#
whycq
2024-04-09 86f9ba9278682d7c117c2e95654c836b6cae36ff
pages/phyz/order/orderCar.vue
@@ -1,6 +1,6 @@
<template>
   <view>
      <view class="list list-font-color shop-car" :class="orderDetl.color" v-for="orderDetl in orderCarList" >
      <view class="list list-font-color shop-car" :class="orderDetl.color" v-for="(orderDetl,index) in orderCarList" :key="index">
         <view class="list-left">
            <view class="detl-threeCode">{{orderDetl.threeCode}}</view>
            <view>主单号:{{orderDetl.orderNo}}</view>
@@ -9,7 +9,7 @@
            <view>总数量:{{orderDetl.anfme}}</view>
            <view>入库数量:{{orderDetl.pakinQty}}</view>
         </view>
         <view class="list-right" @click="chageDetl(orderDetl)">
         <view class="list-right" @click="chageDetl(index)">
            <uni-icons type="settings" size="25"  color="#fff"></uni-icons>
         </view>
      </view>
@@ -29,8 +29,8 @@
                  <uni-number-box :value="count" :step='1' :max="9999999" color="#747474" @change="changeValue" />
               </view>
               <view class="btn">
                  <view class="btn-left" @click="addClose">取消</view>
                  <view class="btn-right" @click="addConfirm()">添加</view>
                  <view class="btn-left" @click="remove()">移除物料</view>
                  <view class="btn-right" @click="changeCount()">修改数量</view>
               </view>
            </view>
         </uni-popup>
@@ -42,7 +42,9 @@
   export default {
      data() {
         return {
            orderCarList: []
            orderCarList: [],
            count: 0,
            index: 0
         }
      },
      onShow() {
@@ -58,9 +60,28 @@
         })
      },
      methods: {
         chageDetl() {
         }
         chageDetl(index) {
            this.index = index
            this.$refs.chageDetl.open()
         },
         // 修改数量
         changeCount() {
            if (this.count > this.orderCarList[this.index].anfme) {
               uni.showToast({ title: '数量不合法!', icon: "none", position: 'top' })
               return
            }
            this.orderCarList[this.index].pakinQty = this.count
            this.$forceUpdate() // 强制刷新
            this.$refs.chageDetl.close()
         },
         // 移除物料
         remove() {
            this.orderCarList.splice(this.index, 1)
            this.$refs.chageDetl.close()
         },
         changeValue(value) {
            this.count = value
         },
      }
   }
</script>
@@ -129,7 +150,7 @@
      height: 100%;
      justify-content: center;
      align-items: center;
      color: #606266;
      color: #e2231a;
      border-right: 1px solid #DCDFE6;
   }
   .btn-right {