From 32dce44249f1b3fb8487a154517c381d55123fbc Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期三, 29 十一月 2023 19:31:49 +0800
Subject: [PATCH] feat: 1、库存管理各种单据导出对接

---
 admin-web/src/views/stock/accessStock/outbound/index.vue |  253 ++++++++++++--------------------------------------
 1 files changed, 61 insertions(+), 192 deletions(-)

diff --git a/admin-web/src/views/stock/accessStock/outbound/index.vue b/admin-web/src/views/stock/accessStock/outbound/index.vue
index 28c09d9..8af4e09 100644
--- a/admin-web/src/views/stock/accessStock/outbound/index.vue
+++ b/admin-web/src/views/stock/accessStock/outbound/index.vue
@@ -11,51 +11,54 @@
             <!--鍒楄〃-->
             <div class="table-tool-bar" style="margin-bottom: 15px;">
               <my-button name="鏂板" @click="handleAdd" site="tools" size="medium" />
-              <my-button name="瀵煎叆" @click="importSetting.dialogShow = true" site="tools" size="medium" />
             </div>
-            <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading">
-              <el-row class="card" :gutter="5">
-                <el-col v-for="(item, index) in list" :key="index" class="cm-item">
-                  <el-card class="card-data">
-                    <div class="card-container">
-                      <div class="card-header">
-                        <div class="card-header-left">
-                          <span>鍑哄簱鍗曞彿锛�</span>
-                          <span class="value">{{ item.businessFormCode }}</span>
-                        </div>
-                        <div class="card-header-right">
-                            <el-button site="form" type="success" size="mini" @click="handleExport(item)"
-                              >瀵煎嚭鍑哄簱鍗�</el-button
+            <div>
+              <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">
+                      <div class="card-container">
+                        <div class="card-header">
+                          <div class="card-header-left">
+                            <span>鍑哄簱鍗曞彿锛�</span>
+                            <span class="value">{{ item.businessFormCode }}</span>
+                          </div>
+                          <div class="card-header-right">
+                            <el-button site="form" type="success" size="mini" @click="handleExport('outputExport',`鍑哄簱鍗�-${item.businessFormCode}`,{id:item.id})"
+                            >瀵煎嚭鍑哄簱鍗�</el-button
                             >
-                          <el-button name="鏌ョ湅璇︽儏" site="form" type="info" size="mini" @click="handleDetail(item)"
+                            <el-button name="鏌ョ湅璇︽儏" site="form" type="info" size="mini" @click="handleDetail(item)"
                             >鏌ョ湅璇︽儏</el-button
-                          >
+                            >
+                          </div>
                         </div>
-                      </div>
-                      <div class="one-hed">
-                        <div class="box"><span class="span-two">鏈烘瀯锛�</span>{{ item.agencyId }}</div>
-                        <div class="box"><span class="span-two">鎿嶄綔浜猴細</span>{{ item.buyerName }}</div>
-                        <div class="box">
-                          <span class="span-two">鍑哄簱鏃堕棿锛�</span>{{ item.procureTime | formatTime }}
+                        <div class="one-hed">
+                          <div class="box"><span class="span-two">鏈烘瀯锛�</span>{{ item.agencyName }}</div>
+                          <div class="box"><span class="span-two">鎿嶄綔浜猴細</span>{{ item.operatorName }}</div>
+                          <div class="box">
+                            <span class="span-two">鍑哄簱鏃堕棿锛�</span>{{ item.dealTime | formatTime }}
+                          </div>
                         </div>
-                      </div>
-                      <div class="card-end">
-                        <div v-for="(just, index) in item.fromProcureTemplateInfoList" :key="index" class="item">
-                          <div class="name">{{ just.goodsTemplateName }}</div>
-                          <div class="value-box">
-                            <div class="value-box-item">
-                              <span class="label">鏁伴噺锛�</span>
-                              <span class="value">{{ just.count }}</span>
-                              <span class="unit">{{ just.unit }}</span>
+                        <div class="card-end">
+                          <div v-for="(just, index) in item.formOutputTemplateInfoList" :key="index" class="item">
+                            <div class="name">{{ just.goodsName }}</div>
+                            <div class="value-box">
+                              <div class="value-box-item">
+                                <span class="label">鏁伴噺锛�</span>
+                                <span class="value">{{ just.count }}</span>
+                                <span class="unit">{{ just.unit }}</span>
+                              </div>
                             </div>
                           </div>
                         </div>
                       </div>
-                    </div>
-                  </el-card>
-                </el-col>
-              </el-row>
+                    </el-card>
+                  </el-col>
+                </el-row>
+                <el-empty v-else description="鏆傛棤鏁版嵁"></el-empty>
+              </div>
             </div>
+
             <el-pagination
               :small="false"
               :current-page="pageNum"
@@ -72,32 +75,25 @@
     </el-container>
     <!--娣诲姞/缂栬緫寮圭獥-->
     <edit v-if="editSetting.show" :setting="editSetting" ref="editRef" @close="editSetting.show=false" @search="refreshData"></edit>
-    <detail v-if="detailSetting.show" :setting="detailSetting" @close="editSetting.show=false" ref="detailRef"></detail>
-    <my-import
-      :import-setting="importSetting"
-      :dialog-show="importSetting.dialogShow"
-      :dialog-title="importSetting.dialogTitle"
-    />
+    <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show=false" ref="detailRef"></detail>
   </div>
 </template>
 
 <script>
-import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder';
+import {outputList} from '@/api/stock/accessStock';
 import MyButton from '@/components/myButton/myButton';
-import SettingIplatform from '@/utils/settingIplatform';
 import myImport from '@/views/components/myImport';
 import edit from './edit';
 import detail from './detail';
