From f9eb1a419834f97a3ab0124b132de4f977b1973b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 28 十二月 2024 21:00:56 +0800
Subject: [PATCH] 通用导入Excel更新

---
 src/views/tigerprojects/wms/wms_item/index.vue                |   12 
 src/assets/icons/ImportExcel-white.svg                        |    1 
 src/views/components/ImportExcelModal.vue                     |  195 +++++++++++++++++++++++++++
 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts |  114 ++++++++++++++-
 src/api/tigerapi/model/systemModel.ts                         |   16 ++
 src/views/tigerprojects/system/lowcode/normal/mainTable.vue   |   12 +
 src/views/tigerprojects/mes/prod/biz_mes_wo/WoModal.vue       |    6 
 src/api/tigerapi/system.ts                                    |   40 +++++
 src/views/tigerprojects/wms/wms_item/wms_item.data.ts         |    1 
 src/views/tigerprojects/mes/smt/smttable/index.vue            |    2 
 10 files changed, 378 insertions(+), 21 deletions(-)

diff --git a/src/api/tigerapi/model/systemModel.ts b/src/api/tigerapi/model/systemModel.ts
index 0af8a41..33296f2 100644
--- a/src/api/tigerapi/model/systemModel.ts
+++ b/src/api/tigerapi/model/systemModel.ts
@@ -1,5 +1,6 @@
 import { Ref } from 'vue';
 import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
+import { extend } from 'dayjs';
 
 export type AD_INFO = {
   nation?: string;
@@ -370,3 +371,18 @@
 export type EntityListGetResultModel = BasicFetchResult<EntityPropertie>;
 
 export type FunctionType = (...args: any[]) => any;
+
+export interface BaseImportInput{
+  typeFullName: string;
+}
+
+export interface ImportEntityValidate extends BaseImportInput {
+  EntityJson: string;
+  CheckJson: string;
+  where: string;
+  typeFullName: string;
+}
+
+export interface ImportInput extends BaseImportInput{
+  EntityJson: string;
+}
diff --git a/src/api/tigerapi/system.ts b/src/api/tigerapi/system.ts
index b419524..6ba9e68 100644
--- a/src/api/tigerapi/system.ts
+++ b/src/api/tigerapi/system.ts
@@ -29,6 +29,8 @@
   EntityList,
   iSYS_ROLE_PROD,
   pParams,
+  ImportEntityValidate,
+  ImportInput,
 } from './model/systemModel';
 import { defHttp } from '/@/utils/http/axios';
 import { isArray, isNullOrEmpty, isTimeViaRegExp8601 } from '/@/utils/is';
@@ -41,6 +43,8 @@
   EntityPageList = '/Base/QueryCustomPage',
   IsAccountExist = '/Base/IsExist',
   AddAfterDelete = '/Base/AddAfterDelete',
+  ImportExcel = '/Base/ImportExcel',
+  BaseValidateTableImport = '/Base/ValidateTableImport',
   setRoleStatus = '/system/setRoleStatus',
   MenuList = '/SYS/getMenuListAll',
   SaveMenu = '/SYS/SaveMenu',
@@ -823,6 +827,8 @@
         }
       } else if (isNumber(params[Keys[k]])) {
         sqlcmd += `And ${Keys[k]} = ${params[Keys[k]]}`;
+      } else if(Keys[k].toString().startsWith('IFEMPTY_')){
+        sqlcmd +=params[Keys[k]]=='Y'? `And (${Keys[k].split('IFEMPTY_')[1]} != '' OR ${Keys[k].split('IFEMPTY_')[1]} is not NULL)`: `And (${Keys[k].split('IFEMPTY_')[1]} = '' OR ${Keys[k].split('IFEMPTY_')[1]} is NULL)`;
       } else {
         sqlcmd +=
           params['nolike'] == 'Y'
@@ -1028,3 +1034,37 @@
       isTransformResponse: false,
     },
   );
