|
@@ -12,19 +12,19 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -12,19 +12,19 @@ const assets = (props, {attrs, slots, emit}) => { |
12
|
|
12
|
|
13
|
//查询资产类型列表
|
13
|
//查询资产类型列表
|
14
|
let getAssetType = () => {
|
14
|
let getAssetType = () => {
|
15
|
- if(Object.keys(icon.value).length > 0){
|
15
|
+ if (Object.keys(icon.value).length > 0) {
|
16
|
return;
|
16
|
return;
|
17
|
}
|
17
|
}
|
18
|
proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) {
|
18
|
proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) {
|
19
|
if (res && res.data.length > 0) {
|
19
|
if (res && res.data.length > 0) {
|
20
|
icon.value = {};
|
20
|
icon.value = {};
|
21
|
- res.data.forEach(function(item, index, arr){
|
21
|
+ res.data.forEach(function (item, index, arr) {
|
22
|
let code = item.ddicCode;
|
22
|
let code = item.ddicCode;
|
23
|
let obj = {};
|
23
|
let obj = {};
|
24
|
// code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase();
|
24
|
// code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase();
|
25
|
- obj.name=item.ddicName;
|
|
|
26
|
- obj.icon=item.ddicDesc;
|
|
|
27
|
- icon.value[code] =obj;
|
25
|
+ obj.name = item.ddicName;
|
|
|
26
|
+ obj.icon = item.ddicDesc;
|
|
|
27
|
+ icon.value[code] = obj;
|
28
|
});
|
28
|
});
|
29
|
}
|
29
|
}
|
30
|
});
|
30
|
});
|
|
@@ -42,15 +42,14 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -42,15 +42,14 @@ const assets = (props, {attrs, slots, emit}) => { |
42
|
let assetsAdd = (type, msg) => {
|
42
|
let assetsAdd = (type, msg) => {
|
43
|
proxy.$http.get(`/api-web/person/assets/typeList/${type}`, {}, function (res) {
|
43
|
proxy.$http.get(`/api-web/person/assets/typeList/${type}`, {}, function (res) {
|
44
|
if (res && res.data && res.data.length > 0) {
|
44
|
if (res && res.data && res.data.length > 0) {
|
45
|
- btnClick('add',res.data,msg);
|
45
|
+ btnClick('add', res.data, msg);
|
46
|
} else {
|
46
|
} else {
|
47
|
- proxy.$global.showMsg("没有配置属性!","warning");
|
47
|
+ proxy.$global.showMsg("没有配置属性!", "warning");
|
48
|
}
|
48
|
}
|
49
|
});
|
49
|
});
|
50
|
}
|
50
|
}
|
51
|
|
51
|
|
52
|
|
52
|
|
53
|
-
|
|
|
54
|
/**
|
53
|
/**
|
55
|
* 新增资产
|
54
|
* 新增资产
|
56
|
* <p>
|
55
|
* <p>
|
|
@@ -72,13 +71,13 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -72,13 +71,13 @@ const assets = (props, {attrs, slots, emit}) => { |
72
|
data = arr;
|
71
|
data = arr;
|
73
|
}
|
72
|
}
|
74
|
|
73
|
|
75
|
- data.map(function (v){
|
74
|
+ data.map(function (v) {
|
76
|
let str = v.extend;
|
75
|
let str = v.extend;
|
77
|
- if(str){
|
76
|
+ if (str) {
|
78
|
try {
|
77
|
try {
|
79
|
let json = JSON.parse(str);
|
78
|
let json = JSON.parse(str);
|
80
|
v.extend = json;
|
79
|
v.extend = json;
|
81
|
- }catch (e){
|
80
|
+ } catch (e) {
|
82
|
}
|
81
|
}
|
83
|
}
|
82
|
}
|
84
|
})
|
83
|
})
|
|
@@ -92,12 +91,12 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -92,12 +91,12 @@ const assets = (props, {attrs, slots, emit}) => { |
92
|
}
|
91
|
}
|
93
|
|
92
|
|
94
|
|
93
|
|
95
|
- let checkAssets = () =>{
|
94
|
+ let checkAssets = () => {
|
96
|
let data = btnType.value.data;
|
95
|
let data = btnType.value.data;
|
97
|
let size = 0;
|
96
|
let size = 0;
|
98
|
- data.forEach(function (v){
|
|
|
99
|
- if( !v.value || v.value == '' || v.value == null){
|
|
|
100
|
- size ++;
|
97
|
+ data.forEach(function (v) {
|
|
|
98
|
+ if (!v.value || v.value == '' || v.value == null) {
|
|
|
99
|
+ size++;
|
101
|
}
|
100
|
}
|
102
|
})
|
101
|
})
|
103
|
|
102
|
|
|
@@ -112,15 +111,15 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -112,15 +111,15 @@ const assets = (props, {attrs, slots, emit}) => { |
112
|
*/
|
111
|
*/
|
113
|
let addAssets = () => {
|
112
|
let addAssets = () => {
|
114
|
let data = btnType.value.data
|
113
|
let data = btnType.value.data
|
115
|
- data.map(function (v){
|
114
|
+ data.map(function (v) {
|
116
|
v.extend = JSON.stringify(v.extend);
|
115
|
v.extend = JSON.stringify(v.extend);
|
117
|
})
|
116
|
})
|
118
|
|
117
|
|
119
|
- if(checkAssets()){
|
|
|
120
|
- proxy.$global.showMsg(`请填写资产信息,不能全部为空!`,'warning');
|
118
|
+ if (checkAssets()) {
|
|
|
119
|
+ proxy.$global.showMsg(`请填写资产信息,不能全部为空!`, 'warning');
|
121
|
return;
|
120
|
return;
|
122
|
}
|
121
|
}
|
123
|
- proxy.$http.post(`/api-web/person/assets/add/${props.parentNode.id}`,data , function (res) {
|
122
|
+ proxy.$http.post(`/api-web/person/assets/add/${props.parentNode.id}`, data, function (res) {
|
124
|
if (res && res.success) {
|
123
|
if (res && res.success) {
|
125
|
proxy.$global.showMsg("添加成功");
|
124
|
proxy.$global.showMsg("添加成功");
|
126
|
showDialog(false);
|
125
|
showDialog(false);
|
|
@@ -138,12 +137,12 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -138,12 +137,12 @@ const assets = (props, {attrs, slots, emit}) => { |
138
|
*/
|
137
|
*/
|
139
|
let saveAssets = () => {
|
138
|
let saveAssets = () => {
|
140
|
let data = btnType.value.data
|
139
|
let data = btnType.value.data
|
141
|
- data.map(function (v){
|
140
|
+ data.map(function (v) {
|
142
|
v.extend = JSON.stringify(v.extend);
|
141
|
v.extend = JSON.stringify(v.extend);
|
143
|
})
|
142
|
})
|
144
|
|
143
|
|
145
|
- if(checkAssets()){
|
|
|
146
|
- proxy.$global.showMsg(`请填写资产信息,不能全部为空!`,'warning');
|
144
|
+ if (checkAssets()) {
|
|
|
145
|
+ proxy.$global.showMsg(`请填写资产信息,不能全部为空!`, 'warning');
|
147
|
return;
|
146
|
return;
|
148
|
}
|
147
|
}
|
149
|
proxy.$http.post(`/api-web/person/assets/edit/${props.parentNode.id}`, data, function (res) {
|
148
|
proxy.$http.post(`/api-web/person/assets/edit/${props.parentNode.id}`, data, function (res) {
|
|
@@ -162,12 +161,12 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -162,12 +161,12 @@ const assets = (props, {attrs, slots, emit}) => { |
162
|
* 时间:2021/11/3 20:14
|
161
|
* 时间:2021/11/3 20:14
|
163
|
*/
|
162
|
*/
|
164
|
let deleteAssets = (arr) => {
|
163
|
let deleteAssets = (arr) => {
|
165
|
- proxy.$global.confirm(`您确认永久删除该资产信息吗?`,function (){
|
164
|
+ proxy.$global.confirm(`您确认永久删除该资产信息吗?`, function () {
|
166
|
proxy.$http.post(`/api-web/person/assets/delete/${props.parentNode.id}`, arr, function (res) {
|
165
|
proxy.$http.post(`/api-web/person/assets/delete/${props.parentNode.id}`, arr, function (res) {
|
167
|
if (res && res.success) {
|
166
|
if (res && res.success) {
|
168
|
proxy.$global.showMsg("删除成功");
|
167
|
proxy.$global.showMsg("删除成功");
|
169
|
} else {
|
168
|
} else {
|
170
|
- proxy.$global.showMsg("删除失败,资产不存在或者已被删除!","error");
|
169
|
+ proxy.$global.showMsg("删除失败,资产不存在或者已被删除!", "error");
|
171
|
}
|
170
|
}
|
172
|
showDialog(false);
|
171
|
showDialog(false);
|
173
|
getAssets();
|
172
|
getAssets();
|
|
@@ -185,7 +184,11 @@ const assets = (props, {attrs, slots, emit}) => { |
|
@@ -185,7 +184,11 @@ const assets = (props, {attrs, slots, emit}) => { |
185
|
* 时间:2021/11/3 20:17
|
184
|
* 时间:2021/11/3 20:17
|
186
|
*/
|
185
|
*/
|
187
|
let showDialog = (flg) => {
|
186
|
let showDialog = (flg) => {
|
188
|
- op.value = flg;
|
187
|
+ if (!props.isAdd) {
|
|
|
188
|
+ op.value = flg;
|
|
|
189
|
+ } else {
|
|
|
190
|
+ proxy.$global.showMsg("请先添加用户!", "error");
|
|
|
191
|
+ }
|
189
|
}
|
192
|
}
|
190
|
|
193
|
|
191
|
let okFunc = () => {
|
194
|
let okFunc = () => {
|
|
@@ -233,22 +236,27 @@ export default { |
|
@@ -233,22 +236,27 @@ export default { |
233
|
type: String,
|
236
|
type: String,
|
234
|
default: ''
|
237
|
default: ''
|
235
|
},
|
238
|
},
|
|
|
239
|
+ isAdd: {
|
|
|
240
|
+ type: Boolean,
|
|
|
241
|
+ default: false
|
|
|
242
|
+ }
|
236
|
},
|
243
|
},
|
237
|
data() {
|
244
|
data() {
|
238
|
- return {
|
|
|
239
|
- }
|
245
|
+ return {}
|
240
|
},
|
246
|
},
|
241
|
setup(props, {attrs, slots, emit}) {
|
247
|
setup(props, {attrs, slots, emit}) {
|
242
|
let height = Vue.ref(window.innerHeight - 130);
|
248
|
let height = Vue.ref(window.innerHeight - 130);
|
|
|
249
|
+ //判定是否展示家庭成员、工作简历级资产列表
|
|
|
250
|
+ let showMore = Vue.ref(false);
|
243
|
|
251
|
|
244
|
const {proxy} = Vue.getCurrentInstance();
|
252
|
const {proxy} = Vue.getCurrentInstance();
|
245
|
let imageUrl = Vue.ref('');
|
253
|
let imageUrl = Vue.ref('');
|
246
|
- const familyInfoTableData=Vue.ref([]);
|
254
|
+ const familyInfoTableData = Vue.ref([]);
|
247
|
// 家庭成员信息弹框显示标识
|
255
|
// 家庭成员信息弹框显示标识
|
248
|
let familyDiaShow = Vue.ref(false);
|
256
|
let familyDiaShow = Vue.ref(false);
|
249
|
//家庭成员信息弹框标题
|
257
|
//家庭成员信息弹框标题
|
250
|
let familyDiaTitle = Vue.ref('');
|
258
|
let familyDiaTitle = Vue.ref('');
|
251
|
- const workInfoTableData=Vue.ref([]);
|
259
|
+ const workInfoTableData = Vue.ref([]);
|
252
|
// 简历信息弹框显示标识
|
260
|
// 简历信息弹框显示标识
|
253
|
let workDiaShow = Vue.ref(false);
|
261
|
let workDiaShow = Vue.ref(false);
|
254
|
//简历信息弹框标题
|
262
|
//简历信息弹框标题
|
|
@@ -265,21 +273,21 @@ export default { |
|
@@ -265,21 +273,21 @@ export default { |
265
|
company: '',
|
273
|
company: '',
|
266
|
headImgUrl: '',
|
274
|
headImgUrl: '',
|
267
|
post: '',
|
275
|
post: '',
|
268
|
- projectId: null,
|
276
|
+ // projectId: null,
|
269
|
quitTime: '',
|
277
|
quitTime: '',
|
270
|
state: '',
|
278
|
state: '',
|
271
|
- idcard:'',
|
|
|
272
|
- politicsStatus:'',
|
|
|
273
|
- hasProof:'', //是否有无犯罪证明 joke add 20221012
|
|
|
274
|
- nativePlace:'', //籍贯 joke add 20221012
|
|
|
275
|
- birthday:'', //出生日期 joke add 20221012
|
|
|
276
|
- partyDate:'', //入党日期 joke add 20221012
|
|
|
277
|
- responsibility:'' //岗位职责 joke add 20221012
|
279
|
+ idcard: '',
|
|
|
280
|
+ politicsStatus: '',
|
|
|
281
|
+ hasProof: '', //是否有无犯罪证明 joke add 20221012
|
|
|
282
|
+ nativePlace: '', //籍贯 joke add 20221012
|
|
|
283
|
+ birthday: '', //出生日期 joke add 20221012
|
|
|
284
|
+ partyDate: '', //入党日期 joke add 20221012
|
|
|
285
|
+ responsibility: '' //岗位职责 joke add 20221012
|
278
|
})
|
286
|
})
|
279
|
|
287
|
|
280
|
let familyInfoForm = Vue.ref({
|
288
|
let familyInfoForm = Vue.ref({
|
281
|
- id:'',
|
|
|
282
|
- personId:props.parentNode.id, //用户id
|
289
|
+ id: '',
|
|
|
290
|
+ personId: props.parentNode.id, //用户id
|
283
|
name: '', //家庭成员姓名
|
291
|
name: '', //家庭成员姓名
|
284
|
appellation: '', //家庭成员称谓
|
292
|
appellation: '', //家庭成员称谓
|
285
|
place: '', //家庭成员工作单位
|
293
|
place: '', //家庭成员工作单位
|
|
@@ -289,8 +297,8 @@ export default { |
|
@@ -289,8 +297,8 @@ export default { |
289
|
let familyInfoFormRef = Vue.ref('');
|
297
|
let familyInfoFormRef = Vue.ref('');
|
290
|
|
298
|
|
291
|
let workInfoForm = Vue.ref({
|
299
|
let workInfoForm = Vue.ref({
|
292
|
- id:'',
|
|
|
293
|
- personId:props.parentNode.id, //用户id
|
300
|
+ id: '',
|
|
|
301
|
+ personId: props.parentNode.id, //用户id
|
294
|
place: '', //工作单位
|
302
|
place: '', //工作单位
|
295
|
position: '', //职位
|
303
|
position: '', //职位
|
296
|
startDate: '', //入职日期
|
304
|
startDate: '', //入职日期
|
|
@@ -307,6 +315,10 @@ export default { |
|
@@ -307,6 +315,10 @@ export default { |
307
|
}, function (res) {
|
315
|
}, function (res) {
|
308
|
if (res && res.object) {
|
316
|
if (res && res.object) {
|
309
|
ruleForm.value = res.object
|
317
|
ruleForm.value = res.object
|
|
|
318
|
+ //如果为新录入,则屏蔽部分页面(家庭成员、工作经历、获得奖励及资产信息)
|
|
|
319
|
+ if (res.object.id != null && res.object.id != '') {
|
|
|
320
|
+ showMore.value = true;
|
|
|
321
|
+ }
|
310
|
proxy.familyInfoTableData = res.object.familyInfoList;
|
322
|
proxy.familyInfoTableData = res.object.familyInfoList;
|
311
|
proxy.workInfoTableData = res.object.workExperienceList;
|
323
|
proxy.workInfoTableData = res.object.workExperienceList;
|
312
|
} else {
|
324
|
} else {
|
|
@@ -318,28 +330,48 @@ export default { |
|
@@ -318,28 +330,48 @@ export default { |
318
|
imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
|
330
|
imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
|
319
|
}
|
331
|
}
|
320
|
|
332
|
|
|
|
333
|
+ let refreshTable = () => {
|
|
|
334
|
+ proxy.$http.get("/api-web/bOpsPerson/search", {
|
|
|
335
|
+ "nickname": props.parentNode.label,
|
|
|
336
|
+ "id": props.parentNode.id,
|
|
|
337
|
+ "projectId": props.projectId
|
|
|
338
|
+ }, function (res) {
|
|
|
339
|
+ if (res && res.object) {
|
|
|
340
|
+ //如果为新录入,则屏蔽部分页面(家庭成员、工作经历、获得奖励及资产信息)
|
|
|
341
|
+ if (res.object.id != null && res.object.id != '') {
|
|
|
342
|
+ showMore.value = true;
|
|
|
343
|
+ }
|
|
|
344
|
+ proxy.familyInfoTableData = res.object.familyInfoList;
|
|
|
345
|
+ proxy.workInfoTableData = res.object.workExperienceList;
|
|
|
346
|
+ }
|
|
|
347
|
+ });
|
|
|
348
|
+
|
|
|
349
|
+ //图片回显
|
|
|
350
|
+ imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
|
|
|
351
|
+ }
|
|
|
352
|
+
|
321
|
//点击家庭成员信息的新增按钮事件
|
353
|
//点击家庭成员信息的新增按钮事件
|
322
|
- let showDiaByType = (flg,type) =>{
|
|
|
323
|
- if (type === 'family'){
|
354
|
+ let showDiaByType = (flg, type) => {
|
|
|
355
|
+ if (type === 'family') {
|
324
|
//展示新增或编辑页面
|
356
|
//展示新增或编辑页面
|
325
|
familyDiaShow.value = flg;
|
357
|
familyDiaShow.value = flg;
|
326
|
- if (flg === false){
|
358
|
+ if (flg === false) {
|
327
|
familyInfoForm.value = {
|
359
|
familyInfoForm.value = {
|
328
|
- id:'',
|
|
|
329
|
- personId:props.parentNode.id, //用户id
|
360
|
+ id: '',
|
|
|
361
|
+ personId: props.parentNode.id, //用户id
|
330
|
name: '', //家庭成员姓名
|
362
|
name: '', //家庭成员姓名
|
331
|
appellation: '', //家庭成员称谓
|
363
|
appellation: '', //家庭成员称谓
|
332
|
place: '', //家庭成员工作单位
|
364
|
place: '', //家庭成员工作单位
|
333
|
position: '', //家庭成员职位
|
365
|
position: '', //家庭成员职位
|
334
|
}
|
366
|
}
|
335
|
}
|
367
|
}
|
336
|
- }else if (type === 'work'){
|
368
|
+ } else if (type === 'work') {
|
337
|
//展示新增或编辑页面
|
369
|
//展示新增或编辑页面
|
338
|
workDiaShow.value = flg;
|
370
|
workDiaShow.value = flg;
|
339
|
- if (flg === false){
|
371
|
+ if (flg === false) {
|
340
|
workInfoForm.value = {
|
372
|
workInfoForm.value = {
|
341
|
- id:'',
|
|
|
342
|
- personId:props.parentNode.id, //用户id
|
373
|
+ id: '',
|
|
|
374
|
+ personId: props.parentNode.id, //用户id
|
343
|
place: '', //工作单位
|
375
|
place: '', //工作单位
|
344
|
position: '', //职位
|
376
|
position: '', //职位
|
345
|
startDate: '', //入职日期
|
377
|
startDate: '', //入职日期
|
|
@@ -349,42 +381,42 @@ export default { |
|
@@ -349,42 +381,42 @@ export default { |
349
|
}
|
381
|
}
|
350
|
}
|
382
|
}
|
351
|
|
383
|
|
352
|
- let seTitleByType = (name,type) => {
|
|
|
353
|
- if (type === 'family'){
|
384
|
+ let seTitleByType = (name, type) => {
|
|
|
385
|
+ if (type === 'family') {
|
354
|
familyDiaTitle.value = name + '家庭成员';
|
386
|
familyDiaTitle.value = name + '家庭成员';
|
355
|
- }else if (type === 'work'){
|
387
|
+ } else if (type === 'work') {
|
356
|
workDiaTitle.value = name + '工作经历';
|
388
|
workDiaTitle.value = name + '工作经历';
|
357
|
}
|
389
|
}
|
358
|
}
|
390
|
}
|
359
|
|
391
|
|
360
|
//点击家庭成员新增按钮
|
392
|
//点击家庭成员新增按钮
|
361
|
- let addFamilyInfo = (name,type) => {
|
|
|
362
|
- showDiaByType(true,type);
|
|
|
363
|
- seTitleByType(name,type);
|
393
|
+ let addFamilyInfo = (name, type) => {
|
|
|
394
|
+ showDiaByType(true, type);
|
|
|
395
|
+ seTitleByType(name, type);
|
364
|
}
|
396
|
}
|
365
|
//点击修改按钮
|
397
|
//点击修改按钮
|
366
|
- let updateFamilyOrWorkInfo = (row,type) => {
|
398
|
+ let updateFamilyOrWorkInfo = (row, type) => {
|
367
|
//获取数据
|
399
|
//获取数据
|
368
|
- if (type === 'family'){
|
400
|
+ if (type === 'family') {
|
369
|
familyInfoForm.value = {
|
401
|
familyInfoForm.value = {
|
370
|
- id:row.id,
|
|
|
371
|
- personId:props.parentNode.id, //用户id
|
402
|
+ id: row.id,
|
|
|
403
|
+ personId: props.parentNode.id, //用户id
|
372
|
name: row.name, //家庭成员姓名
|
404
|
name: row.name, //家庭成员姓名
|
373
|
appellation: row.appellation, //家庭成员称谓
|
405
|
appellation: row.appellation, //家庭成员称谓
|
374
|
place: row.place, //家庭成员工作单位
|
406
|
place: row.place, //家庭成员工作单位
|
375
|
position: row.position, //家庭成员职位
|
407
|
position: row.position, //家庭成员职位
|
376
|
}
|
408
|
}
|
377
|
- }else if (type === 'work'){
|
409
|
+ } else if (type === 'work') {
|
378
|
workInfoForm.value = {
|
410
|
workInfoForm.value = {
|
379
|
- id:row.id,
|
|
|
380
|
- personId:props.parentNode.id, //用户id
|
411
|
+ id: row.id,
|
|
|
412
|
+ personId: props.parentNode.id, //用户id
|
381
|
place: row.place, //工作单位
|
413
|
place: row.place, //工作单位
|
382
|
position: row.position, //职位
|
414
|
position: row.position, //职位
|
383
|
startDate: row.startDate, //入职日期
|
415
|
startDate: row.startDate, //入职日期
|
384
|
endDate: row.endDate, //离职日期
|
416
|
endDate: row.endDate, //离职日期
|
385
|
}
|
417
|
}
|
386
|
}
|
418
|
}
|
387
|
- addFamilyInfo('编辑',type);
|
419
|
+ addFamilyInfo('编辑', type);
|
388
|
}
|
420
|
}
|
389
|
|
421
|
|
390
|
/**
|
422
|
/**
|
|
@@ -394,13 +426,13 @@ export default { |
|
@@ -394,13 +426,13 @@ export default { |
394
|
* @param callback
|
426
|
* @param callback
|
395
|
* @returns {*}
|
427
|
* @returns {*}
|
396
|
*/
|
428
|
*/
|
397
|
- const checkTel= (rule, value, callback) => {
|
|
|
398
|
- var re1=/^0\d{2}-[1-9]\d{7}$/;
|
|
|
399
|
- var re2=/^0\d{3}-[1-9]\{6,7}$/;
|
|
|
400
|
- var result=re1.test(value)||re2.test(value);
|
429
|
+ const checkTel = (rule, value, callback) => {
|
|
|
430
|
+ var re1 = /^0\d{2}-[1-9]\d{7}$/;
|
|
|
431
|
+ var re2 = /^0\d{3}-[1-9]\{6,7}$/;
|
|
|
432
|
+ var result = re1.test(value) || re2.test(value);
|
401
|
if (!result && value) {
|
433
|
if (!result && value) {
|
402
|
return callback(new Error('请输入正确的座机号!'))
|
434
|
return callback(new Error('请输入正确的座机号!'))
|
403
|
- }else{
|
435
|
+ } else {
|
404
|
callback()
|
436
|
callback()
|
405
|
}
|
437
|
}
|
406
|
}
|
438
|
}
|
|
@@ -411,18 +443,18 @@ export default { |
|
@@ -411,18 +443,18 @@ export default { |
411
|
* @param callback
|
443
|
* @param callback
|
412
|
* @returns {*}
|
444
|
* @returns {*}
|
413
|
*/
|
445
|
*/
|
414
|
- const checkPhone= (rule, tel, callback) => {
|
|
|
415
|
- var mobile = /^1[0-9]\d{9}$/;
|
446
|
+ const checkPhone = (rule, tel, callback) => {
|
|
|
447
|
+ var mobile = /^1[0-9]\d{9}$/;
|
416
|
if (tel != '' && !mobile.test(tel)) {
|
448
|
if (tel != '' && !mobile.test(tel)) {
|
417
|
callback(new Error('请输入正确的手机号!'))
|
449
|
callback(new Error('请输入正确的手机号!'))
|
418
|
} else {
|
450
|
} else {
|
419
|
callback();
|
451
|
callback();
|
420
|
}
|
452
|
}
|
421
|
}
|
453
|
}
|
422
|
- const checkIdCard=(rule, idCard, callback) => {
|
454
|
+ const checkIdCard = (rule, idCard, callback) => {
|
423
|
var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
455
|
var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
424
|
if (idCard != '' && !pattern.test(idCard)) {
|
456
|
if (idCard != '' && !pattern.test(idCard)) {
|
425
|
- callback(new Error('身份证校验失败!'));
|
457
|
+ callback(new Error('身份证校验失败!'));
|
426
|
} else {
|
458
|
} else {
|
427
|
callback();
|
459
|
callback();
|
428
|
}
|
460
|
}
|
|
@@ -436,45 +468,62 @@ export default { |
|
@@ -436,45 +468,62 @@ export default { |
436
|
* @author LH
|
468
|
* @author LH
|
437
|
* 表单规则校验
|
469
|
* 表单规则校验
|
438
|
*/
|
470
|
*/
|
439
|
- let rules=Vue.ref({
|
471
|
+ let rules = Vue.ref({
|
440
|
nickname: [
|
472
|
nickname: [
|
441
|
- { message: '请输入姓名', trigger: 'blur' }
|
473
|
+ {required: true, message: '请输入姓名', trigger: 'blur'}
|
|
|
474
|
+ ],
|
|
|
475
|
+ sex: [
|
|
|
476
|
+ {required: true, message: '请选择性别', trigger: 'blur'}
|
442
|
],
|
477
|
],
|
443
|
phone: [
|
478
|
phone: [
|
444
|
- { validator: checkPhone, trigger: 'blur' }
|
479
|
+ {required: true, message: '请输入手机号', trigger: 'blur'},
|
|
|
480
|
+ {validator: checkPhone,message: '请输入正确的手机号' , trigger: 'blur'}
|
445
|
],
|
481
|
],
|
446
|
company: [
|
482
|
company: [
|
447
|
- { message:'请输入所在公司', trigger: 'blur' }
|
483
|
+ {required: true, message: '请输入所在公司', trigger: 'blur'}
|
448
|
],
|
484
|
],
|
449
|
idcard: [
|
485
|
idcard: [
|
450
|
- { validator:checkIdCard,message:'请输入正确的身份证号', trigger: 'blur'}
|
486
|
+ {required: true, message: '请输入身份证号', trigger: 'blur'},
|
|
|
487
|
+ {validator: checkIdCard, message: '请输入正确的身份证号', trigger: 'blur'}
|
|
|
488
|
+ ],
|
|
|
489
|
+ entryTime: [
|
|
|
490
|
+ {required: true, message: '请选择入职时间', trigger: 'blur'}
|
|
|
491
|
+ ],
|
|
|
492
|
+ state: [
|
|
|
493
|
+ {required: true, message: '请选择在职状态', trigger: 'blur'}
|
|
|
494
|
+ ],
|
|
|
495
|
+ university: [
|
|
|
496
|
+ {required: true, message: '请输入毕业院校', trigger: 'blur'}
|
|
|
497
|
+ ],
|
|
|
498
|
+ education: [
|
|
|
499
|
+ {required: true, message: '请输入学历', trigger: 'blur'}
|
451
|
]
|
500
|
]
|
452
|
});
|
501
|
});
|
453
|
|
502
|
|
454
|
let familyOrWorkRules = Vue.ref({
|
503
|
let familyOrWorkRules = Vue.ref({
|
455
|
name: [
|
504
|
name: [
|
456
|
- { required: true, message: '请输入姓名' },
|
|
|
457
|
- { message: '请输入姓名', trigger: 'blur' }
|
505
|
+ {required: true, message: '请输入姓名'},
|
|
|
506
|
+ {message: '请输入姓名', trigger: 'blur'}
|
458
|
],
|
507
|
],
|
459
|
appellation: [
|
508
|
appellation: [
|
460
|
- { required: true, message: '请输入称谓' },
|
|
|
461
|
- { message: '请输入称谓', trigger: 'blur' }
|
509
|
+ {required: true, message: '请输入称谓'},
|
|
|
510
|
+ {message: '请输入称谓', trigger: 'blur'}
|
462
|
],
|
511
|
],
|
463
|
place: [
|
512
|
place: [
|
464
|
- { required: true, message: '请输入工作单位' },
|
|
|
465
|
- { message: '请输入工作单位', trigger: 'blur' }
|
513
|
+ {required: true, message: '请输入工作单位'},
|
|
|
514
|
+ {message: '请输入工作单位', trigger: 'blur'}
|
466
|
],
|
515
|
],
|
467
|
position: [
|
516
|
position: [
|
468
|
- { required: true, message: '请输入职位' },
|
|
|
469
|
- { message: '请输入职位', trigger: 'blur' }
|
517
|
+ {required: true, message: '请输入职位'},
|
|
|
518
|
+ {message: '请输入职位', trigger: 'blur'}
|
470
|
],
|
519
|
],
|
471
|
startDate: [
|
520
|
startDate: [
|
472
|
- { required: true, message: '请选择入职日期' },
|
|
|
473
|
- { validator:validatorDate,message:'请选择入职日期', trigger: 'blur'}
|
521
|
+ {required: true, message: '请选择入职日期'},
|
|
|
522
|
+ {validator: validatorDate, message: '请选择入职日期', trigger: 'blur'}
|
474
|
],
|
523
|
],
|
475
|
endDate: [
|
524
|
endDate: [
|
476
|
- { required: true, message: '请选择离职日期' },
|
|
|
477
|
- { validator:validatorDate,message:'请选择离职日期', trigger: 'blur'}
|
525
|
+ {required: true, message: '请选择离职日期'},
|
|
|
526
|
+ {validator: validatorDate, message: '请选择离职日期', trigger: 'blur'}
|
478
|
],
|
527
|
],
|
479
|
});
|
528
|
});
|
480
|
|
529
|
|
|
@@ -485,72 +534,82 @@ export default { |
|
@@ -485,72 +534,82 @@ export default { |
485
|
*/
|
534
|
*/
|
486
|
// 保存用户信息
|
535
|
// 保存用户信息
|
487
|
let saveUser = () => {
|
536
|
let saveUser = () => {
|
488
|
- proxy.$refs.rule.validate((valid) => {
|
|
|
489
|
- if (valid) {
|
|
|
490
|
- console.log('submit!!');
|
|
|
491
|
- proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
|
|
|
492
|
- if (res && res.code == 0) {
|
|
|
493
|
- proxy.$global.showMsg('保存成功!');
|
|
|
494
|
- }
|
|
|
495
|
- });
|
|
|
496
|
- } else {
|
|
|
497
|
- console.log('error submit!!');
|
|
|
498
|
- return false;
|
|
|
499
|
- }
|
|
|
500
|
- });
|
|
|
501
|
-
|
537
|
+ if (props.treeNode.map == undefined) {
|
|
|
538
|
+ proxy.$global.showMsg('请先添加业务', 'warning');
|
|
|
539
|
+ emit('showPopout', false)
|
502
|
}
|
540
|
}
|
|
|
541
|
+ proxy.$refs.rule.validate((valid) => {
|
|
|
542
|
+ if (valid) {
|
|
|
543
|
+ console.log('submit!!');
|
|
|
544
|
+ ruleForm.value.busId = props.treeNode.map.nodeType.projectId;
|
|
|
545
|
+ proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
|
|
|
546
|
+ if (res && res.code == 0) {
|
|
|
547
|
+ proxy.$global.showMsg('保存成功!');
|
|
|
548
|
+ }
|
|
|
549
|
+ emit('showPopout', false)
|
|
|
550
|
+ });
|
|
|
551
|
+ } else {
|
|
|
552
|
+ console.log('error submit!!');
|
|
|
553
|
+ return false;
|
|
|
554
|
+ }
|
|
|
555
|
+ });
|
|
|
556
|
+
|
|
|
557
|
+ }
|
503
|
|
558
|
|
504
|
- let saveOrUpdateByType = (type,rules) => {
|
559
|
+ let saveOrUpdateByType = (type, rules) => {
|
505
|
let msg = '新增';
|
560
|
let msg = '新增';
|
506
|
var data = {};
|
561
|
var data = {};
|
507
|
- if (type === 'family'){
|
|
|
508
|
- if (familyDiaTitle.value.indexOf('新增') == -1){ //表示编辑
|
562
|
+ if (type === 'family') {
|
|
|
563
|
+ if (familyDiaTitle.value.indexOf('新增') == -1) { //表示编辑
|
509
|
msg = '编辑';
|
564
|
msg = '编辑';
|
510
|
}
|
565
|
}
|
511
|
data = familyInfoForm.value;
|
566
|
data = familyInfoForm.value;
|
512
|
- }else if (type === 'work'){
|
|
|
513
|
- if (workDiaTitle.value.indexOf('新增') == -1){ //表示编辑
|
567
|
+ } else if (type === 'work') {
|
|
|
568
|
+ if (workDiaTitle.value.indexOf('新增') == -1) { //表示编辑
|
514
|
msg = '编辑';
|
569
|
msg = '编辑';
|
515
|
}
|
570
|
}
|
516
|
data = workInfoForm.value;
|
571
|
data = workInfoForm.value;
|
517
|
}
|
572
|
}
|
518
|
rules.validate((valid) => {
|
573
|
rules.validate((valid) => {
|
519
|
- if (valid){
|
|
|
520
|
- proxy.$http.post("/api-web/bOpsPerson/saveOrUpdateByType?type="+type, data, function (res) {
|
574
|
+ if (valid) {
|
|
|
575
|
+ proxy.$http.post("/api-web/bOpsPerson/saveOrUpdateByType?type=" + type, data, function (res) {
|
521
|
if (res && res.success == true) {
|
576
|
if (res && res.success == true) {
|
522
|
- proxy.$global.showMsg(msg +'成功!');
|
|
|
523
|
- showDiaByType(false,type);
|
|
|
524
|
- getPage();
|
577
|
+ proxy.$global.showMsg(msg + '成功!');
|
|
|
578
|
+ showDiaByType(false, type);
|
|
|
579
|
+ refreshTable();
|
525
|
}
|
580
|
}
|
526
|
});
|
581
|
});
|
527
|
}
|
582
|
}
|
528
|
})
|
583
|
})
|
529
|
}
|
584
|
}
|
530
|
//删除
|
585
|
//删除
|
531
|
- let deleteByType = (row,type) => {
|
|
|
532
|
- proxy.$http.post("/api-web/bOpsPerson/deleteByType?type="+type+"&ids="+row.id, {}, function (res) {
|
586
|
+ let deleteByType = (row, type) => {
|
|
|
587
|
+ proxy.$http.post("/api-web/bOpsPerson/deleteByType?type=" + type + "&ids=" + row.id, {}, function (res) {
|
533
|
if (res && res.success == true) {
|
588
|
if (res && res.success == true) {
|
534
|
proxy.$global.showMsg('删除成功!');
|
589
|
proxy.$global.showMsg('删除成功!');
|
535
|
- getPage();
|
590
|
+ refreshTable();
|
536
|
}
|
591
|
}
|
537
|
});
|
592
|
});
|
538
|
}
|
593
|
}
|
539
|
|
594
|
|
540
|
|
595
|
|
541
|
let getFile = (param) => {
|
596
|
let getFile = (param) => {
|
542
|
- let fileObj = param.file
|
|
|
543
|
- let params = {
|
|
|
544
|
- file: fileObj,
|
|
|
545
|
- id: props.parentNode.id
|
|
|
546
|
- }
|
|
|
547
|
- // 上传文件
|
|
|
548
|
- proxy.$http.uploadFile("/api-web/bOpsPerson/uploadFile", params, function (res) {
|
|
|
549
|
- if (res && res.success) {
|
|
|
550
|
- proxy.$global.showMsg("上传成功!");
|
597
|
+ if (!props.isAdd) {
|
|
|
598
|
+ let fileObj = param.file
|
|
|
599
|
+ let params = {
|
|
|
600
|
+ file: fileObj,
|
|
|
601
|
+ id: props.parentNode.id
|
551
|
}
|
602
|
}
|
552
|
- })
|
|
|
553
|
- imageUrl.value = URL.createObjectURL(fileObj);
|
603
|
+ // 上传文件
|
|
|
604
|
+ proxy.$http.uploadFile("/api-web/bOpsPerson/uploadFile", params, function (res) {
|
|
|
605
|
+ if (res && res.success) {
|
|
|
606
|
+ proxy.$global.showMsg("上传成功!");
|
|
|
607
|
+ }
|
|
|
608
|
+ })
|
|
|
609
|
+ imageUrl.value = URL.createObjectURL(fileObj);
|
|
|
610
|
+ } else {
|
|
|
611
|
+ proxy.$global.showMsg("请先添加用户!", "error");
|
|
|
612
|
+ }
|
554
|
}
|
613
|
}
|
555
|
|
614
|
|
556
|
let beforeAvatarUpload = (file) => {
|
615
|
let beforeAvatarUpload = (file) => {
|
|
@@ -582,12 +641,16 @@ export default { |
|
@@ -582,12 +641,16 @@ export default { |
582
|
getAssetType,
|
641
|
getAssetType,
|
583
|
icon
|
642
|
icon
|
584
|
} = assets(props, {attrs, slots, emit});
|
643
|
} = assets(props, {attrs, slots, emit});
|
585
|
-
|
644
|
+ let whether = Vue.ref(true);
|
586
|
// // 挂载完
|
645
|
// // 挂载完
|
587
|
Vue.onMounted(() => {
|
646
|
Vue.onMounted(() => {
|
|
|
647
|
+ if (!props.isAdd) {
|
|
|
648
|
+ getPage();
|
|
|
649
|
+ getAssets();
|
|
|
650
|
+ } else {
|
|
|
651
|
+ whether.value = false;
|
|
|
652
|
+ }
|
588
|
getAssetType();
|
653
|
getAssetType();
|
589
|
- getPage();
|
|
|
590
|
- getAssets();
|
|
|
591
|
})
|
654
|
})
|
592
|
|
655
|
|
593
|
// 监听编辑状态
|
656
|
// 监听编辑状态
|
|
@@ -595,6 +658,7 @@ export default { |
|
@@ -595,6 +658,7 @@ export default { |
595
|
getAssetType();
|
658
|
getAssetType();
|
596
|
getPage();
|
659
|
getPage();
|
597
|
getAssets();
|
660
|
getAssets();
|
|
|
661
|
+ refreshTable();
|
598
|
});
|
662
|
});
|
599
|
return {
|
663
|
return {
|
600
|
imageUrl,
|
664
|
imageUrl,
|
|
@@ -632,7 +696,10 @@ export default { |
|
@@ -632,7 +696,10 @@ export default { |
632
|
workInfoForm,
|
696
|
workInfoForm,
|
633
|
updateFamilyOrWorkInfo,
|
697
|
updateFamilyOrWorkInfo,
|
634
|
familyOrWorkRules,
|
698
|
familyOrWorkRules,
|
635
|
- familyInfoFormRef
|
699
|
+ familyInfoFormRef,
|
|
|
700
|
+ whether,
|
|
|
701
|
+ showMore,
|
|
|
702
|
+ refreshTable
|
636
|
}
|
703
|
}
|
637
|
}
|
704
|
}
|
638
|
} |
705
|
} |