PDA报工页面投料产量和汇报产量放到主页面,调整逻辑,接口联调,取消报工页面逻辑梳理,接口联调
已修改4个文件
已添加1个文件
847 ■■■■ 文件已修改
common/http.api.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/components/saveForm.vue 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index.vue 142 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/seachPersonnelNo.vue 552 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/http.api.js
@@ -508,6 +508,7 @@
            // å–消报工确认
            cancelDTAOfWorkApplication: (params = {}) => vm.$u.get('/mes/product/cancelDTAOfWorkApplication', params),
            selInputPartInfoPDA: (params = {}) => vm.$u.get('/mes/stock/selInputPartInfoPDA',params),
            fuzzyQuery: (params = {}) => vm.$u.get('mes/applyPart/fuzzyQuery', params),
        },
        // è½¦é—´è®¢å•下发
        WorkshopOrderIssued: {
pages.json
@@ -792,6 +792,15 @@
        "navigationBarBackgroundColor": "#3281FF"
      }
    },
        // æŠ•料列表
    {
      "path": "pages/product/report/seachPersonnelNo",
      "style": {
        "navigationStyle": "custom",
        "navigationBarTextStyle": "white",
        "navigationBarBackgroundColor": "#3281FF"
      }
    },
    // å–消报工
    {
      "path": "pages/product/cancelReport/index",
pages/product/report/components/saveForm.vue
@@ -1,24 +1,13 @@
<template>
  <view>
    <u-modal
      v-model="show"
      ref="uModal"
      title=""
      :show-cancel-button="true"
      @confirm="confirm"
      @cancel="cancel"
      :async-close="true"
      :loading="loading"
    >
        <u-modal v-model="show" ref="uModal" title="" :show-cancel-button="true" @confirm="confirm" @cancel="cancel"
            :async-close="true">
      <view class="packing-registration-param">
        <scroll-view
          scroll-y="true"
          style="
                <scroll-view scroll-y="true" style="
            height: 100%;
            transform: translateZ(0);
            -webkit-font-smoothing: antialiased;
          "
        >
          ">
          <view class="packing-registration-param-view">
            <view class="packing-registration-param-item param-extra">
              <view class="packing-registration-param-item-left">
@@ -28,7 +17,7 @@
                <u-input class="item-one item-two" v-model="form.outBatchNo" />
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
                        <!-- <view class="packing-registration-param-item param-extra">
              <view class="packing-registration-param-item-left">
                <text class="item-one">投料批次</text>
              </view>
@@ -39,16 +28,13 @@
                  disabled
                />
              </view>
            </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="form.overallLength"
                />
                                <u-input class="item-one item-two" v-model="form.overallLength" />
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -56,11 +42,7 @@
                <text class="item-one">库位</text>
              </view>
              <view class="packing-registration-param-item-right">
                <u-input
                  class="item-one item-two"
                  v-model="form.proposedLocation"
                  disabled
                />
                                <u-input class="item-one item-two" v-model="form.proposedLocation" disabled />
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -92,31 +74,23 @@
                <text class="item-one">净重</text>
              </view>
              <view class="packing-registration-param-item-right">
                <u-input
                  class="item-one item-two"
                  v-model="form.netWeight"
                  disabled
                />
                                <u-input class="item-one item-two" v-model="form.netWeight" disabled />
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
                        <!-- <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="form.waste" />
              </view>
            </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="form.name"
                  disabled
                />
                                <u-input class="item-one item-two" v-model="form.name" disabled />
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -124,10 +98,7 @@
                <text class="item-one">成品外径测量值</text>
              </view>
              <view class="packing-registration-param-item-right">
                <u-input
                  class="item-one item-two"
                  v-model="form.outerDiameter"
                />
                                <u-input class="item-one item-two" v-model="form.outerDiameter" />
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -159,24 +130,15 @@
                <text class="item-one item-two">生产速度</text>
              </view>
              <view class="packing-registration-param-item-right">
                <u-input
                  class="item-one item-two"
                  v-model="form.productionSpeed"
                />
                                <u-input class="item-one item-two" v-model="form.productionSpeed" />
              </view>
            </view>
          </view>
        </scroll-view>
      </view>
    </u-modal>
    <u-modal
      v-model="showModal"
      title=""
      :show-cancel-button="true"
      :show-confirm-button="true"
      @confirm="confirmTl"
      @cancel="cancelTl"
    >
        <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">
@@ -202,10 +164,7 @@
              <text class="item-one">数量</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="detailedList.suppliedQuantity"
              />
                            <u-input class="item-one item-two" v-model="detailedList.suppliedQuantity" />
            </view>
          </view>
        </view>
@@ -236,7 +195,7 @@
      form: {},
      ifsBatchNo: [],
      productInputList: [],
      loading: false,
                // loading: false,
    };
  },
  watch: {
@@ -257,7 +216,7 @@
  },
  methods: {
    confirm() {
      if (this.loading) return;
                // if (this.loading) return;
      // if (!this.form.outerDiameter) {
      //   this.$u.toast("请输入成品外径测量值");
      //   this.$refs.uModal.clearLoading(); // æ¸…除加载状态
@@ -293,37 +252,40 @@
        this.$refs.uModal.clearLoading(); // æ¸…除加载状态
        return;
      }
      if (!this.form.waste) {
        this.$u.toast("请输入废料");
        this.$refs.uModal.clearLoading(); // æ¸…除加载状态
        return;
      }
      if (this.form.productInputList.length == 0) {
        this.$u.toast("投料批次不能为空,请扫码投料");
        this.$refs.uModal.clearLoading(); // æ¸…除加载状态
        return;
      }
      this.operationTaskList.operationTaskId = this.operationTaskList.id;
      this.form.operationTaskId = this.operationTaskList.id;
      this.form.status = this.operationTaskList.status;
      this.form.Persons = this.operationTaskList.Persons;
      this.form.productStaffIds = this.operationTaskList.productStaffIds;
      this.form.productStaffs = this.operationTaskList.productStaffs;
      this.form.dutyRecordId = this.dutyId;
      this.operationTaskList.productOutputList = []; // åˆ›å»ºä¸€ä¸ªç©ºæ•°ç»„
      this.operationTaskList.productOutputList.push(this.form); // å‘数组中添加元素
      console.log("this.operationTaskList", this.operationTaskList);
      this.loading = true;
      this.$u.api.workReporting
        .submitPDA(this.operationTaskList)
        .then((res) => {
          this.$emit("update",this.operationTaskList);
          this.$refs.uModal.cancel();
        })
        .finally(() => {
          this.loading = false;
                // if (!this.form.waste) {
                //   this.$u.toast("请输入废料");
                //   this.$refs.uModal.clearLoading(); // æ¸…除加载状态
                //   return;
                // }
                // if (this.form.productInputList.length == 0) {
                //   this.$u.toast("投料批次不能为空,请扫码投料");
                //   this.$refs.uModal.clearLoading(); // æ¸…除加载状态
                //   return;
                // }
                // this.operationTaskList.operationTaskId = this.operationTaskList.id;
                // this.form.operationTaskId = this.operationTaskList.id;
                // this.form.status = this.operationTaskList.status;
                // this.form.Persons = this.operationTaskList.Persons;
                // this.form.productStaffIds = this.operationTaskList.productStaffIds;
                // this.form.productStaffs = this.operationTaskList.productStaffs;
                // this.form.dutyRecordId = this.dutyId;
                // this.operationTaskList.productOutputList = []; // åˆ›å»ºä¸€ä¸ªç©ºæ•°ç»„
                // this.operationTaskList.productOutputList.push(this.form); // å‘数组中添加元素
                // console.log("this.operationTaskList", this.operationTaskList);
                // this.loading = true;
                // this.$u.api.workReporting
                //   .submitPDA(this.operationTaskList)
                //   .then((res) => {
                //     this.$emit("update",this.operationTaskList);
                //     this.$refs.uModal.cancel();
                //   })
                //   .finally(() => {
                //     this.loading = false;
                //     this.$refs.uModal.clearLoading();
                //   });
                this.$emit("update", this.form);
          this.$refs.uModal.clearLoading();
        });
                this.$refs.uModal.cancel();
    },
    cancel() {
      this.show = false;
@@ -406,5 +368,6 @@
::v-deep .u-input__input {
  text-align: right !important;
}
@import "../index.scss";
</style>
pages/product/report/index.vue
@@ -23,40 +23,48 @@
            <u-form-item label="零件描述" :border-bottom="false" prop="partName" style="font-size:small">
                <u-input v-model="form.partName" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="批量大小" :border-bottom="false" prop="qtyRequired" style="font-size:small">
            <!-- <u-form-item label="批量大小" :border-bottom="false" prop="qtyRequired" style="font-size:small">
                <u-input v-model="form.qtyRequired" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="剩余数量" :border-bottom="false" prop="Jianqtyfinished" style="font-size:small">
                <u-input v-model="form.Jianqtyfinished" placeholder="" disabled />
            </u-form-item> -->
            <u-form-item label="投料产量" :border-bottom="false" prop="FeedInputProductionVolume" style="font-size:small">
                <u-input v-model="form.FeedInputProductionVolume" type="select" placeholder="请填写投料产量"
                    @click="FeedInputProductionVolumeCLick" />
            </u-form-item>
            <u-form-item label="汇报产量" :border-bottom="false" prop="reportProductionVolume" style="font-size:small">
                <u-input v-model="form.reportProductionVolume" type="select" placeholder="请填写汇报产量"
                    @click="reportProductionVolumeCLick" />
            </u-form-item>
            <u-form-item label="库位" :border-bottom="false" prop="proposedLocation" style="font-size:small">
                <u-input v-model="form.proposedLocation" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="报工类型" label-width="90px" prop="productType" style="font-size:small">
            <!-- <u-form-item label="报工类型" label-width="90px" prop="productType" style="font-size:small">
                <u-radio-group v-model="form.productType" :disabled="subdisabled">
                    <u-radio name="dep"><span style="font-size:small">下机报工</span></u-radio>
                    <u-radio name="ndep"><span style="font-size:small">未下机报工</span></u-radio>
                </u-radio-group>
            </u-form-item>
            <u-form-item label="接收零件" label-width="90px" prop="receive" style="font-size:small">
            </u-form-item> -->
            <!-- <u-form-item label="接收零件" label-width="90px" prop="receive" style="font-size:small">
                <u-radio-group v-model="form.receive" :disabled="subdisabled">
                    <u-radio name="mo"><span style="font-size:small">车间订单</span></u-radio>
                    <u-radio name="part"><span style="font-size:small">替代零件</span></u-radio>
                </u-radio-group>
            </u-form-item>
            </u-form-item> -->
            <u-form-item label="物料" label-width="90px" prop="materialCost" style="font-size:small">
                <u-radio-group v-model="form.materialCost" :disabled="true">
                    <u-radio name="倒冲"><span style="font-size:small">倒冲</span></u-radio>
                    <u-radio name="投料"><span style="font-size:small">投料</span></u-radio>
                </u-radio-group>
            </u-form-item>
            <u-form-item label="简化物料检查" label-width="90px" prop="simplifyMaterials" style="font-size:small">
            <!-- <u-form-item label="简化物料检查" label-width="90px" prop="simplifyMaterials" style="font-size:small">
                <u-radio-group v-model="form.simplifyMaterials" :disabled="subdisabled || simplifyDisabled"
                    @change="radioChange">
                    <u-radio name="true"><span style="font-size:small">是</span></u-radio>
                    <u-radio name="false"><span style="font-size:small">否</span></u-radio>
                </u-radio-group>
            </u-form-item>
            </u-form-item> -->
            <u-form-item label="报工方式" label-width="90px" prop="status" style="font-size:small">
                <u-radio-group v-model="form.status" :disabled="subdisabled" @change="handleReportTypeChange">
                    <u-radio name="false"><span style="font-size:small">按班组报工</span></u-radio>
@@ -210,8 +218,10 @@
                    moOn: "",
                    partNo: "",
                    partName: "",
                    qtyRequired: "",
                    Jianqtyfinished: "",
                    // qtyRequired: "",
                    // Jianqtyfinished: "",
                    FeedInputProductionVolume: null, //投料产量
                    reportProductionVolume: null, //汇报产量
                    proposedLocation: "",
                    productType: "dep",
                    receive: "mo",
@@ -222,7 +232,10 @@
                    Persons: '',
                    productStaffIds: [],
                    productStaffs: []
                },
                reportProductionVolumelist: {},
                FeedInputProductionVolumeList: {}, //投料产量
                personList: [],
                canSelectPerson: false,
                rules: {
@@ -266,6 +279,17 @@
                        message: "请选择人员",
                        trigger: ["change"],
                    }, ],
                    reportProductionVolume: [{
                        required: true,
                        message: "请输入汇报产量",
                        trigger: ["change"],
                    }, ],
                    // FeedInputProductionVolume: [{
                    //     required: true,
                    //     message: "请输入投料产量",
                    //     trigger: ["change"],
                    // }, ],
                },
                showSave: false,
                operationTaskId: "",
