chengxiangling
2025-05-16 c9120650b03c477c27ce5c9c492a416be21df1b0
src/views/demand/planManage/index.vue
@@ -39,7 +39,7 @@
          plain
          icon="Plus"
          @click="handleAdd"
          v-hasPermi="['aps:calendar:add']"
          v-hasPermi="['aps:management:add']"
          >新增</el-button
        >
      </el-col>
@@ -50,7 +50,7 @@
          icon="Edit"
          :disabled="single"
          @click="handleUpdate(null)"
          v-hasPermi="['aps:calendar:update']"
          v-hasPermi="['aps:management:edit']"
          >修改</el-button
        >
      </el-col>
@@ -61,7 +61,7 @@
          icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['aps:calendar:remove']"
          v-hasPermi="['aps:management:remove']"
          >删除</el-button
        >
      </el-col>
@@ -88,27 +88,26 @@
          type="primary"
          size="small"
          @click="handleUpdate(row)"
          v-hasPermi="['aps:calendar:update']"
          v-hasPermi="['aps:management:edit']"
          >修改</el-button
        >
        <el-button
          type="default"
          size="small"
          @click="handleSetCycle(row)"
          v-hasPermi="['aps:calendar:remove']"
          v-hasPermi="['aps:planCycle:edit']"
          >计划周期</el-button
        >
        <el-button
          type="success"
          size="small"
          v-hasPermi="['aps:calendar:remove']"
          >生成计划</el-button
        >
        <el-button
          type="danger"
          size="small"
          @click="handleDelete(row)"
          v-hasPermi="['aps:calendar:remove']"
          v-hasPermi="['aps:management:remove']"
          >删除</el-button
        >
      </template>
@@ -264,6 +263,7 @@
const router = useRouter();
const { aps_area } = proxy.useDict("aps_area");
const { aps_plan_rule } = proxy.useDict("aps_plan_rule");
const { aps_plan_type } = proxy.useDict("aps_plan_type");
const tableRef = ref();
const calendarList = ref([]);
const open = ref(false);
@@ -354,6 +354,15 @@
    field: "type",
    width: 200,
    align: "center",
    formatter: ({ cellValue, row, column }) => {
      if (cellValue) {
        for (let i = 0; i < aps_plan_type.value.length; i++) {
          if (cellValue === aps_plan_type.value[i].value) {
            return aps_plan_type.value[i].label;
          }
        }
      }
    },
  },
  {
    title: "计划排产区域",
@@ -511,6 +520,7 @@
// 计划周期
function handleSetCycle(row) {
  openSetCycle.value = true;
  console.log(row,row.id,"==========")
  if (!row.cycle) {
    formCycle.value = {
      cycle: {
@@ -519,6 +529,7 @@
        period: "1",
        periodStart: moment(Date.now()).format("YYYY-MM-DD"),
        periodEnd: "",
        planId: row.id
      },
    };
    let nowTime = moment(formCycle.value.cycle.periodStart)
@@ -530,7 +541,7 @@
  } else {
    formCycle.value = row;
  }
  console.log(formCycle.value, "formCycle.value");
  console.log(formCycle.value, "formCycle.value+++++===");
}
function handleToggleExpand() {
  expand.value = !expand.value;
@@ -572,14 +583,15 @@
  });
}
function submitFormCycle() {
  console.log(formCycle.value,"formCycle.value=====")
  redundantOrderList({
    ...formCycle.value.cycle,
    planId: formCycle.value.id,
  })
    .then((res) => {
      if (res.code === 200) {
        proxy.$modal.msgSuccess("更新成功");
        openSetCycle.value = false;
        getList();
      } else {
        openSetCycle.value = false;
      }
@@ -587,7 +599,6 @@
    .catch(() => {
      openSetCycle.value = false;
    });
  getList();
}
function handleGoToCycle() {
  router.push({