From 1f017a1ebe252ef945e42dc868ac8c24e2b6d534 Mon Sep 17 00:00:00 2001 From: yyb <995253665@qq.com> Date: 星期四, 21 八月 2025 17:35:49 +0800 Subject: [PATCH] pda报工选择投料接口变更 --- pages/product/report/seachPersonnelNo.vue | 558 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 558 insertions(+), 0 deletions(-) diff --git a/pages/product/report/seachPersonnelNo.vue b/pages/product/report/seachPersonnelNo.vue new file mode 100644 index 0000000..fba4584 --- /dev/null +++ b/pages/product/report/seachPersonnelNo.vue @@ -0,0 +1,558 @@ +<template> + <view class="page"> + <view class="finishProductIn-locno-bg" /> + <u-navbar title="鎶曟枡鍒楄〃" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" + back-icon-color="#000" /> + <view class="finishProductIn-locno-search"> + <u-search v-model="keywords" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false" + placeholder="鍙互杈撳叆鎵规鍙疯繘琛屾姇鏂�" @clear="search" @custom="search" @search="search" @input="search" @focus="showRecommendations"> + </u-search> + + <!-- 妯$硦鏌ヨ鎺ㄨ崘鍒楄〃 --> + <view v-if="recommendations.length > 0" class="recommendation-list"> + <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.ifsBatchNo }}</text> + </view> + <!-- <view class="recommendation-line"> + <text class="recommendation-label">闆朵欢鎻忚堪:</text> + <text class="recommendation-value">{{ item.partName }}</text> + </view> + <view class="recommendation-line"> + <text class="recommendation-label">鏁伴噺:</text> + <text class="recommendation-value">{{ item.suppliedQuantity }}</text> + </view> --> + </view> + </view> + </view> + <view class="wrap"> + <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true"> + <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false"> + <view class="content" v-for="(item, index) in list" :key="item.moNo" :index="index"> + <view class="content-header"> + <view class="content-header-title">{{ index + 1 }}</view> + </view> + <view class="content-body"> + <view class="row-list"> + <view class="_label"> + <view class="_label-icon-1"> </view> + <view class="_label-name">鎵瑰彿:</view> + </view> + <view class="_content"> + {{ item.ifsBatchNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + <view class="_label-icon-2"> </view> + <view class="_label-name">闆朵欢鎻忚堪:</view> + </view> + <view class="_content"> + {{ item.partName }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + <view class="_label-icon-3"> </view> + <view class="_label-name">鏁伴噺:</view> + </view> + <view class="_content"> + {{ item.suppliedQuantity }} + </view> + </view> + </view> + </view> + </u-cell-group> + </scroll-view> + <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true" + @confirm="confirmTl" @cancel="cancelTl"> + <view class="packing-registration-param"> + <view class="packing-registration-param-view"> + <view class="packing-registration-param-item param-extra"> + <view class="packing-registration-param-item-left"> + <text class="item-one">鎵瑰彿</text> + </view> + <view class="packing-registration-param-item-right"> + <text class="item-one item-two">{{ + detailedList.ifsBatchNo + }}</text> + </view> + </view> + <view class="packing-registration-param-item param-extra"> + <view class="packing-registration-param-item-left"> + <text class="item-one">闆朵欢鎻忚堪</text> + </view> + <view class="packing-registration-param-item-right"> + <text class="item-one item-two">{{ detailedList.partName }}</text> + </view> + </view> + <view class="packing-registration-param-item param-extra"> + <view class="packing-registration-param-item-left"> + <text class="item-one">鏁伴噺</text> + </view> + <view class="packing-registration-param-item-right"> + <u-input class="item-one item-two" v-model="detailedList.suppliedQuantity" /> + </view> + </view> + </view> + </view> + </u-modal> + </view> + <view class="finishProductIn-locno-search"> + <u-button type="primary" class="bottom-button" @click="selectNo">鎻愪氦</u-button> + </view> + </view> +</template> +<script> + import content_bg from "@/static/custom/finishProductIn/locNoBg.png"; + export default { + data() { + return { + background: { + backgroundImage: `url(${content_bg})`, + backgroundAttachment: "fixed", + backgroundSize: "100% auto", + backgroundRepeat: "no-repeat", + }, + keywords: "", + list: [], + detailedList: {}, + showModal: false, + ifsBatchNo: [], + productInputList: [], + recommendations: [], // 鎺ㄨ崘鍒楄〃鏁版嵁 + moOn: "", + workstationId: "", + }; + }, + onLoad() { + // this.getlist(); + }, + onShow() { + let that = this; + uni.$off("scan"); // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒 + uni.$on("scan", function(data) { + //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲� + if (data.code) { + let codeInfo = JSON.parse(data.code); + if (codeInfo) { + that.codeInfoId = codeInfo.id; + // 鎵弿鎶ュ伐鍗曚簩缁寸爜 + that.saveForm(codeInfo); + } + } + }); + }, + onLoad(option) { + console.log(option.moOn); // 杈撳嚭: value1 + this.moOn = option.moOn; + this.workstationId = option.workstationId; + }, + methods: { + // 鏄剧ず鎺ㄨ崘鍒楄〃 + showRecommendations() { + // 褰撹緭鍏ユ鑾峰緱鐒︾偣涓斾负绌烘椂锛屾樉绀洪粯璁ゆ帹鑽� + // 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 = []; + // }); + // }, + + // 閫夋嫨鎺ㄨ崘椤� + 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.showModal = true; + // // 娓呯┖杈撳叆妗嗗拰鎺ㄨ崘鍒楄〃 + // this.keywords = ''; + // this.recommendations = []; + // }); + this.detailedList = item; + this.detailedList.suppliedQuantity = item.availableStockQuantity; + this.showModal = true; + // 娓呯┖杈撳叆妗嗗拰鎺ㄨ崘鍒楄〃 + this.keywords = ''; + this.recommendations = []; + }, + + updateArray(arr, newObj) { + // 鏌ユ壘鏁扮粍涓槸鍚︽湁鐩稿悓鐨� id + let index = arr.findIndex(item => item.ifsBatchNo === newObj.ifsBatchNo); + + if (index !== -1) { + // 濡傛灉鎵惧埌鐩稿悓 id 鐨勫璞★紝鏇挎崲鍘熸湁瀵硅薄 + arr[index] = newObj; + } else { + // 濡傛灉娌℃湁鎵惧埌鐩稿悓 id 鐨勫璞★紝鐩存帴鎺ㄥ叆鏂板璞� + arr.push(newObj); + } + return arr; + }, + confirmTl() { + let updatedArrayList = this.updateArray(this.list, this.detailedList); + this.list =updatedArrayList; + this.showModal = false; + this.detailedList = {}; + }, + cancelTl() { + this.showModal = false; + this.detailedList = {}; + }, + search(value) { + if (value) { + this.$u.api.cancelReporting + .getStockNoPageByWorkstationId({ + ifsBatchNo: value, + workstationId: this.workstationId, + }) + .then((res) => { + console.log('妯$硦鏌ヨ缁撴灉:', res.data); + // 濡傛灉杩斿洖鐨勬槸鏁扮粍锛屽垯浣滀负鎺ㄨ崘鍒楄〃 + if (Array.isArray(res.data)) { + this.recommendations = res.data; + // 濡傛灉鍙湁涓�涓粨鏋滐紝鐩存帴閫変腑 + if (res.data.length === 1) { + this.selectRecommendation(res.data[0]); + } + } else { + // 濡傛灉杩斿洖鐨勬槸鍗曚釜瀵硅薄锛屾坊鍔犲埌鎺ㄨ崘鍒楄〃 + this.recommendations = [res.data]; + // this.selectRecommendation(res.data); + } + }); + } else { + // 娓呯┖鎺ㄨ崘鍒楄〃 + this.recommendations = []; + } + }, + // 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗� + saveForm(val) { + this.$u.api.cancelReporting + .selInputPartInfoPDA({ + outBatchNo: val.BN, + partNo: val.PN, + 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; + }); + }, + selectNo() { + this.refreshLastPage(this.list); + }, + + //鍒锋柊涓婁竴涓〉闈� + refreshLastPage(no) { + // 鍛婄煡 A.vue 鏇存柊鏁版嵁 + // 鑾峰彇椤甸潰鏍� + let pages = getCurrentPages(); + + // 鑾峰彇涓婁竴椤垫爤 + let prevPage = pages[pages.length - 2]; + + // 瑙﹀彂涓婁竴椤� upData 鍑芥暟(骞舵惡甯﹀弬鏁�) + prevPage.$vm.setFeedInputProductionVolume(no); + + // 杩斿洖涓婁竴椤� + uni.navigateBack({ + delta: 1, + }); + }, + }, + }; +</script> +<style lang="scss"> + .packing-registration-param { + padding: 40rpx 30rpx 10rpx 30rpx; + height: 350px; + overflow: hidden; + + .packing-registration-param-title { + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: 30rpx; + + .title-label { + margin-left: 14rpx; + font-size: 34rpx; + font-weight: bold; + color: #283e65; + } + } + + .packing-registration-param-view { + height: 177rpx; + background-color: #fff; + border-radius: 10rpx; + padding: 0rpx 23rpx; + margin-bottom: 30rpx; + + .packing-registration-param-item { + height: 90rpx; + border: 1px solid #adc8e4; + line-height: 90rpx; + display: flex; + justify-content: space-between; + border: none; + + .packing-registration-param-item-left { + .item-one { + word-break: break-all; + font-size: small; + color: #060505; + } + } + + .packing-registration-param-item-right { + display: flex; + justify-content: space-between; + + .item-one { + font-size: small; + color: #060505; + margin-right: 6rpx; + word-break: break-all; + } + + .item-two { + font-size: small; + color: #060505; + margin-right: 6rpx; + } + + .item-three { + font-size: 30rpx; + color: #214ded; + margin-right: 6rpx; + } + } + } + + .param-extra { + border-bottom: 1px solid #ededed; + } + } + } + .finishProductIn-locno-bg { + background-color: #f6f9ff; + background-image: url("~@/static/custom/finishProductIn/locNoBg.png"); + // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0)); + padding: 0 20rpx; + background-attachment: fixed; + background-size: 100% auto; + background-repeat: no-repeat; + position: fixed; + top: 0; + bottom: 0; + width: 100%; + z-index: -1; + } + + /* 鎺ㄨ崘鍒楄〃鏍峰紡 */ + .recommendation-list { + margin: 10rpx 30rpx; + background-color: #ffffff; + border-radius: 10rpx; + padding: 10rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + z-index: 999; + position: relative; + } + + .recommendation-item { + padding: 20rpx; + margin-bottom: 10rpx; + background-color: #f5f9ff; + border-radius: 8rpx; + cursor: pointer; + transition: background-color 0.3s; + } + + .recommendation-item:hover { + background-color: #e6f0ff; + } + + .recommendation-line { + display: flex; + justify-content: space-between; + margin-bottom: 8rpx; + } + + .recommendation-label { + font-size: 28rpx; + color: #666666; + } + + .recommendation-value { + font-size: 28rpx; + color: #333333; + text-align: right; + } + + .finishProductIn-locno-search { + padding: 40rpx 30rpx 20rpx 30rpx; + } + + .wrap .finishProductIn-locno-scroll-list { + height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx); + width: 100%; + } + + .finishProductIn-locno-scroll-list-group { + ::v-deep .u-cell-item-box { + background-color: rgba(250, 252, 255, 0.36) !important; + padding: 0rpx 30rpx; + } + + .content { + font-size: 12px; + background-color: #ffffff; + box-sizing: border-box; + border-radius: 10rpx; + margin: 0rpx 0rpx 16rpx; + padding: 20rpx 8rpx; + box-shadow: none; + display: flex; + align-items: center; + + white-space: normal; + + .content-header { + width: 40rpx; + height: 90rpx; + display: flex; + align-items: center; + overflow-wrap: break-word; + + .content-header-icon { + background-image: url("~@/static/custom/moveWareHouse/header_icon.png"); + background-size: 100% auto; + background-repeat: no-repeat; + height: 28rpx; + width: 28rpx; + } + + .content-header-title { + width: 40rpx; + // margin-left: 11rpx; + font-size: 26rpx; + color: #333333; + } + } + + .content-body { + flex: 1; + background: #f5f9ff; + border-radius: 10rpx; + padding: 0rpx 23rpx; + + .row-list { + height: 60rpx; + display: flex; + flex-direction: row; + padding: 0px; + align-items: center; + } + + .row-list ._label { + display: flex; + flex: 0.8; + color: #909399; + align-items: center; + + ._label-icon-1 { + background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png"); + background-size: 100% auto; + background-repeat: no-repeat; + height: 26rpx; + width: 26rpx; + } + + ._label-icon-2 { + background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png"); + background-size: 100% auto; + background-repeat: no-repeat; + height: 26rpx; + width: 26rpx; + } + + ._label-icon-3 { + background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png"); + background-size: 100% auto; + background-repeat: no-repeat; + height: 26rpx; + width: 26rpx; + } + + ._label-name { + margin-left: 11rpx; + font-size: small; + font-weight: 500; + color: #666666; + } + } + + .row-list ._content { + flex: 1.5; + text-align: right; + color: #909399; + font-size: small; + } + + .row-list .s1 { + color: #d35651; + } + } + } + } +</style> \ No newline at end of file -- Gitblit v1.9.3