From ec0d91353b767f089fa72f3cd1eb62568852710b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 22 八月 2024 10:39:30 +0800
Subject: [PATCH] 工单管理增加取消下发功能

---
 src/views/tigerprojects/mes/smt/solder/smt_solder/index.vue |  231 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 115 insertions(+), 116 deletions(-)

diff --git a/src/views/tigerprojects/mes/smt/solder/smt_solder/index.vue b/src/views/tigerprojects/mes/smt/solder/smt_solder/index.vue
index 36c4960..59aea9d 100644
--- a/src/views/tigerprojects/mes/smt/solder/smt_solder/index.vue
+++ b/src/views/tigerprojects/mes/smt/solder/smt_solder/index.vue
@@ -2,16 +2,18 @@
   <div>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button color="primary" @click="solderAdd"> 鏂板 </a-button>
+        <a-button color="primary" @click="solderAdd" preIcon="add_02|svg"> 鏂板 </a-button>
       </template>
       <template #action="{ record }">
-        <TableAction :actions="[
-          {
-            icon: 'clarity:info-standard-line',
-            tooltip: '鎶ュ簾',
-            onClick: handleEdit.bind(null, record),
-          },
-        ]" />
+        <TableAction
+          :actions="[
+            {
+              icon: 'clarity:info-standard-line',
+              tooltip: '鎶ュ簾',
+              onClick: handleEdit.bind(null, record),
+            },
+          ]"
+        />
       </template>
     </BasicTable>
     <Loading :loading="compState.loading" :tip="compState.tip" />
@@ -20,117 +22,114 @@
   </div>
 </template>
 <script lang="ts" setup>
-import { reactive } from 'vue';
-import { aoaToSheetXlsx } from '/@/components/Excel';
-import { BasicTable, useTable, TableAction } from '/@/components/Table';
-import SolderModal from './SolderModal.vue';
-import { useModal } from '/@/components/Modal';
-import { columns, searchFormSchema } from './smt_solder.data';
-import { getsolderListByPage } from '/@/api/tigerapi/mes/smt/solder';
-import { useGo } from '/@/hooks/web/usePage';
-import { Loading } from '/@/components/Loading';
-import { useMessage } from '/@/hooks/web/useMessage';
-import { useI18n } from '/@/hooks/web/useI18n';
-import { SaveSolder } from '/@/api/tigerapi/mes/smt/solder';
+  import { reactive } from 'vue';
+  import { aoaToSheetXlsx } from '/@/components/Excel';
+  import { BasicTable, useTable, TableAction } from '/@/components/Table';
+  import SolderModal from './SolderModal.vue';
+  import { useModal } from '/@/components/Modal';
+  import { columns, searchFormSchema } from './smt_solder.data';
+  import { getsolderListByPage, SaveSolder } from '/@/api/tigerapi/mes/smt/solder';
+  import { useGo } from '/@/hooks/web/usePage';
+  import { Loading } from '/@/components/Loading';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useI18n } from '/@/hooks/web/useI18n';
 
