style:企业信息备案
Showing
1 changed file
with
66 additions
and
30 deletions
... | @@ -20,7 +20,7 @@ | ... | @@ -20,7 +20,7 @@ |
20 | </el-row> | 20 | </el-row> |
21 | <el-row> | 21 | <el-row> |
22 | <el-col :span="12"> | 22 | <el-col :span="12"> |
23 | <el-form-item label="证件种类" prop="zjzl"> | 23 | <el-form-item label="证件种类:" prop="zjzl"> |
24 | <el-select | 24 | <el-select |
25 | clearable | 25 | clearable |
26 | v-model="ruleForm.zjzl" | 26 | v-model="ruleForm.zjzl" |
... | @@ -37,7 +37,7 @@ | ... | @@ -37,7 +37,7 @@ |
37 | </el-col> | 37 | </el-col> |
38 | <el-col :span="12"> | 38 | <el-col :span="12"> |
39 | <el-form-item label="证件号:" prop="zjh"> | 39 | <el-form-item label="证件号:" prop="zjh"> |
40 | <el-input v-model="ruleForm.zjh"></el-input> | 40 | <el-input v-model="ruleForm.zjh" maxlength="18"></el-input> |
41 | </el-form-item> | 41 | </el-form-item> |
42 | </el-col> | 42 | </el-col> |
43 | </el-row> | 43 | </el-row> |
... | @@ -50,13 +50,13 @@ | ... | @@ -50,13 +50,13 @@ |
50 | </el-col> | 50 | </el-col> |
51 | <el-col :span="12"> | 51 | <el-col :span="12"> |
52 | <el-form-item label="法人电话:" prop="frdh"> | 52 | <el-form-item label="法人电话:" prop="frdh"> |
53 | <el-input v-model="ruleForm.frdh"></el-input> | 53 | <el-input v-model="ruleForm.frdh" maxlength="11"></el-input> |
54 | </el-form-item> | 54 | </el-form-item> |
55 | </el-col> | 55 | </el-col> |
56 | </el-row> | 56 | </el-row> |
57 | <el-row> | 57 | <el-row> |
58 | <el-col :span="12"> | 58 | <el-col :span="12"> |
59 | <el-form-item label="单位地址:"> | 59 | <el-form-item label="单位地址:" prop="dwdz"> |
60 | <el-input v-model="ruleForm.dwdz"></el-input> | 60 | <el-input v-model="ruleForm.dwdz"></el-input> |
61 | </el-form-item> | 61 | </el-form-item> |
62 | </el-col> | 62 | </el-col> |
... | @@ -77,6 +77,27 @@ | ... | @@ -77,6 +77,27 @@ |
77 | </template> | 77 | </template> |
78 | 78 | ||
79 | <script> | 79 | <script> |
80 | const checkPhone = (rule, value, callback) => { | ||
81 | let regPone = null | ||
82 | let mobile = /^(1[3456789]\d{9})$/ //手机号 | ||
83 | let tel = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/ // 座机 | ||
84 | if (value && value[0] === '0') {// 检查 value 是否存在并且不是 null 或者 undefined | ||
85 | regPone = tel | ||
86 | } else if (value && value[0] !== '0') { | ||
87 | regPone = mobile | ||
88 | } | ||
89 | if (regPone === null) { | ||
90 | return callback( | ||
91 | new Error('请输入电话') | ||
92 | ) | ||
93 | } else if (!regPone.test(value)) { | ||
94 | return callback( | ||
95 | new Error("请输入正确的电话格式,其中座机格式'区号-座机号码'") | ||
96 | ) | ||
97 | } else { | ||
98 | callback() | ||
99 | } | ||
100 | }; | ||
80 | import store from '@/store/index.js' | 101 | import store from '@/store/index.js' |
81 | import { addQy, update } from "@/api/xxba.js" | 102 | import { addQy, update } from "@/api/xxba.js" |
82 | import clxx from './clxx/index.vue' | 103 | import clxx from './clxx/index.vue' |
... | @@ -126,23 +147,29 @@ | ... | @@ -126,23 +147,29 @@ |
126 | zslx: 2 | 147 | zslx: 2 |
127 | } | 148 | } |
128 | ], | 149 | ], |
129 | //证书入库业务号参数 | ||
130 | ywhQueryForm: { | ||
131 | serialtype: 'zsrkbh', | ||
132 | serialname: '证书入库编号', | ||
133 | serialcode: 'zsrk', | ||
134 | digit: '5' | ||
135 | }, | ||
136 | rules: { | 150 | rules: { |
137 | batchNo: [ | 151 | |
138 | { required: true, message: '入库编号不能为空', trigger: 'blur' } | 152 | qymc: [ |
153 | { required: true, message: '企业名称不能为空', trigger: 'blur' } | ||
154 | ], | ||
155 | dh: [ | ||
156 | { required: true, validator: checkPhone, trigger: ["blur"] }, | ||
157 | ], | ||
158 | zjzl: [ | ||
159 | { required: true, message: '请选择证件种类', trigger: 'change' } | ||
160 | ], | ||
161 | zjh: [ | ||
162 | { required: true, message: '请输入证件号', trigger: 'blur' } | ||
163 | ], | ||
164 | frmc: [ | ||
165 | { required: true, message: '请输入法人名称', trigger: 'blur' } | ||
166 | ], | ||
167 | frdh: [ | ||
168 | { required: true, validator: checkPhone, trigger: ["blur"] }, | ||
139 | ], | 169 | ], |
140 | djjg: [ | 170 | dwdz: [ |
141 | { required: true, message: '请选择登记机构', trigger: 'change' } | 171 | { required: true, message: '请输入单位地址', trigger: 'blur' } |
142 | ], | 172 | ], |
143 | rksj: [ | ||
144 | { required: true, message: '请选择入库时间', trigger: 'change' } | ||
145 | ] | ||
146 | } | 173 | } |
147 | } | 174 | } |
148 | }, | 175 | }, |
... | @@ -164,13 +191,14 @@ | ... | @@ -164,13 +191,14 @@ |
164 | * @author: renchao | 191 | * @author: renchao |
165 | */ | 192 | */ |
166 | submitForm () { | 193 | submitForm () { |
167 | let list = Object.keys(this.formData).length | 194 | let that = this |
168 | this.tableForm.forEach((item, index) => { | 195 | this.tableForm.forEach((item, index) => { |
169 | if (item.bs < 0) { | 196 | if (item.bs < 0) { |
170 | return; | 197 | return; |
171 | } | 198 | } |
172 | }) | 199 | }) |
173 | if (list > 0) { | 200 | if (this.formData.isAdd != 1) { |
201 | store.dispatch('user/reWorkFresh', false) | ||
174 | update(this.ruleForm).then(res => { | 202 | update(this.ruleForm).then(res => { |
175 | if (res.code == 200) { | 203 | if (res.code == 200) { |
176 | this.$message.success('保存成功') | 204 | this.$message.success('保存成功') |
... | @@ -185,17 +213,25 @@ | ... | @@ -185,17 +213,25 @@ |
185 | } | 213 | } |
186 | }) | 214 | }) |
187 | } else { | 215 | } else { |
188 | addQy(this.ruleForm).then(res => { | 216 | that.$refs['ruleForm'].validate((valid) => { |
189 | if (res.code == 200) { | 217 | if (valid) { |
190 | this.$message.success('保存成功') | 218 | store.dispatch('user/reWorkFresh', false) |
191 | this.$emit("input", false); | 219 | addQy(this.ruleForm).then(res => { |
192 | this.$refs['ruleForm'].resetFields(); | 220 | if (res.code == 200) { |
193 | this.resetTableFields(); | 221 | that.$message.success('保存成功') |
194 | this.closeDialog(); | 222 | that.$emit("input", false); |
195 | //刷新列表 | 223 | that.$refs['ruleForm'].resetFields(); |
196 | store.dispatch('user/reWorkFresh', true) | 224 | that.resetTableFields(); |
225 | that.closeDialog(); | ||
226 | //刷新列表 | ||
227 | store.dispatch('user/reWorkFresh', true) | ||
228 | } else { | ||
229 | that.$message.error(res.message); | ||
230 | } | ||
231 | }) | ||
197 | } else { | 232 | } else { |
198 | this.$message.error(res.message); | 233 | this.$message.error('请完善表单'); |
234 | return false; | ||
199 | } | 235 | } |
200 | }) | 236 | }) |
201 | } | 237 | } | ... | ... |
-
Please register or sign in to post a comment