Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
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
fukai
vue-gjjs
Commits
87c689f0
Commit
87c689f0
authored
Oct 26, 2021
by
潘际乾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
请求参数model提取至公共函数
parent
c80b23ef
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
37 deletions
+61
-37
commonApi.js
src/mixin/commonApi.js
+8
-7
commonProcess.js
src/mixin/commonProcess.js
+20
-0
Event.js
src/model/Ditopn/Event.js
+6
-6
index.js
src/utils/index.js
+0
-16
Docpan.vue
src/views/Business/Ditopn/Docpan.vue
+2
-4
Ovwp.vue
src/views/Business/Ditopn/Ovwp.vue
+1
-4
Setpan.vue
src/views/Business/Ditopn/Setpan.vue
+24
-0
No files found.
src/mixin/commonApi.js
View file @
87c689f0
...
@@ -13,25 +13,25 @@ export default {
...
@@ -13,25 +13,25 @@ export default {
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/init"
,{
params
})
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/init"
,{
params
})
},
},
save
(
params
){
save
(
params
){
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/saveData"
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/saveData"
,
this
.
wrapper
(
params
))
},
},
exeuteCheck
(
rulePath
,
params
){
exeuteCheck
(
rulePath
,
params
){
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeCheck/"
+
rulePath
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeCheck/"
+
rulePath
,
this
.
wrapper
(
params
))
},
},
executeDefault
(
rulePath
,
params
)
executeDefault
(
rulePath
,
params
)
{
{
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeDefault/"
+
rulePath
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeDefault/"
+
rulePath
,
this
.
wrapper
(
params
))
},
},
executeRule
(
rulePath
,
params
)
executeRule
(
rulePath
,
params
)
{
{
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeRule/"
+
rulePath
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeRule/"
+
rulePath
,
this
.
wrapper
(
params
))
},
},
async
checkAll
(
params
){
async
checkAll
(
params
){
const
res
=
await
Api
.
post
(
this
.
declareParams
.
trnName
+
"/checkAll"
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
const
res
=
await
Api
.
post
(
this
.
declareParams
.
trnName
+
"/checkAll"
,
this
.
wrapper
(
params
))
return
res
return
res
},
},
pedding
(
params
){
pedding
(
params
){
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/pending"
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/pending"
,
this
.
wrapper
(
params
))
},
},
async
restoreDisplay
()
async
restoreDisplay
()
{
{
...
@@ -43,7 +43,7 @@ export default {
...
@@ -43,7 +43,7 @@ export default {
},
},
executeNotify
(
params
)
executeNotify
(
params
)
{
{
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeNotify"
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/executeNotify"
,
this
.
wrapper
(
params
))
},
},
}
}
}
}
\ No newline at end of file
src/mixin/commonProcess.js
View file @
87c689f0
...
@@ -97,6 +97,26 @@ export default {
...
@@ -97,6 +97,26 @@ export default {
return
"blur"
;
return
"blur"
;
},
},
/**
/**
* 以函数形式获取model(请求参数),保证取到的是最新赋值的
* @param {any} params 参数
* @returns
*/
wrapper
(
params
)
{
params
=
params
||
{}
const
fn
=
async
()
=>
{
const
that
=
this
;
const
data
=
await
new
Promise
(
resolve
=>
{
// 保证前一次请求结果赋值VO完成
setTimeout
(()
=>
{
const
d
=
Utils
.
flatObject
(
that
.
model
)
resolve
(
d
)
},
0
)
})
return
{...
data
,
params
}
}
return
fn
;
},
/**
* 更新Model
* 更新Model
* @param {any} data model数据
* @param {any} data model数据
*/
*/
...
...
src/model/Ditopn/Event.js
View file @
87c689f0
...
@@ -268,21 +268,21 @@ export default {
...
@@ -268,21 +268,21 @@ export default {
})
})
},
},
async
BlurBennam
(
e
)
{
async
BlurBennam
(
e
)
{
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDefault/litp1.remark"
,
Utils
.
getRequestDataFn
.
call
(
this
))
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDefault/litp1.remark"
,
this
.
wrapper
(
))
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
//TODO 处理数据逻辑
//TODO 处理数据逻辑
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
}
}
},
},
async
BlurAplname
(
e
)
{
async
BlurAplname
(
e
)
{
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDefault/litp1.remark"
,
Utils
.
getRequestDataFn
.
call
(
this
))
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDefault/litp1.remark"
,
this
.
wrapper
(
))
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
//TODO 处理数据逻辑
//TODO 处理数据逻辑
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
}
}
},
},
async
BlurSignam
(
e
)
{
async
BlurSignam
(
e
)
{
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDefault/litp1.remark"
,
Utils
.
getRequestDataFn
.
call
(
this
))
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDefault/litp1.remark"
,
this
.
wrapper
(
))
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
//TODO 处理数据逻辑
//TODO 处理数据逻辑
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
...
@@ -297,14 +297,14 @@ export default {
...
@@ -297,14 +297,14 @@ export default {
let
rtnmsg
let
rtnmsg
if
(
cortyp
==
'SWT'
||
cortyp
==
'FMT'
||
cortyp
==
'CMT'
)
{
if
(
cortyp
==
'SWT'
||
cortyp
==
'FMT'
||
cortyp
==
'CMT'
)
{
this
.
model
.
setmod
.
msgmod
.
doccod
=
row
.
id
this
.
model
.
setmod
.
msgmod
.
doccod
=
row
.
id
rtnmsg
=
await
Api
.
post
(
'cptopn/msgmod_butshw'
,
{
data
:
Utils
.
getRequestDataFn
.
call
(
this
)
})
rtnmsg
=
await
Api
.
post
(
'cptopn/msgmod_butshw'
,
{
data
:
this
.
wrapper
(
)
})
}
else
{
}
else
{
this
.
model
.
trnmod
.
trndoc
.
doccod
=
row
.
id
this
.
model
.
trnmod
.
trndoc
.
doccod
=
row
.
id
this
.
model
.
trnmod
.
trndoc
.
cortyp
=
cortyp
this
.
model
.
trnmod
.
trndoc
.
cortyp
=
cortyp
const
params
=
{
const
params
=
{
index
:
index
index
:
index
}
}
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDocpan"
,
Utils
.
getRequestDataFn
.
call
(
this
,
params
))
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDocpan"
,
this
.
wrapper
(
params
))
}
}
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
if
(
cortyp
==
'SWT'
||
cortyp
==
'FMT'
||
cortyp
==
'CMT'
)
{
if
(
cortyp
==
'SWT'
||
cortyp
==
'FMT'
||
cortyp
==
'CMT'
)
{
...
@@ -359,7 +359,7 @@ export default {
...
@@ -359,7 +359,7 @@ export default {
const
params
=
{
const
params
=
{
index
:
index
index
:
index
}
}
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDocpanDetail"
,
{
...
Utils
.
getRequestDataFn
.
call
(
this
),
params
})
let
rtnmsg
=
await
Api
.
post
(
"ditopn/executeDocpanDetail"
,
{
...
this
.
wrapper
(
),
params
})
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
if
(
rtnmsg
.
respCode
==
"AAAAAA"
)
{
//TODO 处理数据逻辑
//TODO 处理数据逻辑
console
.
log
(
"11111111111111111111111111111"
)
console
.
log
(
"11111111111111111111111111111"
)
...
...
src/utils/index.js
View file @
87c689f0
...
@@ -142,22 +142,6 @@ export default class Utils {
...
@@ -142,22 +142,6 @@ export default class Utils {
return
output
.
join
(
''
);
return
output
.
join
(
''
);
}
}
static
getRequestDataFn
(
params
)
{
params
=
params
||
{}
const
fn
=
async
()
=>
{
const
that
=
this
;
const
data
=
await
new
Promise
(
resolve
=>
{
// 保证前一次请求结果赋值VO完成
setTimeout
(()
=>
{
const
d
=
Utils
.
flatObject
(
that
.
model
)
resolve
(
d
)
},
0
)
})
return
{...
data
,
params
}
}
return
fn
;
}
static
positioningErrorMsg
(
fieldErrors
,
formFields
)
{
static
positioningErrorMsg
(
fieldErrors
,
formFields
)
{
let
firstErrorItem
=
null
let
firstErrorItem
=
null
for
(
let
i
=
0
;
i
<
formFields
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
formFields
.
length
;
i
++
)
{
...
...
src/views/Business/Ditopn/Docpan.vue
View file @
87c689f0
...
@@ -369,15 +369,13 @@ export default {
...
@@ -369,15 +369,13 @@ export default {
this
.
centerDialogVisible
=
false
;
this
.
centerDialogVisible
=
false
;
console
.
log
(
this
.
model
);
console
.
log
(
this
.
model
);
this
.
model
.
trnmod
.
trndoc
.
doceot
.
splice
(
this
.
index
,
1
,
this
.
dialog
);
this
.
model
.
trnmod
.
trndoc
.
doceot
.
splice
(
this
.
index
,
1
,
this
.
dialog
);
let
res
=
Api
.
post
(
this
.
executeRule
(
"trnmod.trndoc.doccur.butaddok"
).
then
(
res
=>
{
"ditopn/executeRule/trnmod.trndoc.doccur.butaddok"
,
Utils
.
getRequestDataFn
.
call
(
this
)
);
if
(
res
.
data
.
respCode
==
"AAAAAA"
)
{
if
(
res
.
data
.
respCode
==
"AAAAAA"
)
{
//TODO
//TODO
}
else
{
}
else
{
this
.
$notify
.
error
({
title
:
"错误"
,
message
:
"服务请求失败!"
});
this
.
$notify
.
error
({
title
:
"错误"
,
message
:
"服务请求失败!"
});
}
}
})
},
},
},
},
created
:
function
()
{},
created
:
function
()
{},
...
...
src/views/Business/Ditopn/Ovwp.vue
View file @
87c689f0
...
@@ -520,10 +520,7 @@ export default {
...
@@ -520,10 +520,7 @@ export default {
},
},
nom1CurEvent
()
{
nom1CurEvent
()
{
const
data
=
Utils
.
flatObject
(
this
.
model
);
const
data
=
Utils
.
flatObject
(
this
.
model
);
Api
.
post
(
this
.
executeDefault
(
"didgrp.cbs.nom1.cur"
).
then
((
res
)
=>
{
"ditopn/executeDefault/didgrp.cbs.nom1.cur"
,
Utils
.
getRequestDataFn
.
call
(
this
)
).
then
((
res
)
=>
{
if
((
res
.
respCode
=
"AAAAAA"
))
{
if
((
res
.
respCode
=
"AAAAAA"
))
{
Utils
.
copyValueFromVO
(
this
.
model
,
res
.
data
);
Utils
.
copyValueFromVO
(
this
.
model
,
res
.
data
);
}
}
...
...
src/views/Business/Ditopn/Setpan.vue
View file @
87c689f0
...
@@ -399,6 +399,7 @@
...
@@ -399,6 +399,7 @@
</template>
</template>
<
script
>
<
script
>
import
Api
from
"~/service/Api"
;
import
Api
from
"~/service/Api"
;
import
Utils
from
"~/utils"
;
import
CommonProcess
from
"~/mixin/CommonProcess"
;
import
CommonProcess
from
"~/mixin/CommonProcess"
;
import
CodeTable
from
"~/config/CodeTable"
;
import
CodeTable
from
"~/config/CodeTable"
;
import
Event
from
"~/model/Ditopn/Event"
;
import
Event
from
"~/model/Ditopn/Event"
;
...
@@ -426,6 +427,29 @@ export default {
...
@@ -426,6 +427,29 @@ export default {
// this.visiable = false;
// this.visiable = false;
// this.model.setmod.setfog.setfop[this.index] = this.dialog;
// this.model.setmod.setfog.setfop[this.index] = this.dialog;
},
},
// 第二个表格
detail1
(
index
,
row
)
{
this
.
executeDefault
(
"det"
).
then
(
res
=>
{
this
.
dialogVisible
=
true
;
this
.
dialog
=
row
;
this
.
index
=
index
;
})
},
dispDefault
(){
this
.
executeDefault
(
"ditopn/executeDefault/mac"
).
then
(
res
=>
{
Utils
.
copyValueFromVO
(
this
.
model
,
res
.
data
)
})
},
// 第三个表格
detail2
(
index
,
row
)
{
this
.
executeRule
(
"ditopn/executeRule/det"
).
then
(
res
=>
{
this
.
dialogVisible2
=
true
;
this
.
index
=
index
;
this
.
dialog2
=
row
})
},
},
},
created
:
function
()
{},
created
:
function
()
{},
};
};
...
...
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