yyb
16 小时以前 fcfa50cf224f515baffb647d75f53797575be8df
pages/product/report/index.vue
@@ -74,13 +74,13 @@
          <u-radio name="投料">投料</u-radio>
        </u-radio-group>
      </u-form-item>
      <u-form-item label="工序" prop="value11">
      <u-form-item label="工序" prop="value1">
        <u-checkbox-group>
          <u-checkbox
            :name="item.name"
            v-for="(item, index) in checkboxList"
            :key="index"
            v-model="item.value11"
            v-model="item.value1"
            @change="changeCheckbox"
            :disabled="subdisabled || item.disabled"
          >
@@ -119,7 +119,7 @@
                  <view class="_label-name">数量:</view>
                </view>
                <view class="_content">
                  {{ item.value1 }}
                  {{ item.netWeight }}
                </view>
              </view>
              <view class="row-list">
@@ -147,7 +147,7 @@
    </modalBg>
    <saveForm
      ref="saveForm"
      :operationTaskId="this.form"
      :operationTaskList="this.form"
      @update="handleUpdate"
    />
    <scan></scan>
@@ -180,6 +180,7 @@
      ],
      InventoryReceiptList: [],
      form: {
        workstationId: "",
        work: "",
        taskNo: "",
        name: "",
@@ -190,7 +191,7 @@
        Jianqtyfinished: "",
        proposedLocation: "",
        productType: "dep",
        receive: "mo", // 复选框组的值
        receive: "mo",
        materialcost: "",
        autoReport: false,
        simplifyMaterials: false,
@@ -247,27 +248,23 @@
  // 点击提交按钮的事件处理函数
  onNavigationBarButtonTap() {
    this.$refs.uForm.validate((valid) => {
      if (valid) {
      uni.showLoading({
      if (valid) {
        uni.showLoading({
          mask: true,
          title: "加载中",
        });
        console.log("验证通过");
        // 处理提交逻辑
        this.$u.api.workReporting
          .operationTask({
            id: this.form.id,
          })
          .then((res) => {
            console.log("res", res);
            this.$refs.saveForm.open(res);
            uni.hideLoading();
          });
      } else {
        console.log("验证失败");
        // 可以获取具体的错误信息
        const errors = this.$refs.uForm.getError();
        console.log("错误信息:", errors);
      }
    });
  },
@@ -276,12 +273,9 @@
  },
  onShow() {
    let that = this;
    console.log("1111111111111");
    uni.$off("scan"); // 每次进来先 移除全局自定义事件监听器
    uni.$on("scan", function (data) {
      console.log("onscan");
      //扫码成功后的回调,你可以写自己的逻辑代码在这里
      console.log("页面扫码结果:", data.code);
      if (data.code) {
        let codeInfo = JSON.parse(data.code);
        if (codeInfo.moOn) {
@@ -291,28 +285,21 @@
            .getProductMainV1({
              current: 1,
              size: -1,
              operationTaskId: codeInfo.id,
              id: codeInfo.id,
            })
            .then((res) => {
              console.log("res", res);
              let InventoryReceiptList = JSON.parse(res.data.records);
              that.saveInventory(InventoryReceiptList);
              that.InventoryReceiptList = res.data.productOutputList;
            });
          console.log("this.InventoryReceiptList", that.InventoryReceiptList);
        }
      }
    });
  },
  watch: {
    "form.taskNo": function (newVal, oldVal) {
      console.log("taskNo changed:", newVal, oldVal);
      this.subdisabled = false;
    },
  },
  methods: {
    saveInventory(val) {
      this.InventoryReceiptList = val;
    },
    // 多选处理
    changeCheckbox(val) {
      if (val.name === "工序的自动报告") {
@@ -330,9 +317,7 @@
      this.$refs.modalBg.open();
    },
    // 弹框保存
    confirm() {
      console.log("保存", this.form.taskNo);
    },
    confirm() {},
    // 选择订单号
    openList() {
      if (this.form.taskNo === "") {
@@ -352,9 +337,9 @@
    },
    // 回显扫码的信息-报工单
    saveForm(val) {
      console.log("回显的数据", val);
      this.form = {
        id: val.id,
        workstationId: val.workstationId,
        work: val.work,
        taskNo: val.taskNo,
        name: val.name,