From 65ce2e4b82f2400493fc55b1a8685bbbc1ba30dd Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期二, 24 六月 2025 09:04:44 +0800
Subject: [PATCH] 流程页面样式

---
 src/views/system/modules/SysBusinessCodeRuleModal.vue |  138 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/src/views/system/modules/SysBusinessCodeRuleModal.vue b/src/views/system/modules/SysBusinessCodeRuleModal.vue
new file mode 100644
index 0000000..af61492
--- /dev/null
+++ b/src/views/system/modules/SysBusinessCodeRuleModal.vue
@@ -0,0 +1,138 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴">
+
+    <a-spin :spinning="confirmLoading">
+      <a-form-model ref="form" :model="model" :rules="validatorRules">
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessName" label="涓氬姟鍚嶇О">
+          <a-input placeholder="璇疯緭鍏ヤ笟鍔″悕绉�" v-model="model.businessName" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessCode" label="涓氬姟缂栫爜">
+          <a-input placeholder="璇疯緭鍏ヤ笟鍔$紪鐮�" v-model="model.businessCode" :disabled="editable" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prefix" label="缂栫爜鍓嶇紑">
+          <a-input placeholder="璇疯緭鍏ョ紪鐮佸墠缂�" v-model="model.prefix" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearFormat" label="骞翠唤缂栫爜鏍煎紡">
+          <a-input placeholder="鍙傝�冩棩鏈熷勾浠界紪鐮佹牸寮�" v-model="model.yearFormat" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="monthFormat" label="鏈堜唤缂栫爜鏍煎紡">
+          <a-input placeholder="鍙傝�冩棩鏈熸湀浠界紪鐮佹牸寮�" v-model="model.monthFormat" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayFormat" label="澶╃紪鐮佹牸寮�">
+          <a-input placeholder="鍙傝�冩棩鏈熷ぉ鐨勭紪鐮佹牸寮�" v-model="model.dayFormat" />
+        </a-form-model-item>
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="seqLength" label="搴忓彿闀垮害">
+          <a-input-number v-model="model.seqLength" :min="1" :max="10" :precision="0" />
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+import { httpAction } from '@/api/manage'
+import { validateDuplicateValue } from '@/utils/util'
+
+export default {
+  name: 'SysBusinessCodeRuleModal',
+  data() {
+    return {
+      title: '鎿嶄綔',
+      visible: false,
+      editable: false,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 }
+      },
+      confirmLoading: false,
+      validatorRules: {
+        businessName: [
+          { required: true, message: '璇疯緭鍏ヤ笟鍔″悕绉�!' }
+        ],
+        businessCode: [
+          { required: true, message: '璇疯緭鍏ヤ笟鍔$紪鐮�!' },
+          { validator: (rule, value, callback) => validateDuplicateValue('sys_business_code_rule', 'business_code', value, this.model.id, callback) }
+        ],
+        seqLength: [
+          { required: true, message: '璇疯緭鍏ュ簭鍙烽暱搴�!' }
+        ]
+      },
+      url: {
+        add: '/sys/sysBusinessCodeRule/add',
+        edit: '/sys/sysBusinessCodeRule/edit'
+      }
+    }
+  },
+  created() {
+  },
+  methods: {
+    add() {
+      this.model = {};
+      this.model.seqLength = 4;
+      this.editable = false;
+      this.visible = true
+    },
+    edit(record) {
+      this.editable = true;
+      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 = ''
+          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.$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()
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+
+</style>
\ No newline at end of file

--
Gitblit v1.9.3