Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
4341627e
提交
4341627e
authored
5月 19, 2022
作者:
yuanyufei
浏览文件
操作
浏览文件
下载
差异文件
上线
上级
90fa9292
2701bc2e
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
2482 行增加
和
13 行删除
+2482
-13
index.js
src/api/module/settings/index.js
+137
-0
supplier.js
src/api/system/supplier.js
+34
-0
wareHouse.js
src/api/system/wareHouse.js
+44
-0
fillBrandInf.vue
src/views/entry/fillBrandInf.vue
+3
-3
fillMainInf.vue
src/views/entry/fillMainInf.vue
+2
-2
fillShopInf.vue
src/views/entry/fillShopInf.vue
+1
-1
goodsinfomation.vue
src/views/system/goods/add/components/goodsinfomation.vue
+2
-2
commodityExpress.vue
src/views/system/settings/commodityExpress.vue
+233
-0
commodityGroup.vue
src/views/system/settings/commodityGroup.vue
+310
-0
commodityUnit.vue
src/views/system/settings/commodityUnit.vue
+468
-0
brand.vue
src/views/system/shop/brand.vue
+4
-4
index.vue
src/views/system/shop/index.vue
+1
-1
suppliers.vue
src/views/system/supplier/suppliers.vue
+556
-0
index.vue
src/views/system/warehouse/index.vue
+687
-0
没有找到文件。
src/api/module/settings/index.js
浏览文件 @
4341627e
...
@@ -43,3 +43,140 @@ export function getEditPayPasswordCode(query) {
...
@@ -43,3 +43,140 @@ export function getEditPayPasswordCode(query) {
params
:
query
params
:
query
})
})
}
}
//获取商品计量单位列表
export
function
goodsUnitList
(
query
){
return
request
({
url
:
'/local/goodsUnit/getList'
,
method
:
'get'
,
params
:
query
})
}
//删除计量单位列表
export
function
delGoodsUnit
(
data
){
return
request
({
url
:
'/local/goodsUnit/del'
,
method
:
'post'
,
data
:
data
})
}
//新增计量单位
export
function
addGoodsUnit
(
data
){
return
request
({
url
:
'/local/goodsUnit/operation'
,
method
:
'post'
,
data
:
data
})
}
// 计量单位编辑
export
function
updateGoodsUnit
(
data
){
return
request
({
url
:
'/local/goodsUnit/info'
,
method
:
'post'
,
data
:
data
})
}
//获取商品单位列表
export
function
getPackList
(
query
){
return
request
({
url
:
'/local/goodsUnit/getPackList'
,
method
:
'get'
,
params
:
query
})
}
//删除包装单位列表
export
function
delPack
(
data
){
return
request
({
url
:
'/local/goodsUnit/delPack'
,
method
:
'post'
,
data
:
data
})
}
//新增包装单位
export
function
addPack
(
data
){
return
request
({
url
:
'/local/goodsUnit/operationPack'
,
method
:
'post'
,
data
:
data
})
}
// 包装单位编辑
export
function
infoPack
(
data
){
return
request
({
url
:
'/local/goodsUnit/infoPack'
,
method
:
'post'
,
data
:
data
})
}
//获取商品物流
export
function
goodsLogistics
(
query
){
return
request
({
url
:
'/local/goodsLogistics/getList'
,
method
:
'get'
,
params
:
query
})
}
//删除快递公司名称
export
function
delGoodsLogistics
(
data
){
return
request
({
url
:
'/local/goodsLogistics/del'
,
method
:
'post'
,
data
:
data
})
}
//新增快递公司
export
function
addGoodsLogistics
(
data
){
return
request
({
url
:
'/local/goodsLogistics/add'
,
method
:
'post'
,
data
:
data
})
}
//获取商品分组列表
export
function
groupList
(
data
){
return
request
({
url
:
'/local/group/list'
,
method
:
'post'
,
data
:
data
})
}
//创建商品分组
export
function
addGroup
(
data
){
return
request
({
url
:
'/local/group/create'
,
method
:
'post'
,
data
:
data
})
}
//编辑商品分组
export
function
updateGroup
(
data
){
return
request
({
url
:
'/local/group/update'
,
method
:
'post'
,
data
:
data
})
}
//编辑商品分组
export
function
GroupInfo
(
data
){
return
request
({
url
:
'/local/group/info'
,
method
:
'post'
,
data
:
data
})
}
//删除商品分组
export
function
deleteGroup
(
data
){
return
request
({
url
:
'/local/group/delete'
,
method
:
'post'
,
data
:
data
})
}
// 获取 所有物流信息
export
function
getExpressListData
(
query
)
{
return
request
({
url
:
'/system/order/expressList'
,
method
:
'get'
,
params
:
query
})
}
src/api/system/supplier.js
0 → 100644
浏览文件 @
4341627e
import
request
from
'@/utils/request'
;
//获取供应商列表
export
function
goodsOperatorList
(
query
)
{
return
request
({
url
:
'/local/goodsOperator/getList'
,
method
:
'get'
,
params
:
query
})
}
//删除供应商
export
function
deleteOperator
(
data
){
return
request
({
url
:
'/local/goodsOperator/del'
,
method
:
'post'
,
data
:
data
})
}
//获取供应商详情
export
function
operatorInfo
(
data
){
return
request
({
url
:
'/local/goodsOperator/info'
,
method
:
'post'
,
data
:
data
})
}
//新增和修改供应商
export
function
updateOperator
(
data
){
return
request
({
url
:
'/local/goodsOperator/operation'
,
method
:
'post'
,
data
:
data
})
}
\ No newline at end of file
src/api/system/wareHouse.js
0 → 100644
浏览文件 @
4341627e
import
request
from
'@/utils/request'
;
//获取仓库列表
export
function
wareHoustList
(
data
){
return
request
({
url
:
'/local/warehouse/list'
,
method
:
'post'
,
data
:
data
})
}
//新增仓库
export
function
addWareHoust
(
data
){
return
request
({
url
:
'/local/warehouse/create'
,
method
:
'post'
,
data
:
data
})
}
//仓库详情
export
function
wareHoustInfo
(
data
){
return
request
({
url
:
'/local/warehouse/info'
,
method
:
'post'
,
data
:
data
})
}
//仓库编辑
export
function
updateWareHoust
(
data
){
return
request
({
url
:
'/local/warehouse/update'
,
method
:
'post'
,
data
:
data
})
}
//仓库删除
export
function
deleteWareHoust
(
data
){
return
request
({
url
:
'/local/warehouse/delete'
,
method
:
'post'
,
data
:
data
})
}
src/views/entry/fillBrandInf.vue
浏览文件 @
4341627e
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
必须与商标图文一致。文件大小在500KB以内,支持png,jpg格式,最多可上传2张
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
品牌方给予企业的授权书。文件大小在2MB以内,支持png,jpg格式
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
授权在云仓平台经营此品牌。文件大小在2MB以内,支持png,jpg格式,最多可上传2张
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
...
src/views/entry/fillMainInf.vue
浏览文件 @
4341627e
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
图片大小
在2MB以内,支持png,jpg格式,最多可上传1张
</span></br>
<span
class=
"tips-text"
>
图片大小
为500KB以内,支持png/jpg,限一张,请确保图片清晰
</span></br>
<span
class=
"tips-text"
>
请确保营业执照在有效期内
</span>
<span
class=
"tips-text"
>
请确保营业执照在有效期内
</span>
</div>
</div>
</div>
</div>
...
@@ -141,7 +141,7 @@
...
@@ -141,7 +141,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
请按顺序分别上传正面(照片面)和反面(国徽面)电子版图片,文件大小在 2MB以内,支持png,jpg格式,最多可上传2张
</span>
<span
class=
"tips-text"
>
图片大小为500KB以内,支持png/jpg,每个上传框限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
<div
class=
"idcard-tips-con"
>
<div
class=
"idcard-tips-con"
>
...
...
src/views/entry/fillShopInf.vue
浏览文件 @
4341627e
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
请上传店铺LOGO,文件大小在500KB以内,支持png,jpg格式,最多可上传1张
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
...
src/views/system/goods/add/components/goodsinfomation.vue
浏览文件 @
4341627e
...
@@ -70,8 +70,8 @@
...
@@ -70,8 +70,8 @@
<el-form-item
label=
"商品图片:"
prop=
"imgs"
>
<el-form-item
label=
"商品图片:"
prop=
"imgs"
>
<span
class=
"tip-span"
style=
"display: block;line-height: 34px;"
>
<span
class=
"tip-span"
style=
"display: block;line-height: 34px;"
>
<i
style=
"margin: 10px;"
>
{{
goodsImgFileList
.
length
}}
/ 7
</i>
<i
style=
"margin: 10px;"
>
{{
goodsImgFileList
.
length
}}
/ 7
</i>
商品图片最多上传7张,默认第一张为主图
商品图片最多上传7张,默认第一张为主图
<span
style=
"margin-left:
20px;"
>
单张图片需限制在2M以内,可上传png、jpg格式,尺寸要求为800 * 800
</span>
<span
style=
"margin-left:
10px;"
>
主图要求为白底,建议尺寸要求为800*800px,拖拽图片可进行排序
</span>
</span>
</span>
<draggable
:list=
"goodsImgFileList"
group=
"article"
class=
"dragArea"
@
end=
"handchange($event)"
>
<draggable
:list=
"goodsImgFileList"
group=
"article"
class=
"dragArea"
@
end=
"handchange($event)"
>
<div
v-for=
"(element,index) in goodsImgFileList"
:key=
"index"
class=
"list-complete-item"
<div
v-for=
"(element,index) in goodsImgFileList"
:key=
"index"
class=
"list-complete-item"
...
...
src/views/system/settings/commodityExpress.vue
0 → 100644
浏览文件 @
4341627e
<
template
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
>
<div
class=
"clearfix"
>
<span
class=
"left-text"
>
常用快递
</span>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"handleAdd()"
style=
"float: right"
size=
"mini"
>
新增
</el-button
>
</div>
<el-table
:data=
"tableData"
:height=
"tableHeight"
style=
"width: 100%"
>
<el-table-column
prop=
"logistics_company_name"
label=
"快递公司"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
style=
"color: red"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-card>
<!-- 新增或修改提示框 -->
<el-dialog
title=
"新增快递公司"
:visible
.
sync=
"dialogVisible"
center
:append-to-body=
"true"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
@
close=
"clearPayform"
width=
"40%"
>
<div
style=
"width: 100%; margin: 50px auto 200px"
>
<el-form
:model=
"addForm"
label-width=
"150px"
center
size=
"mini"
>
<el-form-item
label=
"选择快递公司:"
prop=
"express"
>
<el-select
style=
"width: 80%"
v-model=
"addForm.express"
multiple
placeholder=
"请选择..."
>
<el-option
v-for=
"item in scopeOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.label"
></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogVisible()"
>
确 定
</el-button
>
</span>
</el-dialog>
<!-- 删除弹窗 -->
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogDelete"
center
:close-on-click-modal=
"false"
width=
"30%"
class=
"dialogstyle"
>
<div
style=
"text-align: center; margin: 0 auto"
>
<p>
确定要删除该快递公司吗?
</p>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogDelete = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogDelete()"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
goodsLogistics
,
delGoodsLogistics
,
addGoodsLogistics
,
getExpressListData
,
}
from
"@/api/module/settings"
;
export
default
{
name
:
"commodityExpress"
,
data
()
{
return
{
fullHeight
:
0
,
tableHeight
:
0
,
//表格内容
tableData
:
[],
code
:
0
,
//新增表单内容
addForm
:
{
express
:
[],
},
//新增快递公司下拉框数据
scopeOptions
:
[],
//新增表单弹框
dialogVisible
:
false
,
//删除弹框
dialogDelete
:
false
,
};
},
created
()
{
this
.
$nextTick
(()
=>
{
this
.
fullHeight
=
document
.
getElementsByClassName
(
"box-card"
)[
0
].
clientHeight
;
});
},
watch
:
{
fullHeight
(
val
)
{
let
formHeight
=
document
.
getElementsByClassName
(
"clearfix"
)[
0
].
clientHeight
;
this
.
tableHeight
=
val
-
formHeight
-
100
;
},
},
mounted
()
{
//获取快递公司列表
this
.
getGoodsLogistics
();
},
methods
:
{
//删除分组
handleDelete
(
val
)
{
this
.
code
=
val
.
id
;
this
.
dialogDelete
=
true
;
},
//新增快递公司
handleAdd
()
{
getExpressListData
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
scopeOptions
=
res
.
data
.
expressLists
;
this
.
dialogVisible
=
true
;
}
});
},
//删除提示框
closeDialogDelete
()
{
let
obj
=
{
id
:
this
.
code
,
};
delGoodsLogistics
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"删除成功"
,
type
:
"success"
,
});
this
.
dialogDelete
=
false
;
this
.
getGoodsLogistics
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogDelete
=
false
;
}
});
},
//新增弹框确定回调
closeDialogVisible
()
{
let
obj
=
{
logistics_company
:
this
.
addForm
.
express
,
};
addGoodsLogistics
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"添加成功"
,
type
:
"success"
,
});
this
.
getGoodsLogistics
();
this
.
dialogVisible
=
false
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
},
//获取表格内容
getGoodsLogistics
()
{
goodsLogistics
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
tableData
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
}
});
},
//清空表单内容
clearPayform
()
{
this
.
addForm
.
express
=
""
;
},
},
};
</
script
>
<
style
scoped
>
.app-container
{
overflow
:
auto
;
}
.clearfix
{
margin
:
10px
0
15px
0
;
}
.left-text
{
font-size
:
16px
;
font-family
:
Microsoft
YaHei
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
28px
;
}
</
style
>
\ No newline at end of file
src/views/system/settings/commodityGroup.vue
0 → 100644
浏览文件 @
4341627e
<
template
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
>
<div
class=
"clearfix"
>
<span
class=
"left-text"
>
商品分组
</span>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
style=
"float: right"
@
click=
"handleAdd()"
>
新增
</el-button
>
</div>
<!-- 分组表格 -->
<el-table
:data=
"tableData"
:height=
"tableHeight"
style=
"width: 100%"
>
<el-table-column
prop=
"id"
label=
"分组ID"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"分组名称"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"goods_num"
label=
"商品数量"
>
</el-table-column>
<el-table-column
prop=
"created_time"
label=
"创建时间"
>
<template
slot-scope=
"scope"
>
<div>
{{
timeFormatter
(
scope
.
row
.
created_time
)
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"!scope.row.seller_id == 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleDelete(scope.row)"
style=
"color: red"
>
删除
</el-button>
</div>
<div
v-if=
"scope.row.seller_id == 0"
>
--
</div>
<!--
<el-divider
direction=
"vertical"
></el-divider>
-->
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<!-- <div class="footer_pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[20, 40, 60, 80, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div> -->
</el-card>
<!-- 新增或修改弹窗 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"dialogVisible"
:append-to-body=
"true"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
center
@
close=
"clearPayform"
width=
"40%"
>
<div
style=
"width: 100%; margin: 50px auto 200px"
>
<el-form
:model=
"formInline"
ref=
"formInline"
:rules=
"formInlines"
label-width=
"150px"
size=
"mini"
>
<el-form-item
label=
"分组名称:"
prop=
"name"
>
<el-input
v-model=
"formInline.name"
style=
"width: 80%"
placeholder=
"请输入商品分组名称"
></el-input>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogVisible('formInline')"
>
确 定
</el-button
>
</span>
</el-dialog>
<!-- 删除弹窗 -->
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogDelete"
center
:close-on-click-modal=
"false"
width=
"30%"
>
<div
style=
"text-align: center; margin: 0 auto"
>
<p>
确定要删除该分组吗?删除后,该分组的商品将分配到系统默认分组里面。商品的相关设置及状态保持不变。
</p>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogDelete = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogDelete()"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
groupList
,
addGroup
,
updateGroup
,
GroupInfo
,
deleteGroup
,
}
from
"@/api/module/settings"
;
import
{
dateFormat
}
from
"@/utils"
;
export
default
{
name
:
"commodityGroup"
,
data
()
{
return
{
fullHeight
:
0
,
tableHeight
:
0
,
code
:
0
,
tableData
:
[],
//新增和修改提示框分组名称
formInline
:
{
name
:
""
,
},
//表单验证
formInlines
:
{
name
:
[
{
required
:
true
,
message
:
"分组名称不能为空"
,
trigger
:
"blur"
},
],
},
title
:
""
,
//新增修改提示框
dialogVisible
:
false
,
//删除提示框
dialogDelete
:
false
,
};
},
created
()
{
this
.
$nextTick
(()
=>
{
this
.
fullHeight
=
document
.
getElementsByClassName
(
"box-card"
)[
0
].
clientHeight
;
});
this
.
getGroupList
();
},
watch
:
{
fullHeight
(
val
)
{
let
formHeight
=
document
.
getElementsByClassName
(
"clearfix"
)[
0
].
clientHeight
;
this
.
tableHeight
=
val
-
formHeight
-
100
;
},
},
methods
:
{
//新增分组
handleAdd
()
{
this
.
dialogVisible
=
true
;
this
.
title
=
"新增分组"
;
},
//删除分组
handleDelete
(
val
)
{
this
.
code
=
val
.
id
;
this
.
dialogDelete
=
true
;
},
//编辑分组
handleUpdate
(
val
)
{
this
.
title
=
"编辑分组"
;
this
.
code
=
val
.
id
;
let
obj
=
{
id
:
val
.
id
,
};
GroupInfo
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
formInline
.
name
=
res
.
data
.
name
;
this
.
dialogVisible
=
true
;
}
});
},
//新增或修改弹框确定回调
closeDialogVisible
(
formInline
)
{
this
.
$refs
[
formInline
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
obj
=
{
name
:
this
.
formInline
.
name
,
};
if
(
this
.
title
==
"新增分组"
)
{
addGroup
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
"success"
,
message
:
"添加成功"
,
});
this
.
getGroupList
();
}
else
if
(
res
.
code
==
0
)
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
}
});
}
if
(
this
.
title
==
"编辑分组"
)
{
obj
[
"id"
]
=
this
.
code
;
updateGroup
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
"success"
,
message
:
"编辑成功"
,
});
this
.
getGroupList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
}
});
}
this
.
dialogVisible
=
false
;
}
});
},
//删除提示框
closeDialogDelete
()
{
let
obj
=
{
id
:
this
.
code
,
};
deleteGroup
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
"success"
,
message
:
"删除成功"
,
});
this
.
getGroupList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
}
});
this
.
dialogDelete
=
false
;
},
/** 一般时间 格式化 */
timeFormatter
(
time
)
{
if
(
time
)
{
return
dateFormat
(
time
*
1000
,
"Y-m-d H:i:s"
);
}
else
{
return
"--"
;
}
},
getGroupList
()
{
groupList
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
tableData
=
res
.
data
.
list
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
}
});
},
clearPayform
()
{
this
.
formInline
.
name
=
""
;
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
type=
"text/stylus"
>
.app-container
{
overflow
:
auto
;
}
.clearfix
{
margin
:
10px
0
15px
0
;
}
.left-text
{
font-size
:
16px
;
font-family
:
Microsoft
YaHei
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
28px
;
}
/* 分页 */
.footer_pagination
{
text-align
:
center
;
margin-top
:
15px
;
}
</
style
>
\ No newline at end of file
src/views/system/settings/commodityUnit.vue
0 → 100644
浏览文件 @
4341627e
<
template
>
<div
class=
"app-container"
>
<el-card>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"计量单位"
name=
"first"
></el-tab-pane>
<el-tab-pane
label=
"包装单位"
name=
"second"
></el-tab-pane>
</el-tabs>
</el-card>
<el-card
style=
"margin-top: 15px; height: 725px"
class=
"box-card"
>
<div
v-if=
"activeName == 'first'"
>
<el-button
class=
"clearfix"
type=
"primary"
@
click=
"handleAdd()"
size=
"mini"
icon=
"el-icon-plus"
style=
"margin: 10px 0 20px 0"
>
新增
</el-button
>
<el-table
:data=
"tableData"
:height=
"tableHeight"
style=
"width: 100%"
>
<el-table-column
prop=
"title"
label=
"计量单位名称"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div
v-if=
"!scope.row.seller_id == 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size=
"mini"
type=
"text"
style=
"color: red"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</div>
<div
v-if=
"scope.row.seller_id == 0"
>
--
</div>
</
template
>
</el-table-column>
</el-table>
</div>
<div
v-if=
"activeName == 'second'"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"handleAdd()"
size=
"mini"
style=
"margin: 10px 0 20px 0"
>
新增
</el-button
>
<el-table
:data=
"tableData"
:height=
"tableHeight"
style=
"width: 100%"
>
<el-table-column
prop=
"title"
label=
"包装单位名称"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"!scope.row.seller_id == 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<!--
<el-divider
direction=
"vertical"
></el-divider>
-->
<el-button
size=
"mini"
type=
"text"
style=
"color: red"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</div>
<div
v-if=
"scope.row.seller_id == 0"
>
--
</div>
</
template
>
</el-table-column>
</el-table>
</div>
</el-card>
<!-- 新增或修改提示框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"dialogVisible"
center
:append-to-body=
"true"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
@
close=
"clearPayform"
width=
"40%"
>
<div
style=
"width: 100%; margin: 50px auto 200px"
>
<el-form
:model=
"formInline"
ref=
"formInline"
:rules=
"formInlines"
label-width=
"150px"
size=
"mini"
>
<el-form-item
label=
"计量单位名称:"
prop=
"title"
v-if=
"activeName == 'first'"
>
<el-input
v-model
.
trim=
"formInline.title"
style=
"width: 80%"
placeholder=
"请输入计量单位名称"
></el-input>
</el-form-item>
<el-form-item
label=
"包装单位名称:"
prop=
"title"
v-if=
"activeName == 'second'"
>
<el-input
v-model
.
trim=
"formInline.title"
style=
"width: 80%"
placeholder=
"请输入包装单位名称"
></el-input>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogVisible('formInline')"
>
确 定
</el-button
>
</span>
</el-dialog>
<!-- 删除弹窗 -->
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogDelete"
center
:close-on-click-modal=
"false"
width=
"30%"
>
<div
style=
"text-align: center; margin: 0 auto"
v-if=
"activeName == 'first'"
>
<p>
确定要删除该计量单位吗?删除后将不可用。
</p>
<p>
已使用的商品数据不受影响
</p>
</div>
<div
style=
"text-align: center; margin: 0 auto"
v-if=
"activeName == 'second'"
>
<p>
确定要删除该包装单位吗?删除后将不可用。
</p>
<p>
已使用的商品数据不受影响
</p>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogDelete = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogDelete()"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
goodsUnitList
,
delGoodsUnit
,
addGoodsUnit
,
updateGoodsUnit
,
getPackList
,
delPack
,
addPack
,
infoPack
,
}
from
"@/api/module/settings"
;
export
default
{
name
:
"commodityUnit"
,
data
()
{
return
{
fullHeight
:
0
,
tableHeight
:
0
,
activeName
:
"first"
,
operation
:
1
,
//1 添加 2 修改
code
:
0
,
//计量单位表格内容
tableData
:
[],
//包装单位表格内容
tableDataSecond
:
[],
//新增和修改提示框分组名称
formInline
:
{
id
:
0
,
title
:
""
,
},
//表单验证
formInlines
:
{
title
:
[{
required
:
true
,
message
:
"请输入单位名称"
,
trigger
:
"blur"
}],
},
//新增修改提示框
dialogVisible
:
false
,
//删除提示框
dialogDelete
:
false
,
//弹框提示语
title
:
""
,
};
},
created
()
{
this
.
$nextTick
(()
=>
{
this
.
fullHeight
=
document
.
getElementsByClassName
(
"box-card"
)[
0
].
clientHeight
;
});
this
.
getUnitList
();
},
watch
:
{
fullHeight
(
val
)
{
let
formHeight
=
document
.
getElementsByClassName
(
"clearfix"
)[
0
].
clientHeight
;
this
.
tableHeight
=
val
-
formHeight
-
100
;
},
},
methods
:
{
//标签页切换
handleClick
()
{
if
(
this
.
activeName
==
"first"
)
{
this
.
getUnitList
();
}
else
if
(
this
.
activeName
==
"second"
)
{
this
.
getPackList
();
}
},
//新增分组
handleAdd
()
{
if
(
this
.
activeName
==
"first"
)
{
this
.
title
=
"新增计量单位"
;
this
.
dialogVisible
=
true
;
}
else
if
(
this
.
activeName
==
"second"
)
{
this
.
title
=
"新增包装单位"
;
this
.
dialogVisible
=
true
;
}
},
//删除
handleDelete
(
val
)
{
this
.
dialogDelete
=
true
;
this
.
code
=
val
.
id
;
},
//修改
handleUpdate
(
val
)
{
if
(
this
.
activeName
==
"first"
)
{
this
.
title
=
"编辑计量单位"
;
this
.
code
=
val
.
id
;
let
obj
=
{
id
:
val
.
id
,
};
updateGoodsUnit
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
formInline
.
title
=
res
.
data
.
title
;
this
.
formInline
.
id
=
res
.
data
.
id
;
this
.
dialogVisible
=
true
;
}
});
}
else
if
(
this
.
activeName
==
"second"
)
{
this
.
title
=
"编辑包装单位"
;
this
.
code
=
val
.
id
;
let
obj
=
{
id
:
val
.
id
,
};
infoPack
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
formInline
.
title
=
res
.
data
.
title
;
this
.
formInline
.
id
=
res
.
data
.
id
;
this
.
dialogVisible
=
true
;
}
});
}
},
//新增或修改确定回调
closeDialogVisible
(
formInline
)
{
this
.
$refs
[
formInline
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
activeName
==
"first"
)
{
if
(
this
.
formInline
.
id
==
0
)
{
this
.
operation
=
1
;
let
obj
=
{
title
:
this
.
formInline
.
title
,
operation
:
this
.
operation
,
};
addGoodsUnit
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"添加成功"
,
type
:
"success"
,
});
this
.
dialogVisible
=
false
;
this
.
getUnitList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
}
else
{
this
.
operation
=
2
;
let
obj
=
{
title
:
this
.
formInline
.
title
,
id
:
this
.
code
,
operation
:
this
.
operation
,
};
addGoodsUnit
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"编辑成功"
,
type
:
"success"
,
});
this
.
dialogVisible
=
false
;
this
.
getUnitList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
}
}
else
if
(
this
.
activeName
==
"second"
)
{
if
(
this
.
formInline
.
id
==
0
)
{
this
.
operation
=
1
;
let
obj
=
{
title
:
this
.
formInline
.
title
,
operation
:
this
.
operation
,
};
addPack
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"添加成功"
,
type
:
"success"
,
});
this
.
dialogVisible
=
false
;
this
.
getPackList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
}
else
{
this
.
operation
=
2
;
let
obj
=
{
title
:
this
.
formInline
.
title
,
id
:
this
.
code
,
operation
:
this
.
operation
,
};
addPack
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"编辑成功"
,
type
:
"success"
,
});
this
.
dialogVisible
=
false
;
this
.
getPackList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
}
}
}
});
},
//删除提示框
closeDialogDelete
()
{
if
(
this
.
activeName
==
"first"
)
{
let
obj
=
{
id
:
this
.
code
,
};
delGoodsUnit
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"删除成功"
,
type
:
"success"
,
});
this
.
dialogDelete
=
false
;
this
.
getUnitList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogDelete
=
false
;
}
});
}
else
if
(
this
.
activeName
==
"second"
)
{
let
obj
=
{
id
:
this
.
code
,
};
delPack
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"删除成功"
,
type
:
"success"
,
});
this
.
dialogDelete
=
false
;
this
.
getPackList
();
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogDelete
=
false
;
}
});
}
},
//获取计量表格数据
getUnitList
()
{
goodsUnitList
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
tableData
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
}
});
},
// 获取包装表格数据
getPackList
()
{
getPackList
().
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
tableData
=
res
.
data
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
}
});
},
// 清除表单信息
clearPayform
()
{
this
.
formInline
.
title
=
""
;
this
.
formInline
.
id
=
0
;
},
},
};
</
script
>
<
style
scoped
>
.app-container
{
overflow
:
auto
;
}
::v-deep
.el-tabs__item
{
font-size
:
16px
;
font-family
:
Microsoft
YaHei
;
font-weight
:
bold
;
}
::v-deep
.el-tabs__header
{
margin
:
0
;
}
</
style
>
\ No newline at end of file
src/views/system/shop/brand.vue
浏览文件 @
4341627e
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
必须与商标图文一致。文件大小在500KB以内,支持png,jpg格式,最多可上传1张
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
请提供有效期内的商标注册证,保持信息清晰可见,支持png,jpg格式,最多可上传1张
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -270,7 +270,7 @@
...
@@ -270,7 +270,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
授权在云仓平台经营此品牌,支持png,jpg格式,文件大小在2MB以内
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
<p
class=
"brand-auth-tips"
>
上传完整授权链路,品牌方给予企业的授权书,如果是多级授权,请上传各级授权证书
</p>
<p
class=
"brand-auth-tips"
>
上传完整授权链路,品牌方给予企业的授权书,如果是多级授权,请上传各级授权证书
</p>
...
@@ -305,7 +305,7 @@
...
@@ -305,7 +305,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
授权在云仓平台经营此品牌,支持png,jpg格式
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
...
src/views/system/shop/index.vue
浏览文件 @
4341627e
...
@@ -301,7 +301,7 @@
...
@@ -301,7 +301,7 @@
</span>
</span>
</div>
</div>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<div
style=
"width:380px;line-height: 24px;padding-top: 6px;"
>
<span
class=
"tips-text"
>
请上传店铺LOGO,文件大小在500KB以内,支持png,jpg格式,最多可上传1张
</span>
<span
class=
"tips-text"
>
图片大小在500KB以内,支持png/jpg,限一张,请确保图片清晰
</span>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
...
src/views/system/supplier/suppliers.vue
0 → 100644
浏览文件 @
4341627e
<
template
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
>
<div
class=
"clearfix"
>
<span
class=
"left-text"
>
我的供应商
</span>
<el-button
type=
"primary"
size=
"mini"
icon=
"el-icon-plus"
style=
"float: right"
@
click=
"handleAdd()"
>
新增
</el-button
>
</div>
<!-- 分组表格 -->
<el-table
:data=
"tableData"
:height=
"tableHeight"
stripe
style=
"width: 100%"
>
<el-table-column
prop=
"title"
label=
"供货商名称"
>
</el-table-column>
<el-table-column
prop=
"operator_num"
label=
"供应商编号"
>
</el-table-column>
<!--
<el-table-column
prop=
"category_name"
label=
"行业"
>
</el-table-column>
-->
<el-table-column
prop=
"contacts"
label=
"联系人"
>
</el-table-column>
<el-table-column
prop=
"contacts_phone"
label=
"联系电话"
>
</el-table-column>
<el-table-column
prop=
"end_time"
label=
"终止时间"
width=
"180px"
>
<template
slot-scope=
"scope"
>
<div>
{{
timeFormatter
(
scope
.
row
.
end_time
)
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
>
<
template
slot-scope=
"scope"
>
<div
class=
"dotColorGreen"
v-if=
"scope.row.status == 0"
></div>
<div
class=
"dotColorRed"
v-if=
"scope.row.status == 1"
></div>
{{
statusFormatter
(
scope
.
row
.
status
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleDelete(scope.row)"
style=
"color: red"
>
删除
</el-button>
<!--
<el-divider
direction=
"vertical"
></el-divider>
-->
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<div
class=
"footer_pagination"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[20, 40, 60, 80, 100]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</el-card>
<!-- 新增或修改提示框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"dialogVisible"
center
:append-to-body=
"true"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
@
close=
"clearPayform"
width=
"40%"
>
<div
style=
"width: 100%; margin: 0 auto"
>
<el-form
:model=
"editForm"
ref=
"editForms"
:rules=
"editFormRules"
:label-position=
"labelPosition"
label-width=
"150px"
center
size=
"mini"
>
<el-form-item
label=
"供应商名称:"
prop=
"title"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.title"
style=
"width: 80%"
placeholder=
"请输入供应商名称"
></el-input>
</el-form-item>
<!-- <el-form-item label="所属行业:" :rules="[{required: true,message:'请输入内容',trigger:'blur'}]">
<el-cascader
v-model="category"
:props="propsOptions"
style="width: 80%"
@expand-change="getOpen"
@change="closeCascader"
ref="ssqCascader"
></el-cascader>
</el-form-item> -->
<el-form-item
label=
"联系人:"
prop=
"contacts"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.contacts"
style=
"width: 80%"
placeholder=
"请输入供应商联系人"
></el-input>
</el-form-item>
<el-form-item
label=
"联系电话:"
prop=
"contacts_phone"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.contacts_phone"
style=
"width: 80%"
placeholder=
"请输入供应商联系电话"
></el-input>
</el-form-item>
<el-form-item
label=
"终止时间:"
prop=
"end_time"
inline-message=
"true"
>
<el-date-picker
v-model=
"editForm.end_time"
type=
"datetime"
style=
"width: 80%"
unaLink-panels
value-format=
"timestamp"
placeholder=
"选择日期"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"状态:"
prop=
"status"
inline-message=
"true"
>
<el-radio-group
v-model=
"editForm.status"
>
<el-radio
:label=
"0"
>
启用
</el-radio>
<el-radio
:label=
"1"
>
停用
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogVisible('editForms')"
>
提交
</el-button
>
</span>
</el-dialog>
<!-- 删除弹窗 -->
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogDelete"
center
:close-on-click-modal=
"false"
width=
"30%"
>
<div
style=
"text-align: center; margin: 0 auto"
>
<p>
确定要删除该供应商吗?删除后,将无法与商品对应
</p>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogDelete = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogDelete()"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
NewGetCategoryData
}
from
"@/api/module/goods"
;
import
{
goodsOperatorList
,
deleteOperator
,
operatorInfo
,
updateOperator
,
}
from
"@/api/system/supplier"
;
import
{
dateFormat
}
from
"@/utils"
;
export
default
{
name
:
"supplier"
,
data
()
{
// 手机号码格式校验
let
checkTel
=
(
rule
,
value
,
callback
)
=>
{
const
reg
=
/^1
[
3456789
]\d{9}
$/
;
if
(
value
===
""
)
{
callback
(
new
Error
(
"手机号码不能为空"
));
}
else
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
"手机号码格式不对,请重新输入"
));
}
else
{
callback
();
}
};
return
{
fullHeight
:
0
,
tableHeight
:
0
,
total
:
0
,
currentPage
:
1
,
pageSize
:
20
,
code
:
0
,
//删除的供应商id
tableData
:
[],
labelPosition
:
"right"
,
//新增和修改提示语
title
:
""
,
operation
:
1
,
//1添加 2 修改
category
:
[],
//表单行业数据
//新增表单内容
editForm
:
{
title
:
""
,
//供应商名称
contacts
:
""
,
//联系人
contacts_phone
:
""
,
//联系电话
end_time
:
""
,
//终止时间
status
:
0
,
//状态
},
//表单验证
editFormRules
:
{
title
:
[
{
required
:
true
,
message
:
"请输入供应商名称"
,
trigger
:
"blur"
},
],
contacts
:
[
{
required
:
true
,
message
:
"请输入联系人"
,
trigger
:
"blur"
},
],
contacts_phone
:
[
{
required
:
true
,
validator
:
checkTel
,
trigger
:
"blur"
},
],
end_time
:
[
{
required
:
true
,
message
:
"请输入终止时间"
,
trigger
:
"blur"
},
],
status
:
[
{
required
:
true
,
message
:
"供应商名称不能为空"
,
trigger
:
"blur"
},
],
},
// 所属行业下拉框
propsOptions
:
{
expandTrigger
:
"click"
,
lazy
:
true
,
checkStrictly
:
true
,
// 父子不想关联
lazyLoad
:
this
.
lazyLoad
,
value
:
"id"
,
label
:
"title"
,
leaf
:
"leaf"
,
},
jobList
:
[],
isOpen
:
false
,
arrList
:
[],
//新增表单弹框
dialogVisible
:
false
,
//删除弹框
dialogDelete
:
false
,
};
},
created
()
{
this
.
$nextTick
(()
=>
{
this
.
fullHeight
=
document
.
getElementsByClassName
(
"box-card"
)[
0
].
clientHeight
;
});
this
.
getGoodsOperatorList
();
},
watch
:
{
fullHeight
(
val
)
{
let
formHeight
=
document
.
getElementsByClassName
(
"clearfix"
)[
0
].
clientHeight
;
this
.
tableHeight
=
val
-
formHeight
-
120
;
},
},
methods
:
{
//新增分组
handleAdd
()
{
this
.
editForm
.
title
=
""
;
this
.
editForm
.
contacts
=
""
;
this
.
editForm
.
contacts_phone
=
""
;
this
.
editForm
.
end_time
=
""
;
this
.
editForm
.
status
=
0
;
this
.
dialogVisible
=
true
;
this
.
title
=
"新增供应商"
;
this
.
operation
=
1
;
},
//删除分组
handleDelete
(
val
)
{
this
.
code
=
val
.
id
;
this
.
dialogDelete
=
true
;
},
//修改分组
handleUpdate
(
val
)
{
this
.
title
=
"编辑供应商"
;
this
.
operation
=
2
;
this
.
code
=
val
.
id
;
let
obj
=
{
id
:
val
.
id
,
};
operatorInfo
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
editForm
=
res
.
data
;
this
.
editForm
.
end_time
=
res
.
data
.
end_time
*
1000
;
this
.
dialogVisible
=
true
;
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
}
});
},
//删除提示框
closeDialogDelete
()
{
let
obj
=
{
id
:
this
.
code
,
};
deleteOperator
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
getGoodsOperatorList
();
this
.
$message
({
type
:
"success"
,
message
:
"删除成功"
,
});
this
.
dialogDelete
=
false
;
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
this
.
dialogDelete
=
false
;
}
});
},
//新增或修改弹框确定回调
closeDialogVisible
(
editForms
)
{
// let ssqLabelList = this.$refs["ssqCascader"].getCheckedNodes()[0];
this
.
$refs
[
editForms
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
obj
=
{};
obj
[
"operation"
]
=
this
.
operation
;
// obj["category_id"] = ssqLabelList.data.id;
// obj["category_name"] = ssqLabelList.data.title;
obj
[
"title"
]
=
this
.
editForm
.
title
;
obj
[
"contacts"
]
=
this
.
editForm
.
contacts
;
obj
[
"contacts_phone"
]
=
this
.
editForm
.
contacts_phone
;
obj
[
"end_time"
]
=
new
Date
(
this
.
editForm
.
end_time
).
getTime
()
/
1000
;
obj
[
"status"
]
=
this
.
editForm
.
status
;
if
(
this
.
title
==
"新增供应商"
)
{
updateOperator
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
"success"
,
message
:
"添加成功"
,
});
this
.
getGoodsOperatorList
();
this
.
dialogVisible
=
false
;
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
this
.
dialogVisible
=
false
;
}
});
}
else
if
(
this
.
title
==
"编辑供应商"
)
{
obj
[
"id"
]
=
this
.
code
;
updateOperator
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
type
:
"success"
,
message
:
"编辑成功"
,
});
this
.
getGoodsOperatorList
();
this
.
dialogVisible
=
false
;
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
this
.
dialogVisible
=
false
;
}
});
}
}
else
{
return
false
;
}
});
},
//级联菜单懒加载
// getOpen(val) {
// if (this.isOpen) {
// this.arrList.push(val);
// }
// this.category = val;
// try {
// this.arrList.forEach((item) => {
// if (item[1] == val[1]) {
// throw new Error("End Loop");
// } else {
// }
// });
// } catch {}
// },
// lazyLoad(node, resolve) {
// this.category = [];
// this.getArea(node, resolve);
// },
// getArea(node, resolve) {
// const level = node.level;
// let limboNode = {};
// if (level === 0) {
// limboNode = { parent_id: 0 };
// }
// if (level === 1) {
// limboNode = { parent_id: node.value };
// }
// if (level === 2) {
// limboNode = { parent_id: node.value };
// }
// NewGetCategoryData(limboNode).then((res) => {
// let result = {};
// result = res.data;
// if (level === 0) {
// result.forEach((item) => {
// item.value = item.id;
// item.label = item.label;
// item.children = [];
// item.leaf = 0; // 可以控制 是否有下级 值为true都不行,必须等于0
// });
// }
// if (level === 1) {
// for (let i = 0; i
<
res
.
data
.
length
;
i
++
)
{
// if (limboNode.id === res.data[i].id) {
// result = res.data[i].children;
// break;
// }
// }
// result.forEach((item) => {
// item.value = item.id;
// item.label = item.label;
// item.children = [];
// //这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上
// item.leaf = 0;
// });
// }
// if (level === 2) {
// for (let i = 0; i
<
res
.
data
.
length
;
i
++
)
{
// if (limboNode.id === res.data[i].id) {
// result = res.data[i].children;
// break;
// }
// }
// if (res.data.length == 0) {
// this.isOpen = true;
// } else {
// this.isOpen = false;
// result.forEach((item) => {
// item.value = item.id;
// item.label = item.label;
// item.leaf = 1;
// });
// }
// }
// resolve(result);
// });
// },
//分页查询
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
;
this
.
getGoodsOperatorList
();
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
;
this
.
getGoodsOperatorList
();
},
/** 一般时间 格式化 */
timeFormatter
(
time
)
{
if
(
time
)
{
return
dateFormat
(
time
*
1000
,
"Y-m-d H:i:s"
);
}
else
{
return
"--"
;
}
},
statusFormatter
(
val
)
{
if
(
val
==
0
)
{
return
"正常"
;
}
else
if
(
val
==
1
)
{
return
"停用"
;
}
},
//获取列表
getGoodsOperatorList
()
{
let
obj
=
{
page
:
this
.
currentPage
,
limit
:
this
.
pageSize
,
};
goodsOperatorList
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
total
=
res
.
data
.
count
;
this
.
tableData
=
res
.
data
.
list
;
}
});
},
// 清除表单验证
clearPayform
()
{
this
.
editForm
.
title
=
""
;
this
.
editForm
.
category_name
=
""
;
this
.
editForm
.
contacts
=
""
;
this
.
editForm
.
contacts_phone
=
""
;
this
.
editForm
.
end_time
=
""
;
this
.
editForm
.
status
=
0
;
},
//级联菜单选中后自动关闭
closeCascader
()
{
this
.
$refs
.
ssqCascader
.
dropDownVisible
=
false
;
},
},
};
</
script
>
<
style
scoped
>
.dotColorGreen
{
display
:
inline-block
;
width
:
6px
;
height
:
6px
;
background
:
#23c58f
;
border-radius
:
50%
;
}
.dotColorRed
{
display
:
inline-block
;
width
:
6px
;
height
:
6px
;
background
:
#f14e4e
;
border-radius
:
50%
;
}
.clearfix
{
margin
:
8px
0
20px
0
;
}
.left-text
{
font-size
:
16px
;
font-family
:
Microsoft
YaHei
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
28px
;
}
/* 分页 */
.footer_pagination
{
text-align
:
center
;
margin-top
:
15px
;
}
</
style
>
\ No newline at end of file
src/views/system/warehouse/index.vue
0 → 100644
浏览文件 @
4341627e
<
template
>
<div
class=
"app-container"
>
<el-card
style=
"margin-bottom: 15px"
>
<div
slot=
"header"
>
<span
class=
"left-text"
>
仓库管理
</span>
</div>
<div
class=
"clearfix"
>
<!-- 表单 -->
<el-form
:inline=
"true"
:model=
"formInline"
label-width=
"100px"
class=
"demo-form-inline"
size=
"mini"
>
<el-form-item
label=
"仓库名称:"
>
<el-input
v-model
.
trim=
"formInline.name"
placeholder=
"请输入仓库名称"
></el-input>
</el-form-item>
<el-form-item
label=
"启用状态:"
>
<el-select
v-model=
"formInline.status"
placeholder=
"请选择"
style=
"width: 260px"
>
<el-option
label=
"启用"
value=
"1"
></el-option>
<el-option
label=
"停用"
value=
"0"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"仓库编码:"
>
<el-input
v-model
.
trim=
"formInline.code"
style=
"width: 260px"
placeholder=
"请输入仓库编码"
></el-input>
</el-form-item>
<el-form-item
label=
"联系电话:"
>
<el-input
v-model
.
trim=
"formInline.contact_tel"
style=
"width: 260px"
placeholder=
"请输入联系电话"
></el-input>
</el-form-item>
<el-form-item
label=
"联系人:"
>
<el-input
v-model
.
trim=
"formInline.contact_name"
style=
"width: 260px"
placeholder=
"请输入联系人"
></el-input>
</el-form-item>
<el-form-item
style=
"margin-left: 20px"
>
<el-button
type=
"primary"
@
click=
"onSubmit"
size=
"mini"
>
查询
</el-button
>
<el-button
@
click=
"reset"
icon=
"el-icon-refresh-right"
size=
"mini"
>
重置
</el-button
>
<el-button
type=
"primary"
@
click=
"handleAdd()"
size=
"mini"
>
添加仓库
</el-button
>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card>
<!-- 表格 -->
<el-table
:data=
"tableData"
:height=
"tableHeight"
stripe
style=
"width: 100%"
>
<el-table-column
prop=
"code"
label=
"仓库编码"
width=
"90px"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"仓库名称"
>
</el-table-column>
<el-table-column
prop=
"contact_name"
label=
"联系人"
>
</el-table-column>
<el-table-column
prop=
"contact_tel"
label=
"联系电话"
width=
"110px"
>
</el-table-column>
<el-table-column
label=
"地区"
width=
"200px"
>
<template
slot-scope=
"scope"
>
<div>
{{
scope
.
row
.
province
+
scope
.
row
.
city
+
scope
.
row
.
district
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"address"
label=
"仓库地址"
>
</el-table-column>
<el-table-column
label=
"仓库面积"
>
<
template
slot-scope=
"scope"
>
<div>
{{
scope
.
row
.
warehouse_area
}}
m²
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"默认发货仓"
>
<
template
slot-scope=
"scope"
>
<div>
{{
isDefaulu
(
scope
.
row
.
is_default_send
)
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"默认收货仓"
>
<
template
slot-scope=
"scope"
>
<div>
{{
isDefaulu
(
scope
.
row
.
is_default_get
)
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"启用状态"
width=
"110px"
>
<
template
slot-scope=
"scope"
>
<el-switch
@
change=
"change(scope.row)"
v-model=
"scope.row.status"
active-color=
"#13ce66"
inactive-color=
"#ff4949"
:active-value=
"1"
:inactive-value=
"0"
>
</el-switch>
<span
v-if=
"scope.row.status == 1"
style=
"color: #13ce66"
>
已启用
</span
>
<span
v-if=
"scope.row.status == 0"
>
已停用
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"address"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size=
"mini"
type=
"text"
@
click=
"handleDelete(scope.row)"
style=
"color: red"
>
删除
</el-button>
<!--
<el-divider
direction=
"vertical"
></el-divider>
-->
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<div
class=
"footer_pagination"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-sizes=
"[20, 40, 60, 80, 100]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</el-card>
<!-- 新增或修改弹窗 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"dialogVisible"
center
v-loading=
"loading"
:append-to-body=
"true"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
:before-close=
"clearData"
width=
"40%"
>
<div
style=
"width: 100%; margin: 0 auto"
>
<el-form
v-if=
"dialogVisible"
:model=
"editForm"
ref=
"editForms"
:rules=
"editFormRules"
:label-position=
"labelPosition"
label-width=
"150px"
size=
"mini"
>
<el-form-item
label=
"仓库名称:"
prop=
"name"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.name"
style=
"width: 80%"
placeholder=
"请输入仓库名称"
></el-input>
</el-form-item>
<el-form-item
label=
"联系人:"
prop=
"contact_name"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.contact_name"
style=
"width: 80%"
placeholder=
"请输入联系人姓名"
></el-input>
</el-form-item>
<el-form-item
label=
"联系电话:"
prop=
"contact_tel"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.contact_tel"
style=
"width: 80%"
placeholder=
"请输入联系电话"
></el-input>
</el-form-item>
<el-form-item
label=
"地区:"
:rules=
"[
{ required: true, message: '请选择地区', trigger: 'blur' },
]"
>
<el-cascader
v-model=
"areaList"
:props=
"props"
@
change=
"handleChanges"
placeholder=
"请选择具体的省市区"
style=
"width: 80%"
></el-cascader>
</el-form-item>
<el-form-item
label=
"仓库地址:"
prop=
"address"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.address"
style=
"width: 80%"
placeholder=
"请输入仓库详细地址"
></el-input>
</el-form-item>
<el-form-item
label=
"仓库面积:"
prop=
"warehouse_area"
inline-message=
"true"
>
<el-input
v-model
.
trim=
"editForm.warehouse_area"
style=
"width: 80%"
placeholder=
"请输入仓库面积(单位:m²)"
></el-input>
</el-form-item>
<el-form-item
label=
"默认发货仓:"
prop=
"is_default_send"
inline-message=
"true"
>
<el-radio-group
v-model=
"editForm.is_default_send"
>
<el-radio
:label=
"1"
>
是
</el-radio>
<el-radio
:label=
"0"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"默认收货仓:"
prop=
"is_default_get"
inline-message=
"true"
>
<el-radio-group
v-model=
"editForm.is_default_get"
>
<el-radio
:label=
"1"
>
是
</el-radio>
<el-radio
:label=
"0"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"启用状态:"
prop=
"status"
inline-message=
"true"
>
<el-radio-group
v-model=
"editForm.status"
>
<el-radio
:label=
"1"
>
启用
</el-radio>
<el-radio
:label=
"0"
>
停用
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"clearData"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogVisible('editForms')"
>
提交
</el-button
>
</span>
</el-dialog>
<!-- 删除弹窗 -->
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogDelete"
center
:close-on-click-modal=
"false"
width=
"30%"
>
<div
style=
"text-align: center; margin: 0 auto"
>
<p>
确定要删除仓库吗?删除后添加商品时将不可用
</p>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogDelete = false"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"closeDialogDelete()"
>
确 定
</el-button
>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
getAreaList
}
from
"@/api/module/retreat/address"
;
import
{
wareHoustList
,
addWareHoust
,
wareHoustInfo
,
updateWareHoust
,
deleteWareHoust
,
}
from
"@/api/system/wareHouse"
;
export
default
{
name
:
"wareHouse"
,
data
()
{
// 手机号码格式校验
let
checkTel
=
(
rule
,
value
,
callback
)
=>
{
const
reg
=
/^1
[
3456789
]\d{9}
$/
;
if
(
value
===
""
)
{
callback
(
new
Error
(
"手机号码不能为空"
));
}
else
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
"手机号码格式不对,请重新输入"
));
}
else
{
callback
();
}
};
// 面积格式校验
let
checkware
=
(
rule
,
value
,
callback
)
=>
{
const
reg
=
/^
[
0-9
]
+
(\.[
0-9
]{1,2})?
$/
;
if
(
value
===
""
)
{
callback
(
new
Error
(
"仓库面积不能为空"
));
}
else
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
"格式不对或只能保留两位小数"
));
}
else
{
callback
();
}
};
return
{
loading
:
false
,
fullHeight
:
0
,
tableHeight
:
0
,
total
:
0
,
currentPage
:
1
,
pageSize
:
20
,
code
:
0
,
//控制启用状态展示
exhibition
:
true
,
tableData
:
[],
labelPosition
:
"right"
,
// 所属地区下拉框
props
:
{
expandTrigger
:
"click"
,
lazy
:
true
,
lazyLoad
:
this
.
lazyLoad
,
value
:
"id"
,
label
:
"name"
,
leaf
:
"leaf"
,
},
areaList
:
[],
//搜索表单内容
formInline
:
{
name
:
""
,
status
:
""
,
code
:
""
,
contact_tel
:
""
,
contact_name
:
""
,
},
//新增表单内容
editForm
:
{
name
:
""
,
contact_name
:
""
,
contact_tel
:
""
,
address
:
""
,
warehouse_area
:
""
,
is_default_send
:
1
,
is_default_get
:
1
,
status
:
1
,
},
//表单验证
editFormRules
:
{
name
:
[{
required
:
true
,
message
:
"请输入仓库名称"
,
trigger
:
"blur"
}],
contact_name
:
[
{
required
:
true
,
message
:
"请输入联系人姓名"
,
trigger
:
"blur"
},
],
contact_tel
:
[{
required
:
true
,
validator
:
checkTel
,
trigger
:
"blur"
}],
address
:
[
{
required
:
true
,
message
:
"请输入仓库地址"
,
trigger
:
"blur"
},
],
warehouse_area
:
[
{
required
:
true
,
validator
:
checkware
,
trigger
:
"blur"
},
],
is_default_send
:
[
{
required
:
true
,
message
:
"请选择"
,
trigger
:
"blur"
},
],
is_default_get
:
[
{
required
:
true
,
message
:
"请选择"
,
trigger
:
"blur"
},
],
status
:
[{
required
:
true
,
message
:
"请选择"
,
trigger
:
"blur"
}],
},
title
:
""
,
//新增修改提示框
dialogVisible
:
false
,
//删除提示框
dialogDelete
:
false
,
};
},
created
()
{
this
.
$nextTick
(()
=>
{
this
.
fullHeight
=
document
.
getElementsByClassName
(
"app-container"
)[
0
].
clientHeight
;
});
this
.
getWareHoustList
();
},
watch
:
{
fullHeight
(
val
)
{
let
formHeight
=
document
.
getElementsByClassName
(
"clearfix"
)[
0
].
clientHeight
;
this
.
tableHeight
=
val
-
formHeight
-
225
;
},
},
methods
:
{
// 开关已停用和已启用
change
(
val
)
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
val
));
updateWareHoust
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
getWareHoustList
();
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
}
});
},
//新增分组
handleAdd
()
{
this
.
dialogVisible
=
true
;
this
.
title
=
"新增仓库"
;
this
.
editForm
.
name
=
""
;
this
.
editForm
.
contact_name
=
""
;
this
.
editForm
.
contact_tel
=
""
;
this
.
editForm
.
address
=
""
;
this
.
editForm
.
warehouse_area
=
""
;
this
.
editForm
.
is_default_send
=
1
;
this
.
editForm
.
is_default_get
=
1
;
this
.
editForm
.
status
=
1
;
this
.
areaList
=
[];
},
//删除分组
handleDelete
(
val
)
{
this
.
dialogDelete
=
true
;
this
.
code
=
val
.
id
;
},
//点击编辑按钮
handleUpdate
(
val
)
{
this
.
loading
=
true
;
this
.
title
=
"编辑仓库"
;
let
obj
=
{
id
:
val
.
id
,
};
wareHoustInfo
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
editForm
=
res
.
data
;
this
.
areaList
.
push
(
res
.
data
.
province_id
);
this
.
areaList
.
push
(
res
.
data
.
city_id
);
this
.
areaList
.
push
(
res
.
data
.
district_id
);
this
.
dialogVisible
=
true
;
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
,
});
}
this
.
loading
=
false
;
});
},
//查询
onSubmit
()
{
this
.
getWareHoustList
();
},
//重置
reset
()
{
this
.
formInline
.
name
=
""
;
this
.
formInline
.
status
=
""
;
this
.
formInline
.
code
=
""
;
this
.
formInline
.
contact_tel
=
""
;
this
.
formInline
.
contact_name
=
""
;
this
.
getWareHoustList
();
},
//新增或修改弹框确定回调
closeDialogVisible
(
editForms
)
{
this
.
$refs
[
editForms
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
title
==
"新增仓库"
)
{
this
.
editForm
[
"province_id"
]
=
this
.
areaList
[
0
];
this
.
editForm
[
"city_id"
]
=
this
.
areaList
[
1
];
this
.
editForm
[
"district_id"
]
=
this
.
areaList
[
2
];
addWareHoust
(
this
.
editForm
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"添加成功"
,
type
:
"success"
,
});
this
.
clearData
();
this
.
dialogVisible
=
false
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
}
else
if
(
this
.
title
==
"编辑仓库"
)
{
this
.
editForm
[
"province_id"
]
=
this
.
areaList
[
0
];
this
.
editForm
[
"city_id"
]
=
this
.
areaList
[
1
];
this
.
editForm
[
"district_id"
]
=
this
.
areaList
[
2
];
updateWareHoust
(
this
.
editForm
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"编辑成功"
,
type
:
"success"
,
});
this
.
clearData
();
this
.
dialogVisible
=
false
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogVisible
=
false
;
}
});
}
}
});
},
//清空表单数据
clearData
()
{
this
.
dialogVisible
=
false
;
this
.
editForm
.
name
=
""
;
this
.
editForm
.
contact_name
=
""
;
this
.
editForm
.
contact_tel
=
""
;
this
.
editForm
.
address
=
""
;
this
.
editForm
.
warehouse_area
=
""
;
this
.
editForm
.
is_default_send
=
1
;
this
.
editForm
.
is_default_get
=
1
;
this
.
editForm
.
status
=
1
;
this
.
areaList
=
[];
},
//删除提示框
closeDialogDelete
()
{
let
obj
=
{
id
:
this
.
code
,
};
deleteWareHoust
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
"删除成功"
,
type
:
"success"
,
});
this
.
getWareHoustList
();
this
.
dialogDelete
=
false
;
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
,
});
this
.
dialogDelete
=
false
;
}
});
},
//
lazyLoad
(
node
,
resolve
)
{
this
.
getArea
(
node
,
resolve
);
},
//
getArea
(
node
,
resolve
)
{
const
level
=
node
.
level
;
let
limboNode
=
{};
if
(
level
===
0
)
{
limboNode
=
{
pid
:
0
};
}
if
(
level
===
1
)
{
limboNode
=
{
pid
:
node
.
value
};
}
if
(
level
===
2
)
{
limboNode
=
{
pid
:
node
.
value
};
}
getAreaList
(
limboNode
).
then
((
res
)
=>
{
let
result
=
{};
if
(
level
===
0
)
{
result
=
res
.
data
;
result
.
forEach
((
item
)
=>
{
item
.
value
=
item
.
id
;
item
.
label
=
item
.
name
;
item
.
children
=
[];
item
.
leaf
=
0
;
// 可以控制 是否有下级 值为true都不行,必须等于0
});
}
if
(
level
===
1
)
{
result
=
res
.
data
;
result
.
forEach
((
item
)
=>
{
item
.
value
=
item
.
id
;
item
.
label
=
item
.
name
;
item
.
children
=
[];
//这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上
item
.
leaf
=
0
;
});
}
if
(
level
===
2
)
{
result
=
res
.
data
;
result
.
forEach
((
item
)
=>
{
item
.
value
=
item
.
id
;
item
.
label
=
item
.
name
;
item
.
leaf
=
1
;
});
}
resolve
(
result
);
});
},
handleChanges
(
value
)
{
this
.
areaList
=
value
;
// this.addressForm.address_ids = value;
},
// 获取仓库列表
getWareHoustList
()
{
let
obj
=
{};
obj
[
"limit"
]
=
this
.
pageSize
;
obj
[
"page"
]
=
this
.
currentPage
;
if
(
this
.
formInline
.
name
!=
""
)
{
obj
[
"name"
]
=
this
.
formInline
.
name
;
}
if
(
this
.
formInline
.
status
!=
""
)
{
obj
[
"status"
]
=
this
.
formInline
.
status
;
}
if
(
this
.
formInline
.
code
!=
""
)
{
obj
[
"code"
]
=
this
.
formInline
.
code
;
}
if
(
this
.
formInline
.
contact_tel
!=
""
)
{
obj
[
"contact_tel"
]
=
this
.
formInline
.
contact_tel
;
}
if
(
this
.
formInline
.
contact_name
!=
""
)
{
obj
[
"contact_name"
]
=
this
.
formInline
.
contact_name
;
}
wareHoustList
(
obj
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
total
=
res
.
data
.
count
;
this
.
tableData
=
res
.
data
.
list
;
}
});
},
//分页查询
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
;
this
.
getWareHoustList
();
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
;
this
.
getWareHoustList
();
},
//是否默认收货仓
isDefaulu
(
val
)
{
if
(
val
==
0
)
{
return
"否"
;
}
else
if
(
val
==
1
)
{
return
"是"
;
}
},
},
};
</
script
>
<
style
scoped
>
/* .clearfix {
margin: 10px 0 15px 0;
} */
.left-text
{
padding-left
:
7px
;
font-size
:
16px
;
font-family
:
Microsoft
YaHei
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
28px
;
}
/* 分页 */
.footer_pagination
{
text-align
:
center
;
margin-top
:
15px
;
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论