yyb
16 小时以前 fcfa50cf224f515baffb647d75f53797575be8df
pda报工单元测试
已修改6个文件
60 ■■■■■ 文件已修改
common/http.api.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/WorkshopOrderCancellationIssued/index.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/cancelReport/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/components/saveForm.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/index.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/report/orderList.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/http.api.js
@@ -494,7 +494,7 @@
            // 获取车间订单列表
            getWorkshopOrder: (params = {}) => vm.$u.get('/mes/plan/manufacturingOrder/page', params),
            // 获取产出列表
            getProductMainV1: (params = {}) => vm.$u.get('/mes/operationTask/getxxMainList'+ params.id),
            getProductMainV1: (params = {}) => vm.$u.get('/mes/operationTask/getxxMainList/'+ params.id),
            // 报工提交获取详细信息
            operationTask: (params = {}) => vm.$u.get('/mes/operationTask/'+ params.id),
            // 提交
pages/product/WorkshopOrderCancellationIssued/index.vue
@@ -124,6 +124,7 @@
        },
        data() {
            return {
                showModal:false,
                background: {
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: "fixed",
@@ -174,6 +175,7 @@
                //扫码成功后的回调,你可以写自己的逻辑代码在这里
                console.log("扫码结果:", data.code);
                that.scanHandle(data.code);
                this.showModal = true;
                that.$forceUpdate();
            });
        },
@@ -203,6 +205,7 @@
                    url: "/pages/product/report/orderList",
                });
            },
        },
    };
</script>
pages/product/cancelReport/index.vue
@@ -182,7 +182,7 @@
  onShow() {
    let that = this;
    uni.$off("scan"); // 每次进来先 移除全局自定义事件监听器
    if ((form.moNO = null)) {
    if ((that.form.moNO = null)) {
      uni.showToast({
        icon: "none",
        title: "请先选择订单号!",
@@ -190,7 +190,7 @@
      });
      return;
    }
    if ((form.moNO = null)) {
    if ((that.form.moNO = null)) {
      uni.showToast({
        icon: "none",
        title: "扫描的二维码与该订单不一致",
pages/product/report/components/saveForm.vue
@@ -112,7 +112,7 @@
<script>
export default {
  props: {
    operationTaskId: {
    operationTaskList: {
      type: Object,
      required: true,
      default: () => ({}),
@@ -151,10 +151,14 @@
        this.$refs.uModal.clearLoading(); // 清除加载状态
        return;
      }
      this.operationTaskList.operationTaskId = this.operationTaskList.id
      this.form.operationTaskId = this.operationTaskList.id
      this.operationTaskList.productOutputList = []; // 创建一个空数组
      this.operationTaskList.productOutputList.push(this.form); // 向数组中添加元素
      console.log('this.operationTaskList',this.operationTaskList)
      this.$u.api.workReporting
        .submitPDA({ ...this.form, operationTaskId: this.operationTaskId.id })
        .submitPDA(this.operationTaskList)
        .then((res) => {
          console.log("res", res);
          this.$emit('update')
          this.$refs.uModal.cancel();
        });
@@ -164,9 +168,8 @@
      this.form = {};
    },
    open(val) {
      console.log('11daidecanshuskk',val)
      this.show = true;
       this.form = val;
       this.form = val.data;
    },
  },
};
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,
@@ -252,22 +253,18 @@
          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,
pages/product/report/orderList.vue
@@ -127,7 +127,6 @@
                        size: this.pageSize
                    })
                    .then((res) => {
                        console.log("res", res);
                        this.list = res.data.records;
                        this.total = res.data.total;
                        if (this.pageSize >= this.total) {
@@ -138,7 +137,6 @@
                    });
            },
            search(value) {
                console.log("111", value);
                if (value) {
                    this.list = [];
                    this.pageSize = 10;
@@ -149,7 +147,6 @@
                            moNo: value,
                        })
                        .then((res) => {
                            console.log("res", res);
                            this.list = res.data.records;
                            this.total = res.data.total;
                            if (this.pageSize >= this.total) {