|  |  |  | 
|---|
|  |  |  | <uni-forms label-width="120"> | 
|---|
|  |  |  | <uni-forms-item label="æçæ¡ç "> | 
|---|
|  |  |  | <uni-easyinput type="text" :focus="!istrue" v-model="barcode" placeholder="è¯·æ«ææçæ¡ç " | 
|---|
|  |  |  | ref='midInput' @input="inputChangebarcode()" /> | 
|---|
|  |  |  | ref='midInput' @confirm="inputChangebarcode()" /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item label="å
ç®±æ ç¾"> | 
|---|
|  |  |  | <uni-easyinput type="text" @input="inputChange()" v-model="materialsns" | 
|---|
|  |  |  | placeholder="è¯·æ«æå
ç®±æ ç¾" ref='midInput' :focus="istrue" /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item label="åºåºæ°é"> | 
|---|
|  |  |  | <uni-easyinput type="number" v-model="num" placeholder="请è¾å
¥åºåºæ°é" ref='midInput' /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item> | 
|---|
|  |  |  | <label style="margin-left: 0%;">æ»æ°é:{{totalNum}}</label> | 
|---|
|  |  |  | <label style="margin-left: 30%;">åºåºæ°é:{{pickNum}}</label> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item> | 
|---|
|  |  |  | <label style="margin-left: 0%;">工忻æ°é:{{orderTotalNum}}</label> | 
|---|
|  |  |  | <label style="margin-left: 21%;">累计åºåºæ°é:{{orderPickNum}}</label> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item> | 
|---|
|  |  |  | <label style="margin-left: 0%;">å·¥åå·:{{orderNo}}</label> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item> | 
|---|
|  |  |  | <checkbox :checked="isPicking" @click="checkedClick">æ¯å¦æ£é</checkbox> | 
|---|
|  |  |  | <uni-forms-item label="å®çæ°é"> | 
|---|
|  |  |  | <uni-easyinput type="number" v-model="num" placeholder="请è¾å
¥å®çæ°é" ref='midInput' /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item> | 
|---|
|  |  |  | <button @click="picking" type="primary" style="margin-left: 0px;">çç¹å®æ</button> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | </uni-forms> | 
|---|
|  |  |  | <uni-list> | 
|---|
|  |  |  | <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode"> | 
|---|
|  |  |  | <template v-slot:body> | 
|---|
|  |  |  | <view class="uni-list-box"> | 
|---|
|  |  |  | <view class="uni-content"> | 
|---|
|  |  |  | <view class="uni-title-sub uni-ellipsis-2">ç©æç¼ç ï¼{{item.matCode}}</view> | 
|---|
|  |  |  | <view class="uni-title-sub uni-ellipsis-2">æ°éï¼{{item.matQuantity}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </uni-list-item> | 
|---|
|  |  |  | <uni-list-item direction="column" v-for="item in boxBarcodes" :key="item.sn"> | 
|---|
|  |  |  | <template v-slot:body> | 
|---|
|  |  |  | <view class="uni-list-box"> | 
|---|
|  |  |  | <uni-icons type="trash" size="22" style="position: absolute;right: 5%;" | 
|---|
|  |  |  | @click="deleteList(item.sn)"> | 
|---|
|  |  |  | </uni-icons> | 
|---|
|  |  |  | <view class="uni-content"> | 
|---|
|  |  |  | <view class="uni-title-sub uni-ellipsis-2">订åå·ï¼{{item.orderNo}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©æç¼ç ï¼{{item.matCode}}</view> | 
|---|
|  |  |  | <view class="uni-note">çäº§æ¥æï¼{{item.matProductionDate}}</view> | 
|---|
|  |  |  | <view class="uni-note">æ°éï¼{{item.matQty}}</view> | 
|---|
|  |  |  | <view class="uni-note">æ¯å¦æ£éï¼{{item.isPicking}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </uni-list-item> | 
|---|
|  |  |  | </uni-list> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view v-if="current === 2" class="headerstyle"> | 
|---|
|  |  |  | <view class="itemstyle"> | 
|---|
|  |  |  | <uni-forms label-width="120"> | 
|---|
|  |  |  | <uni-forms-item label="æçæ¡ç "> | 
|---|
|  |  |  | <uni-easyinput type="text" :focus="!istrue2" v-model="barcode2" placeholder="è¯·æ«ææçæ¡ç " | 
|---|
|  |  |  | ref='midInput' @input="inputChangebarcode2()" /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item label="å
ç®±æ ç¾"> | 
|---|
|  |  |  | <uni-easyinput type="text" @input="inputChange2()" v-model="innerboxcode" | 
|---|
|  |  |  | placeholder="è¯·æ«æå
ç®±æ ç¾" ref='midInput' :focus="istrue2" /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item> | 
|---|
|  |  |  | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">ç»ç</button> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | </uni-forms> | 
|---|
|  |  |  | <view class="uni-content" v-if="takeStockObj"> | 
|---|
|  |  |  | <view class="uni-title-sub uni-ellipsis-2">çç¹åå·ï¼{{orderNo}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©æç¼ç ï¼{{takeStockObj.materielCode}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©ææ¹æ¬¡ï¼{{takeStockObj.batchNo}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©æåç§°ï¼{{takeStockObj.materielName}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©æè§æ ¼ï¼{{takeStockObj.materielSpec}}</view> | 
|---|
|  |  |  | <view class="uni-note">è´¦é¢æ°éï¼{{takeStockObj.sysQty}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view v-if="current === 1" class="headerstyle"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <uni-forms label-width="120"> | 
|---|
|  |  |  | <uni-forms-item label="æçæ¡ç "> | 
|---|
|  |  |  | <uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode" | 
|---|
|  |  |  | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @input="inputChangebarcode3" /> | 
|---|
|  |  |  | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @confirm="inputChangebarcode3" /> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | <uni-forms-item label="å°åæ¡ç "> | 
|---|
|  |  |  | <uni-easyinput type="text" v-model="address" :disabled="addressdisabled" placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' | 
|---|
|  |  |  | 
|---|
|  |  |  | <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">å
¥åºç¡®è®¤</button> | 
|---|
|  |  |  | </uni-forms-item> | 
|---|
|  |  |  | </uni-forms> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <uni-list> | 
|---|
|  |  |  | <uni-list-item direction="column" v-if="inboundBarcode"> | 
|---|
|  |  |  | <template v-slot:body> | 
|---|
|  |  |  | <view class="uni-list-box"> | 
|---|
|  |  |  | <view class="uni-content"> | 
|---|
|  |  |  | <view class="uni-title-sub uni-ellipsis-2">ç»çæ»æ°éï¼{{Summmary}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </uni-list-item> | 
|---|
|  |  |  | <uni-list-item direction="column" v-for="(item,index) in stockInfoDetail" :key="index"> | 
|---|
|  |  |  | <template v-slot:body> | 
|---|
|  |  |  | <view class="uni-list-box"> | 
|---|
|  |  |  | <view class="uni-content"> | 
|---|
|  |  |  | <view class="uni-title-sub uni-ellipsis-2">ç©æç¼å·ï¼{{item.materielCode}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©æåç§°ï¼{{item.materielName}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç©ææ¹æ¬¡ï¼{{item.batchNo}}</view> | 
|---|
|  |  |  | <view class="uni-note">ç»çæ°éï¼{{item.stockQuantity}}</view> | 
|---|
|  |  |  | <view class="uni-note">çäº§æ¥æï¼{{item.productionDate}}</view> | 
|---|
|  |  |  | <view class="uni-note">æ æ æï¼{{item.effectiveDate}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </uni-list-item> | 
|---|
|  |  |  | </uni-list> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | barcodefocus: true, | 
|---|
|  |  |  | totalNum: 0, | 
|---|
|  |  |  | pickNum: 0, | 
|---|
|  |  |  | num: 0, | 
|---|
|  |  |  | num: null, | 
|---|
|  |  |  | orderTotalNum: 0, | 
|---|
|  |  |  | orderPickNum: 0, | 
|---|
|  |  |  | orderNo: "", | 
|---|
|  |  |  | matTotal: [], | 
|---|
|  |  |  | istrue2: false, | 
|---|
|  |  |  | barcode2: '', | 
|---|
|  |  |  | Summmary:0, | 
|---|
|  |  |  | innerboxcode: "", | 
|---|
|  |  |  | takeStockObj:null, | 
|---|
|  |  |  | sns2: [], | 
|---|
|  |  |  | barcodefocus: true, | 
|---|
|  |  |  | addressFocus: false, | 
|---|
|  |  |  | inboundBarcode: "", | 
|---|
|  |  |  | address: "", | 
|---|
|  |  |  | addressdisabled: true, | 
|---|
|  |  |  | warehouseId:"" | 
|---|
|  |  |  | addressdisabled: false, | 
|---|
|  |  |  | warehouseId:"", | 
|---|
|  |  |  | stockInfoDetail:[] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad(res) { | 
|---|
|  |  |  | this.barcodefocus = false; | 
|---|
|  |  |  | this.istrue = false; | 
|---|
|  |  |  | this.warehouseId = res.warehouseId; | 
|---|
|  |  |  | if (this.warehouseId == 3) { //è¾
æä»åºåºID | 
|---|
|  |  |  | this.orderNo=res.orderNo; | 
|---|
|  |  |  | if (this.warehouseId == 3) { //æ¿æä»åºåºID | 
|---|
|  |  |  | this.address = "1011"; | 
|---|
|  |  |  | this.addressdisabled = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | var postData = { | 
|---|
|  |  |  | MainData: { | 
|---|
|  |  |  | "barcode": this.inboundBarcode, | 
|---|
|  |  |  | "startPoint": this.address | 
|---|
|  |  |  | "startPoint": this.address, | 
|---|
|  |  |  | "warehouseId": this.warehouseId | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$u.post('/api/Inbound/RequestInbound', postData).then(res => { | 
|---|
|  |  |  | this.$u.post('/api/Task/RequestInboundTask', postData).then(res => { | 
|---|
|  |  |  | if (res.status) { | 
|---|
|  |  |  | uni.$showMsg(res.message); | 
|---|
|  |  |  | this.inboundBarcode = ""; | 
|---|
|  |  |  | this.address = ""; | 
|---|
|  |  |  | if (this.warehouseId !== 3) //æ¿æä»åºåºID | 
|---|
|  |  |  | { | 
|---|
|  |  |  | this.address = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.Summmary=0; | 
|---|
|  |  |  | this.stockInfoDetail=[]; | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: "æå", | 
|---|
|  |  |  | type: "success" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: res.message, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.addressFocus = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.$nextTick(function(x) { | 
|---|
|  |  |  | if (this.inboundBarcode != '') { | 
|---|
|  |  |  | var postData = { | 
|---|
|  |  |  | MainData: { | 
|---|
|  |  |  | "barcode": this.inboundBarcode, | 
|---|
|  |  |  | "warehouseId": this.warehouseId, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => { | 
|---|
|  |  |  | // this.stockInfo = []; | 
|---|
|  |  |  | this.stockInfoDetail = []; | 
|---|
|  |  |  | this.Summmary=0; | 
|---|
|  |  |  | if (res.status) { | 
|---|
|  |  |  | // this.stockInfo = res.data, | 
|---|
|  |  |  | this.stockInfoDetail = res.data.details | 
|---|
|  |  |  | //è·åæ»æ°é | 
|---|
|  |  |  | this.stockInfoDetail.forEach(item => { | 
|---|
|  |  |  | this.Summmary += item.stockQuantity; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | // title: "æªæ¾å°æçä¿¡æ¯", | 
|---|
|  |  |  | title: res.message, | 
|---|
|  |  |  | type: "error" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | picking() { | 
|---|
|  |  |  | if (this.barcode == "") { | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (this.sns.length == 0) { | 
|---|
|  |  |  | if(this.num==null || this.num==undefined){ | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: "è¯·æ«æå
ç®±æ ç¾", | 
|---|
|  |  |  | title: "çç¹æ°éä¸è½ä¸ºç©º(å¯å¡«0âæææ°åå¼)", | 
|---|
|  |  |  | type: "error" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(this.takeStockObj==null){ | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: "çç¹ä¿¡æ¯ä¸ºç©º", | 
|---|
|  |  |  | type: "error" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var params = { | 
|---|
|  |  |  | MainData: { | 
|---|
|  |  |  | "barcode": this.barcode, | 
|---|
|  |  |  | "num": this.num, | 
|---|
|  |  |  | "pickNum": this.pickNum | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | DetailData: this.sns | 
|---|
|  |  |  | "id": this.takeStockObj.id | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$u.post('/api/StockOperate/MatPicking', params).then(res => { | 
|---|
|  |  |  | this.$u.post('/api/TakeStockOrder/MatPicking', params).then(res => { | 
|---|
|  |  |  | if (res.status) { | 
|---|
|  |  |  | uni.$showMsg('çç¹æå!') | 
|---|
|  |  |  | this.barcode = ""; | 
|---|
|  |  |  | this.boxBarcodes = []; | 
|---|
|  |  |  | this.sns = []; | 
|---|
|  |  |  | this.materialsns = ""; | 
|---|
|  |  |  | this.barcode=""; | 
|---|
|  |  |  | this.takeStockObj=null; | 
|---|
|  |  |  | this.num=null; | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: "çç¹æå", | 
|---|
|  |  |  | type: "success" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: res.message, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | inputChangebarcode() { | 
|---|
|  |  |  | this.boxBarcodes = []; | 
|---|
|  |  |  | this.istrue = false; | 
|---|
|  |  |  | this.$nextTick(function(x) { | 
|---|
|  |  |  | if (this.barcode != '') { | 
|---|
|  |  |  | var postData = { | 
|---|
|  |  |  | MainData: { | 
|---|
|  |  |  | "barcode": this.barcode | 
|---|
|  |  |  | "orderNo": this.orderNo, | 
|---|
|  |  |  | "takePalletCode": this.barcode | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | this.$u.post('/api/StockInfo/GetStockOutboundOrder', postData).then(res => { | 
|---|
|  |  |  | this.$u.post('/api/TakeStockOrder/GetTakeDetailInfo', postData).then(res => { | 
|---|
|  |  |  | if (res.status) { | 
|---|
|  |  |  | if (res.data.totalNum == res.data.pickNum) { | 
|---|
|  |  |  | res.data.innerBoxCode.forEach(x => { | 
|---|
|  |  |  | var matInfo = x.split('|'); | 
|---|
|  |  |  | if (matInfo.length > 6) { | 
|---|
|  |  |  | var matObj = { | 
|---|
|  |  |  | matCode: matInfo[1], | 
|---|
|  |  |  | matProductionDate: matInfo[3], | 
|---|
|  |  |  | matQty: matInfo[5], | 
|---|
|  |  |  | orderNo: matInfo[6], | 
|---|
|  |  |  | sn: this.materialsns, | 
|---|
|  |  |  | isPicking: this.isPicking | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.sns.push({ | 
|---|
|  |  |  | innerboxcode: this.materialsns, | 
|---|
|  |  |  | isSplit: this.isPicking | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (!this.boxBarcodes.find(x => x.orderNo == matObj | 
|---|
|  |  |  | .orderNo)) { | 
|---|
|  |  |  | this.boxBarcodes.push(matObj); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.totalNum = res.data.totalNum; | 
|---|
|  |  |  | this.pickNum = res.data.pickNum; | 
|---|
|  |  |  | this.orderPickNum = res.data.orderPickNum; | 
|---|
|  |  |  | this.orderTotalNum = res.data.orderTotalNum; | 
|---|
|  |  |  | this.orderNo = res.data.orderNo; | 
|---|
|  |  |  | this.takeStockObj=null; | 
|---|
|  |  |  | this.takeStockObj= res.data; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.barcode=""; | 
|---|
|  |  |  | this.$refs.uToast.show({ | 
|---|
|  |  |  | title: res.message, | 
|---|
|  |  |  | type: "error" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.istrue = true; | 
|---|