From e56be6e04cc6bfd106a354a5419f8a86f31f4003 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期五, 30 五月 2025 17:28:04 +0800
Subject: [PATCH] 备件请购完成

---
 src/views/eam/spare/EamSparePartRequisitionList.vue |  268 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 183 insertions(+), 85 deletions(-)

diff --git a/src/views/eam/spare/EamSparePartRequisitionList.vue b/src/views/eam/spare/EamSparePartRequisitionList.vue
index 6f72a2d..4302e94 100644
--- a/src/views/eam/spare/EamSparePartRequisitionList.vue
+++ b/src/views/eam/spare/EamSparePartRequisitionList.vue
@@ -1,4 +1,4 @@
-<template>
+<template >
   <a-row :gutter="10">
     <a-col
       :md="leftColMd"
@@ -99,7 +99,7 @@
             type="primary"
             icon="plus"
           >鏂板</a-button>
-          <a-button
+          <!-- <a-button
             type="primary"
             icon="download"
             @click="handleExportXls('澶囦欢璇疯喘鍗�')"
@@ -116,7 +116,7 @@
               type="primary"
               icon="import"
             >瀵煎叆</a-button>
-          </a-upload>
+          </a-upload> -->
         </div>
 
         <!-- table鍖哄煙-begin -->
@@ -151,17 +151,24 @@
               slot="action"
               slot-scope="text, record"
             >
-              <a @click="handleOpen(record)">鏄庣粏</a>
-              <a-divider
-                v-if="record.requisitionStatus !== '3' && record.requisitionStatus !== '5'"
-                type="vertical"
-              />
-              <a-dropdown v-if="record.requisitionStatus === '1' || record.requisitionStatus === '4'">
+              <!-- <a @click="handleOpen(record)">鏄庣粏</a> -->
+              <!-- <a
+                v-if="record.requisitionStatus === '1'"
+                @click="handleConfirm(record)"
+              >鎻愪氦</a> -->
+              <a-popconfirm
+                v-if="record.requisitionStatus === '1'"
+                title="纭畾鎻愪氦鍚�?"
+                @confirm="() => handleConfirm(record)"
+              > <a>鎻愪氦</a>
+              </a-popconfirm>
+              <a-divider type="vertical" />
+              <a-dropdown v-if="record.requisitionStatus === '1'">
                 <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
                 <a-menu slot="overlay">
-                  <a-menu-item>
+                  <!-- <a-menu-item>
                     <a @click="handleConfirm(record)">鎻愪氦</a>
-                  </a-menu-item>
+                  </a-menu-item> -->
                   <a-menu-item>
                     <a @click="handleEdit(record)">缂栬緫</a>
                   </a-menu-item>
@@ -175,10 +182,10 @@
                   </a-menu-item>
                 </a-menu>
               </a-dropdown>
-              <a
+              <!-- <a
                 v-if="record.requisitionStatus === '2'"
                 @click="handleExamine(record)"
-              >瀹℃牳</a>
+              >瀹℃牳</a> -->
             </span>
 
           </a-table>
@@ -191,10 +198,10 @@
           @ok="modalFormOk"
         ></eamSparePartRequisition-modal>
 
-        <eamSparePartRequisitionExamine-modal
+        <!-- <eamSparePartRequisitionExamine-modal
           ref="modalExamine"
           @ok="modalFormOk2"
-        ></eamSparePartRequisitionExamine-modal>
+        ></eamSparePartRequisitionExamine-modal> -->
 
       </a-card>
     </a-col>
@@ -203,15 +210,18 @@
       :sm="24"
       v-if="this.rightColVal === 1"
     >
-      <a-card :bordered="false">
-        <div style="text-align: right;">
+      <a-card
+        title="澶囦欢璇疯喘鏄庣粏"
+        :bordered="false"
+      >
+        <div style="text-align: left;">
           <a-icon
             type="close-circle"
             @click="hideSpareDetailList"
           />
         </div>
         <!-- 鏌ヨ鍖哄煙 -->
-        <div class="table-page-search-wrapper">
+        <!-- <div class="table-page-search-wrapper">
           <a-form layout="inline">
             <a-row :gutter="24">
               <a-col
@@ -238,10 +248,10 @@
 
             </a-row>
           </a-form>
-        </div>
+        </div> -->
 
         <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
-        <div
+        <!-- <div
           class="table-operator"
           :md="24"
           :sm="24"
@@ -283,9 +293,9 @@
               <a-icon type="down" />
             </a-button>
           </a-dropdown>
-        </div>
+        </div> -->
 
-        <!-- table鍖哄煙-begin -->
+        <!-- table鍖哄煙-begin 
         <div>
           <div
             class="ant-alert ant-alert-info"
@@ -296,47 +306,47 @@
               style="margin-left: 24px"
               @click="onClearSelected2"
             >娓呯┖</a>
-          </div>
+          </div>-->
 
-          <a-table
-            style="height:500px"
-            ref="table2"
-            size="middle"
-            bordered
-            rowKey="id"
-            :columns="columns2"
-            :dataSource="dataSource2"
-            :pagination="iPagination2"
-            :loading="loading2"
-            class="j-table-force-nowrap"
-            :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
-            @change="handleTableChange2"
+        <a-table
+          style="height:500px"
+          ref="table2"
+          size="middle"
+          bordered
+          rowKey="id"
+          :columns="columns2"
+          :dataSource="dataSource2"
+          :pagination="iPagination2"
+          :loading="loading2"
+          class="j-table-force-nowrap"
+          @change="handleTableChange2"
+        >
+          <!-- :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" -->
+
+          <span
+            slot="action"
+            slot-scope="text, record"
           >
+            <a-dropdown>
+              <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+              <a-menu slot="overlay">
+                <a-menu-item>
+                  <a-popconfirm @click="handleEdit2(record)">
+                    <a>缂栬緫</a>
+                  </a-popconfirm>
+                  <a-popconfirm
+                    title="纭畾鍒犻櫎鍚�?"
+                    @confirm="() => handleDelete2(record.id)"
+                  >
+                    <a>鍒犻櫎</a>
+                  </a-popconfirm>
+                </a-menu-item>
+              </a-menu>
+            </a-dropdown>
+          </span>
 
-            <span
-              slot="action"
-              slot-scope="text, record"
-            >
-              <a-dropdown>
-                <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
-                <a-menu slot="overlay">
-                  <a-menu-item>
-                    <a-popconfirm @click="handleEdit2(record)">
-                      <a>缂栬緫</a>
-                    </a-popconfirm>
-                    <a-popconfirm
-                      title="纭畾鍒犻櫎鍚�?"
-                      @confirm="() => handleDelete2(record.id)"
-                    >
-                      <a>鍒犻櫎</a>
-                    </a-popconfirm>
-                  </a-menu-item>
-                </a-menu>
-              </a-dropdown>
-            </span>
+        </a-table>
 
-          </a-table>
-        </div>
         <!-- table鍖哄煙-end -->
       </a-card>
     </a-col>
@@ -347,7 +357,7 @@
 <script>
 import '@assets/less/TableExpand.less'
 import EamSparePartRequisitionModal from './modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue'
-import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue'
+// import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { deleteAction, getAction, postAction } from '@api/manage'
 import { filterObj } from '@/utils/util'