@@ -286,15 +310,30 @@
                        mask: true,
                        title: "加载中",
                    });
                    // å¤„理提交逻辑
                    this.form.operationTaskId = this.form.id;
                    this.reportProductionVolumelist.operationTaskId = this.form.id;
                    this.reportProductionVolumelist.status = this.form.status;
                    this.reportProductionVolumelist.Persons = this.form.Persons;
                    this.reportProductionVolumelist.productStaffIds = this.form.productStaffIds;
                    this.reportProductionVolumelist.productStaffs = this.form.productStaffs;
                    this.reportProductionVolumelist.productInputList = Object.keys(this.FeedInputProductionVolumeList).length === 0 ? null : this.FeedInputProductionVolumeList;
                    this.reportProductionVolumelist.dutyRecordId = this.dutyId;
                    this.form.productOutputList = []; // åˆ›å»ºä¸€ä¸ªç©ºæ•°ç»„
                    this.form.productOutputList.push(this.reportProductionVolumelist); // å‘数组中添加元素
                    console.log("this.form", this.form);
                    this.$u.api.workReporting
                        .operationTask({
                            id: this.form.id,
                        })
                        .submitPDA(this.form)
                        .then((res) => {
                            res.data.name = this.form.name;
                            this.$refs.saveForm.open(res);
                            uni.hideLoading();
                            this.subdisabled = true;
                            this.$u.toast("提交成功");
                            this.InventoryReceiptList.unshift(this.form.productOutputList[0]);
                            this.reportProductionVolumelist = {},
                            this.FeedInputProductionVolumeList = {}, //投料产量
                            this.form.FeedInputProductionVolume = null, //投料产量
                            this.form.reportProductionVolume = null, //汇报产量
                            console.log("this.InventoryReceiptList", this.InventoryReceiptList);
                        })
                        .finally(() => {
                        });
                } else {
                    // å¯ä»¥èŽ·å–å…·ä½“çš„é”™è¯¯ä¿¡æ¯
@@ -322,10 +361,10 @@
                        // æ‰«ææŠ¥å·¥å•二维码
                        that.CopperReportingWork(codeInfo);
                    }
                    if (codeInfo.BN) {
                        // æ‰«ææŠ¥å·¥å•二维码
                        that.$refs.saveForm.saveForm(codeInfo);
                    }
                    // if (codeInfo.BN) {
                    //     // æ‰«ææŠ¥å·¥å•二维码
                    //     that.$refs.saveForm.saveForm(codeInfo);
                    // }
                }
            });
        },
