yyb
18 小时以前 e9ebe0b65f45b5ecb5729f22bc7e54ce479314d7
报工以及取消报工联调
已修改4个文件
202 ■■■■■ 文件已修改
common/http.api.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/cancelReport/index.vue 161 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/components/saveForm.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/http.api.js
@@ -499,7 +499,11 @@
            operationTask: (params = {}) => vm.$u.get('/mes/operationTask/'+ params.id),
            // 提交
            submitPDA: (params = {}) => vm.$u.post('/mes/product/submitPDA', params),
        },
        // 报工
        cancelReporting: {
            // 取消报工确认
            cancelDTAOfWorkApplication: (params = {}) => vm.$u.get('mes/product/cancelDTAOfWorkApplication', params),
            
        }
    };
pages/product/cancelReport/index.vue
@@ -86,6 +86,7 @@
      </scroll-view>
    </view>
    <u-modal
      width="720rpx"
      v-model="showModal"
      title=""
      :show-cancel-button="true"
@@ -101,7 +102,7 @@
                <text class="item-one">批号</text>
              </view>
              <view class="packing-registration-param-item-right">
                <text class="item-one item-two">{{ detailedList.moNo }}</text>
                <text class="item-one">{{ detailedList.moNo }}</text>
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -109,7 +110,7 @@
                <text class="item-one">零件号</text>
              </view>
              <view class="packing-registration-param-item-right">
                <text class="item-one item-two">{{ detailedList.partNo }}</text>
                <text class="item-one">{{ detailedList.partNo }}</text>
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -117,9 +118,9 @@
                <text class="item-one">零件描述</text>
              </view>
              <view class="packing-registration-param-item-right">
                <text class="item-one item-two">{{
                <span class="item-one">{{
                  detailedList.partName
                }}</text>
                }}</span>
              </view>
            </view>
            <view class="packing-registration-param-item param-extra">
@@ -127,10 +128,9 @@
                <text class="item-one">取消接收数量</text>
              </view>
              <view class="packing-registration-param-item-right">
                <u-input
                  class="item-one item-two"
                  v-model="detailedList.qtyRequired"
                />
                <span class="item-one">{{
                  detailedList.netWeight
                }}</span>
              </view>
            </view>
          </view>
@@ -160,22 +160,8 @@
      form: {
        moNo: "",
      },
      detailedList: {
        moNo: "",
        partNo: "",
        partName: "",
        qtyRequired: "",
      },
      list: [
        {
          moNo: 1,
          partNo: 1,
          partName: 1,
          qtyRequired: 1,
          startDate: 1,
          endDate: 1,
        },
      ],
      detailedList: {},
      list: [],
      rules: {},
      showModal: false,
    };
@@ -184,31 +170,18 @@
  onShow() {
    let that = this;
    uni.$off("scan"); // 每次进来先 移除全局自定义事件监听器
    if ((that.form.moNO == null)) {
      uni.showToast({
        icon: "none",
        title: "请先选择订单号!",
        duration: 2 * 1000,
      });
      return;
    }
    uni.$on("scan", function (data) {
      console.log("onscan");
      //扫码成功后的回调,你可以写自己的逻辑代码在这里
      console.log("页面扫码结果:", data.code);
      if (data.code) {
        let codeInfo = JSON.parse(data.code);
        if (codeInfo.moNO) {
        if ((that.form.moNO != codeInfo.moNO)) {
          uni.showToast({
            icon: "none",
            title: "扫描的二维码与该订单不一致",
            duration: 2 * 1000,
          });
          return;
        }
          console.log('222')
        if (codeInfo.moNo) {
          console.log('1111')
            // 扫描报工单二维码
            that.saveForm(codeInfo);
        // that.$forceUpdate();
        }
      }
    });
@@ -217,10 +190,10 @@
    // 点击确认后获取取消报工记录
    confirm() {
      // 处理确认逻辑
      this.showModal = false;
      this.$u.api.workReporting._({}).then((res) => {
      this.$u.api.cancelReporting.cancelDTAOfWorkApplication({outBatchNo:this.detailedList.outBatchNo}).then((res) => {
        console.log("res", res);
        this.list = res.data.records;
        this.showModal = false;
      });
    },
    cancel() {
@@ -236,10 +209,24 @@
    },
    // 回显扫码的信息-报工单
    saveForm(val) {
      let { moNo, partNo, partName } = val;
      this.detailedList.moNo = moNo;
      this.detailedList.partNo = partNo;
      this.detailedList.partName = partName;
      console.log('1111@@@@@@1',this.form)
      if (this.form.moNo == '') {
        uni.showToast({
          icon: "none",
          title: "请先选择订单号!",
          duration: 2 * 1000,
        });
        return;
      }
      if (this.form.moNo != val.moNo) {
        uni.showToast({
          icon: "none",
          title: "扫描的二维码与该订单不一致",
          duration: 2 * 1000,
        });
        return;
      }
      this.detailedList = val;
      this.showModal = true;
    },
  },
@@ -247,6 +234,86 @@
</script>
<style lang="scss" scoped>
.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: 30rpx;
          color: #666666;
        }
      }
      .packing-registration-param-item-right {
        display: flex;
        justify-content: space-between;
        .item-one {
          font-size: 30rpx;
          color: #060505;
          margin-right: 6rpx;
          word-break: break-all;
        }
        .item-two {
          font-size: 15rpx;
          color: #a6b4cc;
          margin-right: 6rpx;
        }
        .item-three {
          font-size: 30rpx;
          color: #214ded;
          margin-right: 6rpx;
        }
      }
    }
    .param-extra {
      border-bottom: 1px solid #ededed;
    }
  }
}
    .popup-content {
        width: 720rpx;
        height: 400rpx;
        background-color: #fff;
        border-radius: 8px;
        z-index: 10;
        /* 确保内容在蒙版之上 */
    }
