Mr.Shi
2023-09-06 e065047450407e9b0448e2b3e7786f8959f35cf9
minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
@@ -29,26 +29,25 @@
      </view>
      <view class="zk_wl">
         <template v-if="view.MaterialList.length > 0">
            <van-swipe-cell v-for="(item, i) in view.MaterialList" :key="i">
               <view class="zk_wl_item">
            <view class="zk_wl_item" v-for="(item, i) in view.MaterialList" :key="i">
               <image class="shanchu" src="@/static/chuku_ic_delete@2x.png" mode="widthFix" @click="dele(i)"></image>
                  <text>{{item.materialName}}|{{item.materialCode}}</text>
                  <text>
                     <text class="green" v-if="item.qualityType === '0'">合格</text>
                     <text class="yellow" v-if="item.qualityType === '1'">不良</text>
                     <text class="red" v-if="item.qualityType === '2'">报废</text>
                     | <text>{{item.procedureName ? item.procedureName : '-'}} | </text>
                  <text class="green" v-if="item.qualityType === '0'">合格&nbsp;|</text>
                  <text class="yellow" v-if="item.qualityType === '1'">不良&nbsp;|</text>
                  <text class="red" v-if="item.qualityType === '2'">报废&nbsp;|</text>
                  <text>{{item.procedureName ? item.procedureName : '-'}}&nbsp;|&nbsp;</text>
                     <text>{{item.batch ? item.batch : '-'}}</text>
                  </text>
                  <text>货位:{{item.locationName}}</text>
                  <view class="zk_wl_item_num">
                     <text>转出数量({{item.unitName}}):</text>
                  <text>货位:{{item.locationName}}</text>
                  <view class="zk_wl_item_input">
                     <text>数量:</text>
                     <input type="number" v-model="item.total" placeholder="0" />
                     <text>{{item.unitName}}</text>
                  </view>
               </view>
               <template #right>
                  <van-button square type="danger" style="height: 100%;" text="删除" @click="dele(i)" />
               </template>
            </van-swipe-cell>
            </view>
         </template>
         <view class="zk_wl_w" v-else>
            <text>暂无数据</text>
@@ -63,7 +62,12 @@
      <!-- 选择仓库 -->
      <Warehouse :show="view.Warehouse" @close="view.Warehouse = false" @value="getValue" />
      <!-- 选择物料 -->
      <SelectMultipleMaterial ref="SelectMultipleMaterial" />
      <multipleMaterial
      :warehouseId="data.exWarehouseId.toString()"
      :warehouseQualityType="view.warehouseQualityType"
      :selected="view.MaterialList.map(item => item.id)"
      @value="getValueWL"
      ref="multipleMaterial" />
      <!--  单据类型  -->
      <u-picker :show="view.type" :columns="view.documentTypeDate" keyName="name" @cancel="onCancel" @confirm="onConfirm"></u-picker>
   </view>
@@ -72,13 +76,13 @@
<script>
   import { setTime } from '@/util/utils.js'
   import { documentType } from '@/util/constData.js'
   import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
   import multipleMaterial from '../../components/multipleMaterial.vue'
   import Warehouse from '../../components/Warehouse.vue'
   import { createZK } from '@/util/api/agencyAPI'
   
   export default {
      components: {
         SelectMultipleMaterial,
         multipleMaterial,
         Warehouse
      },
      data() {
@@ -117,17 +121,21 @@
                      { name: '废品入库', id: 30 }
                  ]
               ],
               warehouseQualityType: '',
               customFieldName: {
                  text: 'name'
               }
               warehouseQualityType: ''
            }
         };
      },
      methods: {
         // 删除物料
         dele(i) {
            this.view.MaterialList.splice(i, 1)
         },
         // 仓库回调
         getValue(val) {
            if (this.view.status === 'c') {
               if (this.data.exWarehouseId !== val.id) {
                  this.view.MaterialList = []
               }
               this.data.exWarehouse = val.name
               this.data.exWarehouseId = val.id
               this.data.outUserId = val.managerId
@@ -138,6 +146,14 @@
               this.view.warehouseQualityType = val.tmodel.label
            }
            this.view.Warehouse = false
         },
         // 物料回调
         getValueWL(val) {
            val.forEach(element => {
               element.total = element.num
            })
            this.view.MaterialList.push(...val)
            this.view.Material = false
         },
         // 确认单据类型
         onConfirm(val) {
@@ -178,8 +194,8 @@
                  proceduresId: element.procedureId,
                  inLocationId: null,
                  outLocationId: element.locationId,
                  inWarehouseId: data.exWarehouseId,
                  outWarehouseId: data.warehousingWarehouse
                  inWarehouseId: this.data.exWarehouseId,
                  outWarehouseId: this.data.warehousingWarehouse
               })
            })
            createZK({
@@ -194,7 +210,7 @@
               wtransferDetailBeanList
            }).then(res => {
               if (res.code === 200) {
                  uni.showToast({ title: '创建成功!', icon: 'none', duration: 2000 });
                  uni.showToast({ title: '创建成功!', icon: 'success', duration: 2000 });
                  setTimeout(() => {
                     uni.navigateBack({ delta: 1 });
                  }, 2000)
@@ -221,7 +237,7 @@
                     // const { selected } = Material.value
                     // Material.value.selected = arr
                     // view.Material = true
                     this.$refs.SelectMultipleMaterial.open({})
                     this.$refs.multipleMaterial.open()
                  } else {
                     uni.showToast({ title: '请先选择入库仓库', icon: 'none', duration: 2000 });
                  }
@@ -314,6 +330,15 @@
            flex-direction: column;
            padding: 30rpx;
            border-bottom: 1rpx solid #e2e2e2;
            position: relative;
            .shanchu {
               width: 48rpx;
               height: 48rpx;
               position: absolute;
               top: 0;
               right: 0;
            }
            .zk_wl_item_num {
               display: flex;
@@ -321,15 +346,27 @@
               justify-content: space-between;
               margin-top: 30rpx;
               .zk_wl_item_input {
                  display: flex;
                  align-items: center;
               text {
                  font-size: 28rpx;
                     font-size: 26rpx;
                     font-family: PingFangSC-Regular, PingFang SC;
                  font-weight: 400;
                  color: #222222;
                     color: #666666;
                  }
               }
               text {
                  font-size: 26rpx;
                  font-family: PingFangSC-Regular, PingFang SC;
                  font-weight: 400;
                  color: #333333;
                  margin: 0 !important;
               }
               input {
                  width: 180rpx;
                  width: 140rpx;
                  height: 60rpx;
                  background: #FFFFFF;
                  border-radius: 8rpx;
@@ -384,6 +421,7 @@
         position: fixed;
         bottom: 0;
         left: 0;
         z-index: 999;
         padding-bottom: 68rpx;
         display: flex;
         align-items: center;