yyb
5 天以前 e9ebe0b65f45b5ecb5729f22bc7e54ce479314d7
pages/product/cancelReport/index.vue
@@ -50,8 +50,7 @@
            <view class="content-body">
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">订单号:</view>
                  <view class="_label-name">批号:</view>
                </view>
                <view class="_content">
                  {{ item.moNo }}
@@ -59,7 +58,6 @@
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">零件号:</view>
                </view>
                <view class="_content">
@@ -68,7 +66,6 @@
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3"> </view>
                  <view class="_label-name">零件描述:</view>
                </view>
                <view class="_content">
@@ -77,29 +74,10 @@
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">批量大小:</view>
                  <view class="_label-name">取消接收数量:</view>
                </view>
                <view class="_content">
                  {{ item.qtyRequired }}
                </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.startDate }}
                </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.endDate }}
                </view>
              </view>
            </view>
@@ -107,6 +85,58 @@
        </u-cell-group>
      </scroll-view>
    </view>
    <u-modal
      width="720rpx"
      v-model="showModal"
      title=""
      :show-cancel-button="true"
      :show-confirm-button="true"
      @confirm="confirm"
      @cancel="cancel"
    >
      <view class="popup-content">
        <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">{{ detailedList.moNo }}</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">{{ detailedList.partNo }}</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">
                <span class="item-one">{{
                  detailedList.partName
                }}</span>
              </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">
                <span class="item-one">{{
                  detailedList.netWeight
                }}</span>
              </view>
            </view>
          </view>
        </view>
      </view>
    </u-modal>
    <scan></scan>
  </view>
</template>
@@ -130,21 +160,13 @@
      form: {
        moNo: "",
      },
      list: [
        {
          moNo: 1,
          partNo: 1,
          partName: 1,
          qtyRequired: 1,
          startDate: 1,
          endDate: 1,
        },
      ],
      detailedList: {},
      list: [],
      rules: {},
      showModal: false,
    };
  },
  onReady() {
  },
  onReady() {},
  onShow() {
    let that = this;
    uni.$off("scan"); // 每次进来先 移除全局自定义事件监听器
@@ -152,32 +174,31 @@
      console.log("onscan");
      //扫码成功后的回调,你可以写自己的逻辑代码在这里
      console.log("页面扫码结果:", data.code);
      if ((list.moNO = null)) {
        uni.showToast({
               icon: 'none',
               title: '请先选择订单号!',
               duration: 2 * 1000
        })
        return
      }
      if ((list.moNO = null)) {
        uni.showToast({
               icon: 'none',
               title: '扫描的二维码与该订单不一致',
               duration: 2 * 1000
        })
        return
      }
      if (data.code) {
        let codeInfo = JSON.parse(data.code);
        if (codeInfo.WorkNo) {
          console.log('222')
        if (codeInfo.moNo) {
          console.log('1111')
          // 扫描报工单二维码
          that.saveForm(codeInfo);
      // that.$forceUpdate();
        }
      }
    });
  },
  methods: {
    // 点击确认后获取取消报工记录
    confirm() {
      // 处理确认逻辑
      this.$u.api.cancelReporting.cancelDTAOfWorkApplication({outBatchNo:this.detailedList.outBatchNo}).then((res) => {
        console.log("res", res);
        this.list = res.data.records;
        this.showModal = false;
      });
    },
    cancel() {
      this.showModal = false; // 关闭弹窗
    },
    openList() {
      uni.navigateTo({
        url: "/pages/product/report/orderList",
@@ -188,16 +209,111 @@
    },
    // 回显扫码的信息-报工单
    saveForm(val) {
      let { WorkNo, ProcessName, ORDER_NO } = val;
      this.form.value1 = WorkNo;
      this.form.value2 = ProcessName;
      this.form.value3 = ORDER_NO;
      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;
    },
  },
};
</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;
}