-import { getBaseUrl } from '@/utils/base';
-import * as DateFormatter from '@/utils/DateFormatter';
+import listPage from '@/views/mixins/listPage'
+import SettingIplatform from '@/utils/settingIplatform';
 
 export default {
   name: 'index',
+  mixins: [listPage],
   components: { MyButton, myImport, edit, detail },
   data() {
     return {
-      loading: false,
-      adddialog: false,
       list: [],
       // 鎼滅储妗�
       items: [
@@ -109,101 +105,56 @@
           defaultValue: '',
         },
         {
-          type: 'text',
-          dataIndex: 'goodsTemplateName',
+          type: 'select',
+          dataIndex: 'goodsTemplateId',
           label: '鐗╁搧鍚嶇О',
-          placeholder: '鍙ā绯婃悳绱�',
+          placeholder: '璇疯緭鍏�',
           defaultValue: '',
+          options: [],
+          optionsConfig: {
+            label: 'goodsName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
+          },
         },
         {
-          type: 'select',
-          dataIndex: 'name',
+          type: 'cascader',
+          dataIndex: 'agencyId',
           label: '鏈烘瀯',
           placeholder: '璇烽�夋嫨',
+          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
           defaultValue: '',
           options: [],
         },
         {
           type: 'text',
-          dataIndex: 'buyerName',
+          dataIndex: 'createName',
           label: '鍒涘缓浜�',
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
         },
         {
           type: 'date-picker',
-          dataIndex: 'val1',
+          dataIndex: 'startTime',
           label: '鍑哄簱鏃堕棿',
           defaultValue: '',
         },
         {
           type: 'date-picker',
-          dataIndex: 'val2',
+          dataIndex: 'endTime',
           label: '鑷�',
           defaultValue: '',
         },
       ],
-      // 鏍戞暟鎹�
-      treeDataList: [],
-      // 鎼滅储鏉′欢
-      filterFrom: {
-        tenantId: null,
-        userName: null,
-        userPhone: null,
-        states: null,
-      },
-      // 瀵煎叆
-      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: '',
-        orgId: '',
-        show: false,
-      },
-      detailSetting: {
-        title: '璇︽儏',
-        id: '',
-        show: false,
-      },
-      pageNum: 1,
-      pageSize: 10,
-      total: 0,
     };
   },
-  computed: {
-    clientHeight() {
-      return document.documentElement.clientHeight;
-    },
-  },
-  filters: {
-    formatTime(time) {
-      if (!time) return;
-      return DateFormatter.LongToDateTime(time);
-    },
-  },
-  created() {
-    this.fetchData();
+  created(){
+    this.fetchData()
   },
   methods: {
     fetchData() {
       this.loading = true;
-      procureList({
+      outputList({
         pageNum: this.pageNum,
         pageSize: this.pageSize,
         ...this.filterFrom,
@@ -211,89 +162,7 @@
         this.list = res.datas;
         this.total = res.totalRows;
         this.loading = false;
-        console.log(this.list);
       });
-    },
-    //瀵煎叆
-    importOrg() {
-      this.importSetting.dialogShow = true;
-      this.importSetting.onSuccess = (response, callBack) => {
-        if (response.code === 1) {
-          this.$message.success(response.msg);
-          this.search(1);
-        } else {
-          this.$message.warning(response.msg);
-        }
-        callBack();
-      };
-    },
-    // 瀵煎嚭
-    handleExport() {},
-    // 鏂板
-    handleAdd() {
-      this.editSetting.id = null;
-      this.editSetting.info = null;
-      this.editSetting.title = '鏂板';
-      this.editSetting.show = true;
-    },
-    // 缂栬緫
-    handleEdit(row) {
-      this.editSetting.id = row.id;
-      this.editSetting.info = null;
-      this.editSetting.title = '缂栬緫';
-      this.editSetting.show = true;
-    },
-    // 璇︽儏
-    handleDetail(row) {
-      this.detailSetting.id = row.id;
-      this.detailSetting.info = JSON.stringify(row);
-      this.detailSetting.title = '璇︽儏';
-      this.detailSetting.show = true;
-    },
-    // 鍑哄簱
-    handleIncome(row) {
-      this.$confirm(`鎮ㄧ‘瀹� 鍗曞彿锛�${row.businessFormCode}  鍑哄簱鍚�?`, '鍑哄簱鍑哄簱')
-        .then(function () {
-          procureIncome({ id: row.id }).then((res) => {
-            this.$message.success('鍑哄簱鎴愬姛锛�');
-            this.search();
-          });
-        })
-        .catch(() => {});
-    },
-    del(row) {
-      this.$modal
-        .confirm('鏄惁纭鍒犻櫎鍑哄簱鍗曞彿涓�"' + row.businessFormCode + '"鐨勬暟鎹悧锛�')
-        .then(function () {
-          procureDel({ id: row.id }).then((res) => {});
-        })
-        .then((res) => {
-          this.$message.success('鍒犻櫎鎴愬姛锛�');
-          this.search();
-        })
-        .catch(() => {});
-    },
-    // 鍒嗛〉
-    handleSizeChange(pageSize) {
-      this.pageSize = pageSize;
-      this.search({ pageNum: 1 });
-    },
-    handleCurrentChange(pageNum) {
-      this.myTable.paging.page.pageNum = pageNum;
-      this.search({ pageNum: pageNum });
-    },
-    // 鏌ヨtable鍒楄〃
-    search(pageNum) {
-      this.fetchData();
-    },
-    refreshData() {
-      this.pageNum = 1;
-      this.pageSize = 10;
-      this.search();
-    },
-    fifterForm(params) {
-      this.filterFrom = Object.assign(this.filterFrom, params);
-      this.search(1);
     },
   },
 };

--
Gitblit v1.9.1