From ed2117c738eedd3143d3b2ad6b0d40b2116afcf6 Mon Sep 17 00:00:00 2001
From: liuguocan <527956374@qq.com>
Date: 星期二, 28 十一月 2023 14:44:49 +0800
Subject: [PATCH] 首页/物品分发/物品报废

---
 admin-web/src/views/stock/procure/purchaseOrder/index.vue |   65 ++++++++++++++++++++++----------
 1 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/admin-web/src/views/stock/procure/purchaseOrder/index.vue b/admin-web/src/views/stock/procure/purchaseOrder/index.vue
index 621f136..6973b29 100644
--- a/admin-web/src/views/stock/procure/purchaseOrder/index.vue
+++ b/admin-web/src/views/stock/procure/purchaseOrder/index.vue
@@ -29,22 +29,22 @@
                         <div class="card-header-right">
                           <template v-if="item.states == 1">
                             <el-button name="缂栬緫" site="form" type="success" size="mini" @click="handleEdit(item)"
-                              >缂栬緫</el-button
+                            >缂栬緫</el-button
                             >
                             <el-button name="鍏ュ簱" site="form" type="primary" size="mini" @click="handleIncome(item)"
-                              >鍏ュ簱</el-button
+                            >鍏ュ簱</el-button
                             >
                             <el-button name="鍒犻櫎" site="form" type="danger" size="mini" @click="del(item)"
-                              >鍒犻櫎</el-button
+                            >鍒犻櫎</el-button
                             >
                           </template>
                           <template v-if="item.states != 1">
                             <el-button site="form" type="success" size="mini" @click="handleExport(item)"
-                              >瀵煎嚭鍏ュ簱鍗�</el-button
+                            >瀵煎嚭鍏ュ簱鍗�</el-button
                             >
                           </template>
                           <el-button name="鏌ョ湅璇︽儏" site="form" type="info" size="mini" @click="handleDetail(item)"
-                            >鏌ョ湅璇︽儏</el-button
+                          >鏌ョ湅璇︽儏</el-button
                           >
                         </div>
                       </div>
@@ -120,7 +120,7 @@
 import edit from './edit';
 import detail from './detail';
 import { getBaseUrl } from '@/utils/base';
-import listPage from '../../../mixins/listPage'
+import listPage from '../../../mixins/listPage';
 
 export default {
   name: 'index',
@@ -140,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',
@@ -219,6 +232,9 @@
       },
     };
   },
+  created(){
+    this.fetchData()
+  },
   methods: {
     fetchData() {
       this.loading = true;
@@ -249,17 +265,29 @@
     },
     // 鍏ュ簱
     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('鍒犻櫎鎴愬姛锛�');
@@ -275,9 +303,6 @@
       }
       if (this.filterFrom.incomeTimeEnd) {
         this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
-      }
-      if (this.filterFrom.agencyId && this.filterFrom.agencyId.length) {
-        this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
       }
       this.search(1);
     },

--
Gitblit v1.9.1