@@ -341,6 +380,47 @@
            }
        },
        methods: {
            // æŠ•料产量
            FeedInputProductionVolumeCLick() {
                if (this.form.taskNo === "") {
                    uni.showToast({
                        title: "请先扫码",
                        icon: "none",
                    });
                    return;
                }
                if (this.simplifyDisabled) {
                    uni.showToast({
                        title: "倒冲无需投料",
                        icon: "none",
                    });
                    return;
                }
                uni.navigateTo({
                    url: "/pages/product/report/seachPersonnelNo?moOn=" + this.form.moOn,
                });
            },
            // æ±‡æŠ¥äº§é‡
            reportProductionVolumeCLick() {
                if (this.form.taskNo === "") {
                    uni.showToast({
                        title: "请先扫码",
                        icon: "none",
                    });
                    return;
                }
                // å¤„理提交逻辑
                this.$u.api.workReporting
                    .operationTask({
                        id: this.form.id,
                    })
                    .then((res) => {
                        res.data.name = this.form.name;
                        this.$refs.saveForm.open(res);
                        uni.hideLoading();
                    });
            },
            // å¤„理报工方式变更
            handleReportTypeChange() {
                // åˆ‡æ¢æŠ¥å·¥æ–¹å¼æ—¶æ¸…空人员名称
@@ -460,7 +540,7 @@
            },
            confirmModle() {
                console.log("点击确认后获取取消报工记录");
                console.log("点击确认后获取取消报工记录",this.detailedList);
                // å¤„理确认逻辑
                this.$u.api.cancelReporting
                    .cancelDTAOfWorkApplication({
@@ -469,7 +549,7 @@
                    })
                    .then((res) => {
                        console.log("res", res);
                        this.detailedList.splice(this.index, 1)
                        this.InventoryReceiptList.splice(this.index, 1)
                        this.showModal = false;
                        // this.getHandelList();
                        this.$u.toast("取消报工成功");
@@ -516,9 +596,11 @@
            // }
            // },
            handleUpdate(val) {
                this.subdisabled = true;
                this.reportProductionVolumelist = val
                this.form.reportProductionVolume = val.outBatchNo;
                // this.subdisabled = true;
                // this.getHandelList();
                this.InventoryReceiptList.unshift(val);
                // this.InventoryReceiptList.unshift(val);
            },
            // æ‰“开弹框--后面还需要监听扫码枪扫码结果,赋值给报工单号字段,然后打开弹框选择订单号等操作
            open() {
@@ -543,6 +625,14 @@
            setNo(val) {
                this.form.moOn = val.moNo;
            },
            setFeedInputProductionVolume(val) {
                console.log('val', val)
                this.FeedInputProductionVolumeList = val;
                const values = this.FeedInputProductionVolumeList.map((item) => item.ifsBatchNo)
                console.log('values', values)
                  this.form.FeedInputProductionVolume = values.join(';')
            },
            // å›žæ˜¾æ‰«ç çš„信息-报工单
            saveForm(val) {
                this.form = {
@@ -554,8 +644,8 @@
                    moOn: val.moOn,
                    partNo: val.partNo,
                    partName: val.partName,
                    qtyRequired: val.qtyRequired,
                    Jianqtyfinished: val.qtyRequired - val.qtyFinished,
                    // qtyRequired: val.qtyRequired,
                    // Jianqtyfinished: val.qtyRequired - val.qtyFinished,
                    proposedLocation: val.proposedLocation,
                    productType: "dep",
                    receive: "mo",
pages/product/report/seachPersonnelNo.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,552 @@
<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.lotBatchNo"
                    @click="selectRecommendation(item)">
                    <view class="recommendation-line">
                        <text class="recommendation-label">批号:</text>
                        <text class="recommendation-value">{{ item.lotBatchNo }}</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: "",
            };
        },
        onLoad() {
            // this.getlist();
        },
        onShow() {
            let that = this;
            uni.$off("scan"); // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
            uni.$on("scan", function(data) {
                //扫码成功后的回调,你可以写自己的逻辑代码在这里
                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;
    },
    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.ifsBatchNo = item.lotBatchNo;
                // this.showModal = true;
            },
            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
                        .fuzzyQuery({
                            lotBatchNo: value,
                        })
                        .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>