From db6e95062dfb57bcd1fb1cacdbb3cb4372c576b0 Mon Sep 17 00:00:00 2001
From: chengxiangling <291105840@qq.com>
Date: 星期三, 14 五月 2025 17:34:00 +0800
Subject: [PATCH] 钣金页面表格样式;

---
 src/views/mainPlan/sheetMetalRedundantReport/index.vue |  425 +++++++++++++++-------------------------------------
 1 files changed, 122 insertions(+), 303 deletions(-)

diff --git a/src/views/mainPlan/sheetMetalRedundantReport/index.vue b/src/views/mainPlan/sheetMetalRedundantReport/index.vue
index 858de3e..b5c295a 100644
--- a/src/views/mainPlan/sheetMetalRedundantReport/index.vue
+++ b/src/views/mainPlan/sheetMetalRedundantReport/index.vue
@@ -6,52 +6,60 @@
       ref="queryRef"
       :inline="true"
       v-show="showSearch"
-      label-width="90px"
+      label-position="left"
     >
       <el-row type="flex" justify="left">
-        <el-col :span="5">
-          <el-form-item label="闇�姹傝拷婧疘D" prop="description">
+        <el-col :span="locale === 'zh' ? 6 : 8">
+          <el-form-item :label-width="locale === 'zh' ? '48px' : '100px'" :label="$t('plan.query.itemNumber')" prop="itemNumber">
             <el-input
