From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期一, 18 九月 2023 13:24:30 +0800
Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430

---
 src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue |  447 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 447 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue b/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
new file mode 100644
index 0000000..ba98bf4
--- /dev/null
+++ b/src/views/eam/modules/malfunctionRepair/MalfunctionRepaireModal.vue
@@ -0,0 +1,447 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="1200"
+    :visible="visible"
+    :maskClosable="false"
+    @ok="handleOk"
+    cancelText="鍏抽棴"
+    @cancel="handleCancel"
+    :confirmLoading="confirmLoading"
+  >
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+        <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="鍗曟嵁鍙�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                :disabled="disableSubmit"
+                placeholder="璇疯緭鍏ュ崟鎹彿"
+                v-decorator="['num', validatorRules.num]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="鏄惁鍋滄満缁翠慨"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <j-dict-select-tag
+                allow-clear
+                :disabled="disableSubmit"
+                :placeholder="disableSubmit?'':'璇烽�夋嫨鏄惁鍋滄満缁翠慨'"
+                :triggerChange="true"
+                dictCode="is_stop"
+                v-decorator="['isStop', validatorRules.isStop]"
+              />
+            </a-form-item>
+
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="璁惧缂栫爜"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input-search
+                :disabled="disableSubmit"
+                placeholder="璇烽�夋嫨璁惧锛�"
+                enter-button
+                @search="onSearchEquipmentList()"
+                :read-only="true"
+                v-decorator="['equipmentNum', validatorRules.equipmentNum]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="鏁呴殰鏃堕棿"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <j-date
+                :disabled="disableSubmit"
+                style="width: 100%"
+                placeholder="璇烽�夋嫨鏁呴殰鏃堕棿"
+                :showTime="true"
+                dateFormat="YYYY-MM-DD HH:mm:ss"
+                v-decorator="['faultTime', validatorRules.faultTime]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="璁惧鍚嶇О"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                :disabled="true"
+                enter-button
+                :read-only="true"
+                v-decorator="['equipmentName', validatorRules.equipmentName]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="璁惧瑙勬牸"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                :disabled="true"
+                enter-button
+                :read-only="true"
+                v-decorator="['equipmentSpecification', validatorRules.equipmentSpecification]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-row
+            hidden
+            :gutter="24"
+          >
+            <a-col :span="12">
+              <a-form-item
+                label="璁惧Id"
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+              >
+                <a-input
+                  :disabled="true"
+                  :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囩紪鐮�/鍚嶇О/鍨嬪彿'"
+                  v-decorator="['equipmentId', validatorRules.equipmentId ]"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item
+                label="浣跨敤閮ㄩ棬Id"
+                :labelCol="labelCol"
+                :wrapperCol="wrapperCol"
+              >
+                <a-input
+                  :disabled="true"
+                  :placeholder="disableSubmit?'':'璇疯緭鍏ヤ娇鐢ㄩ儴闂╥d'"
+                  v-decorator="['useDepartId', validatorRules.useDepartId ]"
+                />
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="璁惧鍨嬪彿"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-input
+                :disabled="true"
+                enter-button
+                :read-only="true"
+                v-decorator="['equipmentModel', validatorRules.equipmentModel]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="浣跨敤閮ㄩ棬"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <!-- <a-select
+                :placeholder="disableSubmit?'':'璇烽�夋嫨浣跨敤閮ㄩ棬'"
+                :options="this.departs"
+                style="width: 100%"
+                :disabled="disableSubmit"
+                v-decorator="['useDepartId', validatorRules.useDepartId]"
+              /> -->
+              <a-input
+                allow-clear
+                :disabled="true"
+                :placeholder="disableSubmit?'':'璇疯緭鍏ヤ娇鐢ㄩ儴闂�'"
+                v-decorator="['departName', validatorRules.departName ]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="绱ф�ョ▼搴�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <j-dict-select-tag
+                allow-clear
+                :disabled="disableSubmit"
+                :placeholder="disableSubmit?'':'璇烽�夋嫨绱ф�ョ▼搴�'"
+                :triggerChange="true"
+                dictCode="urgency"
+                v-decorator="['urgency', validatorRules.urgency]"
+              />
+            </a-form-item>
+          </a-col>
+
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="鏁呴殰鎻忚堪"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-textarea
+                :disabled="disableSubmit"
+                allow-clear
+                :rows="5"
+                placeholder="璇疯緭鍏ユ晠闅滄弿杩�"
+                v-decorator="['faultDescription', validatorRules.faultDescription]"
+              />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24/2">
+            <a-form-item
+              label="澶囨敞"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <a-textarea
+                :disabled="disableSubmit"
+                allow-clear
+                :rows="5"
+                placeholder="璇疯緭鍏ュ娉�"
+                v-decorator="['remark', validatorRules.remark]"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <!-- <a-row :gutter="24">
+          <a-col :span="24/2">
+            <a-form-item
+              label="鏁呴殰鐓х墖"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <j-image-upload
+                :disabled="disableSubmit"
+                :isMultiple="true"
+                v-decorator="['photo', {}]"
+              ></j-image-upload>
+
+            </a-form-item>
+          </a-col>
+        </a-row> -->
+      </a-form>
+    </a-spin>
+
+    <template slot="footer">
+      <a-button
+        :style="{marginRight: '8px'}"
+        @click="handleCancel()"
+      >
+        鍏抽棴
+      </a-button>
+
+      <a-button
+        @click="handleOk()"
+        type="primary"
+        :loading="confirmLoading"
+      >纭畾</a-button>
+    </template>
+
+    <equipment-list
+      ref="EquipmentList"
+      @sendEquipmentRecord='sendEquipmentRecord'
+    ></equipment-list>
+
+  </a-modal>
+
+</template>
+
+<script>
+import { getAction, postAction, requestPut } from '@/api/manage'
+import pick from 'lodash.pick'
+import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
+import { duplicateCheck } from '@/api/api'
+import Tooltip from 'ant-design-vue/es/tooltip'
+// import JImageUpload from '@/components/jeecg/JImage2Upload'
+import EquipmentList from './EquipmentList'
+import Vue from 'vue'
+
+export default {
+  name: "MalfunctionRepaireModal",
+  components: {
+    JMultiSelectTag,
+    Tooltip,
+    // JImageUpload,
+    EquipmentList
+  },
+  data() {
+    return {
+      title: "鎿嶄綔",
+      visible: false,
+      disableSubmit: false,
+      codeDisable: true,
+      model: {},
+      departs: [],
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      validatorRules: {
+        num: {
+          rules: [
+            { required: true, message: '璇疯緭鍏ュ叆搴撳崟缂栧彿!' },
+          ]
+        },
+        isStop: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨鏄惁鍋滄満!' },
+          ]
+        },
+        equipmentNum: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨璁惧!' },
+          ]
+        },
+        faultTime: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨鏁呴殰鏃堕棿!' },
+          ]
+        },
+      },
+      url: {
+        add: "/eam/equipmentReportRepair/add",
+        edit: "/eam/equipmentReportRepair/edit",
+        getSysDeparts: "/eam/equipment/getSysDeparts",
+      },
+
+      dataSource: [],
+    }
+  },
+
+  created() {
+    this.getSysDeparts()
+  },
+
+  methods: {
+
+    add() {
+      this.edit({})
+    },
+    edit(record) {
+      let that = this;
+      that.dataSource = [];
+      that.form.resetFields();
+      that.model = Object.assign({}, record);
+      that.visible = true;
+      that.$nextTick(() => {
+        that.form.setFieldsValue(pick(that.model, 'num', 'isStop', 'equipmentId', 'equipmentNum', 'equipmentName', 'equipmentModel', 'equipmentSpecification', 'urgency', 'useDepartId', 'departName', 'faultDescription', 'faultTime', 'remark', "photo"));
+      });
+      if (record.id) {
+        this.codeDisable = true;
+      } else {
+        this.codeDisable = false;
+      }
+    },
+
+    getSysDeparts() {
+      getAction(this.url.getSysDeparts).then((res) => {
+        if (res.success) {
+          this.departs = res.result
+        }
+      })
+    },
+
+    close() {
+      this.$emit('close');
+      this.visible = false;
+    },
+
+    handleCancel() {
+      this.close();
+    },
+
+    handleOk() {
+      const that = this;
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          that.confirmLoading = true;
+          let formData = Object.assign(this.model, values);
+          let obj;
+          if (!this.model.id) {
+            obj = postAction(this.url.add, formData);
+          } else {
+            obj = requestPut(this.url.edit, formData, { id: this.model.id });
+          }
+          obj.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();
+          })
+        }
+      })
+    },
+
+    onSearchEquipmentList() {
+      this.$refs.EquipmentList.list();
+      this.$refs.EquipmentList.title = "閫夋嫨璁惧淇℃伅";
+    },
+    sendEquipmentRecord(data) {
+      let record = data.record;
+      this.form.setFieldsValue({ equipmentName: record.name, equipmentId: record.id, equipmentNum: record.num, equipmentModel: record.model, equipmentSpecification: record.specification, useDepartId: record.useId, departName: record.useId_dictText });
+    },
+
+  },
+}
+</script>
+
+<style lang="less" scoped>
+/deep/ .frozenRowClass {
+  color: #c9c9c9;
+}
+.fontweight {
+  font-weight: bold;
+}
+.ant-btn {
+  padding: 0 10px;
+  margin-left: 3px;
+}
+
+.ant-form-item-control {
+  line-height: 0px;
+}
+
+/** 涓昏〃鍗曡闂磋窛 */
+.ant-form .ant-form-item {
+  margin-bottom: 10px;
+}
+
+/** Tab椤甸潰琛岄棿璺� */
+.ant-tabs-content .ant-form-item {
+  margin-bottom: 0px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3