From cb04b8ed8a616c5b9fae9d432c093985b56f044c Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 16 十月 2025 16:55:04 +0800
Subject: [PATCH] 任务导入+翻页修复
---
src/views/flowmgr/exceptiontask.vue | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 205 insertions(+), 18 deletions(-)
diff --git a/src/views/flowmgr/exceptiontask.vue b/src/views/flowmgr/exceptiontask.vue
index cf335f8..7c19c42 100644
--- a/src/views/flowmgr/exceptiontask.vue
+++ b/src/views/flowmgr/exceptiontask.vue
@@ -2,7 +2,7 @@
* @Date: 2025-06-18 09:17:09
* @LastEditors: yangys
* @LastEditTime: 2025-08-13 21:23:34
- * @FilePath: /mdmweb/src/views/tasks/machinereturnfileop.vue
+ * @FilePath: /mdmweb/src/views/tasks/exceptiontask.vue
-->
<template>
<basic-container>
@@ -10,24 +10,31 @@
@search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @selection-change="selectionChange">
<template #menu-left>
- <!--
- <el-button type="primary" plain @click="exportExcel">瀵煎嚭鍒癊XCEL</el-button>
- -->
+
+ <el-button type="primary" :disabled="this.selection.length==0" plain @click="handleDelBatch">鎵归噺鍒犻櫎</el-button>
+
</template>
<template #menu="scope">
<el-button type="primary" text size="default"
- @click.stop="handleStart(scope.row, scope.index)">鍚姩
+ @click.stop="showStartBox(scope.row, scope.index)">鍚姩
</el-button>
<el-button type="primary" text size="default" icon="el-icon-delete" @click.stop="handleDel(scope.row, scope.index)">鍒犻櫎</el-button>
</template>
-
-
+
+ <template slot="errMsg" slot-scope="scope">
+ <avue-text-ellipsis :text="scope.row.errMsg" :height="100">
+ <small slot=""more>...</small>
+ </avue-text-ellipsis>
+ </template>
</avue-crud>
+ <el-dialog title="鍚姩浠诲姟" append-to-body v-model="startBox">
+ <avue-form :option="startOption" v-model="startForm" @submit="handleStart" @reset-change="startCancel"/>
+ </el-dialog>
</basic-container>
</template>
<script>
-import { getList } from '@/api/flowmgr/exceptiontask.js';
+import { getList,queryProgrammer } from '@/api/flowmgr/exceptiontask.js';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import NProgress from 'nprogress';
@@ -73,6 +80,7 @@
},
{
label: '宸ュ簭鍙�',
+ width: 70,
prop: 'processNo'
},
{
@@ -80,8 +88,12 @@
prop: 'processEdition'
},
{
- label: '鍥惧彿鐗堟',
+ label: '鍥剧焊鐗堟',
prop: 'drawingNoEdition'
+ },
+ {
+ label: '璁惧缂栧彿',
+ prop: 'equipmentCode',
},
{
label: '鏈哄簥缂栫爜',
@@ -92,17 +104,51 @@
prop: 'processName',
},
{
- label: '宸ヨ壓鐝',
+ label: '鎵规鍙�',
+ width:85,
prop: 'craftEdition'
},
{
- label: '鍋忕鍗曞彿',
+ label: '涓存椂鏇存敼鍗曞彿',
prop: 'deviation'
+ },
+ {
+ label: '寮傚父绫诲瀷',
+ prop: 'status',
+ width:85,
+ render: ({ row }) => {
+ let txt = '';
+ switch(row.status){
+ case 3:
+ txt = '閲嶅娲惧伐'
+ break;
+ case 4:
+ txt = '楠岃瘉澶辫触'
+ break;
+ case 5:
+ txt = '鍚姩寮傚父'
+ break;
+ default:
+ txt = '';
+ }
+
+ return txt;
+
+ },
+ },
+ {
+ label: '閿欒淇℃伅',
+ prop: 'errMsg',
+ slot: true,
+ showOverflowTooltip:true,
+ width:100,
},
{
label: '鍒涘缓鏃堕棿',
prop: 'createTime',
type: 'datetime',
+ showOverflowTooltip:true,
+ width: 155,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
search: true,
@@ -111,16 +157,116 @@
hide: false,
}
],
- selectedList: [],
- }
+ selection: [],
+ },
+
+ selection: [],
+ startForm:{},
+ startBox:false,
+ startOption:{
+ submitText: "纭鍚姩",
+ emptyText: "鍙栨秷",
+ menuPosition: "right",
+ column: [
+ {
+ label: '闆剁粍浠跺彿',
+ prop: 'drawingNo',
+ type: 'input',
+ disabled:true,
+ span: 12,
+ dataType: 'string',
+ },
+ {
+ label: '宸ュ簭鍙�',
+ prop: 'processNo',
+ type: 'input',
+ disabled:true,
+ span: 12,
+ dataType: 'string',
+ },
+ {
+ label: '宸ュ簭鐗堟',
+ prop: 'processEdition',
+ type: 'input',
+ disabled:true,
+ span: 12,
+ dataType: 'string',
+ },
+ {
+ label: '鏈哄簥缂栫爜',
+ prop: 'machineCode',
+ type: 'input',
+ disabled:true,
+ span: 12,
+ dataType: 'string',
+ },
+ {
+ label: '榛樿宸ヨ壓',
+ prop: 'programmerName',
+ type: 'input',
+ disabled:true,
+ placeholder:'鏃犲尮閰嶄富绠″伐鑹�',
+ span: 10,
+ dataType: 'string',
+ },
+ {
+ label: '涓荤宸ヨ壓',
+ prop: 'producePlanId',
+ type: 'select',
+ clearable:true,
+ remote: true,
+ placeholder:'',
+ span: 14,
+ //value:"1951087994928762880",
+ dicUrl: `/blade-mdm/producedivision/select-programmer?programmer={{key}}`,
+ dicFormatter:(res)=>{
+ return res.data.map(obj => {
+ let item = new Object();
+ item.value = obj.id;
+ item.label = obj.programmerName;
+ item.desc = `涓撲笟缁勯暱锛�${obj.teamLeaderName},鏍″锛�${obj.checkerName},瀹℃牳锛�${obj.seniorName}`
+ return item;
+ }); ;
+ },
+
+ dataType: 'string',
+ }
+ ]
+ },
+
}
},
methods: {
selectionChange (list) {
- this.selectedList = list;
+ this.selection = list;
+
},
-
- handleStart(row,index) {
+ showStartBox(row){
+ this.startForm = row;
+ queryProgrammer(row.drawingNo).then(res=>{
+ console.log(res)
+ if(res.data.code == 200){
+ this.startForm.producePlanId =res.data.data.id;
+ this.startForm.programmerName = res.data.data.programmer;
+ }else{
+ this.$message.warning('鏃犳硶鍖归厤涓荤宸ヨ壓锛岃閫夋嫨銆�')
+ }
+ }).catch(error =>{
+ console.log(error);
+ });
+
+ this.startBox = true;
+
+ },
+ startCancel(){
+ this.startBox = false;
+ },
+ handleStart(row,done) {
+ if(!this.startForm.producePlanId){
+ this.$message.error('鏃犳硶鍖归厤涓荤宸ヨ壓锛岃閫夋嫨銆�');
+ done();
+ return;
+ }
this.$confirm('纭畾瑕佸惎鍔ㄦ淳宸ュ悧锛�', '', {
confirmButtonText: this.$t('submitText'),
cancelButtonText: this.$t('cancelText'),
@@ -130,7 +276,7 @@
axios({
url: '/blade-mdm/flow/task/force-start',
method: 'post',
- params: {id: row.id},
+ params: {id: row.id,producePlanId:this.startForm.producePlanId},
}).then(res => {
this.loading = false;
if(res.data.code == 200){
@@ -138,6 +284,7 @@
type: 'success',
message: '鎿嶄綔鎴愬姛!',
});
+ this.startBox = false;
this.onLoad(this.page,this.query);
}else{
this.$message({
@@ -146,13 +293,15 @@
});
}
- //done();
+ done();
},
error => {
this.loading = false;
+ done();
}
);
}).catch(() => {
+ done();
// this.$message.info('宸插彇娑堟搷浣�');
});
},
@@ -189,6 +338,44 @@
// this.$message.info('宸插彇娑堟搷浣�');
});
},
+ handleDelBatch() {
+ //console.log(this.selection);
+ var ids = this.selection.map(row => row.id).join();
+ //console.log("ids",ids)
+
+ this.$confirm('纭畾瑕佸垹闄ゅ悧锛�', '', {
+ confirmButtonText: this.$t('submitText'),
+ cancelButtonText: this.$t('cancelText'),
+ type: 'warning',
+ }).then(() => {
+ this.loading = true;
+ axios({
+ url: '/blade-mdm/flow/task/remove',
+ method: 'post',
+ params: {ids: ids},
+ }).then(
+ res => {
+ this.loading = false;
+ if(res.data.code == 200){
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ }else{
+ this.$message.error('鎿嶄綔澶辫触!');
+ }
+ this.onLoad(this.page,this.query);
+
+ },
+ error => {
+ this.loading = false;
+ }
+ );
+ }).catch(() => {
+ // this.$message.info('宸插彇娑堟搷浣�');
+ });
+
+ },
searchChange(params, done) {
let data = {}
this.query = params;
--
Gitblit v1.9.3