Mr.Zhang
2023-09-07 1e993780749c9525be74e77e4c81b7db2c88da6f
minipro_standard/pages/InOperation/InOperation.vue
@@ -3,10 +3,11 @@
      <InOutInfo :info="info" />
      <uni-collapse @change="change" @close="close" @open="open">
         <uni-collapse-item v-for="(item, index) in wtransferWarehouseList" :key="index">
         <uni-collapse-item v-if="type==7" v-for="(item1, index) in wtransferWarehouseList" :key="index"
            :open="item1.wtransferDetailList.length">
            <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>
               <view>{{ item.warehouseName }}</view>
               <view>{{ item1.warehouseName }}</view>
            </view>
            <view class="p30">
               <div class="page_dck">
@@ -15,7 +16,7 @@
                     <span>待入库物料</span>
                  </div>
               </div>
               <div class="page_content" v-for="(item, index) in info.woutboundDetailsWait" :key="index"
               <div class="page_content" v-for="(item, index) in item1.wtransferDetailList" :key="index"
                  :name="index">
                  <div class="page_content_title">
                     <div class="page_content_title_top">
@@ -34,31 +35,28 @@
                        <span>{{item.batch ? item.batch : '-'}}</span>
                     </div>
                  </div>
                  <div class="page_content_list">
                  <div class="page_content_list" v-for="(childer, idxs) in item.wstockExtListVOList" :key="idxs">
                     <div class="page_content_list_item">
                        <div class="page_content_list_item_label">入库货位:</div>
                        <div class="page_content_list_item_nr">
                           {{item.locationName ? item.locationName : '-'}}
                        </div>
                        <div class="page_content_list_item_nr">{{ childer.locationName }}</div>
                     </div>
                     <div class="page_content_list_items">
                        <div class="page_content_list_item_label">数量:</div>
                        <div class="page_content_list_item_nr">{{item.num ? item.num : '-'}}{{item.unitName}}
                        </div>
                        <div class="page_content_list_item_nr">{{ childer.num }}{{ childer.unitName }}</div>
                     </div>
                  </div>
               </div>
            </view>
         </uni-collapse-item>
      </uni-collapse>
      <div class="page_h"></div>
      <div class="page_h"></div>
      <div class="page_yxwl">
         <div class="page_yxwl_title">
            <div class="left">
               <div class="page_yxwl_title_x"></div>
               <span>已选择物料</span>
            </div>
            </div>
            <div class="right" v-if="isZKD" @click="openxz">
               <image src="../../static/gongdan_ic_shoudong@2x.png" class="img36" mode=""></image><span>手动入库</span>
               <!-- <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt=""> -->
@@ -159,58 +157,140 @@
         <div class="page_footer_ck" @click="submit">
            <span>确认入库</span>
         </div>
      </div>
      <SelectMultipleMaterial ref="selectMultipleMaterial" />
      </div>
      <SelectMultipleMaterial ref="selectMultipleMaterial" />
      <SelectLoaction ref="selectLoaction" @selected="selectLocation"/>
      <MaterialIn ref="materialIn" @selected="selectLocation"/>
   </view>
