From 3afe42dec5534422f2a99292542fbba86883b527 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 14 五月 2025 13:47:25 +0800
Subject: [PATCH] 1.采购入库扫条码实现
---
config/api.js | 11
pages/wlgl/cgrk3.vue | 550 ++++++++++++++---------------
/dev/null | 460 -------------------------
pages/sbgl/rcdj.vue | 3
pages/wlgl/cgrk2.vue | 2
pages/wlgl/cgdh3.vue | 2
pages/wlgl/cgrk4.vue | 38 -
pages/wlgl/cgrk.vue | 2
8 files changed, 294 insertions(+), 774 deletions(-)
diff --git a/config/api.js b/config/api.js
index c65879d..12cb085 100644
--- a/config/api.js
+++ b/config/api.js
@@ -393,8 +393,11 @@
})
-
-
-//閲囪喘鍏ュ簱鎻愪氦
+//閲囪喘鍏ュ簱鎻愪氦-鎸夐噰璐鍗�
export const MesAppPurchInStorSave = (data1, data2, config = {}) => http.post(
- '/AppPurchManagement/MesAppPurchInStorSave' + data1, data2, config)
\ No newline at end of file
+ '/AppPurchManagement/MesAppPurchInStorSave' + data1, data2, config)
+
+
+//閲囪喘鍏ュ簱鎻愪氦-鎸夊埌璐ф爣绛�
+export const MesAppPurchInStorLabSave = (data1, data2, config = {}) => http.post(
+ '/AppPurchManagement/MesAppPurchInStorLabSave' + data1, data2, config)
\ No newline at end of file
diff --git a/pages/sbgl/rcdj.vue b/pages/sbgl/rcdj.vue
index 991b977..5d6ee32 100644
--- a/pages/sbgl/rcdj.vue
+++ b/pages/sbgl/rcdj.vue
@@ -182,6 +182,7 @@
console.log("鎵弿鍒扮殑鍐呭涓�:", content)
_this.getCheckScanDeviceQrCodeData(content)
})
+
},
onPullDownRefresh() {
setTimeout(() => {
@@ -211,7 +212,7 @@
mounted() {
this.init()
- this.getCheckScanDeviceQrCodeData('111')
+ // this.getCheckScanDeviceQrCodeData('111')
},
methods: {
diff --git a/pages/wlgl/cgdh3.vue b/pages/wlgl/cgdh3.vue
index bdcc506..fbd9a3e 100644
--- a/pages/wlgl/cgdh3.vue
+++ b/pages/wlgl/cgdh3.vue
@@ -614,6 +614,8 @@
hpartcode: i.partcode,
hplanqty: i.quantity,
hqty: i.labelCount,
+ hsourceid: i.orderid,
+ hsourcesbid: i.sbid,
hischeck: i.is_incheck, //鏆傛椂鍐欐
children: i.labelArr
})
diff --git a/pages/wlgl/cgrk.vue b/pages/wlgl/cgrk.vue
index f083e65..99642d1 100644
--- a/pages/wlgl/cgrk.vue
+++ b/pages/wlgl/cgrk.vue
@@ -1,6 +1,6 @@
<template>
<view>
- <page-nav title="閲囪喘鍏ュ簱1"></page-nav>
+ <page-nav title="閲囪喘鍏ュ簱"></page-nav>
<view class="body" style="flex-direction: column;">
<u-button type="primary" icon='plus-circle' size='large' style="width: 96%;margin-left: 2%;margin-top: 70%;"
:plain="true" :hairline="true" @click="navigateTo" text="閫夋嫨閲囪喘璁㈠崟"></u-button>
diff --git a/pages/wlgl/cgrk2.vue b/pages/wlgl/cgrk2.vue
index 8e7c341..d64df01 100644
--- a/pages/wlgl/cgrk2.vue
+++ b/pages/wlgl/cgrk2.vue
@@ -1,6 +1,6 @@
<template>
<view>
- <page-nav title="閲囪喘鍏ュ簱2"></page-nav>
+ <page-nav title="閲囪喘鍏ュ簱"></page-nav>
<view v-if="purchorderArrAll.length===0">
diff --git a/pages/wlgl/cgrk3.vue b/pages/wlgl/cgrk3.vue
index eb6da76..2cc56a1 100644
--- a/pages/wlgl/cgrk3.vue
+++ b/pages/wlgl/cgrk3.vue
@@ -1,35 +1,25 @@
<template>
<view>
- <page-nav title="閲囪喘鍏ュ簱3"></page-nav>
-
-
-
- <view v-if="purchorderArr.length===0">
- <div class="sacnBody">
- <div class="scanImg" @click="topScanClick"></div>
- <div class="scanText">鎵弿鐗╂枡鏍囩</div>
- </div>
- </view>
+ <page-nav title="閲囪喘鍏ュ簱"></page-nav>
<view v-if='purchorderArr.length!==0' class="mainContent" style="">
<view>
<u-gap height="10" bgColor="#eff0f1"></u-gap>
<view class="head">
-
- <view style="max-height: 940rpx;overflow: auto;">
+ <!-- max-height: 1340rpx;overflow: auto; -->
+ <view style="max-height: 1020rpx;overflow: auto;">
<view class="head" style="position: relative;">
- <u-radio-group v-model="radioValue" class="flex_column">
- <view class=" flex_column" style="width: 100%;" @click="radioValueClick(item.hbarcode)"
- v-for="(item,index) in purchorderDetailArr" :key="item.hbarcode">
-
+ <u-radio-group class="flex_column">
+ <view class=" flex_column" style="width: 100%;" v-for="(item,index) in purchorderArr"
+ :key="item.hbarcode">
<view class="head_block" style="position: absolute;margin: 38rpx 0 0 0;">
<view class="head_left">
<view class="head_bar"></view>
<view class="head_title" style="font-weight: bold;">
- 鏍囩淇℃伅
+ 鐗╂枡淇℃伅
</view>
</view>
</view>
@@ -39,12 +29,11 @@
{{(index+1).toString().padStart(2,0)}}
</view>
- <view class="trash" v-show="purchorderDetailArr.length>1"
- @click="trashClick(index)">
+ <view class="trash" v-show="purchorderArr.length>1" @click="trashClick(index)">
<u-icon name="trash" size='20'></u-icon>
</view>
- <view v-show="purchorderDetailArr.length===1" style="width: 48rpx;height: 48rpx;">
+ <view v-show="purchorderArr.length===1" style="width: 48rpx;height: 48rpx;">
</view>
@@ -52,43 +41,62 @@
<view class="flex_between marginBottom20 marginLeft20 marginTop20">
<view style="display: flex;">
<view class="flex_column titleFont">
+ <view>鐗╂枡缂栫爜锛�</view>
+ <view>鐗╂枡鍚嶇О锛�</view>
+ <view>鐗╂枡瑙勬牸锛�</view>
+ <view>鍒拌揣鍗曞彿锛�</view>
+
<view>鐗╂枡鏍囩锛�</view>
- <view>鏍囩鏁伴噺锛�</view>
+ <view>鐗╂枡鏁伴噺锛�</view>
<view>渚涙柟淇℃伅锛�</view>
<view>閲囪喘鎵规锛�</view>
<view>璐ㄩ噺鐘舵�侊細</view>
</view>
<view class="flex_column contentFont">
+ <view>{{item.partcode}}</view>
+ <view>{{item.partname}}</view>
+ <view class="ellipsis" style="width: 460rpx;">
+ {{item.partspec?item.partspec:'/'}}
+ </view>
+ <view>{{item.hbillno}}</view>
+
<view>{{item.hbarcode}}</view>
<view>{{item.hqty}}</view>
- <view class="ellipsis" style="width: 460rpx;">{{item.hcustomername}}
- </view>
- <view>{{item.hbatchno}}</view>
- <!-- <view>{{item.qualitystatus?item.qualitystatus:'/'}}</view> -->
- <view v-if="item.qualitystatus===null">/</view>
- <view v-else style="display: flex;align-items: center;">
- <!-- <u-icon
- :name="item.qualitystatus==='OK'?'checkmark-circle-fill':'close-circle-fill'"
- :color="item.qualitystatus==='OK'?'#55ff00':'#FF0000'"
- size="40"></u-icon>
- <view style="margin-left: 10rpx;">
- {{item.qualitystatus==='OK'?'鍚堟牸':'涓嶅悎鏍�'}}
- </view> -->
+ <view>{{item.hcustomername}}</view>
+ <view>/</view>
+ <view>
+ <view v-if="!item.qualitystatus">/</view>
+ <view v-else style="display: flex;align-items: center;">
- <u-icon name="more-circle-fill" color="#55aaff" size="20"></u-icon>
- <view style="margin-left: 10rpx;">
- 寰呮
+ <u-icon name="tags-fill" color="green" size="20"
+ v-if="item.qualitystatus==='CS'"></u-icon>
+ <view style="margin-left: 10rpx;"
+ v-if="item.qualitystatus==='CS'">鍏嶆</view>
+
+ <u-icon name="checkmark-circle-fill" color="#55ff00" size="20"
+ v-if="item.qualitystatus==='OK'"></u-icon>
+ <view style="margin-left: 10rpx;"
+ v-if="item.qualitystatus==='OK'">鍚堟牸</view>
+
+ <u-icon name="close-circle-fill" color="#FF0000" size="20"
+ v-if="item.qualitystatus==='NG'"></u-icon>
+ <view style="margin-left: 10rpx;"
+ v-if="item.qualitystatus==='NG'">涓嶅悎鏍�</view>
+
+ <u-icon name="more-circle-fill" color="#55aaff" size="20"
+ v-if="item.qualitystatus==='TS'"></u-icon>
+ <view style="margin-left: 10rpx;"
+ v-if="item.qualitystatus==='TS'">寰呮</view>
+
</view>
-
</view>
+
</view>
</view>
- <u-radio size='20' class="marginRight20" :key="item.hbarcode"
- :name="item.hbarcode" activeColor="red"></u-radio>
+
</view>
- <u-gap height="10" v-if="index!==purchorderDetailArr.length-1"
- bgColor="#eff0f1"></u-gap>
+ <u-gap height="10" v-if="index!==purchorderArr.length-1" bgColor="#eff0f1"></u-gap>
</view>
</u-radio-group>
@@ -97,104 +105,83 @@
</view>
</view>
+
+
+
</view>
+
</view>
- <!-- <view v-if='purchorderArr.length!==0' class="footer">
- <view class="head_block" style="align-items: center;padding: 0 23rpx;">
+
+ <view class="footer" v-if='purchorderArr.length!==0'>
+ <view class="head_block">
<view class="head_left">
<view class="head_bar"></view>
<view class="head_title" style="font-weight: bold;">
- 閫夋嫨璐ㄦ鏂规
+ 鎵弿搴撲綅
</view>
</view>
- <view class="flex_center" style="margin-right: 20rpx;">
- <view @click='sheetClick' class="custominputClass">
-
- <view v-show='sheetValue===""' style="color: rgb(192, 196, 204);">璇烽�夋嫨</view>
- <view v-show='sheetValue!==""' class="ellipsis" style="width: 390rpx;">
- {{sheetValue}}
- </view>
-
- <u-icon :name="!sheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
- </view>
+ <view class="marginRight20">
+ <u-icon name="scan" @click="topScanClick" color="red" size="28"></u-icon>
</view>
-
</view>
- </view> -->
- <u-picker :show="sheetShow" :columns="columns" :itemHeight='55' :closeOnClickOverlay='true'
- @close='sheetShow=false' @confirm='pickerConfirm' @cancel='sheetShow=false'></u-picker>
+ <view class="flex_between marginBottom20 marginLeft20 marginTop20">
+ <view style="display: flex;">
+ <view class="flex_column titleFont">
+ <view>搴撲綅淇℃伅锛�</view>
+ <view>鎵�灞炰粨搴擄細</view>
+ </view>
+
+ <view class="flex_column contentFont" @click="sheetShow=true">
+ <view v-if="purchorderObj.lcationcode">{{purchorderObj.lcationcode}}</view>
+ <view v-else style="color: #ccc;">鐐瑰嚮閫夋嫨鎴栨壂搴撲綅鐮�</view>
+ <view v-if="purchorderObj.stockcode">{{purchorderObj.stockcode}}</view>
+ <view v-else style="color: #ccc;">鐐瑰嚮閫夋嫨鎴栨壂搴撲綅鐮�</view>
+ </view>
+ </view>
+ </view>
- <view class="footer">
+ <u-button size="large" :loading="isDisabledSubmitButton" :disabled="isDisabledSubmitButton"
+ loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary" @click="submit" text="纭鎻愪氦">
+ </u-button>
+ </view>
- <u-button :disabled="!sheetValue" v-if='purchorderArr.length!==0' type="primary" size='large'
- :hairline="true" @click="navigateTo" text="涓嬩竴姝�"></u-button>
+ <view v-if='purchorderArr.length===0'>
+ <div class="sacnBody">
+ <div class="scanImg" @click="topScanClick2"></div>
+ <div class="scanText">鎵弿鐗╂枡鏉$爜</div>
+ </div>
</view>
- <!-- <scan-code></scan-code> -->
+
+ <u-picker :show="sheetShow" :columns="columns" :itemHeight='55' :closeOnClickOverlay='true'
+ @close='sheetShow=false' @change="changeHandler" @confirm='pickerConfirm'
+ @cancel='sheetShow=false'></u-picker>
+
<!-- 鎮诞鐞� -->
- <!-- <view v-show="purchorderArr.length!==0&&!sheetShow" @click="topScanClick">
+ <view v-if='purchorderArr.length!==0' @click="topScanClick2">
<drag-ball :x='$DeviceInformation.screenWidth*0.8' :y="$DeviceInformation.screenHeight*0.7"></drag-ball>
- </view> -->
+ </view>
-
- <!-- <navigator :url="'./rcjy2?item='+ encodeURIComponent(JSON.stringify(item))"> -->
- <!-- <navigator :url="'./rcjy2?item='+encodeURIComponent(1)">
- </navigator>
- -->
</view>
</template>
<script>
import {
- MesAppPurchInStorScanLabCode
+ MesAppPurchInStorScanLabCode,
+ WarehouseLocationSearchStoreHouse,
+ MesAppPurchInStorLabSave,
+ WareHouseLocation
} from '../../config/api.js';
- // import scanCode from '@/components/scan-code/scan-code.vue'
- const App = getApp()
export default {
- // components: {
- // scanCode
- // },
onLoad(option) {
-
- // if (option.length !== undefined) {
- // let t1 = JSON.parse(uni.getStorageSync('purchorderArr'))
- // let t2 = JSON.parse(uni.getStorageSync('purchorderDetailArr'))
- // // 鏄惁鍚屾鎵规
- // if (option.issyncbatch === 'true') { //鏄�
- // console.log('鎵ц1')
- // this.purchorderArr = t1.filter(i => {
- // return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
- // option.hbatchno)
- // })
- // this.purchorderDetailArr = t2.filter(i => {
- // console.log(!(i.hbillno === option.hbillno && i.partcode === option.partcode && i
- // .hbatchno ===
- // option.hbatchno))
- // return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
- // option.hbatchno)
- // })
-
- // } else if (option.issyncbatch === 'false') { //鍚�
- // console.log('鎵ц2')
- // this.purchorderDetailArr = t2.filter(i => i.hbarcode !== option.labcode)
- // this.purchorderArr = t1.filter(i => i.hbarcode !== option.labcode)
- // }
- // console.log('鎵ц3')
- // this.radioValue = this.purchorderDetailArr[0].hbarcode
- // const t = this.purchorderDetailArr.find(i => i.hbarcode === this.radioValue).hbillno
- // this.purchorderObj = this.purchorderArr.find(i => i.hbillno === t)
- // this.$forceUpdate()
- // }
-
-
},
@@ -208,74 +195,14 @@
data() {
return {
-
-
- // "hbillno": "DH2303311361", //鍗曟嵁缂栧彿
- // "partcode": "102", //浜у搧缂栫爜
- // "partname": "鍐呭瓨", //浜у搧鍚嶇О
- // "partspec": "", //浜у搧瑙勬牸
- // "hbarcode": "DH2303311360", //鐗╂枡鏍囩
- // "stocktype_code": "1", //瀛樿揣绫诲瀷缂栫爜
- // "hqty": 300.00, //鏍囩鏁伴噺
- // "hcustomercode": "0010002", //渚涘簲鍟嗙紪鐮�
- // "hcustomername": "钂傛.鍏嬭檹浼彂鍔ㄦ満绯荤粺锛堝父宸烇級鏈夐檺鍏徃", //渚涘簲鍟嗗悕绉�
- // "hbatchno": "2", //閲囪喘鎵规
- // "qualitystatus": null //璐ㄩ噺鐘舵��
-
- purchorderObj: {},
- purchorderArr: [
- // {
- // hbillno: 'DH2304041465',
- // partcode: 'ZG-Y-001',
- // partname: 'ZG鍘熸潗鏂�001',
- // partspec: '#001'
- // },
- // {
- // hbillno: 'DH2304041463',
- // partcode: 'ZG-Y-002',
- // partname: 'ZG鍘熸潗鏂�002',
- // partspec: '#002'
- // }
- ],
- purchorderDetailArr: [
- // {
- // hbillno: 'DH2304041465',
- // hbarcode: 'DH2304041464',
- // hqty: 100,
- // hcustomername: 'ZG澶栬喘渚涘簲鍟�',
- // hbatchno: '#101',
- // qualitystatus: 'NG'
- // },
- // {
- // hbillno: 'DH2304041463',
- // hbarcode: 'DH2304041462',
- // hqty: 400,
- // hcustomername: 'ZG澶栬喘渚涘簲鍟�',
- // hbatchno: '#101',
- // qualitystatus: 'OK'
- // },
- // {
- // hbillno: 'DH2304041463',
- // hbarcode: 'DH2304041461',
- // hqty: 300,
- // hcustomername: 'ZG澶栬喘渚涘簲鍟�',
- // hbatchno: '#101',
- // qualitystatus: 'NG'
- // }, {
- // hbillno: 'DH2304041463',
- // hbarcode: 'DH2304041460',
- // hqty: 200,
- // hcustomername: 'ZG澶栬喘渚涘簲鍟�',
- // hbatchno: '#101',
- // qualitystatus: 'OK'
- // },
- ],
- radioValue: '',
-
+ purchorderArr: [],
sheetShow: false, //涓婃媺鍒楄〃鏄惁灞曞紑
- sheetValue: '',
sheetList: [],
- columns: []
+ columns: [],
+ columnsData: [],
+ wareHouseLocationArr: [], //浠撳簱搴撲綅鏁扮粍
+ isDisabledSubmitButton: false,
+ purchorderObj: {}, //瀛樺偍浠撳簱搴撲綅淇℃伅
}
},
created() {
@@ -283,46 +210,48 @@
},
mounted() {
this.init()
+ this.getWareHouseLocation()
-
- this.getMesAppPurchInStorScanLabCode('DH25050900016')
+ // this.getMesAppPurchInStorScanLabCode('DH25051400099')
+ // this.getWarehouseLocationSearchStoreHouse('0011')
+ // setTimeout(() => {
+ // this.getMesAppPurchInStorScanLabCode('DH25051400096')
+ // }, 2000)
},
methods: {
+ // 鑾峰彇寮瑰嚭灞備粨搴撳簱浣嶄俊鎭�
+ async getWareHouseLocation() {
+ const {
+ data: res
+ } = await WareHouseLocation()
+ this.wareHouseLocationArr = res.filter(i => i.children.length > 0)
+ this.columns = [
+ this.wareHouseLocationArr.map(i => i.text),
+ this.wareHouseLocationArr[0].children.map(i => i.text)
+ ]
+ this.wareHouseLocationArr.forEach(i => {
+ this.columnsData.push(i.children.map(j => j.text))
+ })
+
+ },
+ changeHandler(e) {
+ const {
+ columnIndex,
+ value,
+ values, // values涓哄綋鍓嶅彉鍖栧垪鐨勬暟缁勫唴瀹�
+ index,
+ // 寰俊灏忕▼搴忔棤娉曞皢picker瀹炰緥浼犲嚭鏉ワ紝鍙兘閫氳繃ref鎿嶄綔
+ picker = this.$refs.uPicker
+ } = e
+ // 褰撶涓�鍒楀�煎彂鐢熷彉鍖栨椂锛屽彉鍖栫浜屽垪(鍚庝竴鍒�)瀵瑰簲鐨勯�夐」
+ if (columnIndex === 0) {
+ // picker涓洪�夋嫨鍣╰his瀹炰緥锛屽彉鍖栫浜屽垪瀵瑰簲鐨勯�夐」
+ picker.setColumnValues(1, this.columnsData[index])
+ }
+ },
init() {
uni.stopPullDownRefresh();
- },
- //鏉ヨ嚜浜庨〉闈�3鐨勫�� 杩涜鏁版嵁澶勭悊
- fromSubmitData(option) {
-
- let t1 = JSON.parse(uni.getStorageSync('purchorderArr'))
- let t2 = JSON.parse(uni.getStorageSync('purchorderDetailArr'))
- // 鏄惁鍚屾鎵规
- if (option.issyncbatch === 'Y') { //鏄�
- console.log('鎵ц1')
- this.purchorderArr = t1.filter(i => {
- return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
- option.hbatchno)
- })
- this.purchorderDetailArr = t2.filter(i => {
- return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
- option.hbatchno)
- })
-
- } else if (option.issyncbatch === 'N') { //鍚�
- console.log('鎵ц2')
- this.purchorderDetailArr = t2.filter(i => i.hbarcode !== option.labcode)
- this.purchorderArr = t1.filter(i => i.hbarcode !== option.labcode)
- }
- console.log('鎵ц3')
- if (this.purchorderDetailArr.length > 0) {
- this.radioValue = this.purchorderDetailArr[0].hbarcode
- const t = this.purchorderDetailArr.find(i => i.hbarcode === this.radioValue).hbillno
- this.purchorderObj = this.purchorderArr.find(i => i.hbillno === t)
- }
-
- this.$forceUpdate()
-
},
// 鎵弿
topScanClick() {
@@ -336,18 +265,7 @@
console.log('鏉$爜绫诲瀷锛�' + res.scanType);
console.log('鏉$爜鍐呭锛�' + res.result);
that.scanContent = res.result;
- let flag = false
- that.purchorderDetailArr.forEach(item => {
- if (item.hbarcode === res.result) {
- flag = true
- }
- })
- if (flag) {
- that.$u.toast('姝ゆ潯鐮佸凡鎵弿锛屽凡鍦ㄥ垪琛ㄤ腑锛�')
- } else {
- //澶勭悊鎵爜浜嬩欢
- that.getMesAppPurchInStorScanLabCode(that.scanContent);
- }
+ that.getWarehouseLocationSearchStoreHouse(that.scanContent)
},
complete: function(res) {
@@ -359,85 +277,144 @@
});
},
+
+ // 鎵弿鐗╂枡淇℃伅鐮�
+ topScanClick2() {
+ let that = this;
+
+ uni.scanCode({
+ onlyFromCamera: true,
+ // scanType: ['barCode', 'qrCode'],
+ scanType: ['qrCode'],
+ success: function(res) {
+ console.log('鏉$爜绫诲瀷锛�' + res.scanType);
+ console.log('鏉$爜鍐呭锛�' + res.result);
+ that.scanContent = res.result;
+ if (that.purchorderArr.findIndex(i => i.hbarcode === that.scanContent) > -1) {
+ that.$u.toast('姝ゆ潯鐮佸凡鍦ㄥ垪琛ㄤ腑')
+ } else {
+ that.getMesAppPurchInStorScanLabCode(that.scanContent)
+ }
+
+
+ },
+ complete: function(res) {
+
+ },
+ fail: function(res) {
+ console.log('鏉$爜绫诲瀷锛�' + res.scanType);
+ console.log('鏉$爜鍐呭锛�' + res.result);
+ }
+
+ });
+ },
+
+ async getWarehouseLocationSearchStoreHouse(locationcode) {
+ const data = {
+ locationcode
+ }
+ const res = await WarehouseLocationSearchStoreHouse(data)
+ if (res.code === '200') {
+ this.purchorderObj.lcationcode = res.data[0].locationname
+ this.purchorderObj.stockcode = res.data[0].warehousename
+
+ this.purchorderObj.lcationname2 = res.data[0].locationcode
+ this.purchorderObj.stockname2 = res.data[0].warehousecode
+ this.$forceUpdate()
+ } else {
+ this.$u.toast(res.message)
+ }
+ },
// 鑾峰彇鏍囩淇℃伅
async getMesAppPurchInStorScanLabCode(labcode) {
const data = {
labcode
}
const res = await MesAppPurchInStorScanLabCode(this.global.formatData(data))
-
if (res.code === '200') {
- console.log(res)
- this.purchorderArr.unshift({
- hbillno: res.data[0].hbillno,
- partcode: res.data[0].partcode,
- partname: res.data[0].partname,
- partspec: res.data[0].partspec,
- hbarcode: res.data[0].hbarcode,
- hbatchno: res.data[0].hbatchno ? res.data[0].hbatchno : '/',
- })
-
- this.purchorderDetailArr.unshift({
- hbillno: res.data[0].hbillno,
- partcode: res.data[0].partcode,
- hbarcode: res.data[0].hbarcode,
- hqty: res.data[0].hqty,
- hcustomername: res.data[0].hcustomername,
- hcustomercode: res.data[0].hcustomercode,
- hbatchno: res.data[0].hbatchno ? res.data[0].hbatchno : '/',
- qualitystatus: res.data[0].qualitystatus,
- })
-
- this.purchorderObj = this.purchorderArr[0]
-
- this.radioValue = res.data.labcont[0].hbarcode
-
+ this.purchorderArr.unshift(res.data[0])
}
},
// picker纭鎸夐挳
pickerConfirm(val) {
- this.sheetValue = val.value[0]
+
+ this.purchorderObj.lcationcode = val.value[1]
+ this.purchorderObj.stockcode = val.value[0]
+
+ this.purchorderObj.stockname2 = this.wareHouseLocationArr.find(i => i.text === this.purchorderObj
+ .stockcode).value
+
+ this.purchorderObj.lcationname2 = this.wareHouseLocationArr.find(i => i.value === this.purchorderObj
+ .stockname2).children.find(i => i.text === this.purchorderObj
+ .lcationcode).value
+
+
this.sheetShow = false
- },
- // 閫夋嫨璐ㄦ鏂规
- sheetClick(val) {
- this.sheetShow = true
- },
- // 椤甸潰璺宠浆
- navigateTo() {
-
-
- uni.setStorageSync('purchorderArr', JSON.stringify(this.purchorderArr))
- uni.setStorageSync('purchorderDetailArr', JSON.stringify(this.purchorderDetailArr))
-
- // uni.navigateTo({
- // url:'./rcjy2?purchorderObj=' + JSON.stringify(this.purchorderObj)+
- // })
-
-
-
- uni.navigateTo({
- url: './rcjy2?checkstandcode=' + this.sheetList.find(i => i.name === this.sheetValue).code +
- '&checkstandname=' + this.sheetValue + '&sampmethod=' + this.sheetList.find(i => i.name ===
- this.sheetValue).sampmethod + '&sampscare=' + this.sheetList.find(i => i.name === this
- .sheetValue).sampscare + '&purchorderObj=' + JSON.stringify(this
- .purchorderObj) + '&radioSelectValue=' + JSON.stringify(this.purchorderDetailArr.find(
- i => i.hbarcode === this.radioValue))
-
-
- });
- },
- // 鍗曢�夋寜閽偣鍑讳簨浠�
- radioValueClick(val) {
- this.radioValue = val
- const t = this.purchorderDetailArr.find(i => i.hbarcode === val).hbillno
- this.purchorderObj = this.purchorderArr.find(i => i.hbillno === t)
},
// 鍒犻櫎浜嬩欢鐐瑰嚮
trashClick(val) {
- this.purchorderDetailArr.splice(val, 1)
+ this.purchorderArr.splice(val, 1)
},
+ async submit() {
+ const data1 = {
+ username: uni.getStorageSync("username")
+ }
+ let data2 = []
+
+ if (!this.purchorderObj.lcationcode) { //璇存槑鏈夋湭濉啓鐨勫簱浣嶄俊鎭�
+ return this.$u.toast('搴撲綅淇℃伅鏈�夋嫨鎴栨湭鎵爜锛�')
+ }
+
+ this.purchorderArr.forEach(i => {
+ data2.push({
+ "sbid": i.hsourcesbid,
+ "hbarcode": i.hbarcode,
+ "hbillno": i.hbillno,
+ "hsourceid": i.hsourceid,
+ "hsourcebillno": i.hsourcebillno,
+ "partcode": i.partcode,
+ "partname": i.partname,
+ "partspec": i.partspec,
+ "unitcode": i.unitcode,
+ "unitname": i.unitname,
+ "hqty": i.hqty,
+ "quantity": i.quantity,
+ "countarrivalquantity": i.countarrivalquantity,
+ "countInquantity": i.countInquantity,
+ "countreturnquantity": i.countreturnquantity,
+ "harcodelocation": i.harcodelocation,
+ "lactioncode": this.purchorderObj.lcationname2,
+ "lactionname": this.purchorderObj.lcationcode,
+ "housecode": this.purchorderObj.stockname2,
+ "housename": this.purchorderObj.stockcode,
+ "hcustomercode": i.hcustomercode,
+ "hcustomername": i.hcustomername,
+ "deptcode": i.deptcode,
+ "deptname": i.deptname,
+ "batchcode": "",
+ "qstatus": i.qualitystatus
+ })
+ })
+
+ // console.log(JSON.stringify(data2))
+
+ const res = await MesAppPurchInStorLabSave(this.global.formatData(
+ data1), data2)
+
+ if (res.code === '200') {
+ this.$u.toast('鎻愪氦鎴愬姛锛�')
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 1, //杩斿洖灞傛暟锛�2鍒欎笂涓婇〉
+ })
+ }, 1000)
+ } else {
+ this.$u.toast(res.message)
+ }
+
+
+ }
}
}
</script>
@@ -480,4 +457,13 @@
border-radius: 10rpx;
padding: 0 10rpx;
}
+
+ .arrowClass {
+ display: flex;
+ justify-content: center;
+ // background-color: #efefef;
+ width: 100rpx;
+ // border-radius: 10rpx;
+ height: 56rpx;
+ }
</style>
\ No newline at end of file
diff --git a/pages/wlgl/cgrk4.vue b/pages/wlgl/cgrk4.vue
index 7e861fc..9ce0f3f 100644
--- a/pages/wlgl/cgrk4.vue
+++ b/pages/wlgl/cgrk4.vue
@@ -1,6 +1,6 @@
<template>
<view>
- <page-nav title="閲囪喘鍏ュ簱4"></page-nav>
+ <page-nav title="閲囪喘鍏ュ簱"></page-nav>
<view v-if='purchorderArr.length!==0' class="mainContent" style="">
<view>
@@ -393,8 +393,6 @@
i.stockcode = '' //浠撳簱
i.countInquantity2 = parseFloat(i.quantity) - parseFloat(i.countInquantity) +
parseFloat(i.countreturnquantity)
-
- console.log(i.countInquantity)
})
this.purchorderArr = res.data
this.purchorderObj = this.purchorderArr[0]
@@ -504,19 +502,6 @@
"deptcode": i.deptcode,
"deptname": i.deptname,
children: i.children
-
- // "hbarcode": "",
- // "hbillno": "",
- // "hqty": i.hqty,
- // "hcustomercode": i.customercode,
- // "hdeptcode": i.departmentcode,
- // "partcode": i.partcode,
- // "unitcode": i.unitcode,
- // "hsourceid": i.orderid,
- // "hsourcebillno": i.ordercode,
-
- // "stockcode": this.purchorderObj.stockname2,
- // "lcationcode": this.purchorderObj.lcationname2
})
})
@@ -524,20 +509,23 @@
return this.$u.toast('绗�' + count + '涓墿鏂欑殑鍏ュ簱鏁伴噺閿欒锛�')
}
- console.log(JSON.stringify(data2))
+ // console.log(JSON.stringify(data2))
const res = await MesAppPurchInStorSave(this.global.formatData(
data1), data2)
if (res.code === '200') {
- let prevPage = getCurrentPages()[getCurrentPages()
- .length -
- 2]; // 涓婁竴椤甸潰瀹炰緥
- prevPage.$vm
- .getMesAppPurchOrderSearch() // 璋冪敤涓婁竴椤� 瀹氫箟鐨勬柟娉�
- uni.navigateBack({
- delta: 1, //杩斿洖灞傛暟锛�2鍒欎笂涓婇〉
- })
+ this.$u.toast('鎻愪氦鎴愬姛锛�')
+ setTimeout(() => {
+ let prevPage = getCurrentPages()[getCurrentPages()
+ .length -
+ 2]; // 涓婁竴椤甸潰瀹炰緥
+ prevPage.$vm
+ .getMesAppPurchOrderSearch() // 璋冪敤涓婁竴椤� 瀹氫箟鐨勬柟娉�
+ uni.navigateBack({
+ delta: 1, //杩斿洖灞傛暟锛�2鍒欎笂涓婇〉
+ })
+ }, 1000)
} else {
this.$u.toast(res.message)
}
diff --git a/pages/wlgl/cgrk4_back.vue b/pages/wlgl/cgrk4_back.vue
deleted file mode 100644
index a7f2664..0000000
--- a/pages/wlgl/cgrk4_back.vue
+++ /dev/null
@@ -1,460 +0,0 @@
-<template>
- <view>
- <page-nav title="閲囪喘鍏ュ簱4"></page-nav>
-
- <view v-if='purchorderArr.length!==0' class="mainContent" style="">
- <view>
- <u-gap height="10" bgColor="#eff0f1"></u-gap>
- <view class="head">
- <!-- max-height: 1340rpx;overflow: auto; -->
- <view style="">
-
- <view class="head" style="position: relative;">
-
- <u-radio-group v-model="radioValue" class="flex_column">
- <view class=" flex_column" style="width: 100%;" @click="radioValueClick(item.sbid)"
- v-for="(item,index) in purchorderArr" :key="item.sbid">
-
- <view class="head_block" style="position: absolute;margin: 38rpx 0 0 0;">
- <view class="head_left">
- <view class="head_bar"></view>
- <view class="head_title" style="font-weight: bold;">
- 鐗╂枡淇℃伅
- </view>
- </view>
- </view>
-
-
- <view class="orderNumber" :key="item.sbid">
- {{(index+1).toString().padStart(2,0)}}
- </view>
-
- <view class="trash" v-show="purchorderArr.length>1" @click="trashClick(index)">
- <u-icon name="trash" size='20'></u-icon>
- </view>
-
- <view v-show="purchorderArr.length===1" style="width: 48rpx;height: 48rpx;">
- </view>
-
-
-
- <view class="flex_between marginBottom20 marginLeft20 marginTop20">
- <view style="display: flex;">
- <view class="flex_column titleFont">
- <view>鐗╂枡缂栫爜锛�</view>
- <view>鐗╂枡鍚嶇О锛�</view>
- <view>鐗╂枡瑙勬牸锛�</view>
- <view>閲囪喘璁㈠崟锛�</view>
- <view>鍒拌揣杩涘害锛�</view>
- <!-- <view>鐗╂枡鏍囩锛�</view> -->
- <view v-show="!item.arrowType">鐗╂枡鏁伴噺锛�</view>
- <view v-show="!item.arrowType">渚涙柟淇℃伅锛�</view>
- <view v-show="!item.arrowType">閲囪喘鎵规锛�</view>
- <view v-show="!item.arrowType">璐ㄩ噺鐘舵�侊細</view>
- </view>
- <view class="flex_column contentFont">
- <view>{{item.partcode}}</view>
- <view>{{item.partname}}</view>
- <view class="ellipsis" style="width: 460rpx;">
- {{item.partspec?item.partspec:'/'}}
- </view>
- <view>{{item.ordercode}}</view>
- <view style="height: 50rpx;display: flex;align-items: center;">
- <u-line-progress :percentage="(item.hqty/item.hplanqty)*100"
- height="12" :showText='false'></u-line-progress>
- <view style="margin-left: 6rpx; color:#2979FF">
- {{item.hqty}}
- </view>
- <view>
- /
- </view>
- <view>
- {{item.hplanqty}} PCS
- </view>
- </view>
- <!-- <view>杩樺儚杩樻病杩斿洖</view> -->
- <view v-show="!item.arrowType">{{item.hqty}}</view>
- <view v-show="!item.arrowType">{{item.customername}}</view>
- <view v-show="!item.arrowType">/</view>
- <view v-show="!item.arrowType">
- <view v-if="!item.qualitystatus">/</view>
- <view v-else style="display: flex;align-items: center;">
-
- <u-icon name="tags-fill" color="green" size="20"
- v-if="item.qualitystatus==='CS'"></u-icon>
- <view style="margin-left: 10rpx;"
- v-if="item.qualitystatus==='CS'">鍏嶆</view>
-
- <u-icon name="checkmark-circle-fill" color="#55ff00" size="20"
- v-if="item.qualitystatus==='OK'"></u-icon>
- <view style="margin-left: 10rpx;"
- v-if="item.qualitystatus==='OK'">鍚堟牸</view>
-
- <u-icon name="close-circle-fill" color="#FF0000" size="20"
- v-if="item.qualitystatus==='NG'"></u-icon>
- <view style="margin-left: 10rpx;"
- v-if="item.qualitystatus==='NG'">涓嶅悎鏍�</view>
-
- <u-icon name="more-circle-fill" color="#55aaff" size="20"
- v-if="item.qualitystatus==='TS'"></u-icon>
- <view style="margin-left: 10rpx;"
- v-if="item.qualitystatus==='TS'">寰呮</view>
-
- </view>
- </view>
-
- </view>
- </view>
- <u-radio size='20' class="marginRight20" :key="item.sbid" :name="item.sbid"
- activeColor="red"></u-radio>
- </view>
-
-
- <view class="head_block" v-show="!item.arrowType">
- <view class="head_left">
- <view class="head_bar"></view>
- <view class="head_title" style="font-weight: bold;">
- 鎵弿搴撲綅
- </view>
- </view>
-
- <view class="marginRight20">
- <u-icon name="scan" @click="topScanClick" color="red" size="28"></u-icon>
- </view>
- </view>
-
- <view class="flex_between marginBottom20 marginLeft20 marginTop20"
- v-show="!item.arrowType">
- <view style="display: flex;">
- <view class="flex_column titleFont">
- <view>搴撲綅淇℃伅锛�</view>
- <view>鎵�灞炰粨搴擄細</view>
- </view>
-
- <view class="flex_column contentFont" @click="sheetShow=true">
- <view v-if="item.lcationcode">{{item.lcationcode}}</view>
- <view v-else style="color: #ccc;">鐐瑰嚮閫夋嫨鎴栨壂搴撲綅鐮�</view>
- <view v-if="item.stockcode">{{item.stockcode}}</view>
- <view v-else style="color: #ccc;">鐐瑰嚮閫夋嫨鎴栨壂搴撲綅鐮�</view>
- </view>
- </view>
- </view>
-
-
- <view style="display: flex;justify-content: center;margin : 10rpx; 0">
- <view class="arrowClass"
- @click="item.arrowType?arrowDownClick(item):arrowUpClick(item)">
- <u-icon :name="item.arrowType?'arrow-down':'arrow-up'" color="#c8c8c8"
- size="25"></u-icon>
- </view>
- </view>
-
- <u-gap height="10" v-if="index!==purchorderArr.length-1" bgColor="#eff0f1"></u-gap>
-
-
- </view>
- </u-radio-group>
- </view>
-
- </view>
-
- </view>
-
-
-
- </view>
-
- </view>
-
-
- <view class="footer">
- <u-button size="large" :loading="isDisabledSubmitButton" :disabled="isDisabledSubmitButton"
- loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary" @click="submit" text="纭鎻愪氦">
- </u-button>
- </view>
-
-
- <u-picker :show="sheetShow" :columns="columns" :itemHeight='55' :closeOnClickOverlay='true'
- @close='sheetShow=false' @change="changeHandler" @confirm='pickerConfirm'
- @cancel='sheetShow=false'></u-picker>
-
-
- </view>
-</template>
-
-
-<script>
- import {
- MesAppPurchInStorSelectCGOrderPart,
- WarehouseLocationSearchStoreHouse,
- MesAppPurchInStorSave,
- WareHouseLocation
- } from '../../config/api.js';
-
- const App = getApp()
- export default {
-
- onLoad(option) {
- this.getMesAppPurchInStorSelectCGOrderPart(option.ordercode)
- },
-
- onPullDownRefresh() {
- setTimeout(() => {
- this.init(() => {
- uni.stopPullDownRefresh();
- })
- }, 1000);
- },
-
- data() {
- return {
- purchorderObj: {},
- purchorderArr: [],
- radioValue: '',
- sheetShow: false, //涓婃媺鍒楄〃鏄惁灞曞紑
- sheetList: [],
- columns: [],
- columnsData: [],
- wareHouseLocationArr: [], //浠撳簱搴撲綅鏁扮粍
- isDisabledSubmitButton: false
- }
- },
- created() {
-
- },
- mounted() {
- this.init()
- this.getWareHouseLocation()
-
-
- // this.getMesAppPurchInStorSelectCGOrderPart('PO-2025-01-0002')
- // this.getWarehouseLocationSearchStoreHouse('0011')
- },
- methods: {
- async getWareHouseLocation() {
- const {
- data: res
- } = await WareHouseLocation()
- this.wareHouseLocationArr = res.filter(i => i.children.length > 0)
- this.columns = [
- this.wareHouseLocationArr.map(i => i.text),
- this.wareHouseLocationArr[0].children.map(i => i.text)
- ]
- this.wareHouseLocationArr.forEach(i => {
- this.columnsData.push(i.children.map(j => j.text))
- })
-
- },
- changeHandler(e) {
- const {
- columnIndex,
- value,
- values, // values涓哄綋鍓嶅彉鍖栧垪鐨勬暟缁勫唴瀹�
- index,
- // 寰俊灏忕▼搴忔棤娉曞皢picker瀹炰緥浼犲嚭鏉ワ紝鍙兘閫氳繃ref鎿嶄綔
- picker = this.$refs.uPicker
- } = e
- // 褰撶涓�鍒楀�煎彂鐢熷彉鍖栨椂锛屽彉鍖栫浜屽垪(鍚庝竴鍒�)瀵瑰簲鐨勯�夐」
- if (columnIndex === 0) {
- // picker涓洪�夋嫨鍣╰his瀹炰緥锛屽彉鍖栫浜屽垪瀵瑰簲鐨勯�夐」
- picker.setColumnValues(1, this.columnsData[index])
- }
- },
- init() {
- uni.stopPullDownRefresh();
- },
- // 鎵弿
- topScanClick() {
- let that = this;
-
- uni.scanCode({
- onlyFromCamera: true,
- // scanType: ['barCode', 'qrCode'],
- scanType: ['qrCode'],
- success: function(res) {
- console.log('鏉$爜绫诲瀷锛�' + res.scanType);
- console.log('鏉$爜鍐呭锛�' + res.result);
- that.scanContent = res.result;
- that.getWarehouseLocationSearchStoreHouse(that.scanContent)
- },
- complete: function(res) {
-
- },
- fail: function(res) {
- console.log('鏉$爜绫诲瀷锛�' + res.scanType);
- console.log('鏉$爜鍐呭锛�' + res.result);
- }
-
- });
- },
-
- async getWarehouseLocationSearchStoreHouse(locationcode) {
- const data = {
- locationcode
- }
- const res = await WarehouseLocationSearchStoreHouse(data)
- if (res.code === '200') {
- this.purchorderObj.lcationcode = res.data[0].locationname
- this.purchorderObj.stockcode = res.data[0].warehousename
-
- this.purchorderObj.lcationname2 = res.data[0].locationcode
- this.purchorderObj.stockname2 = res.data[0].warehousecode
- } else {
- this.$u.toast(res.message)
- }
- },
- // 鑾峰彇鏍囩淇℃伅
- async getMesAppPurchInStorSelectCGOrderPart(ordercode) {
- const data = {
- ordercode
- }
- const res = await MesAppPurchInStorSelectCGOrderPart(this.global.formatData(data))
- if (res.code === '200') {
- res.data.forEach((i, ind) => {
- i.arrowType = ind !== 0
- i.lcationcode = '' //搴撲綅
- i.stockcode = '' //浠撳簱
- })
- this.purchorderArr = res.data
- this.purchorderObj = this.purchorderArr[0]
- this.radioValue = this.purchorderObj.sbid
- }
- },
- // picker纭鎸夐挳
- pickerConfirm(val) {
-
- this.purchorderObj.lcationcode = val.value[1]
- this.purchorderObj.stockcode = val.value[0]
-
- this.purchorderObj.stockname2 = this.wareHouseLocationArr.find(i => i.text === this.purchorderObj
- .stockcode).value
-
- this.purchorderObj.lcationname2 = this.wareHouseLocationArr.find(i => i.value === this.purchorderObj
- .stockname2).children.find(i => i.text === this.purchorderObj
- .lcationcode).value
-
-
- this.sheetShow = false
- },
- // 鍗曢�夋寜閽偣鍑讳簨浠�
- radioValueClick(val) {
- this.radioValue = val
- this.purchorderObj = this.purchorderArr.find(i => i.sbid === val)
- },
- // 鍒犻櫎浜嬩欢鐐瑰嚮
- trashClick(val) {
- this.purchorderArr.splice(val, 1)
- this.purchorderObj = this.purchorderArr[0]
- this.radioValue = this.purchorderObj.sbid
- },
- // 绠ご鐢卞悜涓嬪彉涓哄悜涓婃椂瑙﹀彂
- arrowDownClick(val) {
- this.purchorderArr.forEach(i => {
- i.arrowType = i.sbid !== val.sbid
- })
- this.$forceUpdate()
- },
- // 绠ご鐢卞悜涓婂彉涓哄悜涓嬫椂瑙﹀彂
- arrowUpClick(val) {
- val.arrowType = true
- this.$forceUpdate()
- },
- async submit() {
- const data1 = {
- username: uni.getStorageSync("username")
- }
- let data2 = []
-
- let ind = this.purchorderArr.findIndex(i => i.lcationcode === '')
- if (ind > -1) { //璇存槑鏈夋湭濉啓鐨勫簱浣嶄俊鎭�
- return this.$u.toast('绗�' + (ind + 1) + '涓殑搴撲綅淇℃伅鏈~鍐�')
- }
- console.log(this.wareHouseLocationArr.flat())
-
- this.purchorderArr.forEach(i => {
- data2.push({
- "hbarcode": "",
- "hbillno": "",
- "hqty": i.hqty,
- "hcustomercode": i.customercode,
- "hdeptcode": i.departmentcode,
- "partcode": i.partcode,
- "unitcode": i.unitcode,
- "hsourceid": i.orderid,
- "hsourcebillno": i.ordercode,
-
- "stockcode": this.purchorderObj.stockname2,
- "lcationcode": this.purchorderObj.lcationname2
- })
- })
-
- // console.log(JSON.stringify(data2))
-
- const res = await MesAppPurchInStorSave(this.global.formatData(
- data1), data2)
-
- if (res.code === '200') {
- let prevPage = getCurrentPages()[getCurrentPages()
- .length -
- 2]; // 涓婁竴椤甸潰瀹炰緥
- prevPage.$vm
- .getMesAppPurchOrderSearch() // 璋冪敤涓婁竴椤� 瀹氫箟鐨勬柟娉�
- uni.navigateBack({
- delta: 1, //杩斿洖灞傛暟锛�2鍒欎笂涓婇〉
- })
- } else {
- this.$u.toast(res.message)
- }
- }
- }
- }
-</script>
-
-<style lang="scss" scoped>
- @import url('@/style/global.css');
-
- ::v-deep .uicon-arrow-left>span {
- display: block;
- }
-
-
-
- .orderNumber {
- width: 60rpx;
- height: 40rpx;
- // margin: -22rpx 0 0 -30rpx;
- background-color: #d3daf9;
- color: #2979FF;
- font-size: 26rpx;
- padding: 4rpx 0 0 10rpx;
- border-radius: 0 0 90% 0;
- }
-
- .trash {
- width: 48rpx;
- height: 48rpx;
- margin: -26rpx 0 0 646rpx;
- background-color: #d3daf9;
- font-size: 26rpx;
- padding: 6rpx 0 0 10rpx;
- border-radius: 100%;
- }
-
- .custominputClass {
- width: 424rpx;
- display: flex;
- justify-content: space-between;
- border: 3rpx #eff0f1 solid;
- border-radius: 10rpx;
- padding: 0 10rpx;
- }
-
- .arrowClass {
- display: flex;
- justify-content: center;
- // background-color: #efefef;
- width: 100rpx;
- // border-radius: 10rpx;
- height: 56rpx;
- }
-</style>
\ No newline at end of file
--
Gitblit v1.9.3