From e3b84d48cef3e024e4a17b4df35f47cf3e63e820 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期三, 10 四月 2024 00:05:59 +0800 Subject: [PATCH] # --- pages/phyz/order/purchaseOrder.vue | 198 ++++++++++++++++++++++--------------------------- 1 files changed, 90 insertions(+), 108 deletions(-) diff --git a/pages/phyz/order/purchaseOrder.vue b/pages/phyz/order/purchaseOrder.vue index 20ced19..91283d8 100644 --- a/pages/phyz/order/purchaseOrder.vue +++ b/pages/phyz/order/purchaseOrder.vue @@ -1,7 +1,7 @@ <template> - <view> + <view class="container"> <view class="code"> - <uni-search-bar :focus="searchValueFocus" v-model="searchValue" @input="searchValueInput()" + <uni-search-bar :focus="searchValueFocus" v-model="searchValue" @input="searchValueInput2()" maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿 璁㈠崟鍙�"> </uni-search-bar> <view class="code-title"> @@ -13,22 +13,29 @@ </view> <view class="list" v-for="(item,i) in dataList"> <view class="list-left"> - <view>缂栧彿锛歿{item.matnr}}</view> - <view>鍚嶇О锛歿{item.maktx}}</view> - <view>瑙勬牸锛歿{item.specs}}</view> - <view>鏁伴噺锛歿{item.anfme}}</view> - <view class="card-id">{{i + 1}}</view> + <view>鍗曟嵁缂栧彿锛歿{item.orderNo}}</view> + <view>鍗曟嵁绫诲瀷锛歿{item.docType$}}</view> + <view>鍒涘缓鏃堕棿锛歿{item.createTime$}}</view> + <!-- <view class="card-id">{{i + 1}}</view> --> + <view class="card-status-1" v-if="item.settle == 1">{{item.settle$}}</view> + <view class="card-status-2" v-if="item.settle == 2">{{item.settle$}}</view> + <view class="card-status-4" v-if="item.settle == 4">{{item.settle$}}</view> </view> <!-- <view class="list-right" @click="checkboxChange(item)"> <label > <checkbox :value="item.orderNo" :checked="item.checked" color="#FFCC33" style="transform:scale(0.7)" /><text></text> </label> </view> --> - <view class="list-right"> - + <view class="list-right" @click="getOrderDetl(item)"> + <uni-icons type="right" color="#c1c1c1"></uni-icons> </view> </view> <view style="height: 100rpx;"></view> + + <view style="position: fixed;bottom: 40px;padding: 10rpx;border-radius: 50%; + left: 20px;background-color: #55aaff;box-shadow: 0px 0px 5px 5px #c8c8c8;"> + <uni-icons type="refreshempty" size="30" color="#FFF" @click="reload()"/> + </view> </view> </template> @@ -36,124 +43,57 @@ export default { data() { return { + baseUrl: '', + token: '', searchValueFocus: true, searchValue: '', checck: true, - dataList: [ - { - orderNo: 'cg0931241', - matnr: 'cg0931255', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z', - checked: true - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931225', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - { - orderNo: 'cg0931241', - matnr: 'cg0931241', - maktx: '浣犲ソ', - anfme: 10, - specs: '10-z' - }, - ], + dataList: [], oldDataList: [], newDataList: [], allCheck: false, - allCheckBtnTitle: '鍏ㄩ��' + allCheckBtnTitle: '鍏ㄩ��', } }, onShow() { - this.oldDataList = [...this.dataList] + this.baseUrl = uni.getStorageSync('baseUrl'); + this.token = uni.getStorageSync('token'); + this.getOrderList() }, + methods: { + reload() { + this.getOrderList() + }, + searchValueInput2() { + let _this = this + uni.request({ + url: `${_this.baseUrl}/order/head/page/auth`, + header: {'token': uni.getStorageSync('token')}, + data: { + curr: 1, + limit: 999999, + order_no: _this.searchValue + }, + method: 'GET', + success(res) { + res = res.data + if (res.code === 200) { + _this.dataList = res.data.records + } + } + }) + }, searchValueInput() { let count = 0 let sign = 0 this.dataList = [...this.oldDataList] this.newDataList = [] for (let k in this.dataList) { - if (!this.dataList[k].matnr.includes(this.matnr)) { + if (!this.dataList[k].orderNo.includes(this.searchValue)) { count++; } else { this.newDataList.push(this.dataList[k]) - } - } - if (this.matnr != '') { - for (let j in this.dataList) { - if (!this.dataList[j].maktx.includes(this.matnr)) { - } else { - for (let i in this.newDataList) { - if (this.newDataList[i].matnr == this.dataList[j].matnr) { - sign++ - } - } - if (sign == 0) { - this.newDataList.push(this.dataList[j]) - } - } } } this.dataList = this.newDataList @@ -186,12 +126,54 @@ clear() { this.matnr = '' this.dataList = [...this.oldDataList] + }, + // 鑾峰彇璁㈠崟鍒楄〃 + getOrderList() { + let _this = this + uni.request({ + url: `${_this.baseUrl}/order/detls/in/page/auth`, + header: {'token': uni.getStorageSync('token')}, + data: { + curr: 1, + limit: 30, + }, + method: 'GET', + success(res) { + res = res.data + if (res.code === 200) { + _this.dataList = res.data.records + _this.oldDataList = [..._this.dataList] + } + } + }) + }, + // 鑾峰彇璁㈠崟鏄庣粏 + getOrderDetl(item) { + let _this = this + uni.navigateTo({ + url: "./orderList", + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('item', { + item: item + }) + }, + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� + acceptDataFromOpenedPage: function(data) { + // _this.matnr = data.data + _this.input(_this.matnr) + }, + }, + + + }); } + } } </script> <style> @import url('../../../static/css/common/order.css'); - </style> \ No newline at end of file -- Gitblit v1.9.1