yyb
2 天以前 26c601a5e0285f68041e3408ca610157a75c9cf6
pages/product/report/seachPersonnelNo.vue
@@ -10,11 +10,11 @@
         <!-- 模糊查询推荐列表 -->
         <view v-if="recommendations.length > 0" class="recommendation-list">
            <view class="recommendation-item" v-for="item in recommendations" :key="item.lotBatchNo"
            <view class="recommendation-item" v-for="item in recommendations" :key="item.ifsBatchNo"
               @click="selectRecommendation(item)">
               <view class="recommendation-line">
                  <text class="recommendation-label">批号:</text>
                  <text class="recommendation-value">{{ item.lotBatchNo }}</text>
                  <text class="recommendation-value">{{ item.ifsBatchNo }}</text>
               </view>
               <!-- <view class="recommendation-line">
                  <text class="recommendation-label">零件描述:</text>
@@ -124,6 +124,7 @@
            productInputList: [],
            recommendations: [], // 推荐列表数据
            moOn: "",
            workstationId: "",
         };
      },
      onLoad() {
@@ -146,31 +147,32 @@
   },
  onLoad(option) {
     console.log(option.moOn); // 输出: value1
      this.moOn = option.moOn;
     this.moOn = option.moOn;
     this.workstationId = option.workstationId;
    },
   methods: {
         // 显示推荐列表
         showRecommendations() {
            // 当输入框获得焦点且为空时,显示默认推荐
            if (!this.keywords.trim()) {
               this.loadDefaultRecommendations();
            }
            // if (!this.keywords.trim()) {
            //    this.loadDefaultRecommendations();
            // }
         },
         // 加载默认推荐
         loadDefaultRecommendations() {
            // 调用API获取默认推荐数据
            this.$u.api.cancelReporting
                  .fuzzyQuery()
               .then((res) => {
                  console.log('默认推荐结果:', res.data);
                  this.recommendations = res.data || [];
               })
               .catch((err) => {
                  console.error('获取默认推荐失败:', err);
                  this.recommendations = [];
               });
         },
         // // 加载默认推荐
         // loadDefaultRecommendations() {
         //    // 调用API获取默认推荐数据
         //    this.$u.api.cancelReporting
         //          .fuzzyQuery()
         //       .then((res) => {
         //          console.log('默认推荐结果:', res.data);
         //          this.recommendations = res.data || [];
         //       })
         //       .catch((err) => {
         //          console.error('获取默认推荐失败:', err);
         //          this.recommendations = [];
         //       });
         // },
         // 选择推荐项
         selectRecommendation(item) {
@@ -178,7 +180,7 @@
            console.log('选择推荐项:', this.moOn);
            this.$u.api.cancelReporting
               .selInputPartInfoPDA({
                  outBatchNo: item.lotBatchNo,
                  outBatchNo: item.ifsBatchNo,
                  partNo: item.partNo,
                  moOn: this.moOn,
               })
@@ -201,9 +203,12 @@
                  this.keywords = '';
                  this.recommendations = [];
               });
            // this.detailedList = item;
            // this.detailedList.ifsBatchNo = item.lotBatchNo;
            // this.showModal = true;
                  // this.detailedList = item;
                  // this.detailedList.suppliedQuantity = item.availableStockQuantity;
                  // this.showModal = true;
                  // // 清空输入框和推荐列表
                  // this.keywords = '';
                  // this.recommendations = [];
         },
         updateArray(arr, newObj) {
@@ -232,8 +237,9 @@
         search(value) {
            if (value) {
               this.$u.api.cancelReporting
                  .fuzzyQuery({
                     lotBatchNo: value,
                  .getStockNoPageByWorkstationId({
                     ifsBatchNo: value,
                     workstationId: this.workstationId,
                  })
                  .then((res) => {
                     console.log('模糊查询结果:', res.data);