Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
17a01eb8
Commit
17a01eb8
authored
Oct 19, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mesplan
parent
947ba7a1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
364 additions
and
362 deletions
+364
-362
henq.js
libs/henq.js
+45
-14
add.vue
pages/mesPlan/add.vue
+318
-347
index.vue
pages/mesPlan/index.vue
+1
-1
No files found.
libs/henq.js
View file @
17a01eb8
...
...
@@ -344,7 +344,7 @@ henq.dirCode = (code, v) => {
}
henq
.
makeRules
=
(
list
,
api
)
=>
{
henq
.
makeRules
=
(
list
,
api
Url
)
=>
{
//测试数据start
list
=
[{
//普通输入框
...
...
@@ -418,10 +418,43 @@ henq.makeRules = (list, api) => {
control
:
0
,
uniqueness
:
0
,
ruleType
:
"email"
,
},
{
//唯一性api接口校验
columnDescription
:
"测试列5"
,
dbColumnName
:
"colums5"
,
dataType
:
"varchar"
,
propertyName
:
"colums5"
,
propertyType
:
"String"
,
code
:
""
,
isNullable
:
false
,
isKey
:
false
,
unit
:
""
,
length
:
50
,
decimalDigits
:
0
,
link
:
0
,
defaultValue
:
""
,
control
:
0
,
uniqueness
:
1
,
//表内唯一验证
ruleType
:
""
,
}
]
apiUrl
=
`
${
resourceUrl
}
/mesparttaskplansimulate/get`
//测试数据end
//唯一性校验
const
validateCol
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
"输入不能为空"
));
}
this
.
$api
.
post
(
apiUrl
,
value
).
then
((
r
)
=>
{
if
(
r
.
result
.
length
>
0
)
{
return
callback
(
new
Error
(
"输入数据已经存在"
));
}
else
{
callback
();
}
})
};
//手机号验证
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
...
...
@@ -446,6 +479,14 @@ henq.makeRules = (list, api) => {
message
:
"必填"
,
trigger
:
"blur"
}
if
(
el
.
uniqueness
!=
0
)
{
let
objUniqueness
=
{
validator
:
validateCol
,
trigger
:
"blur"
}
rules
[
el
.
propertyName
].
push
(
objUniqueness
)
}
}
else
if
(
el
.
ruleType
==
'email'
)
{
objInfo
=
{
required
:
true
,
...
...
@@ -453,25 +494,15 @@ henq.makeRules = (list, api) => {
trigger
:
'blur'
,
type
:
'email'
}
}
else
if
(
el
.
ruleType
==
'phone'
)
{
}
else
if
(
el
.
ruleType
==
'phone'
)
{
objInfo
=
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}
let
valInfoPhone
=
{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
}
rules
[
el
.
propertyName
].
push
(
valInfoPhone
)
}
}
else
{
//数据字典
}
else
{
//数据字典
objInfo
=
{
required
:
true
,
message
:
"必选"
,
...
...
pages/mesPlan/add.vue
View file @
17a01eb8
<
template
>
<div
style=
"width:100%;"
>
<
template
>
<div
style=
"width:100%;"
>
<Form
:model=
"orderSearchForm"
:label-width=
"95"
:rules=
"ruleValidate"
ref=
"formValidate"
>
<Row>
<Col
span=
"8"
>
<FormItem
label=
"产品名称"
style=
"width:100%"
prop=
"productId"
>
<Select
v-model=
"orderSearchForm.productId"
:placeholder=
"placeholdeinfo"
style=
"width:240px;"
>
<Option
v-for=
"(item,index) in list"
:key=
"item.index"
:value=
"item.value"
:label=
"item.label"
style=
"display:none"
></Option>
<Select
v-model=
"orderSearchForm.productId"
:placeholder=
"placeholdeinfo"
style=
"width:240px;"
>
<Option
v-for=
"(item,index) in list"
:key=
"item.index"
:value=
"item.value"
:label=
"item.label"
style=
"display:none"
></Option>
<Tree
key=
"mytree"
:data=
"data1"
ref=
"mytree"
:render=
"renderContent"
></Tree>
</Select>
</FormItem>
...
...
@@ -29,11 +19,7 @@
</Col>
<Col
span=
"8"
>
<FormItem
label=
"任务类型"
style=
"width:100%"
prop=
"taskType"
>
<dictionary
code=
"plan.order.taskType"
v-model=
"orderSearchForm.taskType"
style=
"width:240px"
></dictionary>
<dictionary
code=
"plan.order.taskType"
v-model=
"orderSearchForm.taskType"
style=
"width:240px"
></dictionary>
</FormItem>
</Col>
</Row>
...
...
@@ -45,24 +31,12 @@
</Col>
<Col
span=
"8"
>
<FormItem
label=
"开始时间"
style=
"width:100%"
>
<DatePicker
type=
"date"
placeholder=
"请选择日期"
style=
"width:240px"
@
on-change=
"getStartDate"
v-model=
"orderSearchForm.demandStartDate"
></DatePicker>
<DatePicker
type=
"date"
placeholder=
"请选择日期"
style=
"width:240px"
@
on-change=
"getStartDate"
v-model=
"orderSearchForm.demandStartDate"
></DatePicker>
</FormItem>
</Col>
<Col
span=
"8"
>
<FormItem
label=
"完成时间"
style=
"width:100%"
>
<DatePicker
type=
"date"
placeholder=
"请选择日期"
style=
"width:240px"
@
on-change=
"getFinishedDate"
v-model=
"orderSearchForm.demandFinishDate"
></DatePicker>
<DatePicker
type=
"date"
placeholder=
"请选择日期"
style=
"width:240px"
@
on-change=
"getFinishedDate"
v-model=
"orderSearchForm.demandFinishDate"
></DatePicker>
</FormItem>
</Col>
</Row>
...
...
@@ -79,11 +53,7 @@
</Col>
<Col
span=
"8"
>
<FormItem
label=
"紧急程度"
style=
"width:100%"
>
<dictionary
style=
"width:240px"
code=
"plan.order.urgencyLevel"
v-model=
"orderSearchForm.urgencyLevel"
></dictionary>
<dictionary
style=
"width:240px"
code=
"plan.order.urgencyLevel"
v-model=
"orderSearchForm.urgencyLevel"
></dictionary>
</FormItem>
</Col>
</Row>
...
...
@@ -106,9 +76,11 @@
</Col>
</Row>
</Form>
</div>
</div>
</
template
>
<
script
>
<
script
>
var
myDate
=
new
Date
();
var
dayTomorrow
=
new
Date
();
dayTomorrow
.
setTime
(
dayTomorrow
.
getTime
()
+
24
*
60
*
60
*
1000
);
...
...
@@ -147,30 +119,24 @@ export default {
bomId
:
null
,
},
ruleValidate
:
{
productId
:
[
{
productId
:
[{
required
:
true
,
message
:
"请选择产品名称"
,
type
:
"number"
,
trigger
:
"change"
,
},
],
taskType
:
[
{
},
],
taskType
:
[{
required
:
true
,
message
:
"请选择任务类型"
,
trigger
:
"change"
,
type
:
"number"
,
},
],
quantity
:
[
{
},
],
quantity
:
[{
required
:
true
,
message
:
"请输入数量"
,
type
:
"number"
,
trigger
:
"change"
,
},
],
},
],
},
wfstatu
:
1
,
};
...
...
@@ -227,7 +193,10 @@ export default {
this
.
selectdata
=
[];
this
.
selectdata
=
data
;
this
.
list
=
[];
this
.
list
.
push
({
label
:
data
[
0
].
title
,
value
:
data
[
0
].
id
});
this
.
list
.
push
({
label
:
data
[
0
].
title
,
value
:
data
[
0
].
id
});
if
(
data
[
0
].
isProduct
==
1
)
{
this
.
orderSearchForm
.
productName
=
data
[
0
].
title
;
this
.
orderSearchForm
.
productId
=
data
[
0
].
productId
;
...
...
@@ -269,7 +238,11 @@ export default {
}
});
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
renderContent
(
h
,
{
root
,
node
,
data
})
{
let
type
=
"md-folder"
;
let
title
=
data
.
title
;
if
(
data
.
isProduct
!=
0
)
{
...
...
@@ -285,8 +258,7 @@ export default {
}
}
return
h
(
"span"
,
{
"span"
,
{
on
:
{
click
:
()
=>
{
let
arrTree
=
[];
...
...
@@ -305,8 +277,7 @@ export default {
},
}),
h
(
"span"
,
{
"span"
,
{
style
:
{
color
:
data
.
isProduct
==
0
?
"#000"
:
"rgba(38, 128, 235, 1)"
,
},
...
...
pages/mesPlan/index.vue
View file @
17a01eb8
...
...
@@ -552,7 +552,7 @@ export default {
methods
:
{
getRules
()
{
let
ruleInfos
=
this
.
$u
.
makeRules
()
console
.
log
(
ruleInfos
)
//
console.log(ruleInfos)
//alert(JSON.stringify(ruleInfos))
},
addOk
()
{
...
...
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