From a4674a75bfffc500a049beafb74daaec50c8f87f Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期四, 17 七月 2025 17:46:06 +0800
Subject: [PATCH] 三保工单审批流程

---
 src/views/eam/maintenance/modules/EamSecondMaintenanceBatchOrderModal.vue |  156 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 156 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/maintenance/modules/EamSecondMaintenanceBatchOrderModal.vue b/src/views/eam/maintenance/modules/EamSecondMaintenanceBatchOrderModal.vue
new file mode 100644
index 0000000..7f78e9f
--- /dev/null
+++ b/src/views/eam/maintenance/modules/EamSecondMaintenanceBatchOrderModal.vue
@@ -0,0 +1,156 @@
+<template>
+  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen centered
+           :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴">
+    <a-spin :spinning="spinning">
+      <j-vxe-table ref="editableDetailTable" rowNumber rowSelection bordered alwaysEdit toolbar @added="addNewRow"
+                   :toolbarConfig="detail.toolbarConfig" keep-source :height="500"
+                   :dataSource="detail.dataSource" :columns="detail.columns"/>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+  import { getAction, httpAction } from '@/api/manage'
+  import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue'
+  import { JVXETypes } from '@comp/jeecg/JVxeTable'
+
+  export default {
+    name: 'EamSecondMaintenanceBatchOrderModal',
+    components: { MaintenanceEquipmentSelect },
+    data() {
+      return {
+        title: '鎿嶄綔',
+        visible: false,
+        confirmLoading: false,
+        spinning: false,
+        url: {
+          batchAdd: '/eam/secondMaintenanceOrder/batchAdd'
+        },
+        detail: {
+          dataSource: [],
+          columns: [
+            {
+              title: 'ID',
+              key: 'id',
+              type: JVXETypes.hidden
+            },
+            {
+              title: '宸ュ崟鍙�',
+              dataIndex: 'orderNum',
+              align: 'center',
+              type: JVXETypes.inputNumber,
+              disabled: true,
+              placeholder: '宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�'
+            },
+            {
+              title: '缁熶竴缂栫爜',
+              dataIndex: 'equipmentId',
+              align: 'center',
+              type: JVXETypes.slot,
+              slotName: 'equipmentId'
+            },
+            {
+              title: '瑙勮寖鍚嶇О',
+              dataIndex: 'standardName',
+              align: 'center',
+              type: JVXETypes.input,
+              disabled: true,
+              placeholder: '閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�'
+            },
+            {
+              title: '淇濆吇鏃ユ湡',
+              dataIndex: 'maintenanceDate',
+              align: 'center',
+              type: JVXETypes.date
+            },
+            {
+              title: '淇濆吇鍛ㄦ湡',
+              dataIndex: 'maintenancePeriod',
+              align: 'center',
+              type: JVXETypes.inputNumber,
+              defaultValue: '6'
+            }
+          ],
+          toolbarConfig: {
+            // prefix 鍓嶇紑锛泂uffix 鍚庣紑
+            slot: ['prefix', 'suffix'],
+            // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳
+            btn: ['add', 'remove', 'clearSelection']
+          }
+        }
+      }
+    },
+    methods: {
+      add() {
+        //鍒濆鍖栭粯璁ゅ��
+        this.model = { maintenancePeriod: 6 }
+        this.visible = true
+        this.editable = true
+        this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = []
+      },
+
+      addNewRow({ row }) {
+        console.log('row', row)
+        row.maintenancePeriod = 6
+        this.$refs.editableDetailTable.updateData()
+      },
+
+      autocompleteForm(selectObj) {
+        this.$set(this.model, 'standardName', selectObj.standardName)
+        this.$set(this.model, 'standardId', selectObj.id)
+        this.$set(this.model, 'equipmentId', selectObj.equipmentId)
+        if (!this.model.id) this.loadStandardDetail(selectObj.id)
+      },
+
+      async handleOk() {
+        const that = this
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = that.spinning = true
+            let httpUrl = ''
+            let method = ''
+            if (!this.model.id) {
+              httpUrl += this.url.add
+              method = 'post'
+            } else {
+              httpUrl += this.url.edit
+              method = 'put'
+            }
+            httpAction(httpUrl, this.model, method)
+              .then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.$emit('ok')
+                  that.close()
+                } else {
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = that.spinning = false
+              })
+          } else {
+            return false
+          }
+        })
+      },
+
+      handleCancel() {
+        this.close()
+      },
+
+      close() {
+        this.$emit('close')
+        this.visible = false
+      }
+
+    }
+  }
+</script>

--
Gitblit v1.9.3