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/accessStock/outbound/index.vue |  256 ++++++++++++--------------------------------------
 1 files changed, 62 insertions(+), 194 deletions(-)

diff --git a/admin-web/src/views/stock/accessStock/outbound/index.vue b/admin-web/src/views/stock/accessStock/outbound/index.vue
index 30595e1..e574460 100644
--- a/admin-web/src/views/stock/accessStock/outbound/index.vue
+++ b/admin-web/src/views/stock/accessStock/outbound/index.vue
@@ -12,50 +12,53 @@
             <div class="table-tool-bar" style="margin-bottom: 15px;">
               <my-button name="鏂板" @click="handleAdd" site="tools" size="medium" />
             </div>
-            <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" 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">
+            <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(item)"
-                              >瀵煎嚭鍑哄簱鍗�</el-button
+                            >瀵煎嚭鍑哄簱鍗�</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>
-              <div class="no-data" v-else>鏆傛棤鏁版嵁</div>
+                    </el-card>
+                  </el-col>
+                </el-row>
+                <div class="no-data" v-else>鏆傛棤鏁版嵁</div>
+              </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 { outputList, procureDel, procureIncome } from '@/api/stock/accessStock';
+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 '../../../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,11 +105,17 @@
           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: 'cascader',
@@ -126,81 +128,28 @@
         },
         {
           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() {
@@ -213,101 +162,20 @@
         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.pageNum = pageNum;
-      this.search();
-    },
-    // 鏌ヨtable鍒楄〃
-    search(pageNum) {
-      if(pageNum){
-        this.pageNum = pageNum
-      }
-      this.fetchData();
-    },
-    refreshData() {
-      this.pageNum = 1;
-      this.pageSize = 10;
-      this.search();
     },
     fifterForm(params) {
       this.filterFrom = Object.assign(this.filterFrom, params);
-      if (this.filterFrom.incomeTimeStart) {
-        this.filterFrom.incomeTimeStart = this.filterFrom.incomeTimeStart.replace(/\-/g, '');
+      if (this.filterFrom.startTime) {
+        this.filterFrom.startTime = this.filterFrom.startTime.replace(/\-/g, '');
       }
-      if (this.filterFrom.incomeTimeEnd) {
-        this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
+      if (this.filterFrom.endTime) {
+        this.filterFrom.endTime = this.filterFrom.endTime.replace(/\-/g, '');
       }
-      if (this.filterFrom.agencyId.length) {
+      if (this.filterFrom.agencyId&&this.filterFrom.agencyId.length) {
         this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
       }
-      this.search({ pageNum: 1 });
+      this.search(1);
     },
   },
 };

--
Gitblit v1.9.1