From 20913c80c3f5fc8e533cb92b90e6f20bcd68e032 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期三, 29 十一月 2023 17:49:32 +0800
Subject: [PATCH] feat: 1、优化导入 2、部门物品台账查询对接

---
 admin-web/src/views/departmentitem/ledgerquy/ledQuy/index.vue |  142 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 90 insertions(+), 52 deletions(-)

diff --git a/admin-web/src/views/departmentitem/ledgerquy/ledQuy/index.vue b/admin-web/src/views/departmentitem/ledgerquy/ledQuy/index.vue
index 793de65..bd7ea12 100644
--- a/admin-web/src/views/departmentitem/ledgerquy/ledQuy/index.vue
+++ b/admin-web/src/views/departmentitem/ledgerquy/ledQuy/index.vue
@@ -16,6 +16,11 @@
         </el-card>
       </el-container>
     </el-container>
+    <my-import
+        :import-setting="importSetting"
+        :dialog-show="importSetting.dialogShow"
+        :dialog-title="importSetting.dialogTitle"
+    />
   </div>
 </template>
 
@@ -24,11 +29,14 @@
 import MyButton from '@/components/myButton/myButton';
 import SettingIplatform from '@/utils/settingIplatform';
 import * as finsystenant from '@/api/baseSetting/finsystenant';
-import { getBaseUrl } from '@/utils/base';
+import myImport from '@/views/components/myImport';
+import {getBaseUrl} from '@/utils/base';
+import * as DateFormatter from '@/utils/DateFormatter';
+import stockType from '@/utils/stockType'
 
 export default {
   name: 'index',
-  components: { MyButton, MyTableV2 },
+  components: { MyButton, MyTableV2, myImport },
   data() {
     return {
       // 鎼滅储妗�
@@ -38,61 +46,71 @@
           dataIndex: 'agencyId',
           label: '鏈烘瀯',
           placeholder: '璇烽�夋嫨',
+          defaultValue: '',
+          options: [],
+          cascader: [
+            { key: 'inWarehouseId', queryKey: 'tenantId' },
+            { key: 'goodsTemplateId', queryKey: 'agencyId' },
+          ],
           optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
+        },
+        {
+          type: 'select',
+          dataIndex: 'inWarehouseId',
+          label: '閮ㄩ棬',
+          placeholder: '璇烽�夋嫨',
+          optionsConfig: {
+            url: `/pc/fin/sys/tenant/department/list/all`,
+            label: 'name',
+            value: 'id',
+          },
           defaultValue: '',
           options: [],
         },
         {
           type: 'select',
-          dataIndex: 'name',
-          label: '閮ㄩ棬',
-          placeholder: '璇疯緭鍏�',
-          defaultValue: '',
-          options: [],
-        },
-        {
-          type: 'text',
-          dataIndex: 'name',
+          dataIndex: 'goodsTemplateId',
           label: '鐗╁搧鍚嶇О',
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
+          options: [],
+          cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }],
+          optionsConfig: {
+            label: 'goodsName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
+          },
         },
         {
           type: 'select',
-          dataIndex: 'name',
+          dataIndex: 'baseGoodsModelsId',
           label: '瑙勬牸鍨嬪彿',
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
           options: [],
+          optionsConfig: {
+            label: 'modelName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel',
+          },
         },
         {
           type: 'select',
-          dataIndex: 'status',
+          dataIndex: 'flowType',
           label: '绫诲瀷',
           placeholder: '璇烽�夋嫨',
-          defaultValue: '1',
-          options: [
-            {
-              label: '鍚敤',
-              value: '1',
-            },
-            {
-              label: '绂佺敤',
-              value: '0',
-            },
-          ],
-        },
-        {
-          type: 'text',
-          dataIndex: 'name',
-          label: '鍗曞彿',
-          placeholder: '璇疯緭鍏�',
           defaultValue: '',
+          options: [],
+          optionsConfig: {
+            label: 'dict_label',
+            value: 'dict_value',
+            url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/FLOW_TYPE',
+          },
         },
         {
           type: 'text',
-          dataIndex: 'name',
-          label: '鎿嶄綔浜�',
+          dataIndex: 'businessFormCode',
+          label: '鍗曞彿',
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
         },
