From 9bb18084093bdc0dabb614420d09e54c710d9b46 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期二, 28 十一月 2023 14:34:45 +0800
Subject: [PATCH] feat: 出入库明细对接

---
 admin-web/src/views/stock/transfer/transferApplication/index.vue |   82 +++++++++++++++++++---------------------
 1 files changed, 39 insertions(+), 43 deletions(-)

diff --git a/admin-web/src/views/stock/transfer/transferApplication/index.vue b/admin-web/src/views/stock/transfer/transferApplication/index.vue
index 64f853c..8e1a11a 100644
--- a/admin-web/src/views/stock/transfer/transferApplication/index.vue
+++ b/admin-web/src/views/stock/transfer/transferApplication/index.vue
@@ -12,7 +12,7 @@
             <div class="table-tool-bar" style="margin-bottom: 15px">
               <my-button name="璋冩嫧鐢宠" icon="el-icon-plus" @click="handleAdd" site="tools" size="medium" />
             </div>
-            <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading">
+            <div :style="{ 'overflow-y': 'auto', height: 'calc(100vh - 352px)' }" v-loading="loading">
               <el-row v-if="list.length" class="card" :gutter="5">
                 <el-col v-for="(item, index) in list" :key="index" class="cm-item">
                   <el-card class="card-data">
@@ -62,9 +62,7 @@
                         <div class="box">
                           <span class="span-two">鐢宠璋冩嫧鏃堕棿锛�</span>{{ item.createTime | formatTime }}
                         </div>
-                        <div class="box">
-                          <span class="span-two">鎺ユ敹鏃堕棿锛�</span>{{ item.inTime | formatTime }}
-                        </div>
+                        <div class="box"><span class="span-two">鎺ユ敹鏃堕棿锛�</span>{{ item.inTime | formatTime }}</div>
                       </div>
                       <div class="one-hed">
                         <div class="box"><span class="span-two">璋冩嫧鏈烘瀯锛�</span>{{ item.outAgencyName }}</div>
@@ -131,6 +129,7 @@
 import listPage from '../../../mixins/listPage';
 import transfer from '../../../mixins/transfer';
 import { commonsApi } from '@/api/commonsApi';
+import SettingIplatform from '@/utils/settingIplatform';
 
 export default {
   name: 'index',
@@ -151,29 +150,17 @@
           defaultValue: '',
         },
         {
-          type: 'text',
-          dataIndex: 'goodsTemplateName',
+          type: 'select',
+          dataIndex: 'goodsTemplateId',
           label: '鐗╁搧鍚嶇О',
-          placeholder: '鍙ā绯婃悳绱�',
-          defaultValue: '',
-        },
-        {
-          type: 'cascader',
-          dataIndex: 'outAgencyId',
-          label: '璋冩嫧鏈烘瀯',
-          placeholder: '璇烽�夋嫨',
-          optionsConfig: { url: commonsApi.cascader_tree_fin_tenant, props: null },
+          placeholder: '璇疯緭鍏�',
           defaultValue: '',
           options: [],
-        },
-        {
-          type: 'cascader',
-          dataIndex: 'inAgencyId',
-          label: '鎺ユ敹鏈烘瀯',
-          placeholder: '璇烽�夋嫨',
-          optionsConfig: { url: commonsApi.cascader_tree_fin_tenant, props: null },
-          defaultValue: '',
-          options: [],
+          optionsConfig: {
+            label: 'goodsName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
+          },
         },
         {
           type: 'select',
@@ -208,14 +195,13 @@
           defaultValue: '',
         },
       ],
-      filterFrom:{
-      }
+      filterFrom: {},
     };
   },
   created() {
     this.filterFrom = {
-      operatorId:this.userInfo.id
-    }
+      inAgencyId: this.userInfo.tenantId,
+    };
     this.fetchData();
     this.items.map((v) => {
       if (v.label == '鐘舵��') {
@@ -238,33 +224,43 @@
         console.log(this.list);
       });
     },
-    
+
     // 鍏ュ簱
     handleIncome(row) {
-      this.$confirm(`鎮ㄧ‘瀹� 鍗曞彿锛�${row.businessFormCode}  璋冩嫧鍑哄簱鍚�?`, '璋冩嫧鍑哄簱').then(() => {
-        transfeIncome({ id: row.id })
-          .then((res) => {
-            this.$message.success('璋冩嫧鍑哄簱鎴愬姛锛�');
-            this.search(1);
-          })
+      this.$confirm(`鎮ㄧ‘瀹� 鍗曞彿锛�${row.businessFormCode}  鎺ユ敹鍏ュ簱鍚�?`, '鎺ユ敹鍏ュ簱', {
+        beforeClose: (action, instance, done) => {
+          if (action == 'confirm') {
+            instance.confirmButtonLoading = true;
+            instance.confirmButtonText = '鎵ц涓�...';
+            transfeIncome({ id: row.id })
+              .then((res) => {
+                this.$message.success('鎺ユ敹鍏ュ簱鎴愬姛锛�');
+                done();
+                instance.confirmButtonLoading = false;
+                this.search(1);
+              })
+              .catch(() => {
+                done();
+              });
+          } else {
+            done();
+          }
+        },
       });
     },
 
     // 瀵煎嚭
     handleExport(row) {
-      transferExport({id:row.id}).then(res=>{
-        
-      })
+      transferExport({ id: row.id }).then((res) => {});
     },
 
     // 鎾ら攢
     handleRevoke(row) {
       this.$confirm(`鎮ㄧ‘瀹氭挙閿�鍗曞彿涓�"${row.businessFormCode}"  鐨勬暟鎹悧?`, '鎾ら攢').then(() => {
-        transferUpdStatus({ id: row.id })
-          .then((res) => {
-            this.$message.success('鎾ら攢鎴愬姛锛�');
-            this.search(1);
-          })
+        transferUpdStatus({ id: row.id }).then((res) => {
+          this.$message.success('鎾ら攢鎴愬姛锛�');
+          this.search(1);
+        });
       });
     },
     fifterForm(params) {

--
Gitblit v1.9.1