chengxiangling
2025-05-14 9587438965a876c23b9e9efcff014f1cc565cb4d
提交日历等
已修改10个文件
446 ■■■■ 文件已修改
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/bom/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/calendar/index.vue 398 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/materialManagement/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/materialStorageManagement/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/processCapacityManagement/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/processRouteDataPreparate/index.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/professionalFixedCycleManagement/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/resourceGroup/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/sheetMetalOrderManage/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -44,6 +44,7 @@
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "5.0.5",
    "moment": "^2.30.1",
    "sass": "1.77.5",
    "terser": "^5.39.0",
    "unplugin-auto-import": "^0.17.6",
src/views/basicData/bom/index.vue
@@ -6,11 +6,11 @@
      :rules="rules"
      :inline="true"
      v-show="showSearch"
      :label-width="locale === 'zh' ? '90px' : '160px'"
      label-position="left"
    >
      <el-row :gutter="20">
        <el-col :span="locale === 'zh' ? 5 : 9">
          <el-form-item :label="$t('plan.query.itemNumber')" prop="itemCode">
        <el-col :span="locale === 'zh' ? 5 : 8">
          <el-form-item :label="$t('plan.query.itemNumber')" :label-width="locale === 'zh' ? '50px' : '110px'" prop="itemCode">
            <el-input
              :style="{ width: locale === 'zh' ? '140px' : '220px' }"
              v-model="queryParams.itemCode"
