From 9b78294b36a634baadd9e0700398672a55806c75 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 30 七月 2024 13:46:43 +0800
Subject: [PATCH] #
---
pages/pakin/pakin.vue | 186 ++++++++++++++++++++++++++++++----------------
1 files changed, 122 insertions(+), 64 deletions(-)
diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue
index 456e187..5f535dd 100644
--- a/pages/pakin/pakin.vue
+++ b/pages/pakin/pakin.vue
@@ -7,13 +7,8 @@
@input="barcodeInput()">
</view>
<view class="item">
- <view class="code-decs">鐗╂枡鐮�:</view>
- <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()">
- <view class="item-right">
- <button></button>
- <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text>
- <uni-icons type="right" color="#c1c1c1"></uni-icons>
- </view>
+ <view class="code-decs">绔欑偣:</view>
+ <uni-combox :candidates="staList" placeholder="璇烽�夋嫨鍏ュ簱绔欑偣" v-model="sta"></uni-combox>
</view>
</view>
<view class="mat-list-title">
@@ -33,29 +28,43 @@
</view>
</view>
<view class="list-left-item">
- <view class="desc">鍝佸悕锛�</view>
- <view class="left-item">{{item.maktx}}</view>
+ <view class="desc">鎵瑰彿锛�</view>
+ <view class="left-item">{{item.batch}}</view>
</view>
<view class="list-left-item">
- <view class="desc">瑙勬牸锛�</view>
+ <view class="desc">鑶滅被鍨嬶細</view>
<view class="left-item">{{item.specs}}</view>
</view>
<view class="list-left-item">
- <view class="desc">鎵瑰彿锛�</view>
- <view class="left-item">
- <uni-tag :text="item.batch" type="warning"></uni-tag>
- </view>
+ <view class="desc">鐢熶骇鏃ユ湡锛�</view>
+ <view class="left-item">{{item.manuDate}}</view>
</view>
<view class="list-left-item">
+ <view class="desc">鍨嬪彿锛�</view>
+ <view class="left-item">{{item.model}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">瀹藉害锛�</view>
+ <view class="left-item">{{item.specs}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">闀垮害锛�</view>
+ <view class="left-item">{{item.length}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">闈㈢Н锛�</view>
+ <view class="left-item">{{item.volume}}</view>
+ </view>
+ <!-- <view class="list-left-item">
<view class="desc">閲嶉噺锛�</view>
<view class="left-item">
<uni-tag :text="item.weight" type="warning"></uni-tag>
</view>
- </view>
- <view class="list-left-item">
+ </view> -->
+ <!-- <view class="list-left-item">
<view class="desc">鏁伴噺锛�</view>
<view class="left-item">{{item.anfme}}</view>
- </view>
+ </view> -->
</view>
<view class="list-right">
<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
@@ -66,7 +75,7 @@
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
<view class="buttom">
<button size="mini" @click="reset('warn')">閲嶇疆</button>
- <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button>
+ <button size="mini" type="primary" @click="combConfirm('warn')">鍏ュ簱</button>
</view>
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
@@ -82,20 +91,34 @@
style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;">
</view>
</view>
- <!-- <view class="popup-item">
+ <view class="popup-item">
<view class="popup-item-left">鎵瑰彿:</view>
<view class="popup-item-right"><input type="text" v-model="batch"></view>
- </view> -->
+ </view>
<view class="popup-item">
- <view class="popup-item-left">閲嶉噺:</view>
+ <view class="popup-item-left">鑶滅被鍨�:</view>
+ <view class="popup-item-right"><input type="text" v-model="specs"></view>
+ </view>
+ <view class="popup-item">
+ <view class="popup-item-left">鐢熶骇鏃ユ湡:</view>
+ <view class="popup-item-right"><input type="text" v-model="manuDate"></view>
+ </view>
+ <view class="popup-item">
+ <view class="popup-item-left">鍨嬪彿:</view>
+ <view class="popup-item-right"><input type="text" v-model="model"></view>
+ </view>
+ <view class="popup-item">
+ <view class="popup-item-left">瀹藉害:</view>
<view class="popup-item-right"><input type="text" v-model="weight"></view>
</view>
<view class="popup-item">
- <view class="popup-item-left">鏁伴噺:</view>
- <view class="popup-item-right" style="border: none;justify-content: center;">
- <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" />
- </view>
+ <view class="popup-item-left">闀垮害:</view>
+ <view class="popup-item-right"><input type="text" v-model="length"></view>
</view>
+ <view class="popup-item">
+ <view class="popup-item-left">闈㈢Н:</view>
+ <view class="popup-item-right"><input type="text" v-model="volume"></view>
+ </view>
<view class="btn">
<view class="btn-left" @click="reviseClose">鍙栨秷</view>
<view class="btn-right" @click="reviseConfirm()">淇敼</view>
@@ -156,6 +179,13 @@
matFocus: false,
matData: '',
removeNum: 0,
+ specs:'',
+ manuDate:'',
+ model:'',
+ length:'',
+ volume:'',
+ staList:[104],
+ sta:''
}
},
onLoad() {
@@ -165,7 +195,7 @@
this.baseUrl = uni.getStorageSync('baseUrl');
this.token = uni.getStorageSync('token');
},
- methods: {
+ methods: {
messageToggle(type) {
this.msgType1 = type
this.$refs.message.open()
@@ -174,6 +204,7 @@
barcodeInput() {
// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
setTimeout(() => {
+ let that = this;
var len = this.barcode.length
if (len != 8) {
uni.showToast({
@@ -183,6 +214,45 @@
});
this.barcodeFocuss()
return;
+ }else{
+ uni.request({
+ url: that.baseUrl + '/waitPakin/selectByBarcode/list',
+ data: {
+ barcode: that.barcode
+ },
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ success(result) {
+ result = result.data
+ if (result.code === 200 && result.data) {
+ that.matData = result.data
+ for(var list in that.matData.records){
+ console.log(list)
+ that.checkMat(that.matData.records[list])
+ }
+
+ } else if (result.code == 403) {
+ uni.showToast({
+ title: result.msg,
+ icon: "none",
+ position: 'top'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: result.msg,
+ icon: "none",
+ position: 'top'
+ })
+ }
+
+ }
+ });
}
this.focuss()
}, 200)
@@ -198,7 +268,8 @@
},
// 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
focuss() {
- this.focus = false;
+ this.barcodeFocus = false;
+ this.matFocus = false;
setTimeout(() => {
this.matnr = '';
this.matFocus = true;
@@ -208,7 +279,7 @@
findMat() {
let that = this
uni.request({
- url: that.baseUrl + '/mat/auth',
+ url: that.baseUrl + '/mat/split',
data: {
matnr: that.matnr
},
@@ -218,28 +289,11 @@
success(result) {
result = result.data
if (result.code === 200 && result.data) {
- that.matData = result.data
- that.matnr = ''
- that.matData['batch'] = ''
- uni.navigateTo({
- url: "../mat/matSelected",
- // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- success: function(res) {
- res.eventChannel.emit('mat', {
- data: result.data
- })
- },
- // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
- events: {
- matList: function(data) {
- that.checkMat(data.data)
- that.focuss()
- },
- },
- });
- } else if (res.code == 403) {
+ that.matData = result.data
+ that.checkMat(that.matData)
+ } else if (result.code == 403) {
uni.showToast({
- title: res.msg,
+ title: result.msg,
icon: "none",
position: 'top'
})
@@ -250,7 +304,7 @@
}, 1000);
} else {
uni.showToast({
- title: res.msg,
+ title: result.msg,
icon: "none",
position: 'top'
})
@@ -312,13 +366,18 @@
if (add) {
this.dataList.unshift(mat)
}
+ this.$forceUpdate() // 寮哄埗鍒锋柊
},
// 淇敼鎵瑰彿
revise(item, i) {
- this.matnr = this.dataList[i].matnr
- this.count = this.dataList[i].anfme
+ this.matnr = this.dataList[i].matnr
this.batch = this.dataList[i].batch
this.weight = this.dataList[i].weight
+ this.specs = this.dataList[i].specs
+ this.manuDate = this.dataList[i].manuDate
+ this.model = this.dataList[i].model
+ this.length = this.dataList[i].length
+ this.volume = this.dataList[i].volume
this.rowNum = i
this.eject()
},
@@ -362,7 +421,7 @@
combConfirm(type) {
this.msgType = type
this.title = '璀﹀憡'
- this.content = '鏄惁鐜板湪缁勬墭!'
+ this.content = '鏄惁鐜板湪鍏ュ簱!'
this.$refs.combConfirm.open()
},
combClose() {
@@ -381,18 +440,16 @@
this.messageToggle('error')
return;
}
- for (var i = 0; i < that.dataList.length; i++) {
- if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
- this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
- this.messageToggle('error')
- return;
- }
+ if (that.sta === '') {
+ this.messageText = "璇烽�夋嫨绔欑偣"
+ this.messageToggle('error')
+ return;
}
uni.request({
- url: that.baseUrl + '/mobile/comb/auth',
+ url: that.baseUrl + '/mobile/inbound/auth',
data: JSON.stringify({
barcode: that.barcode,
- combMats: that.dataList
+ sta: that.sta
}),
method: 'POST',
header: {
@@ -402,8 +459,8 @@
var res = result.data
if (res.code === 200) {
that.resst();
- that.messageText = "缁勬墭鎴愬姛"
- that.messageToggle('success')
+ that.messageText = "鐢熸垚鍏ュ簱浠诲姟鎴愬姛"
+ that.messageToggle('success')
} else if (res.code == 403) {
that.messageText = res.msg
that.messageToggle('error')
@@ -439,6 +496,7 @@
resst() {
this.dataList = []
this.barcode = ''
+ this.sta = ''
this.barcodeFocuss()
},
}
@@ -495,6 +553,6 @@
z-index: 9;
/* border-top: 1px solid #DCDFE6; */
text-align: center;
- box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
+ box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
}
</style>
--
Gitblit v1.9.1