jiangping
2023-10-26 ea87c908fb6cdfc3e227a584a53e6730efb8262a
minipro_standard/pages/OutOperation/OutOperation.vue
ÎļþÃû´Ó minipro_standard/pages_inspect/pages/OutOperation/OutOperation.vue ÐÞ¸Ä
@@ -1,12 +1,10 @@
<template>
   <page-meta :page-style="ban ?'overflow: hidden;': ''"/>
   <view>
      <InOutInfo :info="info" />
      <uni-collapse @change="change" @close="close" @open="open">
         <uni-collapse-item :open="item1.wtransferDetailList.length" v-if="type==7"
            v-for="(item1, index) in warehouseList" :key="index">
         <uni-collapse-item :open="item1.wtransferDetailList.length" v-if="type==7" v-for="(item1, index) in warehouseList" :key="index">
            <view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
               <image src="../../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
               <image src="../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
               <view>{{ item1.warehouseName }}</view>
            </view>
            <view class="p30">
@@ -24,11 +22,14 @@
                        <span>待出<span>{{ item.outPlannum }}</span> {{ item.unitName }}</span>
                     </div>
                     <div class="page_content_title_bottom">
                        <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                        <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                        <span class="error" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                        <span v-else>-<text class="c6" decode>{{ split}}</text></span>
                        <span>{{item.procedureName || '-'}}<text class="c6" decode>{{ split}}</text></span>
                        <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span class="error" v-else-if="item.qualityType === 2">报废&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span v-else>-&nbsp;/&nbsp;</span>
                        <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;/&nbsp;</span>
                        <span>{{item.batch ? item.batch : '-'}}</span>
                     </div>
                  </div>
@@ -51,7 +52,7 @@
         </uni-collapse-item>
         <uni-collapse-item v-if="type==8">
            <view class="p30 cY" style="border-bottom: 4rpx solid #f7f7f7;" slot="title">
               <image src="../../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
               <image src="../../static/chuku_ic_cangku@2x.png" class="img36 mr10" mode=""></image>
               <view>{{ info.warehouseName }}</view>
            </view>
            <view class="p30">
