Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
office-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
office-web
Commits
305fc629
Commit
305fc629
authored
Dec 12, 2018
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 增加员工档案
parent
34640c32
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
535 additions
and
928 deletions
+535
-928
api.js
src/api/api.js
+1
-1
staffInfoTemplate.js
src/components/contacts/staffInfoTemplate.js
+182
-46
limit-input.vue
src/components/limit-input.vue
+29
-3
staffRecordsTemplate.vue
src/views/contacts/staffRecordsTemplate.vue
+323
-878
No files found.
src/api/api.js
View file @
305fc629
...
...
@@ -6,7 +6,7 @@ import {Message} from 'element-ui'
Vue
.
axios
.
defaults
.
timeout
=
15000
;
var
local
=
window
.
location
.
origin
;
if
(
local
.
indexOf
(
'localhost'
)
!=
-
1
)
{
local
=
'http://
gicdev.demogic
.com'
;
local
=
'http://
www.gicdev
.com'
;
}
console
.
log
(
local
)
...
...
src/components/contacts/staffInfoTemplate.js
View file @
305fc629
...
...
@@ -5,7 +5,7 @@ let baseInfo = [
fieldName
:
'姓名'
,
fieldKey
:
'clerkName'
,
systemFlag
:
true
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fieldType
:
"0"
,
//字段类型(0:单行输入框,1:多行输入框,2:单选框 3:多选框 4:日期 5:日期区间 6:数字输入框 7:图片上传 )
fixed
:
false
,
// 判断字段是否已经在列表中
fieldDescription
:
'请输入'
,
// 提示文字
...
...
@@ -21,7 +21,7 @@ let baseInfo = [
fieldKey
:
'groupName'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -36,7 +36,7 @@ let baseInfo = [
fieldKey
:
'clerkPhone'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -53,7 +53,7 @@ let baseInfo = [
fieldKey
:
'clerkCode'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -68,7 +68,7 @@ let baseInfo = [
fieldKey
:
'clerkEmail'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -83,7 +83,7 @@ let baseInfo = [
fieldKey
:
'positionName'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -98,7 +98,7 @@ let baseInfo = [
fieldKey
:
'hireDate'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
typeValue
:
'年-月-日'
,
...
...
@@ -120,7 +120,7 @@ let jobInfo = [
fieldKey
:
'clerkType'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -141,7 +141,7 @@ let jobInfo = [
fieldKey
:
'clerkStatus'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -159,7 +159,7 @@ let jobInfo = [
fieldKey
:
'correctionDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -178,7 +178,7 @@ let jobInfo = [
fieldKey
:
'positionRank'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -196,7 +196,7 @@ let selfInfo = [
fieldKey
:
'identifyName'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -211,7 +211,7 @@ let selfInfo = [
fieldKey
:
'identifyNo'
,
systemFlag
:
true
,
fieldType
:
"6"
,
// 字段类型 数字输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -227,7 +227,7 @@ let selfInfo = [
fieldKey
:
'birthDay'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -246,7 +246,7 @@ let selfInfo = [
fieldKey
:
'sex'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -260,7 +260,7 @@ let selfInfo = [
fieldKey
:
'nation'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -274,7 +274,7 @@ let selfInfo = [
fieldKey
:
'identifyAddr'
,
systemFlag
:
true
,
fieldType
:
"1"
,
// 字段类型 多行输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -288,7 +288,7 @@ let selfInfo = [
fieldKey
:
'identifyEffectiveDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型 多行输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
typeValue
:
'年-月-日'
,
...
...
@@ -306,7 +306,7 @@ let selfInfo = [
fieldKey
:
'birthPlaceType'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -328,7 +328,7 @@ let selfInfo = [
fieldKey
:
'address'
,
systemFlag
:
true
,
fieldType
:
"1"
,
// 字段类型 多行输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -342,7 +342,7 @@ let selfInfo = [
fieldKey
:
'politicalStatus'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -362,7 +362,7 @@ let selfInfo = [
fieldKey
:
'maritalStatus'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -380,7 +380,7 @@ let selfInfo = [
fieldKey
:
'firstWorkDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型 多行输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
typeValue
:
'年-月-日'
,
...
...
@@ -398,7 +398,7 @@ let selfInfo = [
fieldKey
:
'bankNo'
,
systemFlag
:
true
,
fieldType
:
"6"
,
// 字段类型 数字输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -414,7 +414,7 @@ let selfInfo = [
fieldKey
:
'bankName'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型 多行输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -431,7 +431,7 @@ let eduInfo = [
fieldKey
:
'graduateInstitutions'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -446,7 +446,7 @@ let eduInfo = [
fieldKey
:
'graduateDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -465,7 +465,7 @@ let eduInfo = [
fieldKey
:
'majorCourse'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -480,7 +480,7 @@ let eduInfo = [
fieldKey
:
'highestEducation'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -507,7 +507,7 @@ let contractInfo = [
fieldKey
:
'contractCompany'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -522,7 +522,7 @@ let contractInfo = [
fieldKey
:
'contractType'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -546,7 +546,7 @@ let contractInfo = [
fieldKey
:
'firstContractBeginDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -565,7 +565,7 @@ let contractInfo = [
fieldKey
:
'firstContractEndDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -584,7 +584,7 @@ let contractInfo = [
fieldKey
:
'currentContractBeginDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -603,7 +603,7 @@ let contractInfo = [
fieldKey
:
'currentContractEndDate'
,
systemFlag
:
true
,
fieldType
:
"4"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
...
...
@@ -622,7 +622,7 @@ let contractInfo = [
fieldKey
:
'contractDateType'
,
systemFlag
:
true
,
fieldType
:
"2"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
...
...
@@ -643,7 +643,7 @@ let contractInfo = [
fieldKey
:
'contractRenewNum'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -661,7 +661,7 @@ let contactInfo = [
fieldKey
:
'emergencyContact'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -676,7 +676,7 @@ let contactInfo = [
fieldKey
:
'emergencyContactPhone'
,
systemFlag
:
true
,
fieldType
:
"6"
,
// 字段类型 数字输入框
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -692,7 +692,7 @@ let contactInfo = [
fieldKey
:
'emergencyContactRelationship'
,
systemFlag
:
true
,
fieldType
:
"0"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
...
...
@@ -710,7 +710,7 @@ let personalInfo = [
fieldKey
:
'identifyFrontImageUrl'
,
systemFlag
:
true
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
...
...
@@ -725,7 +725,7 @@ let personalInfo = [
fieldKey
:
'identifyBackImageUrl'
,
systemFlag
:
true
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
...
...
@@ -740,7 +740,7 @@ let personalInfo = [
fieldKey
:
'qualificationImageUrl'
,
systemFlag
:
true
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
...
...
@@ -755,7 +755,7 @@ let personalInfo = [
fieldKey
:
'diplomaImageUrl'
,
systemFlag
:
true
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
...
...
@@ -770,7 +770,7 @@ let personalInfo = [
fieldKey
:
'fireEvidenceImageUrl'
,
systemFlag
:
true
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
...
...
@@ -785,7 +785,7 @@ let personalInfo = [
fieldKey
:
'clerkImageUrl'
,
systemFlag
:
true
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
...
...
@@ -795,6 +795,139 @@ let personalInfo = [
},
]
let
defineInfo
=
[
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'单行输入框'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'0'
,
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
fieldContent
:
[],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'多行输入框'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'1'
,
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
fieldContent
:
[],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'单选框'
,
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'2'
,
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
fieldContent
:
[
{
'type'
:
'checkbox'
,
'name'
:
'选项1'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项2'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项3'
,}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'多选框'
,
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'3'
,
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
fieldContent
:
[
{
'type'
:
'checkbox'
,
'name'
:
'选项1'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项2'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项3'
,}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'日期'
,
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'4'
,
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
ruleContent
:[
{
'type'
:
'radio'
,
'name'
:
'年-月-日'
,
'key'
:
1
,
'checked'
:
'checked'
,
'isEdit'
:
1
},
{
'type'
:
'radio'
,
'name'
:
'年-月'
,
'key'
:
2
,
'isEdit'
:
1
}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'日期区间'
,
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'5'
,
fixed
:
false
,
startName
:
'开始时间'
,
endName
:
'结束时间'
,
startDescription
:
'请选择开始时间'
,
endDescription
:
'请选择结束时间'
,
typeValue
:
'年-月-日'
,
ruleContent
:[
{
'type'
:
'radio'
,
'name'
:
'年-月-日'
,
'key'
:
1
,
'checked'
:
'checked'
,
'isEdit'
:
1
},
{
'type'
:
'radio'
,
'name'
:
'年-月'
,
'key'
:
2
,
'isEdit'
:
1
}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'数字输入框'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldType
:
"6"
,
// 字段类型 数字输入框
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
fieldContent
:
[],
isMust
:
true
,
unit
:
'单位'
,
// 数字单位
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'图片'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
true
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
fieldContent
:[],
isMust
:
true
,
staffRecordsIds
:
[]
}
]
export
default
{
baseInfo
:
function
()
{
...
...
@@ -817,6 +950,9 @@ export default {
},
personalInfo
:
function
()
{
return
personalInfo
;
},
defineInfo
:
function
()
{
return
defineInfo
;
}
}
...
...
src/components/limit-input.vue
View file @
305fc629
...
...
@@ -2,6 +2,8 @@
限制输入框组件
<limitInput
:inputWidth="500"
:limitClass="'limit-color'"
:disflag='!childItem.fieldEdited'
:inputValue.sync="ruleForm.addressDetail"
:holder="'请输入详细地址'"
:getByType="'word'"
...
...
@@ -9,8 +11,16 @@
</limitInput>
-->
<
template
>
<div
class=
"input-line-cell"
:style=
"
{width: inputWidth + 'px'}">
<el-input
:style=
"
{width: inputWidth + 'px'}" v-model="itemValue" :placeholder="holder" @focus="inputFocus()" @keyup.native="(value) => toInput(value)">
</el-input>
<div
:class=
"['input-line-cell',limitClass]"
:style=
"
{width: inputWidth + 'px'}">
<el-input
:style=
"
{width: inputWidth + 'px'}"
v-model="itemValue"
:disabled='disflag'
:placeholder="holder"
@focus="inputFocus()"
@keyup.native="(value) => toInput(value)">
</el-input>
<span
class=
"tip"
><span
class=
"len_span"
>
{{
inputNum
}}
</span>
/
{{
limitLength
}}
</span>
</div>
...
...
@@ -43,7 +53,17 @@
holder
:
{
type
:
String
,
default
:
'请输入'
}
},
disflag
:
{
type
:
Boolean
,
default
:
false
},
limitClass
:
{
type
:
String
,
default
:
''
},
},
data
()
{
return
{
...
...
@@ -104,6 +124,12 @@
.input-line-cell
{
position
:
relative
;
display
:
inline-block
;
&.limit-color
{
.tip
{
color
:
rgba
(
255
,
255
,
255
,
0.7
);
}
}
}
.w-340
{
...
...
src/views/contacts/staffRecordsTemplate.vue
View file @
305fc629
...
...
@@ -176,11 +176,11 @@
<div
:class=
"['opencard-item-title',item.fieldName.length>6? 'block-pre-wrap': '']"
>
{{
item
.
fieldName
}}
</div>
</div>
<ul
class=
"view-content"
>
<draggable
:options=
"
{group:{name:'people', pull:false, put:true },sort: true}" v-model="item.
sonList
" :class="['drag-wrap','block-wrap',item.systemFieldId]" @add="addDragItem">
<draggable
:options=
"
{group:{name:'people', pull:false, put:true },sort: true}" v-model="item.
children
" :class="['drag-wrap','block-wrap',item.systemFieldId]" @add="addDragItem">
<li
:class=
"['filed-item',
currentChildIndex == ind? 'active-item': '']"
v-for=
"(childItem,ind) in item.sonList"
@
click
.
stop=
"selectChildItem(childItem.systemFieldId,index,ind,item.sonList
)"
>
<li
:class=
"['filed-item',
(currentChildKey == childItem.systemFieldId && currentChildIndex == ind)? 'active-item': '']"
v-for=
"(childItem,ind) in item.children"
@
click
.
stop=
"selectChildItem(childItem.systemFieldId,index,ind,item.children
)"
>
<!-- 删除 -->
<span
class=
"item-close"
@
click
.
stop=
"deleteChildItem(childItem.systemFieldId,index,ind,item.
sonList
,childItem)"
><i
class=
"el-icon-close"
></i></span>
<span
class=
"item-close"
@
click
.
stop=
"deleteChildItem(childItem.systemFieldId,index,ind,item.
children
,childItem)"
><i
class=
"el-icon-close"
></i></span>
<!-- item -->
<!-- 单择/多选/日期 -->
<div
v-if=
"(childItem.fieldType == 2 || childItem.fieldType == 3 || childItem.fieldType == 4)"
>
...
...
@@ -208,7 +208,7 @@
<div
v-if=
"(childItem.fieldType == 7)"
>
<div
:class=
"['opencard-item-title',childItem.fieldName.length>6? 'title-pre-wrap': '']"
>
{{
childItem
.
fieldName
}}
</div>
<div
class=
"draged-item-show"
>
<span
class=
"show-warm-text show-warm-text-flag
"
>
{{
childItem
.
fieldDescription
}}
</span>
<span
class=
"show-warm-text show-warm-text-flag
select-flag"
><i
class=
"iconfont icon-icon"
></i>
</span>
</div>
</div>
<!-- 单行/多行/数字输入框 -->
...
...
@@ -241,95 +241,162 @@
<div
class=
"edit-view baby-info-flag baby-info"
>
<
template
v-for=
"(item,index) in tempaletDataList"
>
<!-- 公共 -->
<template
v-if=
"currentIndex == index && item.
systemFieldId != -1
"
>
<template
v-if=
"currentIndex == index && item.
parentCode == ''
"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title edit-title-padding"
>
标题
</div>
<add-input
:inputValue=
"item.fieldName"
:disFlag=
"1"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"item.fieldName"
:holder=
"''"
:disflag=
'true'
:getByType=
"'word'"
:maxLength=
"10"
>
</limitInput>
</div>
</
template
>
<!-- 自定义中 根据 item.systemFieldId == -1 判断是否可编辑-->
<
template
v-if=
"currentIndex == index && item.systemFieldId == -1 && !currentChildIndex"
>
<div
class=
"edit-item "
>
<!-- 组块内部 -->
<
template
v-if=
"childIndex == index && !!item.children && !!item.children.length"
>
<template
v-for=
"(childItem,ind) in item.children"
>
<!-- 标题 日期区间例外-->
<template
v-if=
"currentChildIndex == ind && !(childItem.fieldType==5)"
>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
标题
</div>
<add-input
:inputValue=
"item.fieldName"
:titleName=
"'title'"
:disFlag=
"0"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.fieldName"
:holder=
"''"
:disflag=
'!childItem.fieldEdited'
:getByType=
"'word'"
:maxLength=
"10"
>
</limitInput>
<p
v-if=
"childItem.fieldType == 7"
style=
"margin-top: 8px;font-size: 12px;color: rgba(255, 255, 255, 0.7)"
>
{{
childItem
.
fieldDescription
}}
</p>
</div>
</
template
>
<
template
v-if=
"currentIndex == index && item.fieldType != 5"
>
<div
class=
"edit-item"
>
<!-- 提示 -->
<
template
v-if=
"currentChildIndex == ind && !(childItem.fieldType==5 || childItem.fieldType == 7)"
>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
提示文字
</div>
<!--
<el-input
class=
"w-340"
v-model=
"item.placeHolder"
placeholder=
""
></el-input>
-->
<add-input
:inputValue=
"item.fieldDescription"
:disFlag=
"0"
:maxLength=
"15"
@
itemInput=
"itemInput"
></add-input>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.fieldDescription"
:holder=
"''"
:disflag=
'false'
:getByType=
"'word'"
:maxLength=
"20"
>
</limitInput>
</div>
</
template
>
<!-- 组块内部 -->
<
template
v-if=
"childIndex == index && !!item.sonList && !!item.sonList.length && item.systemFieldId==-1"
>
<template
v-for=
"(child,ind) in item.sonList"
>
<!-- 标题 -->
<template
v-if=
"currentChildIndex == ind && (child.fieldType=='3'||child.fieldType=='1'||child.fieldType=='0'||child.fieldType=='4')"
>
<div
class=
"edit-item test-title"
>
<
template
v-if=
"currentChildIndex == ind && childItem.fieldType == 5"
>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
标题
</div>
<add-input
:inputValue=
"child.fieldName"
:titleName=
"'title'"
:child=
"'child'"
:disFlag=
"0"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.startName"
:holder=
"''"
:disflag=
'!childItem.fieldEdited'
:getByType=
"'word'"
:maxLength=
"10"
>
</limitInput>
</div>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
提示文字
</div>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.startDescription"
:holder=
"''"
:disflag=
'false'
:getByType=
"'word'"
:maxLength=
"20"
>
</limitInput>
</div>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
标题
</div>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.endName"
:holder=
"''"
:disflag=
'!childItem.fieldEdited'
:getByType=
"'word'"
:maxLength=
"10"
>
</limitInput>
</div>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
提示文字
</div>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.endDescription"
:holder=
"''"
:disflag=
'false'
:getByType=
"'word'"
:maxLength=
"20"
>
</limitInput>
</div>
</
template
>
<!-- 提示 -->
<
template
v-if=
"currentChildIndex == ind && (child.fieldType=='3'||child.fieldType=='1'||child.fieldType=='0'||child.fieldType=='4')"
>
<div
class=
"edit-item test-title"
>
<div
class=
"edit-item-title"
>
提示文字
</div>
<!--
<el-input
class=
"w-340"
v-model=
"item.placeHolder"
placeholder=
""
></el-input>
-->
<add-input
:inputValue=
"child.fieldDescription"
:disFlag=
"0"
:child=
"'child'"
:maxLength=
"15"
@
itemInput=
"itemInput"
></add-input>
<!-- 单位 -->
<
template
v-if=
"currentChildIndex == ind && childItem.fieldType == 6"
>
<div
class=
"edit-item test-title limit-w-340"
>
<div
class=
"edit-item-title"
>
单位
</div>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"childItem.unit"
:holder=
"''"
:disflag=
'childItem.fieldEdited'
:getByType=
"'word'"
:maxLength=
"20"
>
</limitInput>
</div>
</
template
>
<!-- 类型 -->
<
template
v-if=
"currentChildIndex == ind && (child.fieldType=='3'||child.fieldType=='1'||child.fieldType=='0'||child.fieldType=='4'
)"
>
<
template
v-if=
"currentChildIndex == ind && (childItem.fieldType == 4 || childItem.fieldType == 5
)"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<template
v-if=
"child.fieldType == 3"
>
<template
v-for=
"(types,ind) in child.ruleContent"
>
<el-radio
v-model=
"types.checked"
:label=
"types.checked"
>
{{
types
.
name
}}
</el-radio>
</
template
>
</template>
<!-- 多选 -->
<
template
v-if=
"child.fieldType == 1"
>
<template
v-for=
"(types,ind) in child.ruleContent"
>
<el-checkbox
v-model=
"types.checked=='checked'? true:false"
disabled
>
{{
types
.
name
}}
</el-checkbox>
</
template
>
</template>
<!-- 单行输入框-->
<
template
v-if=
"child.fieldType==0"
>
<template
v-for=
"(types,ind) in child.ruleContent"
>
<el-checkbox
v-model=
"types.select"
@
change=
"changeCheck($event,ind,child.type)"
>
{{
types
.
name
}}
</el-checkbox>
</
template
>
</template>
<div
class=
"edit-item-title"
>
日期类型
</div>
<!-- 日期 -->
<
template
v-if=
"currentChildIndex == ind && child.systemFieldId == -1 && child.fieldType==4"
>
<template
v-for=
"(types,ind) in child.ruleContent"
>
<el-radio
v-model=
"child.typeValue"
:label=
"types.name"
@
change=
"changeRadio($event,ind,child)"
>
{{
types
.
name
}}
</el-radio>
</
template
>
<template
v-for=
"(types,ind) in childItem.ruleContent"
>
<el-radio
v-model=
"childItem.typeValue"
:label=
"types.name"
@
change=
"changeRadio($event,ind,childItem)"
>
{{
types
.
name
}}
</el-radio>
</
template
>
</div>
</template>
<!-- 选项 -->
<
template
v-if=
"currentChildIndex == ind && (child.fieldType=='3'||child.fieldType=='1
')"
>
<
template
v-if=
"currentChildIndex == ind && (childItem.fieldType=='2'||childItem.fieldType=='3
')"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
选项
<span
v-if=
"child.fieldType=='1'"
>
最多20项,每项最多10个字
</span>
<span
v-if=
"child.fieldType=='3'"
>
最多5项,每项最多10个字
</span></div>
<template
v-for=
"(types,ind) in child.fieldContent"
>
<div
class=
"margin-t-15"
:style=
"ind==0? 'margin-top: 0':''"
>
<add-input
:inputValue=
"types.name"
:childIndex=
"ind"
:child=
"'child'"
:childItem=
"(child.fieldType=='3' || child.fieldType=='1')? 'k303':''"
:disFlag=
"0"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
<i
class=
"opt-btn el-icon-remove del-item"
v-if=
"child.fieldContent.length>1"
@
click=
"delChildItem(index,ind,child)"
></i>
<template
v-if=
"(child.systemFieldId == '-1'&&child.fieldType==1&&ind
<
19
)"
>
<i
class=
"opt-btn el-icon-circle-plus add-item"
v-if=
"ind == child.fieldContent.length-1"
@
click=
"addChildItem(index,ind,child)"
></i>
</
template
>
<
template
v-if=
"(child.systemFieldId == '-1'&&child.fieldType==3&&ind < 4)"
>
<i
class=
"opt-btn el-icon-circle-plus add-item"
v-if=
"ind == child.fieldContent.length-1"
@
click=
"addChildItem(index,ind,child)"
></i>
<div
class=
"edit-item-title"
>
选项
<span
v-if=
"childItem.fieldType=='1'"
>
最多20项,每项最多10个字
</span>
<span
v-if=
"childItem.fieldType=='3'"
>
最多5项,每项最多10个字
</span></div>
<template
v-for=
"(types,ind) in childItem.fieldContent"
>
<div
class=
"margin-t-15 limit-w-340"
:style=
"ind==0? 'margin-top: 0':''"
>
<limitInput
:inputWidth=
"340"
:limitClass=
"'limit-color'"
:inputValue
.
sync=
"types.name"
:holder=
"''"
:disflag=
'!childItem.fieldEdited'
:getByType=
"'word'"
:maxLength=
"10"
>
</limitInput>
<i
class=
"opt-btn el-icon-remove del-item"
v-if=
"(childItem.systemFieldId == '-1' && childItem.fieldContent.length>1)"
@
click=
"delChildItem(index,ind,childItem)"
></i>
<template
v-if=
"(childItem.systemFieldId == '-1'&& ind
<
19
)"
>
<i
class=
"opt-btn el-icon-circle-plus add-item"
v-if=
"ind == childItem.fieldContent.length-1"
@
click=
"addChildItem(index,ind,childItem)"
></i>
</
template
>
<!-- <template v-if="(childItem.systemFieldId == '-1'&&childItem.fieldType==3&&ind < 4)">
<i class="opt-btn el-icon-circle-plus add-item" v-if="ind == childItem.fieldContent.length-1" @click="addChildItem(index,ind,childItem)"></i>
</template> -->
</div>
</template>
...
...
@@ -337,142 +404,21 @@
</template>
<!-- 必填 -->
<
template
v-if=
"currentChildIndex == ind && (child.fieldType=='3'||child.fieldType=='1'||child.fieldType=='0'||child.fieldType=='4')
"
>
<div
class=
"edit-item
"
>
<
template
v-if=
"currentChildIndex == ind
"
>
<div
class=
"edit-item
"
>
<div
class=
"edit-item-title"
>
验证
</div>
<el-checkbox
v-model=
"child.isMust"
>
必填
</el-checkbox>
</div>
</
template
>
</template>
</template>
<!-- 性别 -->
<
template
v-if=
"currentIndex == index && item.systemFieldId == 'k102'"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-radio
v-model=
"types.checked"
:label=
"types.checked"
>
{{
types
.
name
}}
</el-radio>
</
template
>
</div>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
选项
</div>
<
template
v-for=
"(types,ind) in item.fieldContent"
>
<div
class=
"margin-t-15"
:style=
"ind==0? 'margin-top:0':''"
>
<add-input
:inputValue=
"types.name"
:disFlag=
"1"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
</div>
</
template
>
</div>
</template>
<!-- 文化程度 婚姻状况 是否有房 是否有车-->
<
template
v-if=
"currentIndex == index && (item.systemFieldId == 'k105'|| item.systemFieldId == 'k201' || item.systemFieldId == 'k202' || item.systemFieldId == 'k301' || item.systemFieldId == 'k302')"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-radio
v-model=
"types.checked"
:label=
"types.checked"
>
{{
types
.
name
}}
</el-radio>
</
template
>
</div>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
选项
</div>
<
template
v-for=
"(types,ind) in item.fieldContent"
>
<div
class=
"margin-t-15"
:style=
"ind==0? 'margin-top: 0':''"
>
<add-input
:inputValue=
"types.name"
:disFlag=
"1"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
</div>
</
template
>
</div>
</template>
<!-- 邮箱 -->
<
template
v-if=
"currentIndex == index && item.systemFieldId == 'k106'"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-checkbox
v-model=
"types.checked=='checked'? true:false"
disabled
>
{{
types
.
name
}}
</el-checkbox>
</
template
>
</div>
</template>
<!-- 年收入 购物周期 喜好的礼品-->
<
template
v-if=
"currentIndex == index && (item.systemFieldId == 'k303' ||item.systemFieldId == 'k403' || item.systemFieldId == 'k404' || (item.systemFieldId == '-1'&&item.fieldType=='3') || (item.systemFieldId == '-1'&&item.fieldType=='1'))"
>
<template
v-if=
"item.ruleContent.length"
>
<!-- v-if="item.systemFieldId == 'k303' || item.systemFieldId == 'k403' || item.systemFieldId == 'E1'"-->
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<!-- 单选 -->
<template
v-if=
"item.fieldType == 2||item.fieldType == 3"
>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-radio
v-model=
"types.checked"
:label=
"types.checked"
>
{{
types
.
name
}}
</el-radio>
</
template
>
</template>
<!-- 多选 -->
<
template
v-if=
"item.fieldType == 1"
>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-checkbox
v-model=
"types.checked=='checked'? true:false"
disabled
>
{{
types
.
name
}}
</el-checkbox>
</
template
>
</template>
</div>
</template>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
选项
<span
v-if=
"item.systemFieldId == 'k404'||(item.systemFieldId == '-1'&&item.fieldType=='1')"
>
最多20项,每项最多10个字
</span>
<span
v-if=
"item.systemFieldId != 'k404' && (item.systemFieldId == 'k403'||item.systemFieldId == 'k303' || item.systemFieldId == '-1'&&item.fieldType=='3')"
>
最多5项,每项最多10个字
</span></div>
<
template
v-for=
"(types,ind) in item.fieldContent"
>
<div
class=
"margin-t-15"
:style=
"ind==0? 'margin-top: 0':''"
>
<add-input
:inputValue=
"types.name"
:childIndex=
"ind"
:childItem=
"(item.systemFieldId == 'k403'||item.systemFieldId == 'k303' || item.systemFieldId == 'k404' || (item.systemFieldId == '-1'&&item.fieldType=='3') || (item.systemFieldId == '-1'&&item.fieldType=='1'))? 'k303':''"
:disFlag=
"0"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
<i
class=
"opt-btn el-icon-remove del-item"
v-if=
"item.fieldContent.length>1"
@
click=
"delChildItem(index,ind,item)"
></i>
<template
v-if=
"((item.systemFieldId == 'k404'||(item.systemFieldId == '-1' && item.fieldType==1)) && ind
<
19
)"
>
<i
class=
"opt-btn el-icon-circle-plus add-item"
v-if=
"ind == item.fieldContent.length-1"
@
click=
"addChildItem(index,ind,item)"
></i>
</
template
>
<
template
v-if=
"((item.systemFieldId == 'k403'||item.systemFieldId == 'k303' || (item.systemFieldId == '-1'&&item.fieldType=='3')) && ind < 4)"
>
<i
class=
"opt-btn el-icon-circle-plus add-item"
v-if=
"ind == item.fieldContent.length-1"
@
click=
"addChildItem(index,ind,item)"
></i>
</
template
>
</div>
</template>
</div>
</template>
<!-- 期望消息推送 -->
<
template
v-if=
"currentIndex == index && item.systemFieldId == 'k402'"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-checkbox
v-model=
"types.checked=='checked'? true:false"
disabled
>
{{
types
.
name
}}
</el-checkbox>
</
template
>
</div>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
选项
</div>
<
template
v-for=
"(types,ind) in item.fieldContent"
>
<div
class=
"margin-t-15"
:style=
"ind==0? 'margin-top: 0':''"
>
<add-input
:inputValue=
"types.name"
:disFlag=
"1"
:maxLength=
"10"
@
itemInput=
"itemInput"
></add-input>
</div>
</
template
>
</div>
</template>
<!-- 自定义日期 -->
<
template
v-if=
"currentIndex == index && item.systemFieldId == -1&& item.fieldType==4"
>
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
类型
</div>
<template
v-for=
"(types,ind) in item.ruleContent"
>
<el-radio
v-model=
"item.typeValue"
:label=
"types.name"
@
change=
"changeRadio($event,ind,item)"
>
{{
types
.
name
}}
</el-radio>
</
template
>
<el-checkbox
v-model=
"childItem.isMust"
>
必填
</el-checkbox>
</div>
</
template
>
<!-- 公共 -->
<
template
v-if=
"currentIndex == index"
>
<!-- 必填 -->
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
验证
</div>
<el-checkbox
v-model=
"item.isMust"
>
必填
</el-checkbox>
</div>
<
template
v-if=
"currentChildIndex == ind"
>
<!-- 员工档案中 -->
<div
class=
"edit-item "
>
<div
class=
"edit-item-title"
>
员工档案中
</div>
<el-checkbox-group
class=
"staffRecords-limit"
v-model=
"i
tem.staffRecordsIds"
v-model=
"childI
tem.staffRecordsIds"
@
change=
"checkedChange($event,item)"
>
<template
v-for=
"(staffRecordsItem,idx) in staffRecordsOptions"
>
<div
class=
"checkbox-cell"
>
...
...
@@ -483,6 +429,9 @@
</div>
</template>
</template>
</template>
<!-- 组块内部 -->
</template>
</div>
</div>
</el-tab-pane>
...
...
@@ -496,6 +445,7 @@
<
script
>
import
draggable
from
'vuedraggable'
;
import
AddInput
from
'@/components/templateSet/add-input'
;
import
limitInput
from
'@/components/limit-input.vue'
;
import
allInfo
from
'@/components/contacts/staffInfoTemplate'
;
import
showMsg
from
'@/common/js/showmsg'
;
...
...
@@ -548,207 +498,86 @@ export default {
// 个人材料
personalInfo
:
allInfo
.
personalInfo
(),
// 自定义
defineInfo
:
[
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'单行输入框'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'0'
,
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
fieldContent
:
[],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'多行输入框'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'1'
,
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
fieldContent
:
[],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'单选框'
,
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'2'
,
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
fieldContent
:
[
{
'type'
:
'checkbox'
,
'name'
:
'选项1'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项2'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项3'
,}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'多选框'
,
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'3'
,
fixed
:
false
,
fieldDescription
:
'请选择'
,
ruleContent
:
[],
fieldContent
:
[
{
'type'
:
'checkbox'
,
'name'
:
'选项1'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项2'
,},
{
'type'
:
'checkbox'
,
'name'
:
'选项3'
,}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'日期'
,
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'4'
,
fixed
:
false
,
fieldDescription
:
'请选择'
,
typeValue
:
'年-月-日'
,
ruleContent
:[
{
'type'
:
'radio'
,
'name'
:
'年-月-日'
,
'key'
:
1
,
'checked'
:
'checked'
,
'isEdit'
:
1
},
{
'type'
:
'radio'
,
'name'
:
'年-月'
,
'key'
:
2
,
'isEdit'
:
1
}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'日期区间'
,
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fieldType
:
'5'
,
fixed
:
false
,
startName
:
'开始时间'
,
endName
:
'结束时间'
,
startDescription
:
'请选择开始时间'
,
endDescription
:
'请选择结束时间'
,
typeValue
:
'年-月-日'
,
ruleContent
:[
{
'type'
:
'radio'
,
'name'
:
'年-月-日'
,
'key'
:
1
,
'checked'
:
'checked'
,
'isEdit'
:
1
},
{
'type'
:
'radio'
,
'name'
:
'年-月'
,
'key'
:
2
,
'isEdit'
:
1
}
],
isMust
:
true
,
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'数字输入框'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldType
:
"6"
,
// 字段类型 数字输入框
fieldEdited
:
1
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'请输入'
,
ruleContent
:
[],
fieldContent
:
[],
isMust
:
true
,
unit
:
'单位'
,
// 数字单位
staffRecordsIds
:
[]
},
{
parentCode
:
'defineInfo'
,
systemFieldId
:
'-1'
,
fieldName
:
'图片'
,
fieldKey
:
''
,
systemFlag
:
false
,
fieldType
:
"7"
,
// 字段类型
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fixed
:
false
,
fieldDescription
:
'最多上传9张图片'
,
ruleContent
:
[],
fieldContent
:[],
isMust
:
true
,
staffRecordsIds
:
[]
},
],
defineInfo
:
allInfo
.
defineInfo
(),
// 中间数据集合
currentIndex
:
0
,
//当前选择的 item
currentKey
:
''
,
// 当前选择的 item key
// children
currentChildKey
:
null
,
currentChildIndex
:
null
,
childIndex
:
0
,
tempaletDataList
:[
{
parentCode
:
''
,
systemFieldId
:
'baseInfo'
,
fieldName
:
'基本信息'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
/*{
{
parentCode
:
''
,
systemFieldId
:
'jobInfo'
,
fieldName
:
'工作信息'
,
fieldEdited:
0
, // 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
{
parentCode
:
''
,
systemFieldId
:
'selfInfo'
,
fieldName
:
'个人信息'
,
fieldEdited:
0
, // 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
{
parentCode
:
''
,
systemFieldId
:
'eduInfo'
,
fieldName
:
'学历信息'
,
fieldEdited:
0
, // 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
{
parentCode
:
''
,
systemFieldId
:
'contractInfo'
,
fieldName
:
'合同信息'
,
fieldEdited:
0
, // 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
{
parentCode
:
''
,
systemFieldId
:
'contactInfo'
,
fieldName
:
'紧急联系人'
,
fieldEdited:
0
, // 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
{
parentCode
:
''
,
systemFieldId
:
'personalInfo'
,
fieldName
:
'个人资料'
,
fieldEdited:
0
, // 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
*/
},
],
// 添加父级集合
...
...
@@ -757,78 +586,74 @@ export default {
parentCode
:
''
,
systemFieldId
:
'baseInfo'
,
fieldName
:
'基本信息'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
'jobInfo'
:
{
parentCode
:
''
,
systemFieldId
:
'jobInfo'
,
fieldName
:
'工作信息'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
'selfInfo'
:
{
parentCode
:
''
,
systemFieldId
:
'selfInfo'
,
fieldName
:
'个人信息'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
'eduInfo'
:
{
parentCode
:
''
,
systemFieldId
:
'eduInfo'
,
fieldName
:
'学历信息'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
'contractInfo'
:
{
parentCode
:
''
,
systemFieldId
:
'contractInfo'
,
fieldName
:
'合同信息'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
'contactInfo'
:{
parentCode
:
''
,
systemFieldId
:
'contactInfo'
,
fieldName
:
'紧急联系人'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
'personalInfo'
:
{
parentCode
:
''
,
systemFieldId
:
'personalInfo'
,
fieldName
:
'个人资料'
,
fieldEdited
:
0
,
// 修改(0:不可修改,1:可修改)
fieldEdited
:
false
,
// 修改(0:不可修改,1:可修改)
isMust
:
true
,
fieldDescription
:
''
,
sonList
:[
children
:[
],
},
},
// sonlist
currentChildIndex
:
null
,
childIndex
:
0
,
// 员工档案权限
staffRecordsOptions
:
[
{
...
...
@@ -837,7 +662,7 @@ export default {
},
{
id
:
'staffUnvisible'
,
name
:
'对员工可见'
name
:
'对员工
不
可见'
},
{
id
:
'staffMod'
,
...
...
@@ -861,39 +686,15 @@ export default {
* baseInfoClone
*/
baseInfoClone
()
{
var
that
=
this
const
that
=
this
// that.baseInfo = JSON.parse(JSON.stringify(that.baseInfo))
},
inputFocus
(
tag
,
obj
){
var
that
=
this
console
.
log
(
tag
,
obj
);
that
.
tempTag
=
tag
;
that
.
tempObj
=
obj
;
},
formatInput
(
e
){
var
that
=
this
console
.
log
(
e
,
e
.
target
.
value
)
that
.
tempObj
[
that
.
tempTag
]
=
String
(
e
.
target
.
value
).
replace
(
/
[^\d]
/g
,
''
)
// 判断最大值和最小值
if
(
that
.
tempObj
[
'limitCountMin'
]
>=
that
.
tempObj
[
'limitCountMax'
])
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
"长度限制格式有误"
})
// 重新赋值
that
.
tempObj
[
'limitCountMax'
]
=
20
+
parseInt
(
that
.
tempObj
[
'limitCountMin'
])
}
},
/**
* 点击左侧字段 item
*/
clickItem
(
item
)
{
var
that
=
this
const
that
=
this
console
.
log
(
item
)
// item.fixed = !item.fixed
// 判断 中间数据中是否存在父级
...
...
@@ -958,7 +759,7 @@ export default {
* move child
*/
onChildMove
(
evt
){
var
that
=
this
const
that
=
this
var
tag
=
true
;
console
.
log
(
"onChildMove:"
,
evt
,
evt
.
to
.
className
)
if
(
evt
.
dragged
.
className
.
indexOf
(
'block-class'
)
!=
-
1
)
{
...
...
@@ -974,7 +775,7 @@ export default {
* move end
*/
itemMoveEnd
(
evt
)
{
var
that
=
this
const
that
=
this
that
.
isDragging
=
false
;
console
.
log
(
" move end:"
,
evt
,
evt
.
clone
.
dataset
.
type
)
that
.
selectKey
=
''
;
...
...
@@ -982,7 +783,7 @@ export default {
// 判断中间是否已经添加
that
.
tempaletDataList
.
forEach
(
function
(
ele
,
index
){
ele
.
sonList
.
forEach
(
function
(
child
,
key
)
{
ele
.
children
.
forEach
(
function
(
child
,
key
)
{
if
(
child
.
systemFieldId
==
that
.
selectKey
)
{
setKey
()
}
...
...
@@ -1064,7 +865,7 @@ export default {
},
cloneDefine
(
evt
)
{
var
that
=
this
const
that
=
this
console
.
log
(
"clone>>>>"
,
evt
)
},
...
...
@@ -1074,18 +875,18 @@ export default {
* 选择 item 即父级 item
*/
selectItem
(
key
,
index
)
{
var
that
=
this
const
that
=
this
console
.
log
(
key
,
index
)
that
.
currentKey
=
key
;
that
.
currentIndex
=
index
;
that
.
currentChildIndex
=
null
;
that
.
currentIndex
=
index
;
// 父级:当前选中的索引
that
.
currentChildIndex
=
null
;
// 子级未有选中
},
/**
* 删除 item 即父级 item
*/
deleteItem
(
key
,
index
)
{
var
that
=
this
const
that
=
this
console
.
log
(
key
,
index
)
that
.
tempaletDataList
.
splice
(
index
,
1
)
that
.
currentIndex
--
;
...
...
@@ -1093,26 +894,28 @@ export default {
if
(
that
.
currentIndex
<=
0
)
{
that
.
currentIndex
=
0
;
}
if
(
that
.
tempaletDataList
.
length
)
{
that
.
currentKey
=
that
.
tempaletDataList
[
that
.
currentIndex
].
systemFieldId
;
}
// 删除后重新设置 fixed 值
that
[
key
].
forEach
(
function
(
ele
,
index
){
ele
.
fixed
=
false
})
console
.
log
(
that
.
currentIndex
,
that
.
currentKey
,
that
.
tempaletDataList
)
console
.
log
(
that
.
currentIndex
,
that
.
tempaletDataList
)
},
// 添加 item
/**
* 添加 item
*/
addItem
(
evt
)
{
var
that
=
this
;
const
that
=
this
;
console
.
log
(
"中间add:"
,
evt
,
that
.
tempaletDataList
)
},
// 添加child
/**
* 添加 child
*/
addDragItem
(
evt
)
{
var
that
=
this
;
const
that
=
this
;
console
.
log
(
"中间 child-add:"
,
evt
,
that
.
tempaletDataList
)
return
false
;
},
...
...
@@ -1121,24 +924,25 @@ export default {
* 选择 item 即子级 item
*/
selectChildItem
(
key
,
index
,
ind
,
list
)
{
var
that
=
this
const
that
=
this
console
.
log
(
key
,
index
,
ind
,
list
)
that
.
currentKey
=
key
;
that
.
currentIndex
=
null
;
that
.
currentChildKey
=
key
that
.
childIndex
=
index
that
.
currentChildIndex
=
ind
;
console
.
log
(
that
.
tempaletDataList
)
},
/**
* 删除 item 即子级 item
*/
deleteChildItem
(
key
,
index
,
ind
,
list
,
childItem
)
{
var
that
=
this
const
that
=
this
console
.
log
(
key
,
index
,
ind
,
list
)
that
.
childIndex
=
index
// list.splice(ind,1)
that
.
tempaletDataList
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
tempaletDataList
))
that
.
tempaletDataList
[
index
].
sonList
.
splice
(
ind
,
1
)
that
.
tempaletDataList
[
index
].
children
.
splice
(
ind
,
1
)
// 重新设置左侧的 fixed
console
.
log
(
childItem
.
parentCode
)
...
...
@@ -1154,7 +958,7 @@ export default {
*/
checkedChange
(
e
,
item
){
var
that
=
this
const
that
=
this
console
.
log
(
e
,
item
)
},
...
...
@@ -1162,24 +966,24 @@ export default {
* 添加删除选项
*/
delChildItem
(
index
,
ind
,
item
)
{
var
that
=
this
const
that
=
this
console
.
log
(
index
,
ind
,
item
)
item
.
fieldContent
.
splice
(
ind
,
1
)
},
addChildItem
(
index
,
ind
,
item
)
{
var
that
=
this
const
that
=
this
console
.
log
(
index
,
ind
,
item
)
item
.
fieldContent
.
forEach
(
function
(
ele
,
index
)
{
if
(
ele
.
name
)
{}
})
// 多选
if
(
item
.
systemFieldId
==
"k404"
||
item
.
systemFieldId
==
'-1'
&&
item
.
fieldType
==
1
)
{
if
(
ind
==
19
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
"最多可添加 20 项"
})
return
;
}
else
{
console
.
log
(
'item.systemFieldId>>>'
,
item
.
systemFieldId
,
item
.
fieldType
)
if
(
item
.
systemFieldId
==
'-1'
&&
item
.
fieldType
==
1
){
...
...
@@ -1199,7 +1003,6 @@ export default {
message
:
"选项不能重复"
})
console
.
log
(
item
.
fieldContent
,
arrValues
)
return
;
}
return
;
...
...
@@ -1220,22 +1023,11 @@ export default {
message
:
"选项不能重复"
})
console
.
log
(
item
.
fieldContent
,
arrValues
)
return
;
}
}
return
;
}
// 单选
if
(
ind
==
4
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
"最多可添加 5 项"
})
return
;
}
item
.
fieldContent
.
push
(
{
'type'
:
'radio'
,
'name'
:
'请输入选项'
},
...
...
@@ -1258,66 +1050,18 @@ export default {
},
// 改变输入框的值,子组件触发方法
itemInput
(
val
)
{
var
that
=
this
console
.
log
(
val
,
val
.
c3Index
)
// 判断组块子级
if
(
!!
val
&&
val
.
child
==
'child'
)
{
// 如果是标题
if
(
!!
val
&&
val
.
title
==
'title'
)
{
console
.
log
(
that
.
tempaletDataList
[
that
.
childIndex
],
that
.
currentChildIndex
)
that
.
tempaletDataList
[
that
.
childIndex
].
sonList
[
that
.
currentChildIndex
].
fieldName
=
val
.
value
;
return
;
}
// 如果是/
console
.
log
(
that
.
tempaletDataList
[
that
.
childIndex
].
sonList
[
that
.
currentChildIndex
])
if
(
!!
val
&&
val
.
flag
==
'k303'
)
{
that
.
tempaletDataList
[
that
.
childIndex
].
sonList
[
that
.
currentChildIndex
].
fieldContent
[
val
.
c3Index
].
name
=
val
.
value
;
return
;
}
that
.
tempaletDataList
[
that
.
childIndex
].
sonList
[
that
.
currentChildIndex
].
fieldDescription
=
val
.
value
;
return
;
}
// 如果是标题
if
(
!!
val
&&
val
.
title
==
'title'
)
{
that
.
tempaletDataList
[
that
.
currentIndex
].
fieldName
=
val
.
value
;
return
;
}
// 如果是年收入/
if
(
!!
val
&&
val
.
flag
==
'k303'
)
{
that
.
tempaletDataList
[
that
.
currentIndex
].
fieldContent
[
val
.
c3Index
].
name
=
val
.
value
;
return
;
}
that
.
tempaletDataList
[
that
.
currentIndex
].
fieldDescription
=
val
;
},
// 自定义复选(单行输入框)
changeCheck
(
e
,
ind
,
item
)
{
var
that
=
this
console
.
log
(
e
,
ind
,
item
)
// item[ind].checked = e
// if (e) {
// item[ind].checked = 'unchecked'
// }else {
// item[ind].checked ='checked';
// }
console
.
log
(
item
)
},
// 自定义单选(日期)
/**
* 自定义单选(日期)
*/
changeRadio
(
e
,
ind
,
item
)
{
var
that
=
this
const
that
=
this
console
.
log
(
e
,
ind
,
item
)
},
// 判断添加重复字段
/**
* 判断添加重复字段
*/
isRepeat
(
arr
)
{
var
hash
=
{};
for
(
var
i
in
arr
)
{
...
...
@@ -1330,78 +1074,49 @@ export default {
},
//路由跳转
/**
* 路由跳转
*/
changeRoute
(
route
)
{
this
.
$router
.
push
(
route
);
},
// 检查
/**
* 检查
*/
checkTag
(
data
)
{
var
that
=
this
var
tag
=
{}
tag
.
flag
=
true
;
tag
.
bodyFlag
=
true
;
const
that
=
this
;
let
tag
=
{};
tag
.
filedFlag
=
true
;
data
.
forEach
(
function
(
ele
,
index
){
ele
.
isMust
=
ele
.
isMust
==
true
?
1
:
0
;
//是否必填(0:不是,1:必填)
ele
.
sortNum
=
index
+
1
;
//排序
// console.log(">>>>>>>>>>>>>>>>>>>>" ,ele.fieldName )
if
(
ele
.
fieldName
==
''
)
{
tag
.
filedFlag
=
false
tag
.
name
=
ele
.
fieldName
||
''
tag
.
name
=
ele
.
fieldName
||
'
字段名称
'
return
false
;
}
if
(
!!
ele
.
enterpriseIds
&&
(
ele
.
enterpriseIds
==
null
||
!
ele
.
enterpriseIds
.
length
))
{
tag
.
flag
=
false
tag
.
name
=
ele
.
fieldName
}
if
(
ele
.
systemFieldId
==
'k203'
&&
!
ele
.
babyIds
.
length
)
{
console
.
log
(
ele
.
babyIds
)
tag
.
bodyFlag
=
false
tag
.
name
=
ele
.
fieldName
||
'宝宝'
}
// 判断
组块
// 判断
子级
if
(
ele
.
systemFieldId
==
-
1
&&
ele
.
fieldType
==
5
)
{
ele
.
sonList
.
forEach
(
function
(
el
,
index
){
ele
.
children
.
forEach
(
function
(
el
,
index
){
if
(
el
.
fieldName
==
''
)
{
tag
.
filedFlag
=
false
tag
.
name
=
el
.
fieldName
||
''
tag
.
name
=
el
.
fieldName
||
'
字段名称
'
return
false
;
}
if
(
el
.
enterpriseIds
==
null
||
!
el
.
enterpriseIds
.
length
)
{
tag
.
flag
=
false
tag
.
name
=
el
.
fieldName
}
})
}
})
return
tag
},
guid
()
{
return
'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
function
(
c
)
{
var
r
=
Math
.
random
()
*
16
|
0
,
v
=
c
==
'x'
?
r
:
(
r
&
0x3
|
0x8
);
return
v
.
toString
(
16
);
});
},
// 保存
/**
* 保存
*/
saveAndBack
()
{
var
that
=
this
const
that
=
this
console
.
log
(
that
.
tempaletDataList
);
var
data
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
tempaletDataList
))
// 检查商户选中
if
(
!
data
||!
data
.
length
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
'请配置开卡字段'
})
return
;
}
// console.log(that.checkTag(data))
var
tagObj
=
that
.
checkTag
(
data
)
console
.
log
(
tagObj
)
...
...
@@ -1414,82 +1129,41 @@ export default {
return
;
}
// 检查宝宝
if
(
!
tagObj
.
bodyFlag
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
tagObj
.
name
+
'字段至少选择一个选项'
})
return
;
}
data
.
forEach
(
function
(
ele
,
index
){
ele
.
isMust
=
ele
.
isMust
==
true
?
1
:
0
;
//是否必填(0:不是,1:必填)
// 判断可修改
ele
.
fieldEdited
=
ele
.
fieldEdited
==
true
?
1
:
0
ele
.
sortNum
=
index
+
1
;
//排序
if
(
!!
ele
.
enterpriseIds
&&
ele
.
enterpriseIds
.
length
)
{
ele
.
enterpriseIds
=
ele
.
enterpriseIds
.
join
(
','
)
}
if
(
ele
.
babyIds
)
{
ele
.
babyIds
=
ele
.
babyIds
.
join
(
','
)
}
if
(
ele
.
fieldContent
)
{
ele
.
fieldContent
=
JSON
.
stringify
(
ele
.
fieldContent
)
}
if
(
ele
.
ruleContent
)
{
ele
.
ruleContent
=
JSON
.
stringify
(
ele
.
ruleContent
)
}
if
(
ele
.
systemFieldId
!=
-
1
||
(
ele
.
systemFieldId
==
-
1
)
&&
ele
.
fieldType
!=
5
)
{
ele
.
parentFieldId
=
'-1'
;
}
// 日期
if
(
ele
.
systemFieldId
==
-
1
&&
ele
.
fieldType
==
4
)
{
if
(
ele
.
typeValue
==
"年-月"
)
{
ele
.
regularRule
=
'0000010'
;
}
else
{
ele
.
regularRule
=
'0000100'
;
}
}
})
// 判断重复字段
var
flagArr
=
data
.
map
(
item
=>
item
.
fieldName
)
if
(
that
.
isRepeat
(
flagArr
))
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
'标题字段名不能重复'
})
return
;
//
that.$message.error({
//
duration: 1000,
//
message: '标题字段名不能重复'
//
})
//
return;
}
console
.
log
(
data
)
//
that.saveAllData(data)
that
.
saveAllData
(
data
)
},
// 保存数据
/**
* 保存---api
*/
saveAllData
(
data
)
{
var
that
=
this
const
that
=
this
var
para
=
{
params
:
JSON
.
stringify
(
data
)
templateContent
:
JSON
.
stringify
(
data
)
}
postRequest
(
'/
api-admin/save-card-filed-template
'
,
para
)
postRequest
(
'/
haoban-manage-web/record/record-template-save.json
'
,
para
)
.
then
((
res
)
=>
{
console
.
log
(
res
.
data
)
var
resData
=
res
.
data
if
(
resData
.
errorCode
==
0
)
{
if
(
resData
.
errorCode
==
1
)
{
showMsg
.
showmsg
(
'保存成功'
,
'success'
)
that
.
changeRoute
(
'/memberCardSet'
)
//
that.changeRoute('/memberCardSet')
return
;
}
errMsg
.
errorMsg
(
resData
)
...
...
@@ -1505,117 +1179,20 @@ export default {
});
},
// 获取模板所有字段
getTempInfo
()
{
var
that
=
this
var
para
=
{
}
postRequest
(
'/api-admin/member-card-filed-template'
,
para
)
/**
* 获取已经保存模板信息---api
*/
getInfo
()
{
const
that
=
this
postRequest
(
'/haoban-manage-web/record/employee-find-template.json'
,{})
.
then
((
res
)
=>
{
console
.
log
(
res
.
data
)
var
resData
=
res
.
data
if
(
resData
.
errorCode
==
0
)
{
var
data
=
resData
.
result
.
cateList
data
.
forEach
(
function
(
el
,
ind
){
el
.
fieldList
.
forEach
(
function
(
ele
,
index
){
if
(
!!
ele
.
fieldContent
&&
ele
.
fieldContent
!=
-
1
)
{
if
(
ele
.
fieldContent
.
indexOf
(
"'"
)
!=
'-1'
)
{
ele
.
fieldContent
=
JSON
.
parse
(
ele
.
fieldContent
.
replace
(
/'/g
,
'"'
))
}
else
{
ele
.
fieldContent
=
JSON
.
parse
(
ele
.
fieldContent
)
}
// ele.fieldContent = JSON.parse(ele.fieldContent.replace(/'/g, '"'))
}
if
(
!!
ele
.
ruleContent
&&
ele
.
ruleContent
!=
-
1
)
{
if
(
ele
.
ruleContent
.
indexOf
(
"'"
)
!=
'-1'
)
{
ele
.
ruleContent
=
JSON
.
parse
(
ele
.
ruleContent
.
replace
(
/'/g
,
'"'
))
}
else
{
ele
.
ruleContent
=
JSON
.
parse
(
ele
.
ruleContent
)
}
// ele.ruleContent = JSON.parse(ele.ruleContent.replace(/'/g, '"'))
}
// 判断必选
ele
.
isMust
=
ele
.
isMust
==
1
?
true
:
false
// 判断可修改
ele
.
fieldEdited
=
ele
.
fieldEdited
==
1
?
true
:
false
// 判断商户全选
if
(
!!
ele
.
enterpriseIds
&&
ele
.
enterpriseIds
!=
''
&&
ele
.
enterpriseIds
!=
null
&&
!!
ele
.
enterpriseIds
.
length
)
{
// console.log(ele.enterpriseIds)
ele
.
enterpriseIds
=
ele
.
enterpriseIds
.
split
(
','
)
}
else
{
ele
.
enterpriseIds
=
[]
}
// console.log(ele.enterpriseIds)
ele
.
isIndeterminate
=
false
;
if
(
!!
ele
.
enterpriseIds
&&
ele
.
enterpriseIds
.
length
==
that
.
merchantOptions
.
length
)
{
ele
.
checkAll
=
true
;
}
else
{
ele
.
checkAll
=
false
;
}
if
(
!!
ele
.
enterpriseIds
&&!!
ele
.
enterpriseIds
.
length
&&
ele
.
enterpriseIds
.
length
<
that
.
merchantOptions
.
length
){
ele
.
isIndeterminate
=
true
;
}
// 字段不一样,统一下字段
if
(
!
ele
.
systemFieldId
)
{
ele
.
systemFieldId
=
ele
.
opencardFieldId
}
// 判断禁用 fixed 字段
// console.log(that.setList)
if
(
that
.
setList
.
indexOf
(
ele
.
systemFieldId
)
!=-
1
)
{
ele
.
fixed
=
true
}
else
{
ele
.
fixed
=
false
;
}
// 如果是 k10开头
if
(
ele
.
systemFieldId
.
indexOf
(
'k10'
)
!=
-
1
)
{
that
.
baseInfo
.
push
(
ele
)
}
// 如果是 k20开头
if
(
ele
.
systemFieldId
.
indexOf
(
'k20'
)
!=
-
1
)
{
// 宝宝信息
if
(
ele
.
systemFieldId
==
'k203'
)
{
console
.
log
(
"ele.babyIds:"
,
ele
.
babyIds
)
ele
.
babyIds
=
[]
}
that
.
familyInfo
.
push
(
ele
)
}
// 如果是 k30开头
if
(
ele
.
systemFieldId
.
indexOf
(
'k30'
)
!=
-
1
)
{
that
.
assetInfo
.
push
(
ele
)
}
// 如果是 k40开头
if
(
ele
.
systemFieldId
.
indexOf
(
'k40'
)
!=
-
1
)
{
that
.
otherInfo
.
push
(
ele
)
if
(
resData
.
errorCode
==
1
)
{
that
.
setList
=
[];
if
(
!!
resData
.
result
&&
!!
Object
.
keys
(
resData
.
result
).
length
)
{
that
.
handleGetInfo
(
resData
.
result
)
}
// 自定义不是从接口返回
// if (ele.systemFieldId == -1) {
// that.defineInfo.push(ele)
// }
console
.
log
(
that
.
familyInfo
)
})
})
//
// showMsg.showmsg('设置成功','success')
return
;
}
errMsg
.
errorMsg
(
resData
)
...
...
@@ -1623,7 +1200,6 @@ export default {
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
that
.
$message
.
error
({
duration
:
1000
,
message
:
error
.
message
...
...
@@ -1631,205 +1207,45 @@ export default {
});
},
// 获取已经保存模板信息
getInfo
()
{
var
that
=
this
var
para
=
{
}
postRequest
(
'/api-admin/get-card-field-template-detail'
,
para
)
.
then
((
res
)
=>
{
console
.
log
(
res
.
data
)
var
resData
=
res
.
data
if
(
resData
.
errorCode
==
0
)
{
that
.
setList
=
[];
var
data
=
resData
.
result
/**
* 处理已存配置信息
*/
handleGetInfo
(
result
)
{
const
that
=
this
var
data
=
JSON
.
parse
(
result
.
templateContent
)
that
.
setParent
=
[];
data
.
forEach
(
function
(
ele
,
index
){
if
(
!!
ele
.
fieldContent
&&
ele
.
fieldContent
!=
-
1
)
{
// console.log(ele.fieldContent,ele.fieldContent.indexOf("'"))
if
(
ele
.
fieldContent
.
indexOf
(
"'"
)
!=
'-1'
)
{
ele
.
fieldContent
=
JSON
.
parse
(
ele
.
fieldContent
.
replace
(
/'/g
,
'"'
))
}
else
{
ele
.
fieldContent
=
JSON
.
parse
(
ele
.
fieldContent
)
}
}
if
(
!!
ele
.
ruleContent
&&
ele
.
ruleContent
!=
-
1
)
{
console
.
log
(
ele
.
ruleContent
,
ele
.
ruleContent
.
indexOf
(
"'"
))
if
(
ele
.
ruleContent
.
indexOf
(
"'"
)
!=
'-1'
)
{
ele
.
ruleContent
=
JSON
.
parse
(
ele
.
ruleContent
.
replace
(
/'/g
,
'"'
))
}
else
{
ele
.
ruleContent
=
JSON
.
parse
(
ele
.
ruleContent
)
}
if
(
ele
.
systemFieldId
==-
1
&&
ele
.
fieldType
==
0
)
{
ele
.
ruleContent
.
forEach
(
function
(
el
,
ind
){
el
.
select
=
el
.
select
==
1
?
true
:
false
that
.
setParent
.
push
(
ele
.
systemFieldId
);
// 判断子级
if
(
!!
ele
.
children
&&
ele
.
children
.
length
)
{
ele
.
children
.
forEach
(
function
(
el
,
index
){
that
.
setList
.
push
(
el
.
systemFieldId
)
})
}
}
// 判断必选
ele
.
isMust
=
ele
.
isMust
==
1
?
true
:
false
// 判断可修改
ele
.
fieldEdited
=
ele
.
fieldEdited
==
1
?
true
:
false
// 判断商户全选
if
(
!!
ele
.
enterpriseIds
&&
ele
.
enterpriseIds
!=
''
&&
ele
.
enterpriseIds
!=
null
)
{
ele
.
enterpriseIds
=
ele
.
enterpriseIds
.
split
(
','
)
}
if
(
ele
.
enterpriseIds
.
length
==
that
.
merchantOptions
.
length
)
{
ele
.
checkAll
=
true
;
}
else
{
ele
.
checkAll
=
false
;
}
// 判断半选
ele
.
isIndeterminate
=
false
;
if
(
!!
ele
.
enterpriseIds
&&
ele
.
enterpriseIds
.
length
==
that
.
merchantOptions
.
length
)
{
ele
.
checkAll
=
true
;
}
else
{
ele
.
checkAll
=
false
;
}
if
(
!!
ele
.
enterpriseIds
&&!!
ele
.
enterpriseIds
.
length
&&
ele
.
enterpriseIds
.
length
<
that
.
merchantOptions
.
length
){
ele
.
isIndeterminate
=
true
;
}
// 如果是生日
if
(
ele
.
modifyLimitStatus
!=
''
||
ele
.
modifyLimitStatus
==
0
){
ele
.
modifyLimitStatus
=
String
(
ele
.
modifyLimitStatus
)
}
// 宝宝信息
if
(
!!
ele
.
babyIds
)
{
ele
.
babyIds
=
ele
.
babyIds
.
split
(
','
)
}
else
{
console
.
log
(
"ele.babyIds:"
,
ele
.
babyIds
)
ele
.
babyIds
=
[]
}
// 判断禁用,把已经获取的字段添加到数组中,以后判断是否禁用
that
.
setList
.
push
(
ele
.
systemFieldId
)
// 判断自定义部分 regularRule
// if (ele.systemFieldId == -1 ) {
// var regularArr = ele.regularRule.split('')
// ele.zh = regularArr[0];
// ele.num = regularArr[1];
// ele.char = regularArr[2];
// ele.symb = regularArr[3];
// ele.ymd = regularArr[4];
// ele.ym = regularArr[5];
// ele.email = regularArr[6];
// }
// 日期
if
(
ele
.
systemFieldId
==
-
1
&&
ele
.
fieldType
==
4
)
{
if
(
ele
.
regularRule
==
'0000010'
)
{
ele
.
typeValue
=
"年-月"
;
}
else
{
ele
.
typeValue
=
"年-月-日"
;
}
}
// 判断组块
if
(
ele
.
systemFieldId
==
-
1
&&
ele
.
fieldType
==
5
)
{
if
(
ele
.
sonList
==
null
||
!
ele
.
sonList
)
{
ele
.
sonList
=
[]
}
if
(
!!
ele
.
sonList
&&
ele
.
sonList
.
length
)
{
ele
.
sonList
.
forEach
(
function
(
el
,
index
){
if
(
!!
el
.
fieldContent
&&
el
.
fieldContent
!=
-
1
)
{
if
(
el
.
fieldContent
.
indexOf
(
"'"
)
!=
'-1'
)
{
el
.
fieldContent
=
JSON
.
parse
(
el
.
fieldContent
.
replace
(
/'/g
,
'"'
))
}
else
{
el
.
fieldContent
=
JSON
.
parse
(
el
.
fieldContent
)
}
// el.fieldContent = JSON.parse(el.fieldContent.replace(/'/g, '"'))
}
if
(
!!
el
.
ruleContent
&&
el
.
ruleContent
!=
-
1
)
{
if
(
el
.
ruleContent
.
indexOf
(
"'"
)
!=
'-1'
)
{
el
.
ruleContent
=
JSON
.
parse
(
el
.
ruleContent
.
replace
(
/'/g
,
'"'
))
}
else
{
el
.
ruleContent
=
JSON
.
parse
(
el
.
ruleContent
)
}
// el.ruleContent = JSON.parse(el.ruleContent.replace(/'/g, '"'))
}
// 判断必选
el
.
isMust
=
el
.
isMust
==
1
?
true
:
false
// 判断商户全选
if
(
!!
el
.
enterpriseIds
&&
el
.
enterpriseIds
!=
''
&&
el
.
enterpriseIds
!=
null
)
{
el
.
enterpriseIds
=
el
.
enterpriseIds
.
split
(
','
)
}
if
(
el
.
enterpriseIds
.
length
==
that
.
merchantOptions
.
length
)
{
el
.
checkAll
=
true
;
}
else
{
el
.
checkAll
=
false
;
}
// 日期
if
(
el
.
systemFieldId
==
-
1
&&
el
.
fieldType
==
4
)
{
if
(
el
.
regularRule
==
'0000010'
)
{
el
.
typeValue
=
"年-月"
;
}
else
{
el
.
typeValue
=
"年-月-日"
;
}
}
// 判断半选
el
.
isIndeterminate
=
false
;
if
(
!!
el
.
enterpriseIds
&&
el
.
enterpriseIds
.
length
==
that
.
merchantOptions
.
length
)
{
el
.
checkAll
=
true
;
}
else
{
el
.
checkAll
=
false
;
}
if
(
!!
el
.
enterpriseIds
&&!!
el
.
enterpriseIds
.
length
&&
el
.
enterpriseIds
.
length
<
that
.
merchantOptions
.
length
){
el
.
isIndeterminate
=
true
;
}
})
}
}
})
//
console
.
log
(
data
)
that
.
tempaletDataList
=
data
that
.
setFixed
();
},
// 获取模板所有字段
// that.getTempInfo()
// showMsg.showmsg('设置成功','success')
return
;
/**
* 设置禁止拖拽
*/
setFixed
()
{
const
that
=
this
console
.
log
(
that
.
setParent
)
that
.
setParent
.
forEach
(
function
(
ele
,
index
){
that
[
ele
].
forEach
(
function
(
obj
,
key
){
if
(
that
.
setList
.
includes
(
obj
.
systemFieldId
))
{
obj
.
fixed
=
true
}
errMsg
.
errorMsg
(
resData
)
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
that
.
$message
.
error
({
duration
:
1000
,
message
:
error
.
message
})
});
},
}
},
watch
:
{
isDragging
(
newValue
)
{
var
that
=
this
const
that
=
this
if
(
newValue
){
that
.
delayedDragging
=
true
return
...
...
@@ -1841,10 +1257,11 @@ export default {
},
components
:
{
draggable
,
AddInput
AddInput
,
limitInput
},
mounted
()
{
var
that
=
this
;
const
that
=
this
;
// 获取已经配置的数据
that
.
getInfo
()
document
.
body
.
ondrop
=
function
(
event
)
{
...
...
@@ -2206,8 +1623,6 @@ export default {
}
}
.opencard-drag
{
background
:
#fff
;
height
:
46px
;
...
...
@@ -2222,14 +1637,14 @@ export default {
padding-left
:
10px
;
overflow
:
hidden
;
white-space
:
nowrap
;
-webkit-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
box-sizing
:
border-box
;
&.title-pre-wrap
{
line-height
:
15px
;
word-break
:
break-all
;
white-space
:
pre-wrap
;
padding-top
:
9px
;
-webkit-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
/*&.block-pre-wrap{
line-height: 12px;
...
...
@@ -2258,6 +1673,18 @@ export default {
}
.limit-w-340
{
/deep/
.el-input__inner
{
font-size
:
12px
;
color
:
#fff
;
background-color
:
rgba
(
255
,
255
,
255
,
.1
);
}
.tip
{
color
:
rgba
(
255
,
255
,
255
,
0.7
);
}
}
/* 右侧 */
.template-cell-r
{
width
:
400px
;
...
...
@@ -2265,6 +1692,24 @@ export default {
overflow
:
hidden
;
padding-top
:
40px
;
.input-line-cell
{
.tip
{
color
:
rgba
(
255
,
255
,
255
,
0.7
);
}
}
.limit-w-340
{
/deep/
.el-input__inner
{
font-size
:
12px
;
color
:
#fff
;
background-color
:
rgba
(
255
,
255
,
255
,
.1
);
}
.tip
{
color
:
rgba
(
255
,
255
,
255
,
0.7
);
}
}
.el-tabs
{
/deep/.el-tabs__item
{
width
:
175px
;
...
...
@@ -2311,8 +1756,7 @@ export default {
width
:
316px
;
}
.w-340
{
width
:
340px
;
.limit-w-340
{
/deep/
.el-input__inner
{
color
:
#fff
;
background-color
:
rgba
(
255
,
255
,
255
,
.1
);
...
...
@@ -2322,6 +1766,7 @@ export default {
.opt-btn
{
cursor
:
pointer
;
color
:
#C9D3DF
;
vertical-align
:
middle
;
&.
add-item
:
hover
{
/*color: #1890ff;*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment