| 
					
				 | 
			
			
				@@ -67,8 +67,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         width="150" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         label="操作"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template slot-scope="scope"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-button v-if="isAuth('work:clt:start')" type="text" size="small" @click="startTask(scope.row.taskId)">开始</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <el-button v-if="isAuth('work:clt:complete')" type="text" size="small" @click="transferTask(scope.row.taskId)">移交</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button v-if="isAuth('work:clt:start') && (scope.row.state == 0 || scope.row.state == 1)" :disabled="scope.row.state == 0" type="text" size="small" @click="startTask(scope.row.taskId)">开始</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button v-if="isAuth('work:clt:complete') && scope.row.state != 3" type="text" size="small" @click="transferTask(scope.row.taskId, scope.row.workTypeId)">移交</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button v-if="isAuth('work:clt:complete') && scope.row.state == 2 && (scope.row.type == null || scope.row.type == 1)" type="text" size="small" @click="completeTask(scope.row.taskId)">完成</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-button v-if="isAuth('work:clt:complete') && scope.row.state == 2 && (scope.row.type == 2 || scope.row.type == 3)" type="text" size="small" @click="checkTask(scope.row.taskId)">检验</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </el-table> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -81,17 +83,63 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       :total="totalPage" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       layout="total, sizes, prev, pager, next, jumper"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </el-pagination> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <el-dialog title="移交任务" width="30%" :visible.sync="transferDialogFormVisible"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-form :model="transferDialogForm" :rules="transferDialogFormRules" ref="transferDialogForm"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-form-item label="检验类型" prop="checkType" label-width="120px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           <el-select v-model="transferDialogForm.checkType" placeholder="请选择检验类型"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-option label="通过" value="1"></el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-option label="不通过" value="2"></el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-form-item label="移交用户" prop="transferUserId" label-width="120px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-select v-model="transferDialogForm.transferUserId" placeholder="请选择移交用户"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           <el-option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            v-for="item in transferUserList" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :key="item.userId" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :label="item.name" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :value="item.userId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </el-form> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div slot="footer" class="dialog-footer"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-button @click="transferDialogFormVisible = false">取 消</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-button type="primary" @click="transferSubmit">确 定</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </el-dialog> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <el-dialog title="检验任务" width="30%" :visible.sync="checkDialogFormVisible"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <el-form :model="checkDialogForm" :rules="checkDialogFormRules" ref="checkDialogForm"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-form-item label="检验类型" prop="checkType" label-width="80px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+           <el-select v-model="checkDialogForm.checkType" placeholder="请选择检验类型" style="width:100%"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-option label="通过" value="1"></el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-option label="不通过" value="2"></el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-form-item label="备注" prop="notes" label-width="80px"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-input v-model="checkDialogForm.notes" type="textarea" :rows="2" placeholder="请输入备注"></el-input> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </el-form-item> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </el-form> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div slot="footer" class="dialog-footer"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-button @click="checkDialogFormVisible = false">取 消</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <el-button type="primary" @click="checkSubmit">确 定</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </el-dialog> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  import { getTaskList } from '@/api/task' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { getTaskList, startTask, transferTask, completeTask, checkTask } from '@/api/task' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import { workTypeMasterList } from '@/api/worktype' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     name: 'work', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     data () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         addOrUpdateVisible: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        dataForm: {}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dataForm: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          state: '1' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         dataList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         pageIndex: 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         pageSize: 10, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -108,7 +156,19 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             code: '3', value: '已完成' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        transferDialogFormVisible: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        transferDialogForm: {}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        transferUserList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        transferDialogFormRules: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          checkType: [{required: true, message: '请选择检验类型', trigger: 'blur'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          transferUserId: [{required: true, message: '请选择移交用户', trigger: 'blur'}] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        checkDialogFormVisible: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        checkDialogForm: {}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        checkDialogFormRules: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          checkType: [{required: true, message: '请选择检验类型', trigger: 'blur'}], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     created () { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -156,11 +216,120 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 开始 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       startTask (taskId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm('是否开始任务?', '提示', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          confirmButtonText: '确定', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          cancelButtonText: '取消', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          type: 'warning' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          startTask({taskId}).then(({data}) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(data && data.code === '200'){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                type: 'success', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                message: '操作成功!' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.getDataList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                message: data.msg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).catch(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type: 'info', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            message: '已取消' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          });          
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 移交 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      transferTask (taskId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // todo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      transferTask (taskId, workTypeId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.transferDialogFormVisible = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.transferDialogForm.taskId = taskId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        workTypeMasterList(workTypeId).then(({data}) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if(data && data.code === '200') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.transferUserList = data.data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 确认移交 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      transferSubmit() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$refs['transferDialogForm'].validate((valid) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if(valid){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            transferTask(this.transferDialogForm).then(({data}) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if(data && data.code === '200'){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  type: 'success', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  message: '移交成功!' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.transferDialogFormVisible = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.getDataList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  message: data.msg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 完成 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      completeTask(taskId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$confirm('是否完成任务?', '提示', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          confirmButtonText: '确定', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          cancelButtonText: '取消', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          type: 'warning' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          completeTask({taskId}).then(({data}) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(data && data.code === '200'){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                type: 'success', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                message: '操作成功!' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              this.getDataList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+               this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                message: data.msg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }).catch(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type: 'info', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            message: '已取消' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          })          
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 检验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      checkTask(taskId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.checkDialogFormVisible = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.checkDialogForm.taskId = taskId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 确认检验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      checkSubmit(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$refs['checkDialogForm'].validate((valid) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if(valid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let submitData = this.checkDialogForm; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            checkTask(submitData).then(({data}) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              if(data && data.code === '200') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  type: 'success', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  message: '移交成功!' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.checkDialogFormVisible = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.getDataList() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  this.$message({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  type: 'error', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  message: data.msg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 |