guoyuji
2024-07-04 1c13bd7a2cd2c8ba69a185da69344c8b59f4e561
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -127,7 +127,7 @@
    titleSelectJson.value.processType = res.data.process
    gridOptions.loading = false
    //禁用删除、保存按钮
    //禁用删除、审核按钮
    gridOptions.toolbarConfig.buttons[0].disabled = true
    gridOptions.toolbarConfig.buttons[1].disabled = true
  } else {
@@ -155,7 +155,6 @@
      total.pageTotal = res.data.total.pageTotal
      pageTotal.value = res.data.total
      xGrid.value.loadData(res.data.data)
      console.log(res.data.data)
      gridOptions.loading = false
      if (selectState==1){
        //禁用删除、审核按钮
@@ -164,11 +163,11 @@
        //启用保存
        gridOptions.toolbarConfig.buttons[2].disabled = false
      }else{
        //禁用删除、审核按钮
        //启用删除、审核按钮
        gridOptions.toolbarConfig.buttons[0].disabled = false
        gridOptions.toolbarConfig.buttons[1].disabled = false
        //启用保存
        gridOptions.toolbarConfig.buttons[2].disabled = false
        //禁用保存
        gridOptions.toolbarConfig.buttons[2].disabled = true
      }
    } else {
@@ -420,7 +419,7 @@
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            if (selectRecords.length == 0) {
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              ElMessage.warning("请勾选排产数据")
              return;
            }
            for (let i = 0; i < selectRecords.length; i++) {
@@ -429,13 +428,13 @@
              let number = selectRecords[i].schedulingQuantity
              //计划开始、结束时间,排产数量不能为空
              if (start == null || end == null || number == null) {
                ElMessage.warning(t('processCard.saveCorrespondingValues'))
                ElMessage.warning("请填入对应的值再进行保存")
                return;
              }
            }
            let selectProcesses = processVal.value
            if (selectProcesses == null || selectProcesses == "") {
              ElMessage.warning(t('processCard.selectProductionSchedulingProcess'))
              ElMessage.warning("请选择排产工序")
              return;
            }
@@ -449,7 +448,7 @@
            //保存排产数据
            request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success(t('basicData.msg.saveSuccess'))
                ElMessage.success("保存成功")
                // 启用保存
                gridOptions.toolbarConfig.buttons[2].disabled = false
                router.push({
@@ -474,10 +473,10 @@
          const selectRecords = $table.getCheckboxRecords()
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              ElMessage.warning("请勾选排产数据")
              return;
            }
            const type = await VXETable.modal.confirm(t('processCard.deleteThisData'))
            const type = await VXETable.modal.confirm('您确定要删除该数据?')
            if (type === 'confirm') {
              let schedulingData = ref({
                scheduling: selectRecords,
@@ -485,7 +484,7 @@
              request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => {
                if (res.code == 200) {
                  ElMessage.success(t('basicData.msg.deleteSuccess'))
                  ElMessage.success("删除成功")
                  location.reload();
                } else {
                  ElMessage.warning(res.msg)
@@ -501,7 +500,7 @@
          const selectRecords = $table.getCheckboxRecords()
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              ElMessage.warning("请勾选排产数据")
              return;
            }
            let schedulingData = ref({
@@ -510,7 +509,7 @@
            })
            request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success(t('basicData.msg.ReviewSuccess'))
                ElMessage.success("审核成功")
                location.reload();
              } else {
                ElMessage.warning(res.msg)
@@ -585,7 +584,7 @@
  let selectState = stateValue.value
  table.forEach((selectRecords) => {
    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState == 1) {
      ElMessage.warning(t('processCard.schedulingQuantityNoQuantityScheduled'))
      ElMessage.warning("排产数量不能大于待排产数量")
      //禁用保存按钮
      //gridOptions.toolbarConfig.buttons[2].disabled = true
    }
@@ -604,9 +603,9 @@
        <el-date-picker
            v-model="form.date1"
            :default-time="defaultTime"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            end-placeholder="结束时间"
            format="YYYY/MM/DD"
            start-placeholder="开始时间"
            type="daterange"
            value-format="YYYY-MM-DD"
@@ -623,7 +622,7 @@
          />
        </el-select>
        &nbsp;
        <el-select v-model="stateValue" class="m-2" :placeholder="$t('processCard.whetherToScheduleProduction')" style="width: 120px">
        <el-select v-model="stateValue" class="m-2" placeholder="是否排产" style="width: 120px">
          <el-option
              v-for="item in stateOptions"
              :key="item.value"