+
+  /**
+   * @desc 瀵煎叆Excel
+   */
+export async function ImportExcel(entityName: string, items: ImportInput) {
+  const data = await defHttp.post(
+    {
+      url: Api.ImportExcel,
+      params: genAction(entityName, items),
+    },
+    {
+      errorMessageMode: 'none',
+      isTransformResponse: false,
+    },
+  );
+  return data;
+}
+
+/**
+ * @desc 瀵煎叆Excel
+ */
+export async function ValidateTableImport(entityName: string, items: ImportEntityValidate) {
+const data = await defHttp.post(
+  {
+    url: Api.BaseValidateTableImport,
+    params: genAction(entityName, items),
+  },
+  {
+    errorMessageMode: 'none',
+    isTransformResponse: false,
+  },
+);
+return data;
+}
diff --git a/src/assets/icons/ImportExcel-white.svg b/src/assets/icons/ImportExcel-white.svg
new file mode 100644
index 0000000..6a5579a
--- /dev/null
+++ b/src/assets/icons/ImportExcel-white.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1735231893769" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3240" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.953846 890.958769a31.507692 31.507692 0 0 1-31.507692 31.507693H320.590769a69.395692 69.395692 0 0 1-69.316923-69.316924V620.386462h63.015385v232.763076a6.301538 6.301538 0 0 0 6.301538 6.301539h226.855385a31.507692 31.507692 0 0 1 31.507692 31.507692zM918.685538 318.070154a10.318769 10.318769 0 0 0-0.472615-2.126769 12.681846 12.681846 0 0 0-0.708923-2.284308 8.349538 8.349538 0 0 0-0.708923-1.969231 23.158154 23.158154 0 0 0-2.126769-4.174769 16.620308 16.620308 0 0 0-1.654154-2.441846 39.384615 39.384615 0 0 0-2.914462-3.387077L740.982154 113.664a31.507692 31.507692 0 0 0-23.630769-10.397538H320.590769a69.395692 69.395692 0 0 0-69.316923 69.316923v187.628307h63.015385V172.583385a6.301538 6.301538 0 0 1 6.301538-6.301539h346.584616v157.538462a31.507692 31.507692 0 0 0 31.507692 31.507692h157.538461v138.633846a31.507692 31.507692 0 0 0 63.015385 0v-170.141538a27.884308 27.884308 0 0 0-0.551385-5.750154zM730.190769 292.312615V195.820308l86.646154 96.492307zM957.046154 744.448a31.507692 31.507692 0 0 1-31.507692 31.507692H699.155692l40.723693 40.723693a31.507692 31.507692 0 1 1-44.583385 44.504615l-93.735385-93.735385a31.901538 31.901538 0 0 1-4.804923-5.750153 31.507692 31.507692 0 0 1-3.780923-26.624 18.510769 18.510769 0 0 1 1.102769-2.914462 25.836308 25.836308 0 0 1 2.678154-5.041231A27.017846 27.017846 0 0 1 598.646154 724.676923a28.750769 28.750769 0 0 1 2.126769-2.363077l94.523077-94.523077a30.641231 30.641231 0 0 1 11.342769-7.246769h21.897846a30.641231 30.641231 0 0 1 11.34277 7.246769 31.507692 31.507692 0 0 1 0 44.504616l-40.723693 40.802461h226.38277a31.507692 31.507692 0 0 1 31.507692 31.350154zM728.536615 620.386462h-21.897846a31.507692 31.507692 0 0 1 21.897846 0z" fill="#ffffff" p-id="3241"></path><path d="M728.615385 504.123077v1.260308c0.236308-0.551385 0.078769-1.260308 0-1.260308z" fill="#ffffff" p-id="3242"></path><path d="M706.638769 620.386462h21.897846a31.507692 31.507692 0 0 0-21.897846 0zM728.615385 504.123077v1.260308c0.236308-0.551385 0.078769-1.260308 0-1.260308z" fill="#ffffff" p-id="3243"></path><path d="M327.916308 400.147692v34.343385H199.364923v44.662154h111.616v34.422154H199.364923v47.497846h128.551385v34.737231H164.391385V400.147692h163.524923zM482.461538 594.471385h-43.559384l-3.859692-5.671385-21.425231-31.507692-4.096-6.065231-4.174769 6.065231-21.661539 31.507692-4.017231 5.907692h-42.771692l4.096-5.907692 22.055385-31.507692 25.678769-36.548923-49.467077-71.837539h44.268308l25.993846 41.038769 24.497231-41.117538h42.299076L429.843692 519.876923l26.387693 37.415385 22.212923 31.507692 4.01723 5.671385zM624.246154 533.031385c-0.708923 6.065231-1.654154 11.579077-2.678154 16.620307a56.792615 56.792615 0 0 1-2.363077 7.876923 75.697231 75.697231 0 0 1-4.253538 8.979693 60.731077 60.731077 0 0 1-12.996923 15.753846 46.710154 46.710154 0 0 1-10.161231 6.459077 67.820308 67.820308 0 0 1-10.870154 4.174769 76.012308 76.012308 0 0 1-26.702769 2.599385 73.885538 73.885538 0 0 1-25.67877-6.459077h-0.630153a56.32 56.32 0 0 1-20.007385-15.753846 66.166154 66.166154 0 0 1-9.373538-15.753847 64.118154 64.118154 0 0 1-3.387077-8.979692 88.379077 88.379077 0 0 1-3.229539-31.035077 78.769231 78.769231 0 0 1 5.513846-25.442461 74.594462 74.594462 0 0 1 12.918154-21.031385 60.967385 60.967385 0 0 1 20.716308-15.753846 72.704 72.704 0 0 1 25.915077-7.089231 67.111385 67.111385 0 0 1 21.740307 1.890462 64.827077 64.827077 0 0 1 19.219693 8.270769 51.515077 51.515077 0 0 1 13.863384 12.681846 48.915692 48.915692 0 0 1 7.876923 15.123692l3.859693 12.288h-41.905231a44.898462 44.898462 0 0 0-4.489846-7.876923 22.921846 22.921846 0 0 0-5.907692-5.041231 21.425231 21.425231 0 0 0-11.027693-2.363076 32.925538 32.925538 0 0 0-12.130461 2.756923 26.072615 26.072615 0 0 0-10.555077 7.876923 36.785231 36.785231 0 0 0-6.222769 11.342769 62.227692 62.227692 0 0 0-2.284308 14.729846 54.587077 54.587077 0 0 0 1.654154 16.935385 33.555692 33.555692 0 0 0 6.222769 13.154461 25.757538 25.757538 0 0 0 8.979692 6.852923h0.630154a29.380923 29.380923 0 0 0 13.390769 2.284308 26.702769 26.702769 0 0 0 11.264-2.599385h0.472616a23.630769 23.630769 0 0 0 7.876923-7.876923 26.545231 26.545231 0 0 0 4.174769-9.294769l1.575385-7.246769zM726.646154 545.476923l-1.575385 5.671385a12.681846 12.681846 0 0 1-3.308307 6.222769 18.904615 18.904615 0 0 1-4.411077 3.702154 28.041846 28.041846 0 0 1-15.753847 4.096 36.233846 36.233846 0 0 1-15.123692-2.914462 23.630769 23.630769 0 0 1-7.404308-4.883692 18.983385 18.983385 0 0 1-3.465846-4.017231 32.137846 32.137846 0 0 1-4.647384-11.421538c-0.630154-3.702154-1.102769-7.168-1.575385-10.476308h96.964923l-0.630154-17.171692a98.067692 98.067692 0 0 0-5.513846-28.672 54.035692 54.035692 0 0 0-20.873846-25.836308 50.176 50.176 0 0 0-10.633846-5.907692 64.669538 64.669538 0 0 0-26.860308-5.356308 66.166154 66.166154 0 0 0-31.507692 7.876923 61.833846 61.833846 0 0 0-21.976616 19.219692 74.515692 74.515692 0 0 0-11.027692 22.921847 114.766769 114.766769 0 0 0-3.072 29.065846 93.420308 93.420308 0 0 0 4.883692 30.168615c0 1.260308 0.787692 2.441846 1.260308 3.702154a52.224 52.224 0 0 0 21.267692 25.757538l2.835693 1.654154A73.491692 73.491692 0 0 0 701.046154 597.307077a82.313846 82.313846 0 0 0 26.860308-3.465846 52.617846 52.617846 0 0 0 11.342769-4.962462 53.405538 53.405538 0 0 0 9.058461-6.852923 40.014769 40.014769 0 0 0 11.815385-17.880615c2.048-6.616615 3.702154-12.760615 4.883692-18.432z m-52.932923-45.213538a26.781538 26.781538 0 0 1 5.907692-10.082462 32.216615 32.216615 0 0 1 10.633846-7.876923 33.319385 33.319385 0 0 1 14.020923-2.520615 20.873846 20.873846 0 0 1 13.627077 4.883692 25.206154 25.206154 0 0 1 7.876923 9.531077A74.909538 74.909538 0 0 1 728.615385 504.123077v1.260308h-56.713847zM782.099692 399.990154h33.555693v196.056615h-33.555693z" fill="#ffffff" p-id="3244"></path></svg>
\ No newline at end of file
diff --git a/src/views/components/ImportExcelModal.vue b/src/views/components/ImportExcelModal.vue
new file mode 100644
index 0000000..9dbcb5f
--- /dev/null
+++ b/src/views/components/ImportExcelModal.vue
@@ -0,0 +1,195 @@
+<template>
+  <BasicModal
+    width="1200px"
+    :height="700"
+    v-bind="$attrs"
+    ok-text="淇濆瓨"
+    @register="register"
+    :title="t(props.title)"
+    @ok="handleSubmit"
+  >
+    <div class="high-form">
+      <p style="color: red" v-text="err"></p>
+      <BasicTable
+        v-for="(table, index) in tableListRef"
+        :key="index"
+        :title="table.title"
+        :columns="table.columns"
+        :dataSource="table.dataSource"
+      >
+        <template #toolbar>
+          <a-button @click="tmpDownload" type="primary" preIcon="tmpDownload-white|svg">
+            妯℃澘
+          </a-button>
+          <ImpExcel @success="loadDataSuccess" dateFormat="YYYY-MM-DD">
+            <a-button type="success" class="m-3" preIcon="ImportExcel-white|svg">
+              瀵煎叆Excel
+            </a-button>
+          </ImpExcel>
+        </template>
+      </BasicTable>
+    </div>
+  </BasicModal>
+</template>
+<script lang="ts" setup>
+  import { ref, unref, h } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { aoaToSheetXlsx, ImpExcel, ExcelData } from '/@/components/Excel';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  // import { useLocale } from '/@/locales/useLocale';
+  import { BasicTable } from '/@/components/Table';
+  import { ImportExcel, ValidateTableImport } from '/@/api/tigerapi/system';
+
+  const emit = defineEmits(['success', 'register', 'toExcel']);
+  const props = defineProps({
+    title: {
+      type: String,
+      default: '',
+    },
+    mtitle: {
+      type: String,
+      default: '',
+    },
+    arr: {
+      type: Array,
+      default: () => [1, 2, 3, 4],
+    },
+  });
+  // const { getLocale } = useLocale();
+  const { t } = useI18n('');
+  const { createMessage, createConfirm } = useMessage();
+  const tmpHeader = ref([]);
+  const filename = ref('');
+  const entityName = ref('');
+  const checkJson = ref('');
+  const where = ref('');
+  const typeFullName = ref('');
+  const baseColumns = ref([]);
+  const tableListRef = ref<
+    {
+      title: string;
+      columns?: any[];
+      dataSource?: any[];
+    }[]
+  >([]);
+  const [register, { setModalProps, closeModal }] = useModalInner((data) => {
+    setModalProps({ confirmLoading: false });
+    tableListRef.value = [
+      {
+        title: '鍒楄〃淇℃伅',
+        columns: [
+          {
+            title: '瀛楁1',
+            dataIndex: 'field1',
+            width: 200,
+            sorter: true,
+            resizable: true,
+          },
+          {
+            title: '瀛楁2',
+            dataIndex: 'field2',
+            width: 200,
+            sorter: true,
+            resizable: true,
+          },
+        ],
+        dataSource: [],
+      },
+    ];
+    tmpHeader.value = data.tmpHeader;
+    filename.value = data.filename;
+    baseColumns.value = data.baseColumns;
+    entityName.value = data.entityName;
+    checkJson.value = JSON.stringify(data.checkJson);
+    where.value = JSON.stringify(data.where);
+    typeFullName.value = data.typeFullName;
+  });
+  var err = ref('');
+  async function loadDataSuccess(excelDataList: ExcelData[]) {
+    tableListRef.value = [];
+
+    for (const excelData of excelDataList) {
+      const {
+        // header,
+        results,
+        meta: { sheetName },
+      } = excelData;
+
+      let dataSource = [] as any[];
+      results.map((item) => {
+        let entity = {} as any;
+        baseColumns.value.map((c) => {
+          entity[c['dataIndex']] = item[c['title']]; //c['dataIndex']=='BATCH_NO'?`${item[c['ORDER_NO']]}-01`: item[c['title']];
+        });
+        dataSource.push(entity);
+      });
+
+      tableListRef.value.push({
+        title: sheetName,
+        dataSource: dataSource,
+        columns: baseColumns.value,
+      });
+    }
+    console.log('console.log(tableListRef.value);', tableListRef.value);
+    var res = await ValidateTableImport(entityName.value, {
+      EntityJson: JSON.stringify(tableListRef.value[0].dataSource),
+      CheckJson: checkJson.value,
+      where: where.value,
+      typeFullName: typeFullName.value
+    });
+    if (res.IsSuccessed) {
+      tableListRef.value[0].dataSource = res.Data;
+      err.value = '';
+    } else {
+      tableListRef.value = [];
+      createMessage.error('瀵煎叆澶辫触' + res.Message);
+      err.value = res.Message;
+    }
+  }
+
+  /**
+   * @desc 瀵煎嚭妯℃澘
+   */
+  function tmpDownload() {
+    aoaToSheetXlsx({
+      data: '',
+      header: tmpHeader.value,
+      filename: filename.value, //'宸ュ崟鏂欑珯琛ㄤ俊鎭�.xlsx'
+    });
+  }
+
+  /**
+   * @desc 瀵煎叆鎻愪氦
+   */
+  async function handleSubmit() {
+    try {
+      const values = tableListRef.value;
+      setModalProps({ confirmLoading: true });
+      createConfirm({
+        iconType: 'warning',
+        title: () => h('span', t('瀵煎叆淇℃伅')),
+        content: () => h('span', t('纭鏈変慨鏀圭殑鏁版嵁鏄惁姝g‘锛屾湁寮傚父鐨勬暟鎹棤娉曞鍏�')),
+        onOk: async () => {
+          const apiAction = await ImportExcel(entityName.value, tableListRef.value[0]['dataSource'] as any[]);
+          if (apiAction.IsSuccessed) {
+            closeModal();
+            createMessage.success(t('瀵煎叆鎴愬姛'));
+            emit('success', {
+              isUpdate: unref(false),
+              values: { ...values, id: 0 },
+            });
+          }
+        },
+      });
+    } finally {
+      setModalProps({ confirmLoading: false });
+    }
+  }
+</script>
+<style lang="less" scoped>
+  .high-form {
+    padding: 5px 10px 10px;
+    background: #f5f9fe;
+  }
+</style>
diff --git a/src/views/tigerprojects/mes/prod/biz_mes_wo/WoModal.vue b/src/views/tigerprojects/mes/prod/biz_mes_wo/WoModal.vue
index b9d82c1..7457b83 100644
--- a/src/views/tigerprojects/mes/prod/biz_mes_wo/WoModal.vue
+++ b/src/views/tigerprojects/mes/prod/biz_mes_wo/WoModal.vue
@@ -18,7 +18,7 @@
         :dataSource="table.dataSource"
       >
         <template #toolbar>
