wangxinhui
2025-01-12 2f14ad3cc01d575bfde0850bae05fded8acb7af6
´úÂë¹ÜÀí/»´°²PDA/pages/stash/outraworderboxing.vue
@@ -7,39 +7,24 @@
            <view class="itemstyle">
               <uni-forms style="margin-left: 2%;margin-top: 20px;" label-width="180">
                  <uni-forms-item :label="label" style="margin-top: -20px;"></uni-forms-item>
                  <!-- <uni-forms-item label="单据类型:生产领料单" style="margin-top: -20px;"></uni-forms-item> -->
                  <uni-forms-item label="物料码:" style="margin-top: -20px;">
                     <uni-easyinput type="text" placeholder="请扫描物料码" ref='midInput' :focus="focus"
                        v-model="innerCode" @input="snInput" />
                     <uni-easyinput type="text" placeholder="请扫描物料码" ref='midInput' :focus="!focus"
                        v-model="materSn" @input="snInput" />
                  </uni-forms-item>
                  <!-- <uni-forms-item :label="PurchaseOrderNo" style="margin-top: -20px;"></uni-forms-item>
                  <uni-forms-item :label="matCode" style="margin-top: -20px;"></uni-forms-item>
                  <uni-forms-item :label="LotNo" style="margin-top: -20px;"></uni-forms-item>
                  <uni-forms-item :label="ProductionDate" style="margin-top: -20px;"></uni-forms-item>
                  <uni-forms-item :label="EffectiveDate" style="margin-top: -20px;"></uni-forms-item>
                  <uni-forms-item :label="orderQty" style="margin-top: -20px;"></uni-forms-item>
                  <uni-forms-item :label="remaindQty" style="margin-top: -20px;"> -->
                  <uni-list>
                     <uni-list-item direction="column" v-for="item in matInfos" :key="item.palletCode">
                     <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index">
                        <template v-slot:body>
                           <view class="uni-content">
                              <view>单据编号:{{item.orderNo}}</view>
                              <view>托盘编号:{{item.palletCode}}</view>
                              <view>物料批次:{{item.batchNo}}</view>
                              <!-- <view class="uni-title-sub uni-ellipsis-2">采购单号:{{item.purchaseOrderNo}}</view> -->
                              <view>物料编码:{{item.materielCode}}</view>
                              <view>物料名称:{{item.materielName}}</view>
                              <view>单据数量:{{item.orderQuantity}}</view>
                              <view>原始库存:{{item.originalQuantity}}</view>
                              <view>分配库存:{{item.assignQuantity}}</view>
                              <view>剩余库存:{{item.originalQuantity-item.assignQuantity}}</view>
                              <view>批次号:{{item.lotNo}}</view>
                              <view>数量:{{item.quantity}}</view>
                              <!-- <view class="uni-note">生产日期:{{item.productionDate}}</view>
                              <view class="uni-note">有效期:{{item.effectiveDate}}</view> -->
                           </view>
                        </template>
                     </uni-list-item>
                  </uni-list>
                  <uni-forms-item label="出库数量:" style="margin-top: -20px;">
                     <uni-easyinput type="text" placeholder="请输入出库数量" ref='midInput' :focus="focus"
                        v-model="outQty" />
                  </uni-forms-item>
                  </uni-forms-item>
               </uni-forms>
               <uni-forms-item>
@@ -58,8 +43,8 @@
                              <view>物料编码:{{item.materielCode}}</view>
                              <view>物料名称:{{item.materielName}}</view>
                              <view>数量:{{item.orderQuantity+item.unit}}</view>
                              <view>出库数量:{{item.orderQuantity}}</view>
                              <view>已出数量:{{item.overOutQuantity}}</view>
                              <view>出库数量:{{item.orderQuantity+item.unit}}</view>
                              <view>已出数量:{{item.overOutQuantity+item.unit}}</view>
                           </view>
                        </view>
                     </template>
@@ -79,40 +64,19 @@
         return {
            items: ['物料信息', '单据信息'],
            current: 0,
            matTotal: [],
            matInfos: [],
            orderNo: "",
            label: "",
            outQty: "",
            orderInfo: [],
            focus: false,
            pkfocus: false,
            barcode: "",
            materSn: "",
            Initiallife: 1000,
            sns: [],
            pksns: [],
            addressFocus: false,
            inboundBarcode: "",
            address: "",
            check: true,
            value: "",
            matInfo: [],
            value2: "",
            matTotals: [],
            sn: "",
            warehouseId: "",
            Test: false,
            Testlabel: "",
            Testplaceholder: "",
            Testcheck: false,
            pkmaterSn: "",
            pkmatInfos: []
         }
      },
      onShow() {},
      onLoad(res) {
         this.focus = false;
         this.addressFocus = false;
         this.orderNo = res.orderNo;
         this.warehouseId = res.warehouseId;
         this.label = "单据编号:" + this.orderNo;
@@ -140,7 +104,6 @@
         },
         onClickItem(e) {
            this.focus = false;
            this.addressFocus = false;
            if (this.current !== e.currentIndex) {
               this.current = e.currentIndex;
               if (this.current == 2) {
@@ -152,7 +115,7 @@
         snInput() {
            this.$nextTick(() => {
               if (this.materSn != "") {
                  this.focus = false;
                  this.focus = true;
                  var matSn = this.materSn;
                  setTimeout(() => {
                     this.materSn = "";
@@ -160,8 +123,8 @@
                  this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                     this.Testcheck = false;
                     if (res.status) {
                        this.sns.push(res.data.serialNumber);
                        this.matInfos = [];
                        this.sn = res.data.serialNumber;
                        this.matInfos.push(res.data);
                        if (res.message) {
                           this.$refs.uToast.show({
@@ -177,6 +140,8 @@
                           this.voiceSpeech('../../static/success.mp3');
                        }, 100);
                     } else {
                        this.matInfos = [];
                        this.sns = [];
                        this.$refs.uToast.show({
                           title: res.message,
                           type: "error"
@@ -189,56 +154,30 @@
               }
            })
         },
         deleteList(res) {
            this.matInfos.splice(res, 1);
            this.sns.splice(res, 1);
         },
         submit() {
            if (this.barcode == "") {
            if (this.sn == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘条码",
                  title: "请扫描物料码",
                  type: 'error'
               })
               return;
            }
            if (this.matInfos.length == 0) {
               this.$refs.uToast.show({
                  title: "请扫描内箱标签",
                  type: 'error'
               })
               return;
            }
            if (this.Test) {
               if (!this.Testcheck) {
                  this.Testcheck = true;
                  this.$refs.uToast.show({
                     title: "请确认初始寿命",
                     type: 'error'
                  })
                  return;
               }
            }
            this.$u.post('/api/InboundOrder/MaterielGroup', {
            debugger
            this.$u.post('/api/OutboundOrder/outpinku', {
               MainData: {
                  "palletCode": this.barcode,
                  "orderNo": this.orderNo,
                  "initiallife": this.Initiallife,
                  // "isFull": this.check
                  "sn": this.sn,
                  "warehouseId": this.warehouseId
               },
               DelKeys: this.sns
               }
            }).then(res => {
               this.Testcheck = false;
               if (res.status) {
                  this.$refs.uToast.show({
                     title: "出库成功",
                     type: "success"
                  })
                  this.focus = false;
                  this.barcode = "";
                  this.matInfos = [];
                  this.sns = [];
                  this.matTotal = [];
                  this.sn = "";
               } else {
                  this.$refs.uToast.show({
                     title: res.message,