From 9834dbff448908d2008d8c52a2544aad00c099b1 Mon Sep 17 00:00:00 2001
From: haoyahui <2032914783@qq.com>
Date: 星期三, 22 十一月 2023 17:34:26 +0800
Subject: [PATCH] 库存盘点, 异常明细,报废管理

---
 admin-web/src/views/stock/procure/purchaseOrder/index.vue |  137 ++++++++++++++-------------------------------
 1 files changed, 43 insertions(+), 94 deletions(-)

diff --git a/admin-web/src/views/stock/procure/purchaseOrder/index.vue b/admin-web/src/views/stock/procure/purchaseOrder/index.vue
index d0deb5a..7000dc4 100644
--- a/admin-web/src/views/stock/procure/purchaseOrder/index.vue
+++ b/admin-web/src/views/stock/procure/purchaseOrder/index.vue
@@ -14,7 +14,7 @@
               <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-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">
@@ -74,6 +74,7 @@
                   </el-card>
                 </el-col>
               </el-row>
+              <div class="no-data" v-else>鏆傛棤鏁版嵁</div>
             </div>
             <el-pagination
               :small="false"
@@ -113,17 +114,17 @@
 
 <script>
 import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder';
-import { getTree } from '@/api/baseSetting/finsystenant';
 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';
 
 export default {
   name: 'index',
+  mixins: [listPage],
   components: { MyButton, myImport, edit, detail },
   data() {
     return {
@@ -139,12 +140,25 @@
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
         },
+        // {
+        //   type: 'text',
+        //   dataIndex: 'goodsTemplateName',
+        //   label: '鐗╁搧鍚嶇О',
+        //   placeholder: '鍙ā绯婃悳绱�',
+        //   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',
@@ -157,7 +171,7 @@
         },
         {
           type: 'text',
-          dataIndex: 'buyerName',
+          dataIndex: 'createName',
           label: '鍒涘缓浜�',
           placeholder: '璇疯緭鍏�',
           defaultValue: '',
@@ -198,13 +212,6 @@
       ],
       // 鏍戞暟鎹�
       treeDataList: [],
-      // 鎼滅储鏉′欢
-      filterFrom: {
-        tenantId: null,
-        userName: null,
-        userPhone: null,
-        states: null,
-      },
       // 瀵煎叆
       importSetting: {
         dialogTitle: '瀵煎叆',
@@ -223,35 +230,10 @@
         },
         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() {
@@ -281,40 +263,31 @@
         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.show = true;
-    },
     // 鍏ュ簱
     handleIncome(row) {
-      this.$confirm(`鎮ㄧ‘瀹� 鍗曞彿锛�${row.businessFormCode}  鍏ュ簱鍚�?`, '閲囪喘鍏ュ簱').then(() => {
-        procureIncome({ id: row.id })
-          .then((res) => {
-            this.$message.success('鍏ュ簱鎴愬姛锛�');
-            this.search();
-          })
-          .catch(() => {});
+      this.$confirm(`鎮ㄧ‘瀹� 鍗曞彿锛�${row.businessFormCode}  鍏ュ簱鍚�?`, '閲囪喘鍏ュ簱', {
+        beforeClose: (action, instance, done) => {
+          if (action == 'confirm') {
+            instance.confirmButtonLoading = true;
+            instance.confirmButtonText = '鎵ц涓�...';
+            procureIncome({ id: row.id })
+              .then((res) => {
+                this.$message.success('鍏ュ簱鎴愬姛锛�');
+                done();
+                instance.confirmButtonLoading = false;
+                this.search();
+              })
+              .catch(() => {
+                done();
+              });
+          } else {
+            done();
+          }
+        },
       });
     },
     del(row) {
-      this.$modal.confirm('鏄惁纭鍒犻櫎鍏ュ簱鍗曞彿涓�"' + row.businessFormCode + '"鐨勬暟鎹悧锛�').then( () => {
+      this.$modal.confirm('鏄惁纭鍒犻櫎鍏ュ簱鍗曞彿涓�"' + row.businessFormCode + '"鐨勬暟鎹悧锛�').then(() => {
         procureDel({ id: row.id })
           .then((res) => {
             this.$message.success('鍒犻櫎鎴愬姛锛�');
@@ -323,27 +296,6 @@
           .catch(() => {});
       });
     },
-    // 鍒嗛〉
-    handleSizeChange(pageSize) {
-      this.pageSize = pageSize;
-      this.search(1);
-    },
-    handleCurrentChange(pageNum) {
-      this.pageNum = pageNum;
-      this.search(pageNum);
-    },
-    // 鏌ヨ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) {
@@ -351,9 +303,6 @@
       }
       if (this.filterFrom.incomeTimeEnd) {
         this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
-      }
-      if (this.filterFrom.agencyId.length) {
-        this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
       }
       this.search(1);
     },

--
Gitblit v1.9.1