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
zhouqian
vue-gjjs
Commits
87c689f0
Commit
87c689f0
authored
Oct 26, 2021
by
潘际乾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
请求参数model提取至公共函数
parent
c80b23ef
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
42 deletions
+66
-42
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
+7
-9
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 {
return
Api
.
post
(
this
.
declareParams
.
trnName
+
"/init"
,{
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
){
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
)
{
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
)
{
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
){
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
},
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
()
{
...
...
@@ -43,7 +43,7 @@ export default {
},
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 {
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
* @param {any} data model数据
*/
...
...
src/model/Ditopn/Event.js
View file @
87c689f0
...
...
@@ -268,21 +268,21 @@ export default {
})
},
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"
)
{
//TODO 处理数据逻辑
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
}
},
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"
)
{
//TODO 处理数据逻辑
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
}
},
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"
)
{
//TODO 处理数据逻辑
this
.
model
.
litp1
.
remark
=
rtnmsg
.
data
.
litp1_remark
...
...
@@ -297,14 +297,14 @@ export default {
let
rtnmsg
if
(
cortyp
==
'SWT'
||
cortyp
==
'FMT'
||
cortyp
==
'CMT'
)
{
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
{
this
.
model
.
trnmod
.
trndoc
.
doccod
=
row
.
id
this
.
model
.
trnmod
.
trndoc
.
cortyp
=
cortyp
const
params
=
{
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
(
cortyp
==
'SWT'
||
cortyp
==
'FMT'
||
cortyp
==
'CMT'
)
{
...
...
@@ -359,7 +359,7 @@ export default {
const
params
=
{
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"
)
{
//TODO 处理数据逻辑
console
.
log
(
"11111111111111111111111111111"
)
...
...
src/utils/index.js
View file @
87c689f0
...
...
@@ -142,22 +142,6 @@ export default class Utils {
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
)
{
let
firstErrorItem
=
null
for
(
let
i
=
0
;
i
<
formFields
.
length
;
i
++
)
{
...
...
src/views/Business/Ditopn/Docpan.vue
View file @
87c689f0
...
...
@@ -369,15 +369,13 @@ export default {
this
.
centerDialogVisible
=
false
;
console
.
log
(
this
.
model
);
this
.
model
.
trnmod
.
trndoc
.
doceot
.
splice
(
this
.
index
,
1
,
this
.
dialog
);
let
res
=
Api
.
post
(
"ditopn/executeRule/trnmod.trndoc.doccur.butaddok"
,
Utils
.
getRequestDataFn
.
call
(
this
)
);
if
(
res
.
data
.
respCode
==
"AAAAAA"
)
{
//TODO
}
else
{
this
.
$notify
.
error
({
title
:
"错误"
,
message
:
"服务请求失败!"
});
}
this
.
executeRule
(
"trnmod.trndoc.doccur.butaddok"
).
then
(
res
=>
{
if
(
res
.
data
.
respCode
==
"AAAAAA"
)
{
//TODO
}
else
{
this
.
$notify
.
error
({
title
:
"错误"
,
message
:
"服务请求失败!"
});
}
})
},
},
created
:
function
()
{},
...
...
src/views/Business/Ditopn/Ovwp.vue
View file @
87c689f0
...
...
@@ -520,10 +520,7 @@ export default {
},
nom1CurEvent
()
{
const
data
=
Utils
.
flatObject
(
this
.
model
);
Api
.
post
(
"ditopn/executeDefault/didgrp.cbs.nom1.cur"
,
Utils
.
getRequestDataFn
.
call
(
this
)
).
then
((
res
)
=>
{
this
.
executeDefault
(
"didgrp.cbs.nom1.cur"
).
then
((
res
)
=>
{
if
((
res
.
respCode
=
"AAAAAA"
))
{
Utils
.
copyValueFromVO
(
this
.
model
,
res
.
data
);
}
...
...
src/views/Business/Ditopn/Setpan.vue
View file @
87c689f0
...
...
@@ -399,6 +399,7 @@
</template>
<
script
>
import
Api
from
"~/service/Api"
;
import
Utils
from
"~/utils"
;
import
CommonProcess
from
"~/mixin/CommonProcess"
;
import
CodeTable
from
"~/config/CodeTable"
;
import
Event
from
"~/model/Ditopn/Event"
;
...
...
@@ -426,6 +427,29 @@ export default {
// this.visiable = false;
// 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
()
{},
};
...
...
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