From 1d69fc35f7151b428a9aad0267d7854eab76127c Mon Sep 17 00:00:00 2001 From: 905166056 <905166056@qq.com> Date: Tue, 20 Apr 2021 15:06:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E5=AE=8C=E7=BB=93=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=9C=89=E5=81=BF=E6=9C=8D=E5=8A=A1=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=B4=B9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/repair/repair.js | 8 ++++-- .../repairDispatchFinish.vue | 28 +++++++++++-------- pages/repairHandle/repairHandle.vue | 24 ++++++++++++++-- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/api/repair/repair.js b/api/repair/repair.js index 9e551a4..5c27d4d 100644 --- a/api/repair/repair.js +++ b/api/repair/repair.js @@ -167,7 +167,9 @@ export function finishRepair(_that){ "resId": _that.goods.resId, }, "resId": _that.goods.resId, - "useNumber": _that.useNumber + "useNumber": _that.useNumber, + "isCustom": _that.isCustom, + "customGoodsName": _that.customGoodsName, } console.log(_data); let _beforeRepairPhotos = _that.beforeRepairPhotos; @@ -191,8 +193,10 @@ export function finishRepair(_that){ msg = "商品数量不能为零"; }else if (_data.useNumber > _that.goods.stock){ msg = "库存不足"; - }else if (!_data.conditions.resId){ + }else if (!_data.isCustom && !_data.conditions.resId){ msg = "请选择商品"; + }else if (_data.isCustom && !_data.customGoodsName){ + msg = "请输入商品名"; // }else if (_data.price == '' || !_data.price || parseFloat(_data.price) < parseFloat(_data.outLowPrice) || parseFloat(_data.price) > parseFloat(_data.outHighPrice)){ }else if (_data.price == '' || !_data.price){ msg = "请输入有效金额"; diff --git a/pages/repairDispatchFinish/repairDispatchFinish.vue b/pages/repairDispatchFinish/repairDispatchFinish.vue index fa93251..616f30f 100644 --- a/pages/repairDispatchFinish/repairDispatchFinish.vue +++ b/pages/repairDispatchFinish/repairDispatchFinish.vue @@ -34,6 +34,7 @@ + 加载更多 @@ -50,7 +51,8 @@ myOrders: [], orders: [], storeId: '', - noData: false + noData: false, + page: 1, } }, components: { @@ -70,7 +72,7 @@ let _userInfo = this.java110Context.getUserInfo(); let storeId = _userInfo.storeId; let _objData = { - page: 1, + page: this.page, row: 15, userId: _userInfo.userId, communityId: _that.java110Context.getCurrentCommunity().communityId @@ -82,7 +84,6 @@ method: "GET", data: _objData, //动态数据 success: function(res) { - console.log("请求返回信息:", res); let _json = res.data; if (_json.code != 0) { uni.showToast({ @@ -91,19 +92,24 @@ }); return; } + if(_json.data.length <= 0){ + uni.showToast({ + title: '已全部加载' + }) + return; + } let _data = _json.data; - _that.myOrders = _data; + _data.forEach(function(item) { + let dateStr = item.appointmentTime; + let _date = new Date(dateStr.replace(/-/g, "/")); + item.appointmentTime = (_date.getMonth() + 1) + '-' + _date.getDate(); + }); + _that.myOrders = _that.myOrders.concat(_data); + _that.page ++; if (_that.myOrders.length < 1) { _that.noData = true; return; } - _that.myOrders.forEach(function(item) { - let dateStr = item.appointmentTime; - console.log(dateStr); - let _date = new Date(dateStr.replace(/-/g, "/")); - item.appointmentTime = (_date.getMonth() + 1) + '-' + _date.getDate(); - }); - // _that.orders = _data.ownerRepairs; }, fail: function(e) { wx.showToast({ diff --git a/pages/repairHandle/repairHandle.vue b/pages/repairHandle/repairHandle.vue index 7aea5a8..75171f3 100644 --- a/pages/repairHandle/repairHandle.vue +++ b/pages/repairHandle/repairHandle.vue @@ -42,12 +42,18 @@ + + 商品名 + + 单价 - 价格:{{goods.outLowPrice}} - 价格范围{{goods.outLowPrice}}-{{goods.outHighPrice}} + + 价格:{{goods.outLowPrice}} + 价格范围{{goods.outLowPrice}}-{{goods.outHighPrice}} + 数量 @@ -216,6 +222,8 @@ "outLowPrice": "", "outHighPrice": "", }, + isCustom: false, + customGoodsName: '', } }, onLoad(options) { @@ -298,6 +306,10 @@ return; } _that.goodsCloums = _that.goodsCloums.concat(_data); + // 如果是“其他类” 追加 “自定义” 选项 + if(_that.goodsTypeCloums[_that.goodsTypeIndex].statusCd == '1003'){ + _that.goodsCloums = _that.goodsCloums.concat([{resName: '自定义'}]); + } }); }, @@ -339,6 +351,14 @@ this.goods = '' return; } + // 自定义商品 + if(this.goodsCloums[this.goodsIndex].resName == "自定义"){ + this.goods = '' + this.isCustom = true; + return; + }else{ + this.isCustom = false; + } let selected = this.goodsCloums[this.goodsIndex] //获取选中的数组 this.goods = selected if(selected.outLowPrice == selected.outHighPrice){