From cb4a49ccdf19f4be55b96adcdb906dc24ed3860a Mon Sep 17 00:00:00 2001 From: Vinjor Date: Tue, 22 Oct 2024 18:29:31 +0800 Subject: [PATCH] 111 --- components/applyCard.vue | 26 ++- pages-order/choosePeople/choosePeople.vue | 14 +- pages-order/orderDetail/orderDetail.vue | 24 ++- pages-repair/apply/applyForm.vue | 13 +- pages-repair/applyList/applyList.vue | 131 ++++++++++-- pages-repair/applyList/todoDetail.vue | 246 ++++++++++++++++++++++ pages-repair/static/daishenhe.png | Bin 0 -> 1507 bytes pages-repair/static/weitongguo.png | Bin 0 -> 1384 bytes pages-repair/static/yitongguo.png | Bin 0 -> 1400 bytes pages.json | 16 +- utils/utils.js | 38 ++-- 11 files changed, 436 insertions(+), 72 deletions(-) create mode 100644 pages-repair/applyList/todoDetail.vue create mode 100644 pages-repair/static/daishenhe.png create mode 100644 pages-repair/static/weitongguo.png create mode 100644 pages-repair/static/yitongguo.png diff --git a/components/applyCard.vue b/components/applyCard.vue index 74c4d91..c6f2404 100644 --- a/components/applyCard.vue +++ b/components/applyCard.vue @@ -1,21 +1,20 @@ @@ -103,7 +109,7 @@ export default { font-size: 30rpx; color: #333333; margin-left: 5px; - } + } .desc{ font-size: 28rpx; color: #858BA0 diff --git a/pages-order/choosePeople/choosePeople.vue b/pages-order/choosePeople/choosePeople.vue index 4b4940a..510b266 100644 --- a/pages-order/choosePeople/choosePeople.vue +++ b/pages-order/choosePeople/choosePeople.vue @@ -148,7 +148,12 @@ export default { }).then(res => { this.list = res.data.records this.list.map((item) => { - item.workTypeText = getDictTextByCodeAndValue('repair_work_type', item.workType) + getDictTextByCodeAndValue("repair_work_type",item.workType).then(value => { + item.workTypeText = value + }).catch(error => { + item.workTypeText = "未知" + console.error(error); + }); }) }) }, @@ -163,7 +168,12 @@ export default { }).then((res) => { this.list = res.data this.list.map((item) => { - item.workTypeText = getDictTextByCodeAndValue('repair_work_type', item.workType) + getDictTextByCodeAndValue("repair_work_type",item.workType).then(value => { + item.workTypeText = value + }).catch(error => { + item.workTypeText = "未知" + console.error(error); + }); }) if (this.list.length > 0) { console.log(this.list[0].userId) diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue index 20ddbbc..8caa2d1 100644 --- a/pages-order/orderDetail/orderDetail.vue +++ b/pages-order/orderDetail/orderDetail.vue @@ -185,7 +185,7 @@ 售价:{{ item.itemPrice || "" }} 数量:{{ item.itemCount || "" }} - 单位:{{ getItemUnit(item.itemUnit) || ""}} + 单位:{{ item.itemUnit || ""}} 折扣:{{ item.itemDiscount || "" }} 金额:{{ item.itemMoney || "" }} @@ -633,10 +633,26 @@ export default { //维修记录匹配数据字典 if (null != resultObj.records){ resultObj.records.map((item)=>{ - item.typeStr = getDictTextByCodeAndValue('repair_records_type',item.type) + getDictTextByCodeAndValue("repair_records_type",item.type).then(value => { + item.typeStr = value + }).catch(error => { + item.typeStr = "未知" + console.error(error); + }); item.createTime = formatTimestamp(item.createTime) }) } + //配件翻译字典 + if (null != resultObj.wares){ + resultObj.wares.map((item)=>{ + getDictTextByCodeAndValue("repair_unit",item.itemUnit).then(value => { + item.itemUnit = value + }).catch(error => { + item.itemUnit = "未知" + console.error(error); + }); + }) + } this.ticketInfo = resultObj //判断当前角色及工单状态显示操作按钮 this.checkRoleOperate() @@ -697,10 +713,6 @@ export default { // url: `/pages-order/choosePeople/choosePeople?type=${type}&id=${this.ticketId}` }) }, - //翻译配件单位 - getItemUnit(unitCode){ - return getDictTextByCodeAndValue("repair_unit",unitCode); - }, /** * 点击配件申请单提醒,查看相关配件 * @param wareId diff --git a/pages-repair/apply/applyForm.vue b/pages-repair/apply/applyForm.vue index 1e78684..50cbd48 100644 --- a/pages-repair/apply/applyForm.vue +++ b/pages-repair/apply/applyForm.vue @@ -20,7 +20,7 @@ {{ item.name }} 单位: - {{ getItemUnit(item.unit) }} + {{ item.unit }} @@ -175,6 +175,13 @@ export default { }else{ m.num = 0 } + //翻译单位 + getDictTextByCodeAndValue("repair_unit",m.unit).then(value => { + m.unit = value + }).catch(error => { + m.unit = "未知" + console.error(error); + }); return m }) //判断 如果获取的数据的页码不是第一页,就让之前赋值获取过的数组数据 concat连接 刚获取的第n页数据 @@ -269,10 +276,6 @@ export default { this.activeId = value this.onRefresherrefresh() }, - //翻译配件单位 - getItemUnit(unitCode){ - return getDictTextByCodeAndValue("repair_unit",unitCode); - }, } } diff --git a/pages-repair/applyList/applyList.vue b/pages-repair/applyList/applyList.vue index ca4059f..4fb155b 100644 --- a/pages-repair/applyList/applyList.vue +++ b/pages-repair/applyList/applyList.vue @@ -12,7 +12,7 @@ - + @@ -27,6 +27,7 @@ import tabBarVue from '@/components/tabBar/tabBar.vue' import OrderCard from "@/components/applyCard.vue"; import request from '@/utils/request'; + import {getUserInfo} from '@/utils/auth'; export default { components: { OrderCard, @@ -52,39 +53,60 @@ }, { id: 2, - title: '已通过' + title: '待领料' + }, + { + id: 3, + title: '待退料' }, ], orderList: [ - { - carNo: "川E795C0", - createTime: '2024-10-20 12:00', - ticketsStatus: '05', - remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你' - }, - { - carNo: "川E795C1", - createTime: '2024-10-20 12:00', - ticketsStatus: '02', - remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你' - }, - { - carNo: "川E795C2", - createTime: '2024-10-20 12:00', - ticketsStatus: '01', - remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你' - } + // { + // carNo: "川E795C0", + // createTime: '2024-10-20 12:00', + // ticketsStatus: '05', + // remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你' + // }, + // { + // carNo: "川E795C1", + // createTime: '2024-10-20 12:00', + // ticketsStatus: '02', + // remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你' + // }, + // { + // carNo: "川E795C2", + // createTime: '2024-10-20 12:00', + // ticketsStatus: '01', + // remark: '大厦预订奴化时间内丢进爱上牛津阿斯顿你' + // } ], + userInfo:null, }; }, onLoad(){ - + this.userInfo = getUserInfo() + console.log(this.userInfo) + this.getOrderList() }, methods:{ changeTabFun(id) { this.activeKey = id this.onRefresherrefresh() }, + /** + * 上滑加载数据 + */ + onReachBottomCus() { + //判断 如果页码*页容量大于等于总条数,提示该页数据加载完毕 + if (this.pageNo * this.pageSize >= this.total) { + uni.$u.toast('没有更多数据了') + return + } + //页码+1,调用获取数据的方法获取第二页数据 + this.pageNo++ + //此处调用自己获取数据列表的方法 + this.getOrderList() + }, /** * 下拉刷新数据 */ @@ -92,11 +114,74 @@ this.isTriggered = true this.pageNo = 1 this.total = 0 - //this.orderList = [] + this.orderList = [] this.getOrderList() }, + /** + * 查看申请单详情 + */ + viewDetail(item){ + if(0==this.activeKey || 1==this.activeKey){ + //配件申请单详情 + uni.navigateTo({ + url: '/pages-repair/applyList/todoDetail?viewType=apply&id='+item.id + }) + }else{ + //领料单\退料单详情 + uni.navigateTo({ + url: '/pages-repair/applyList/todoDetail?viewType=receive&id='+item.id + }) + } + }, + /** + * 查数据 + */ getOrderList(){ - + let url="" + let params = { + pageNo:this.pageNo, + pageSize:this.pageSize + } + if(0==this.activeKey){ + //已提交的配件申请单 + url = "/admin-api/repair/tw/page" + params.type="01" + }else if(1==this.activeKey){ + //未通过的配件申请单 + url = "/admin-api/repair/tw/page" + params.type="01" + params.status="05" + }else if(2==this.activeKey){ + //待确认的领料单 + url = "/admin-api/repair/so/page" + params.soType = "02" + params.userId = this.userInfo.id + params.soStatus = "04" + }else if(3==this.activeKey){ + //待确认的退料单 + url = "/admin-api/repair/so/page" + params.soType = "04" + params.userId = this.userInfo.id + params.soStatus = "07" + } + request({ + url: url, + method: 'get', + params:params + }).then((res) => { + if (res.code == 200) { + if(res.data.records.length > 0){ + if (this.pageNo != 1) { + this.orderList = this.orderList.concat(res.data.records) + } else { + this.orderList = res.data.records + } + } + //将获取的总条数赋值 + this.total = res.data.total + this.isTriggered = false + } + }) } } } diff --git a/pages-repair/applyList/todoDetail.vue b/pages-repair/applyList/todoDetail.vue new file mode 100644 index 0000000..93c395c --- /dev/null +++ b/pages-repair/applyList/todoDetail.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/pages-repair/static/daishenhe.png b/pages-repair/static/daishenhe.png new file mode 100644 index 0000000000000000000000000000000000000000..086c3a74715655a3d74d227cdd24d362cd509827 GIT binary patch literal 1507 zcmV<91swW`P)Px)ok>JNRA@up*jsEARTu~G|Ln}(w|l9yY|&nTS`sCKq%FmU#0Uh%L>~yj`0kSl z(ZmFUVnHGTF+w5_BK#6_rcoqDy&bvh}iHCknZ1r^Z9p?@(&{1e+)uZJ=|>{vOyTj zY)(iam~4dE+m6KeW!M_GLiC-461@xFR)?g&pWFa6nPQgNybwK@*-2=cf^gqa@b+bJ zta_7TV#8-qv+1i$nN@E%0FF23FR%0!^ORX$2rDLX<7)`6m9(75ir)GTf};V6u?r7j zNHV0%l-M)`yO$l22g3wm!H_P+asT~0(RT`hb2-f3Hku46C(h)A!Dxq)@WZuc7t*O2 ztDk|bX&XB#M>5P17EJa|5)<7J?91qlot(UiV9%$pHogMq>bD?ACukb6k#kVv(@AEsyX^zW;vFRKUZF{m6s5plg_Ri_JNH$E zOwBZjonV;?2{D4V{6f^DvB_mQ0!HX#fQ$lBVgwsL3#9F26&^7LrE% z&IKgKFF}n>!MtoEO(eU_^fZ74Ls-fzJ5MDUM11r-l*kBd%U?sV=OB1TJv{3_LVWBZ zEi+f^ZiKFV2BT{weVDSWqCoUw$o1jtClDVwhw9G5kRl^UPISZ3@&GEq241f)vkjkiS$V?`c5N0{5?D!AH(QwrT{5?8*=Ct zZO4J%x@bD)+I2YtDk_8(6YMz*d-Ha>VR7gT?No|54%fQ(G6?#=lq3SbAAlP7!`8eV zwuUWpR$0*@teEtU)Rc&spLfCCy60hpDkCv=5#r60-~=0ND_)1-sHc+x8FOZ@l0fuh zBAJmsIo*fkyH~+~jaJ-3N z(z(d686Nlo=DH53u}L_edz*etCWh$Hw{+|wt9s+-nL)LrkU}uzTtjYbYvWcrlPS@A zbkp(CbKtGD;Hw(wd`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d(`WiAX^YilX0G~N9`86 z(m59Zzb4|GVwN&HKh#ViCi@8D7D%xpVKbi)Ibg1ql*nFo0Tu~kVbtgJq?h4`s%?CG>ON;BG7HQPfyJODJ`K302yrMgJam2 z`Yr$tR?bFeoh0EzxZ6(xmWYrtYc^b?v;AUR0ZtCoV|zj|JuOe}3D*rJ;1Jd_s~h|c z`UxYJM`xl|dk(KF*C8)9E3g~ljK4PNA1n(1S(;6DGyk^I(|zY95g}#9ikVjkYnfdb zYC-nGOpmXO<{iR{nXO!d0^$oy&_L#j2`b23FhK|L788^ZZ!kd%5sC?Fh!9NBLs&5( z0b#*}3}iM;NI^VdLJl$$CL|&5Fd++Z#e_6uGA869PR#!SP3LinFev^20000 { - console.log(res) - if (res.code == 200) { - setStorageWithExpiry(dictCode,res.data,3600) - dictArray = res.data - let dictObj = dictArray.find(item=>item.value==value) - if(dictObj){ - return dictObj.label - }else{ - return "未知数据" - } - } + params: {type: dictCode} }) - }else{ - let dictObj = dictArray.find(item=>item.value==value) - if(dictObj){ + if (res.code == 200) { + setStorageWithExpiry(dictCode, res.data, 3600) + dictArray = res.data + let dictObj = dictArray.find(item => item.value == value) + if (dictObj) { + return dictObj.label + } else { + return "未知数据" + } + } + } else { + let dictObj = dictArray.find(item => item.value == value) + if (dictObj) { return dictObj.label - }else{ + } else { return "未知数据" } }