Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
548d5a84
Commit
548d5a84
authored
Jun 12, 2022
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供应商
parent
e4360e35
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1101 additions
and
95 deletions
+1101
-95
.env.development
.env.development
+1
-1
channel.js
src/api/ecw/channel.js
+54
-0
index.vue
src/components/DictSelector/index.vue
+52
-0
index.vue
src/components/RegionSelector/index.vue
+62
-0
dd-select.vue
src/components/TableForm/components/dd-select.vue
+39
-0
index.js
src/components/TableForm/components/index.js
+6
-0
index.vue
src/components/TableForm/index.vue
+87
-0
config.js
src/components/generator/config.js
+26
-0
main.js
src/main.js
+4
-0
request.js
src/utils/request.js
+1
-1
edit.vue
src/views/ecw/channel/edit.vue
+205
-0
index.vue
src/views/ecw/channel/index.vue
+265
-0
edit.vue
src/views/ecw/supplier/edit.vue
+256
-0
index.vue
src/views/ecw/supplier/index.vue
+43
-93
No files found.
.env.development
View file @
548d5a84
...
...
@@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 捷道管理系统
# 捷道管理系统/开发环境
VUE_APP_BASE_API = 'http://
127.0.0.1:48080
'
VUE_APP_BASE_API = 'http://
jd.apitest.jdshangmen.com
'
# VUE_APP_BASE_API = '/api'
# 路由懒加载
...
...
src/api/ecw/channel.js
0 → 100644
View file @
548d5a84
import
request
from
'
@/utils/request
'
// 创建渠道管理
export
function
createChannel
(
data
)
{
return
request
({
url
:
'
/ecw/channel/create
'
,
method
:
'
post
'
,
data
:
data
})
}
// 更新渠道管理
export
function
updateChannel
(
data
)
{
return
request
({
url
:
'
/ecw/channel/update
'
,
method
:
'
put
'
,
data
:
data
})
}
// 删除渠道管理
export
function
deleteChannel
(
id
)
{
return
request
({
url
:
'
/ecw/channel/delete?id=
'
+
id
,
method
:
'
delete
'
})
}
// 获得渠道管理
export
function
getChannel
(
id
)
{
return
request
({
url
:
'
/ecw/channel/get?id=
'
+
id
,
method
:
'
get
'
})
}
// 获得渠道管理分页
export
function
getChannelPage
(
query
)
{
return
request
({
url
:
'
/ecw/channel/page
'
,
method
:
'
get
'
,
params
:
query
})
}
// 导出渠道管理 Excel
export
function
exportChannelExcel
(
query
)
{
return
request
({
url
:
'
/ecw/channel/export-excel
'
,
method
:
'
get
'
,
params
:
query
,
responseType
:
'
blob
'
})
}
src/components/DictSelector/index.vue
0 → 100644
View file @
548d5a84
<
template
>
<el-select
v-model=
"valueSync"
:placeholder=
"placeholder"
clearable
:multiple=
"multiple"
>
<el-option
v-for=
"dict in getList(type)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</
template
>
<
script
>
const
selfDefinedDict
=
{
_yesno
:
[
{
label
:
'
是
'
,
value
:
'
1
'
},
{
label
:
'
否
'
,
value
:
'
0
'
}
]
}
export
default
{
props
:{
placeholder
:
{
type
:
String
,
default
:
'
请选择
'
},
type
:
String
,
value
:
[
String
,
Number
,
Array
],
multiple
:
Boolean
,
forceString
:
{
type
:
Boolean
,
default
:
true
}
},
data
(){
return
{
valueSync
:
null
}
},
watch
:{
valueSync
(){
this
.
$emit
(
'
input
'
,
this
.
forceString
?
String
(
this
.
valueSync
)
:
this
.
valueSync
)
},
value
(
val
){
if
(
!
val
||
val
===
null
){
return
}
if
(
this
.
forceString
&&
this
.
multiple
){
this
.
valueSync
=
val
.
split
(
'
,
'
)
}
else
this
.
valueSync
=
this
.
forceString
?
String
(
val
)
:
val
}
},
methods
:{
getList
(){
return
selfDefinedDict
[
this
.
type
]
||
this
.
getDictDatas
(
this
.
type
)
}
}
}
</
script
>
\ No newline at end of file
src/components/RegionSelector/index.vue
0 → 100644
View file @
548d5a84
<
template
>
<div>
<template
v-for=
"(list, level) in options"
>
<el-select
:key=
"list.id"
v-model=
"selectedIndex[level]"
placeholder=
"请选择"
>
<el-option
v-for=
"item in list"
:key=
"item.id"
:label=
"item.titleZh"
:value=
"item.id"
>
</el-option>
</el-select>
</
template
>
</div>
</template>
<
script
>
import
{
getListTree
}
from
"
@/api/ecw/region
"
;
// 洲,国,省,市,区
export
default
{
props
:{
continent
:
{
type
:
Number
,
default
:
1
},
// 0 从洲开始,1从国家开始,
type
:
String
,
// 进出口类型
},
data
()
{
return
{
treeList
:
[],
selectedIndex
:[],
options
:[]
};
},
watch
:{
treeList
(){
this
.
selectedIndex
=
[]
this
.
options
=
[
this
.
treeList
]
},
selectedIndex
(
val
,
old
){
}
},
created
(){
getListTree
({
treeType
:
this
.
treeType
,
type
:
this
.
type
}).
then
((
response
)
=>
{
this
.
treeList
=
response
.
data
;
});
},
methods
:
{
},
};
</
script
>
\ No newline at end of file
src/components/TableForm/components/dd-select.vue
0 → 100644
View file @
548d5a84
<
template
>
<div
class=
"xselect"
>
<el-select
v-model=
"valueSync"
>
<el-option
v-for=
"(item, index) in options"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</div>
</
template
>
<
script
>
export
default
{
props
:{
value
:{
type
:
String
,
},
options
:{
type
:
Array
,
default
(){
return
[]
}
}
},
watch
:
{
valueSync
(
newValue
)
{
this
.
$emit
(
'
input
'
,
newValue
)
}
},
data
(){
return
{
valueSync
:
[]
}
},
created
()
{
this
.
$set
(
this
,
'
valueSync
'
,
this
.
value
)
},
methods
:
{
}
}
</
script
>
src/components/TableForm/components/index.js
0 → 100644
View file @
548d5a84
let
modules
=
{}
const
files
=
require
.
context
(
''
,
false
,
/
\.
vue$/
);
files
.
keys
().
forEach
((
filename
)
=>
{
modules
[
filename
.
slice
(
2
,
-
4
)]
=
files
(
filename
).
default
||
files
(
filename
)
});
export
default
modules
\ No newline at end of file
src/components/TableForm/index.vue
0 → 100644
View file @
548d5a84
<
template
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix card-header"
>
<div
class=
"title"
>
{{
title
}}
</div>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-plus"
@
click=
"listData.push(
{})">
</el-button>
</div>
<el-table
:data=
"listData"
border
>
<el-table-column
label=
"序号"
width=
"90px"
>
<template
slot-scope=
"scope"
>
{{
scope
.
$index
+
1
}}
</
template
>
</el-table-column>
<
template
v-for=
"col in fields"
>
<el-table-column
:label=
"col.label"
:key=
"col.field"
>
<template
slot-scope=
"
{row}">
<component
:is=
"col.tag || 'el-input'"
v-model=
"row[col.field]"
v-bind=
"col.attrs"
/>
</
template
>
</el-table-column>
</template>
<!-- <el-table-column label="职位">
<template slot-scope="{row}">
<el-input v-model="row.job" />
</template>
</el-table-column> -->
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"danger"
size=
"mini"
icon=
"el-icon-delete"
@
click=
"del(scope.$index)"
></el-button>
</
template
>
</el-table-column>
</el-table>
</el-card>
</template>
<
script
>
/*
fields:
[
{
field: 'name',
label: '字段名'
tag: 'el-input',
attr: {}
}
]
*/
import
FormComponents
from
'
./components/index.js
'
export
default
{
components
:
{...
FormComponents
},
props
:{
title
:
String
,
fields
:
Array
,
value
:
Array
},
data
(){
return
{
listData
:
[]
}
},
watch
:{
listData
(
val
){
console
.
log
(
'
数据更新
'
)
this
.
$emit
(
'
input
'
,
val
)
},
value
(){
this
.
listData
=
this
.
value
}
},
methods
:{
del
(
index
){
this
.
$confirm
(
'
确定删除此行?
'
)
.
then
(
res
=>
{
this
.
listData
.
splice
(
index
,
1
)
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.card-header
{
display
:
flex
;
.title
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
font-size
:
16px
;
}
}
</
style
>
\ No newline at end of file
src/components/generator/config.js
View file @
548d5a84
...
...
@@ -14,6 +14,32 @@ export const formConf = {
// 输入型组件 【左面板】
export
const
inputComponents
=
[
{
// 组件的自定义配置
__config__
:
{
label
:
'
表格输入
'
,
labelWidth
:
null
,
showLabel
:
true
,
changeTag
:
true
,
tag
:
'
table-form
'
,
tagIcon
:
'
input
'
,
defaultValue
:
[],
required
:
false
,
layout
:
'
colFormItem
'
,
span
:
24
,
document
:
'
https://element.eleme.cn/#/zh-CN/component/input
'
,
// 正则校验规则
regList
:
[]
},
// 组件的插槽属性
__slot__
:
{
prepend
:
''
,
append
:
''
},
// 其余的为可直接写在组件标签上的属性
title
:
'
表格标题
'
,
style
:
{
width
:
'
100%
'
},
},
{
// 组件的自定义配置
__config__
:
{
...
...
src/main.js
View file @
548d5a84
...
...
@@ -22,6 +22,8 @@ import { parseTime, resetForm, addDateRange, addBeginAndEndTime, handleTree} fro
import
Pagination
from
"
@/components/Pagination
"
;
// 自定义表格工具扩展
import
RightToolbar
from
"
@/components/RightToolbar
"
import
TableForm
from
'
@/components/TableForm
'
import
DictSelector
from
'
@/components/DictSelector
'
// 代码高亮插件
// import hljs from 'highlight.js'
// import 'highlight.js/styles/github-gist.css'
...
...
@@ -67,6 +69,8 @@ Vue.component('DictTag', DictTag)
Vue
.
component
(
'
DocAlert
'
,
DocAlert
)
Vue
.
component
(
'
Pagination
'
,
Pagination
)
Vue
.
component
(
'
RightToolbar
'
,
RightToolbar
)
Vue
.
component
(
'
TableForm
'
,
TableForm
)
Vue
.
component
(
'
DictSelector
'
,
DictSelector
)
// 字典标签组件
import
DictTag
from
'
@/components/DictTag
'
import
DocAlert
from
'
@/components/DocAlert
'
...
...
src/utils/request.js
View file @
548d5a84
...
...
@@ -15,7 +15,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const
service
=
axios
.
create
({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL
:
process
.
env
.
VUE_APP_BASE_API
+
'
/admin-api/
'
,
// 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/
baseURL
:
(
localStorage
.
VUE_APP_BASE_API
||
process
.
env
.
VUE_APP_BASE_API
)
+
'
/admin-api/
'
,
// 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/
// 超时
timeout
:
10000
})
...
...
src/views/ecw/channel/edit.vue
0 → 100644
View file @
548d5a84
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
基本信息
</span>
</div>
<el-form-item
label=
"仓库ID字符串"
prop=
"warehouseIds"
>
<el-input
v-model=
"form.warehouseIds"
placeholder=
"请输入仓库ID字符串"
/>
</el-form-item>
<el-form-item
label=
"快递ID"
prop=
"expressId"
>
<el-input
v-model=
"form.expressId"
placeholder=
"请输入快递ID"
/>
</el-form-item>
<el-form-item
label=
"渠道代理"
prop=
"channelAgent"
>
<el-input
v-model=
"form.channelAgent"
placeholder=
"请输入渠道代理"
/>
</el-form-item>
</el-card>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
渠道收费规则
</span>
</div>
<!--
<el-form-item
label=
"渠道ID"
prop=
"channelId"
>
<el-input
v-model=
"form.channelId"
placeholder=
"请输入渠道ID"
/>
</el-form-item>
-->
<el-form-item
label=
"收费模式"
prop=
"chargingMode"
>
<el-input
v-model=
"form.channelCostCreateReqVO.chargingMode"
placeholder=
"请输入收费模式"
/>
</el-form-item>
<el-form-item
label=
"是否包税:0 不包税 1 包税"
prop=
"isTaxInclusive"
>
<el-input
v-model=
"form.channelCostCreateReqVO.isTaxInclusive"
placeholder=
"请输入是否包税:0 不包税 1 包税"
/>
</el-form-item>
<el-form-item
label=
"包税加价金额"
prop=
"taxAddAmount"
>
<el-input
v-model=
"form.channelCostCreateReqVO.taxAddAmount"
placeholder=
"请输入包税加价金额"
/>
</el-form-item>
<el-form-item
label=
"结算类型:1 单件 2 整票"
prop=
"settlementType"
>
<el-select
v-model=
"form.channelCostCreateReqVO.settlementType"
placeholder=
"请选择结算类型:1 单件 2 整票"
>
<el-option
label=
"请选择字典生成"
value=
""
/>
</el-select>
</el-form-item>
<el-form-item
label=
"免税金额"
prop=
"taxFreeAmount"
>
<el-input
v-model=
"form.channelCostCreateReqVO.taxFreeAmount"
placeholder=
"请输入免税金额"
/>
</el-form-item>
<el-form-item
label=
"消费税比例"
prop=
"consumptionTaxRatio"
>
<el-input
v-model=
"form.channelCostCreateReqVO.consumptionTaxRatio"
placeholder=
"请输入消费税比例"
/>
</el-form-item>
<el-form-item
label=
"燃油费用比例"
prop=
"fuelCostRatio"
>
<el-input
v-model=
"form.channelCostCreateReqVO.fuelCostRatio"
placeholder=
"请输入燃油费用比例"
/>
</el-form-item>
<el-form-item
label=
"单件取整重量"
prop=
"oneRoundingWeight"
>
<el-input
v-model=
"form.channelCostCreateReqVO.oneRoundingWeight"
placeholder=
"请输入单件取整重量"
/>
</el-form-item>
<el-form-item
label=
"取整单价"
prop=
"unitPrice"
>
<el-input
v-model=
"form.channelCostCreateReqVO.unitPrice"
placeholder=
"请输入取整单价"
/>
</el-form-item>
<el-form-item
label=
"杂费"
prop=
"incidental"
>
<el-input
v-model=
"form.channelCostCreateReqVO.incidental"
placeholder=
"请输入杂费"
/>
</el-form-item>
<el-form-item
label=
"免抛重量"
prop=
"freeThrowWeight"
>
<el-input
v-model=
"form.channelCostCreateReqVO.freeThrowWeight"
placeholder=
"请输入免抛重量"
/>
</el-form-item>
<el-form-item
label=
"计算系数"
prop=
"coefficients"
>
<el-input
v-model=
"form.channelCostCreateReqVO.coefficients"
placeholder=
"请输入计算系数"
/>
</el-form-item>
<el-form-item
label=
"清关单价"
prop=
"customsClearUnit"
>
<el-input
v-model=
"form.channelCostCreateReqVO.customsClearUnit"
placeholder=
"请输入清关单价"
/>
</el-form-item>
</el-card>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
渠道信息
</span>
</div>
<el-row>
<el-col
span=
"12"
>
<el-form-item
label=
"中文名称"
prop=
"nameZh"
>
<el-input
v-model=
"form.nameZh"
placeholder=
"请输入名称-中文"
/>
</el-form-item>
</el-col>
<el-col
span=
"12"
>
<el-form-item
label=
"名称英文"
prop=
"nameEn"
>
<el-input
v-model=
"form.nameEn"
placeholder=
"请输入名称-英文"
/>
</el-form-item>
</el-col>
<el-col
span=
"12"
>
<el-form-item
label=
"内部名称中文"
prop=
"internalNameZh"
>
<el-input
v-model=
"form.internalNameZh"
placeholder=
"请输入内部名称-中文"
/>
</el-form-item>
</el-col>
<el-col
span=
"12"
>
<el-form-item
label=
"内部名称英文"
prop=
"internalNameEn"
>
<el-input
v-model=
"form.internalNameEn"
placeholder=
"请输入内部名称-英文"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item
label=
"类型编码"
prop=
"typeNumber"
>
<el-input
v-model=
"form.typeNumber"
placeholder=
"请输入类型编码"
/>
</el-form-item>
<el-form-item
label=
"排序"
prop=
"sort"
>
<el-input
v-model=
"form.sort"
placeholder=
"请输入排序"
/>
</el-form-item>
<el-form-item
label=
"预计到达时间(天)"
prop=
"etaTime"
>
<el-date-picker
clearable
v-model=
"form.etaTime"
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
"选择预计到达时间(天)"
/>
</el-form-item>
<el-form-item
label=
"备注-中文"
prop=
"remarksZh"
>
<el-input
v-model=
"form.remarksZh"
placeholder=
"请输入备注-中文"
/>
</el-form-item>
<el-form-item
label=
"备注-英文"
prop=
"remarksEn"
>
<el-input
v-model=
"form.remarksEn"
placeholder=
"请输入备注-英文"
/>
</el-form-item>
<el-form-item
label=
"状态(0:禁用 1:启用)"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
label=
"1"
>
请选择字典生成
</el-radio>
</el-radio-group>
</el-form-item>
</el-card>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</
template
>
<
script
>
import
{
createChannel
,
updateChannel
,
deleteChannel
,
getChannel
,
getChannelPage
,
exportChannelExcel
,
}
from
"
@/api/ecw/channel
"
;
export
default
{
data
()
{
return
{
form
:
{
channelCostCreateReqVO
:{}
},
rules
:
{},
};
},
created
()
{
if
(
this
.
$route
.
query
.
id
)
{
getChannel
(
this
.
$route
.
query
.
id
).
then
((
res
)
=>
{
this
.
form
=
res
.
data
;
});
}
},
methods
:
{
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
;
}
// 修改的提交
if
(
this
.
form
.
channelId
!=
null
)
{
updateChannel
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
return
;
}
// 添加的提交
createChannel
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
});
},
},
};
</
script
>
<
style
scoped
lang=
"scss"
>
.el-card
{
margin-bottom
:
20px
;
}
</
style
>
\ No newline at end of file
src/views/ecw/channel/index.vue
0 → 100644
View file @
548d5a84
This diff is collapsed.
Click to expand it.
src/views/ecw/supplier/edit.vue
0 → 100644
View file @
548d5a84
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"elForm"
:model=
"formData"
:rules=
"rules"
size=
"small"
label-width=
"100px"
label-position=
"left"
>
<el-form-item
label=
"公司全称"
prop=
"companyZh"
>
<el-input
v-model=
"formData.companyZh"
placeholder=
"请输入公司全称"
show-word-limit
clearable
:style=
"
{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item
label=
"代理名称"
prop=
"agentName"
>
<el-input
v-model=
"formData.agentName"
placeholder=
"请输入代理名称"
clearable
:style=
"
{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item
label=
"公司电话"
prop=
"tell"
>
<el-input
v-model=
"formData.tell"
placeholder=
"请输入公司电话"
clearable
:style=
"
{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item
label=
"公司地址"
prop=
"address"
>
<el-select
v-model=
"formData.country"
>
<el-option
v-for=
"(item, index) in treeList"
:value=
"item.id"
:label=
"item.titleZh"
:key=
"item.id"
/>
</el-select>
<el-select
v-model=
"formData.province"
>
<el-option
v-for=
"(item, index) in provinceList"
:value=
"item.id"
:label=
"item.titleZh"
:key=
"item.id"
/>
</el-select>
<el-select
v-model=
"formData.city"
>
<el-option
v-for=
"(item, index) in cityList"
:value=
"item.id"
:label=
"item.titleZh"
:key=
"item.id"
/>
</el-select>
<el-input
v-model=
"formData.address"
placeholder=
"请输入详细地址"
></el-input>
<!--
<el-select
v-model=
"selectedRegionIndex"
>
<el-option
v-for=
"(item, index) in regionList"
:value=
"index"
:label=
"item.titleZh"
:key=
"item.id"
/>
</el-select>
-->
<!--
<el-select
v-model=
"formData.address"
placeholder=
"请选择下拉选择公司地址"
clearable
:style=
"
{width: '100%'}">
</el-select>
-->
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"formData.remark"
type=
"textarea"
placeholder=
"请输入备注"
:autosize=
"
{minRows: 4, maxRows: 4}" :style="{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item
label-width=
"0"
prop=
"field110"
>
<table-form
title=
"联系人"
:fields=
"[
{ label: '部门', field: 'department'},
{ label: '职位', field: 'position'},
{ label: '名称*', field: 'name', required: true},
{ label: '电话*', field: 'phone', required: true},
]" v-model="formData.contactList">
</table-form>
</el-form-item>
<el-form-item
label=
"供应商类别"
prop=
"companyType"
>
<!--
<el-checkbox-group
v-model=
"formData.companyType"
size=
"medium"
>
<el-checkbox
v-for=
"(item, index) in companyTypeOptions"
:key=
"index"
:label=
"item.value"
:disabled=
"item.disabled"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
-->
<dict-selector
v-model=
"formData.companyType"
type=
"company_type"
multiple
/>
</el-form-item>
<el-form-item
label=
"合作类型"
prop=
"cooperationType"
>
<dict-selector
v-model=
"formData.cooperationType"
type=
"cooperation_type"
/>
</el-form-item>
<el-form-item
label=
"营业执照"
prop=
"license"
>
<upload
v-model=
"formData.license"
/>
<!--
<el-upload
ref=
"license"
:file-list=
"licensefileList"
:action=
"licenseAction"
:before-upload=
"licenseBeforeUpload"
>
<el-button
size=
"small"
type=
"primary"
icon=
"el-icon-upload"
>
点击上传
</el-button>
</el-upload>
-->
</el-form-item>
<el-form-item
label=
"合同"
prop=
"contract"
>
<upload
v-model=
"formData.contract"
/>
<!--
<el-upload
ref=
"contract"
:file-list=
"contractfileList"
:action=
"contractAction"
:before-upload=
"contractBeforeUpload"
>
<el-button
size=
"small"
type=
"primary"
icon=
"el-icon-upload"
>
点击上传
</el-button>
</el-upload>
-->
</el-form-item>
<el-form-item
label=
"统一信用代码"
prop=
"licenseNumber"
>
<el-input
v-model=
"formData.licenseNumber"
placeholder=
"请输入统一社会信用代码"
clearable
:style=
"
{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item
label-width=
"0"
prop=
"field110"
>
<table-form
title=
"银行信息"
:fields=
"[
{ label: '账户名称*', field: 'accountName', required: true},
{ label: '币别*', field: 'currency', required: true},
{ label: '银行名称*', field: 'bankName', required: true},
{ label: '银行账户*', field: 'bankAccount', required: true},
{ label: '银行代码', field: 'bankCode'},
{ label: '账户类型', field: 'accountType'},
{ label: '银行地址', field: 'bankAddress'},
]" v-model="formData.bankList">
</table-form>
</el-form-item>
<el-form-item
size=
"large"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
提交
</el-button>
<el-button
@
click=
"resetForm"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
import
{
createSupplier
,
updateSupplier
,
getSupplier
}
from
"
@/api/ecw/supplier
"
;
import
upload
from
'
@/components/ImageUpload
'
import
{
getListTree
}
from
"
@/api/ecw/region
"
;
export
default
{
components
:
{
upload
},
props
:
[],
data
()
{
return
{
formData
:
{
companyZh
:
undefined
,
agentName
:
undefined
,
tell
:
""
,
address
:
"
Abc123456
"
,
remark
:
undefined
,
field110
:
undefined
,
companyType
:
[],
cooperationType
:
undefined
,
license
:
null
,
contract
:
null
,
licenseNumber
:
undefined
,
},
rules
:
{
companyZh
:
[{
required
:
true
,
message
:
'
请输入公司全称
'
,
trigger
:
'
blur
'
}],
agentName
:
[],
tell
:
[],
address
:
[],
remark
:
[],
companyType
:
[{
required
:
true
,
type
:
'
string
'
,
message
:
'
请至少选择一个供应商类别
'
,
trigger
:
'
change
'
}],
cooperationType
:
[{
required
:
true
,
message
:
'
请选择合作类型
'
,
trigger
:
'
change
'
}],
licenseNumber
:
[],
},
treeList
:[],
provinceList
:[],
cityList
:[]
/*
selectedCountryIndex: null,
selectedProvinceIndex: null,
selectedCityIndex: null, */
// selectedRegionIndex: null
}
},
computed
:
{
/* provinceList(){
return this.treeList[this.selectedCountryIndex] ?. children || []
},
cityList(){
return this.provinceList[this.selectedProvinceIndex] ?. children || []
},
regionList(){
return this.cityList[this.selectedCityIndex] ?. children || []
} */
},
watch
:
{
'
formData.country
'
(
country
){
this
.
treeList
.
forEach
(
item
=>
{
if
(
item
.
id
==
country
){
this
.
provinceList
=
item
.
children
||
[]
}
})
},
'
formData.province
'
(
province
){
this
.
provinceList
.
forEach
(
item
=>
{
if
(
item
.
id
==
province
){
this
.
cityList
=
item
.
children
||
[]
}
})
}
},
created
()
{
// 回显数据需要在加载了地区数据之后,否则无法正常回显
getListTree
({
treeType
:
1
}).
then
(
response
=>
{
this
.
treeList
=
response
.
data
if
(
this
.
$route
.
query
.
id
){
getSupplier
(
this
.
$route
.
query
.
id
).
then
(
response
=>
{
/* response.data.companyType = response.data.companyType.split(",") || [] */
this
.
formData
=
response
.
data
;
});
}
})
},
mounted
()
{},
methods
:
{
onProvinceSelected
(
e
){
console
.
log
(
e
,
e
)
},
submitForm
()
{
this
.
$refs
[
"
elForm
"
].
validate
(
valid
=>
{
if
(
!
valid
)
{
return
;
}
let
data
=
Object
.
assign
({},
this
.
formData
)
/* if(data.companyType && data.companyType.length){
data.companyType = data.companyType.join(',')
} */
/* let regionArr = []
if(this.selectedCountryIndex !== null){
//regionArr.push(this.treeList[this.selectedCountryIndex].id)
data.country = this.treeList[this.selectedCountryIndex].id
}
if(this.selectedProvinceIndex !== null){
data.province = this.treeList[this.selectedCountryIndex].id
}
if(this.selectedCityIndex !== null){
data.city = this.cityList[this.selectedCityIndex].id
} */
// 修改的提交
if
(
data
.
id
!=
null
)
{
updateSupplier
(
data
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
$router
.
back
()
});
return
;
}
// 添加的提交
createSupplier
(
data
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
$router
.
back
()
});
});
},
resetForm
()
{
this
.
$refs
[
'
elForm
'
].
resetFields
()
},
/* licenseBeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
contractBeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
}, */
}
}
</
script
>
<
style
>
.el-upload__tip
{
line-height
:
1.2
;
}
</
style
>
src/views/ecw/supplier/index.vue
View file @
548d5a84
This diff is collapsed.
Click to expand it.
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