From c7bbdaab4503cc0e470623e87cca3b8a1840bff0 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期二, 24 六月 2025 17:43:05 +0800
Subject: [PATCH] 设备管理-大修项修页面

---
 src/views/eam/repair/EamMajorPartialRepairList.vue |  509 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 380 insertions(+), 129 deletions(-)

diff --git a/src/views/eam/repair/EamMajorPartialRepairList.vue b/src/views/eam/repair/EamMajorPartialRepairList.vue
index 4286fc2..b3176e9 100644
--- a/src/views/eam/repair/EamMajorPartialRepairList.vue
+++ b/src/views/eam/repair/EamMajorPartialRepairList.vue
@@ -1,37 +1,43 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 鏌ヨ鍖哄煙 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鍒犻櫎鏍囪">
-              <a-input placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" v-model="queryParam.delFlag"></a-input>
+            <a-form-item label="缁翠慨缂栫爜">
+              <a-input placeholder="璇疯緭鍏ョ淮淇紪鐮�" v-model="queryParam.repairCode"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="璁惧ID">
-              <a-input placeholder="璇疯緭鍏ヨ澶嘔D" v-model="queryParam.equipmentId"></a-input>
+            <a-form-item label="椤圭洰鍚嶇О">
+              <a-input placeholder="璇疯緭鍏ラ」鐩悕绉�" v-model="queryParam.repairName"></a-input>
             </a-form-item>
           </a-col>
-        <template v-if="toggleSearchStatus">
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="缁翠慨绫诲瀷">
-              <a-input placeholder="璇疯緭鍏ョ淮淇被鍨�" v-model="queryParam.repairType"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="璁″垝寮�濮嬫椂闂�">
-              <a-input placeholder="璇疯緭鍏ヨ鍒掑紑濮嬫椂闂�" v-model="queryParam.planStartTime"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="璁″垝缁撴潫鏃堕棿">
-              <a-input placeholder="璇疯緭鍏ヨ鍒掔粨鏉熸椂闂�" v-model="queryParam.planEndTime"></a-input>
-            </a-form-item>
-          </a-col>
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="缁翠慨鐘舵��">
+                <j-dict-select-tag placeholder="璇烽�夋嫨缁翠慨鐘舵��" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="缁翠慨绫诲瀷">
+                <a-select v-model="queryParam.repairType" placeholder="璇烽�夋嫨缁翠慨绫诲瀷">
+                  <a-select-option value="澶т慨">澶т慨</a-select-option>
+                  <a-select-option value="椤逛慨">椤逛慨</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="璁″垝寮�濮嬫棩鏈�">
+                <a-range-picker
+                  v-model="planDateRange"
+                  @change="selectDateChange"
+                  format="YYYY-MM-DD"
+                  value-format="YYYY-MM-DD"
+                />
+              </a-form-item>
+            </a-col>
           </template>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -43,21 +49,26 @@
               </a>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
+    <!-- 鏌ヨ鍖哄煙-END -->
 
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('澶т慨椤逛慨')">瀵煎嚭</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
-        <a-button type="primary" icon="import">瀵煎叆</a-button>
-      </a-upload>
+<!--      <a-button type="primary" icon="download" @click="handleExportXls('eam_major_partial_repair')">瀵煎嚭</a-button>-->
+<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
+<!--        <a-button type="primary" icon="import">瀵煎叆</a-button>-->
+<!--      </a-upload>-->
+      <!-- 楂樼骇鏌ヨ鍖哄煙 -->
+<!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item>
+          <a-menu-item key="1" @click="batchSubmit"><a-icon type="form"/>鎻愪氦</a-menu-item>
+          <a-menu-item key="2" @click="batchConfirm"><a-icon type="check"/>纭</a-menu-item>
+          <a-menu-item key="3" @click="batchRepeal"><a-icon type="close"/>浣滃簾</a-menu-item>
+          <a-menu-item key="4" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button>
       </a-dropdown>
@@ -73,51 +84,97 @@
       <a-table
         ref="table"
         size="middle"
