From 1e3797178d05b111b901a005827189ee63d6f8f6 Mon Sep 17 00:00:00 2001
From: CD配唱片 <CD配唱片>
Date: 星期三, 07 五月 2025 16:25:33 +0800
Subject: [PATCH] 提交数据联调,i18n

---
 src/views/mainPlan/sheetMetalSupplyGap/index.vue |  241 +++++++----------------------------------------
 1 files changed, 37 insertions(+), 204 deletions(-)

diff --git a/src/views/mainPlan/sheetMetalSupplyGap/index.vue b/src/views/mainPlan/sheetMetalSupplyGap/index.vue
index 3ec494f..0a2c021 100644
--- a/src/views/mainPlan/sheetMetalSupplyGap/index.vue
+++ b/src/views/mainPlan/sheetMetalSupplyGap/index.vue
@@ -12,11 +12,11 @@
         <el-col :span="locale === 'zh' ? 5 : 10">
           <el-form-item
             :label="$t('plan.query.requireTraceID')"
-            prop="description"
+            prop="requireId"
           >
             <el-input
               :style="{ width: locale === 'zh' ? '140px' : '300px' }"
-              v-model="queryParams.description"
+              v-model="queryParams.requireId"
               :placeholder="`${$t('plan.placeholder.requireTraceID')}`"
               clearable
               @keyup.enter="handleQuery"
@@ -24,10 +24,10 @@
           </el-form-item>
         </el-col>
         <el-col :span="locale === 'zh' ? 8 : 9">
-          <el-form-item :label="$t('plan.query.itemNumber')" prop="description">
+          <el-form-item :label="$t('plan.query.itemNumber')" prop="bomLineCode">
             <el-input
               :style="{ width: locale === 'zh' ? '140px' : '210px' }"
