From 9cffbeacee5a22bb49fee77700c8fe1ba0f51c29 Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Tue, 9 Jan 2024 19:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/aftersales/aftersalesWorkOrder.js | 9 + src/option/aftersales/vueTvemp.js | 6 +- src/views/aftersales/aftersalesWorkOrder.vue | 253 +++++++++++-------- 3 files changed, 165 insertions(+), 103 deletions(-) diff --git a/src/api/aftersales/aftersalesWorkOrder.js b/src/api/aftersales/aftersalesWorkOrder.js index 5eb6a6a7..d03b0a44 100644 --- a/src/api/aftersales/aftersalesWorkOrder.js +++ b/src/api/aftersales/aftersalesWorkOrder.js @@ -389,4 +389,13 @@ export const $_updateManagerConfirmed = (data) => { method: 'put', data }) +} + +// 申诉回显 +export const $_AppealDetails = (params) => { + return request({ + url: '/api/logpm-aftersales/aftersalesAppeal/detail', + method: 'get', + params + }) } \ No newline at end of file diff --git a/src/option/aftersales/vueTvemp.js b/src/option/aftersales/vueTvemp.js index e643f2d8..a251c904 100644 --- a/src/option/aftersales/vueTvemp.js +++ b/src/option/aftersales/vueTvemp.js @@ -404,7 +404,7 @@ export const Claimsfield = [ }, { prop: 'workOrderNumber', - label: '工单号', + label: '异常工单号', type: 2, values: '', width: '130', @@ -679,7 +679,7 @@ export const AppealList = [ { prop: 'workOrderNumber', - label: '工单号', + label: '异常工单号', type: 2, values: '', width: '130', @@ -777,7 +777,7 @@ export const timeoutList = [ { prop: 'workOrderNumber', - label: '工单号', + label: '异常工单号', type: 2, values: '', width: '130', diff --git a/src/views/aftersales/aftersalesWorkOrder.vue b/src/views/aftersales/aftersalesWorkOrder.vue index 7fa2b891..38c41849 100644 --- a/src/views/aftersales/aftersalesWorkOrder.vue +++ b/src/views/aftersales/aftersalesWorkOrder.vue @@ -125,6 +125,7 @@ 申诉 + @@ -148,6 +149,7 @@ :columnList="publicColumnList" :tableData="data" :loading="loadingObj.list" + :checkselect="selectList" @inputTxt="inputsc" @timeCheck="timesc" @btnCheck="btnsc" @@ -170,7 +172,7 @@
查看 @@ -183,17 +185,19 @@ 申诉 + 编辑 + 取消取消申诉 - @@ -368,33 +372,28 @@
- - - -
- -
- -
+ + + + +
+ +
-
- -
+
-
- -
+
移除 @@ -445,20 +444,22 @@
- - - + + + + + { item => item.dictValue == JSON.parse(localStorage.getItem('TWMS-userInfo')).content.role_name ); if (matchingItem) { - console.log(TabList.value,'导航'); + console.log(TabList.value, '导航'); UserPermissions.value = matchingItem.dictValue; - console.log(matchingItem.dictValue,'角色'); - if(matchingItem.dictValue!='仓库客服'){ - TabList.value[2].state=false - }else{ - TabList.value[2].state=true + console.log(matchingItem.dictValue, '角色'); + if (matchingItem.dictValue != '仓库客服') { + TabList.value[2].state = false; + } else { + TabList.value[2].state = true; } - } else { - TabList.value[2].state=true + TabList.value[2].state = true; UserPermissions.value = '仓库客服'; } console.log(UserPermissions.value, '当前角色权限'); @@ -1342,14 +1346,13 @@ const view = val => { businessId: val.row.businessId, ProcessType: TabPermissions.value == 2 ? '2' : TabPermissions.value == 3 ? '1' : '', //类型 1 待处理 2 已处理 RouteIndexs: TabPermissions.value, //当前记录参数 - }, }); }; // 申诉列表编辑 -const Appealeditor = (val) => { -// 编辑信息 +const Appealeditor = val => { + // 编辑信息 $router.push({ path: '/aftersales/aftersalesWorkOrdermodify', query: { @@ -1359,12 +1362,11 @@ const Appealeditor = (val) => { warehouseId: val.row.warehouseId, workOrderNumber: val.row.workOrderNumber, RouterState: 'Kfend', - Appealeditor: 'appeal',//申诉编辑 + Appealeditor: 'appeal', //申诉编辑 }, }); }; - // 首页删除 const ViewDelete = val => { ElMessageBox.confirm(`是否删除该条数据?`) @@ -1455,26 +1457,65 @@ const AppealAttachmentImgSuccess = val => { console.log(val, '申诉图片上传成功'); }; // 工单申诉按钮 -const appeal = val => { - console.log(details.selectionList, 'details.selectionList'); - if (!details.selectionList.length) { - ElMessage({ - message: '请选择要申诉的数据', - type: 'warning', - }); +const appeal = (val, state) => { + console.log(state); + console.log(val.row, '申诉当前点击的按钮'); + if (state == 'edit') { + // 当前是编辑申诉 + + details.selectionList.push(val.row); + AppealeditorState.value = true; //开启申诉编辑状态 + if(val.row) { + selectList.value.push(val.row) + } + + let data={ + id:val.row.id, + } + $_AppealDetails(data).then(res=>{ + console.log(res,'申诉编辑回显'); + Reasonforappeal.value = res.data.data.reason;//申诉原因 + setTimeout(()=>{ + console.log(res.data.data.peopleEntityList.map(item=>item.actualPersonId)); + console.log(warehouseData.value,'仓库数据'); + // Appealselection.value= + dialogappeal.value = true; //展开申诉编辑 + },0) + + }) return; } - if (details.selectionList.length > 1) { - ElMessage({ - message: '只能单条申诉', - type: 'warning', - }); - return; + + if (!state) { + // 单条申诉 + AppealeditorState.value = false; //开启申诉编辑状态 + if(val.row){ + details.selectionList.push(val.row); + } + + dialogappeal.value = true; //展开申诉弹窗 + } else { + // 批量申诉 + console.log(details.selectionList, 'details.selectionList'); + if (!details.selectionList.length) { + ElMessage({ + message: '请选择要申诉的数据', + type: 'warning', + }); + return; + } + if (details.selectionList.length > 1) { + ElMessage({ + message: '只能单条申诉', + type: 'warning', + }); + return; + } + dialogappeal.value = true; //展开申诉弹窗 } - dialogappeal.value = true; //展开申诉弹窗 }; // 工单申诉确认按钮 -const Appealbutton = () => { +const Appealbutton = state => { if (AppealAttachment.value.length > 1) { ElMessage({ message: '只能上传一张图片', @@ -1482,6 +1523,7 @@ const Appealbutton = () => { }); return; } + // appealData.value单条申诉点击变量暂未启用 console.log(details.selectionList, '当前申诉的东西'); loadingappeal.value = true; //开启加载效果 console.log(Appealselection.value, '当前选择的责任人'); @@ -1490,34 +1532,40 @@ const Appealbutton = () => { peopleEntityList: [], //参数一 imagePath: '', //申诉图片附件 }; - data.workOrderId = details.selectionList[0].lawoId; + data.workOrderId = details.selectionList[0].id; data.reason = Reasonforappeal.value; - data.appealPeopleName = warehouseData.value .filter(item => Appealselection.value.includes(item.value)) .map(item => item.label) .join(','); //实际责任人名称 + //如果为编辑状态追加ID字段 + console.log(AppealeditorState.value,'申诉状态'); + if (AppealeditorState.value) { + data.id = details.selectionList[0].id; + } + console.log(details.selectionList,'准备处理的数据'); details.selectionList.forEach(item => { - console.log(item.id); console.log(item, '已经选择的列表'); data['peopleEntityList'].push({ workOrderId: item.id, //异常工单ID warehouseId: item.warehouseId == '/' ? '' : item.warehouseId, reason: Reasonforappeal.value, //申诉理由 claimant: userInfo.value.content.user_name, //申诉人 - claimantUserId: userInfo.value.content.user_id, //申诉人ID + actualPersonId: warehouseData.value + .filter(item => Appealselection.value.includes(item.value)) + .map(item => item.value) + .join(','), //实际责任人ID actualPersonName: warehouseData.value .filter(item => Appealselection.value.includes(item.value)) .map(item => item.label) .join(','), //实际责任人名称 }); }); - if(AppealAttachment.value.length){ + if (AppealAttachment.value.length) { data.imagePath = AppealAttachment.value[0].response.data.link; //申诉图片 } - - console.log(data, '处理好的值'); + console.log(data, '处理好的值'); $_appealSubmit(data).then(res => { dialogappeal.value = false; //关闭申诉弹窗 loadingappeal.value = false; //关闭加载效果 @@ -1527,6 +1575,8 @@ const Appealbutton = () => { details.query.workOrderStatus = 30; ArbitrationStatus.value = false; //不可以申请仲裁 tabValue.value = 2; + AppealeditorState.value = false; //关闭编辑状态 + appealData.value = {}; //清空当前行申诉数据 empty(); //清空搜索数据 IndexTable({ workOrderStatus: 30 }); if (res.data.code == 200) { @@ -1538,8 +1588,6 @@ const Appealbutton = () => { }); }; - - // 异常类型事件 const abnormalChange = val => { console.log(val); @@ -1872,20 +1920,18 @@ const appealFn = val => { $_listAppeal(data).then(res => { details.loadingObj.list = false; //开启动画加载 console.log(res, '申诉列表返回值'); - - if(res.data.data.records.length){ + + if (res.data.data.records.length) { details.data = res.data.data.records; - }else{ - details.data=[{}] + } else { + details.data = [{}]; } page.value.total = res.data.data.total; - }); }; // 申诉列表 const AppealTab = val => { - if (val == 0) { AppealStatusT.value = false; //申诉列表关闭 Tableheaderswitching(columnList); //切换表头 @@ -2049,12 +2095,12 @@ const tabChenge = val => { } else if (val == 8) { // 待回复按钮 console.log('待回复'); - if(UserPermissions.value=='仓库客服'){ - data.workOrderStatus = ''; - details.query.workOrderStatus = ''; - Tableheaderswitching(columnList); - empty(); - ProcessingPartyFun(data); + if (UserPermissions.value == '仓库客服') { + data.workOrderStatus = ''; + details.query.workOrderStatus = ''; + Tableheaderswitching(columnList); + empty(); + ProcessingPartyFun(data); } } }; @@ -2271,7 +2317,7 @@ const DetermineStorage = val => { let ID = {}; ID = val.row.id; data['assignList'].push(ID); - if(TabPermissions.value=='6'){ + if (TabPermissions.value == '6') { $_updateManagerConfirmed(data).then(res => { if (res.data.code == 200) { ElMessage({ @@ -2284,7 +2330,7 @@ const DetermineStorage = val => { // 赔款方 console.log(data, '处理好的值'); } - if(TabPermissions.value=='2'){ + if (TabPermissions.value == '2') { console.log(data, '处理好的数据'); $_updateWorkOrderStatus(data).then(res => { console.log(res, '确定提交存储'); @@ -2492,7 +2538,15 @@ const AddCompensation = () => { som++; } }); - CompensationParty.value.push({ name: '', state: 0, num: 0, reason: '', cld: som ,warehouseId:'',personResponsibleName:''}); + CompensationParty.value.push({ + name: '', + state: 0, + num: 0, + reason: '', + cld: som, + warehouseId: '', + personResponsibleName: '', + }); }; // 添加受款方 const AddPayee = () => { @@ -2566,7 +2620,6 @@ const Batchcompletion = () => { // 批量提交 const CompletedSubmission = () => { - PLloading.value = true; //开启处理加载效果 console.log(CompensationParty.value); let pay = CompensationParty.value.find(item => item.cld == 1); @@ -2606,8 +2659,8 @@ const CompletedSubmission = () => { money: Number(party.num), reasonArbitration: Reasonarbitration.value, // workOrderId: selection.id, - warehouseId: party.warehouseId,//仓库 - personResponsibleName:party.personResponsibleName + warehouseId: party.warehouseId, //仓库 + personResponsibleName: party.personResponsibleName, }; // 将赔款方信息添加到对应的completionRecordEntities数组中 data[index].completionRecordEntities.push(record);