Sfoglia il codice sorgente

已完成工单撤回

damon227 9 mesi fa
parent
commit
d2c3781941
2 ha cambiato i file con 71 aggiunte e 5 eliminazioni
  1. 9 0
      src/api/task.js
  2. 62 5
      src/views/modules/works/work.vue

+ 9 - 0
src/api/task.js

@@ -158,3 +158,12 @@ export function getWorkStatDetail (params) {
     params: params
   })
 }
+
+// 批量撤回
+export function revokeBatch (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/WorkController/revokeBatch`),
+    method: 'post',
+    data
+  })
+}

+ 62 - 5
src/views/modules/works/work.vue

@@ -248,6 +248,15 @@
             @click="submitTask(scope.row.nodeId, scope.row.productionId, scope.row.taskId)"
             >提审理单</el-button
           >
+          <el-button
+            v-if="
+              Number(scope.row.state) === 3
+            "
+            type="text"
+            size="small"
+            @click="revokeBatchTask(scope.row.taskIds)"
+            >撤回</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
@@ -519,6 +528,18 @@
     <!-- 文件预览 -->
     <preview-component v-if="previewVisible" ref="preview" />
     <attach-detail-dialog ref="attachDetail"/>
+
+    <el-dialog title="撤回" :visible.sync="revokeBatchDialogFormVisible">
+      <el-form :model="revokeBatchForm">
+        <el-form-item label="数量">
+          <el-input-number v-model="revokeBatchForm.number" :min="1" :max="revokeBatchForm.maxNumber"></el-input-number>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="revokeBatchDialogFormVisible = false">取 消</el-button>
+        <el-button type="primary" @click="revokeBatchHandle">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -535,7 +556,8 @@ import {
   batchStart,
   batchCheckTask,
   batchCompleteTask,
-  submitTask
+  submitTask,
+  revokeBatch
 } from '@/api/task'
 import { workTypeMasterList } from '@/api/worktype'
 import templateList from '../warehouse/template-list'
@@ -556,13 +578,12 @@ export default {
   },
   watch: {
     'dataForm.userId' (value) {
-      this.opColVisible =
-        Number(this.dataForm.state) !== 3 && value === this.userId
+      this.opColVisible = value === this.userId
     },
     'dataForm.state' (value) {
       this.opColVisible = this.dataForm.userId
-        ? Number(value) !== 3 && this.dataForm.userId === this.userId
-        : Number(value) !== 3
+        ? this.dataForm.userId === this.userId
+        : true
     }
   },
   data () {
@@ -674,6 +695,12 @@ export default {
           { required: true, message: '完成记录说明不能为空', trigger: 'blur' }
         ],
         disqualificationNodeId: [{ required: true, message: '请选择', trigger: 'blur' }]
+      },
+      revokeBatchDialogFormVisible: false,
+      revokeBatchForm: {
+        taskIds: '',
+        maxNumber: 0,
+        number: 0
       }
     }
   },
@@ -1079,6 +1106,32 @@ export default {
           })
         }
       })
+    },
+    // 批量撤回
+    revokeBatchTask (taskIds) {
+      this.revokeBatchDialogFormVisible = true
+      this.revokeBatchForm.taskIds = taskIds
+      this.revokeBatchForm.number = this.revokeBatchForm.maxNumber = taskIds.length
+    },
+    revokeBatchHandle () {
+      let data = {
+        taskIds: this.revokeBatchForm.taskIds.slice(0, this.revokeBatchForm.number)
+      }
+      revokeBatch(data).then(({ data }) => {
+        if (data && data.code === '200') {
+          this.$message({
+            type: 'success',
+            message: '操作成功!'
+          })
+          this.revokeBatchDialogFormVisible = false
+          this.getDataList()
+        } else {
+          this.$message({
+            type: 'error',
+            message: data.msg
+          })
+        }
+      })
     }
   }
 }
@@ -1088,4 +1141,8 @@ export default {
 /deep/ .el-tabs .el-tabs__header {
   margin: 0;
 }
+
+/deep/ .dialog-footer {
+  position: inherit;
+}
 </style>