From 2e25e96baa73c7a26c71f3af1a14431b52ebf805 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 27 三月 2024 15:37:13 +0800
Subject: [PATCH] #
---
pages/phyz/order/orderList.vue | 36 ++++
pages/phyz/order/preview.vue | 265 +++++++++++++++++++++++++++++++++++++
pages.json | 8 +
static/css/common/order.css | 24 +++
pages/phyz/AGV/AGVPakin3.vue | 46 ++++++
5 files changed, 373 insertions(+), 6 deletions(-)
diff --git a/pages.json b/pages.json
index 7b7c1b8..db1793c 100644
--- a/pages.json
+++ b/pages.json
@@ -514,6 +514,14 @@
"navigationBarTitleText" : "缁勬墭鍏ュ簱",
"enablePullDownRefresh" : false
}
+ },
+ {
+ "path" : "pages/phyz/order/preview",
+ "style" :
+ {
+ "navigationBarTitleText" : "鍑哄簱棰勮",
+ "enablePullDownRefresh" : false
+ }
}
diff --git a/pages/phyz/AGV/AGVPakin3.vue b/pages/phyz/AGV/AGVPakin3.vue
index 1f45943..8074439 100644
--- a/pages/phyz/AGV/AGVPakin3.vue
+++ b/pages/phyz/AGV/AGVPakin3.vue
@@ -6,8 +6,17 @@
@input="findOrder()">
</view>
<view class="item">
- <input type="text" placeholder=" 鎵爜 / 杈撳叆 鏂欑鐮�" v-model="barcode" :focus="barcodeFocus"
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆 璐ф灦鐮�" v-model="barcode" :focus="barcodeFocus"
@input="barcodeInput()">
+ </view>
+ <view class="item">
+ <view class="dropdown" @click="toggleDropdown()">
+ <input type="text" style="width: 650rpx;" v-model="containerType">
+ <uni-icons :type="isOpen ? 'top' : 'bottom'" color="#c1c1c1" style="margin-left: 10rpx;"></uni-icons>
+ <scroll-view scroll-y="ture" class="dropdown-content" v-if="isOpen">
+ <view class="dropdown-item" v-for="option in selects" @click="selected(option)">{{option}}</view>
+ </scroll-view>
+ </view>
</view>
<view class="item">
<input type="text" placeholder=" 鎵爜 / 杈撳叆 鏆傚瓨浣�" v-model="stationCode" :focus="stationCodeFocus"
@@ -150,6 +159,7 @@
barcode: '',
orderNo: '',
stationCode: '',
+ containerType: '',
dataList: [],
count: 0,
rowNum: '',
@@ -171,7 +181,9 @@
flag: 0,
tempOrderInfo: {csocode: '',isoseq: ''},
hide: true,
- hidebg: 'kb-bgtr'
+ hidebg: 'kb-bgtr',
+ isOpen: false,
+ selects: ['1鍙�','2鍙�']
}
},
onLoad() {
@@ -210,6 +222,12 @@
} else {
this.hidebg = 'kb-bgfa'
}
+ },
+ toggleDropdown() {
+ this.isOpen = !this.isOpen
+ },
+ selected(option) {
+ this.containerType = option
},
findOrder() {
let that = this
@@ -689,7 +707,6 @@
/* font-family: PingFang SC; uniapp 榛樿瀛椾綋涓嶅眳涓� */
font-size: 36upx;
font-family: PingFang SC;
- width: 55vw;
}
@@ -716,4 +733,27 @@
text-align: center;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
}
+ .dropdown {
+ position: relative;
+ display: flex;
+ align-items: center;
+ padding: 0rpx 20rpx;
+ }
+ .dropdown-content {
+ position: absolute;
+ top: calc(100% + 15rpx);
+ left: 0;
+ width: calc(100% - 20rpx);
+ max-height: 300rpx;
+ background-color: #fff;
+ box-shadow: 0 0px 6px rgba(0, 0, 0, 0.3);
+ border-radius: 8rpx;
+ z-index: 10;
+ }
+ .dropdown-item {
+ padding: 12rpx;
+ line-height: 1.2;
+ font-size: 12rpx;
+ color: #3a3a3a;
+ }
</style>
\ No newline at end of file
diff --git a/pages/phyz/order/orderList.vue b/pages/phyz/order/orderList.vue
index 6e816e0..815d4a6 100644
--- a/pages/phyz/order/orderList.vue
+++ b/pages/phyz/order/orderList.vue
@@ -30,9 +30,15 @@
<view style="height: 100rpx;"></view>
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
- <view class="buttom">
+ <view class="buttom" v-if="orderType == 'in'">
<button size="mini" @click="reset('warn')">閲嶇疆</button>
<button size="mini" type="primary" @click="combConfirm('warn')">鍘荤粍鎵�</button>
+ </view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="buttom" v-if="orderType == 'out'">
+ <button size="mini" @click="reset('warn')">閲嶇疆</button>
+ <button size="mini" type="primary" @click="combConfirm2('warn')">鍘诲嚭搴�</button>
</view>
</view>
@@ -53,6 +59,7 @@
newDataList: [],
allCheck: false,
allCheckBtnTitle: '鍏ㄩ��',
+ orderType: 'out'
}
},
onLoad() {
@@ -72,17 +79,18 @@
})
that.getOrderDetl(data.item.id)
-
+ that.orderType = 'in'
})
eventChannel.on('item1', function(data) {
console.log(data);
that.orderId = data.item.orderId
+ console.log(data.item.id);
uni.setNavigationBarTitle({
title: data.item.orderNo,
})
that.getOrderDetl(data.item.id)
-
+ that.orderType = 'out'
})
},
onShow() {
@@ -205,6 +213,28 @@
},
});
},
+ combConfirm2(type) {
+ let _this = this
+ let combList = []
+ for (let k of _this.dataList) {
+ if (k.checked) {
+ combList.push(k)
+ }
+ }
+ if (combList.length == 0) {
+ uni.showToast({ title: '璇烽�夋嫨鍑哄簱鍟嗗搧', icon: "error", position: 'top'})
+ return
+ }
+ uni.navigateTo({
+ url: "./preview",
+ success: function(res) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+ res.eventChannel.emit('mats', {
+ mats: combList
+ })
+ },
+ });
+ },
}
}
</script>
diff --git a/pages/phyz/order/preview.vue b/pages/phyz/order/preview.vue
new file mode 100644
index 0000000..6fbca48
--- /dev/null
+++ b/pages/phyz/order/preview.vue
@@ -0,0 +1,265 @@
+<template>
+ <view>
+ <view class="code">
+ <!-- <uni-search-bar :focus="matFocus" v-model="matnr" @input="matInput()" ma
+ maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿鍟嗗搧">
+ </uni-search-bar> -->
+ <view class="code-title">
+ <view></view>
+ <view>鍟嗗搧鍒楄〃</view>
+ <view @click="allChecked">{{allCheckBtnTitle}}</view>
+ </view>
+ </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.batch}}</view>
+ <view class="list-anfme">鏁伴噺锛歿{item.anfme}}</view>
+ <view class="list-qty-1" v-if="item.anfme > item.qty">浣滀笟鏁伴噺锛歿{item.qty}}</view>
+ <view class="list-qty-2" v-if="item.anfme <= item.qty">浣滀笟鏁伴噺锛歿{item.qty}}</view>
+ <view class="card-id">{{i + 1}}</view>
+ <view>璐т綅锛歿{item.locNo}}</view>
+ <view style="display: flex;">鍑哄簱绔欙細
+ <view class="dropdown" @click="toggleDropdown(item)">
+ <input type="text" style="width: 270rpx;" v-model="item.agvStaNo">
+ <uni-icons :type="item.isOpen ? 'top' : 'bottom'" color="#c1c1c1" style="margin-left: 10rpx;"></uni-icons>
+ <scroll-view scroll-y="ture" class="dropdown-content" v-if="item.isOpen">
+ <view class="dropdown-item" v-for="option in selects" @click="selected(option,item)">{{option.value}}</view>
+ </scroll-view>
+ </view>
+ </view>
+ </view>
+ <view class="list-right" @click="checkboxChange(item)">
+ <label >
+ <checkbox :value="item.orderNo" :checked="item.checked" color="" :disabled="item.anfme <= item.qty" style="transform:scale(0.7)" /><text></text>
+ </label>
+ </view>
+ </view>
+ <view style="height: 100rpx;"></view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="buttom">
+ <button size="mini" @click="reset('warn')">绋嶅悗澶勭悊</button>
+ <button size="mini" type="primary" @click="combConfirm('warn')">绔嬪嵆鍑哄簱</button>
+ </view>
+
+
+ </view>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ baseUrl: '',
+ token: '',
+ orderId: '',
+ matFocus: true,
+ matnr: '',
+ checck: true,
+ dataList: [{}],
+ oldDataList: [],
+ newDataList: [],
+ allCheck: false,
+ allCheckBtnTitle: '鍏ㄩ��',
+ orderType: 'out',
+ ids: [],
+ isOpen: false,
+ selects: [
+ {value: "CS-101-001-01@1"},
+ {value: "CS-101-001-02@1"},
+ {value: "CS-101-001-03@1"},
+ {value: "CS-101-002-01@1"},
+ {value: "CS-101-002-02@1"},
+ {value: "CS-101-002-03@1"},
+ ]
+ }
+ },
+ onLoad() {
+ let that = this
+ this.baseUrl = uni.getStorageSync('baseUrl');
+ this.token = uni.getStorageSync('token');
+ // const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE
+ const eventChannel = this.getOpenerEventChannel();
+
+ // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+ eventChannel.on('mats', function(data) {
+ console.log(data);
+ for (let item of data.mats) {
+ that.ids.push(item.id)
+ }
+ that.getPakoutList(that.ids)
+ })
+ },
+ onShow() {
+ if (this.dataList.length > 0) {
+ this.oldDataList = [...this.dataList]
+ }
+ },
+ methods: {
+ toggleDropdown(item) {
+ item.isOpen = !item.isOpen;
+ },
+ selected(option,item) {
+ item.agvStaNo = option.value
+ },
+ // 璁㈠崟鏄庣粏
+ getPakoutList(ids) {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/out/pakout/preview/auth`,
+ header: {'token': uni.getStorageSync('token')},
+ data: ids,
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ for (let k of res.data) {
+ k['isOpen'] = false
+ }
+ _this.dataList = res.data
+ _this.oldDataList = [..._this.dataList]
+ }
+ }
+ })
+ },
+ matInput() {
+ let count = 0
+ let sign = 0
+ if (this.oldDataList.length > 0) {
+ this.dataList = [...this.oldDataList]
+ }
+ this.newDataList = []
+ for (let k in this.dataList) {
+ if (!this.dataList[k].matnr.includes(this.matnr)) {
+ 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
+ },
+ checkboxChange(e) {
+ let items = this.dataList,
+ values = e.orderNo;
+ if (e.checked) {
+ this.$set(e,'checked',false)
+ } else {
+ if (e.anfme == e.qty) {
+ this.$set(e,'checked',false)
+ } else {
+ this.$set(e,'checked',true)
+ }
+
+ }
+ },
+ allChecked() {
+ if (this.allCheck) {
+ this.allCheck = false
+ this.allCheckBtnTitle = '鍏ㄩ��'
+ } else {
+ this.allCheck = true
+ this.allCheckBtnTitle = '鍙栨秷'
+ }
+ for (let item of this.dataList) {
+ if (this.allCheck) {
+ if (item.anfme == item.qty) {
+ this.$set(item,'checked',false)
+ } else {
+ this.$set(item,'checked',true)
+ }
+ } else {
+ this.$set(item,'checked',false)
+ }
+ }
+ },
+ clear() {
+ this.matnr = ''
+ this.dataList = [...this.oldDataList]
+ },
+ combConfirm(type) {
+ let _this = this
+ let combList = []
+ for (let k of _this.dataList) {
+ if (k.checked) {
+ if (k.agvStaNo == null) {
+ uni.showToast({ title: `${k.locNo}褰撳墠璐т綅娌℃湁閫夋嫨鍑哄簱绔檂, icon: "error", position: 'top'})
+ return
+ } else {
+ combList.push(k)
+ }
+ }
+ }
+ if (combList.length == 0) {
+ uni.showToast({ title: '璇烽�夋嫨鍑哄簱鍟嗗搧', icon: "error", position: 'top'})
+ return
+ }
+ uni.request({
+ url: `${_this.baseUrl}/out/pakout/auth`,
+ header: {'token': uni.getStorageSync('token')},
+ data: combList,
+ method: 'POST',
+ success(res) {
+ res = res.data
+ console.log(res);
+ }
+ })
+ },
+ combConfirm2(type) {
+ let _this = this
+ let combList = []
+ for (let k of _this.dataList) {
+ if (k.checked) {
+ combList.push(k)
+ }
+ }
+ if (combList.length == 0) {
+ uni.showToast({ title: '璇烽�夋嫨鍑哄簱鍟嗗搧', icon: "error", position: 'top'})
+ return
+ }
+ uni.navigateTo({
+ url: "../AGV/AGVPakin2",
+ success: function(res) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+ res.eventChannel.emit('mats', {
+ mats: combList
+ })
+ },
+ });
+ },
+ }
+ }
+</script>
+
+<style>
+ @import url('../../../static/css/common/order.css');
+ .list-anfme {
+ color: #0082ff;
+ font-weight: bold;
+ }
+ .list-qty-1 {
+ color: #33ba43;
+ font-weight: bold;
+ }
+ .list-qty-2 {
+ color: #e2231a;
+ font-weight: bold;
+ }
+</style>
\ No newline at end of file
diff --git a/static/css/common/order.css b/static/css/common/order.css
index 4665071..d5a20e3 100644
--- a/static/css/common/order.css
+++ b/static/css/common/order.css
@@ -93,4 +93,28 @@
background-color: #e6f7ff;
border: 1px solid #91d5ff;
border-radius: 6rpx;
+ }
+ .dropdown {
+ position: relative;
+ display: flex;
+ align-items: center;
+ border-bottom: 1px solid #333;
+ padding: 0rpx 20rpx;
+ }
+ .dropdown-content {
+ position: absolute;
+ top: calc(100% + 15rpx);
+ left: 0;
+ width: calc(100%);
+ max-height: 300rpx;
+ background-color: #fff;
+ box-shadow: 0 0px 6px rgba(0, 0, 0, 0.3);
+ border-radius: 8rpx;
+ z-index: 10;
+ }
+ .dropdown-item {
+ padding: 12rpx;
+ line-height: 1.2;
+ font-size: 12rpx;
+ color: #3a3a3a;
}
\ No newline at end of file
--
Gitblit v1.9.1