From 5cbba170e270e6f1c99a91e27dbb7951a27d596a Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期五, 24 十一月 2023 16:41:32 +0800
Subject: [PATCH] 故障报修验收

---
 src/views/eam/modules/equipmentNew/EquipmentModal.vue   |   12 --
 src/views/eam/modules/malfunctionRepair/AcceptModel.vue |  141 +++++++++++++++++++++++++++++++++++
 src/views/eam/MalfunctionRepair.vue                     |   51 ++++++++----
 3 files changed, 178 insertions(+), 26 deletions(-)

diff --git a/src/views/eam/MalfunctionRepair.vue b/src/views/eam/MalfunctionRepair.vue
index 12934f5..4358a35 100644
--- a/src/views/eam/MalfunctionRepair.vue
+++ b/src/views/eam/MalfunctionRepair.vue
@@ -215,7 +215,11 @@
           slot="action"
           slot-scope="text, record"
         >
-          <a-popconfirm
+          <a
+            :disabled=" record.status !== '4'"
+            @click="handleAccept(record)"
+          >楠屾敹</a>
+          <!-- <a-popconfirm
             v-if="record.status == '1' || record.status == '4'"
             title="纭鎻愪氦鍚�?"
             @confirm="() =>handleCommit(record, 'commit')"
@@ -271,9 +275,9 @@
                 </a-popconfirm>
               </a-menu-item>
             </a-menu>
-          </a-dropdown>
+          </a-dropdown> -->
         </span>
-        <span slot="faultDescription" slot-scope="text">
+        <span slot="jell" slot-scope="text">
             <j-ellipsis :value="text" :length="10" />
         </span>
 
@@ -307,6 +311,10 @@
       @ok='approvalModalFormOk'
       @cancel='approvalModalFormOk'
     ></approvel-modal>
+    <accept-model
+    ref="acceptModel"
+    @ok="modalFormOk"
+    ></accept-model>
   </a-card>
 </template>
   
@@ -321,6 +329,7 @@
 import ApprovelModal from './modules/malfunctionRepair/ApprovelModal'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
+import AcceptModel from './modules/malfunctionRepair/AcceptModel'
 
 export default {
   name: 'MalfunctionRepairList',
@@ -329,7 +338,8 @@
     MalfunctionRepairModal,
     FaultDescriptionList,
     ApprovelModal,
-    JEllipsis 
+    JEllipsis,
+    AcceptModel,
   },
   data() {
     return {
@@ -430,24 +440,27 @@
           align: "center",
           dataIndex: 'createBy'
         },
-        // {
-        //   title: '鍒涘缓鏃堕棿',
-        //   align: "center",
-        //   dataIndex: 'createTime',
-        // },
+        {
+          title: '楠屾敹鎰忚',
+          align: "center",
+          dataIndex: 'errUda5',
+          scopedSlots: { 
+            customRender: 'jell' 
+          }
+        },
         {
           title: '澶囨敞',
           align: "center",
           dataIndex: 'remark'
         },
-        // {
-        //   title: '鎿嶄綔',
-        //   dataIndex: 'action',
-        //   align: "center",
-        //   fixed: "right",
-        //   width: 200,
-        //   scopedSlots: { customRender: 'action' }
-        // }
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: "center",
+          fixed: "right",
+          width: 200,
+          scopedSlots: { customRender: 'action' }
+        }
       ],
       url: {
         list: "/eam/equipmentReportRepair/getReportRepairList",
@@ -632,6 +645,10 @@
     timeChange(){
       this.queryParam.faultStartTime = moment(this.faultTime[0]).format("YYYY-MM-DD HH:mm:ss")
       this.queryParam.faultEndTime = moment(this.faultTime[1]).format("YYYY-MM-DD HH:mm:ss")
+    },
+    handleAccept(record){
+      this.$refs.acceptModel.title="楠屾敹"
+      this.$refs.acceptModel.edit(record)
     }
   }
 }
diff --git a/src/views/eam/modules/equipmentNew/EquipmentModal.vue b/src/views/eam/modules/equipmentNew/EquipmentModal.vue
index 5db4bea..3932501 100644
--- a/src/views/eam/modules/equipmentNew/EquipmentModal.vue
+++ b/src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -117,15 +117,9 @@
               :wrapperCol="wrapperCol"
               prop="useId"
             >
-              <!-- <a-tree-select
-                style="width: 100%"
-                :disabled="formDisabled"
-                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
-                :tree-data="treeData"
-                placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬"
-                tree-default-expand-all
-                v-model="model.useId"
-              /> -->
+            
+            
+
               <j-dict-select-tag
                 allow-clear
                 :disabled="formDisabled"
diff --git a/src/views/eam/modules/malfunctionRepair/AcceptModel.vue b/src/views/eam/modules/malfunctionRepair/AcceptModel.vue
new file mode 100644
index 0000000..2898bae
--- /dev/null
+++ b/src/views/eam/modules/malfunctionRepair/AcceptModel.vue
@@ -0,0 +1,141 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴"
+  >
+    <a-spin :spinning="confirmLoading">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+      >
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-model-item
+              label="楠屾敹鎰忚"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="errUda5"
+            >
+               <a-textarea v-model="model.remark" rows="4" placeholder="楠屾敹鎰忚" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+<script>
+import { httpAction } from '@/api/manage'
+import { validateDuplicateValue } from '@/utils/util'
+import pick from 'lodash.pick'
+import { postAction, requestPut, getAction } from '@/api/manage'
+import { duplicateCheck } from '@/api/api'
+import moment from 'moment'
+import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
+import { JVXETypes } from '@/components/jeecg/JVxeTable'
+export default {
+  name: "NodeModel",
+  mixins: [JVxeTableModelMixin],
+  components: {
+    validateDuplicateValue,
+  },
+  props: {
+    disableSubmit: {
+      type: Boolean,
+      default: false,
+      required: false
+    },
+    caytegoryParam: {
+      type: String,
+      default: '',
+      required: false
+    }
+  },
+  data() {
+    return {
+      title: "鎿嶄綔",
+      width: 1500,
+      visible: false,
+      model: {
+      },
+      labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+      },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+      },
+
+      confirmLoading: false,
+      validatorRules: {
+        remark: [
+          { min: 0, max: 100, message: '闀垮害涓嶈秴杩� 100 涓瓧绗�', trigger: 'blur' },
+        ],
+      },
+      url: {
+        accept: "/eam/equipmentReportRepair/accept",
+      },
+    }
+  },
+  created() {
+    //澶囦唤model鍘熷鍊�
+    this.initOptions();
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
+  methods: {
+    add() {
+      this
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    close() {
+      this.$emit('close');
+      this.visible = false;
+      this.$refs.form.clearValidate();
+    },
+    handleOk() {
+      const that = this;
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          that.confirmLoading = true;
+          let httpurl = this.url.accept;
+          let method = 'put';
+          httpAction(httpurl, this.model, method).then((res) => {
+            if (res.success) {
+              that.$message.success(res.message);
+              that.$emit('ok');
+            } else {
+              that.$message.warning(res.message);
+            }
+          }).finally(() => {
+            that.confirmLoading = false;
+            that.close();
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleCancel() {
+      this.close()
+    },
+  },
+  computed: {
+    formDisabled() {
+      return this.disableSubmit
+    },
+  },
+}
+</script>
\ No newline at end of file

--
Gitblit v1.9.3