.page {
  box-sizing: border-box;
}
pages/product/report/components/saveForm.vue
@@ -41,6 +41,14 @@
          </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.reelWeight" />
            </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">
@@ -52,7 +60,7 @@
              <text class="item-one">净重</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.theoryWeight" />
              <u-input class="item-one item-two" v-model="form.netWeight" />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
@@ -60,7 +68,7 @@
              <text class="item-one">工序</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.name" />
              <u-input class="item-one item-two" v-model="form.name" disabled />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
pages/product/report/index.vue
@@ -43,8 +43,8 @@
      <u-form-item label="零件描述" :border-bottom="false" prop="partName">
        <u-input v-model="form.partName" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="批量大小" :border-bottom="false" prop="qtyrequired">
        <u-input v-model="form.qtyrequired" placeholder="" disabled />
      <u-form-item label="批量大小" :border-bottom="false" prop="qtyRequired">
        <u-input v-model="form.qtyRequired" placeholder="" disabled />
      </u-form-item>
      <u-form-item
        label="剩余数量"
@@ -68,8 +68,8 @@
          <u-radio name="part">替代零件</u-radio>
        </u-radio-group>
      </u-form-item>
      <u-form-item label="物料" prop="materialcost">
        <u-radio-group v-model="form.materialcost" :disabled="true">
      <u-form-item label="物料" prop="materialCost">
        <u-radio-group v-model="form.materialCost" :disabled="true">
          <u-radio name="倒冲">倒冲</u-radio>
          <u-radio name="投料">投料</u-radio>
        </u-radio-group>
@@ -111,7 +111,7 @@
                  <view class="_label-name">批号:</view>
                </view>
                <view class="_content">
                  {{ item.productNo }}
                  {{ item.outBatchNo }}
                </view>
              </view>
              <view class="row-list">
@@ -187,12 +187,12 @@
        moOn: "",
        partNo: "",
        partName: "",
        qtyrequired: "",
        qtyRequired: "",
        Jianqtyfinished: "",
        proposedLocation: "",
        productType: "dep",
        receive: "mo",
        materialcost: "",
        materialCost: "",
        autoReport: false,
        simplifyMaterials: false,
      },
@@ -260,6 +260,7 @@
            id: this.form.id,
          })
          .then((res) => {
            res.data.name = this.form.name
            this.$refs.saveForm.open(res);
            uni.hideLoading();
          });
@@ -354,18 +355,18 @@
        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", // 复选框组的值
        materialcost: val.materialcost,
        materialCost: val.materialCost,
        autoReport: false,
        simplifyMaterials: false,
      };
      this.checkboxList[1].value = false;
      this.checkboxList[0].value = false;
      if (this.form.materialcost == "倒冲") {
      if (this.form.materialCost == "倒冲") {
        this.checkboxList[1].disabled = true;
      }
    },