| | |
| | | |
| | | <!-- 模糊查询推荐列表 --> |
| | | <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> |
| | |
| | | productInputList: [], |
| | | recommendations: [], // 推荐列表数据 |
| | | moOn: "", |
| | | workstationId: "", |
| | | }; |
| | | }, |
| | | onLoad() { |
| | |
| | | }, |
| | | 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) { |
| | | console.log('选择推荐项:', item); |
| | | console.log('选择推荐项:', this.moOn); |
| | | this.$u.api.cancelReporting |
| | | .selInputPartInfoPDA({ |
| | | outBatchNo: item.lotBatchNo, |
| | | partNo: item.partNo, |
| | | moOn: this.moOn, |
| | | }) |
| | | .then((res) => { |
| | | const list = { |
| | | suppliedQuantity: res.data.suppliedQuantity, |
| | | ifsBatchNo: res.data.ifsBatchNo, |
| | | partNo: res.data.partNo, |
| | | partName: res.data.partName, |
| | | locationNo: res.data.locationNo, |
| | | ifsLineItemNo: res.data.ifsLineItemNo, |
| | | serialNo: res.data.serialNo, |
| | | engChgLevel: res.data.engChgLevel, |
| | | ifsWdr: res.data.waivDevRejNo, |
| | | activitySeq: res.data.activitySeq, |
| | | }; |
| | | this.detailedList = list; |
| | | // this.$u.api.cancelReporting |
| | | // .selInputPartInfoPDA({ |
| | | // outBatchNo: item.lotBatchNo, |
| | | // partNo: item.partNo, |
| | | // moOn: this.moOn, |
| | | // }) |
| | | // .then((res) => { |
| | | // const list = { |
| | | // suppliedQuantity: res.data.suppliedQuantity, |
| | | // ifsBatchNo: res.data.ifsBatchNo, |
| | | // partNo: res.data.partNo, |
| | | // partName: res.data.partName, |
| | | // locationNo: res.data.locationNo, |
| | | // ifsLineItemNo: res.data.ifsLineItemNo, |
| | | // serialNo: res.data.serialNo, |
| | | // engChgLevel: res.data.engChgLevel, |
| | | // ifsWdr: res.data.waivDevRejNo, |
| | | // activitySeq: res.data.activitySeq, |
| | | // }; |
| | | // this.detailedList = list; |
| | | // this.showModal = true; |
| | | // // 清空输入框和推荐列表 |
| | | // this.keywords = ''; |
| | | // this.recommendations = []; |
| | | // }); |
| | | this.detailedList = item; |
| | | this.detailedList.suppliedQuantity = item.availableStockQuantity; |
| | | this.showModal = true; |
| | | // 清空输入框和推荐列表 |
| | | this.keywords = ''; |
| | | this.recommendations = []; |
| | | }); |
| | | // this.detailedList = item; |
| | | // this.detailedList.ifsBatchNo = item.lotBatchNo; |
| | | // this.showModal = true; |
| | | }, |
| | | |
| | | updateArray(arr, newObj) { |
| | |
| | | search(value) { |
| | | if (value) { |
| | | this.$u.api.cancelReporting |
| | | .fuzzyQuery({ |
| | | lotBatchNo: value, |
| | | .getStockNoPageByWorkstationId({ |
| | | ifsBatchNo: value, |
| | | workstationId: this.workstationId, |
| | | }) |
| | | .then((res) => { |
| | | console.log('模糊查询结果:', res.data); |