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
05d35cea
Commit
05d35cea
authored
Oct 31, 2022
by
lianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态码表:code="getValues('key', 'tableName')"
parent
29cb9cfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
commonApi.js
src/mixin/commonApi.js
+20
-6
Drv.vue
src/views/Business/Bttdck/Drv.vue
+3
-1
No files found.
src/mixin/commonApi.js
View file @
05d35cea
...
...
@@ -3,6 +3,7 @@ import Api from "~/service/Api"
import
{
display
}
from
"~/service/business/file"
import
{
getTrnNameByInr
}
from
"~/service/business/common"
import
Utils
from
"../utils"
import
CodeTable
from
"~/config/CodeTable"
;
export
default
{
data
()
{
...
...
@@ -34,17 +35,30 @@ export default {
this
.
root
.
updateValueSet
(
values
)
}
},
//获取后台setValues、setCodeValues传来的动态码,并自动转为码表值
getValues
(
key
)
{
/*
获取后台setValues、setCodeValues传来的动态码,并自动转为码表值。
key:为后端传来的CodeSet的字段path,如bddgrp.rec.docprbrol
tableName:src下的全局静态码表中的码表名称,如rolall
如后端传来的CodeSet下该字段值为"value+lable",则不用传参数tableName
如后端传来的CodeSet下该字段值仅有"value",则需传参数tableName,去全局静态码表中找到相应码表,根据value值找到lable值
*/
getValues
(
key
,
tableName
)
{
let
arr
=
this
.
codes
.
codeSet
[
key
]
if
(
!
arr
)
return
undefined
return
arr
.
map
(
item
=>
{
let
itemArr
=
item
.
split
(
"
\
t"
)
if
(
itemArr
.
length
>
1
)
return
{
label
:
item
,
value
:
itemArr
[
0
]
}
else
return
{
label
:
itemArr
[
0
],
value
:
itemArr
[
0
]
}
if
(
itemArr
.
length
>
1
)
{
return
{
label
:
item
,
value
:
itemArr
[
0
]
}
}
else
{
if
(
tableName
&&
CodeTable
[
tableName
])
{
const
r
=
CodeTable
[
tableName
].
find
(
code
=>
code
.
value
===
itemArr
[
0
])
if
(
r
)
{
return
{
label
:
r
.
label
,
value
:
itemArr
[
0
]
}
}
}
return
{
label
:
itemArr
[
0
],
value
:
itemArr
[
0
]
}
}
})
},
showBackendErrors
(
fieldErrors
)
{
...
...
src/views/Business/Bttdck/Drv.vue
View file @
05d35cea
...
...
@@ -295,6 +295,7 @@
<c-input-currency-min
v-model=
"model.btdgrp.be2amt2"
placeholder=
""
disabled
></c-input-currency-min>
</el-form-item>
</c-col>
...
...
@@ -521,9 +522,10 @@
v-model=
"model.btdgrp.rec.docprbrolbe1"
style=
"width: 100%"
placeholder=
"请选择收款人"
:code=
"
codes.docprbrolbe1
"
:code=
"
getValues('btdgrp.rec.docprbrolbe1', 'rolall')
"
@
change=
"selectOrCheckboxRule('btdgrp.rec.docprbrolbe1')"
></c-select>
<!-- :code="codes.docprbrolbe1" -->
</el-form-item>
</c-col>
...
...
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