|
@@ -2,66 +2,42 @@
|
|
|
<div class="__normal-page">
|
|
|
<div class="__normal-content">
|
|
|
<div class="seat">
|
|
|
- <div class="seat-filter">
|
|
|
+ <div class="seat-filter" v-loading="loadingDuty">
|
|
|
<CusForm>
|
|
|
<CusFormColumn
|
|
|
:span="8"
|
|
|
label="值班厅领导"
|
|
|
link="select"
|
|
|
- static
|
|
|
- v-model:param="queryForm.shipId"
|
|
|
- labelKey="label"
|
|
|
- valueKey="value"
|
|
|
+ v-model:param="dutyForm.dutyHallLeader"
|
|
|
:clearable="false"
|
|
|
- :options="[
|
|
|
- {label: '类型一', value: '1'},
|
|
|
- {label: '类型二', value: '2'},
|
|
|
- {label: '类型三', value: '3'},
|
|
|
- ]"/>
|
|
|
+ :options="$store.state.dictionary.dutyHallLeaderList"
|
|
|
+ @change="setDuty"/>
|
|
|
<CusFormColumn
|
|
|
:span="8"
|
|
|
label="总值班"
|
|
|
link="select"
|
|
|
- static
|
|
|
- v-model:param="queryForm.shipId"
|
|
|
- labelKey="label"
|
|
|
- valueKey="value"
|
|
|
+ v-model:param="dutyForm.totalClass"
|
|
|
:clearable="false"
|
|
|
- :options="[
|
|
|
- {label: '类型一', value: '1'},
|
|
|
- {label: '类型二', value: '2'},
|
|
|
- {label: '类型三', value: '3'},
|
|
|
- ]"/>
|
|
|
+ :options="$store.state.dictionary.totalClassList"
|
|
|
+ @change="setDuty"/>
|
|
|
<CusFormColumn
|
|
|
:span="8"
|
|
|
label="带班领导"
|
|
|
link="select"
|
|
|
- static
|
|
|
- v-model:param="queryForm.shipId"
|
|
|
- labelKey="label"
|
|
|
- valueKey="value"
|
|
|
+ v-model:param="dutyForm.shiftLeader"
|
|
|
:clearable="false"
|
|
|
- :options="[
|
|
|
- {label: '类型一', value: '1'},
|
|
|
- {label: '类型二', value: '2'},
|
|
|
- {label: '类型三', value: '3'},
|
|
|
- ]"/>
|
|
|
+ :options="$store.state.dictionary.shiftLeaderList"
|
|
|
+ @change="setDuty"/>
|
|
|
<CusFormColumn
|
|
|
:span="24"
|
|
|
label="值班员"
|
|
|
link="select"
|
|
|
- static
|
|
|
- v-model:param="queryForm.shipId2"
|
|
|
- labelKey="label"
|
|
|
- valueKey="value"
|
|
|
+ v-model:param="dutyForm.dutyPerson"
|
|
|
multiple
|
|
|
:clearable="false"
|
|
|
:filterable="false"
|
|
|
- :options="[
|
|
|
- {label: '类型一', value: '1'},
|
|
|
- {label: '类型二', value: '2'},
|
|
|
- {label: '类型三', value: '3'},
|
|
|
- ]"/>
|
|
|
+ :options="$store.state.dictionary.dutyPersonList"
|
|
|
+ @change="setDuty"/>
|
|
|
</CusForm>
|
|
|
</div>
|
|
|
<div class="seat-position">
|
|
@@ -177,6 +153,8 @@ import {
|
|
|
import {useStore} from 'vuex'
|
|
|
import {useRouter, useRoute} from 'vue-router'
|
|
|
import PeopleCom from './people.vue'
|
|
|
+import {getSeatDutyPersonEdit} from "@/api/modules/seat";
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: '',
|
|
@@ -189,7 +167,8 @@ export default defineComponent({
|
|
|
const route = useRoute();
|
|
|
const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
|
|
|
const state = reactive({
|
|
|
- queryForm: {},
|
|
|
+ dutyForm: {},
|
|
|
+ loadingDuty: false,
|
|
|
seatList: [],
|
|
|
currentSeat: {},
|
|
|
dutyInfo: {
|
|
@@ -278,7 +257,48 @@ export default defineComponent({
|
|
|
state.transfer = JSON.parse(JSON.stringify(state.currentSeat))
|
|
|
state.showPeople = true
|
|
|
}
|
|
|
+ // 获取字典
|
|
|
+ const initDictionary = () => {
|
|
|
+ store.dispatch('dictionary/LOAD_DICT_LIST', 'duty_hall_leader')
|
|
|
+ store.dispatch('dictionary/LOAD_DICT_LIST', 'total_class')
|
|
|
+ store.dispatch('dictionary/LOAD_DICT_LIST', 'shift_leader')
|
|
|
+ store.dispatch('dictionary/LOAD_DICT_LIST', 'duty_person')
|
|
|
+ }
|
|
|
+ const initDuty = () => {
|
|
|
+ state.dutyForm.dutyHallLeader = store.state.app.dutyInfo?.dutyHallLeader || ''
|
|
|
+ state.dutyForm.totalClass = store.state.app.dutyInfo?.totalClass || ''
|
|
|
+ state.dutyForm.shiftLeader = store.state.app.dutyInfo?.shiftLeader || ''
|
|
|
+ state.dutyForm.dutyPerson = store.state.app.dutyInfo?.dutyPerson ? store.state.app.dutyInfo?.dutyPerson.split(',') : []
|
|
|
+ }
|
|
|
+ const setDuty = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ state.loadingDuty = true
|
|
|
+ const params = {
|
|
|
+ id: store.state.app.dutyInfo?.id || null,
|
|
|
+ dutyHallLeader: state.dutyForm.dutyHallLeader || '',
|
|
|
+ totalClass: state.dutyForm.totalClass || '',
|
|
|
+ shiftLeader: state.dutyForm.shiftLeader || '',
|
|
|
+ dutyPerson: state.dutyForm.dutyPerson.join(',') || ''
|
|
|
+ }
|
|
|
+ that.$api.getSeatDutyPersonEdit(params).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ store.dispatch('app/LOAD_DUTY_INFO')
|
|
|
+ ElMessage.success(res.message)
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.message)
|
|
|
+ }
|
|
|
+ state.loadingDuty = false
|
|
|
+ }).catch(() => {
|
|
|
+ state.loadingDuty = false
|
|
|
+ })
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+ watch(() => store.state.app.dutyInfo, () => {
|
|
|
+ initDuty()
|
|
|
+ })
|
|
|
onMounted(() => {
|
|
|
+ initDuty()
|
|
|
+ initDictionary()
|
|
|
handleSearch()
|
|
|
})
|
|
|
return {
|
|
@@ -286,7 +306,8 @@ export default defineComponent({
|
|
|
handlePage,
|
|
|
onEdit,
|
|
|
onEditCancel,
|
|
|
- addPeople
|
|
|
+ addPeople,
|
|
|
+ setDuty
|
|
|
}
|
|
|
},
|
|
|
})
|