廖井涛
2025-03-21 b8982b86a15d186c4cf6144fface700d9769fa95
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -98,7 +98,7 @@
      .toISOString()
      .replace('T', ' ')
      .slice(0, 10) //默认开始时间3天前
  const end = new Date(new Date().getTime() + 3600 * 1000 * 24)
  const end = new Date(new Date().getTime())
      .toISOString()
      .replace('T', ' ')
      .slice(0, 10)//默认结束时间当前时间
@@ -431,7 +431,7 @@
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            if (selectRecords.length == 0) {
              ElMessage.warning("请勾选排产数据")
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              return;
            }
            for (let i = 0; i < selectRecords.length; i++) {
@@ -440,13 +440,13 @@
              let number = selectRecords[i].schedulingQuantity
              //计划开始、结束时间,排产数量不能为空
              if (start == null || end == null || number == null) {
                ElMessage.warning("请填入对应的值再进行保存")
                ElMessage.warning(t('processCard.saveCorrespondingValues'))
                return;
              }
            }
            let selectProcesses = processVal.value
            if (selectProcesses == null || selectProcesses == "") {
              ElMessage.warning("请选择排产工序")
              ElMessage.warning(t('processCard.selectProductionSchedulingProcess'))
              return;
            }
@@ -460,7 +460,7 @@
            //保存排产数据
            request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("保存成功")
                ElMessage.success(t('basicData.msg.saveSuccess'))
                // 启用保存
                gridOptions.toolbarConfig.buttons[2].disabled = false
                router.push({
@@ -485,11 +485,11 @@
          const selectRecords = $table.getCheckboxRecords()
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning("请勾选排产数据")
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              return;
            }
            const type = await VXETable.modal.confirm('您确定要删除该数据?')
            const type = await VXETable.modal.confirm(t('processCard.deleteThisData'))
            if (type === 'confirm') {
              let schedulingData = ref({
                scheduling: selectRecords,
@@ -497,7 +497,7 @@
              request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => {
                if (res.code == 200) {
                  ElMessage.success("删除成功")
                  ElMessage.success(t('basicData.msg.deleteSuccess'))
                  location.reload();
                } else {
                  ElMessage.warning(res.msg)
@@ -517,7 +517,7 @@
          let inputVal = form.orderId
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning("请勾选排产数据")
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              return;
            }
            let schedulingData = ref({
@@ -526,7 +526,7 @@
            })
            request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("审核成功")
                ElMessage.success(t('basicData.msg.ReviewSuccess'))
                router.push({
                  path: '/main/processCard/ProductionScheduling',
                  query: {random: Math.random()}
@@ -545,7 +545,7 @@
          const selectRecords = $table.getCheckboxRecords()
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning("请勾选排产数据")
              ElMessage.warning(t('processCard.checkProductionScheduling'))
              return;
            }
            let schedulingData = ref({
@@ -554,7 +554,7 @@
            })
            request.post("/productionScheduling/cancelReviewScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("反审成功")
                ElMessage.success(t('basicData.msg.cancelReviewSuccess'))
                location.reload();
              } else {
                ElMessage.warning(res.msg)
@@ -629,7 +629,7 @@
  let selectState = stateValue.value
  selectRecords.forEach((selectRecords) => {
    if (selectRecords.schedulingQuantity > selectRecords.pendingProductionQuantity) {
      ElMessage.warning("排产数量不能大于待排产数量")
      ElMessage.warning(ElMessage.warning(t('processCard.schedulingQuantityNoQuantityScheduled')))
      //禁用保存按钮
      //gridOptions.toolbarConfig.buttons[2].disabled = true
    }
@@ -651,15 +651,14 @@
</script>
<template>
  <div class="main-div-customer">
    <div id="selectForm">
      <el-row :gutter="0">
  <div  style="width: 100%;height: 100%">
    <div class="head">
        <el-date-picker
            v-model="orderInfo.workOrderDate"
            :default-time="defaultTime"
            end-placeholder="结束时间"
            :start-placeholder="$t('basicData.startDate')"
            :end-placeholder="$t('basicData.endDate')"
            format="YYYY/MM/DD"
            start-placeholder="开始时间"
            type="daterange"
            value-format="YYYY-MM-DD"
@@ -676,7 +675,7 @@
          />
        </el-select>
        &nbsp;
        <el-select v-model="stateValue" class="m-2" placeholder="是否排产" style="width: 120px">
        <el-select v-model="stateValue" class="m-2" :placeholder="$t('processCard.whetherToScheduleProduction')" style="width: 120px">
          <el-option
              v-for="item in stateOptions"
              :key="item.value"
@@ -690,67 +689,69 @@
            :icon="Search"
            type="primary" @click="getWorkOrder">{{ $t('basicData.search') }}
        </el-button>
      </el-row>
    </div>
    <vxe-grid
        ref="xGrid"
        class="mytable-scrollbar"
        height="95%"
        v-bind="gridOptions"
        v-on="gridEvents"
        @filter-change="filterChanged"
    <div class="main-table">
      <vxe-grid
          ref="xGrid"
          class="mytable-scrollbar"
          height="100%"
          v-bind="gridOptions"
          v-on="gridEvents"
          @filter-change="filterChanged"
    >
      <!--      :checkbox-config="checkBoxConfig"  @checkbox-change="determineNum"-->
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
            <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
            <span v-else>{{ row[item.field] }}</span>
      >
        <!--      :checkbox-config="checkBoxConfig"  @checkbox-change="determineNum"-->
        <!--      下拉显示所有信息插槽-->
        <template #content="{ row }">
          <ul class="expand-wrapper">
            <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
              <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
              <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
              <span v-else>{{ row[item.field] }}</span>
          </li>
        </ul>
      </template>
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/>
            </li>
          </ul>
        </template>
        <template #num1_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <input v-model="option.data" type="type"
                     @keyup.enter.native="$panel.confirmFilter()"
                     @input="changeFilterEvent($event, option, $panel)"/>
            </div>
          </div>
        </div>
      </template>
      <template #pager>
        <!--使用 pager 插槽-->
        <!--        'PrevJump','NextJump', -->
        <vxe-pager
            v-model:current-page="pageNum"
            v-model:page-size="total.pageSize"
            v-model:pager-count="total.pageTotal"
            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
            :total="total.dataTotal"
            @page-change="handlePageChange"
        >
        </vxe-pager>
      </template>
        </template>
        <template #pager>
          <!--使用 pager 插槽-->
          <!--        'PrevJump','NextJump', -->
          <vxe-pager
              v-model:current-page="pageNum"
              v-model:page-size="total.pageSize"
              v-model:pager-count="total.pageTotal"
              :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
              :total="total.dataTotal"
              @page-change="handlePageChange"
          >
          </vxe-pager>
        </template>
    </vxe-grid>
      </vxe-grid>
    </div>
  </div>
</template>
<style scoped>
.main-div-customer {
  width: 99%;
  height: 100%;
.head{
  width: 100%;
  height: 35px;
}
#selectForm {
  width: 70%;
  height: 6%;
  text-align: center;
.main-table{
  width: 100%;
  height: calc(100% - 35px);
}
.vxe-grid {