From ba77fdc6a30c9ad0941e40319f8c4f6fe6fdf9f1 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期四, 07 八月 2025 10:30:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue |  204 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 204 insertions(+), 0 deletions(-)

diff --git a/src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue b/src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue
new file mode 100644
index 0000000..a9059be
--- /dev/null
+++ b/src/views/mdc/base/modules/mdcUtilizationRate/MdcUtilizationRateModel.vue
@@ -0,0 +1,204 @@
+<template>
+  <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading"
+           :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴">
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="绫诲埆">
+              <a-input :disabled="true" v-decorator="['rateParameterCategory', validatorRules.rateParameterCategory]"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="绛夌骇" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input :disabled="true" v-decorator="['rateParameterLevel', validatorRules.rateParameterLevel]"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-item label="鏈�灏忚寖鍥达紙鍗曚綅锛�%锛�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ユ渶灏忚寖鍥�"
+                       v-decorator="['minimumRange',validatorRules.minimumRange]"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-item label="鏈�澶ц寖鍥达紙鍗曚綅锛�%锛�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ユ渶澶ц寖鍥�"
+                       v-decorator="['maximumRange',validatorRules.maximumRange]"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-item label="棰滆壊" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input type="color" v-decorator="['rateParameterColor',validatorRules.rateParameterColor]"></a-input>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import pick from 'lodash.pick'
+  import {
+    getAction,
+    postAction,
+    requestPut
+  } from '@/api/manage'
+  import {
+    duplicateCheck
+  } from '@/api/api'
+
+  export default {
+    name: 'MdcUtilizationRateModel',
+    props: {},
+    data() {
+      return {
+        title: '',
+        visible: false,
+        show: false,
+        model: {},
+        checked: false,
+        labelCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 6
+          }
+        },
+        wrapperCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 18
+          }
+        },
+        confirmLoading: false,
+        form: this.$form.createForm(this),
+        validatorRules: {},
+        url: {
+          edit: '/mdc/MdcUtilizationRate/editUtilization'
+        },
+        disableSubmit: true
+      }
+    },
+    created() {
+    },
+    methods: {
+      //绾ц仈妗唎nChange浜嬩欢
+      onChange(value) {
+
+      },
+      edit(record) {
+        this.form.resetFields()
+        this.model = Object.assign({}, record)
+        this.visible = true
+        this.$nextTick(() => {
+          this.form.setFieldsValue(pick(this.model, 'rateParameterCategory', 'rateParameterLevel', 'minimumRange', 'maximumRange', 'rateParameterColor'))
+        })
+      },
+      close() {
+        this.$emit('close')
+        this.visible = false
+        this.show = false
+      },
+      handleOk() {
+        const that = this
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true
+            let formData = Object.assign(this.model, values)
+            requestPut(this.url.edit, formData, {
+              id: this.model.id
+            }).then((res) => {
+              if (res.success) {
+                // that.$message.success("淇濆瓨鎴愬姛")
+                that.$notification.success({
+                  message: '娑堟伅',
+                  description: '淇濆瓨鎴愬姛'
+                })
+                that.$emit('ok', res.result)
+              } else {
+                // that.$message.warning(res.message)
+                that.$notification.warning({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+              }
+            }).finally(() => {
+              that.confirmLoading = false
+              that.close()
+            })
+          }
+        })
+      },
+      handleCancel() {
+        this.close()
+      },
+      loadCascade() {
+        getAction(this.url.loadCascadeData).then((res) => {
+          if (res.success) {
+            this.partCategoryCascade = res.result
+          }
+        })
+      },
+      onCascadeChange(value, selectedOptions) {
+        this.cascadeDefaultValue = [...value]
+      },
+      filter(inputValue, path) {
+        return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
+      },
+      //楠岃瘉 缂栫爜
+      validateNum(rule, value, callback) {
+        var params = {
+          tableName: 'lxmes_base_part',
+          fieldName: 'num',
+          fieldVal: value,
+          dataId: this.model.id,
+          //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true
+          delFlag: 'true'
+        }
+        duplicateCheck(params).then((res) => {
+          if (res.success) {
+            callback()
+          } else {
+            callback('瀛樿揣缂栫爜宸插瓨鍦�!')
+          }
+        })
+      },
+      checkboxChange(e) {
+        this.checked = e.target.checked
+      }
+    }
+  }
+</script>
+
+<style scoped>
+  .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>

--
Gitblit v1.9.3