#
lty
昨天 fbbbc66329808249c7a0689f2efca6c79a6bf892
pages/basics/pakStore.vue
@@ -7,12 +7,10 @@
         </view>
         <view class="square-content">
            <view class="content-input-btn">
               <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()"
               :focus="focus" placeholder-style="line-height:  85rpx;">
               <uni-icons type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons>
               <input v-model="barcode" placeholder="请输入条码"  placeholder-style="line-height:  85rpx;">
            </view>
            <view class="content-btn">
               <button class="cu-btn bg-blue pda-btn" @click="selectMat()">+提取</button>
               <button class="cu-btn bg-blue pda-btn" @click="fetchProductList()">+提取</button>
            </view>
         </view>
      </view>
@@ -49,9 +47,37 @@
         
      </view>
      
      <view class="square-none" v-show="matList.length === 0">
      <view class="square-none" v-show="productList.length === 0">
         <view class="v-show">暂无更多数据...</view>
      </view>
         <checkbox-group @change="checkbox">
            <view v-for="(item,index) in productList" :key="index" class="data-list bg-false"
               :class="'bg-'+item.checked">
               <view class="data-list-left">
                  <!-- <view>
                     <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
                  </view> -->
                  <view class="matnr"><text style="width: 400rpx;">编码:{{item.matnr}}</text></view>
                  <view><text style="width: 400rpx;">品名:{{item.maktx}}</text></view>
                  <view><text style="width: 400rpx;">工作号:{{item.workNo}}</text></view>
<!--                   <view><text style="width: 400rpx;">开始时间:{{item.startTime}}</text></view>
                  <view><text style="width: 400rpx;">结束时间:{{item.endTime}}</text></view> -->
                  <view>
                     <text style="width: 400rpx;">数量:{{item.anfme}}</text>
<!--                      <text style="margin-left: 100rpx;">单位:{{item.unit}}</text> -->
                  </view>
               </view>
               <view class="data-list-right">
                  <label>
                     <uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons>
                  </label>
                  <label>
                     <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
                  </label>
               </view>
            </view>
         </checkbox-group>
      </scroll-view>
      
      <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
         <view class="data-list-left">
@@ -67,7 +93,7 @@
         </view>
         <view class="data-list-right">
            <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
            <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label>
            <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="removeMat(item,index)"></uni-icons></label>
         </view>
      </view>
        <!-- 底部按钮 -->
@@ -76,7 +102,7 @@
              <button class="cu-btn" @click="resst()">重置</button>
           </label>
           <label class="label-btn">
              <button class="cu-btn bg-blue " @click="comb()">启动入库</button>
              <button class="cu-btn bg-blue " @click="startPutIn()">启动入库</button>
           </label>
        </view>
        <!-- 弹窗 -->
@@ -112,7 +138,10 @@
                matList: [],
                sites: [],
                siteId: '',
            count:0
            count:0,
            barcode: '',       // 扫描或输入条码
            productList: [],   // 提取到的商品列表
            workNo: '',        // 工号(用于调用入库接口)
            }
        },
        mounted(){
@@ -133,6 +162,10 @@
         // 清空input
         remove(e) {
            this[e] = ''
         },
         // 移除物料
         removeMat(item,index) {
            this.matList.splice(index,1)
         },
         // 搜索物料
         findMat() {
@@ -215,6 +248,31 @@
               },
            });
         },
         fetchProductList() {
           if (!this.barcode) {
            uni.showToast({ title: '请输入条码', icon: 'none' });
            return;
           }
           uni.request({
            url: this.commonUrl + "/mobile/pickIn/auth?barcode=" + this.barcode,
            method: 'GET',
            success: (res) => {
            console.log(res.data.data);
              if (res.data.data && res.data.data.length > 0) {
               this.productList = res.data.data;
               this.siteId = res.data.data[0].staNo;
               this.workNo = res.data.data[0].workNo;
              } else {
               uni.showToast({ title: '未找到商品', icon: 'none' });
              }
            },
            fail: () => {
              uni.showToast({ title: '提取失败', icon: 'none' });
            }
           });
         },
         // 获取可用入库站点
            getInBound() {
                let that = this;
@@ -241,6 +299,25 @@
                    }
                })
            },
         // 启动入库
         startPutIn() {
           if (!this.siteId || !this.workNo) {
             uni.showToast({ title: '信息不完整', icon: 'none' });
             return;
           }
           uni.request({
             url:this.baseHttp + this.baseIP + ':' +"9090" + "/" +"tzglwcs" + "/console/site/pickIn?siteId=" + this.siteId + "&workNo=" + this.workNo,
             method: 'POST',
             success: (res) => {
               uni.showToast({ title: '入库成功', icon: 'success' });
              this.resst();
             },
             fail: () => {
               uni.showToast({ title: '入库失败', icon: 'none' });
             }
           });
         },
            // 启动入库
         comb() {
                let that = this
@@ -274,11 +351,15 @@
                    }
                })
            },
            resst() {
                this.matnr = '';
                this.siteId = '';
            this.matList = [];
            },
         resst() {
           this.matnr = '';
           this.siteId = '';
           this.workNo = '';
           this.barcode = '';
           this.productList = [];
           this.matList = [];
         },
         // 修改数量
         revise(item,index) {
            this.count = this.matList[index].anfme