408249787 2 жил өмнө
parent
commit
11c6a5bc0a

+ 1 - 0
src/views/fill/gather/modules/CreateTaskForm.vue

@@ -209,6 +209,7 @@ export default {
         console.log(values)
         addFillTasks(values).then(res => {
           this.$message.success('创建成功!')
+          this.$router.push('/sb/inspection/fill/task')
           this.handleCancel()
         })
       })

+ 8 - 11
src/views/fill/task/FillGatherTask.vue

@@ -72,14 +72,17 @@
           <template>
             <a @click="handleView(record)">查看</a>
             <operation-button
+              v-show="record.status!== 2"
               @click="handleEdit(record)"
             >填报</operation-button>
             <operation-button
               :type="2"
+              v-show="record.status!== 2"
               title="是否要转派该任务"
               @confirm="handleDispatch(record)"
             >转派</operation-button>
             <operation-button
+              v-show="record.status!== 2"
               :type="2"
               title="是否要延时该任务"
               @confirm="handleOvertime(record)"
@@ -87,12 +90,14 @@
 
             <operation-button
               v-if="record.status===5"
+              v-show="record.status!== 2"
               :type="2"
               title="是否取消暂停要该任务"
               @confirm="handlePause(record)"
             >取消暂停</operation-button>
             <operation-button
               v-else
+              v-show="record.status!== 2"
               :type="2"
               title="是否暂停要该任务"
               @confirm="handlePause(record)"
@@ -232,7 +237,7 @@ export default {
           ...this.queryParam,
           dataScope: {
             sortBy: 'desc',
-            sortName: 'update_time'
+            sortName: 'created_time'
           }
         }
         return getFillGatherTaskPage(Object.assign(parameter, this.queryParam))
@@ -323,16 +328,8 @@ export default {
       modal.base(record)
     },
     handlePause (record) {
-      if (record.status === 5) {
-        this.visible = false
-        const modal = this.$refs.pauseModal
-        modal.base(record)
-        return
-      }
-      pauseFillGatherTask({ pauseType: 1, id: record.id }).then(res => {
-        this.$message.success('暂停成功!')
-        this.handleOk()
-      })
+      const modal = this.$refs.pauseModal
+      modal.base(record)
     },
     handleAdd () {
       this.visible = false

+ 5 - 0
src/views/fill/task/modules/BaseForm.vue

@@ -200,6 +200,11 @@ export default {
           title: ' 延时时长',
           width: 150,
           dataIndex: 'lateHour'
+        },
+        {
+          title: '备注',
+          width: 150,
+          dataIndex: 'remark'
         }
       ]
       // 下拉框map

+ 15 - 2
src/views/fill/task/modules/PauseForm.vue

@@ -1,6 +1,6 @@
 <template>
   <a-modal
-    title="转派"
+    title="暂停"
     :width="800"
     :visible="visible"
     :confirmLoading="confirmLoading"
@@ -11,6 +11,7 @@
         <a-input v-decorator="['id']" type="hidden"/>
       </a-form-item>
       <a-form-item
+        v-if="model.status === 5"
         label="要求时间"
         :labelCol="BaseTool.Constant.labelCol"
         :wrapperCol="BaseTool.Constant.wrapperCol"
@@ -22,6 +23,15 @@
           <span slot="suffix">小时</span>
         </a-input>
       </a-form-item>
+      <a-form-item
+        v-else
+        label="暂停原因"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-textarea
+          v-decorator="['remark', {rules: [{required: true, message: '暂停原因不能为空'}]}]" />
+      </a-form-item>
     </a-form>
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="save()">提交</a-button>
@@ -44,6 +54,7 @@ export default {
       confirmLoading: false,
       form: this.$form.createForm(this),
       visible: false,
+      model: {},
       // 下拉框map
       ipqcMap: {}
     }
@@ -54,6 +65,7 @@ export default {
   methods: {
     base (record) {
       console.log(record)
+      this.model = record
       this.visible = true
       const { form: { setFieldsValue } } = this
       // 日期处理
@@ -77,7 +89,7 @@ export default {
           this.confirmLoading = false
           return
         }
-        values.pauseType = 2
+        values.pauseType = this.model.status === 5 ? 2 : 1
         console.log(values)
         pauseFillGatherTask(values).then(res => {
           this.handleCancel()
@@ -87,6 +99,7 @@ export default {
     },
     handleCancel () {
       this.visible = false
+      this.confirmLoading = false
       this.$emit('ok')
     }