-              v-model="queryParams.description"
+              v-model="queryParams.bomLineCode"
               :placeholder="`${$t('common.common.placeholder')}${$t(
                 'plan.query.itemNumber'
               )}`"
@@ -68,7 +68,7 @@
     <HxlhTable
       style="width: 100%"
       :columns="columns"
-      :data="calendarList"
+      :data="gapList"
       :loading="loading"
       :height="height"
       ref="tableRef"
@@ -85,21 +85,15 @@
 <script setup name="Calendar">
 import HxlhTable from "@/components/HxlhTable";
 import {
-  listCalendar,
-  getCalendar,
-  delCalendar,
-  addCalendar,
-  updateCalendar,
-} from "@/api/basicData/calendar";
+  supplyGapList
+} from "@/api/basicData/sheetMetalConfig/sheetMetalConfig";
 import axios from "axios";
 import { listAll_plant } from "@/api/basicData/plant";
-import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
-import { selectProcessNameList } from "@/api/basicData/processRoute.js";
 import { useI18n } from "vue-i18n"; //瑕佸湪js涓娇鐢ㄥ浗闄呭寲
 const { t, locale } = useI18n();
 const { proxy } = getCurrentInstance();
 const tableRef = ref();
-const calendarList = ref([]);
+const gapList = ref([]);
 const loading = ref(true);
 const showSearch = ref(true);
 const ids = ref([]);
@@ -114,14 +108,8 @@
   queryParams: {
     pageNum: 1,
     pageSize: 10,
-    description: null,
-    type: null,
-    effectiveDate: null,
-    expiringDate: null,
-    content: null,
-    applicableFactory: null,
-    applicableWorkshop: null,
-    applicableProcess: null,
+    bomLineCode: null,
+    requireId: null
   },
 });
 const { queryParams, form, rules } = toRefs(data);
@@ -145,67 +133,67 @@
     columns.value = [
       {
         title: t("plan.table.requireID"),
-        field: "description",
+        field: "id",
         width: 150,
         align: "center",
       },
       {
         title: t("plan.table.requireTraceID"),
-        field: "type",
+        field: "requireId",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.itemNumber"),
-        field: "effectiveDate",
+        field: "bomLineCode",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.bomLowCode"),
-        field: "expiringDate",
+        field: "bomLineLevel",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.matchState"),
-        field: "expiringDate",
+        field: "matchState",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.matchPattern"),
-        field: "createTime",
+        field: "matchMode",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.unmatchedDemandQuantity"),
-        field: "createTime",
+        field: "unmatchedDemandAmount",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.planStartDay"),
-        field: "createTime",
+        field: "startDate",
         width: 200,
         align: "center",
       },
       {
         title: t("plan.table.planEndDayDate"),
-        field: "updateTime",
+        field: "completeDate",
         width: 100,
         align: "center",
       },
       {
         title: t("plan.table.requirementDate"),
-        field: "updateTime",
+        field: "demandDate",
         width: 100,
         align: "center",
       },
       {
         title: t("plan.table.applicableFactories"),
-        field: "applicableFactory",
+        field: "orgCode",
         width: 200,
         align: "center",
         formatter: ({ cellValue, row, column }) => {
@@ -220,7 +208,7 @@
       },
       {
         title: t("plan.table.productionBase"),
-        field: "updateTime",
+        field: "productionBase",
         width: 100,
         align: "center",
       },
@@ -231,52 +219,24 @@
 /** 鏌ヨ鏃ュ巻绠$悊鍒楄〃 */
 function getList() {
   loading.value = true;
-  listCalendar(queryParams.value).then((response) => {
-    calendarList.value = response.rows;
+  supplyGapList(queryParams.value).then((response) => {
+    gapList.value = response.rows;
     page.value.total = response.total;
     loading.value = false;
+  }).catch(()=>{
+    loading.value = false;
   });
-  axios
-    .all([
-      /** 鏌ヨ宸ュ巶鍒楄〃 */
-      listAll_plant({}),
-      /** 鏌ヨ杞﹂棿鍒楄〃 */
-      listAll_shop({}),
-    ])
-    .then(
-      axios.spread((response1, response2) => {
-        plantList.value = response1.data;
-        shopList.value = response2.data;
-        loading.value = false;
-      })
-    )
-    .catch((error) => {
-      console.error("璇锋眰鍑洪敊:", error);
-    });
+  listAll_plant({}).then(response=>{
+    plantList.value = response.data;
+  })
 }
-
-// 鍙栨秷鎸夐挳
-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,
+  queryParams.value = {
+    pageNum: 1,
+    pageSize: 10,
+    bomLineCode: null,
+    requireId: null
   };
   proxy.resetForm("calendarRef");
 }
@@ -284,6 +244,7 @@
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 function handleQuery() {
   queryParams.value.pageNum = 1;
+  page.value.current = 1
   getList();
 }
 
@@ -299,137 +260,15 @@
   single.value = selection.length != 1;
   multiple.value = !selection.length;
 }
-
-/** 鏂板鎸夐挳鎿嶄綔 */
-async function handleAdd() {
-  reset();
-  open.value = true;
-  title.value = "娣诲姞鏃ュ巻绠$悊";
-}
-/** 閫夋嫨宸ュ巶鍚庝簨浠� 鍔犺浇杞﹂棿 鍜� 宸ュ簭 **/
-function changePlant(plant) {
-  listAps_shop({ plantCode: plant }).then((response) => {
-    shopList.value = response.rows;
-  });
-  selectProcessNameList({ orgCode: plant }).then((response) => {
-    processList.value = response.rows;
-  });
-}
-/** 淇敼鎸夐挳鎿嶄綔 */
-function handleUpdate(row) {
-  reset();
-  const _id = row.id || ids.value;
-  getCalendar(_id).then((response) => {
-    form.value = response.data;
-    // form.value.content = JSON.parse(response.data.content.value);
-    if (form.value.type === "1") {
-      weekDaysSettingList.value = JSON.parse(
-        response.data.content.value
-      ).weekdays;
-    } else if (form.value.type === "2") {
-      holidays.value = JSON.parse(response.data.content.value).holidays;
-    }
-
-    open.value = true;
-    title.value = "淇敼鏃ュ巻绠$悊";
-  });
-}
-
-/** 鎻愪氦鎸夐挳 */
-function submitForm() {
-  proxy.$refs["calendarRef"].validate((valid) => {
-    if (valid) {
-      if (form.value.id != null) {
-        if (form.value.type === "1") {
-          updateCalendar({
-            ...form.value,
-            content: {
-              weekdays: weekDaysSettingList.value,
-            },
-            applicableWorkshop: form.value.applicableWorkshop,
-            applicableProcess: form.value.applicableProcess,
-          }).then((response) => {
-            proxy.$modal.msgSuccess("淇敼鎴愬姛");
-            open.value = false;
-            getList();
-          });
-        } else if (form.value.type === "2") {
-          updateCalendar({
-            ...form.value,
-            content: {
-              holidays: holidays.value,
-            },
-            applicableWorkshop: form.value.applicableWorkshop,
-            applicableProcess: form.value.applicableProcess,
-          }).then((response) => {
-            proxy.$modal.msgSuccess("淇敼鎴愬姛");
-            open.value = false;
-            getList();
-          });
-        }
-      } else {
-        if (form.value.type === "1") {
-          addCalendar({
-            ...form.value,
-            content: {
-              weekdays: weekDaysSettingList.value,
-            },
-          }).then((response) => {
-            proxy.$modal.msgSuccess("鏂板鎴愬姛");
-            open.value = false;
-            getList();
-          });
-        } else if (form.value.type === "2") {
-          addCalendar({
-            ...form.value,
-            content: {
-              holidays: holidays.value,
-            },
-          }).then((response) => {
-            proxy.$modal.msgSuccess("鏂板鎴愬姛");
-            open.value = false;
-            getList();
-          });
-        }
-      }
-    }
-  });
-}
-
-/** 鍒犻櫎鎸夐挳鎿嶄綔 */
-function handleDelete(row) {
-  const _ids = row.id || ids.value;
-  proxy.$modal
-    .confirm('鏄惁纭鍒犻櫎鏃ュ巻绠$悊缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�')
-    .then(function () {
-      return delCalendar(_ids);
-    })
-    .then(() => {
-      getList();
-      proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-    })
-    .catch(() => {});
-}
-
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
 function handleExport() {
   proxy.download(
-    "core/calendar/export",
+    "aps/ApsPlateStandardRequire/supplyGapListExport",
     {
       ...queryParams.value,
     },
-    `calendar_${new Date().getTime()}.xlsx`
+    `supplyGapListExport_${new Date().getTime()}.xlsx`
   );
-}
-function handleSwitchType(e) {
-  typeRadioNumber.value = e;
-  form.value.type = e;
-  form.value.effectiveDate = null;
-  form.value.expiringDate = null;
-  form.value.content = null;
-  form.value.applicableFactory = null;
-  form.value.applicableWorkshop = null;
-  form.value.applicableProcess = null;
 }
 function changePageNo(currentPage) {
   queryParams.value.pageNum = currentPage;
@@ -442,12 +281,6 @@
   queryParams.value.pageSize = pageSize;
   getList();
 }
-// 澶氶�夋閫変腑鏁版嵁
-const handleCheckboxChange = (data) => {
-  ids.value = data.records.map((item) => item.id);
-  single.value = data.records.length !== 1;
-  multiple.value = !data.records.length;
-};
 onMounted(() => {
   getList();
 });

--
Gitblit v1.9.3