@@ -357,7 +367,7 @@
   mixins: [JeecgListMixin],
   components: {
     EamSparePartRequisitionModal,
-    EamSparePartRequisitionExamineModal
+    // EamSparePartRequisitionExamineModal
   },
   data() {
     return {
@@ -415,6 +425,16 @@
       // 琛ㄥご
       columns: [
         {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
           title: '璇疯喘鍗曞彿',
           align: "center",
           dataIndex: 'requisitionCode'
@@ -454,21 +474,41 @@
       // 瀛愯〃琛ㄥご
       columns2: [
         {
-          title: '澶囧搧澶囦欢ID',
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '澶囧搧缂栫爜',
           align: "center",
-          dataIndex: 'partId'
+          dataIndex: 'partCode'
+        },
+        {
+          title: '鍚嶇О',
+          align: "center",
+          dataIndex: 'partName'
+        },
+        {
+          title: '鍨嬪彿',
+          align: "center",
+          dataIndex: 'partModel'
         },
         {
           title: '璇疯喘鏁伴噺',
           align: "center",
           dataIndex: 'requisitionNum'
         },
-        {
-          title: '鎿嶄綔',
-          dataIndex: 'action',
-          align: "center",
-          scopedSlots: { customRender: 'action' },
-        }
+        // {
+        //   title: '鎿嶄綔',
+        //   dataIndex: 'action',
+        //   align: "center",
+        //   scopedSlots: { customRender: 'action' },
+        // }
       ],
       url: {
         list: "/eam/eamSparePartRequisition/list",
@@ -490,17 +530,17 @@
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
     },
     leftColMd() {
-      return this.selectedRowKeys1.length === 0 ? 24 : 12
+      return this.selectedRowKeys1.length === 0 ? 24 : 14
     },
     rightColMd() {
-      return this.selectedRowKeys1.length === 0 ? 0 : 12
+      return this.selectedRowKeys1.length === 0 ? 0 : 10
     }
   },
   methods: {
     customRow(record) {
       return {
         on: {
-          dblclick: () => {
+          click: () => {
             this.handleOpen(record)
           }
         }
@@ -530,6 +570,25 @@
       this.onClearSelected2()
       this.loadData2()
     },
+
+    // handleAdd: function () {
+    //   // if (this.spareRequisitionId === '') {
+    //   //   this.$message.error('璇烽�夋嫨涓�涓璐崟!')
+    //   // } else {
+    //   // this.$refs.modalForm2.roleDisabled = true
+    //   this.$refs.sparePartRequisitionModalForm.title = '鏂板'
+    //   this.$refs.sparePartRequisitionModalForm.add()
+    //   // }
+    // },
+    searchQuery: function () {
+      this.loadData(1)
+      this.dataSource2 = []
+    },
+    searchReset: function () {
+      this.queryParam = {}
+      this.loadData(1)
+      this.dataSource2 = []
+    },
     searchQuery2: function () {
       this.loadData2(1)
     },
@@ -549,6 +608,38 @@
     onClearSelected2: function () {
       this.selectedRowKeys2 = []
       this.selectionRows2 = []
+    },
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error("璇疯缃畊rl.list灞炴��!")
+        return
+      }
+      //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+      if (arg === 1) {
+        this.ipagination.current = 1;
+      }
+      var params = this.getQueryParams();//鏌ヨ鏉′欢
+      if (!params) {
+        return false;
+      }
+      this.loading = true;
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          // console.log(res)
+          //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+          this.dataSource = res.result.records || res.result;
+          if (res.result.total) {
+            this.ipagination.total = res.result.total;
+          } else {
+            this.ipagination.total = 0;
+          }
+          //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+        } else {
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
     },
     loadData2: function (arg) {
       if (!this.url.list2) {
@@ -661,26 +752,33 @@
       this.selectionRows1 = []
     },
     handleConfirm(record) {
+      setTimeout(() => {
+        this.loading = true
+      }, 100);
+
       if (!this.url.submit) {
         this.$message.error('璇疯缃畊rl.submit灞炴��!')
         return
       }
       var that = this
-      this.$confirm({
-        title: '纭鎻愪氦',
-        content: '纭畾鎻愪氦鍚�?',
-        onOk: function () {
-          postAction(that.url.submit, record).then((res) => {
-            if (res.success) {
-              that.$message.success(res.message)
-              that.loadData()
-              // that.onClearSelected1()
-            } else {
-              that.$message.warning(res.message)
-            }
-          })
+      // this.$confirm({
+      //   title: '纭鎻愪氦',
+      //   content: '纭畾鎻愪氦鍚�?',
+      //   onOk: function () {
+
+      postAction(that.url.submit, record).then((res) => {
+        if (res.success) {
+          that.$message.success(res.message)
+          that.loadData()
+          // that.onClearSelected1()
+        } else {
+          that.$message.warning(res.message)
         }
+        that.loading = false
       })
+      //   }
+      // })
+      this.loading = false
     },
     handleExamine: function (record) {
       this.$refs.modalExamine.examine(record);

--
Gitblit v1.9.3