From cd6c1593614f34dca08abda4c3a322e3ca17ea4c Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 23 Oct 2024 22:15:34 +0800 Subject: [PATCH] 1 --- components/applyCard.vue | 12 +- pages-home/home/home.vue | 41 ++++ pages-home/service/applyList.vue | 226 ++++++++++++++++++ pages-home/service/todoDetail.vue | 279 ++++++++++++++++++++++ pages-order/choosePeople/choosePeople.vue | 13 +- pages-order/orderDetail/orderDetail.vue | 142 ++++++----- pages-repair/applyList/applyList.vue | 2 +- pages.json | 12 + utils/utils.js | 6 +- 9 files changed, 659 insertions(+), 74 deletions(-) create mode 100644 pages-home/service/applyList.vue create mode 100644 pages-home/service/todoDetail.vue diff --git a/components/applyCard.vue b/components/applyCard.vue index d46dbbc..0e572e8 100644 --- a/components/applyCard.vue +++ b/components/applyCard.vue @@ -1,16 +1,16 @@ @@ -297,64 +297,67 @@ export default { }, //是否可以授权给客户看 canOpenCus:false, + //是否可以看见钱 + canSeeMoney:false, //当前选择的操作:working-维修期间|done_half-阶段完成|done-全部完成递交下一维修班组选人维修 nowChooseOperate:"", carInfo: {}, userInfo: {}, loginUser:{}, selectedProj: [ - { - projName: '清洗内饰', - amount: '280', - date: '2024-10-20 12:00', - desc: '车辆已到维修厂,工作人员正准备开始维修', - imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}], - isSend: true, - // 待审核部件 - examinePart: [], - id: 'projId1', - // 销售 - salesman: [ - { - name: '魏书豪', - id: '11111' - } - ], - // 施工 - constructor: [] - }, - { - projName: '清洗内饰', - amount: '280', - date: '2024-10-20 12:00', - desc: '车辆已到维修厂,工作人员正准备开始维修', - imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}], - isSend: false, - // 待审核部件 - hasNoReviewPart: false, - id: 'projId2', - salesman: [], - constructor: [] - }, - { - projName: '清洗内饰', - amount: '280', - date: '2024-10-20 12:00', - desc: '车辆已到维修厂,工作人员正准备开始维修', - imageList: [], - isSend: false, - // 待审核部件 - hasNoReviewPart: true, - id: 'projId3', - salesman: [], - constructor: [] - } + // { + // projName: '清洗内饰', + // amount: '280', + // date: '2024-10-20 12:00', + // desc: '车辆已到维修厂,工作人员正准备开始维修', + // imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}], + // isSend: true, + // // 待审核部件 + // examinePart: [], + // id: 'projId1', + // // 销售 + // salesman: [ + // { + // name: '魏书豪', + // id: '11111' + // } + // ], + // // 施工 + // constructor: [] + // }, + // { + // projName: '清洗内饰', + // amount: '280', + // date: '2024-10-20 12:00', + // desc: '车辆已到维修厂,工作人员正准备开始维修', + // imageList: [{filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}, {filePath: ''}], + // isSend: false, + // // 待审核部件 + // hasNoReviewPart: false, + // id: 'projId2', + // salesman: [], + // constructor: [] + // }, + // { + // projName: '清洗内饰', + // amount: '280', + // date: '2024-10-20 12:00', + // desc: '车辆已到维修厂,工作人员正准备开始维修', + // imageList: [], + // isSend: false, + // // 待审核部件 + // hasNoReviewPart: true, + // id: 'projId3', + // salesman: [], + // constructor: [] + // } ], submitData:[] }; }, onLoad(data) { this.loginUser = getUserInfo() + this.canSeeMoney = !this.loginUser.roleCodes.includes('repair_staff'); console.log(this.loginUser,294) console.log(data) if (data.id) { @@ -414,10 +417,14 @@ export default { let fileStr = this.fileList.map(item=>item.url.replace(config.baseImageUrl,"")).join(",") if("working"==this.nowChooseOperate){ //维修中拍照 - const result = await saveTicketsRecords(this.ticketInfo.id,null,null,null,"sgz","施工中拍照记录",fileStr); - }else if("done_half"==this.nowChooseOperate || "done"==this.nowChooseOperate){ + const result = await saveTicketsRecords(this.ticketInfo.id,null,this.nowRepair.repairItemId,null,"sgz","施工中拍照记录",fileStr,"",""); + }else if("done_half"==this.nowChooseOperate){ //阶段完成 - const result = await saveTicketsRecords(this.ticketInfo.id, '03',this.nowRepair.repairItemId,"03","sgwczj","阶段完成",fileStr); + const result = await saveTicketsRecords(this.ticketInfo.id, '03',this.nowRepair.repairItemId,"03","sgwczj","阶段完成",fileStr,"",""); + }else if("done"==this.nowChooseOperate){ + //移交总检 + const result = await saveTicketsRecords(this.ticketInfo.id, '03',this.nowRepair.repairItemId,"03","sgwczj","维修完成移交总检",fileStr,"02",""); + // } this.$refs.popup.close() uni.showToast({ @@ -425,13 +432,20 @@ export default { icon: 'none' }) if("done"==this.nowChooseOperate){ - //全部完成,需要指派下一个维修人 + //移交总检需要返回 + setTimeout(() => { + uni.navigateBack() + },500) + } + if("other"==this.nowChooseOperate){ + //移交下一班组维修,需要指派下一个维修人 setTimeout(()=>{ uni.navigateTo({ - url: '/pages-order/choosePeople/choosePeople?id=' + this.ticketInfo.id +'&ifDetail=true' + url: '/pages-order/choosePeople/choosePeople?id=' + this.ticketInfo.id+'&itemId='+this.nowRepair.repairItemId +'&ifDetail=true' }) },500) } + console.error("result",result); } catch (error) { console.error(error); @@ -470,7 +484,10 @@ export default { text: '阶段完成', active: false,code:"done_half" }) this.content.push({ - text: '全部完成', active: false,code:"done" + text: '项目完成', active: false,code:"other" + }) + this.content.push({ + text: '移交总检', active: false,code:"done" }) //查当前维修的项目 this.selectNowRepair() @@ -491,8 +508,8 @@ export default { console.log(e) this.content[e.index].active = !e.item.active this.nowChooseOperate = e.item.code - if("working"==e.item.code || "done_half"==e.item.code || "done"==e.item.code){ - //维修过程中拍照上传、阶段完成、整体完成 + if("working"==e.item.code || "done_half"==e.item.code || "done"==e.item.code || "other"==e.item.code){ + //维修过程中拍照上传、阶段完成、移交其他班组、移交总检 this.fileList=[] this.$refs.popup.open("bottom") }else if("start" == e.item.code){ @@ -572,7 +589,6 @@ export default { async startWorkRequest(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark){ try { const result = await saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark,null); - debugger //刷新数据 this.getOrderDetail() } catch (error) { diff --git a/pages-repair/applyList/applyList.vue b/pages-repair/applyList/applyList.vue index 47cbae1..5b936f9 100644 --- a/pages-repair/applyList/applyList.vue +++ b/pages-repair/applyList/applyList.vue @@ -88,7 +88,7 @@ console.log(this.userInfo) }, onShow(){ - this.getOrderList() + this.onRefresherrefresh() }, methods:{ changeTabFun(id) { diff --git a/pages.json b/pages.json index ecd4f7a..56d9fe4 100644 --- a/pages.json +++ b/pages.json @@ -122,6 +122,18 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "service/applyList", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "service/todoDetail", + "style": { + "navigationBarTitleText": "" + } } ] }, diff --git a/utils/utils.js b/utils/utils.js index 5c86839..1799c8f 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -88,8 +88,10 @@ export function getDictByCode(dictCode){ * @param recordType 操作类型 对应后端枚举:RecordTypeEnum * @param remark 备注 * @param image 图片相对路径,多个英文逗号隔开 + * @param finishType 完成类型 01:完成并移交下一班组、02:完成并移交总检、03:完成工单 + * @param nextName 下一班组名称 */ -export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark,image){ +export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,recordType,remark,image,finishType,nextName){ return new Promise((resolve, reject) => { let dataObj = { id: id, @@ -97,6 +99,8 @@ export function saveTicketsRecords(id,ticketsWorkStatus,itemId,itemStatus,record item: {id: itemId, itemStatus: itemStatus}, recordType: recordType, remark: remark, + finishType:finishType, + nextName:nextName, image: image } request({