@@ -22,15 +22,16 @@
            />
          </el-form-item>
        </el-col>
        <el-col :span="locale === 'zh' ? 7 : 9">
        <el-col :span="locale === 'zh' ? 7 : 10">
          <el-form-item
            :label="$t('plan.table.applicableFactories')"
            :label-width="locale === 'zh' ? '70px' : '150px'"
            prop="orgCode"
          >
            <el-select
              clearable
              v-model="queryParams.orgCode"
              :style="{ width: locale === 'zh' ? '180px' : '240px' }"
              :style="{ width: locale === 'zh' ? '180px' : '280px' }"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.table.applicableFactories'
              )}`"
src/views/basicData/calendar/index.vue
@@ -7,9 +7,10 @@
      :inline="true"
      v-show="showSearch"
      label-width="68px"
      label-position="left"
    >
      <el-row type="flex" justify="left">
        <el-col :span="6">
      <el-row type="flex" justify="left" :gutter="20">
        <el-col :span="5">
          <el-form-item label="日历描述" prop="description">
            <el-input
              style="width: 140px"
@@ -37,7 +38,7 @@
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" style="text-align: right">
        <el-col :span="13" style="text-align: right">
          <el-form-item class="column-with-margin">
            <el-button type="primary" icon="Search" @click="handleQuery"
              >查询</el-button
@@ -140,17 +141,26 @@
        </div>
      </template>
      <template #buttons="{ row }">
        <vxe-button
          mode="text"
        <el-button
          type="primary"
          size="small"
          @click="handleUpdate(row)"
          v-hasPermi="['aps:calendar:update']"
          >修改</vxe-button
          >修改</el-button
        >
        <vxe-button
          mode="text"
        <el-button
          type="warning"
          size="small"
          @click="handleSetHolidays(row)"
          v-hasPermi="['aps:calendar:remove']"
          >设置节假日</el-button
        >
        <el-button
          type="danger"
          size="small"
          @click="handleDelete(row)"
          v-hasPermi="['aps:calendar:remove']"
          >删除</vxe-button
          >删除</el-button
        >
      </template>
    </HxlhTable>
@@ -193,7 +203,7 @@
          >
          </el-date-picker>
        </el-form-item>
        <div v-if="form.type === '1'">
        <div>
          <div class="title_bar_line">
            <div class="line_short"></div>
            <div>周工作设置</div>
@@ -251,10 +261,10 @@
          prop="applicableFactory"
          class="factory_use_item"
        > -->
        <div class="select_factory">适用工厂/车间/工序</div>
        <div class="select_factory select_factory_dis">适用工厂/车间/工序</div>
        <!-- <el-row :gutter="20" class="select_factory"> -->
        <div
          class="select_factory"
          class="select_factory_dis"
          v-for="(item, index) in applicableSettingList"
          :key="index"
        >
@@ -271,7 +281,7 @@
              v-for="plant in aps_factory"
              :key="plant.value"
              :label="plant.label"
              :value="plant.value"
              :value="`${plant.value};${plant.label}`"
            >
            </el-option>
          </el-select>
@@ -289,7 +299,7 @@
              v-for="shop in shopList"
              :key="shop.id"
              :label="shop.shopName"
              :value="shop.id"
              :value="`${shop.id};${shop.shopName}`"
            >
            </el-option>
          </el-select>
@@ -304,9 +314,9 @@
          >
            <el-option
              v-for="process in processList"
              :key="process.id"
              :key="process.processNumber"
              :label="process.processName"
              :value="process.processName"
              :value="`${process.processNumber};${process.processName}`"
            >
            </el-option>
          </el-select>
@@ -315,8 +325,17 @@
          <el-button
            class="select_content"
            type="primary"
            :icon="Plus"
            icon="Plus"
            @click="handleAddFactory(item)"
            circle
            size="small"
          />
          <el-button
            v-if="applicableSettingList.length > 1"
            class="select_content"
            type="primary"
            icon="Minus"
            @click="handleMinusFactory(item)"
            circle
            size="small"
          />
@@ -344,11 +363,115 @@
        </div>
      </template>
    </el-dialog>
    <el-dialog
      title="设置节假日"
      v-model="openSetHolidays"
      width="80%"
      style="height: 570px"
      append-to-body
    >
      <div class="height_dialog">
        <div class="height_dialog_scroll">
          <div class="grey_bg">
            <div v-if="expand">
              <div class="flex_item">
                <div>工作日历:&nbsp;</div>
                <div>{{ form.description }}</div>
              </div>
              <div class="flex_item">
                <div>生效时间:&nbsp;</div>
                <div>{{ form.effectiveDate }}</div>
              </div>
              <div class="flex_item">
                <div>失效时间:&nbsp;</div>
                <div>{{ form.expiringDate }}</div>
              </div>
              <div class="flex_item">
                <div>适用工厂:&nbsp;</div>
                <div class="flex_item_dis">
                  <div
                    v-for="(item, index) in form.applicableTranslate"
                    :key="index"
                  >
                    {{ item.factory }} - {{ item.workshop }} - {{ item.process }}
                  </div>
                </div>
              </div>
            </div>
            <div class="flex_item_expand_end" @click="handleToggleExpand">
              <el-icon :size="18" v-if="expand"><ArrowUpBold /></el-icon>
              <el-icon v-else><ArrowDownBold /></el-icon>
            </div>
          </div>
          <div class="title_flex">
            <div class="holiday_title">节假日列表</div>
            <el-button type="primary" size="small" @click="hanldeAddHolidays"
              >添加节假日</el-button
            >
          </div>
          <div class="grey_bg">
          <el-form
            class="mart10"
            ref="holidaysRef"
            :model="formHolidays"
            :rules="holidayRules"
            :inline="true"
            label-width="105px"
          >
            <template v-for="(item, index) in formHolidays" :key="index">
              <el-form-item label="节假日描述" prop="description">
                <el-input
                  style="width: 130px"
                  v-model="item.describe"
                  placeholder="请输入描述"
                />
              </el-form-item>
              <el-form-item label="开始时间" prop="startdate">
                <el-date-picker
                  style="width: 130px"
                  clearable
                  v-model="item.startdate"
                  type="date"
                  :disabled-date="handleDisabledDate"
                  :default-value="form.effectiveDate"
                  placeholder="选择日期"
                >
                </el-date-picker>
              </el-form-item>
              <el-form-item label="结束时间" prop="enddate">
                <el-date-picker
                  style="width: 130px"
                  clearable
                  v-model="item.enddate"
                  type="date"
                  placeholder="选择日期"
                  :disabled-date="handleDisabledDate"
                  :default-value="form.expiringDate"
                >
                </el-date-picker>
              </el-form-item>
              <el-form-item label="" prop="">
                <el-button v-if="formHolidays.length>1" type="danger" size="small" @click="handleDelSettingHolidays(item)">删除</el-button>
              </el-form-item>
            </template>
          </el-form>
          </div>
        </div>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="openSetHolidays = false">取 消</el-button>
          <el-button type="primary" @click="handleSaveHolidaysForm"
            >保存</el-button
          >
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup name="Calendar">
import { Plus } from "@element-plus/icons-vue";
import moment from "moment";
import HxlhTable from "@/components/HxlhTable";
import {
  listCalendar,
@@ -361,11 +484,14 @@
import { listAll_plant, listByWorkShop } from "@/api/basicData/plant";
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { selectProcessNameList } from "@/api/basicData/processRoute.js";
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
const { aps_factory } = proxy.useDict("aps_factory");
const tableRef = ref();
const calendarList = ref([]);
const open = ref(false);
const openSetHolidays = ref(false);
const expand = ref(true);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
@@ -384,6 +510,13 @@
      },
    ],
  },
  formHolidays: [
    {
      enddate: "",
      startdate: "",
      describe: "",
    },
  ],
  queryParams: {
    pageNum: 1,
    pageSize: 10,
@@ -426,16 +559,18 @@
        trigger: "blur",
      },
    ],
    applicableFactory: [
  },
  holidayRules: {
    describe: [
      {
        required: true,
        message: "请选择适用工厂",
        message: "请输入节假日描述",
        trigger: "blur",
      },
    ],
  },
});
const { queryParams, form, rules } = toRefs(data);
const { queryParams, form, rules, formHolidays, holidayRules } = toRefs(data);
const dateType = ref("周工作");
const dateTypeList = ref([
  {
@@ -449,7 +584,7 @@
]);
const typeRadioNumber = ref(1);
const applicableSettingList = ref([
  { factory: "", workshop: "", process: "" },
  { factory: "", workshop: "", process: "", id: 0 },
]);
const weekDaysSettingList = ref([
  {
@@ -583,7 +718,7 @@
  },
  {
    title: "操作",
    width: 100,
    width: 270,
    fixed: "right",
    slots: { default: "buttons" },
    align: "center",
@@ -626,34 +761,6 @@
// 取消按钮
function cancel() {
  open.value = false;
  reset();
}
// 表单重置
function reset() {
  form.value = {
    id: null,
    description: null,
    type: "1",
    effectiveDate: null,
    expiringDate: null,
    content: null,
    applicableFactory: null,
    applicableWorkshop: null,
    applicableProcess: null,
    createBy: null,
    createTime: null,
    updateBy: null,
    updateTime: null,
    applicable: [
      {
        factory: "",
        workshop: "",
        process: "",
      },
    ],
  };
  proxy.resetForm("calendarRef");
}
/** 搜索按钮操作 */
@@ -677,7 +784,6 @@
/** 新增按钮操作 */
async function handleAdd() {
  reset();
  open.value = true;
  form.value = {
    applicable: [
@@ -693,7 +799,7 @@
/** 选择工厂后事件 加载车间 和 工序 **/
function changePlant(plant) {
  console.log(plant);
  listAps_shop({ plantCode: plant }).then((response) => {
  listAps_shop({ plantCode: plant.split(";")[0] }).then((response) => {
    shopList.value = response.rows;
  });
  // selectProcessNameList({ orgCode: plant }).then((response) => {
@@ -701,17 +807,23 @@
  // });
}
function changeWorkshop(workShop) {
  console.log(workShop.split(";")[0]);
  listByWorkShop({ workShop: "气柜" }).then((res) => {
    console.log(res, "workShop");
    processList.value = res.rows;
  });
}
function handleAddFactory(row) {
  applicableSettingList.value.push(row);
  console.log(row);
  applicableSettingList.value.push({ ...row, id: ++row.id });
}
function handleMinusFactory(row) {
  applicableSettingList.value = applicableSettingList.value.filter(
    (item, index) => item !== row
  );
}
/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  const _id = row.id || ids.value;
  getCalendar(_id).then((response) => {
    form.value = response.data;
@@ -728,11 +840,102 @@
    title.value = "修改日历管理";
  });
}
// 设置节假日
function handleSetHolidays(row) {
  form.value = {
    ...row,
    applicableTranslate: JSON.parse(row.applicableTranslate),
  };
  if (!row.holidays) {
    formHolidays.value = [
      {
        enddate: "",
        startdate: "",
        describe: "",
      },
    ];
  } else {
    formHolidays.value = JSON.parse(row.holidays.value);
  }
  openSetHolidays.value = true;
}
// 禁用日期
function handleDisabledDate(date) {
  const targetDate = moment(date).valueOf();
  const startDate = moment(form.value.effectiveDate).valueOf();
  const endDate = moment(form.value.expiringDate).valueOf();
  console.log(targetDate, startDate, endDate, "handleDisabledDate");
  return targetDate < startDate || targetDate > endDate;
}
// 删除节假日设置
function handleDelSettingHolidays(row) {
 formHolidays.value = formHolidays.value.filter(item=>{
    return item != row
  })
}
// 添加节假日
function hanldeAddHolidays() {
  formHolidays.value.push({
    enddate: "",
    startdate: "",
    describe: "",
  });
}
function handleToggleExpand() {
  expand.value = !expand.value;
}
// 提交节假日
function handleSaveHolidaysForm() {
  proxy.$refs["holidaysRef"].validate((valid) => {
    if (valid) {
      updateCalendar({
        id: form.value.id,
        // content: {
        //   weekdays: weekDaysSettingList.value,
        // },
        holidays: formHolidays.value.map((item) => {
          return {
            startdate: moment(item.startdate).format("YY-MM-DD"),
            enddate: moment(item.enddate).format("YY-MM-DD"),
          };
        }),
        // applicable: applicableSettingList.value.map((item) => {
        //   return {
        //     factory: item.factory.split(";")[0],
        //     process: item.process.split(";")[0],
        //     workshop: item.workshop.split(";")[0],
        //   };
        // }),
        // applicableTranslate: JSON.stringify(
        //   applicableSettingList.value.map((item) => {
        //     return {
        //       factory: item.factory.split(";")[1],
        //       process: item.process.split(";")[1],
        //       workshop: item.workshop.split(";")[1],
        //     };
        //   })
        //),
        // applicableCn:
        //},
      }).then((response) => {
        proxy.$modal.msgSuccess("新增成功");
        open.value = false;
        getList();
      });
    }
  });
}
/** 提交按钮 */
function submitForm() {
  proxy.$refs["calendarRef"].validate((valid) => {
    if (valid) {
      if (applicableSettingList.value[0].factory === "") {
        ElMessage({
          type: "error",
          message: "至少选择一个适用工厂",
        });
        return;
      }
      if (form.value.id != null) {
        // if (form.value.type === "1") {
        //   updateCalendar({
@@ -753,7 +956,13 @@
          content: {
            holidays: holidays.value,
          },
          applicableWorkshop: form.value.applicableWorkshop,
          applicableWorkshop: form.value.applicableWorkshop.map((item) => {
            return {
              factory: item.factory.split(";")[0],
              process: item.process.split(";")[0],
              workshop: item.workshop.split(";")[0],
            };
          }),
          applicableProcess: form.value.applicableProcess,
        }).then((response) => {
          proxy.$modal.msgSuccess("修改成功");
@@ -779,8 +988,24 @@
          content: {
            weekdays: weekDaysSettingList.value,
          },
          holidays: holidays.value,
          applicable: applicableSettingList.value,
          // holidays: holidays.value,
          applicable: applicableSettingList.value.map((item) => {
            return {
              factory: item.factory.split(";")[0],
              process: item.process.split(";")[0],
              workshop: item.workshop.split(";")[0],
            };
          }),
          applicableTranslate: JSON.stringify(
            applicableSettingList.value.map((item) => {
              return {
                factory: item.factory.split(";")[1],
                process: item.process.split(";")[1],
                workshop: item.workshop.split(";")[1],
              };
            })
          ),
          // applicableCn:
          //},
        }).then((response) => {
          proxy.$modal.msgSuccess("新增成功");
@@ -896,10 +1121,12 @@
  margin-top: 10px;
}
.select_factory {
  margin-left: 34px;
  font-weight: 800;
  font-size: 14px;
  color: #606266;
}
.select_factory_dis {
  margin-left: 34px;
}
.select_content {
  margin-right: 10px;
@@ -917,4 +1144,55 @@
.auto-height-grid .xe-body .xe-body--row {
  height: auto; /* 或者使用 min-height */
}
.mart10 {
  margin-top: 20px;
}
.h300 {
}
.height_dialog{
  height: 400px;
  overflow: hidden;
  .height_dialog_scroll{
    height: 100%;
    overflow: auto;
  }
}
.grey_bg {
  background: #f1f1f1;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  .flex_item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 10px;
    .flex_item_dis {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      & div {
        margin-bottom: 5px;
      }
    }
  }
  .flex_item_expand_end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    cursor: pointer;
  }
}
.title_flex {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  .holiday_title {
    font-size: 15px;
    font-weight: 500;
  }
}
</style>
src/views/basicData/materialManagement/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left" label-width="50px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="料号" prop="itemNumber">
src/views/basicData/materialStorageManagement/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left" label-width="50px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="料号" prop="itemNumber">
src/views/basicData/processCapacityManagement/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :rules="rules" :inline="true" v-show="showSearch" label-width="68px">
    <el-form :model="queryParams" ref="queryRef" :rules="rules" :inline="true" v-show="showSearch" label-position="left" label-width="50px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="料号" prop="itemNumber">
src/views/basicData/processRouteDataPreparate/index.vue
@@ -6,13 +6,13 @@
      :rules="rules"
      :inline="true"
      v-show="showSearch"
      :label-width="locale === 'zh' ? '90px' : '160px'"
      label-position="left"
    >
      <el-row type="flex" justify="left" :gutter="20">
        <el-col :span="locale === 'zh' ? 5 : 9">
          <el-form-item :label="$t('plan.query.itemNumber')" prop="itemCode">
        <el-col :span="locale === 'zh' ? 5 : 8">
          <el-form-item :label="$t('plan.query.itemNumber')" :label-width="locale === 'zh' ? '50px' : '110px'"  prop="itemCode">
            <el-input
              :style="{ width: locale === 'zh' ? '140px' : '240px' }"
              :style="{ width: locale === 'zh' ? '140px' : '220px' }"
              v-model="queryParams.itemCode"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.query.itemNumber'
@@ -22,15 +22,16 @@
            />
          </el-form-item>
        </el-col>
        <el-col :span="locale === 'zh' ? 7 : 9">
        <el-col :span="locale === 'zh' ? 7 : 10">
          <el-form-item
            :label="$t('plan.table.applicableFactories')"
            :label-width="locale === 'zh' ? '70px' : '150px'"
            prop="orgCode"
          >
            <el-select
              clearable
              v-model="queryParams.orgCode"
              :style="{ width: locale === 'zh' ? '180px' : '260px' }"
              :style="{ width: locale === 'zh' ? '180px' : '280px' }"
              :placeholder="`${$t('common.common.placeholder')}${$t(
                'plan.table.applicableFactories'
              )}`"
src/views/basicData/professionalFixedCycleManagement/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left" label-width="50px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="料号" prop="itemNumber">
src/views/basicData/resourceGroup/index.vue
@@ -1,10 +1,10 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-position="left" >
      <el-row :gutter="20">
        <el-col
        :span="6">
      <el-form-item label="资源组" prop="resourceGroupName">
      <el-form-item label="资源组" label-width="60px" prop="resourceGroupName">
        <el-input
          v-model="queryParams.resourceGroupName"
          placeholder="请输入资源组名称"
@@ -15,7 +15,7 @@
        </el-col>
        <el-col
        :span="6">
      <el-form-item label="截止机加需求日期" style="width: 400px" label-width="150px">
      <el-form-item label="截止机加需求日期" style="width: 400px" label-width="140px">
        <el-date-picker
          v-model="daterangeRequestDate"
          value-format="YYYY-MM-DD"
src/views/mainPlan/sheetMetalOrderManage/index.vue
@@ -552,6 +552,15 @@
        field: "orgCode",
        width: 100,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < aps_factory.value.length; i++) {
              if (cellValue === aps_factory.value[i].value) {
                return aps_factory.value[i].label;
              }
            }
          }
        },
      },
      {
        title: t("plan.table.productionBase"),