@@ -68,11 +69,14 @@
                        <span>待出 <span>{{ item.num }}</span> {{ item.unitName }}</span>
                     </div>
                     <div class="page_content_title_bottom">
                        <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                        <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                        <span class="error" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                        <span v-else>-<text class="c6" decode>{{ split}}</text></span>
                        <span>{{item.procedureName ? item.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                        <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span class="error" v-else-if="item.qualityType === 2">报废&nbsp;<span
                              class="black">/</span>&nbsp;</span>
                        <span v-else>-&nbsp;/&nbsp;</span>
                        <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;/&nbsp;</span>
                        <span>{{item.batch ? item.batch : '-'}}</span>
                     </div>
                  </div>
@@ -104,8 +108,7 @@
            </div>
            <div class="right" v-if="isZKD" @click="openxz">
               <image src="../../../static/gongdan_ic_shoudong@2x.png" class="img36" mode=""></image>
               <span>手动出库</span>
               <image src="../../static/gongdan_ic_shoudong@2x.png" class="img36" mode=""></image><span>手动出库</span>
            </div>
         </div>
         <div class="page_yxwl_list" v-if="outboundList.length > 0">
@@ -116,12 +119,12 @@
               </div>
               <div class="page_yxwl_list_item_sx">
                  <span class="green" v-if="item.qualityType == 0">合格<text class="c6" decode>{{ split}}</text></span>
                  <span class="yellow" v-else-if="item.qualityType == 1">不良<text class="c6" decode>{{ split}}</text></span>
                  <span class="red" v-else-if="item.qualityType == 2">报废<text class="c6" decode>{{ split}}</text></span>
                  <span v-else>-<text class="c6" decode>{{ split}}</text></span>
                  <span>{{ item.procedureName ? item.procedureName : '-' }}<text class="c6" decode>{{ split}}</text></span>
                  <span>{{ item.batch ? item.batch : '-' }}</span>
                  <span class="green" v-if="item.qualityType == 0">合格&nbsp;<span>/</span></span>
                  <span class="yellow" v-else-if="item.qualityType == 1">不良&nbsp;<span>/</span></span>
                  <span class="red" v-else-if="item.qualityType == 2">报废&nbsp;<span>/</span></span>
                  <span v-else>-&nbsp;/&nbsp;</span>
                  <span>&nbsp;{{ item.procedureName ? item.procedureName : '-' }}&nbsp;/&nbsp;</span>
                  <span>&nbsp;{{ item.batch ? item.batch : '-' }}</span>
               </div>
               <div class="page_yxwl_list_item_num">
                  <div class="item">
@@ -130,7 +133,7 @@
                        <span>{{ item.locationName }}</span>
                     </div>
                  </div>
                  <div class="item f24">
                  <div class="item">
                     <div class="label">数量:</div>
                     <div class="nr">
                        <!-- @input="changeNum(item)" -->
@@ -140,7 +143,7 @@
                  </div>
                  <div class="dele" @click="dele(index)">
                     <!-- <img src="@/assets/icon/chuku_ic_delete@2x.png" alt="" /> -->
                     <image src="../../../static/chuku_ic_delete@2x.png" class="img48" mode=""></image>
                     <image src="../../static/chuku_ic_delete@2x.png" class="img24" mode=""></image>
                  </div>
               </div>
            </div>
@@ -154,7 +157,7 @@
            <span>确认出库</span>
         </div>
      </div>
      <SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @close="ban = false" @selectes="selectMaterail" />
      <SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @selectes="selectMaterail" />
   </view>
</template>
@@ -175,15 +178,16 @@
   import {
      getDB
   } from '@/util/api/agencyAPI'
   import {
      logout
   } from '../../util/api'
   export default {
      components: {
         InOutInfo,
         SelectTraMultipleMaterial
      },
      data() {
         return {
            ban: false,
            type: '',
            id: '',
            dbid: '',
@@ -192,8 +196,6 @@
            info: {
            },
            split: '&nbsp;/&nbsp;',
            mainOrder: '',
            warehouseId: '',
            ids: [],
            warehouseList: [{
@@ -243,7 +245,6 @@
               data.wTransferType = '0'
            }
            infoAction(data).then(res => {
               this.mainOrder = res.data.id
               if (this.isZKD) {
                  this.info = res.data.wtransfer
                  this.warehouseList = res.data.wtransferWarehouseList
@@ -262,67 +263,22 @@
         close() {},
         open() {},
         openxz() {
            this.ban = true
            this.$refs.selectTraMultipleMaterial.open({
               transferId: this.id,
               warehouseId: this.warehouseId
            })
         },
         selectMaterail(v) {
            this.ban = false
            let tempList = this.warehouseList[0].wtransferDetailList
            let materials = JSON.parse(JSON.stringify(v.materials))
            let materials = v.materials
            materials.forEach(materail => {
            tempList.forEach(item => {
               let isOutList = false
               this.outboundList.forEach(selected => {
                  if (selected.newId == item.id) {
                     isOutList = true
                     return
                  }
               })
               if (!isOutList) {
                  item.wstockExtListVOList.forEach(hw => {
                     materials.forEach((materail, index) => {
                        if (hw.materialId == materail.materialId &&
                              hw.procedureId == materail.procedureId &&
                              hw.qualityType == materail.qualityType &&
                              hw.locationId == materail.locationId &&
                              hw.batch == materail.batch
                           ) {
                              this.addToOutList(materail, item)
                              materials.splice(index, 1)
                              return
                        }
                     })
                  })
                     // if (item.batch) {
                     //    // ç²¾ç¡®åŒ¹é…
                     //    if (materail.materialId == item.materialId &&
                     //          materail.procedureId == item.procedureId &&
                     //          materail.qualityType == item.qualityType &&
                     //          materail.batch == item.batch
                     //       ) {
                     //          this.addToOutList(materail, item)
                     //          materials.splice(index, 1)
                     //          return
                     //    }
                     // } else {
                     //    if (materail.materialId == item.materialId &&
                     //          materail.procedureId == item.procedureId &&
                     //          materail.qualityType == item.qualityType
                     //       ) {
                     //       this.addToOutList(materail, item)
                     //       materials.splice(index, 1)
                     //       return
                     //    }
                     // }
               }
            })
         },
         addToOutList(materail, item) {
                     if (materail.materialId == hw.materialId && materail.procedureId == hw
                        .procedureId && materail.qualityType == hw.qualityType && materail.batch ==
                        hw.batch) {
            let isExist = false
            this.outboundList.forEach(selected => {
               if (selected.newId == materail.id) {
@@ -331,13 +287,17 @@
               }
            })
            if (isExist) {
               uni.$u.toast('该物料已存在')
            } else {
                           uni.$u.toast('该物料批次已存在')
                           return
                        }
               let obj = JSON.parse(JSON.stringify(materail))
               obj.newId = item.id
               this.outboundList.push(obj)
               console.log(this.outboundList);
            }
                  })
               })
            })
         },
         dele(index) {
            this.outboundList.splice(index, 1)
@@ -354,6 +314,7 @@
                     return a;
                  }, {});
                  let tempList = this.warehouseList[0].wtransferDetailList
                  for (let i = 0; i < tempList.length; i++) {
                     let item = tempList[i]
                     for (let a in result) {
@@ -393,10 +354,12 @@
                     if (res.code === 200) {
                        this.$store.dispatch('getUpcomingNum')
                        uni.$u.toast('操作成功')
                        uni.$emit('success')
                        uni.redirectTo({
                           url: `/pages_adjust/pages/warehousingDetails/warehousingDetails?id=${this.id}&dbid=${this.dbid}`
                           url: `/pages/warehousingDetails/warehousingDetails?id=${this.info.id}&dbid=${this.dbid}`
                        })
                        // uni.redirectTo({
                        //    url: `/pages_adjust/pages/outboundDetails/outboundDetails?id=${this.info.id}&dbid=${this.dbid}`
                        // })
                        // setTimeout(() => {
                        //   router.replace({ name: 'wTransferDetail', query: { id: info.value.wtransfer.id, dbid: route.query.dbid } })
                        // }, 2000)
@@ -407,15 +370,14 @@
               }
            } else if (this.type === QRCodeType.CKD) {
               wOutBoundForUpload({
                  id: this.id,
                  id: info.value.woutbound.id,
                  wOutboundType: 0
               }).then(res => {
                  if (res.code === 200) {
                     this.$store.dispatch('getUpcomingNum')
                     uni.$u.toast('操作成功')
                     uni.$emit('success')
                     uni.redirectTo({
                        url: `/pages_adjust/pages/outboundDetails/outboundDetails?id=${this.id}`
                        url: `/pages_adjust/pages/outboundDetails/outboundDetails?id=${this.info.id}`
                     })
                     // setTimeout(() => {
                     //   // router.go(-1)
@@ -705,7 +667,6 @@
               display: flex;
               align-items: center;
               margin-top: 15rpx;
               font-size: 24rpx;
            }
            .page_yxwl_list_item_num {
@@ -790,7 +751,6 @@
      left: 30rpx;
      padding-bottom: 68rpx;
      z-index: 9999;
      .page_footer_qr {
         flex: 1;
         height: 88rpx;