|
|
@@ -1029,7 +1029,7 @@ export default {
|
|
|
id: this.pageParams.id,
|
|
|
pk: this.pageParams.id,
|
|
|
title,
|
|
|
- status: type ? '已发布' : (status || '未发布'),
|
|
|
+ status: type ? '已发布' : '未发布',
|
|
|
startDate: dateRange[0],
|
|
|
endDate: dateRange[1],
|
|
|
type: scheduleType,
|
|
|
@@ -1040,21 +1040,39 @@ export default {
|
|
|
console.log(submitData)
|
|
|
this.loading = true
|
|
|
saveStaffSchedule(submitData).then(() => {
|
|
|
- this.$message.success('保存成功')
|
|
|
- if (type) {
|
|
|
- this.handleSaveNews()
|
|
|
- } else {
|
|
|
- this.loading = false
|
|
|
- this.closeDialog()
|
|
|
- this.$emit('callback')
|
|
|
- }
|
|
|
// 增加一条调班申请记录,用于查看排班管理员修改历史。
|
|
|
- this.submitAdjust(submitData)
|
|
|
+ this.submitAdjust(submitData).then(() => {
|
|
|
+ if (type) { // 提交
|
|
|
+ this.handleSaveNews().then(() => {
|
|
|
+ this.loading = false
|
|
|
+ this.activeStep = 3
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ this.$confirm('退出当前页面?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.closeDialog()
|
|
|
+ this.$emit('callback')
|
|
|
+ }).catch(() => {
|
|
|
+ this.$emit('callback')
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('提交失败')
|
|
|
+ })
|
|
|
+ } else { // 保存
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ this.loading = false
|
|
|
+ // this.closeDialog()
|
|
|
+ this.$emit('callback')
|
|
|
+ }
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
+ this.$message.error('保存失败')
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
- handleSaveNews () {
|
|
|
+ async handleSaveNews () {
|
|
|
this.activeStep = 2
|
|
|
this.$nextTick(async () => {
|
|
|
const element = this.$refs.schedule
|
|
|
@@ -1083,11 +1101,7 @@ export default {
|
|
|
userId: userId,
|
|
|
userName: name
|
|
|
}
|
|
|
- this.$common.saveNews(news).then(() => {
|
|
|
- this.loading = false
|
|
|
- this.closeDialog()
|
|
|
- this.$emit('callback')
|
|
|
- })
|
|
|
+ return this.$common.saveNews(news)
|
|
|
})
|
|
|
},
|
|
|
captureAndUpload (element) {
|
|
|
@@ -1292,7 +1306,7 @@ export default {
|
|
|
return result.join('。')
|
|
|
},
|
|
|
// 提交调班申请数据
|
|
|
- submitAdjust (submitData) {
|
|
|
+ async submitAdjust (submitData) {
|
|
|
let overView = ''
|
|
|
if (submitData.id) {
|
|
|
overView = this.getOverViews(this.responseData || null, submitData.staffScheduleDetailPoList)
|
|
|
@@ -1310,7 +1324,7 @@ export default {
|
|
|
updateTime: Date.now(),
|
|
|
adjustmentDetailPoList: []
|
|
|
}
|
|
|
- saveAdjustment(adjustData)
|
|
|
+ await saveAdjustment(adjustData)
|
|
|
},
|
|
|
closeDialog () {
|
|
|
this.$emit('close', false)
|