</template>
<script>
   import InOutInfo from '@/components/InOutInfo.vue'
   import InOutInfo from '@/components/InOutInfo.vue'
   import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
   import { QRCodeType } from '@/common/config.js'
   import SelectLoaction from '@/components/SelectLoaction.vue'
   import MaterialIn from '@/components/materialIn.vue'
   import {
      QRCodeType
   } from '@/common/config.js'
   import {
      getList,
      outScanAppliances,
      getLocationInfo,
      saveIn,
      getInByWTransferId,
      wTransferForInOut,
      wOutBoundForInOut,
      wOutBoundForUpload,
      transferToInNew
   } from '@/util/api/ExWarehouse'
   import {
      wTransferForInOutUpload
   } from '@/util/api/ExWarehouse'
   import {
      getBarcodeContent,
      getListByCondition,
      getListByWarehouseId
   } from '@/util/api/WorkOrderAPI'
   import {
      getDB
   } from '@/util/api/agencyAPI'
   export default {
      components: {
         InOutInfo,
         SelectLoaction,
         MaterialIn,
         SelectMultipleMaterial
      },
      data() {
         return {
            type: '',
            isZKD: false,
         return {
            type: '',
            id: '',
            wareHouseId: '',
            isZKD: false,
            show: false,
            info: {
               outPlandate: '2022/02/14',
               originType: 1,
               wtransferRedisCodeBeanList: [],
               remark: 'Vue是前端开发中广泛使用的一个JavaScript框架,它可以让我们更轻松地管理页面的状态、渲染和交互。但是在编写Vue应用时,有时会遇到“SyntaxError: Unexpected token”报错,这个错误提示意味着代码中存在语法错误,JavaScript引擎无法解析,从而导致程序运行失败。本篇文章将介绍常见引起“SyntaxError: Unexpected token”的原因以及解决方法。'
            },
            ids: [],
            wtransferWarehouseList: [{
               warehouseName: '测试库'
            }]
            info: {},
            ids: [],
            location: '',
            locationName: '',
            wtransferWarehouseList: [],
            MateriaList: []
         };
      },
      onLoad(option) {
         this.type = option.type||'ZKD'
         this.isZKD = this.type==QRCodeType.ZKD
         // console.log(this.type, QRCodeType.ZKD, this.type==QRCodeType.ZKD);
      },
      onLoad(option) {
         this.type = option.type
         this.id = option.id
         this.isZKD = this.type == QRCodeType.ZKD
         if (option.dbid) {
            this.getDBs(option.dbid)
         } else {
            this.getInfo()
         }
      },
      methods: {
         getDBs(dbid) {
            getDB(dbid)
               .then(res => {
                  let {
                     data
                  } = res
                  if (data.status == 1) {
                     // 已完成
                  } else {
                     this.getInfo()
                  }
               })
               .catch(err => {})
         },
         getInfo() {
            let infoAction
            let data = {
               id: this.id
            }
            console.log(this.type, QRCodeType.CKD);
            if (this.type == QRCodeType.CKD) {
               infoAction = wOutBoundForInOut
               data.wOutboundType = '1'
            } else if (this.type == QRCodeType.ZKD) {
               infoAction = wTransferForInOut
               data.wTransferType = '1'
            }
            infoAction(data).then(res => {
               if (this.isZKD) {
                  this.info = res.data.wtransfer
                  this.wareHouseId = res.data.wtransfer.inWarehouseId
                  this.wtransferWarehouseList = res.data.wtransferWarehouseList
                  this.MateriaList = res.data.wtransferWarehouseList[0].wtransferDetailList
               } else {
                  this.info = res.data.woutbound
                  this.woutboundDetailsWait = res.data.woutboundDetailsWait
               }
            }).catch(err => {
               uni.$u.toast(err)
               uni.navigateBack()
            })
         },
         change() {},
         close() {},
         open() {},
         openxz() {
           let arr = []
           if (this.info.wtransferRedisCodeBeanList.length !== 0) {
             this.info.wtransferRedisCodeBeanList.forEach(element => {
               arr.push(element.appliancesId)
             })
             this.ids = arr.join(',')
           } else {
             this.ids = ''
           }
          this.$refs.selectMultipleMaterial.open({})
         open() {},
         openxz() {
            getListByWarehouseId({
                  wareHouseId: this.wareHouseId
               })
               .then(res => {
                  if (res.data.length === 1) {
                     this.location = res.data[0].id
                     this.locationName = res.data[0].unionName
                     this.$refs.materialIn.open({list: this.MateriaList})
                  } else {
                     this.$refs.selectLoaction.open({wareHouseId: this.wareHouseId})
                  }
               })
         },
         selectLocation(item) {
            this.location = item.id
            this.locationName = item.unionName
            this.$refs.materialIn.open({list: this.MateriaList})
         }
      }
   }
</script>