-              style="width: 140px"
-              v-model="queryParams.description"
-              placeholder="璇疯緭鍏ラ渶姹傝拷婧疘D"
+             :style="{ width: locale === 'zh' ? '180px' : '210px' }"
+              v-model="queryParams.itemNumber"
+              :placeholder="`${$t('common.common.placeholder')}${$t(
+                'plan.query.itemNumber'
+              )}`"
               clearable
               @keyup.enter="handleQuery"
             />
           </el-form-item>
         </el-col>
-        <el-col :span="5">
-          <el-form-item label="鏂欏彿" prop="description">
+        <el-col :span="locale === 'zh' ? 6 : 8">
+          <el-form-item
+            :label="$t('plan.query.workOrderNo')"
+            prop="documentNumber"
+          >
             <el-input
-              style="width: 140px"
-              v-model="queryParams.description"
-              placeholder="璇疯緭鍏ユ枡鍙�"
+              :style="{ width: locale === 'zh' ? '180px' : '280px' }"
+              v-model="queryParams.documentNumber"
+              :placeholder="`${$t('common.common.placeholder')}${$t(
+                'plan.query.workOrderNo'
+              )}`"
               clearable
               @keyup.enter="handleQuery"
             />
           </el-form-item>
         </el-col>
-        <el-col :span="14" style="text-align: right">
+        <el-col :span="locale === 'zh' ? 12 : 8" style="text-align: right">
           <el-form-item class="column-with-margin">
-            <el-button type="primary" icon="Search" @click="handleQuery"
-              >鏌ヨ</el-button
-            >
-            <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+            <el-button type="primary" icon="Search" @click="handleQuery">{{
+              $t("common.common.query")
+            }}</el-button>
+            <el-button icon="Refresh" @click="resetQuery">{{
+              $t("common.common.reset")
+            }}</el-button>
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-
       <el-col :span="1.5">
         <el-button
           type="warning"
           plain
           icon="Download"
           @click="handleExport"
-          v-hasPermi="['core:calendar:export']"
-          >瀵煎嚭</el-button
+          v-hasPermi="['Aps:apsPlatePlan:redundantOrderListExport']"
+          >{{ $t("common.common.export") }}</el-button
         >
       </el-col>
       <right-toolbar
@@ -62,7 +70,7 @@
     <HxlhTable
       style="width: 100%"
       :columns="columns"
-      :data="calendarList"
+      :data="orderList"
       :loading="loading"
       :height="height"
       ref="tableRef"
@@ -70,188 +78,125 @@
       @changePageNo="changePageNo"
       @changePageSize="changePageSize"
       @on-checkbox="handleCheckboxChange"
-      class="auto-height-grid"
     >
     </HxlhTable>
   </div>
 </template>
 
-<script setup name="Calendar">
+<script setup name="SheetMetalRedundantReport">
 import HxlhTable from "@/components/HxlhTable";
-import {
-  listCalendar,
-  getCalendar,
-  delCalendar,
-  addCalendar,
-  updateCalendar,
-} from "@/api/basicData/calendar";
-import axios from "axios";
+import { redundantOrderList } from "@/api/basicData/sheetMetalConfig/sheetMetalConfig";
 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 orderList = ref([]);
 const loading = ref(true);
 const showSearch = ref(true);
-const ids = ref([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const title = ref("");
 const data = reactive({
-  form: {
-    type: "1",
-  },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
-    description: null,
-    type: null,
-    effectiveDate: null,
-    expiringDate: null,
-    content: null,
-    applicableFactory: null,
-    applicableWorkshop: null,
-    applicableProcess: null,
+    documentNumber: null,
+    itemNumber: null,
   },
 });
-const { queryParams, form, rules } = toRefs(data);
-const typeRadioNumber = ref(1);
+const { queryParams } = toRefs(data);
 const plantList = ref([]);
-const shopList = ref([]);
-const allShopList = ref([]);
-const processList = ref([]);
 const height = ref(document.documentElement.clientHeight - 220 + "px;");
 // 琛ㄦ牸閰嶇疆-鍒楄〃
-const columns = ref([
-  {
-    title: "宸ュ崟鍙�",
-    field: "description",
-    width: 150,
-    align: "center"
-  },
-  {
-    title: "瀛愪欢鏂欏彿",
-    field: "type",
-    width: 200,
-    align: "center"
-  },
-  {
-    title: "鐢熶骇鏁伴噺",
-    field: "effectiveDate",
-    width: 200,
-    align: "center",
-  },
-  {
-    title: "鏈尮閰嶇敓浜ф暟閲�",
-    field: "expiringDate",
-    width: 200,
-    align: "center"
-  },
-  {
-    title: "閫傜敤宸ュ巶",
-    field: "applicableFactory",
-    width: 200,
-    align: "center",
-    formatter: ({ cellValue, row, column }) => {
-      if (cellValue) {
-        for (let i = 0; i < plantList.value.length; i++) {
-          if (cellValue === plantList.value[i].plantCode) {
-            return plantList.value[i].plantName;
-          }
-        }
-      }
-    },
-  },
-  {
-    title: "鐢熶骇鍩哄湴",
-    field: "expiringDate",
-    width: 200,
-    align: "center"
-  },
-  {
-    title: "璁″垝寮�宸ユ棩",
-    field: "createTime",
-    width: 200,
-    align: "center",
-  },
-  {
-    title: "璁″垝瀹屽伐鏃�",
-    field: "updateTime",
-    width: 100,
-    align: "center",
-  },
-  {
-    title: "宸ュ崟鍒涘缓鏃堕棿",
-    field: "updateTime",
-    width: 100,
-    align: "center",
-  },
-]);
+const columns = ref([]);
 // 鍒嗛〉灞炴��
 const page = ref({
   total: 0,
   current: 1,
   size: 10,
 });
-
-/** 鏌ヨ鏃ュ巻绠$悊鍒楄〃 */
+watch(
+  locale,
+  (newLocale) => {
+    columns.value = [
+      {
+        title: t("plan.table.workOrderNo"),
+        field: "documentNumber",
+        align: "center",
+      },
+      {
+        title: t("plan.table.itemNumber"),
+        field: "itemNumber",
+        align: "center",
+      },
+      {
+        title: t("plan.table.productionQuantity"),
+        field: "productionQuantity",
+        width: "80",
+        align: "center",
+      },
+      {
+        title: t("plan.table.mismatchedProductionQuantity"),
+        field: "unmatchedQuantity",
+        width: "auto",
+        align: "center",
+      },
+      {
+        title: t("plan.table.applicableFactories"),
+        field: "plant",
+        width: "100",
+        align: "center",
+        formatter: ({ cellValue, row, column }) => {
+          if (cellValue) {
+            for (let i = 0; i < plantList.value.length; i++) {
+              if (cellValue === plantList.value[i].plantCode) {
+                return plantList.value[i].plantName;
+              }
+            }
+          }
+        },
+      },
+      {
+        title: t("plan.table.productionBase"),
+        field: "productionBase",
+        width: "100",
+        align: "center",
+      },
+      {
+        title: t("plan.table.planStartDay"),
+        field: "planStartDay",
+        width: "120",
+        align: "center",
+      },
+      {
+        title: t("plan.table.planEndDayDate"),
+        field: "planEndDay",
+        width: "120",
+        align: "center",
+      },
+      {
+        title: t("plan.table.workorderCreationTime"),
+        field: "orderCreateTime",
+        width: "150",
+        align: "center",
+      },
+    ];
+  },
+  { immediate: true, deep: true }
+);
+/** 鏌ヨ绠$悊鍒楄〃 */
 function getList() {
   loading.value = true;
-  listCalendar(queryParams.value).then((response) => {
-    calendarList.value = response.rows;
+  redundantOrderList(queryParams.value).then((response) => {
+    orderList.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);
-    });
 }
-
-// 鍙栨秷鎸夐挳
-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,
-  };
-  proxy.resetForm("calendarRef");
-}
-
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 function handleQuery() {
   queryParams.value.pageNum = 1;
+  page.value.current = 1;
   getList();
 }
 
@@ -261,143 +206,15 @@
   handleQuery();
 }
 
-// 澶氶�夋閫変腑鏁版嵁
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id);
-  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/apsPlatePlan/redundantOrderListExport",
     {
       ...queryParams.value,
     },
-    `calendar_${new Date().getTime()}.xlsx`
+    `redundantOrderList_${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;
@@ -410,14 +227,16 @@
   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();
+  /** 鏌ヨ宸ュ巶鍒楄〃 */
+  listAll_plant({})
+    .then((response) => {
+      plantList.value = response.data;
+    })
+    .catch((error) => {
+      console.error("璇锋眰鍑洪敊:", error);
+    });
 });
 </script>
 <style lang="scss" scoped>

--
Gitblit v1.9.3