-          <a-button @click="aoaToExcel" color="primary" preIcon="tmpDownload-white|svg">
+          <a-button @click="ToExcel" color="primary" preIcon="tmpDownload-white|svg">
             妯℃澘
           </a-button>
           <ImpExcel @success="loadDataSuccess" dateFormat="YYYY-MM-DD">
@@ -152,7 +152,7 @@
   //   v && props.userData && nextTick(() => onDataReceive(props.userData));
   // }
   //瀵煎嚭
-  function aoaToExcel() {
+  function ToExcel() {
     const arrHeader = [
       '鍏宠仈宸ュ崟鍙�',
       '浜у搧缂栫爜',
@@ -214,7 +214,7 @@
 </script>
 <style lang="less" scoped>
   .high-form {
-    padding: 5px 10px 10px 10px;
+    padding: 5px 10px 10px;
     background: #f5f9fe;
   }
 </style>
diff --git a/src/views/tigerprojects/mes/smt/smttable/index.vue b/src/views/tigerprojects/mes/smt/smttable/index.vue
index 4f611ee..702567f 100644
--- a/src/views/tigerprojects/mes/smt/smttable/index.vue
+++ b/src/views/tigerprojects/mes/smt/smttable/index.vue
@@ -17,6 +17,7 @@
               icon: 'clarity:note-edit-line',
               tooltip: '淇敼',
               onClick: handleEdit.bind(null, record),
+              name: ''
             },
             {
               icon: 'ant-design:delete-outlined',
@@ -27,6 +28,7 @@
                 placement: 'left',
                 confirm: handleDelete.bind(null, record),
               },
+              name: ''
             },
           ]"
         />
diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
index 85c5dc0..a7656bb 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts
@@ -22,6 +22,7 @@
 import { useForm } from '/@/components/Form/index';
 import { cloneDeep } from 'lodash-es';
 import { useProdRouteStore } from '/@/store/modules/prodRoute';
+import { Tag, Tooltip } from 'ant-design-vue';
 
 const { t } = useI18n();
 const { createErrorModal } = useMessage();
@@ -43,10 +44,86 @@
      * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
      * @return {*}
      */
-    CreateAction: (type: string) => {
-      return {
-        action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
-      };
+    CreateAction: (type: string, fnName: string) => {
+      let action = {} as any;
+      switch (fnName) {
+        case 'ImportExcel':
+          action = {
+            action: 'importModal', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) | modal(鎵撳紑妯℃�佺獥鍙�) | importModal(鎵撳紑瀵煎叆妯℃�佺獥鍙�)
+            params: {
+              tmpHeader: ['宸ュ崟鍙�', '璁″垝鏃ユ湡', '璁″垝鏁伴噺'], /* 涓嬭浇妯℃澘鐨勬爣棰樺瓧娈� */
+              filename: '宸ュ崟璁″垝妯℃澘.xlsx', /* 涓嬭浇妯℃澘鐨勬枃浠跺悕 */
+              entityName: 'BIZ_MES_WO_BATCH', /* 瀵煎叆琛ㄧ殑琛ㄥ悕 */
+              checkJson: ['ORDER_NO', 'PLAN_DATE', 'PLAN_QTY'], /* 瀵煎叆琛ㄩ渶瑕佹鏌ョ殑瀛楁鍒楄〃 */
+              where: ['ORDER_NO'], /* 瀵煎叆琛ㄩ渶瑕佹煡璇㈢殑瀛楁鍒楄〃 */
+              typeFullName:'Tiger.IBusiness.MES.IImportWoPlan,Tiger.IBusiness.MES', /* 瀵煎叆鐨勬柟娉曞叏鍚嶏紝閫氱敤瀵煎叆鐢ㄨ繖涓細Tiger.IBusiness.ICommonImportExcel,Tiger.IBusiness */
+              baseColumns: [ /* 瀵煎叆鏃剁晫闈㈡樉绀烘暟鎹殑瀛楁 */
+                {
+                  title: '宸ュ崟鍙�',
+                  dataIndex: 'ORDER_NO',
+                  ifShow: true,
+                  width: 180,
+                },
+                {
+                  title: '宸ュ崟鎵规鍙�',
+                  dataIndex: 'BATCH_NO',
+                  ifShow: true,
+                  width: 180,
+                  // customRender: ({ record }) => {
+                  //   record.BATCH_NO = record.ORDER_NO+'-01'
+                  //   return record.BATCH_NO
+                  // },
+                },
+                {
+                  title: '璁″垝鏃ユ湡',
+                  dataIndex: 'PLAN_DATE',
+                  ifShow: true,
+                  width: 180,
+                },
+                {
+                  title: '璁″垝鏁伴噺',
+                  dataIndex: 'PLAN_QTY',
+                  ifShow: true,
+                  width: 180,
+                },
+                {
+                  title: '澶勭悊鏂瑰紡',
+                  dataIndex: 'VALIDATION_TYPE',
+                  ifShow: true,
+                  width: 180,
+                  customRender: ({ record }) => {
+                    const status = record.VALIDATION_TYPE;
+                    var text = '';
+                    var color = 'green';
+                    if (status == '鏁版嵁寮傚父') {
+                      color = 'red';
+                      text = status;
+                    } else if (status == '淇敼') {
+                      color = 'yellow';
+                      text = status;
+                    } else {
+                      text = status;
+                    }
+                    return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text));
+                  },
+                },
+                {
+                  title: '澶勭悊缁撴灉',
+                  dataIndex: 'VALIDATION_RESULT',
+                  ifShow: true,
+                  width: 180,
+                },
+              ],
+            },
+          };
+          break;
+        default:
+          action = {
+            action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) | modal(鎵撳紑妯℃�佺獥鍙�)
+          };
+          break;
+      }
+      return action;
     },
     /**
      * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽�
@@ -262,6 +339,16 @@
           break;
       }
     },
+    /**
+     * @description: 鑾峰彇鏍囬淇℃伅
+     * @param {string} type
+     * @return {*}
+     */
+    GetTitle: () => {
+      return {
+        importTitle: '宸ュ崟璁″垝瀵煎叆', /* 鎵撳紑妯℃�佺獥鍙f樉绀虹殑鏍囬 */
+      };
+    },
   };
 
   /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