+        :scroll="{x:true}"
         bordered
         rowKey="id"
         :columns="columns"
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        class="j-table-force-nowrap"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
         @change="handleTableChange">
 
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">缂栬緫</a>
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            涓嬭浇
+          </a-button>
+        </template>
 
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
-                  <a>鍒犻櫎</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleDetail(record)">璇︽儏</a>
+          <span v-if="record.repairStatus === 'PENDING_SUBMISSION'">
+            <a-divider type="vertical" />
+            <a-popconfirm title="纭畾瑕佹彁浜ゅ悧?" @confirm="() => handleSubmit(record.id)">
+              <a>鎻愪氦</a>
+            </a-popconfirm>
+          </span>
+          <span v-if="record.repairStatus === 'PENDING_CONFIRMATION'">
+            <a-divider type="vertical" />
+            <a-popconfirm title="瑕佸畬鎴愮‘璁ゅ悧?" @confirm="() => handleConfirm(record.id)">
+              <a>纭</a>
+            </a-popconfirm>
+          </span>
+          <span v-if="record.repairStatus === 'CONFIRMED'">
+            <a-divider type="vertical" />
+            <a @click="handleFill(record)">濉姤</a>
+          </span>
+
+          <span v-if="record.repairStatus === 'PENDING_SUBMISSION'">
+            <a-divider type="vertical" />
+            <a-dropdown>
+              <a class="ant-dropdown-link">鏇村<a-icon type="down" /></a>
+              <a-menu slot="overlay">
+                <a-menu-item>
+                  <a @click="handleEdit(record)">缂栬緫</a>
+                </a-menu-item>
+                <a-menu-item>
+                  <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
+                    <a>鍒犻櫎</a>
+                  </a-popconfirm>
+                </a-menu-item>
+              </a-menu>
+            </a-dropdown>
+          </span>
         </span>
 
       </a-table>
     </div>
-    <!-- table鍖哄煙-end -->
 
-    <!-- 琛ㄥ崟鍖哄煙 -->
-    <eamMajorPartialRepair-modal ref="modalForm" @ok="modalFormOk"></eamMajorPartialRepair-modal>
+    <eam-major-partial-repair-modal ref="modalForm" @ok="modalFormOk"></eam-major-partial-repair-modal>
+    <eam-major-partial-repair-detail-modal ref="modalDetailForm" @ok="modalFormOk"></eam-major-partial-repair-detail-modal>
   </a-card>
 </template>
 
 <script>
+
   import '@/assets/less/TableExpand.less'
-  import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal'
+  import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal'
+  import EamMajorPartialRepairDetailModal from './modules/EamMajorPartialRepairDetailModal'
+  import { getAction } from '../../../api/manage'
 
   export default {
-    name: "EamMajorPartialRepairList",
-    mixins:[JeecgListMixin],
+    name: 'EamMajorPartialRepairList',
+    mixins:[JeecgListMixin, mixinDevice],
     components: {
-      EamMajorPartialRepairModal
+      EamMajorPartialRepairModal,
+      EamMajorPartialRepairDetailModal
     },
     data () {
       return {
@@ -133,110 +190,304 @@
             customRender:function (t,r,index) {
               return parseInt(index)+1;
             }
-           },
-		   {
-            title: '鍒犻櫎鏍囪',
-            align:"center",
-            dataIndex: 'delFlag'
-           },
-		   {
-            title: '璁惧ID',
-            align:"center",
-            dataIndex: 'equipmentId'
-           },
-		   {
-            title: '缁翠慨绫诲瀷',
-            align:"center",
-            dataIndex: 'repairType'
-           },
-		   {
-            title: '璁″垝寮�濮嬫椂闂�',
-            align:"center",
-            dataIndex: 'planStartTime'
-           },
-		   {
-            title: '璁″垝缁撴潫鏃堕棿',
-            align:"center",
-            dataIndex: 'planEndTime'
-           },
-		   {
-            title: '缁翠慨缂栫爜',
+          },
+          {
+            title:'缁翠慨缂栫爜',
             align:"center",
             dataIndex: 'repairCode'
-           },
-		   {
-            title: '缁翠慨鍚嶇О',
+          },
+          {
+            title:'椤圭洰鍚嶇О',
             align:"center",
             dataIndex: 'repairName'
-           },
-		   {
-            title: '缁翠慨鐘舵��',
+          },
+          {
+            title:'缁翠慨鐘舵��',
             align:"center",
-            dataIndex: 'repairStatus'
-           },
-		   {
-            title: '瀹為檯寮�濮嬫椂闂�',
+            dataIndex: 'repairStatus_dictText'
+          },
+          {
+            title:'缁翠慨绫诲瀷',
+            align:"center",
+            dataIndex: 'repairType'
+          },
+          {
+            title:'鐢宠浜�',
+            align:"center",
+            dataIndex: 'applicant_dictText'
+          },
+          {
+            title:'鐢宠杞﹂棿',
+            align:"center",
+            dataIndex: 'applicantProduction_dictText'
+          },
+          {
+            title:'璁″垝寮�濮嬫棩鏈�',
+            align:"center",
+            dataIndex: 'planStartDate'
+          },
+          {
+            title:'璁″垝缁撴潫鏃ユ湡',
+            align:"center",
+            dataIndex: 'planEndDate'
+          },
+          {
+            title:'瀹為檯寮�濮嬫椂闂�',
             align:"center",
             dataIndex: 'actualStartTime'
-           },
-		   {
-            title: '瀹為檯缁撴潫鏃堕棿',
+          },
+          {
+            title:'瀹為檯缁撴潫鏃堕棿',
             align:"center",
             dataIndex: 'actualEndTime'
-           },
-		   {
-            title: '鎬婚噾棰�',
+          },
+          {
+            title:'鎬婚噾棰�',
             align:"center",
             dataIndex: 'totalAmount'
-           },
-		   {
-            title: '闄勪欢',
+          },
+          // {
+          //   title:'鏁呴殰鎻忚堪',
+          //   align:"center",
+          //   dataIndex: 'faultDescription'
+          // },
+          // {
+          //   title:'鐢宠鍘熷洜',
+          //   align:"center",
+          //   dataIndex: 'applicantReason'
+          // },
+          {
+            title:'璐d换浜�',
             align:"center",
-            dataIndex: 'attachment'
-           },
-		   {
-            title: '缁翠慨鎻忚堪',
+            dataIndex: 'responsiblePerson_dictText'
+          },
+          {
+            title:'澶囨敞',
             align:"center",
-            dataIndex: 'repairDescription'
-           },
-		   {
-            title: '缁翠慨鏂瑰紡',
-            align:"center",
-            dataIndex: 'repairMethod'
-           },
-		   {
-            title: '濮斿鍏徃',
-            align:"center",
-            dataIndex: 'outsourcedCompany'
-           },
-		   {
-            title: '璐d换浜�',
-            align:"center",
-            dataIndex: 'responsiblePerson'
-           },
+            dataIndex: 'remark'
+          },
           {
             title: '鎿嶄綔',
             dataIndex: 'action',
             align:"center",
-            scopedSlots: { customRender: 'action' },
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
           }
         ],
