From 3bdac82e0066f97307fc6a7177cecdf89a5ba7e1 Mon Sep 17 00:00:00 2001 From: whycq <whycq> Date: 星期四, 07 四月 2022 09:23:39 +0800 Subject: [PATCH] # --- pages/basics/publish.vue | 349 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 338 insertions(+), 11 deletions(-) diff --git a/pages/basics/publish.vue b/pages/basics/publish.vue index 182f96f..be21743 100644 --- a/pages/basics/publish.vue +++ b/pages/basics/publish.vue @@ -1,6 +1,21 @@ <template> <view> - <view> + <view class="margin-top"> + <view class="app-list"> + <view class="app-list-cell"> + <view class="app-list-cell-left">涓婃灦璐т綅</view> + <view class="app-list-cell-db"> + <picker mode="multiSelector" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray"> + <view class="app-input">{{multiArray[0][multiIndex[0]]}} + ,{{multiArray[1][multiIndex[1]]}} + ,{{multiArray[2][multiIndex[2]]}}</view> + </picker> + </view> + </view> + </view> + </view> + + <view class="margin-top"> <uni-table border stripe type="selection" emptyText="娌℃湁鏇村鏁版嵁"> <uni-tr> <uni-th align="center">鏁伴噺</uni-th> @@ -50,8 +65,8 @@ <view> <!-- 鏄剧ず琛ㄥ崟寮圭獥 --> <uni-popup ref="showNodeSelect" type="dialog"> - <uni-popup-dialog ref="inputClose" mode="input" title="閫夋嫨鍏ュ簱璐т綅" > - + <uni-popup-dialog ref="inputClose" mode="input" title="閫夋嫨鍏ュ簱璐т綅" @confirm="aabbcc()"> + </uni-popup-dialog> </uni-popup> </view> @@ -68,13 +83,45 @@ rowNum:'', msgType: '', messageText: '', + selectData: "", + index: 0, + multiArray: [ + ['璇烽�夋嫨'], + ['璇烽�夋嫨'], + ['璇烽�夋嫨'] + ], + multiIndex: [0, 0, 0], + date: getDate({ + format: true + }), + startDate:getDate('start'), + endDate:getDate('end'), + sum: '', + nodeSel: '', } + }, + onLoad() { + }, mounted(){ const UIP = uni.getStorageSync('UIP'); this.baseIP = UIP; const UPORT = uni.getStorageSync('UPORT'); this.basePORT = UPORT + let that = this + uni.request({ + url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/node/tree/auth", + header: { 'token':uni.getStorageSync('token') }, + data: {}, + method:'POST', + success(res) { + var res = res.data + if (res.code === 200 ) { + that.selectData = res.data + that.multiArray[0] = [res.data[0].title,res.data[0].children[0].title] + } + } + }) }, methods: { // 寮瑰嚭灞� @@ -109,8 +156,6 @@ } else { that.addSotokInData(object) } - - } that.initCount() }, @@ -126,7 +171,6 @@ if (toPush) { that.stockInData.push(object[i]) } - } }, // 淇敼鏁伴噺 @@ -154,21 +198,304 @@ return; } } - this.$refs.showNodeSelect.open() uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/work/stock/pakin", - header: { 'token':uni.getStorageSync('token') }, - data: {}, + url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "//work/stock/pakin", + header: { + 'content-type':'application/json', + 'token':uni.getStorageSync('token') + }, + data: { + nodeId: this.nodeSel, + mats: this.stockInData, + }, method:'POST', success(res) { console.log(res) + var res = res.data + if (res.code === 200 ) { + console.log(res) + } } }) + }, + bindMultiPickerColumnChange: function(e) { + var selectData = this.selectData + var selectData2 = this.selectData[0].children[0].children[0].children + var selectData3 = this.selectData[0].children[0].children[1].children + this.multiIndex[e.detail.column] = e.detail.value + switch (e.detail.column) { + case 0: //鎷栧姩绗�1鍒� + + switch (this.multiIndex[0]) { + case 0: + this.multiArray[1] = [selectData[0].title] + this.multiArray[2] = [selectData[0].title] + break + case 1: + this.multiArray[1] = [selectData[0].children[0].children[0].title, + selectData[0].children[0].children[1].title] + this.multiArray[2] = [selectData2[0].title, + selectData2[1].title, + selectData2[2].title, + selectData2[3].title, + selectData2[4].title, + selectData2[5].title, + selectData2[6].title, + selectData2[7].title, + selectData2[8].title, + selectData2[9].title, + selectData2[10].title, + selectData2[11].title, + selectData2[12].title, + selectData2[13].title, + selectData2[14].title, + selectData2[15].title, ] + break + } + this.multiIndex.splice(1, 1, 0) + this.multiIndex.splice(2, 1, 0) + break + case 1: //鎷栧姩绗�2鍒� + + switch (this.multiIndex[0]) { //鍒ゆ柇绗竴鍒楁槸浠�涔� + case 0: + switch (this.multiIndex[1]) { + case 0: + + break + case 1: + this.multiArray[2] = ['涓滀含','鍖楁捣閬�'] + break + } + break + case 1: + switch (this.multiIndex[1]) { + case 0: + this.multiArray[2] = [selectData2[0].title, + selectData2[1].title, + selectData2[2].title, + selectData2[3].title, + selectData2[4].title, + selectData2[5].title, + selectData2[6].title, + selectData2[7].title, + selectData2[8].title, + selectData2[9].title, + selectData2[10].title, + selectData2[11].title, + selectData2[12].title, + selectData2[13].title, + selectData2[14].title, + selectData2[15].title, ] + break + case 1: + this.multiArray[2] = [selectData3[0].title, + selectData3[1].title, + selectData3[2].title, + selectData3[3].title, + selectData3[4].title, + selectData3[5].title, + selectData3[6].title, + selectData3[7].title, + selectData3[8].title, + selectData3[9].title, + selectData3[10].title, + selectData3[11].title, + selectData3[12].title, + selectData3[13].title, + selectData3[14].title, + selectData3[15].title, ] + break + } + break + } + this.multiIndex.splice(2, 1, 0) + break + } + this.$forceUpdate() + var num1 = this.multiIndex[0] + var num2 = this.multiIndex[1] + var num3 = this.multiIndex[2] + this.sum = num1 + "-" + num2 + "-" + num3 + this.changeNum(this.sum) + }, + changeNum() { + switch (this.sum) { + case "0-0-0": + this.nodeSel = 1 + break; + case "1-0-0": + this.nodeSel = 4 + break; + case "1-0-1": + this.nodeSel = 5 + break; + case "1-0-2": + this.nodeSel = 6 + break; + case "1-0-3": + this.nodeSel = 7 + break; + case "1-0-4": + this.nodeSel = 8 + break; + case "1-0-5": + this.nodeSel = 9 + break; + case "1-0-6": + this.nodeSel = 10 + break; + case "1-0-7": + this.nodeSel = 11 + break; + case "1-0-8": + this.nodeSel = 12 + break; + case "1-0-9": + this.nodeSel = 13 + break; + case "1-0-10": + this.nodeSel = 14 + break; + case "1-0-11": + this.nodeSel = 15 + break; + case "1-0-12": + this.nodeSel = 16 + break; + case "1-0-13": + this.nodeSel = 17 + break; + case "1-0-14": + this.nodeSel = 18 + break; + case "1-0-15": + this.nodeSel = 19 + break; + case "1-1-0": + this.nodeSel = 21 + break; + case "1-1-1": + this.nodeSel = 22 + break; + case "1-1-2": + this.nodeSel = 23 + break; + case "1-1-3": + this.nodeSel = 24 + break; + case "1-1-4": + this.nodeSel = 25 + break; + case "1-1-5": + this.nodeSel = 26 + break; + case "1-1-6": + this.nodeSel = 27 + break; + case "1-1-7": + this.nodeSel = 28 + break; + case "1-1-8": + this.nodeSel = 29 + break; + case "1-1-9": + this.nodeSel = 30 + break; + case "1-1-10": + this.nodeSel = 31 + break; + case "1-1-11": + this.nodeSel = 32 + break; + case "1-1-12": + this.nodeSel = 33 + break; + case "1-1-13": + this.nodeSel = 34 + break; + case "1-1-14": + this.nodeSel = 35 + break; + case "1-1-15": + this.nodeSel = 36 + break; + + } + }, + aabbcc(e) { + console.log(e) } } } </script> <style> - + .app-list { + background-color: #ffffff; + position: relative; + width: 100%; + display: flex; + flex-direction: column; + } + .app-list:after { + position: absolute; + z-index: 10; + right: 0; + bottom: 0; + left: 0; + height: 1px; + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + background-color: #c8c7cc; + } + .app-list::before { + position: absolute; + z-index: 10; + right: 0; + top: 0; + left: 0; + height: 1px; + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + background-color: #c8c7cc; + } + .app-list-cell { + position: relative; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + } + .app-list-cell-left { + white-space: nowrap; + font-size:28rpx; + padding: 0 30rpx; + } + .app-list-cell-db, + .app-list-cell-right { + flex: 1; + } + .app-input { + height: 80rpx; + padding: 15rpx 25rpx; + line-height:50rpx; + font-size:28rpx; + background:#FFF; + flex: 1; + } + .app-list-cell::after { + position: absolute; + z-index: 3; + right: 0; + bottom: 0; + left: 30rpx; + height: 1px; + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + background-color: #c8c7cc; + } </style> -- Gitblit v1.9.1