|
@@ -299,31 +299,40 @@ export default defineComponent({
|
|
|
}
|
|
|
const onSave = () => {
|
|
|
ref_form.value.submit().then(() => {
|
|
|
- ElMessageBox.confirm("是否提交?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- state.loadingForm = true
|
|
|
- that.$api.editSeatDutyUnitEdit(Object.assign(state.seatInfo.editDutyInfo.deptForm, {
|
|
|
- dutyUnitPersonList: state.seatInfo.editDutyInfo.tableData.map(v => {
|
|
|
- v.unitId = state.seatInfo.editDutyInfo.deptForm.id
|
|
|
- return v
|
|
|
- }),
|
|
|
- name: store.state.dictionary.deptMap.get(state.seatInfo.editDutyInfo.deptForm.deptId).organizationName
|
|
|
- })).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- onSeatClick(state.currentSeatId)
|
|
|
- initSeat()
|
|
|
- ElMessage.success(res.message)
|
|
|
- } else {
|
|
|
- ElMessage.error(res.message)
|
|
|
- }
|
|
|
- state.loadingForm = false
|
|
|
- }).catch(() => {
|
|
|
- state.loadingForm = false
|
|
|
+ if (state.seatInfo.editDutyInfo.tableData.length > 0) {
|
|
|
+ ElMessageBox.confirm("是否提交?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ state.loadingForm = true
|
|
|
+ that.$api.editSeatDutyUnitEdit(Object.assign(state.seatInfo.editDutyInfo.deptForm, {
|
|
|
+ dutyUnitPersonList: state.seatInfo.editDutyInfo.tableData.map(v => {
|
|
|
+ v.unitId = state.seatInfo.editDutyInfo.deptForm.id
|
|
|
+ return v
|
|
|
+ }),
|
|
|
+ name: store.state.dictionary.deptMap.get(state.seatInfo.editDutyInfo.deptForm.deptId).organizationName
|
|
|
+ })).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ onSeatClick(state.currentSeatId)
|
|
|
+ initSeat()
|
|
|
+ ElMessage.success(res.message)
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.message)
|
|
|
+ }
|
|
|
+ state.loadingForm = false
|
|
|
+ }).catch(() => {
|
|
|
+ state.loadingForm = false
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: '请分配值班人员!',
|
|
|
+ grouping: true,
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
- }).catch(() => {})
|
|
|
+ }
|
|
|
+
|
|
|
}).catch((e) => {
|
|
|
ElMessage({
|
|
|
message: e[0].message,
|