春风项目四线(合箱线、总装线)
wujian
2024-09-04 e4a393c219c3c48cbf0e4af615b316facb82eb62
jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -109,7 +109,7 @@
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          :disabled="create"
          @click="CreatehandleUpdate"
        >生成</el-button>
      </el-col>
@@ -360,6 +360,7 @@
      ids: [],
      // 非单个禁用
      single: true,
      create: false,
      // 非多个禁用
      multiple: true,
      move: true,
@@ -676,6 +677,14 @@
      console.log('this.single1111',this.single)
      console.log('selecion',selection)
      this.ids = selection.map(item => item.id)
      const statusList = selection.map(item => item.orderStatus)
      console.log('statusList',statusList)
      console.log('statusList.filter( x => x !== "1").length',statusList.filter( x => x !== "1").length)
      if (statusList.filter( x => x !== "1").length >0){
        this.create = true
      } else {
        this.create = false
      }
      if (selection.length >1){
        this.single = false
        this.multiple = true
@@ -721,24 +730,30 @@
      this.titleName = "添加生产订单";
    },
    /** 同步按钮操作 */
    CreatehandleUpdate(Row) {
      this.initWorkshop();
      this.reset();
      const id = Row.id || this.ids
      getProductionOrdes(id).then(response => {
        console.log(response.data)
        console.log(response.data.productCode)
        this.materialQueryParams.materialCode = response.data.productCode;
        listMaterial(this.materialQueryParams).then(response => {
          this.markNo = response.rows[0].mark
          this.form.typeL = response.rows[0].typeL;
    CreatehandleUpdate() {
      console.log('this.ids',this.ids)
      if (this.ids.length === 0){
        this.$message.error('请勾选数据');
      }else {
        this.initWorkshop();
        this.reset();
        const id = this.ids
        getProductionOrdes(id).then(response => {
          console.log(response.data)
          console.log(response.data.productCode)
          this.materialQueryParams.materialCode = response.data.productCode;
          listMaterial(this.materialQueryParams).then(response => {
            this.markNo = response.rows[0].mark
            this.form.typeL = response.rows[0].typeL;
          });
          this.form = response.data;
          this.form.idNums=id;
          this.Createopen = true;
          this.titleName = "生成箱体条码";
          // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
        });
        this.form = response.data;
        this.form.idNums=id;
        this.Createopen = true;
        this.titleName = "生成箱体条码";
        // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
      });
      }
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
@@ -832,10 +847,15 @@
      }, `productionOrde_${new Date().getTime()}.xlsx`)
    },
    goToPage() {
      this.showDetailFlag=true
      console.log('this.showDetailFlag',this.showDetailFlag)
      //更新实际生产日期
      //updateOrderInfo(this.singleSelect)
      if (this.ids.length === 0){
        this.$message.error('请勾选数据');
      }else {
        this.showDetailFlag=true
        console.log('this.showDetailFlag',this.showDetailFlag)
        //更新实际生产日期
        //updateOrderInfo(this.singleSelect)
      }
    },
  }
};