zhonghuizhen 1 год назад
Родитель
Сommit
eee22fbd15

+ 2 - 2
src/views/business/​scheduleManage/components/config-list.vue

@@ -104,10 +104,10 @@ export default {
                 columns: [
                 columns: [
                     { prop: 'name', label: '配置名称', width: 150 },
                     { prop: 'name', label: '配置名称', width: 150 },
                     { prop: 'scheduleType', label: '排班类型', tags: scheduleType, width: 100, sortable: 'custom' },
                     { prop: 'scheduleType', label: '排班类型', tags: scheduleType, width: 100, sortable: 'custom' },
-                    { prop: 'isEffective', label: '是否生效', slotName: 'isEffective', width: 100 },
+                    { prop: 'isEffective', label: '是否生效', slotName: 'isEffective', width: 85, align: 'center' },
                     { prop: 'approver', label: '调班审批人', tags: userOption, dataType: 'stringArray', minWidth: 140 },
                     { prop: 'approver', label: '调班审批人', tags: userOption, dataType: 'stringArray', minWidth: 140 },
                     { prop: 'createBy', label: '创建人', tags: userOption, width: 90 },
                     { prop: 'createBy', label: '创建人', tags: userOption, width: 90 },
-                    { prop: 'createTime', label: '创建时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 }
+                    { prop: 'createTime', label: '创建时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 120 }
                 ],
                 ],
                 rowHandle: {
                 rowHandle: {
                     effect: 'display',
                     effect: 'display',

+ 1 - 0
src/views/business/​scheduleManage/components/config.vue

@@ -93,6 +93,7 @@
                                     v-model="formData.scheduleStaff"
                                     v-model="formData.scheduleStaff"
                                     :options="getCascaderOptions()"
                                     :options="getCascaderOptions()"
                                     :show-all-levels="false"
                                     :show-all-levels="false"
+                                    style="width: 100%;"
                                     clearable
                                     clearable
                                     :props="{
                                     :props="{
                                         value: 'value',
                                         value: 'value',

+ 46 - 5
src/views/business/​scheduleManage/components/record.vue

@@ -20,10 +20,22 @@
                 placement="top"
                 placement="top"
             >
             >
                 <el-card class="card">
                 <el-card class="card">
-                    <div class="applicant">申请人:{{ item.creator }}</div>
-                    <div class="reason">原因:{{ item.reason }}</div>
-                    <div class="detail">详情:{{ item.overview }}</div>
-                    <div class="approve">通过时间:{{ item.updateTime }}</div>
+                    <div class="applicant">
+                        <span class="leftText">申请人:</span>
+                        <span class="rightText">{{item.creator }}</span>
+                    </div>
+                    <div class="reason">
+                        <span class="leftText">原因:</span>
+                        <span class="rightText">{{item.reason }}</span>
+                    </div>
+                    <div class="detail">
+                        <span class="leftText">详情:</span>
+                        <span class="rightText">{{item.overview }}</span>
+                    </div>
+                    <div class="approve">
+                        <span class="leftText">通过时间:</span>
+                        <span class="rightText">{{item.updateTime }}</span>
+                    </div>
                 </el-card>
                 </el-card>
             </el-timeline-item>
             </el-timeline-item>
         </el-timeline>
         </el-timeline>
@@ -140,14 +152,43 @@ export default {
                     &:first_child {
                     &:first_child {
                         margin-top: 0;
                         margin-top: 0;
                     }
                     }
+
                 }
                 }
             }
             }
-            .applicant, .reason, .detail {
+            .applicant, .reason, .detail{
                 line-height: 1.5;
                 line-height: 1.5;
+                display: flex;
+                flex-direction: row;
+                //align-items: flex-start;
+                justify-content: flex-start;
+                .leftText{
+                    text-align: right;
+                    flex:0 1 20%
+                }
+                .rightText{
+                    margin-left: 0.5em;
+                    flex:0 1 80%;
+                    text-align: left;
+                }
             }
             }
             .detail {
             .detail {
                 white-space: pre-wrap;
                 white-space: pre-wrap;
             }
             }
+            .approve{
+                line-height: 1.5;
+                display: flex;
+                flex-direction: row;
+                justify-content: flex-start;
+                .leftText{
+                    text-align: right;
+                    flex:0 1 20%
+                }
+                .rightText{
+                    margin-left: 0.5em;
+                    flex:0 1 80%;
+                    text-align: left;
+                }
+            }
         }
         }
     }
     }
 </style>
 </style>

+ 32 - 18
src/views/business/​scheduleManage/edit.vue

@@ -1029,7 +1029,7 @@ export default {
                 id: this.pageParams.id,
                 id: this.pageParams.id,
                 pk: this.pageParams.id,
                 pk: this.pageParams.id,
                 title,
                 title,
-                status: type ? '已发布' : (status || '未发布'),
+                status: type ? '已发布' : '未发布',
                 startDate: dateRange[0],
                 startDate: dateRange[0],
                 endDate: dateRange[1],
                 endDate: dateRange[1],
                 type: scheduleType,
                 type: scheduleType,
@@ -1040,21 +1040,39 @@ export default {
             console.log(submitData)
             console.log(submitData)
             this.loading = true
             this.loading = true
             saveStaffSchedule(submitData).then(() => {
             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(() => {
             }).catch(() => {
+                this.$message.error('保存失败')
                 this.loading = false
                 this.loading = false
             })
             })
         },
         },
-        handleSaveNews () {
+        async handleSaveNews () {
             this.activeStep = 2
             this.activeStep = 2
             this.$nextTick(async () => {
             this.$nextTick(async () => {
                 const element = this.$refs.schedule
                 const element = this.$refs.schedule
@@ -1083,11 +1101,7 @@ export default {
                     userId: userId,
                     userId: userId,
                     userName: name
                     userName: name
                 }
                 }
-                this.$common.saveNews(news).then(() => {
-                    this.loading = false
-                    this.closeDialog()
-                    this.$emit('callback')
-                })
+                return this.$common.saveNews(news)
             })
             })
         },
         },
         captureAndUpload (element) {
         captureAndUpload (element) {
@@ -1292,7 +1306,7 @@ export default {
             return result.join('。')
             return result.join('。')
         },
         },
         // 提交调班申请数据
         // 提交调班申请数据
-        submitAdjust (submitData) {
+        async submitAdjust (submitData) {
             let overView = ''
             let overView = ''
             if (submitData.id) {
             if (submitData.id) {
                 overView = this.getOverViews(this.responseData || null, submitData.staffScheduleDetailPoList)
                 overView = this.getOverViews(this.responseData || null, submitData.staffScheduleDetailPoList)
@@ -1310,7 +1324,7 @@ export default {
                 updateTime: Date.now(),
                 updateTime: Date.now(),
                 adjustmentDetailPoList: []
                 adjustmentDetailPoList: []
             }
             }
-            saveAdjustment(adjustData)
+            await saveAdjustment(adjustData)
         },
         },
         closeDialog () {
         closeDialog () {
             this.$emit('close', false)
             this.$emit('close', false)