-		url: {
+        url: {
           list: "/eam/eamMajorPartialRepair/list",
           delete: "/eam/eamMajorPartialRepair/delete",
           deleteBatch: "/eam/eamMajorPartialRepair/deleteBatch",
-          exportXlsUrl: "eam/eamMajorPartialRepair/exportXls",
+          exportXlsUrl: "/eam/eamMajorPartialRepair/exportXls",
           importExcelUrl: "eam/eamMajorPartialRepair/importExcel",
-       },
-    }
-  },
-  computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    }
-  },
+          submit: "eam/eamMajorPartialRepair/submit",
+          submitBatch: "eam/eamMajorPartialRepair/submitBatch",
+          confirm: "eam/eamMajorPartialRepair/confirm",
+          confirmBatch: "eam/eamMajorPartialRepair/confirmBatch",
+          repeal: "eam/eamMajorPartialRepair/repeal",
+          repealBatch: "eam/eamMajorPartialRepair/repealBatch"
+        },
+        planDateRange: [],
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
     methods: {
-     
+      searchReset() {
+        this.planDateRange = []
+        this.queryParam = {}
+        this.loadData(1);
+      },
+      selectDateChange(value, dateString) {
+        if (dateString && dateString.length === 2) {
+          this.queryParam.planStartDate = dateString[0]
+          this.queryParam.planEndDate = dateString[1]
+        }
+      },
+      handleFill(record) {
+        this.$refs.modalDetailForm.open(record);
+        this.$refs.modalDetailForm.title = "濉姤";
+        this.$refs.modalDetailForm.disableSubmit = false;
+      },
+      handleSubmit(id) {
+        getAction(this.url.submit,{id:id}).then((res)=>{
+          if(res.success){
+            this.loadData();
+            this.$message.success(res.message);
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+      },
+      handleConfirm(id) {
+        getAction(this.url.confirm,{id:id}).then((res)=>{
+          if(res.success){
+            this.loadData();
+            this.$message.success(res.message);
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+      },
+      batchSubmit() {
+        if (this.selectedRowKeys.length <= 0) {
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨涓�鏉¤褰�'
+          })
+          return
+        } else {
+          var ids = ''
+          for (var a = 0; a < this.selectedRowKeys.length; a++) {
+            ids += this.selectedRowKeys[a] + ','
+          }
+          var that = this
+          this.$confirm({
+            title: '纭鎻愪氦',
+            content: '鏄惁鎻愪氦閫変腑鏁版嵁锛屽彧鏈夊緟鎻愪氦鐘舵�佺殑鏁版嵁鎵嶅彲鎻愪氦鎴愬姛?',
+            onOk: function () {
+              that.loading = true
+              getAction(that.url.submitBatch, { ids: ids }).then((res) => {
+                if (res.success) {
+                  //閲嶆柊璁$畻鍒嗛〉闂
+                  that.reCalculatePage(that.selectedRowKeys.length)
+                  // that.$message.success(res.message);
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.loadData()
+                  that.onClearSelected()
+                } else {
+                  // that.$message.warning(res.message);
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              }).finally(() => {
+                that.loading = false
+              })
+            }
+          })
+        }
+      },
+      batchConfirm() {
+        if (this.selectedRowKeys.length <= 0) {
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨涓�鏉¤褰�'
+          })
+          return
+        } else {
+          var ids = ''
+          for (var a = 0; a < this.selectedRowKeys.length; a++) {
+            ids += this.selectedRowKeys[a] + ','
+          }
+          var that = this
+          this.$confirm({
+            title: '鏄惁纭',
+            content: '鏄惁纭閫変腑鏁版嵁锛屽彧鏈夊緟纭鐘舵�佺殑鏁版嵁鎵嶅彲纭鎴愬姛?',
+            onOk: function () {
+              that.loading = true
+              getAction(that.url.confirmBatch, { ids: ids }).then((res) => {
+                if (res.success) {
+                  //閲嶆柊璁$畻鍒嗛〉闂
+                  that.reCalculatePage(that.selectedRowKeys.length)
+                  // that.$message.success(res.message);
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.loadData()
+                  that.onClearSelected()
+                } else {
+                  // that.$message.warning(res.message);
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              }).finally(() => {
+                that.loading = false
+              })
+            }
+          })
+        }
+      },
+      batchRepeal() {
+        if (this.selectedRowKeys.length <= 0) {
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨涓�鏉¤褰�'
+          })
+          return
+        } else {
+          var ids = ''
+          for (var a = 0; a < this.selectedRowKeys.length; a++) {
+            ids += this.selectedRowKeys[a] + ','
+          }
+          var that = this
+          this.$confirm({
+            title: '鏄惁浣滃簾',
+            content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟鎻愪氦鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?',
+            onOk: function () {
+              that.loading = true
+              getAction(that.url.repealBatch, { ids: ids }).then((res) => {
+                if (res.success) {
+                  //閲嶆柊璁$畻鍒嗛〉闂
+                  that.reCalculatePage(that.selectedRowKeys.length)
+                  // that.$message.success(res.message);
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.loadData()
+                  that.onClearSelected()
+                } else {
+                  // that.$message.warning(res.message);
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              }).finally(() => {
+                that.loading = false
+              })
+            }
+          })
+        }
+      },
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'repairCode',text:'缁翠慨缂栫爜',dictCode:''})
+        fieldList.push({type:'string',value:'repairName',text:'椤圭洰鍚嶇О',dictCode:''})
+        fieldList.push({type:'string',value:'repairStatus',text:'缁翠慨鐘舵��',dictCode:''})
+        fieldList.push({type:'string',value:'repairType',text:'缁翠慨绫诲瀷',dictCode:''})
+        fieldList.push({type:'string',value:'applicant',text:'鐢宠浜�',dictCode:''})
+        fieldList.push({type:'string',value:'applicantProduction',text:'鐢宠杞﹂棿',dictCode:''})
+        fieldList.push({type:'date',value:'planStartDate',text:'璁″垝寮�濮嬫棩鏈�'})
+        fieldList.push({type:'date',value:'planEndDate',text:'璁″垝缁撴潫鏃ユ湡'})
+        fieldList.push({type:'date',value:'actualStartTime',text:'瀹為檯寮�濮嬫椂闂�'})
+        fieldList.push({type:'date',value:'actualEndTime',text:'瀹為檯缁撴潫鏃堕棿'})
+        fieldList.push({type:'BigDecimal',value:'totalAmount',text:'鎬婚噾棰�',dictCode:''})
+        fieldList.push({type:'string',value:'faultDescription',text:'鏁呴殰鎻忚堪',dictCode:''})
+        fieldList.push({type:'string',value:'applicantReason',text:'鐢宠鍘熷洜',dictCode:''})
+        fieldList.push({type:'string',value:'responsiblePerson',text:'璐d换浜�',dictCode:''})
+        fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''})
+        this.superFieldList = fieldList
+      }
     }
   }
 </script>

--
Gitblit v1.9.3