|
|
@ -20,7 +20,8 @@ |
|
|
|
<div :class="['line', { active: active == 'dayShift' }]"> |
|
|
|
<p @click="active = 'dayShift'">白天值班:</p> |
|
|
|
<div> |
|
|
|
<p v-for=" item in dayShift" :key="item.id" @click="removeDutyPerson(item)">{{ item.name }}</p> |
|
|
|
<p v-for="(item, index) in dayShift" :key="`${item.id}_${index}`" @click="removeDutyPerson(item)">{{ |
|
|
|
item.name }}</p> |
|
|
|
<div class="no-data" v-if="!dayShift.length">未添加人员</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -28,7 +29,8 @@ |
|
|
|
<div :class="['line', { active: active == 'graveyardShift' }]"> |
|
|
|
<p @click="active = 'graveyardShift'">晚上值班:</p> |
|
|
|
<div> |
|
|
|
<p v-for=" item in graveyardShift" :key="item.id" @click="removeDutyPerson(item)">{{ item.name }}</p> |
|
|
|
<p v-for="(item, index) in graveyardShift" :key="`${index}_${item.id}`" @click="removeDutyPerson(item)">{{ |
|
|
|
item.name }}</p> |
|
|
|
<div class="no-data" v-if="!graveyardShift.length">未添加人员</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -122,8 +124,11 @@ export default { |
|
|
|
immediate: true, |
|
|
|
async handler(bool) { |
|
|
|
if (!bool) return; |
|
|
|
if (!this.data) { |
|
|
|
|
|
|
|
this.dayShift = [...this.data?.dayShift || []]; |
|
|
|
this.graveyardShift = [...this.data?.graveyardShift || []]; |
|
|
|
|
|
|
|
if (!this.data) { |
|
|
|
const result = await getSelectOptionsStation(2); |
|
|
|
|
|
|
|
this.formList[0].options.options = (result || []); |
|
|
@ -131,8 +136,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
this.getPeopleList(this.data.station); |
|
|
|
this.dayShift = [...this.data.dayShift || []]; |
|
|
|
this.graveyardShift = [...this.data.graveyardShift || []]; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -214,6 +217,7 @@ export default { |
|
|
|
if (!this.data) { |
|
|
|
this.updateData(data) |
|
|
|
.then((result) => { |
|
|
|
console.log("%c [ result ]-217-「ModifyDutyInformationTable.vue」", "font-size:15px; background:#335cf6; color:#77a0ff;", result); |
|
|
|
if (result.code != 200) return Message.error("保存失败"); |
|
|
|
|
|
|
|
Message.success("保存成功"); |
|
|
@ -252,7 +256,7 @@ export default { |
|
|
|
]) |
|
|
|
.then(([del, update]) => { |
|
|
|
if (del.status === 'rejected' && update.status === 'rejected') return Message.error("修改失败"); |
|
|
|
if (del.value.code != '200' && update.value.code != '200') return Message.error("修改失败"); |
|
|
|
if (del.value?.code != '200' && update.value?.code != '200') return Message.error("修改失败"); |
|
|
|
|
|
|
|
this.$emit('close') |
|
|
|
}) |
|
|
|