@@ -118,6 +136,24 @@
         userPhone: null,
         status: 1,
       },
+      // 瀵煎叆
+      importSetting: {
+        dialogTitle: '瀵煎叆',
+        dialogShow: false,
+        fileSettings: {
+          data: {},
+          uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // 涓婁紶鍦板潃
+          accept: '.xls', // 鏍煎紡
+          type: 'text', // 鍥炴樉褰㈠紡
+          loading: false, // 瀵煎叆鏁堟灉
+        },
+        /* 妯℃澘涓嬭浇 */
+        templateSettings: {
+          templateName: '瀵煎叆妯℃澘.xls', // 鍚嶇О
+          templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // 涓嬭浇鍦板潃
+        },
+        onSuccess: null,
+      },
       editSetting: {
         title: '',
         id: '',
@@ -128,7 +164,7 @@
       table: {
         showIndex: true, // 鏄惁鏄剧ず搴忓彿
         expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁
-        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 璇锋眰鍦板潃
+        url: SettingIplatform.apiBaseURL + '/pc/warehouse/flow/getTaiZhangList', // 璇锋眰鍦板潃
         // 宸ュ叿鏉�
         tools: {
           columnsCtrl: {
@@ -137,36 +173,40 @@
           },
           generalExport: {
             // 閫氱敤瀵煎嚭鎸夐挳
-            show: true,
+            show: false,
           },
           // 鑷畾涔夊伐鍏锋潯鎸夐挳
           custom: [],
         },
         // 鍒椾俊鎭�
         columns: [
-          { title: '鏈烘瀯', field: 'name', align: 'left' },
-          { title: '閮ㄩ棬', field: 'code', align: 'center' },
-          { title: '鐗╁搧鍚嶇О', field: 'lv', align: 'center' },
-          { title: '瑙勬牸鍨嬪彿', field: 'lv', align: 'center' },
-          { title: '绫诲瀷', field: 'summary', align: 'left' },
-          { title: '鍗曞彿', field: 'summary', align: 'left' },
-          { title: '鏁伴噺', field: 'summary', align: 'left' },
-          { title: '鎿嶄綔鍓嶆暟閲�', field: 'summary', align: 'left' },
-          { title: '鎿嶄綔鍚庢暟閲�', field: 'summary', align: 'left' },
+          { title: '鏈烘瀯', field: 'agencyName', align: 'left', width: 130 },
+          { title: '閮ㄩ棬', field: 'departName', align: 'left', width: 130 },
+          { title: '鐗╁搧鍚嶇О', field: 'goodsTemplateName', align: 'left', minWidth: 130 },
+          { title: '瑙勬牸鍨嬪彿', field: 'baseGoodsModelsName', align: 'left', width: 130 },
+          {
+            title: '绫诲瀷',
+            field: 'summary',
+            align: 'center',
+            formatter: (row) => {
+              let result = stockType(row)
+              return { value: result };
+            },
+          },
+          { title: '鍗曞彿', field: 'businessFormCode', align: 'center', width: 130 },
+          { title: '鏁伴噺', field: 'thisCount', align: 'center', width: 100 },
+          { title: '鎿嶄綔鍓嶆暟閲�', field: 'initialCount', align: 'center', width: 100 },
+          { title: '鎿嶄綔鍚庢暟閲�', field: 'endCount', align: 'center', width: 100 },
           {
             title: '鎿嶄綔鏃堕棿',
-            field: 'summary',
-            align: 'left',
+            field: 'dealTime',
+            align: 'center',
             width: 160,
             formatter: (row) => {
-              return { value: DateFormatter.LongToDateTime(row.procureTime) };
+              return { value: DateFormatter.LongToDateTime(row.dealTime) };
             },
           },
         ],
-        // 鎿嶄綔淇℃伅
-        operation: {
-          show: false // 鏄剧ず鎿嶄綔鍒�
-        },
         paging: {
           show: true, // 鏄剧ず鍒嗛〉
           // 鍒嗛〉淇℃伅
@@ -197,5 +237,3 @@
   },
 };
 </script>
-
-<style scoped></style>

--
Gitblit v1.9.1