@@ -312,7 +399,7 @@
         try {
           const form = param.values['forminfo'];
           const wo = param.values['mValues'];
-          wo.STATUS = wo.STATUS == 3?wo.STATUS: 2;
+          wo.STATUS = wo.STATUS == 3 ? wo.STATUS : 2;
           let input: SaveWoBatchInput = {
             Wo: wo,
             WoBatch: {
@@ -348,7 +435,7 @@
               ACT_END_TIME: wo.ACT_END_TIME,
               BATCH_NO: '',
             },
-            IfToCust: form.IfToCust
+            IfToCust: form.IfToCust,
           };
           SaveMesBatchWo(input).then((action) => {
             resolve(action);
@@ -402,15 +489,22 @@
       Name: 'WoRouteBinding',
       CODE: params['record'].ORDER_NO,
       Title: `宸ュ崟[${params['record'].ORDER_NO}]宸ヨ壓缁戝畾`,
-      colSlots: params['colSlots'].value, /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */
-      crudColSlots: {BAS_PKG_DTL:['BAS_LABEL_TEMP1add'], ItemCode: ['BAS_CODE_RULE1add']} /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
-      OtherTableName: ['BAS_PKG_DTL', 'ItemCode'], /* 鑷畾涔夋樉绀哄垪琛ㄧ殑琛ㄥ悕锛岃窡涓婇潰澧炲垹鏀圭殑琛ㄥ悕涓�鑷达紝鏈夊涓氨鏀惧垪琛ㄤ腑 */
+      colSlots:
+        params['colSlots'].value /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
+      crudColSlots: {
+        BAS_PKG_DTL: ['BAS_LABEL_TEMP1add'],
+        ItemCode: ['BAS_CODE_RULE1add'],
+      } /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */,
+      OtherTableName: [
+        'BAS_PKG_DTL',
+        'ItemCode',
+      ] /* 鑷畾涔夋樉绀哄垪琛ㄧ殑琛ㄥ悕锛岃窡涓婇潰澧炲垹鏀圭殑琛ㄥ悕涓�鑷达紝鏈夊涓氨鏀惧垪琛ㄤ腑 */,
       dense: true,
       pageTitle: `宸ュ崟宸ヨ壓缁戝畾`,
       pageContent: `杩欓噷鏄鐞嗗伐鍗曠殑宸ヨ壓缁戝畾锛屼竴涓伐鍗曞彲浠ョ粦瀹氫竴涓伐鑹鸿矾绾匡紝骞跺彲浠ヤ繚瀛樹负瀹㈡埛涓撶敤鐨勫伐鑹鸿矾绾縛,
       SessionName: 'WoRouteBinding_update',
       ifSave: false,
-      rotType: 'Wo'
+      rotType: 'Wo',
     };
     // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
     sessionStorage.removeItem(`${id.SessionName}_params`);
diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
index ad98fbf..b2920ca 100644
--- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
+++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -66,6 +66,7 @@
       </CustModal>
     </Suspense>
     <normalDrawer @register="registerDrawer" @success="handleSuccess" />
+    <ImportExcelModal @register="registerImport" :title="ImportTitle" />
   </div>
 </template>
 <script lang="ts" setup>
@@ -77,6 +78,7 @@
   import normalDrawer from '../normalDrawer.vue';
   import CustModal from '/@/views/components/CustModal.vue';
   import RouteViewModal from '/@/views/components/RouteViewModal.vue';
+  import ImportExcelModal from '/@/views/components/ImportExcelModal.vue';
   import { FlowChartView } from '/@/components/FlowChart';
   import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
   import { useModal } from '/@/components/Modal';
@@ -117,6 +119,7 @@
   const [registerRv, { openModal: openRvModal, closeModal: RvcloseModal }] = useModal();
   const [registerCust, { openModal: openCustModal }] = useModal();
   const [registerCrud, { openModal: openCrudModal }] = useModal();
+  const [registerImport, { openModal: openImportModal }] = useModal();
   const cType = ref('');
   const formSchemas = ref({}); //寮瑰嚭妗嗗琛ㄥ崟缁撴瀯
   const routeData = ref({
@@ -151,6 +154,7 @@
       OpenSelectItem: OpenSelectCust,
       GetSelectSuccess,
       CustFunc,
+      GetTitle,
     },
     ActionColumn,
   ] = isNullOrUnDef(custImport.value['default'])
@@ -161,6 +165,7 @@
     ? {}
     : KeyFieldValues(objParams.value['CODE'], objParams.value['ID']);
   const dtlSlots = ref<any[]>([]);
+  const ImportTitle = GetTitle && isFunction(GetTitle)? ref(GetTitle().importTitle): ref('');
   const useformdata = GetUseForm && isFunction(GetUseForm) ? GetUseForm() : {};
   const useFormData = ref<any>(useformdata);
   /* 鑷畾涔夋ā鎬佺獥鍙d腑琛ㄥ崟涓彃妲芥覆鏌撴寜閽墦寮�妯℃�佹useModal鏂规硶 */
@@ -345,7 +350,7 @@
   }
 
   /**
-   * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
+   * @description: 鑾峰彇宸ュ叿鏍忎腑鎸夐挳鐨勮涓�
    * @return {*}
    */
   function handleCreate(fnName: string) {
@@ -362,7 +367,7 @@
     } else {
       /* 濡傛灉鍔ㄦ�佸姞杞界殑瀹炰綋绫�.ts瀛樺湪锛屾牴鎹�.ts鏂囦欢涓殑鏂规硶鏉ユ墽琛屾搷浣� */
       const [{ CreateAction }] = custImport.value['default']();
-      const result = CreateAction(entityName.value, colSlots.value);
+      const result = CreateAction(entityName.value, fnName);
       switch (result.action) {
         case 'go' /* 璺宠浆椤甸潰 */:
           // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
@@ -384,6 +389,9 @@
             ifSave: true, //鏄惁鎻愪氦琛ㄥ崟鏃朵繚瀛樺埌鏁版嵁搴擄紝鍚�-鏆傚瓨|鏄�-淇濆瓨
           });
           break;
+        case 'importModal' /* 鎵撳紑瀵煎叆Excel妯℃�佺獥鍙� */:
+          openImportModal(true, result.params);
+          break;
       }
     }
   }
diff --git a/src/views/tigerprojects/wms/wms_item/index.vue b/src/views/tigerprojects/wms/wms_item/index.vue
index 80ecb72..a60949d 100644
--- a/src/views/tigerprojects/wms/wms_item/index.vue
+++ b/src/views/tigerprojects/wms/wms_item/index.vue
@@ -68,12 +68,12 @@
     canResize: true,
     bordered: true,
     showIndexColumn: false,
-    actionColumn: {
-      width: 80,
-      title: '鎿嶄綔',
-      dataIndex: 'action',
-      slots: { customRender: 'action' },
-    },
+    // actionColumn: {
+    //   width: 80,
+    //   title: '鎿嶄綔',
+    //   dataIndex: 'action',
+    //   slots: { customRender: 'action' },
+    // },
     searchInfo: { ITEM_CODE },
   });
   const { setTitle } = useTabs();
diff --git a/src/views/tigerprojects/wms/wms_item/wms_item.data.ts b/src/views/tigerprojects/wms/wms_item/wms_item.data.ts
index d6bb928..ba838ce 100644
--- a/src/views/tigerprojects/wms/wms_item/wms_item.data.ts
+++ b/src/views/tigerprojects/wms/wms_item/wms_item.data.ts
@@ -163,6 +163,7 @@
     title: '渚涘簲鍟嗘壒娆″彿',
     dataIndex: 'SUPP_LOTNO',
     resizable: true,
+    fixed: 'right'
   },
   {
     title: '鎵规鍙�',

--
Gitblit v1.9.3