Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
5b6ca0ad
提交
5b6ca0ad
authored
11月 25, 2021
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
云仓2.5-提测
上级
b4676ca5
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
750 行增加
和
918 行删除
+750
-918
brand.js
src/api/module/brand/brand.js
+22
-5
fillShopInf.vue
src/views/entry/fillShopInf.vue
+3
-19
newyuncang.vue
src/views/entry/newyuncang.vue
+0
-53
goodsinfomation.vue
src/views/system/goods/add/components/goodsinfomation.vue
+10
-18
index.vue
src/views/system/goods/add/index.vue
+10
-6
brand.vue
src/views/system/shop/brand.vue
+488
-376
index.vue
src/views/system/shop/index.vue
+217
-441
没有找到文件。
src/api/module/brand/brand.js
浏览文件 @
5b6ca0ad
...
...
@@ -9,7 +9,7 @@ export function getBrandsInf(query) {
}
// 新增品牌
export
function
addBrand
(
data
)
{
export
function
addBrand
Data
(
data
)
{
return
request
({
url
:
'/local/brands'
,
method
:
'post'
,
...
...
@@ -17,12 +17,29 @@ export function addBrand(data) {
});
}
// 删除 品牌
export
function
delBrandData
(
data
)
{
return
request
({
url
:
'/local/brand/deleteBrand'
,
method
:
'post'
,
data
:
data
});
}
// 获取品牌详情
export
function
getDetails
(
id
)
{
// export function (id) {
// return request({
// url: '?id='+id,
// method: 'get'
// })
// }
export
function
getDetails
(
query
)
{
return
request
({
url
:
'/local/brandsInfo?id='
+
id
,
method
:
'get'
})
url
:
'/local/brandsInfo'
,
method
:
'get'
,
params
:
query
});
}
// 修改品牌信息
...
...
src/views/entry/fillShopInf.vue
浏览文件 @
5b6ca0ad
...
...
@@ -85,25 +85,9 @@
<el-form-item
label=
"其他资质:"
>
<div
class=
"auth-con"
>
<!--*** 方法一 start ***-->
<!-- :class="['uploadData',
{ 'hiden-dom': businessImgFileList.length >= 1 }]"-->
<!-- :class="uploadDataClass(item)"-->
<!--
<div
v-for=
"(item,index) in qualificationList"
:key=
"item.id"
class=
"single-upload-con"
>
-->
<!--
<el-upload-->
<!-- :class="uploadDataClass(item,index)"-->
<!-- action="#"-->
<!-- list-type="picture-card"-->
<!-- :limit="1"-->
<!-- :on-exceed="showTip1"-->
<!-- :http-request="(item)=>
{return uploadBusinessImgs(item)}"-->
<!-- :file-list="showIndexAuthImg(item,index)"-->
<!-- >
</el-upload>
-->
<!--
<div
class=
"single-title"
>
{{
authTitleFormatter
(
item
.
content
)
}}
</div>
-->
<!--
</div>
-->
<!--*** 方法一 end ***-->
<!--*** 方法二 start ***-->
<div
v-for=
"(item,index) in qualificationList"
:key=
"item.id"
class=
"single-upload-con"
>
<div
v-show=
"!item.url"
class=
"single-auth-img"
@
click=
"upPre
Spe
Img(index)"
></div>
<div
v-show=
"!item.url"
class=
"single-auth-img"
@
click=
"upPre
Auth
Img(index)"
></div>
<div
v-show=
"item.url"
class=
"single-auth-img-con"
>
<img
class=
"auth-spec-img"
:src=
"item.url"
alt=
""
/>
...
...
@@ -510,7 +494,7 @@
}
},
/** 上传 对应资质图片 */
upPre
Spe
Img
(
index
)
{
upPre
Auth
Img
(
index
)
{
let
domRef
=
"hxz"
+
index
;
this
.
$refs
[
domRef
][
0
].
value
=
''
;
this
.
$refs
[
domRef
][
0
].
click
();
...
...
@@ -544,7 +528,7 @@
},
/** 更换图片 */
// changeSpeImg(index,item) {
// this.upPre
Spe
Img(index,item);
// this.upPre
Auth
Img(index,item);
// },
/** 删除 当前图片 */
delSingleSpecImg
(
index
,
item
)
{
...
...
src/views/entry/newyuncang.vue
浏览文件 @
5b6ca0ad
...
...
@@ -801,59 +801,6 @@
</
script
>
<
style
lang=
"scss"
type=
"text/stylus"
scoped
>
/* 手机竖屏时,可视区域的最大宽度为 480 */
//@media screen and (max-width: 480px) and (orientation: portrait) {
// .pc-content {
// display: none!important;
// }
// .mobile-show {
// display: none!important;
// }
//}
/* 手机横屏和pc最小宽度为 812px */
/* 手机横屏 812px 为iphoneX 横屏的设备独立像素*/
//@media screen and (max-width: 961px) and (orientation: landscape) {
// .pc-content {
// display: none !important;
// }
//
// .mobile-content {
// display: block!important;
// font-size: 0.16rem;
// }
//}
@media
screen
and
(
min-width
:
750px
)
{
html
{
font-size
:
100px
;
}
}
@media
screen
and
(
min-width
:
640px
)
and
(
max-width
:
749
)
{
html
{
font-size
:
85
.333px
;
}
}
@media
screen
and
(
min-width
:
414px
)
and
(
max-width
:
639
)
{
html
{
font-size
:
61
.333px
;
}
}
@media
screen
and
(
min-width
:
375px
)
and
(
max-width
:
413
)
{
html
{
font-size
:
50px
;
}
}
@media
screen
and
(
min-width
:
320px
)
and
(
max-width
:
374
)
{
html
{
font-size
:
42
.6667px
;
}
}
@media
screen
and
(
max-width
:
961px
)
{
.pc-content
{
display
:
none
!
important
;
...
...
src/views/system/goods/add/components/goodsinfomation.vue
浏览文件 @
5b6ca0ad
...
...
@@ -44,8 +44,8 @@
<!--
<span
class=
"tip-span ml20"
>
关键词之间用逗号分开,最多可以添加5个
</span>
-->
</el-form-item>
<el-form-item
label=
"所属品牌:"
prop=
"
goods_bran
d"
>
<el-select
v-model=
"goodsInfoForm.
goods_bran
d"
placeholder=
"请选择商品品牌"
style=
"width: 420px;"
>
<el-form-item
label=
"所属品牌:"
prop=
"
brand_i
d"
>
<el-select
v-model=
"goodsInfoForm.
brand_i
d"
placeholder=
"请选择商品品牌"
style=
"width: 420px;"
>
<el-option
v-for=
"item in brandOptions"
:key=
"item.id"
...
...
@@ -169,6 +169,7 @@
deliver_area
:
''
,
// 发货地
unit
:
''
,
// 单位
goods_brand
:
''
,
// 品牌
brand_id
:
0
,
// 品牌id
web_url
:
''
,
// 外部链接
out_goods_id
:
''
,
// 商品编码
imgs
:
[]
// 商品图片
...
...
@@ -262,25 +263,16 @@
},
// 获取 商品品牌
getBrands
()
{
getBrandsInf
().
then
(
res
=>
{
if
(
res
.
data
)
{
this
.
brandOptions
=
res
.
data
.
data
;
// 增加入参
let
data
=
{
status
:
1
}
getBrandsInf
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
brandOptions
=
res
.
data
.
data
?
res
.
data
.
data
:
[];
}
else
{
this
.
brandOptions
=
[];
}
// let num_goods_brand = Number(this.goodsInfoForm.goods_brand);
//
// if( this.goodsInfoForm.goods_brand !== '') {
// let result = this.brandOptions.find( item => {
// return item.id === num_goods_brand;
// });
// //console.log(315,result)
// if( result == undefined) {
// this.goodsInfoForm.goods_brand = '';
// }
// }
});
},
/* 修改 商品分类 类目 */
...
...
src/views/system/goods/add/index.vue
浏览文件 @
5b6ca0ad
...
...
@@ -178,13 +178,12 @@
deliver_area
:
res
.
data
.
deliver_area
,
// 发货地
unit
:
res
.
data
.
unit
,
// 单位
goods_brand
:
res
.
data
.
goods_brand
,
// 品牌
brand_id
:
res
.
data
.
brand_id
,
// 品牌
web_url
:
res
.
data
.
web_url
,
// 外部链接
out_goods_id
:
(
res
.
data
.
out_goods_id
==
0
)
?
''
:
res
.
data
.
out_goods_id
,
// 商品编码
imgs
:
res
.
data
.
imgs
// 商品图片
}
this
.
goodsinfodata
.
categoryStr
=
res
.
data
.
category_first_name
+
'/'
+
res
.
data
.
category_first_name
+
'/'
+
res
.
data
.
category_three_name
;
// 发货地 需要 处理
// this.goodsinfodata.deliver_area = this.goodsinfodata.deliver_area === 0 ? '' : this.goodsinfodata.deliver_area;
let
arr
=
[];
arr
[
0
]
=
res
.
data
.
category_first_id
;
...
...
@@ -505,13 +504,18 @@
let
spxxData
=
this
.
$refs
.
goodsInfo
.
goodsInfoForm
;
// 品牌处理 goods_brand
let
brandOptions
=
this
.
$refs
.
goodsInfo
.
brandOptions
;
for
(
let
bi
=
0
;
bi
<
brandOptions
.
length
;
bi
++
)
{
if
(
Number
(
spxxData
.
goods_brand
)
===
Number
(
brandOptions
[
bi
].
id
)
)
{
spxxData
.
goods_brand
=
brandOptions
[
bi
].
brand_cn
;
break
;
debugger
// goods_brand
if
(
Array
.
isArray
(
brandOptions
)
&&
brandOptions
.
length
>
0
)
{
for
(
let
bi
=
0
;
bi
<
brandOptions
.
length
;
bi
++
)
{
if
(
Number
(
spxxData
.
goods_id
)
===
Number
(
brandOptions
[
bi
].
id
)
)
{
spxxData
.
goods_brand
=
brandOptions
[
bi
].
brand_cn
;
break
;
}
}
}
// 产地数据处理
let
areaOptions
=
this
.
$refs
.
goodsInfo
.
areaOptions
;
for
(
let
ai
=
0
;
ai
<
areaOptions
.
length
;
ai
++
)
{
...
...
src/views/system/shop/brand.vue
浏览文件 @
5b6ca0ad
...
...
@@ -7,7 +7,7 @@
<el-col
:span=
"22"
>
<el-form-item
label=
"品牌名称"
>
<el-input
v-model=
"queryParams.brand_
cn
"
v-model=
"queryParams.brand_
name
"
placeholder=
"请输品牌名称"
clearable
size=
"small"
...
...
@@ -15,7 +15,7 @@
</el-form-item>
<el-form-item
label=
"品牌经营类型:"
>
<el-select
v-model=
"queryParams.brand_type"
clearable
size=
"small"
placeholder=
"全部品牌类型"
@
change=
"typeChange"
>
<el-select
v-model=
"queryParams.brand_type"
clearable
size=
"small"
placeholder=
"全部品牌类型"
>
<el-option
v-for=
"item in brandTypeOptions"
:key=
"item.value"
...
...
@@ -26,7 +26,7 @@
</el-form-item>
<el-form-item
label=
"品牌状态:"
>
<el-select
v-model=
"queryParams.status"
clearable
size=
"small"
placeholder=
"全部状态"
@
change=
"statusChange"
>
<el-select
v-model=
"queryParams.status"
clearable
size=
"small"
placeholder=
"全部状态"
>
<el-option
v-for=
"item in statusOptions"
:key=
"item.value"
...
...
@@ -39,13 +39,13 @@
</el-col>
<el-col
:span=
"2"
>
<el-form-item
style=
"float: right"
>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"
handleAd
d"
>
新 增
</el-button>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
@
click=
"
addBran
d"
>
新 增
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table
v-loading=
"loading"
:data=
"brandList"
:height=
"tableHeight"
>
<el-table
:data=
"brandList"
:height=
"tableHeight"
>
<el-table-column
label=
"品牌名称"
prop=
"brand_cn"
align=
"center"
></el-table-column>
<el-table-column
label=
"品牌经营类型"
prop=
"brand_type"
align=
"center"
>
<template
slot-scope=
"scope"
>
...
...
@@ -55,20 +55,20 @@
<el-table-column
label=
"品牌商标注册号"
prop=
"brand_number"
align=
"center"
></el-table-column>
<el-table-column
label=
"品牌状态"
prop=
"status"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
===
0
?
'未审核'
:
scope
.
row
.
status
===
1
?
'已通过'
:
'已拒绝'
}}
{{
brandStatusFormatter
(
scope
.
row
.
status
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"授权期限"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<!--
<span>
{{
timeFormatter
(
scope
.
row
.
send_time
)
}}
</span>
--
>
<span>
{{
timeFormatter
(
scope
.
row
.
brand_start_time
)
}}
</span
>
<span>
--
</span>
<!--
<span>
{{
timeFormatter
(
scope
.
row
.
send_time
)
}}
</span>
--
>
<span>
{{
timeFormatter
(
scope
.
row
.
brand_end_time
)
}}
</span
>
</
template
>
</el-table-column>
<el-table-column
label=
"审核说明"
prop=
"
sm
"
align=
"center"
></el-table-column>
<el-table-column
label=
"审核说明"
prop=
"
last_check_content
"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"small"
@
click=
"
handleDetails
(scope.row)"
:disabled=
"(scope.row.id === 1)"
>
编辑
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"
editBrand
(scope.row)"
:disabled=
"(scope.row.id === 1)"
>
编辑
</el-button>
<el-divider
direction=
"vertical"
></el-divider>
<el-button
type=
"text"
size=
"small"
@
click=
"deleteBrand(scope.row)"
:disabled=
"(scope.row.id === 1)"
>
删除
</el-button>
</
template
>
...
...
@@ -83,8 +83,17 @@
></pagination>
</el-card>
<!-- 新增/修改/详情 -->
<el-dialog
:title=
"brandTitle"
:visible
.
sync=
"isOpen"
width=
"60%"
class=
"brandInf-add"
>
<el-form
:model=
"brandForm"
:rules=
"brandRules"
ref=
"brandForm"
label-width=
"140px"
>
<el-dialog
:title=
"brandTitle"
:visible
.
sync=
"isOpen"
width=
"70%"
class=
"brandInf-add"
center
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
:before-close=
"handleCancel"
>
<el-form
v-if=
"isOpen"
:model=
"brandForm"
:rules=
"brandRules"
ref=
"brandForm"
label-width=
"140px"
>
<el-row
v-if=
"indexBrandId != 0 && brandForm.status != 3"
>
<p
class=
"brand-status-con"
>
<span
v-if=
"brandForm.status == 1"
class=
"color-spe-success"
><i
class=
"el-icon-success"
></i></span>
<span
v-if=
"brandForm.status == 2"
class=
"color-spe-error"
><i
class=
"el-icon-error"
></i></span>
<span
v-if=
"brandForm.status == 0"
class=
"color-spe-waiting"
><i
class=
"el-icon-success"
></i></span>
<span
class=
"brand-form-status-text"
>
{{ statusVal }}
</span>
</p>
</el-row>
<el-row>
<el-col
:span=
"16"
:offset=
"3"
>
<el-form-item
label=
"经营品牌类型:"
prop=
"brand_type"
>
...
...
@@ -99,7 +108,7 @@
<el-row>
<el-col
:span=
"16"
:offset=
"3"
>
<el-form-item
label=
"品牌中文名:"
prop=
"brand_cn"
>
<el-input
v-model=
"brandForm.brand_cn"
></el-input>
<el-input
v-model=
"brandForm.brand_cn"
@
input=
"checkIsExsitBrandName"
></el-input>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -130,8 +139,8 @@
action=
"#"
list-type=
"picture-card"
:http-request=
"uploadLogoImgs"
:limit=
"
2
"
:on-exceed=
"limit
Two
"
:limit=
"
1
"
:on-exceed=
"limit
1
"
:before-upload=
"UpImgSizeFiveKB"
:on-preview=
"handlePreviewLogo"
:on-remove=
"handleRemoveLogo"
...
...
@@ -166,8 +175,8 @@
action=
"#"
list-type=
"picture-card"
:http-request=
"uploadCertImgs"
:limit=
"
2
"
:on-exceed=
"limit
Two
"
:limit=
"
1
"
:on-exceed=
"limit
1
"
:before-upload=
"UpImgSizeTwoMb"
:on-preview=
"handlePreviewCert"
:on-remove=
"handleRemoveCert"
...
...
@@ -203,9 +212,37 @@
</el-col>
</el-row>
<el-row>
<el-col
:span=
"16"
:offset=
"3"
>
<el-form-item
label=
"商标注册有效期:"
prop=
"brand_auth_time"
v-if=
"brandForm.brand_type === 2"
>
<el-date-picker
type=
"date"
placeholder=
"选择日期"
v-model=
"validityConcreteTime"
style=
"width: 300px;"
@
change=
"validityConcreteChange"
></el-date-picker>
<el-checkbox
v-model=
"validityLongTermVal"
style=
"padding-left:15px;"
@
change=
"validityLongTermChange"
>
长期
</el-checkbox>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"16"
:offset=
"3"
>
<el-form-item
label=
"品牌授权期限:"
prop=
"brandAuthRangeTime"
>
<el-date-picker
style=
"width:400px;"
v-model=
"brandForm.brandAuthRangeTime"
type=
"daterange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"21"
:offset=
"3"
>
<el-form-item
label=
"品牌
方授权书
:"
prop=
"brand_auth"
v-if=
"brandForm.brand_type === 2"
>
<el-form-item
label=
"品牌
厂商授权
:"
prop=
"brand_auth"
v-if=
"brandForm.brand_type === 2"
>
<div
style=
"width:100%;height: 100%;display: flex;flex-direction: row;justify-content: normal;"
>
<div
style=
"padding-right:6px;"
>
<el-upload
...
...
@@ -237,18 +274,6 @@
</el-col>
</el-row>
<el-row>
<el-col
:span=
"16"
:offset=
"3"
>
<el-form-item
label=
"授权有效期至:"
prop=
"brand_auth_time"
v-if=
"brandForm.brand_type === 2"
>
<el-date-picker
type=
"date"
placeholder=
"选择日期"
v-model=
"validityConcreteTime"
style=
"width: 300px;"
@
change=
"validityConcrete"
></el-date-picker>
<el-checkbox
v-model=
"validityLongTermVal"
style=
"padding-left:15px;"
@
change=
"validityLongTerm"
>
长期
</el-checkbox>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"21"
:offset=
"3"
>
<el-form-item
label=
"品牌经营授权:"
prop=
"brand_business_auth"
>
...
...
@@ -304,7 +329,7 @@
</el-row>
<el-form-item
class=
"btnCen"
>
<el-button
type=
""
@
click=
"handleCancel
('brandForm')"
style=
"margin-right: 30px"
>
取
消
</el-button>
<el-button
type=
""
@
click=
"handleCancel
"
style=
"margin-right: 30px"
>
取
消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave('brandForm')"
>
提交审核
</el-button>
</el-form-item>
...
...
@@ -314,7 +339,7 @@
</template>
<
script
>
import
{
getBrandsInf
,
getDetails
,
addBrand
,
upBrand
,
upLoadImg
}
from
'@/api/module/brand/brand'
import
{
getBrandsInf
,
getDetails
,
addBrand
Data
,
upBrand
,
upLoadImg
,
delBrandData
}
from
'@/api/module/brand/brand'
import
{
dateFormat
}
from
'@/utils'
export
default
{
name
:
"Brand"
,
...
...
@@ -343,7 +368,7 @@
let
authTimeValidator
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
brandForm
.
brand_type
===
2
)
{
if
(
this
.
validityConcreteTime
===
null
&&
this
.
validityLongTermVal
===
false
)
{
callback
(
new
Error
(
"
授权
有效期具体时间和长期必须填写其中一个"
));
callback
(
new
Error
(
"
品牌注册
有效期具体时间和长期必须填写其中一个"
));
}
else
{
callback
();
}
...
...
@@ -351,6 +376,13 @@
callback
();
}
};
let
authRangeTimeValidator
=
(
rule
,
value
,
callback
)
=>
{
if
(
Array
.
isArray
(
this
.
brandForm
.
brandAuthRangeTime
)
&&
this
.
brandForm
.
brandAuthRangeTime
.
length
==
2
)
{
callback
();
}
else
{
callback
(
new
Error
(
"请选择品牌授权期限"
));
}
};
let
authBusValidator
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
shopImgFileList
.
length
>
0
)
{
callback
();
...
...
@@ -361,25 +393,26 @@
return
{
fullHeight
:
0
,
tableHeight
:
0
,
loading
:
false
,
isOpen
:
false
,
brandTitle
:
''
,
brandTypeOptions
:
[
{
label
:
"自有品牌"
,
value
:
1
},
{
label
:
"品牌厂商授权"
,
value
:
2
},
{
label
:
"全部品牌"
,
value
:
'-1'
},
{
label
:
"自有品牌"
,
value
:
'1'
},
{
label
:
"品牌厂商授权"
,
value
:
'2'
},
],
statusOptions
:
[
{
label
:
'未审核'
,
value
:
0
},
{
label
:
'已通过'
,
value
:
1
},
{
label
:
'已拒绝'
,
value
:
2
}
{
label
:
'未审核'
,
value
:
'0'
},
{
label
:
'已通过'
,
value
:
'1'
},
{
label
:
'已拒绝'
,
value
:
'2'
},
{
label
:
'已过期'
,
value
:
'3'
},
],
total
:
0
,
queryParams
:
{
page
:
1
,
limit
:
10
,
brand_
cn
:
null
,
brand_type
:
null
,
status
:
null
brand_
name
:
''
,
brand_type
:
''
,
status
:
''
},
LogoVisible
:
false
,
LogoImageUrl
:
''
,
...
...
@@ -396,6 +429,8 @@
validityConcreteTime
:
null
,
validityLongTermVal
:
false
,
// 长期
brandList
:
[],
indexBrandId
:
0
,
// 当前品牌 id
statusVal
:
''
,
brandForm
:
{
id
:
0
,
brand_type
:
''
,
// 品牌经营类型
...
...
@@ -405,7 +440,8 @@
brand_register_cert
:
''
,
// 商标注册证书
brand_number
:
''
,
// 品牌商标注册号
brand_range
:
''
,
// 品牌类型
brand_auth_time
:
''
,
// 授权有效期 == 商标授权时间期限
brand_auth_time
:
''
,
// 商品注册有效期
brandAuthRangeTime
:
[],
// 品牌授权有效期
brand_auth
:
''
,
// 商标授权 == 品牌授权 == factoryImgFileList
brand_business_auth
:
''
,
// 商标经营授权 == 品牌经营授权 == shopImgFileList
},
...
...
@@ -418,11 +454,10 @@
brand_range
:
[{
required
:
true
,
message
:
'品牌类型需要选择其一'
,
trigger
:
'blur'
}],
brand_auth
:
[{
required
:
true
,
message
:
'品牌授权书图片至少上传一张'
,
validator
:
authValidator
}],
// 品牌授权
brand_auth_time
:
[{
required
:
true
,
trigger
:
'change'
,
validator
:
authTimeValidator
}],
brandAuthRangeTime
:
[{
required
:
true
,
trigger
:
'blur'
,
validator
:
authRangeTimeValidator
}],
brand_business_auth
:
[{
required
:
true
,
message
:
'品牌经营授权至少上传一张图片'
,
validator
:
authBusValidator
}],
},
downTemplatehttp
:
''
,
// shopTemplatehttp : 'http://excel.jxhh.com/brand_new.doc',
// factoryTemplatehttp : 'http://excel.jxhh.com/brand_new.doc',
shopTemplatehttp
:
'http://excel.jxhh.com/brand_new.doc'
,
factoryTemplatehttp
:
'http://excel.jxhh.com/brand_new.doc'
,
}
...
...
@@ -441,24 +476,23 @@
},
methods
:
{
typeChange
(
val
){
if
(
val
===
""
)
{
this
.
queryParams
.
brand_type
=
null
;
/** 查询 品牌 列表 */
getList
()
{
let
data
=
{
page
:
this
.
queryParams
.
page
,
limit
:
this
.
queryParams
.
limit
}
},
statusChange
(
val
){
if
(
val
===
""
)
{
this
.
queryParams
.
status
=
null
;
if
(
this
.
queryParams
.
brand_name
!=
""
)
{
data
[
'brand_name'
]
=
this
.
queryParams
.
brand_name
}
},
isClick
()
{
return
false
;
},
getList
()
{
this
.
loading
=
true
;
//let params = this.handleQueryParams(this.queryParams);
getBrandsInf
(
this
.
queryParams
).
then
(
res
=>
{
if
(
res
&&
res
.
data
&&
res
.
code
===
1
)
{
if
(
this
.
queryParams
.
brand_type
==
'1'
||
this
.
queryParams
.
brand_type
==
'2'
||
this
.
queryParams
.
brand_type
==
'3'
)
{
data
[
'brand_type'
]
=
this
.
queryParams
.
brand_type
}
if
(
this
.
queryParams
.
status
==
'0'
||
this
.
queryParams
.
status
==
'1'
||
this
.
queryParams
.
status
==
'2'
)
{
data
[
'status'
]
=
this
.
queryParams
.
status
}
getBrandsInf
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
if
(
res
.
data
)
{
this
.
brandList
=
res
.
data
.
data
;
this
.
total
=
res
.
data
.
count
;
...
...
@@ -466,12 +500,370 @@
this
.
brandList
=
[];
}
}
else
{
this
.
$message
({
message
:
'数据出错啦!'
,
type
:
'error'
});
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
'获取品牌列表数据失败'
});
}
});
},
/** 品牌 审核状态 */
statusFormatter
(
status
)
{
let
res
=
''
;
if
(
status
==
0
)
{
res
=
'等待审核'
}
if
(
status
==
1
)
{
res
=
'审核通过'
}
if
(
status
==
2
)
{
res
=
'审核被拒绝'
}
return
res
},
/** 校验品牌 */
checkIsExsitBrandName
()
{
if
(
!
this
.
brandForm
.
brand_cn
)
return
let
data
=
{
brand_name
:
this
.
brandForm
.
brand_cn
}
getDetails
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
&&
res
.
data
)
{
this
.
$message
({
type
:
'warning'
,
message
:
'品牌名称已存在'
});
}
});
},
/** 新增 品牌 */
addBrand
()
{
if
(
this
.
total
<=
20
)
{
this
.
isOpen
=
true
;
this
.
reset
(
'brandForm'
)
this
.
brandTitle
=
'新增品牌信息'
;
this
.
indexBrandId
=
0
;
this
.
brandForm
.
brand_auth
=
''
;
this
.
brandForm
.
brand_auth_time
=
''
;
}
else
{
this
.
$message
({
type
:
'warning'
,
message
:
'目前暂时只支持维护20个品牌数据'
});
}
},
/** 编辑 品牌 */
editBrand
(
row
)
{
this
.
indexBrandId
=
row
.
id
;
let
data
=
{
id
:
this
.
indexBrandId
}
getDetails
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
isOpen
=
true
;
this
.
reset
(
'brandForm'
)
this
.
brandTitle
=
'品牌信息详情'
;
this
.
brandForm
=
res
.
data
;
// 品牌审核状态
this
.
statusVal
=
this
.
statusFormatter
(
res
.
data
.
status
)
// 模板下载地址赋值
this
.
downTemplatehttp
=
(
this
.
brandForm
.
brand_type
===
1
?
this
.
shopTemplatehttp
:
this
.
factoryTemplatehttp
);
// 品牌logo图片
let
brandArr
=
[];
let
brandUrl
=
{};
brandArr
=
this
.
brandForm
.
brand_logo
.
split
(
","
);
if
(
brandArr
.
length
>
0
)
{
brandArr
.
forEach
(
item
=>
{
brandUrl
=
{};
if
(
item
)
{
brandUrl
.
url
=
item
this
.
brandImgFileList
.
push
(
brandUrl
)
}
});
}
else
{
this
.
brandImgFileList
=
[];
}
// 商标注册证书图片
let
certArr
=
[];
let
certRrl
=
{};
certArr
=
this
.
brandForm
.
brand_register_cert
.
split
(
","
);
if
(
certArr
.
length
>
0
)
{
certArr
.
forEach
(
item
=>
{
certRrl
=
{};
if
(
item
)
{
certRrl
.
url
=
item
this
.
certImgFileList
.
push
(
certRrl
)
}
});
}
else
{
this
.
certImgFileList
=
[];
}
// 商标注册有效期
if
(
this
.
brandForm
.
brand_auth_time
===
0
)
{
this
.
validityLongTermVal
=
true
;
this
.
validityConcreteTime
=
''
;
}
else
{
this
.
validityLongTermVal
=
false
;
this
.
validityConcreteTime
=
this
.
timeFormatter
(
this
.
brandForm
.
brand_auth_time
);
}
// 品牌授权期限
this
.
brandForm
.
brandAuthRangeTime
=
[]
this
.
brandForm
.
brandAuthRangeTime
.
push
(
this
.
timeFormatter
(
this
.
brandForm
.
brand_start_time
))
this
.
brandForm
.
brandAuthRangeTime
.
push
(
this
.
timeFormatter
(
this
.
brandForm
.
brand_end_time
))
// 品牌厂商授权 图片
let
factoryArr
=
[];
let
factoryUrl
=
{};
factoryArr
=
this
.
brandForm
.
brand_auth
.
split
(
","
);
if
(
factoryArr
.
length
>
0
)
{
factoryArr
.
forEach
(
item
=>
{
factoryUrl
=
{};
if
(
item
)
{
factoryUrl
.
url
=
item
this
.
factoryImgFileList
.
push
(
factoryUrl
)
}
});
}
else
{
this
.
factoryImgFileList
=
[];
}
// 品牌经营授权 图片
let
shopArr
=
[];
let
shopUrl
=
{};
shopArr
=
this
.
brandForm
.
brand_business_auth
.
split
(
","
);
if
(
shopArr
.
length
>
0
)
{
shopArr
.
forEach
(
item
=>
{
shopUrl
=
{};
if
(
item
)
{
shopUrl
.
url
=
item
this
.
shopImgFileList
.
push
(
shopUrl
)
}
});
}
else
{
this
.
shopImgFileList
=
[];
}
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
'获取品牌失败'
});
}
this
.
loading
=
false
;
});
},
/** 取消、关闭 新增,编辑 */
handleCancel
()
{
this
.
reset
(
'brandForm'
)
this
.
isOpen
=
false
;
},
/** 提交審核 */
handleSave
(
form
)
{
this
.
$refs
[
form
].
validate
(
valid
=>
{
if
(
valid
)
{
// 入参数据
let
brandsData
=
{
brands
:
[]
};
let
data
=
{}
data
[
'id'
]
=
this
.
indexBrandId
;
data
[
'brand_type'
]
=
this
.
brandForm
.
brand_type
;
data
[
'brand_cn'
]
=
this
.
brandForm
.
brand_cn
;
data
[
'brand_en'
]
=
this
.
brandForm
.
brand_en
;
data
[
'brand_number'
]
=
this
.
brandForm
.
brand_number
;
// 品牌logo图片处理
if
(
this
.
brandImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
brandImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
data
[
'brand_logo'
]
=
this
.
brandImgFileList
[
i
].
url
;
}
else
{
data
[
'brand_logo'
]
+=
','
+
this
.
brandImgFileList
[
i
].
url
;
}
}
}
// 商标注册证书图片
if
(
this
.
certImgFileList
.
length
>
0
)
{
for
(
let
a
=
0
;
a
<
this
.
certImgFileList
.
length
;
a
++
)
{
if
(
a
===
0
)
{
data
[
'brand_register_cert'
]
=
this
.
certImgFileList
[
a
].
url
;
}
else
{
data
[
'brand_register_cert'
]
+=
','
+
this
.
certImgFileList
[
a
].
url
;
}
}
}
// 品牌类型
data
[
'brand_range'
]
=
this
.
brandForm
.
brand_range
// 商标注册有效期
if
(
this
.
validityLongTermVal
)
{
data
[
'brand_auth_time'
]
=
0
;
}
else
{
data
[
'brand_auth_time'
]
=
new
Date
(
this
.
validityConcreteTime
).
getTime
()
/
1000
;
}
// 品牌 授权期限
if
(
Array
.
isArray
(
this
.
brandForm
.
brandAuthRangeTime
)
&&
this
.
brandForm
.
brandAuthRangeTime
.
length
==
2
)
{
data
[
'brand_start_time'
]
=
new
Date
(
this
.
brandForm
.
brandAuthRangeTime
[
0
]).
getTime
()
/
1000
;
data
[
'brand_end_time'
]
=
new
Date
(
this
.
brandForm
.
brandAuthRangeTime
[
1
]).
getTime
()
/
1000
;
}
// 品牌商标授权 图片
if
(
this
.
factoryImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
factoryImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
data
[
'brand_auth'
]
=
this
.
factoryImgFileList
[
i
].
url
;
}
else
{
data
[
'brand_auth'
]
+=
','
+
this
.
factoryImgFileList
[
i
].
url
;
}
}
}
// 品牌经营授权 图片处理
if
(
this
.
shopImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
shopImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
data
[
'brand_business_auth'
]
=
this
.
shopImgFileList
[
i
].
url
;
}
else
{
data
[
'brand_business_auth'
]
+=
','
+
this
.
shopImgFileList
[
i
].
url
;
}
}
}
// 新增 品牌
if
(
this
.
indexBrandId
==
0
)
{
// 入参 格式处理
brandsData
.
brands
.
push
(
data
);
addBrandData
(
brandsData
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
'新增成功'
,
type
:
'success'
});
this
.
getList
();
this
.
isOpen
=
false
;
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
"新增失败"
});
}
});
}
// 修改 品牌
if
(
this
.
indexBrandId
!=
0
)
{
// 入参 格式处理
// brandsData.brands.push(data);
this
.
$confirm
(
'确定要提交审核吗?提交审核后,品牌处于待审核状态,对应商品将做下架处理'
,
'提示:'
,
{
type
:
'warning'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
}).
then
(
async
()
=>
{
let
res
=
await
upBrand
(
data
)
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
'编辑成功'
,
type
:
'success'
});
this
.
getList
();
this
.
isOpen
=
false
;
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
"编辑失败"
});
}
}).
catch
(()
=>
{});
}
}
// vilid end
})
},
/** 删除 品牌 */
deleteBrand
(
row
)
{
if
(
!
row
.
id
)
{
return
}
let
data
=
{
brand_ids
:
[]
}
data
.
brand_ids
.
push
(
row
.
id
);
this
.
$confirm
(
'确定要删除品牌吗?品牌删除后,使用该品牌的商品也会作下架处理!'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
async
()
=>
{
let
result
=
await
delBrandData
(
data
);
if
(
result
.
code
==
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'删除成功'
});
this
.
getList
()
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
result
.
message
?
result
.
message
:
'删除成功'
});
}
}).
catch
(()
=>
{});
},
/** 查询 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
;
this
.
getList
();
},
/** 商品注册有效期 具体时间 */
validityConcreteChange
()
{
if
(
this
.
validityConcreteTime
)
{
this
.
validityLongTermVal
=
false
;
}
},
/** 商品注册有效期 长期 */
validityLongTermChange
()
{
if
(
this
.
validityLongTermVal
)
{
this
.
validityConcreteTime
=
null
;
}
},
// 通用方法
/** 重置 编辑 表单*/
reset
(
formName
){
if
(
this
.
$refs
[
formName
])
{
this
.
$refs
[
formName
].
resetFields
();
}
else
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
formName
].
resetFields
();
})
}
this
.
brandImgFileList
=
[];
this
.
certImgFileList
=
[];
this
.
factoryImgFileList
=
[];
this
.
shopImgFileList
=
[];
},
/** 上传图片 数量限制 */
limit1
()
{
this
.
$message
({
message
:
'最多上传1张图片'
,
type
:
'warning'
});
},
/** 时间格式化 */
timeFormatter
(
timeVal
)
{
return
dateFormat
(
timeVal
*
1000
,
'Y-m-d'
)
},
/** 品牌 状态格式化 */
brandStatusFormatter
(
statusVal
)
{
let
res
=
''
;
if
(
statusVal
==
0
)
{
res
=
'未审核'
}
if
(
statusVal
==
1
)
{
res
=
'已通过'
}
if
(
statusVal
==
2
)
{
res
=
'已拒绝'
}
if
(
statusVal
==
3
)
{
res
=
'已过期'
}
return
res
;
},
/** 图片转换为base64位 */
getBase64
(
file
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
let
reader
=
new
FileReader
();
let
imgResult
=
""
;
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
function
()
{
imgResult
=
reader
.
result
;
};
reader
.
onerror
=
function
(
error
)
{
reject
(
error
);
};
reader
.
onloadend
=
function
()
{
resolve
(
imgResult
);
};
});
},
/**********---------------------------------------------************************** */
// 品牌经营类型 改变触发
chooseBrandType
()
{
this
.
downTemplatehttp
=
''
;
...
...
@@ -489,9 +881,7 @@
chooseBrandRange
()
{
this
.
$refs
.
brandForm
.
clearValidate
(
'brand_range'
);
},
limitTwo
()
{
this
.
$message
({
message
:
'最多上传2张图片'
,
type
:
'warning'
});
},
// 品牌商标图片 自定义上传
uploadLogoImgs
(
param
)
{
this
.
getBase64
(
param
.
file
).
then
((
res
)
=>
{
...
...
@@ -644,322 +1034,14 @@
}
}
},
// 授权有效期 二选一效果
validityConcrete
()
{
if
(
this
.
validityConcreteTime
)
{
this
.
validityLongTermVal
=
false
;
}
},
validityLongTerm
()
{
if
(
this
.
validityLongTermVal
)
{
this
.
validityConcreteTime
=
null
;
}
},
// 新增,修改,详情
handleAdd
()
{
if
(
this
.
total
<
20
)
{
this
.
isOpen
=
true
;
this
.
brandTitle
=
'新增品牌信息'
;
this
.
reset
(
'brandForm'
);
this
.
brandForm
.
id
=
0
;
this
.
brandForm
.
brand_auth
=
''
;
this
.
brandForm
.
brand_auth_time
=
''
;
}
else
{
this
.
$message
({
type
:
'warning'
,
message
:
'目前暂时只支持维护20个品牌数据!'
});
}
},
/** 详情 */
handleDetails
(
row
)
{
this
.
isOpen
=
true
;
this
.
brandTitle
=
'品牌信息详情'
;
const
ids
=
row
.
id
;
getDetails
(
ids
).
then
(
res
=>
{
if
(
res
.
code
&&
res
.
code
===
1
&&
res
.
data
)
{
this
.
brandForm
=
res
.
data
;
// 模板下载地址赋值
this
.
downTemplatehttp
=
(
this
.
brandForm
.
brand_type
===
1
?
this
.
shopTemplatehttp
:
this
.
factoryTemplatehttp
);
// 商标logo图片处理
let
brandList
=
{};
let
brandArr
=
[];
if
(
this
.
brandForm
.
brand_logo
.
indexOf
(
","
)
>
0
)
{
brandArr
=
this
.
brandForm
.
brand_logo
.
split
(
","
);
for
(
let
a
=
0
;
a
<
brandArr
.
length
;
a
++
){
brandList
=
{};
brandList
.
url
=
brandArr
[
a
];
this
.
brandImgFileList
.
push
(
brandList
);
}
}
else
{
brandList
.
url
=
this
.
brandForm
.
brand_logo
;
this
.
brandImgFileList
=
[];
this
.
brandImgFileList
.
push
(
brandList
);
}
// 商标注册证书处理 brand_register_cert
let
certList
=
{};
let
certArr
=
[];
if
(
this
.
brandForm
.
brand_register_cert
.
indexOf
(
","
)
>
0
)
{
certArr
=
this
.
brandForm
.
brand_register_cert
.
split
(
","
);
for
(
let
a
=
0
;
a
<
certArr
.
length
;
a
++
){
certList
=
{};
certList
.
url
=
certArr
[
a
];
this
.
certImgFileList
.
push
(
certList
);
}
}
else
{
certList
.
url
=
this
.
brandForm
.
brand_register_cert
;
this
.
certImgFileList
=
[];
this
.
certImgFileList
.
push
(
certList
);
}
// 品牌授权 图片处理 factoryImgFileList
let
factoryList
=
{};
let
factoryArr
=
[];
if
(
this
.
brandForm
.
brand_auth
.
indexOf
(
","
)
>
0
)
{
factoryArr
=
this
.
brandForm
.
brand_auth
.
split
(
","
);
for
(
let
authIndex
=
0
;
authIndex
<
factoryArr
.
length
;
authIndex
++
){
factoryList
=
{};
factoryList
.
url
=
factoryArr
[
authIndex
];
this
.
factoryImgFileList
.
push
(
factoryList
);
}
}
else
{
factoryList
.
url
=
this
.
brandForm
.
brand_auth
;
this
.
factoryImgFileList
=
[];
this
.
factoryImgFileList
.
push
(
factoryList
);
}
// 品牌经营授权 图片处理 shopImgFileList
let
shopList
=
{};
let
shopArr
=
[];
if
(
this
.
brandForm
.
brand_business_auth
.
indexOf
(
","
)
>
0
)
{
shopArr
=
this
.
brandForm
.
brand_business_auth
.
split
(
","
);
for
(
let
busIndex
=
0
;
busIndex
<
shopArr
.
length
;
busIndex
++
){
shopList
=
{};
shopList
.
url
=
shopArr
[
busIndex
];
this
.
shopImgFileList
.
push
(
shopList
);
}
}
else
{
shopList
.
url
=
this
.
brandForm
.
brand_business_auth
;
this
.
shopImgFileList
=
[];
this
.
shopImgFileList
.
push
(
shopList
);
}
// 期限处理
if
(
this
.
brandForm
.
brand_auth_time
===
0
)
{
this
.
validityLongTermVal
=
true
;
}
else
{
this
.
validityConcreteTime
=
this
.
toStandTime
(
this
.
brandForm
.
brand_auth_time
);
}
}
else
if
(
res
.
code
===
0
)
{
if
(
res
.
msg
)
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'error'
});
}
else
{
this
.
$message
({
message
:
'数据出错啦!'
,
type
:
'error'
});
}
}
});
},
// 查询
handleQuery
()
{
this
.
queryParams
.
page
=
1
;
this
.
getList
();
},
// 保存
handleSave
(
form
)
{
this
.
$refs
[
form
].
validate
(
valid
=>
{
if
(
valid
)
{
let
addBrandForm
=
{};
let
toArrBrandForm
=
[];
if
(
this
.
validityLongTermVal
)
{
this
.
brandForm
.
brand_auth_time
=
(
this
.
validityLongTermVal
-
0
-
1
);
}
else
if
(
this
.
validityLongTermVal
===
false
&&
this
.
validityConcreteTime
)
{
this
.
brandForm
.
brand_auth_time
=
new
Date
(
this
.
validityConcreteTime
).
getTime
()
/
1000
;
}
else
{
this
.
brandForm
.
brand_auth_time
=
''
;
}
// 品牌logo图片处理
if
(
this
.
brandImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
brandImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
brandForm
.
brand_logo
=
this
.
brandImgFileList
[
i
].
url
;
}
else
{
this
.
brandForm
.
brand_logo
+=
','
+
this
.
brandImgFileList
[
i
].
url
;
}
}
}
// 商标注册证书图片处理 certImgFileList
if
(
this
.
certImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
certImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
brandForm
.
brand_register_cert
=
this
.
certImgFileList
[
i
].
url
;
}
else
{
this
.
brandForm
.
brand_register_cert
+=
','
+
this
.
certImgFileList
[
i
].
url
;
}
}
}
// 品牌授权图片处理
if
(
this
.
factoryImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
factoryImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
brandForm
.
brand_auth
=
this
.
factoryImgFileList
[
i
].
url
;
}
else
{
this
.
brandForm
.
brand_auth
+=
','
+
this
.
factoryImgFileList
[
i
].
url
;
}
}
}
// 品牌经营授权 图片处理
if
(
this
.
shopImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
shopImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
brandForm
.
brand_business_auth
=
this
.
shopImgFileList
[
i
].
url
;
}
else
{
this
.
brandForm
.
brand_business_auth
+=
','
+
this
.
shopImgFileList
[
i
].
url
;
}
}
}
// 数据处理完毕
toArrBrandForm
.
push
(
this
.
brandForm
);
addBrandForm
.
brands
=
toArrBrandForm
;
// 新增/修改
if
(
this
.
brandForm
.
id
===
0
)
{
addBrand
(
addBrandForm
).
then
(
res
=>
{
if
(
res
.
code
&&
res
.
code
===
1
)
{
this
.
$message
({
message
:
'新增成功'
,
type
:
'success'
});
this
.
getList
();
this
.
reset
(
'brandForm'
);
this
.
isOpen
=
false
;
}
else
if
(
res
.
code
===
0
)
{
if
(
res
.
msg
)
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'error'
});
}
else
{
this
.
$message
({
message
:
'新增失败'
,
type
:
'error'
});
}
}
});
// 修改
}
else
{
this
.
$confirm
(
'是否确认修改此数据项?'
,
'提示:'
,
{
type
:
'warning'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
}).
then
(()
=>
{
this
.
edit
(
toArrBrandForm
);
}).
catch
(()
=>
{
this
.
isOpen
=
false
;
});
}
}
})
},
/** 删除 品牌 */
deleteBrand
(
row
)
{
},
// 修改
edit
(
param
)
{
upBrand
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1
)
{
this
.
$message
({
message
:
'修改成功'
,
type
:
'success'
});
this
.
getList
();
}
else
if
(
res
.
code
===
0
)
{
if
(
res
.
msg
)
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'error'
});
}
else
{
this
.
$message
({
message
:
'数据出错啦!'
,
type
:
'error'
});
}
}
this
.
reset
(
'brandForm'
);
this
.
isOpen
=
false
;
});
},
// 取消
handleCancel
(
form
)
{
this
.
reset
(
form
);
this
.
isOpen
=
false
;
},
// -----------通用 方法----------
// 搜索参数处理
handleQueryParams
(
parmas
)
{
let
newParmas
=
{};
// 对象深拷贝
newParmas
=
JSON
.
parse
(
JSON
.
stringify
(
parmas
));
for
(
let
key
in
newParmas
){
if
(
key
)
{
if
(
newParmas
[
key
]
!==
0
&&
newParmas
[
key
]
!==
''
)
{
if
(
!
newParmas
[
key
])
{
newParmas
[
key
]
=
null
;
}
}
}
}
return
newParmas
;
},
// 究极清空
reset
(
form
){
if
(
this
.
$refs
[
form
])
{
this
.
$refs
[
form
].
resetFields
();
}
else
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
form
].
resetFields
();
});
}
// 取消按钮,图片清空
this
.
brandImgFileList
=
[];
this
.
certImgFileList
=
[];
this
.
factoryImgFileList
=
[];
this
.
shopImgFileList
=
[];
},
// 图片转换为base64位
getBase64
(
file
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
let
reader
=
new
FileReader
();
let
imgResult
=
""
;
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
function
()
{
imgResult
=
reader
.
result
;
};
reader
.
onerror
=
function
(
error
)
{
reject
(
error
);
};
reader
.
onloadend
=
function
()
{
resolve
(
imgResult
);
};
});
},
/** 时间格式化 */
timeFormatter
(
timeVal
)
{
return
dateFormat
(
timeVal
*
1000
,
'Y-m-d'
)
},
// 时间戳转换为 标准时间格式
toStandTime
(
val
)
{
let
date
=
new
Date
(
val
*
1000
)
let
Y
=
date
.
getFullYear
()
+
'-'
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'-'
const
D
=
(
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
())
+
' '
const
h
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
const
m
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
const
s
=
(
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
())
return
Y
+
M
+
D
+
h
+
m
+
s
;
},
}
}
// methods end
}
</
script
>
<
style
lang=
"scss"
type=
"text/stylus"
scoped
>
.brandInf-add
{
/
deep
/
.el-dialog
{
height
:
8
0
%
;
height
:
8
5
%
;
overflow
:
hidden
;
}
/
deep
/
.el-dialog__body
{
...
...
@@ -968,6 +1050,36 @@
overflow-y
:
scroll
;
}
}
.brand-status-con
{
font-size
:
16px
;
margin
:
0
10%
10px
;
padding
:
12px
20px
;
border
:
1px
solid
#00afff
;
display
:
flex
;
justify-content
:
normal
;
align-items
:center
;
flex-direction
:
row
;
}
.color-spe-success
{
color
:
#67C23A
;
font-size
:
20px
;
padding-top
:
2px
;
}
.color-spe-error
{
color
:
#F56C6C
;
font-size
:
20px
;
padding-top
:
2px
;
}
.color-spe-waiting
{
color
:
#909399
;
font-size
:
20px
;
padding-top
:
2px
;
}
.brand-form-status-text
{
padding
:
0
10px
;
}
.btnCen
{
/
deep
/
.el-form-item__content
{
margin-left
:
0
!
important
;
...
...
src/views/system/shop/index.vue
浏览文件 @
5b6ca0ad
...
...
@@ -100,8 +100,8 @@
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
<el-dialog
:visible
.
sync=
"
dialog
BackVisible"
>
<img
width=
"100%"
:src=
"
dialogBackImage
Url"
alt=
""
>
<el-dialog
:visible
.
sync=
"
idcard
BackVisible"
>
<img
width=
"100%"
:src=
"
idcardBackImg
Url"
alt=
""
>
</el-dialog>
</div>
<div>
...
...
@@ -245,22 +245,22 @@
<!--编辑-->
<el-dialog
title=
"编辑店铺信息"
:visible
.
sync=
"isOpen"
width=
"65%"
class=
"shopinf-edit"
center
:
close-on-click-modal=
"false
"
>
<el-form
ref=
"editStoreForm"
:model=
"editStoreForm"
:rules=
"shop
Rules"
label-width=
"180px"
size=
"small"
>
center
:
destroy-on-close=
"true"
:close-on-click-modal=
"false"
:before-close=
"handleCancel
"
>
<el-form
v-if=
"isOpen"
ref=
"editForm"
:model=
"editForm"
:rules=
"edit
Rules"
label-width=
"180px"
size=
"small"
>
<el-form-item
label=
"电商平台经验:"
prop=
"is_business_experience"
>
<el-radio-group
v-model=
"
store
Form.is_business_experience"
>
<el-radio-group
v-model=
"
edit
Form.is_business_experience"
>
<el-radio
:label=
"1"
>
有
</el-radio>
<el-radio
:label=
"0"
>
无
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"店铺名称:"
prop=
"store_name"
inline-message=
"true"
>
<el-input
v-model=
"
store
Form.store_name"
style=
"width: 400px;"
placeholder=
"请输入店铺名称"
></el-input>
<el-input
v-model=
"
edit
Form.store_name"
style=
"width: 400px;"
placeholder=
"请输入店铺名称"
></el-input>
</el-form-item>
<el-form-item
label=
"经营类目:"
prop=
"scope"
>
<el-select
v-model=
"
storeForm.scope"
@
remove-tag=
"removeTag"
@
visible-change=
"s
copeVisibleChange($event)"
multiple
placeholder=
"请选择..."
style=
"width: 400px;"
>
<el-select
v-model=
"
editForm.scope"
@
remove-tag=
"removeEditTag"
@
visible-change=
"editS
copeVisibleChange($event)"
multiple
placeholder=
"请选择..."
style=
"width: 400px;"
>
<el-option
v-for=
"item in scopeOptions"
:key=
"item.id"
...
...
@@ -274,21 +274,21 @@
<div
style=
"width:100%;height: 100%;display: flex;flex-direction: row;justify-content: normal;"
>
<div
style=
"padding-right:6px;"
>
<el-upload
:class=
"['uploadData',
{ 'hiden-dom':
l
ogoImgFileList.length >= 1 }]"
:class=
"['uploadData',
{ 'hiden-dom':
editL
ogoImgFileList.length >= 1 }]"
action="#"
list-type="picture-card"
:limit="1"
:on-exceed="showTip1"
:before-upload = "beforeUpImg"
:http-request="upload
LogoImgs
"
:on-preview="handle
PictureCardPrev
iew"
:on-remove="
handleRemove
"
:file-list = '
l
ogoImgFileList'
:before-upload = "beforeUp
loadLogo
Img"
:http-request="upload
ShopLogoImg
"
:on-preview="handle
EditShopLogoV
iew"
:on-remove="
removeEditShopLogoImg
"
:file-list = '
editL
ogoImgFileList'
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
<el-dialog
:visible
.
sync=
"
dialog
Visible"
append-to-body
>
<img
width=
"100%"
:src=
"
dialogImage
Url"
alt=
""
>
<el-dialog
:visible
.
sync=
"
isEditShopLogo
Visible"
append-to-body
>
<img
width=
"100%"
:src=
"
editShopLogoImg
Url"
alt=
""
>
</el-dialog>
</div>
<div>
...
...
@@ -303,11 +303,11 @@
</el-form-item>
<el-form-item
label=
"运营负责人:"
prop=
"emergency_name"
inline-message=
"true"
>
<el-input
v-model=
"
store
Form.emergency_name"
style=
"width: 400px;"
placeholder=
"请输入运营负责人姓名"
></el-input>
<el-input
v-model=
"
edit
Form.emergency_name"
style=
"width: 400px;"
placeholder=
"请输入运营负责人姓名"
></el-input>
</el-form-item>
<el-form-item
label=
"联系电话:"
prop=
"emergency_tel"
>
<el-input
v-model=
"
store
Form.emergency_tel"
style=
"width: 400px;"
placeholder=
"请输入联系电话"
></el-input>
<el-input
v-model=
"
edit
Form.emergency_tel"
style=
"width: 400px;"
placeholder=
"请输入联系电话"
></el-input>
</el-form-item>
<el-form-item>
...
...
@@ -317,14 +317,14 @@
<el-form-item
label=
"其他资质:"
>
<div
class=
"auth-con"
>
<div
v-for=
"(item,index) in
q
ualificationList"
:key=
"item.id"
class=
"single-upload-con"
>
<div
v-show=
"!item.url"
class=
"single-auth-img"
@
click=
"upPre
Spe
Img(index)"
></div>
<div
v-for=
"(item,index) in
editQ
ualificationList"
:key=
"item.id"
class=
"single-upload-con"
>
<div
v-show=
"!item.url"
class=
"single-auth-img"
@
click=
"upPre
Auth
Img(index)"
></div>
<div
v-show=
"item.url"
class=
"single-auth-img-con"
>
<img
class=
"auth-spec-img"
:src=
"item.url"
alt=
""
/>
<span
class=
"span-img-del-loading"
>
<span
class=
"span-img-del el-icon-zoom-in zoom-span-block"
@
click=
"viewSingle
Spec
Img(index,item)"
></span>
<span
class=
"span-img-del el-icon-delete del-span-block"
@
click=
"delSingle
Spec
Img(index,item)"
></span>
<span
class=
"span-img-del el-icon-zoom-in zoom-span-block"
@
click=
"viewSingle
Auth
Img(index,item)"
></span>
<span
class=
"span-img-del el-icon-delete del-span-block"
@
click=
"delSingle
Auth
Img(index,item)"
></span>
</span>
</div>
<div
class=
"single-title"
>
{{
authTitleFormatter
(
item
.
content
)
}}
</div>
...
...
@@ -343,7 +343,7 @@
</el-form>
</el-dialog>
<!-- 图片预览 -->
<!--
资质
图片预览 -->
<el-dialog
:visible
.
sync=
"imgDialog"
:destroy-on-close=
"true"
...
...
@@ -359,6 +359,7 @@
<
script
>
import
{
getGoodsType
,
getMainInf
,
getShopInf
,
upLoadImg
,
addShopInf
,
getUploadQualificationListData
}
from
'@/api/module/entry'
;
import
{
dateFormat
}
from
'@/utils'
export
default
{
name
:
"Shop"
,
data
()
{
...
...
@@ -440,30 +441,16 @@
imgDialog
:
false
,
// 编辑
isOpen
:
false
,
//-------------------------
dialogVisible
:
false
,
// --------------------
dialogImageUrl2
:
''
,
dialogVisible2
:
false
,
dialogBackImageUrl
:
''
,
dialogBackVisible
:
false
,
logoFileList
:
[],
// 店铺logo
businessFileList
:
[],
// 其他资质
shopRules
:
{},
businessImgFileList
:
[],
editForm
:
{
is_business_experience
:
0
,
is_business_experience
:
''
,
store_name
:
''
,
scope
:
[],
shop_logo
:
''
,
business_auth
:
''
,
emergency_name
:
''
,
emergency_tel
:
''
,
business_auth
:
''
,
},
e
id
tRules
:
{
e
di
tRules
:
{
store_name
:
[{
required
:
true
,
message
:
'店铺名称不能为空'
,
trigger
:
'blur'
}],
scope
:
[{
required
:
true
,
message
:
'经营类目至少选择一种'
,
trigger
:
'change'
}],
shop_logo
:
[{
required
:
true
,
message
:
'店铺Logo至少上传一张图片'
,
validator
:
logoValidator
}],
//
...
...
@@ -474,6 +461,12 @@
],
business_auth
:
[{
required
:
true
,
message
:
'店铺Logo至少上传一张图片'
,
validator
:
busAuthValidator
}],
//
},
// 编辑 店铺logo
editLogoImgFileList
:
[],
isEditShopLogoVisible
:
false
,
editShopLogoImgUrl
:
''
,
// 编辑 资质
editQualificationList
:
[],
}
},
// data end
...
...
@@ -488,12 +481,6 @@
this
.
getShop
();
},
methods
:
{
// 图片只预览
getPreviewImgList
(
ele
)
{
let
arr
=
[];
arr
.
push
(
ele
);
return
arr
;
},
/** 获取 主体即企业 信息 */
getMain
()
{
getMainInf
().
then
(
res
=>
{
...
...
@@ -633,47 +620,13 @@
}
});
},
/** 预览 营业执照 */
handleLicenseImgview
(
file
)
{
this
.
licenseImgUrl
=
file
.
url
;
this
.
isLicenseVisible
=
true
;
},
/** 预览 身份证 正面 */
handleIdcardPositiveImgview
(
file
)
{
this
.
idcardPositiveImgUrl
=
file
.
url
;
this
.
idcardPositiveVisible
=
true
;
},
/** 预览 身份证 反面 */
handleIdcardBackImgview
(
file
)
{
this
.
idcardBackImgUrl
=
file
.
url
;
this
.
idcardBackVisible
=
true
;
},
/** 预览 店铺 logo */
handleShopLogoPreview
(
file
)
{
this
.
shopLogoImgUrl
=
file
.
url
;
this
.
shopLogoVisible
=
true
;
},
/** 预览 当前资质对应图片 */
viewSingleSpecImg
(
index
,
item
)
{
this
.
imgDialog
=
false
;
if
(
!
item
.
url
)
return
;
this
.
imgDialog
=
true
;
this
.
qualificationUrl
=
item
.
url
},
// 修改 店铺信息的 回显数据
showShopInf
()
{
getShopInf
().
then
(
res
=>
{
if
(
res
.
code
===
1
&&
res
.
data
)
{
// 店铺信息修改 start
//this.editForm = res.data;
this
.
editForm
.
scope
=
[];
/** 编辑 */
handleEdit
()
{
getShopInf
().
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
isOpen
=
true
;
this
.
editForm
=
res
.
data
// 经营类目 数据处理
if
(
res
.
data
.
scope
===
''
)
{
this
.
editForm
.
scope
=
[];
}
else
{
...
...
@@ -687,223 +640,121 @@
}
// 店铺logo回显处理
let
logoList
=
{};
let
eidtLogoArr
=
[];
if
(
this
.
editForm
.
shop_logo
.
indexOf
(
","
)
>
0
)
{
eidtLogoArr
=
this
.
editForm
.
shop_logo
.
split
(
","
);
for
(
let
a
=
0
;
a
<
eidtLogoArr
.
length
;
a
++
)
{
logoList
=
{};
logoList
.
url
=
eidtLogoArr
[
a
];
this
.
logoImgFileList
.
push
(
logoList
);
}
}
else
if
(
this
.
editForm
.
shop_logo
)
{
logoList
.
url
=
this
.
editForm
.
shop_logo
;
this
.
logoImgFileList
=
[];
this
.
logoImgFileList
.
push
(
logoList
);
}
else
{
this
.
logoImgFileList
=
[];
let
logoImgArr
=
[];
let
logoImgUrl
=
{};
logoImgArr
=
this
.
editForm
.
shop_logo
.
split
(
","
);
if
(
logoImgArr
.
length
>
0
)
{
logoImgArr
.
forEach
(
item
=>
{
logoImgUrl
=
{};
if
(
item
)
{
logoImgUrl
.
url
=
item
this
.
editLogoImgFileList
.
push
(
logoImgUrl
)
}
});
}
else
{
this
.
editLogoImgFileList
=
[];
}
// 资质图片回显处理
let
businessList
=
{};
let
editBusArr
=
[];
if
(
this
.
editForm
.
business_auth
.
indexOf
(
","
)
>
0
)
{
editBusArr
=
this
.
editForm
.
business_auth
.
split
(
","
);
for
(
let
a
=
0
;
a
<
editBusArr
.
length
;
a
++
)
{
businessList
=
{};
businessList
.
url
=
editBusArr
[
a
];
this
.
businessImgFileList
.
push
(
businessList
);
}
}
else
if
(
this
.
editForm
.
business_auth
)
{
businessList
.
url
=
this
.
editForm
.
business_auth
;
this
.
businessImgFileList
=
[];
this
.
businessImgFileList
.
push
(
businessList
);
}
else
{
this
.
businessImgFileList
=
[];
}
// 店铺信息修改 end
}
else
if
(
res
.
code
===
0
&&
res
.
msg
)
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'error'
});
this
.
editQualificationList
=
this
.
editForm
.
qualification
?
this
.
editForm
.
qualification
:
[];
}
else
{
this
.
$message
({
message
:
"数据有误!"
,
type
:
'error'
});
this
.
$message
({
type
:
'error'
,
message
:
res
.
msg
?
res
.
msg
:
'获取店铺信息失败'
});
}
});
},
/
/ 编辑
handle
Edit
()
{
this
.
isOpen
=
true
;
this
.
showShopInf
()
;
/
** 关闭/取消 编辑 */
handle
Cancel
()
{
this
.
resetEditForm
(
'editForm'
)
;
this
.
isOpen
=
false
;
},
/
/ 保存
/
** 提交审核 */
handleAdd
(
formName
)
{
this
.
$confirm
(
'确定要修改信息吗?信息修改后需要重新提交审核,审核周期约1-3个工作日。'
,
'提示:'
,
{
type
:
'warning'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
}).
then
(()
=>
{
this
.
save
(
formName
);
}).
catch
(()
=>
{
this
.
reset
(
'editForm'
);
});
},
save
(
formName
)
{
let
scoprStr
=
''
;
for
(
let
i
=
0
;
i
<
this
.
editForm
.
scope
.
length
;
i
++
)
{
scoprStr
+=
this
.
editForm
.
scope
[
i
]
+
','
;
}
this
.
editForm
.
scope
=
scoprStr
.
substring
(
0
,
scoprStr
.
length
-
1
);
// shop_logo图片地址字段
if
(
this
.
logoImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
logoImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
editForm
.
shop_logo
=
this
.
logoImgFileList
[
i
].
url
;
}
else
{
this
.
editForm
.
shop_logo
+=
','
+
this
.
logoImgFileList
[
i
].
url
;
// 其他 资质 填写拦截校验
let
isComplete
=
false
;
if
(
this
.
editQualificationList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
editQualificationList
.
length
;
i
++
)
{
if
(
!
this
.
editQualificationList
[
i
].
url
)
{
isComplete
=
true
;
break
}
}
}
// 其他资质图片字段处理
if
(
this
.
businessImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
businessImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
editForm
.
business_auth
=
this
.
businessImgFileList
[
i
].
url
;
}
else
{
this
.
editForm
.
business_auth
+=
','
+
this
.
businessImgFileList
[
i
].
url
;
}
if
(
isComplete
)
{
this
.
$message
({
type
:
'warning'
,
message
:
'请上传对应资质所需的图片'
});
return
;
}
}
// business_auth: '',
let
data
=
{};
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
addShopInf
(
this
.
editForm
).
then
(
res
=>
{
if
(
res
.
code
===
1
)
{
this
.
getShop
();
this
.
$message
({
message
:
'店铺信息修改成功'
,
type
:
'success'
});
this
.
isOpen
=
false
;
}
else
if
(
res
.
code
===
0
&&
res
.
msg
)
{
// 处理 scope数据格式冲突
if
(
this
.
editForm
.
scope
===
''
)
{
this
.
editForm
.
scope
=
[];
}
else
{
let
scopeListStr
=
this
.
editForm
.
scope
.
split
(
','
);
let
scopeList
=
[];
for
(
let
i
=
0
;
i
<
scopeListStr
.
length
;
i
++
)
{
scopeList
.
push
(
parseInt
(
scopeListStr
[
i
]));
}
this
.
editForm
.
scope
=
scopeList
;
data
[
'is_business_experience'
]
=
this
.
editForm
.
is_business_experience
;
data
[
'store_name'
]
=
this
.
editForm
.
store_name
;
data
[
'emergency_name'
]
=
this
.
editForm
.
emergency_name
;
data
[
'emergency_tel'
]
=
this
.
editForm
.
emergency_tel
;
data
[
'scope'
]
=
this
.
editForm
.
scope
.
join
(
','
);
// 编辑 的店铺logolist
if
(
this
.
editLogoImgFileList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
editLogoImgFileList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
data
[
'shop_logo'
]
=
this
.
editLogoImgFileList
[
i
].
url
;
}
else
{
data
[
'shop_logo'
]
+=
','
+
this
.
editLogoImgFileList
[
i
].
url
;
}
if
(
res
.
msg
)
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'error'
});
}
else
{
this
.
$message
({
message
:
"数据开小差了,请稍后重试"
,
type
:
'error'
});
}
}
});
}
else
{
// 因 scope字段是selcet的绑定值,必须为数组类型,但是,在传给后台的时候,是字符串类型,传入的时候需要处理,回显的时候也需要处理
// 在校验时候就产出了这个bug,校验不通过的话,他已经被处理为字符串了,不通过的话,还原格式,不能还原数据
//this.storeForm.scope = [];
if
(
this
.
storeForm
.
scope
===
''
)
{
this
.
storeForm
.
scope
=
[];
}
else
{
let
scopeListStr
=
this
.
storeForm
.
scope
.
split
(
','
);
let
scopeList
=
[];
for
(
let
i
=
0
;
i
<
scopeListStr
.
length
;
i
++
)
{
scopeList
.
push
(
parseInt
(
scopeListStr
[
i
]));
}
this
.
storeForm
.
scope
=
scopeList
;
}
}
});
},
// 取消
handleCancel
()
{
this
.
resetForm
(
'editForm'
);
this
.
isOpen
=
false
;
},
showTip1
(
files
,
fileList
)
{
this
.
$message
({
message
:
'最多上传1张图片'
,
type
:
'warning'
});
data
[
'qualification_auth'
]
=
JSON
.
stringify
(
this
.
editQualificationList
)
this
.
$confirm
(
'确定要修改信息吗?信息修改后需要重新提交审核,审核周期约1-3个工作日'
,
'提示:'
,
{
type
:
'warning'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
}).
then
(()
=>
{
addShopInf
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'编辑成功'
});
this
.
isOpen
=
false
;
this
.
getShop
();
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
'操作失败'
});
}
});
}).
catch
(()
=>
{});
}
// valid true 通过 end
})
},
showTip20
(
files
,
fileList
)
{
this
.
$message
({
message
:
'最多上传20张图片'
,
type
:
'warning'
});
/** 预览 营业执照 */
handleLicenseImgview
(
file
)
{
this
.
licenseImgUrl
=
file
.
url
;
this
.
isLicenseVisible
=
true
;
},
/** 上传 营业执照图片 */
uploadLicenseImages
(
param
)
{
this
.
getBase64
(
param
.
file
).
then
((
res
)
=>
{
let
result
=
res
.
split
(
","
);
this
.
Base64img
=
result
[
1
];
let
data
=
{
"img_data"
:
this
.
Base64img
};
upLoadImg
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
licenseImgFileList
.
push
({
'url'
:
res
.
data
.
image_url
});
this
.
$message
({
type
:
'success'
,
message
:
'上传成功'
});
this
.
$refs
.
mainForm
.
clearValidate
(
'license'
);
// 图片识别
this
.
readLicenseImgInfo
(
this
.
licenseImgFileList
);
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
'上传失败'
});
}
});
});
/** 预览 身份证 正面 */
handleIdcardPositiveImgview
(
file
)
{
this
.
idcardPositiveImgUrl
=
file
.
url
;
this
.
idcardPositiveVisible
=
true
;
},
// handlePictureCardPreview(file) {
// this.dialogImageUrl = file.url;
// this.dialogVisible = true;
// },
handleRemove
(
file
,
fileList
)
{
for
(
let
i
=
0
;
i
<
this
.
licenseImgFileList
.
length
;
i
++
)
{
if
(
file
.
uid
===
this
.
licenseImgFileList
[
i
].
uid
)
{
this
.
licenseImgFileList
.
splice
(
i
,
1
);
}
}
/** 预览 身份证 反面 */
handleIdcardBackImgview
(
file
)
{
this
.
idcardBackImgUrl
=
file
.
url
;
this
.
idcardBackVisible
=
true
;
},
// 上传店铺logo图片
uploadLogoImgs
(
param
)
{
this
.
getBase64
(
param
.
file
).
then
((
res
)
=>
{
let
result
=
res
.
split
(
","
);
this
.
Base64img
=
result
[
1
];
let
data
=
{
"img_data"
:
this
.
Base64img
};
upLoadImg
(
data
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
==
1
)
{
this
.
logoImgFileList
.
push
({
'url'
:
res
.
data
.
image_url
});
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
this
.
$refs
.
storeForm
.
clearValidate
(
'shop_logo'
);
}
});
});
/** 预览 店铺 logo */
handleShopLogoPreview
(
file
)
{
this
.
shopLogoImgUrl
=
file
.
url
;
this
.
shopLogoVisible
=
true
;
},
// 上传资质图片
uploadBusinessImgs
(
param
)
{
this
.
getBase64
(
param
.
file
).
then
((
res
)
=>
{
let
result
=
res
.
split
(
","
);
this
.
Base64img
=
result
[
1
];
let
data
=
{
"img_data"
:
this
.
Base64img
};
upLoadImg
(
data
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
==
1
)
{
this
.
businessImgFileList
.
push
({
'url'
:
res
.
data
.
image_url
});
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
this
.
$refs
.
storeForm
.
clearValidate
(
'business_auth'
);
}
});
});
/** 预览 当前资质对应图片 */
viewSingleSpecImg
(
index
,
item
)
{
this
.
imgDialog
=
false
;
if
(
!
item
.
url
)
return
;
this
.
imgDialog
=
true
;
this
.
qualificationUrl
=
item
.
url
},
/
/ 店铺logo图片上传格式和大小的校验
beforeUpImg
(
file
)
{
/
** 上传 店铺logo 格式和大小的校验 */
beforeUp
loadLogo
Img
(
file
)
{
let
isImgSize
=
(
file
.
size
/
1024
)
>
500
;
if
(
file
.
type
!==
"image/png"
&&
file
.
type
!==
"image/jpg"
&&
file
.
type
!=
"image/jpeg"
)
{
this
.
$message
({
...
...
@@ -920,189 +771,119 @@
return
false
;
}
},
// 其他资质图片上传 校验
// beforeUpBusImg(file) {
// let isImgSize = (file.size / 1024 /1024) > 2;
// if(file.type !== "image/png" && file.type !== "image/jpg" && file.type != "image/jpeg") {
// this.$message({
// message: '上传图片格式只支持png/png格式',
// type: "warning"
// });
// return false;
// }
// if(isImgSize) {
// this.$message({
// message: '上传图片大小不能超过2M',
// type: "warning"
// });
// return false;
// }
// },
// handlePictureCardPreview(file) {
// this.dialogImageUrl = file.url;
// this.dialogVisible = true;
// },
// handleRemove(file,fileList) {
// for(let i = 0; i
<
this
.
logoImgFileList
.
length
;
i
++
)
{
// if(file.uid === this.logoImgFileList[i].uid) {
// this.logoImgFileList.splice(i,1);
// }
// }
// },
/** 上传身份证 正面 */
uploadIdcardPositive
(
param
)
{
/** 上传 店铺logo图片 */
uploadShopLogoImg
(
param
)
{
this
.
getBase64
(
param
.
file
).
then
((
res
)
=>
{
let
result
=
res
.
split
(
","
);
this
.
Base64img
=
result
[
1
];
let
data
=
{
"img_data"
:
this
.
Base64img
};
upLoadImg
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
idcardImgFileList
.
push
({
'url'
:
res
.
data
.
image_url
});
this
.
$message
({
type
:
'success'
,
message
:
'上传成功'
});
this
.
$refs
.
mainForm
.
clearValidate
(
'idcard_front'
);
this
.
readIdcardPositive
(
this
.
idcardImgFileList
);
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
'上传失败'
});
if
(
res
&&
res
.
code
==
1
)
{
this
.
logoImgFileList
.
push
({
'url'
:
res
.
data
.
image_url
});
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
this
.
$refs
.
storeForm
.
clearValidate
(
'shop_logo'
);
}
});
});
},
/** 识别 身份证 正面 */
readIdcardPositive
(
fileList
)
{
if
(
!
Array
.
isArray
(
fileList
)
||
!
fileList
[
0
].
url
)
return
let
data
=
{
img
:
fileList
[
0
].
url
}
getIdcardImgInfoData
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
mainForm
.
real_name
=
res
.
data
.
words_result
[
'姓名'
].
words
?
res
.
data
.
words_result
[
'姓名'
].
words
:
''
;
this
.
mainForm
.
idcard_number
=
res
.
data
.
words_result
[
'公民身份号码'
].
words
?
res
.
data
.
words_result
[
'公民身份号码'
].
words
:
''
;
}
});
/** 编辑 预览 店铺logo 图片 */
handleEditShopLogoView
(
file
)
{
this
.
editShopLogoImgUrl
=
file
.
url
;
this
.
isEditShopLogoVisible
=
true
;
},
// handlePictureCardPreview2(file) {
// this.dialogImageUrl2 = file.url;
// this.dialogVisible2 = true;
// },
handleRemove2
(
file
,
fileList
)
{
for
(
let
i
=
0
;
i
<
this
.
idcardImgFileList
.
length
;
i
++
)
{
if
(
file
.
uid
===
this
.
idcardImgFileList
[
i
].
uid
)
{
this
.
idcardImgFileList
.
splice
(
i
,
1
);
/** 编辑 删除 店铺logo 图片 */
removeEditShopLogoImg
(
file
)
{
for
(
let
i
=
0
;
i
<
this
.
editLogoImgFileList
.
length
;
i
++
)
{
if
(
file
.
uid
===
this
.
editLogoImgFileList
[
i
].
uid
)
{
this
.
editLogoImgFileList
.
splice
(
i
,
1
);
}
}
},
/** 上传身份证 反面 */
uploadIdcardBack
(
param
)
{
this
.
getBase64
(
param
.
file
).
then
((
res
)
=>
{
/** 上传 对应资质图片 */
upPreAuthImg
(
index
)
{
let
domRef
=
"hxz"
+
index
;
this
.
$refs
[
domRef
][
0
].
value
=
''
;
this
.
$refs
[
domRef
][
0
].
click
();
},
/** 真正的上传图片方法,原生input */
changeIMG
(
index
,
item
)
{
let
curItem
=
item
;
let
inputDom
=
"hxz"
+
index
;
let
file
=
this
.
$refs
[
inputDom
][
0
].
files
[
0
];
if
(
file
.
size
>
1024
*
1024
*
3
)
{
this
.
$message
({
type
:
'error'
,
message
:
'规格图片不能大于 3 M'
});
return
;
}
this
.
getBase64
(
file
).
then
((
res
)
=>
{
let
result
=
res
.
split
(
","
);
this
.
Base64img
=
result
[
1
];
let
data
=
{
"img_data"
:
this
.
Base64img
};
upLoadImg
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
idcardBackImgFileList
.
push
({
'url'
:
res
.
data
.
image_url
});
this
.
$message
({
type
:
'success'
,
message
:
'上传成功'
});
this
.
$refs
.
mainForm
.
clearValidate
(
'idcard_back'
);
this
.
readIdcardBack
(
this
.
idcardBackImgFileList
);
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
?
res
.
message
:
'上传失败'
});
}
});
});
},
/** 识别 身份证 反面 */
readIdcardBack
(
fileList
)
{
if
(
!
Array
.
isArray
(
fileList
)
||
!
fileList
[
0
].
url
)
return
let
data
=
{
img
:
fileList
[
0
].
url
}
getIdcardImgInfoData
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
// 身份证 有效 XXXXXXXX日 => xx-xx-xx
let
endStr
=
res
.
data
.
words_result
[
'失效日期'
].
words
?
res
.
data
.
words_result
[
'失效日期'
].
words
:
''
;
if
(
endStr
==
'长期'
)
{
this
.
validityConcreteTime
=
[];
this
.
validityLongTermVal
=
true
;
}
else
{
let
beginStr
=
res
.
data
.
words_result
[
'签发日期'
].
words
?
res
.
data
.
words_result
[
'签发日期'
].
words
:
''
;
let
reg
=
/^
(\d{4})(\d{2})(\d{2})
$/
;
let
begin
=
beginStr
.
replace
(
reg
,
"$1-$2-$3"
);
let
end
=
endStr
.
replace
(
reg
,
"$1-$2-$3"
);
this
.
validityConcreteTime
=
[];
this
.
validityConcreteTime
.
push
(
begin
);
this
.
validityConcreteTime
.
push
(
end
);
this
.
validityLongTermVal
=
false
;
let
data
=
{
"img_data"
:
this
.
Base64img
}
upLoadImg
(
data
).
then
(
res
=>
{
if
(
res
&&
res
.
code
==
1
)
{
curItem
.
url
=
res
.
data
.
image_url
;
// this.singleSpecImgList.push({'url': res.data.image_url})
this
.
$message
({
message
:
'上传成功'
,
type
:
'success'
});
}
else
{
this
.
$message
({
message
:
'上传失败,请重新上传'
,
type
:
'error'
});
}
}
}
)
});
},
/** 预览 身份证反面 */
handleIdcardBackPreview
(
file
)
{
this
.
dialogBackImageUrl
=
file
.
url
;
this
.
dialogBackVisible
=
true
;
},
/** 删除 身份证反面 */
handleBackRemove2
(
file
)
{
for
(
let
i
=
0
;
i
<
this
.
idcardBackImgFileList
.
length
;
i
++
)
{
if
(
file
.
uid
===
this
.
idcardBackImgFileList
[
i
].
uid
)
{
this
.
idcardBackImgFileList
.
splice
(
i
,
1
);
}
}
},
/** 营业期限 选择区间时间时 */
periodLongTermChange
()
{
if
(
Array
.
isArray
(
this
.
periodConcreteTime
)
&&
this
.
periodConcreteTime
.
length
==
2
)
{
this
.
periodLongTermVal
=
false
;
}
},
/** 营业期限 选择 长期时 */
periodConcreteChange
()
{
if
(
this
.
periodLongTermVal
)
{
this
.
periodConcreteTime
=
[];
}
},
/** 身份证有效期 选择区间时间时 */
validityConcreteTimeChange
()
{
if
(
Array
.
isArray
(
this
.
validityConcreteTime
)
&&
this
.
validityConcreteTime
.
length
==
2
)
{
this
.
validityLongTermVal
=
false
;
}
/** 查看 当前资质图片 */
viewSingleAuthImg
(
index
,
item
)
{
this
.
imgDialog
=
false
;
// this.qualificationUrl = "";
if
(
!
item
.
url
)
return
;
this
.
imgDialog
=
true
;
this
.
qualificationUrl
=
item
.
url
},
/** 身份证有效期 选择 长期时 */
validityLongTermValChange
()
{
if
(
this
.
validityLongTermVal
)
{
this
.
validityConcreteTime
=
[];
/** 删除 当前图片 */
delSingleAuthImg
(
index
,
item
)
{
if
(
item
.
url
)
{
item
.
url
=
''
;
this
.
$message
({
type
:
'success'
,
message
:
'删除成功'
});
}
},
/** 删除单个 经营类目 触发 */
removeTag
(
indexVal
)
{
remove
Edit
Tag
(
indexVal
)
{
if
(
!
indexVal
)
return
;
if
(
this
.
store
Form
.
scope
.
length
==
0
)
{
this
.
q
ualificationList
=
[];
if
(
this
.
edit
Form
.
scope
.
length
==
0
)
{
this
.
editQ
ualificationList
=
[];
}
if
(
this
.
store
Form
.
scope
.
length
>
0
)
{
let
data
=
{
cate_ids
:
this
.
store
Form
.
scope
}
if
(
this
.
edit
Form
.
scope
.
length
>
0
)
{
let
data
=
{
cate_ids
:
this
.
edit
Form
.
scope
}
getUploadQualificationListData
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
q
ualificationList
=
res
.
data
?
res
.
data
:
[];
this
.
editQ
ualificationList
=
res
.
data
?
res
.
data
:
[];
}
})
}
},
/** 经营类目 下拉框隐藏时候,触发 */
s
copeVisibleChange
(
handleType
)
{
editS
copeVisibleChange
(
handleType
)
{
if
(
!
handleType
)
{
if
(
Array
.
isArray
(
this
.
storeForm
.
scope
)
&&
this
.
store
Form
.
scope
.
length
>
0
)
{
let
data
=
{
cate_ids
:
this
.
store
Form
.
scope
}
if
(
Array
.
isArray
(
this
.
editForm
.
scope
)
&&
this
.
edit
Form
.
scope
.
length
>
0
)
{
let
data
=
{
cate_ids
:
this
.
edit
Form
.
scope
}
getUploadQualificationListData
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
q
ualificationList
=
res
.
data
?
res
.
data
:
[];
this
.
editQ
ualificationList
=
res
.
data
?
res
.
data
:
[];
}
})
}
}
},
/** 初始化 编辑 表单 */
resetEditForm
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
();
this
.
editQualificationList
=
[];
this
.
editLogoImgFileList
=
[];
},
// 图片转换为base64位
// --- 通用 ---
/** 图片转换为base64位 */
getBase64
(
file
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
let
reader
=
new
FileReader
();
...
...
@@ -1119,34 +900,29 @@
};
});
},
/** 时间戳转换为 标准时间格式 */
formatterTime
(
time
)
{
return
dateFormat
(
time
*
1000
,
'Y-m-d'
)
},
/** 上传图片限制 1张 */
showTip1
()
{
this
.
$message
({
message
:
'最多上传1张图片'
,
type
:
'warning'
});
},
/** 资质类目 title格式化 */
authTitleFormatter
(
textVal
)
{
let
res
=
''
,
resoult
=
''
;
let
res
=
''
;
if
(
textVal
)
{
res
=
textVal
.
trim
();
// if(textVal.left(0) == '《') {
//
// }
// if(textVal.right(0) == '《') {
//
// }
// console.log(111,textVal.left(0));
// console.log(222,textVal.right(0));
}
return
res
},
// /** 图片只预览 */
// getPreviewImgList(ele) {
// let arr = [];
// arr.push(ele);
// return arr;
// },
// 时间戳转换为 标准时间格式
toStandTime
(
val
)
{
let
date
=
new
Date
(
val
*
1000
)
let
Y
=
date
.
getFullYear
()
+
'-'
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'-'
const
D
=
(
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
:
date
.
getDate
())
+
' '
const
h
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
const
m
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
const
s
=
(
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
())
return
Y
+
M
+
D
+
h
+
m
+
s
;
},
}
}
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论