diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index cbbfd5c..5db872a 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -21,10 +21,6 @@ - - - - @@ -131,8 +127,59 @@ + + + + + + 上下线 + + + {{item.title}} + + + + 设置指派单规则 + + + + + + + + + + + 取 + + + {{item.getAreaName}} + + + + + 送 + + + {{item.putAreaName}} + + + + + + + + + 备注: + + + + + + @@ -145,6 +192,20 @@ return { tab1Checked: 'daiqu', menuButtonInfo: {}, + isArea:false, + waimaRuleList: [], + selectRuleList:[], + paotuiRuleList:[], + lineStatus:[ + { + title:'上线', + value:0 + }, + { + title:'下线', + value:1 + } + ] } }, props:{ @@ -165,9 +226,79 @@ console.log("配送初始化") this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() }, + selectRule(item){ + //TODO 这里应该改成 复选,选中的遍历再放进来 + let rule = { + id:item.id, + getPushOrder:1 + } + this.selectRuleList.push(rule) + let submitData = { + userId: uni.getStorageSync('id'), + workerRelaPriceList: this.selectRuleList + }; + this.tui.request('/app/workerRelaPrice/batchUpdate', 'post', submitData).then(res => { + uni.hideLoading(); + if (res.code == 200) { + uni.showToast({title: '设置成功'}); + } else { + uni.showToast({title: res.message, icon: 'none'}); + } + }).catch(err => { + uni.hideLoading(); + }); + }, + openPopup(){ + let that = this + that.tui.request("/app/workerRelaPrice/getByWorkerId?workerId=" + uni.getStorageSync('worker').workerId, "GET", {}, false, true).then((res) => { + if (res.code == 200) { + if(res.result != null){ + let data = res.result; + let list = data.workerRelaPriceList || []; + let waimaList = list.filter(item => item.orderType == 0); + let paotuiList = list.filter(item => item.orderType == 1); + + if(waimaList.length > 0) { + that.waimaRuleList = waimaList; + } + if(paotuiList.length > 0) { + that.paotuiRuleList = paotuiList; + } + that.$forceUpdate(); + } + + this.$refs.carPopup.open('bottom') + } else { + that.tui.toast(res.message) + return + } + }).catch((res) => {}) + }, + checkArea(){ + this.isArea = !this.isArea + }, checkTab1(type) { this.tab1Checked = type }, + changeOnline(value){ + let url = '' + if(value == 0){ + url = '/worker/onLine' + }else{ + url = '/worker/offLine' + } + this.tui.request(url, "POST", { + id:uni.getStorageSync('worker').workerId + }, false, true).then((res) => { + if (res.code == 200) { + this.tui.toast(res.message) + } else { + this.tui.toast(res.message) + } + + }) + this.isArea = !this.isArea + }, ceshi(e) { console.log("11111111",e) if (e.detail.code) {