-const { t } = useI18n();
-const { createMessage } = useMessage();
-const go = useGo();
-const compState = reactive({
-  absolute: false,
-  loading: false,
-  tip: '鍔犺浇涓�...',
-});
-const [registerSolder, { openModal: openSolderModal }] = useModal();
-const [registerTable,{getForm,getPaginationRef,reload}] = useTable({
-  title: '閿¤啅鑳舵按淇℃伅',
-  api: getsolderListByPage,
-  columns,
-  formConfig: {
-    labelWidth: 120,
-    schemas: searchFormSchema,
-  },
-  actionColumn: {
-    width: 80,
-    title: '鎿嶄綔',
-    dataIndex: 'action',
-    slots: { customRender: 'action' },
-    fixed: 'right', //undefined,
-  },
-  ellipsis:true,
-  useSearchForm: true,
-  showTableSetting: false,
-  bordered: true,
-  showIndexColumn: false,
-});
-let arr: any[] = [];
-//瀵煎嚭
-// function aoaToExcel() {
-//   const totals = getPaginationRef().total
-//   if (totals < 30000) {
-//     arr = [];
-//     compState.loading = true;
-//     const col = getForm().getFieldsValue()
-//     getWmsItemSumByPage(col).then((res) => {
-//       res.items.forEach(element => {
-//         arr.push({
-//           '浠撳簱': element.WH_CODE,
-//           '鐗╂枡浠g爜': element.ITEM_CODE,
-//           '鐗╂枡鍚嶇О': element.ITEM_NAME,
-//           '鏁伴噺': element.ZK_QTY,
-//           '鍗曚綅': element.UNIT
-//         });
-//       });
-//       const arrHeader = columns.map((column) => column.title);
-//       const arrData = arr.map((item) => {
-//         return Object.keys(item).map((key) => item[key]);
-//       });
-//       // 淇濊瘉data椤哄簭涓巋eader涓�鑷�
-//       if(arr.length<30000){
-//         aoaToSheetXlsx({
-//         data: arrData,
-//         header: arrHeader,
-//         filename: '姹囨�绘姤琛�.xlsx',
-//       });
-//       }else{
-//         createMessage.error(t('瀵煎嚭鏁版嵁涓嶈兘瓒呰繃涓変竾鏉★紝濡傞渶瑕佹洿澶氱殑璇疯仈绯荤鐞嗗憳'));
-//       }
-      
-//       compState.loading = false;
-
-//     })
-
-//   } else {
-//     createMessage.error(t('瀵煎嚭鏁版嵁涓嶈兘瓒呰繃涓変竾鏉★紝濡傞渶瑕佹洿澶氱殑璇疯仈绯荤鐞嗗憳'));
-//   }
-
-
-// }
-//璺宠浆鍒板疄鏃跺簱瀛�
-function handleEdit(record: any) {
-  //璺宠浆椤甸潰
-  //go('/WmsItem/' + record.ITEM_CODE);
-  const apiAction = SaveSolder(record, true);
-  apiAction.then((action) => {
-    if (action) {
-      if (action.IsSuccessed) {
-        createMessage.success(t('宸叉姤搴熸垚鍔�'));
-      }
-    } else {
-      createMessage.error(action.Message);
-    }
+  const { t } = useI18n();
+  const { createMessage } = useMessage();
+  const go = useGo();
+  const compState = reactive({
+    absolute: false,
+    loading: false,
+    tip: '鍔犺浇涓�...',
   });
+  const [registerSolder, { openModal: openSolderModal }] = useModal();
+  const [registerTable, { getForm, getPaginationRef, reload }] = useTable({
+    title: '閿¤啅鑳舵按淇℃伅',
+    api: getsolderListByPage,
+    columns,
+    formConfig: {
+      labelWidth: 120,
+      schemas: searchFormSchema,
+    },
+    actionColumn: {
+      width: 80,
+      title: '鎿嶄綔',
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+      fixed: 'right', //undefined,
+    },
+    ellipsis: true,
+    useSearchForm: true,
+    showTableSetting: true,
+    bordered: true,
+    showIndexColumn: false,
+  });
+  let arr: any[] = [];
+  //瀵煎嚭
+  // function aoaToExcel() {
+  //   const totals = getPaginationRef().total
+  //   if (totals < 30000) {
+  //     arr = [];
+  //     compState.loading = true;
+  //     const col = getForm().getFieldsValue()
+  //     getWmsItemSumByPage(col).then((res) => {
+  //       res.items.forEach(element => {
+  //         arr.push({
+  //           '浠撳簱': element.WH_CODE,
+  //           '鐗╂枡浠g爜': element.ITEM_CODE,
+  //           '鐗╂枡鍚嶇О': element.ITEM_NAME,
+  //           '鏁伴噺': element.ZK_QTY,
+  //           '鍗曚綅': element.UNIT
+  //         });
+  //       });
+  //       const arrHeader = columns.map((column) => column.title);
+  //       const arrData = arr.map((item) => {
+  //         return Object.keys(item).map((key) => item[key]);
+  //       });
+  //       // 淇濊瘉data椤哄簭涓巋eader涓�鑷�
+  //       if(arr.length<30000){
+  //         aoaToSheetXlsx({
+  //         data: arrData,
+  //         header: arrHeader,
+  //         filename: '姹囨�绘姤琛�.xlsx',
+  //       });
+  //       }else{
+  //         createMessage.error(t('瀵煎嚭鏁版嵁涓嶈兘瓒呰繃涓変竾鏉★紝濡傞渶瑕佹洿澶氱殑璇疯仈绯荤鐞嗗憳'));
+  //       }
 
-}
-function solderAdd(){
-  //alert("鏂板")
-  openSolderModal(true, {
-        data: 'content',
-        info: 'Info',
+  //       compState.loading = false;
+
+  //     })
+
+  //   } else {
+  //     createMessage.error(t('瀵煎嚭鏁版嵁涓嶈兘瓒呰繃涓変竾鏉★紝濡傞渶瑕佹洿澶氱殑璇疯仈绯荤鐞嗗憳'));
+  //   }
+
+  // }
+  //璺宠浆鍒板疄鏃跺簱瀛�
+  function handleEdit(record: any) {
+    //璺宠浆椤甸潰
+    //go('/WmsItem/' + record.ITEM_CODE);
+    const apiAction = SaveSolder(record, true);
+    apiAction.then((action) => {
+      if (action) {
+        if (action.IsSuccessed) {
+          createMessage.success(t('宸叉姤搴熸垚鍔�'));
+        }
+      } else {
+        createMessage.error(action.Message);
+      }
     });
-}
+  }
+  function solderAdd() {
+    //alert("鏂板")
+    openSolderModal(true, {
+      data: 'content',
+      info: 'Info',
+    });
+  }
 
-function handleSuccess() {
-  reload();
-}
+  function handleSuccess() {
+    reload();
+  }
 </script>

--
Gitblit v1.9.3