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/stock/transfer/transferissue/index.vue |   70 +++++++++++++++++++---------------
 1 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/admin-web/src/views/stock/transfer/transferissue/index.vue b/admin-web/src/views/stock/transfer/transferissue/index.vue
index 26aa693..264ae5a 100644
--- a/admin-web/src/views/stock/transfer/transferissue/index.vue
+++ b/admin-web/src/views/stock/transfer/transferissue/index.vue
@@ -9,7 +9,7 @@
         <el-row style="margin-top: 15px">
           <el-col>
             <!--鍒楄〃-->
-            <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">
@@ -24,11 +24,7 @@
                           <div v-if="item.states == 4" class="states states-info">宸叉挙閿�</div>
                         </div>
                         <div class="card-header-right">
-                          <el-button
-                            v-if="item.states == 1"
-                            site="form"
-                            type="success"
-                            size="mini"
+                          <el-button v-if="item.states == 1" site="form" type="success" size="mini"
                             >瀵煎嚭璋冩嫧鍑哄簱鍗�</el-button
                           >
                           <el-button
@@ -39,11 +35,7 @@
                             @click="handleOutput(item)"
                             >鍑哄簱</el-button
                           >
-                          <el-button
-                            v-if="item.states == 2"
-                            site="form"
-                            type="primary"
-                            size="mini"
+                          <el-button v-if="item.states == 2" site="form" type="primary" size="mini"
                             >瀵煎嚭璋冩嫧鍏ュ簱鍗�</el-button
                           >
                           <el-button name="鏌ョ湅璇︽儏" site="form" type="info" size="mini" @click="handleDetail(item)"
@@ -84,7 +76,7 @@
                   </el-card>
                 </el-col>
               </el-row>
-              <div class="no-data" v-else>鏆傛棤鏁版嵁</div>
+              <el-empty v-else description="鏆傛棤鏁版嵁"></el-empty>
             </div>
             <el-pagination
               :small="false"
@@ -110,13 +102,14 @@
 </template>
 
 <script>
-import { transferList,transferOutput } from '@/api/stock/transfer';
+import {transferList, transferOutput} from '@/api/stock/transfer';
 import MyButton from '@/components/myButton/myButton';
 import myImport from '@/views/components/myImport';
 import detail from './detail';
 import listPage from '../../../mixins/listPage';
 import transfer from '../../../mixins/transfer';
-import { commonsApi } from '@/api/commonsApi';
+import {commonsApi} from '@/api/commonsApi';
+import SettingIplatform from '@/utils/settingIplatform';
 
 export default {
   name: 'index',
@@ -137,20 +130,18 @@
           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: [],
+          cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }],
+          optionsConfig: {
+            label: 'goodsName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
+          },
         },
         {
           type: 'cascader',
@@ -197,6 +188,9 @@
     };
   },
   created() {
+    this.filterFrom = {
+      outAgencyId: this.userInfo.tenantId,
+    };
     this.fetchData();
     this.items.map((v) => {
       if (v.label == '鐘舵��') {
@@ -209,6 +203,7 @@
     fetchData() {
       this.loading = true;
       transferList({
+        qryType: 0,
         pageNum: this.pageNum,
         pageSize: this.pageSize,
         ...this.filterFrom,
@@ -220,12 +215,25 @@
       });
     },
     handleOutput(row) {
-      this.$confirm(`鎮ㄧ‘瀹� 鍗曞彿锛�${row.businessFormCode}  璋冩嫧鍑哄簱鍚�?`, '璋冩嫧鍑哄簱').then(() => {
-        transferOutput({ 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 = '鎵ц涓�...';
+            transferOutput({ id: row.id })
+              .then((res) => {
+                this.$message.success('璋冩嫧鍑哄簱鎴愬姛锛�');
+                done();
+                instance.confirmButtonLoading = false;
+                this.search(1);
+              })
+              .catch(() => {
+                done();
+              });
+          } else {
+            done();
+          }
+        },
       });
     },
     fifterForm(params) {

--
Gitblit v1.9.1