|
@@ -191,6 +191,7 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -191,6 +191,7 @@ const assets = (props, {attrs, slots, emit}) => { |
191
|
|
191
|
|
192
|
|
192
|
|
193
|
export default {
|
193
|
export default {
|
|
|
194
|
+
|
194
|
name: 'projectPJIndex',
|
195
|
name: 'projectPJIndex',
|
195
|
template: '',
|
196
|
template: '',
|
196
|
components: {},
|
197
|
components: {},
|
|
@@ -209,7 +210,8 @@ export default { |
|
@@ -209,7 +210,8 @@ export default { |
209
|
},
|
210
|
},
|
210
|
},
|
211
|
},
|
211
|
data() {
|
212
|
data() {
|
212
|
- return {}
|
213
|
+ return {
|
|
|
214
|
+ }
|
213
|
},
|
215
|
},
|
214
|
setup(props, {attrs, slots, emit}) {
|
216
|
setup(props, {attrs, slots, emit}) {
|
215
|
let height = Vue.ref(window.innerHeight - 130);
|
217
|
let height = Vue.ref(window.innerHeight - 130);
|
|
@@ -239,6 +241,7 @@ export default { |
|
@@ -239,6 +241,7 @@ export default { |
239
|
politicsStatus:''
|
241
|
politicsStatus:''
|
240
|
})
|
242
|
})
|
241
|
|
243
|
|
|
|
244
|
+
|
242
|
// 获取表格数据
|
245
|
// 获取表格数据
|
243
|
let getPage = () => {
|
246
|
let getPage = () => {
|
244
|
proxy.$http.get("/api-web/bOpsPerson/search", {
|
247
|
proxy.$http.get("/api-web/bOpsPerson/search", {
|
|
@@ -258,17 +261,114 @@ export default { |
|
@@ -258,17 +261,114 @@ export default { |
258
|
}
|
261
|
}
|
259
|
|
262
|
|
260
|
|
263
|
|
261
|
- // 保存用户信息
|
|
|
262
|
- let saveUser = () => {
|
|
|
263
|
- if(!ruleForm.value.politicsStatus){
|
|
|
264
|
- proxy.$global.showMsg('政治面貌不能为空!',"warning");
|
|
|
265
|
- return false;
|
264
|
+ /**
|
|
|
265
|
+ * @Author LH
|
|
|
266
|
+ * @param rule
|
|
|
267
|
+ * @param value
|
|
|
268
|
+ * @param callback
|
|
|
269
|
+ * @returns {*}
|
|
|
270
|
+ */
|
|
|
271
|
+ const checkTel= (rule, value, callback) => {
|
|
|
272
|
+ var re1=/^0\d{2}-[1-9]\d{7}$/;
|
|
|
273
|
+ var re2=/^0\d{3}-[1-9]\{6,7}$/;
|
|
|
274
|
+ var result=re1.test(value)||re2.test(value);
|
|
|
275
|
+ if (!result) {
|
|
|
276
|
+ return callback(new Error('请输入正确的座机号!'))
|
|
|
277
|
+ }else{
|
|
|
278
|
+ callback()
|
|
|
279
|
+ }
|
|
|
280
|
+ }
|
|
|
281
|
+ /**
|
|
|
282
|
+ * @Author LH
|
|
|
283
|
+ * @param rule
|
|
|
284
|
+ * @param value
|
|
|
285
|
+ * @param callback
|
|
|
286
|
+ * @returns {*}
|
|
|
287
|
+ */
|
|
|
288
|
+ const checkPhone= (rule, tel, callback) => {
|
|
|
289
|
+ var mobile = /^1[3|5|8]\d{9}$/;
|
|
|
290
|
+ if (!mobile.test(tel)) {
|
|
|
291
|
+ return callback(new Error('请输入正确的手机号!'))
|
|
|
292
|
+ }else{
|
|
|
293
|
+ callback();
|
|
|
294
|
+ }
|
|
|
295
|
+ }
|
|
|
296
|
+ /**
|
|
|
297
|
+ * @Author LH
|
|
|
298
|
+ * @param rule
|
|
|
299
|
+ * @param value
|
|
|
300
|
+ * @param callback
|
|
|
301
|
+ * @returns {*}
|
|
|
302
|
+ */
|
|
|
303
|
+ const checkEmail= (rule, tel, callback) => {
|
|
|
304
|
+ var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); //正则表达式
|
|
|
305
|
+ var obj = document.getElementById("email"); //要验证的对象
|
|
|
306
|
+ if(obj.value === ""){ //输入不能为空
|
|
|
307
|
+ return callback(new Error('邮箱不能为空!'));
|
|
|
308
|
+ }else if(!reg.test(obj.value)){ //正则验证不通过,格式不对
|
|
|
309
|
+ return callback(new Error('邮箱格式不正确!'));
|
|
|
310
|
+ }else{
|
|
|
311
|
+ callback()
|
|
|
312
|
+ }
|
|
|
313
|
+ }
|
|
|
314
|
+ const checkIdCard=(rule, idCard, callback) => {
|
|
|
315
|
+ var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
|
|
316
|
+ if (pattern.test(idCard)) {
|
|
|
317
|
+ callback()
|
|
|
318
|
+ }else{
|
|
|
319
|
+ return callback(new Error('身份证校验失败!'));
|
266
|
}
|
320
|
}
|
267
|
- proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
|
|
|
268
|
- if (res && res.code == 0) {
|
|
|
269
|
- proxy.$global.showMsg('保存成功!');
|
321
|
+ }
|
|
|
322
|
+
|
|
|
323
|
+ /**
|
|
|
324
|
+ * @author LH
|
|
|
325
|
+ * 表单规则校验
|
|
|
326
|
+ */
|
|
|
327
|
+ let rules=Vue.ref({
|
|
|
328
|
+ nickname: [
|
|
|
329
|
+ {required: true, message: '请输入姓名', trigger: 'blur' }
|
|
|
330
|
+ ],
|
|
|
331
|
+ tel: [
|
|
|
332
|
+ {required: true, validator: checkTel, trigger: 'blur' }
|
|
|
333
|
+ ],
|
|
|
334
|
+ phone: [
|
|
|
335
|
+ {required: true, validator: checkPhone, trigger: 'blur' }
|
|
|
336
|
+ ],
|
|
|
337
|
+ email: [
|
|
|
338
|
+ {required: true, validator: checkEmail, trigger: 'blur' }
|
|
|
339
|
+ ],
|
|
|
340
|
+ company: [
|
|
|
341
|
+ {required: true, message:'请输入所在公司', trigger: 'blur' }
|
|
|
342
|
+ ],
|
|
|
343
|
+ idcard: [
|
|
|
344
|
+ {required: true, validator:checkIdCard,message:'请输入身份证号', trigger: 'blur' }
|
|
|
345
|
+ ],
|
|
|
346
|
+ entryTime: [
|
|
|
347
|
+ { required: true, message: '请选择入职时间', trigger: 'blur' },
|
|
|
348
|
+ ],
|
|
|
349
|
+ });
|
|
|
350
|
+
|
|
|
351
|
+
|
|
|
352
|
+ /**
|
|
|
353
|
+ * @EDITOR LH
|
|
|
354
|
+ * @returns {boolean}
|
|
|
355
|
+ */
|
|
|
356
|
+ // 保存用户信息
|
|
|
357
|
+ let saveUser = () => {
|
|
|
358
|
+ proxy.$refs.rule.validate((valid) => {
|
|
|
359
|
+ if (valid) {
|
|
|
360
|
+ console.log('submit!!');
|
|
|
361
|
+ proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
|
|
|
362
|
+ if (res && res.code == 0) {
|
|
|
363
|
+ proxy.$global.showMsg('保存成功!');
|
|
|
364
|
+ }
|
|
|
365
|
+ });
|
|
|
366
|
+ } else {
|
|
|
367
|
+ console.log('error submit!!');
|
|
|
368
|
+ return false;
|
270
|
}
|
369
|
}
|
271
|
});
|
370
|
});
|
|
|
371
|
+
|
272
|
}
|
372
|
}
|
273
|
|
373
|
|
274
|
|
374
|
|
|
@@ -349,6 +449,7 @@ export default { |
|
@@ -349,6 +449,7 @@ export default { |
349
|
getAssetType,
|
449
|
getAssetType,
|
350
|
// 资产属性
|
450
|
// 资产属性
|
351
|
icon,
|
451
|
icon,
|
|
|
452
|
+ rules,
|
352
|
}
|
453
|
}
|
353
|
}
|
454
|
}
|
354
|
-} |
455
|
+} |