From 13b0bad30ef1df53492cbab1c1b99dfc02dee63f Mon Sep 17 00:00:00 2001
From: haoyahui <2032914783@qq.com>
Date: 星期二, 21 十一月 2023 17:51:16 +0800
Subject: [PATCH] 台账管理,盘点任务开发

---
 admin-web/src/views/stock/ledger/ledgerQuery/index.vue |  152 +++++++++++++++++++++++++++-----------------------
 1 files changed, 83 insertions(+), 69 deletions(-)

diff --git a/admin-web/src/views/stock/ledger/ledgerQuery/index.vue b/admin-web/src/views/stock/ledger/ledgerQuery/index.vue
index 89c5be4..59c1aac 100644
--- a/admin-web/src/views/stock/ledger/ledgerQuery/index.vue
+++ b/admin-web/src/views/stock/ledger/ledgerQuery/index.vue
@@ -33,6 +33,7 @@
 import { getBaseUrl } from '@/utils/base';
 import { getCategorySelectTree, goodsModel } from '@/api/baseSetting/finsystenant';
 import { getDicts } from '@/api/system/dict/data';
+import * as DateFormatter from '@/utils/DateFormatter';
 
 export default {
   name: 'index',
@@ -46,40 +47,66 @@
           dataIndex: 'agencyId',
           label: '鏈烘瀯',
           placeholder: '璇烽�夋嫨',
-          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
           defaultValue: '',
           options: [],
+          cascader: [
+            { key: 'warehouseId', queryKey: 'agencyId' },
+            { key: 'goodsTemplateId', queryKey: 'agencyId' },
+          ],
+          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
         },
         {
-          type: 'text',
-          dataIndex: 'name',
+          type: 'select',
+          dataIndex: 'warehouseId',
+          label: '浠撳簱',
+          placeholder: '璇烽�夋嫨',
+          defaultValue: '',
+          options: [],
+          optionsConfig: {
+            label: 'warehouseName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse',
+          },
+        },
+        {
+          type: 'select',
+          dataIndex: 'goodsTemplateId',
           label: '鐗╁搧鍚嶇О',
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
+          options: [],
+          cascader: [{ key: 'categoryId', queryKey: 'goodsTemplatesId' }],
+          optionsConfig: {
+            label: 'goodsName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
+          },
         },
         {
           type: 'select',
-          dataIndex: 'status',
+          dataIndex: 'baseGoodsModelsId',
           label: '瑙勬牸鍨嬪彿',
-          placeholder: '璇烽�夋嫨',
+          placeholder: '璇疯緭鍏�',
           defaultValue: '',
           options: [],
+          optionsConfig: {
+            label: 'modelName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel',
+          },
         },
         {
           type: 'select',
-          dataIndex: 'status',
-          label: '鍒嗙被',
+          dataIndex: 'flowType',
+          label: '绫诲瀷',
           placeholder: '璇烽�夋嫨',
           defaultValue: '',
           options: [],
-        },
-        {
-          type: 'select',
-          dataIndex: 'status',
-          label: '绫诲埆',
-          placeholder: '璇烽�夋嫨',
-          defaultValue: '',
-          options: [],
+          optionsConfig: {
+            label: 'dict_label',
+            value: 'dict_value',
+            url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/FLOW_TYPE',
+          },
         },
         {
           type: 'text',
@@ -89,16 +116,9 @@
           defaultValue: '',
         },
         {
-          type: 'text',
-          dataIndex: 'name',
-          label: '鎿嶄綔浜�',
-          placeholder: '璇疯緭鍏�',
-          defaultValue: '',
-        },
-        {
           type: 'date-picker',
           dataIndex: 'val1',
-          label: '鍑哄簱鏃堕棿',
+          label: '鏃堕棿',
           defaultValue: '',
         },
         {
@@ -145,7 +165,7 @@
       table: {
         showIndex: true, // 鏄惁鏄剧ず搴忓彿
         expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁
-        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 璇锋眰鍦板潃
+        url: SettingIplatform.apiBaseURL + '/pc/warehouse/flow/getTaiZhangList', // 璇锋眰鍦板潃
         // 宸ュ叿鏉�
         tools: {
           columnsCtrl: {
@@ -165,13 +185,44 @@
           { title: '浠撳簱', field: 'warehouseName', align: 'center' },
           { title: '鐗╁搧鍚嶇О', field: 'goodsTemplateName', align: 'center' },
           { title: '瑙勬牸鍨嬪彿', field: 'baseGoodsModelsName', align: 'center' },
-          { title: '绫诲瀷', field: 'summary', align: 'left' },
-          { title: '鍗曞彿', field: 'summary', align: 'left' },
-          { title: '鏁伴噺', field: 'counts', align: 'left' },
-          { 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',
+            formatter: (row) => {
+              let result = '';
+              let arr = ['閲囪喘鍏ュ簱', '璋冩嫧', '鍏朵粬鍑哄簱', '閮ㄩ棬鍒嗗彂', '鎶ュ簾鍑哄簱', '閮ㄩ棬鐗╁搧鍥為��浠撳簱', '鐗╁搧鐩樼偣'];
+              if (row.businessType == 7) {
+                if (this.thisType == 1) {
+                  result = '鐩樼泩鍏ュ簱';
+                } else {
+                  result = '鐩樹簭鍑哄簱';
+                }
+              }else if(this.businessType == 2) {
+                if (this.thisType == 1) {
+                  result = '璋冩嫧鍏ュ簱';
+                } else {
+                  result = '璋冩嫧鍑哄簱';
+                }
+              }else {
+                result = arr[row.businessType - 1];
+              }
+              return { value: result };
+            },
+          },
+          { title: '鍗曞彿', field: 'businessFormCode', align: 'left' },
+          { title: '鏁伴噺', field: 'thisCount', align: 'left' },
+          { title: '鎿嶄綔鍓嶆暟閲�', field: 'initialCount', align: 'left' },
+          { title: '鎿嶄綔鍚庢暟閲�', field: 'endCount', align: 'left' },
+          { title: '鍦ㄩ��', field: 'zaiTuCount', align: 'left' },
+          {
+            title: '鎿嶄綔鏃堕棿',
+            field: 'dealTime',
+            align: 'left',
+            formatter: (row) => {
+              return { value: DateFormatter.LongToDateTime(row.dealTime) };
+            },
+          },
         ],
         paging: {
           show: true, // 鏄剧ず鍒嗛〉
@@ -186,45 +237,8 @@
       },
     };
   },
-  created() {
-    this.initQuery();
-  },
+  created() {},
   methods: {
-    initQuery() {
-      goodsModel().then((res) => {
-        this.items.forEach((v) => {
-          if (v.label == '瑙勬牸鍨嬪彿') {
-            v.options = res.map((item) => {
-              item.label = item.modelName;
-              item.vlaue = item.id;
-              return item;
-            });
-          }
-        });
-      });
-      getDicts('GOODS_PRICE').then((res) => {
-        this.items.forEach((v) => {
-          if (v.label == '绫诲埆') {
-            v.options = res.map((v) => {
-              v.label = v.dict_label;
-              v.value = v.dict_value;
-              return v;
-            });
-          }
-        });
-      });
-      getCategorySelectTree().then((res) => {
-        this.items.forEach((v) => {
-          if (v.label == '鍒嗙被') {
-            v.options = res.map((item) => {
-              item.label = item.label;
-              item.vlaue = item.id;
-              return item;
-            });
-          }
-        });
-      });
-    },
     del(row) {
       this.$modal
         .confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.name + '"鐨勬満鏋勫悧锛�')

--
Gitblit v1.9.1