Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
welfare
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
达摩4.0重构
welfare
Commits
559e626f
Commit
559e626f
authored
Feb 09, 2021
by
萱草
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 礼品管理
parent
99f8e308
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
519 additions
and
299 deletions
+519
-299
gift.js
src/api/gift.js
+6
-0
routes.js
src/router/routes.js
+2
-0
stock-record.js
src/router/stock-record.js
+20
-0
check-upload-detail.vue
src/views/gift-manage/module/check-upload-detail.vue
+79
-0
real-gift-detail.vue
src/views/gift-manage/real-gift-detail.vue
+33
-21
real-gift.vue
src/views/gift-manage/real-gift.vue
+29
-57
stock-record.vue
src/views/gift-manage/stock-record.vue
+260
-0
virtual-gift-detail.vue
src/views/gift-manage/virtual-gift-detail.vue
+12
-181
virtual-gift.vue
src/views/gift-manage/virtual-gift.vue
+78
-40
No files found.
src/api/gift.js
View file @
559e626f
...
...
@@ -38,6 +38,12 @@ let realGift = {
giftStandardList
:
'/gift/spec-list'
,
// 规格查询
giftStandardValueNew
:
'/gift/spec-value-save'
,
// 规格值新建
giftStandardValueList
:
'/gift/spec-value-list'
,
// 规格值查询
virtualCardList
:
'/gift/vir-card-page'
,
// 虚拟礼品卡券卡密列表
virtualUploadLog
:
'/gift/vir-card-log-page'
,
// 库存上传记录
batchUpdate
:
{
url
:
'/gift/batch-update'
,
method
:
'post'
}
};
realGift
=
getFetch
(
realGift
,
welfarePrefix
);
...
...
src/router/routes.js
View file @
559e626f
...
...
@@ -4,12 +4,14 @@ import cardPackage from './card-package';
import
realGift
from
'./real-gift'
;
import
Layout
from
'@/components/layout/layout'
;
import
virtualGift
from
'./virtual-gift'
;
import
stockRecord
from
'./stock-record'
;
export
const
asyncRoutes
=
[
...
gicCard
,
...
cardPackage
,
...
realGift
,
...
virtualGift
,
...
stockRecord
,
];
...
...
src/router/stock-record.js
0 → 100644
View file @
559e626f
import
Layout
from
'@/components/layout/layout'
;
export
default
[
{
path
:
'/gift-manage'
,
component
:
Layout
,
redirect
:
'/gift-manage/stock-record'
,
children
:
[
{
path
:
'stock-record'
,
component
:
()
=>
import
(
'@/views/gift-manage/stock-record.vue'
),
},
// {
// path: 'virtual-gift-detail',
// component: () => import('@/views/gift-manage/virtual-gift-detail.vue'),
// }
],
},
];
\ No newline at end of file
src/views/gift-manage/module/check-upload-detail.vue
0 → 100644
View file @
559e626f
<
template
>
<el-dialog
title=
"查看内容"
:visible
.
sync=
"dialogVisible"
width=
"500px"
@
close=
"cancelSubmit()"
>
<div
v-loading=
"loading"
>
<div>
<el-input
placeholder=
"请输入关键词搜索"
prefix-icon=
"el-icon-search"
v-model=
"search"
class=
"mr10 w220"
clearable
@
keyup
.
enter
.
native=
"getSearchList"
@
clear=
"getSearchList"
></el-input>
</div>
<el-table
:data=
"tableData"
>
<el-table-column
label=
"卡号"
prop=
"paramOne"
></el-table-column>
<el-table-column
label=
"卡密/券码"
prop=
"paramTwo"
></el-table-column>
<el-table-column
label=
"当前状态"
prop=
"statusFlag"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
statusFlag
===
0
?
'未兑换'
:
'已兑换'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"用户/会员"
prop=
"name"
></el-table-column>
</el-table>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelSubmit()"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"submitProNanme()"
>
确认
</el-button>
</div>
</el-dialog>
</template>
<
script
>
// import request from '../service/request.js';
import
api
from
'@/api/gift.js'
;
const
{
virtualCardList
}
=
api
;
export
default
{
data
()
{
return
{
dialogVisible
:
false
,
loading
:
false
,
tableData
:
[
{
paramOne
:
'123'
,
paramTwo
:
'123'
,
statusFlag
:
0
,
name
:
'测试'
},
{
paramOne
:
'4556'
,
paramTwo
:
'4556'
,
statusFlag
:
1
,
name
:
'测试lall'
}
]
};
},
mounted
()
{
this
.
dialogVisible
=
true
;
this
.
getTableList
();
},
methods
:
{
getTableList
(){
this
.
loading
=
true
;
let
params
=
{
id
:
''
,
key
:
''
};
virtualCardList
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
}).
finally
(()
=>
this
.
loading
=
false
);
},
submitProNanme
()
{
this
.
dialogVisible
=
false
;
// setInterval(() => {
// this.$emit('closeUpdateCost');
// }, 10);
},
// 取消修改
cancelSubmit
()
{
this
.
dialogVisible
=
false
;
// setInterval(() => {
// this.$emit('closeUpdateCost');
// }, 10);
}
}
};
</
script
>
<
style
scoped
></
style
>
src/views/gift-manage/real-gift-detail.vue
View file @
559e626f
...
...
@@ -366,6 +366,7 @@ export default {
skuCols
:
[],
stValCount
:
[],
skuSellObj
:
{},
stockObj
:
{},
isStdImg
:
false
,
cordList
:
[],
// 礼品分类
// goodsType: 1, // 1 实物 2虚拟
...
...
@@ -391,7 +392,8 @@ export default {
stock
:
undefined
,
giftSkuCode
:
''
,
skuBarCode
:
''
}
},
isEdit
:
false
};
},
mounted
()
{
...
...
@@ -404,6 +406,7 @@ export default {
if
(
this
.
giftId
)
{
this
.
bread
[
2
].
breadName
=
'编辑礼品'
;
this
.
getMess
();
this
.
isEdit
=
true
;
}
// this.getOpenStorePick();
this
.
getStandardList
();
// 获取规格列表
...
...
@@ -914,6 +917,16 @@ export default {
stockStatus
:
true
,
giftSkuCostPriceStatus
:
true
};
if
(
this
.
isEdit
){
if
(
Number
(
this
.
stockObj
[
item
])
>
Number
(
this
.
skuSellObj
[
item
].
stock
)){
this
.
skuSellObj
[
item
].
stockType
=
1
;
this
.
skuSellObj
[
item
].
stockAlter
=
Number
(
this
.
stockObj
[
item
])
-
Number
(
this
.
skuSellObj
[
item
].
stock
);
}
else
{
this
.
skuSellObj
[
item
].
stockType
=
0
;
this
.
skuSellObj
[
item
].
stockAlter
=
Number
(
this
.
skuSellObj
[
item
].
stock
)
-
Number
(
this
.
stockObj
[
item
]);
}
console
.
log
(
this
.
skuSellObj
);
}
}
this
.
handleData
.
giftSkuCostPrice
=
''
;
// this.goodsForm.skuIntegral = undefined;
...
...
@@ -996,6 +1009,7 @@ export default {
giftSkuCostPriceStatus
:
true
,
// skuId: Object.keys(skuSellObjCopy).length > 0 ? skuSellObjCopy[item.mapId].skuId : ''
};
this
.
stockObj
[
item
.
mapId
]
=
Object
.
keys
(
skuSellObjCopy
).
length
>
0
?
skuSellObjCopy
[
item
.
mapId
].
stock
:
''
;
}
else
{
this
.
skuSellObj
[
item
.
mapId
]
=
{
giftSkuCostPrice
:
''
,
...
...
@@ -1081,6 +1095,16 @@ export default {
}
else
{
this
.
skuSellObj
[
key
].
stockStatus
=
true
;
}
if
(
this
.
isEdit
){
if
(
Number
(
this
.
stockObj
[
key
])
>
Number
(
this
.
skuSellObj
[
key
].
stock
)){
this
.
skuSellObj
[
key
].
stockType
=
1
;
this
.
skuSellObj
[
key
].
stockAlter
=
Number
(
this
.
stockObj
[
key
])
-
Number
(
this
.
skuSellObj
[
key
].
stock
);
}
else
{
this
.
skuSellObj
[
key
].
stockType
=
0
;
this
.
skuSellObj
[
key
].
stockAlter
=
Number
(
this
.
skuSellObj
[
key
].
stock
)
-
Number
(
this
.
stockObj
[
key
]);
}
console
.
log
(
this
.
skuSellObj
);
}
},
// 保存
submitForm
(
goodsForm
)
{
...
...
@@ -1124,11 +1148,14 @@ export default {
return
item
;
});
skuList
.
push
({
gift
:
this
.
giftId
,
stock
:
this
.
skuSellObj
[
item
].
stock
,
giftSkuCode
:
this
.
skuSellObj
[
item
].
giftSkuCode
,
skuBarCode
:
this
.
skuSellObj
[
item
].
skuBarCode
,
giftSkuCostPrice
:
this
.
skuSellObj
[
item
].
giftSkuCostPrice
,
giftSkuStrand
:
JSON
.
stringify
(
goodsStandard
)
giftSkuStrand
:
JSON
.
stringify
(
goodsStandard
),
stockType
:
this
.
skuSellObj
[
item
].
stockType
,
stockAlter
:
this
.
skuSellObj
[
item
].
stockAlter
,
});
}
...
...
@@ -1212,24 +1239,6 @@ export default {
}
}).
finally
(()
=>
this
.
$emit
(
'updateLoading'
));
}
// request
// .post(url, params)
// .then(res => {
// if (res.data.code === '0000') {
// this.$router.push({ path: '/myGift' });
// this.btnLoading = false;
// } else {
// this.btnLoading = false;
// this.$message.error(res.data.message);
// }
// })
// .catch(error => {
// this.$message.error({
// duration: 1000,
// message: error.message
// });
// this.btnLoading = false;
// }).finally(() => this.$emit('updateLoading'));
}
});
}
...
...
@@ -1265,8 +1274,11 @@ export default {
h3
{
color
:
#303133
;
font-size
:
14px
;
font-weight
:
5
00
;
font-weight
:
7
00
;
margin-bottom
:
20px
;
margin-left
:
20px
;
padding-bottom
:
20px
;
border-bottom
:
1px
solid
#dfdfdf
;
}
//
.add-btn
{
//
height
:
30px
;
...
...
src/views/gift-manage/real-gift.vue
View file @
559e626f
...
...
@@ -201,21 +201,35 @@ export default {
total
:
0
,
sortOrder
:
''
,
sortColumn
:
''
,
tableData
:
[],
// tableData: [
// {
// costPrice: '99',
// giftId: '111111',
// giftName: '测试',
// giftNo: '00000',
// hiddenFlag: 1,
// historyTotalStock: '9999',
// occupyStock: '100',
// totalStock: '800',
// remainedStock: '700',
// updateTime: '1610693597000'
// }
// ],
// tableData: [],
tableData
:
[
{
costPrice
:
'99'
,
giftId
:
'111111'
,
giftName
:
'测试1'
,
giftNo
:
'00000'
,
hiddenFlag
:
1
,
historyTotalStock
:
'9999'
,
occupyStock
:
'100'
,
totalStock
:
'800'
,
remainedStock
:
'700'
,
updateTime
:
'1610693597000'
,
statusFlag
:
1
,
},
{
costPrice
:
'99'
,
giftId
:
'111111'
,
giftName
:
'测试2'
,
giftNo
:
'00000'
,
hiddenFlag
:
1
,
historyTotalStock
:
'9999'
,
occupyStock
:
'100'
,
totalStock
:
'800'
,
remainedStock
:
'700'
,
updateTime
:
'1610693597000'
,
statusFlag
:
0
,
}
],
selectList
:
[],
// 更新成本数据
updateCostData
:
{
...
...
@@ -408,37 +422,6 @@ export default {
this
.
stockData
.
textarea
=
''
;
this
.
StockDialog
=
false
;
},
// 虚拟礼品库存调整
// confirmStock(obj, item) {
// console.log('调整库存', obj, item);
// let stock;
// if (obj.type === 1) {
// stock = obj.stock;
// } else if (obj.type === 2) {
// stock = '-' + obj.stock;
// }
// let params = {
// goodsId: item.goodsId,
// goodsStock: stock
// };
// request
// .post('/api-integral-mall/update-integral-gift-info', params)
// .then(res => {
// if (res.data.code === '0000') {
// this.$message.success('修改成功');
// this.getTableList();
// } else {
// this.$message.error(res.data.message);
// }
// })
// .catch(error => {
// this.$message.error({
// duration: 1000,
// message: error.message
// });
// });
// },
// 更新成本
updateCost
(
item
)
{
console
.
log
(
'修改成本'
,
item
);
...
...
@@ -475,17 +458,6 @@ export default {
// this.$router.push({ path: '/addGift', query: { goodsType: item.proType, goodsId: item.goodsId } });
// }
},
// computed: {
// // ...mapGetters([ 'getDefaultId' ])
// },
// watch: {
// getDefaultId() {
// this.shopId = this.getDefaultId;
// if (this.shopId) {
// this.init();
// }
// }
// }
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/gift-manage/stock-record.vue
0 → 100644
View file @
559e626f
<
template
>
<div>
<div
class=
"tab-top"
>
<el-input
:placeholder=
"placeholderText"
v-model=
"search"
class=
"mr10 w350"
clearable
@
keyup
.
enter
.
native=
"getSearchList"
@
clear=
"getSearchList"
>
<el-select
v-model=
"searchType"
slot=
"prepend"
placeholder=
"礼品名称"
style=
"width:140px;"
@
change=
"handleChangeType"
>
<el-option
label=
"礼品名称"
:value=
"1"
></el-option>
<el-option
label=
"礼品编码"
:value=
"2"
></el-option>
<el-option
label=
"福利id"
:value=
"3"
></el-option>
</el-select>
</el-input>
<el-input
placeholder=
"请输入操作人姓名搜索"
prefix-icon=
"el-icon-search"
v-model=
"search2"
class=
"mr10 w220"
clearable
@
keyup
.
enter
.
native=
"getSearchList"
@
clear=
"getSearchList"
></el-input>
<el-date-picker
v-model=
"timeValue"
type=
"datetimerange"
align=
"right"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
></el-date-picker>
</div>
<div
class=
"table-content"
v-loading=
"loading"
>
<el-table
:data=
"tableData"
ref=
"multipleTable"
style=
"width: 100%"
>
<el-table-column
label=
"上传时间"
prop=
"createTime"
width=
"300px"
></el-table-column>
<el-table-column
prop=
"creatorName"
label=
"操作人"
min-width=
"150px"
></el-table-column>
<el-table-column
prop=
"fileName"
label=
"文件名称"
min-width=
"150px"
></el-table-column>
<el-table-column
prop=
"giftName"
label=
"福利名称"
min-width=
"120px"
></el-table-column>
<el-table-column
label=
"上传结果"
min-width=
"150px"
>
<template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.statusFlag === 0"
>
处理中
</div>
<div
v-else
>
成功
<span
class=
"blue"
>
{{
scope
.
row
.
success
}}
</span>
条,失败
<span
class=
"danger-color"
>
{{
scope
.
row
.
fail
}}
</span>
条,
<el-button
type=
"text"
@
click=
"checkDetail"
>
查看详情
</el-button>
</div>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination-conteiner"
style=
"background:#fff;"
v-show=
"total > 0"
>
<div
class=
"pagination"
>
<dm-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"listParams.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"listParams.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
v-if=
"total != 0"
>
</dm-pagination>
</div>
</div>
</div>
<el-dialog
title=
"查看详情"
:visible
.
sync=
"dialogVisible"
width=
"30%"
:before-close=
"handleClose"
>
<span>
这是一段信息
</span>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
page
,
formate
}
from
'@/mixins/table.js'
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
import
api
from
'@/api/gift.js'
;
const
{
giftPage
}
=
api
;
export
default
{
components
:
{
// klal
},
data
()
{
return
{
bread
:
[
{
breadName
:
'礼品管理'
},
{
breadName
:
'库存上传记录'
}
],
// activeName: '0',
mixins
:
[
page
,
formate
],
listParams
:
{
search
:
''
,
search2
:
''
,
startTime
:
''
,
endTime
:
''
,
currentPage
:
1
,
pageSize
:
20
,
},
proType
:
''
,
status
:
''
,
batchOperate
:
''
,
total
:
0
,
sortOrder
:
''
,
sortColumn
:
''
,
// tableData: [],
tableData
:
[
{
createTime
:
'1610693597000'
,
statusFlag
:
0
,
creatorName
:
'超级管理员'
,
fileName
:
'我是文件啦啦啦'
,
giftName
:
'年终福利'
,
success
:
'2'
,
fail
:
'1'
,
uploadLogId
:
'111111'
},
{
createTime
:
'1610693597000'
,
statusFlag
:
1
,
creatorName
:
'小熊饼干'
,
fileName
:
'我是文件小魔仙'
,
giftName
:
'过年啦'
,
success
:
'2'
,
fail
:
'1'
,
uploadLogId
:
'111111'
},
{
createTime
:
'1610693597000'
,
statusFlag
:
2
,
creatorName
:
'纯甄牛奶'
,
fileName
:
'我是文件小哪吒'
,
giftName
:
'放鞭炮'
,
success
:
'2'
,
fail
:
'1'
,
uploadLogId
:
'111111'
}
],
loading
:
false
,
search
:
''
,
searchType
:
1
,
placeholderText
:
'请输入关键词搜索'
,
isShow
:
false
,
timeValue
:
''
,
dialogVisible
:
false
,
};
},
created
()
{
this
.
$emit
(
'updateBread'
,
this
.
bread
);
this
.
$emit
(
'showAside'
,
true
);
// if (localStorage.getItem('giftObj')) {
// let giftObj = JSON.parse(localStorage.getItem('giftObj'));
// this.pageNum = giftObj.pageNum;
// this.pageSize = giftObj.pageSize;
// this.search = giftObj.search;
// this.proType = giftObj.proType;
// this.status = giftObj.status;
// this.sortColumn = giftObj.sortColumn;
// this.sortOrder = giftObj.sortOrder;
// // this.activeName = giftObj.activeName;
// localStorage.removeItem('giftObj'); // 使用完就清除缓存
// }
this
.
init
();
},
methods
:
{
formatDateTimeByType
,
init
()
{
this
.
getTableList
();
},
getSearchList
()
{
this
.
pageNum
=
1
;
this
.
getTableList
();
},
// 列表筛选条件更改
handleChangeType
()
{
if
(
this
.
searchType
===
1
)
{
this
.
placeholderText
=
'请输入礼品名称'
;
}
else
if
(
this
.
searchType
===
2
)
{
this
.
placeholderText
=
'请输入礼品编码'
;
}
else
if
(
this
.
searchType
===
3
)
{
this
.
placeholderText
=
'条形码'
;
}
else
if
(
this
.
searchType
===
4
)
{
this
.
placeholderText
=
'福利id'
;
}
},
// 实物礼品列表
getTableList
()
{
console
.
log
(
'获取列表详情'
);
let
params
=
{
giftType
:
'1'
,
startTime
:
''
,
startStock
:
''
,
startCostPrice
:
''
,
sortOrder
:
''
,
sortColumn
:
''
,
pageSize
:
''
,
pageNum
:
''
,
hiddenFlag
:
''
,
giftNo
:
''
,
giftName
:
''
,
giftId
:
''
,
giftBarNo
:
''
,
endTime
:
''
,
endStock
:
''
,
endCostPrice
:
''
};
giftPage
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
this
.
tableData
=
res
.
result
;
console
.
log
(
this
.
tableData
);
});
},
checkDetail
(){
this
.
dialogVisible
=
true
;
}
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.tab-top
{
height
:
32px
;
margin
:
20px
20px
0px
20px
;
}
.table-content
{
margin
:
20px
;
padding-bottom
:
20px
;
.img-text
{
height
:
60px
;
img
{
width
:
60px
;
height
:
60px
;
border
:
1px
solid
#dcdfe6
;
padding
:
4px
;
border-radius
:
2px
;
}
.text
{
display
:
inline-block
;
vertical-align
:
top
;
width
:
75%
;
margin-left
:
3px
;
font-size
:
13px
;
line-height
:
14px
;
.goods-descript
{
color
:
#606266
;
line-height
:
18px
;
font-size
:
14px
;
margin-bottom
:
10px
;
}
.goods-code
{
color
:
#909399
;
font-size
:
12px
;
line-height
:
16px
;
}
}
&
:hover
.el-icon-edit-outline
{
display
:
inline-block
;
cursor
:
pointer
;
}
.el-icon-edit-outline
:hover
{
color
:
#2f54ed
;
}
}
.stock-box
{
&:hover
.el-icon-edit-outline
{
display
:
inline-block
;
cursor
:
pointer
;
}
}
}
.el-icon-edit-outline
:hover
{
color
:
#2f54ed
;
}
.undeline-dash
{
border-bottom
:
1px
dashed
#2F54EB
;
font-weight
:
500
;
}
.spanclass
{
display
:
inline-block
;
line-height
:
32px
;
}
</
style
>
<
style
>
.damolish
.el-tooltip__popper
{
width
:
240px
;
}
</
style
>
\ No newline at end of file
src/views/gift-manage/virtual-gift-detail.vue
View file @
559e626f
...
...
@@ -84,7 +84,7 @@
<el-button><i
class=
"el-icon-upload2"
style=
"margin-right:5px"
></i>
点击上传
</el-button>
</el-upload>
</div>
<div
style=
"display:flex;justify-content:space-between;width:400px"
><span>
导入说明:
</span><el-button
type=
"text"
>
查看内容
</el-button></div>
<div
style=
"display:flex;justify-content:space-between;width:400px"
><span>
导入说明:
</span><el-button
type=
"text"
@
click=
"checkUploadDetail"
>
查看内容
</el-button></div>
<p>
1.填充空缺内容,导出所有项均为必填项;
</p>
<p>
1.请勿导入重复的内容,导入的内容在原来基础上增加库存;
</p>
<p>
1.上传完整仅支持.xlsx .xls文件的导入,填充数据不超过“10万”条;
</p>
...
...
@@ -139,6 +139,7 @@
<div
class=
"link-item"
:class=
"linkIndex === 5 ? 'link-item-active' : ''"
@
click=
"jump(5)"
>
权限设置
</div>
</div>
</div>
<check-upload-detail
v-if=
"dialogVisible"
></check-upload-detail>
</div>
</template>
<
script
>
...
...
@@ -147,9 +148,11 @@ import { request } from '../../utils/request';
import
api
from
'@/api/gift.js'
;
import
uploadUrl
from
'@/api/common.js'
;
const
{
giftGet
,
giftUpdate
,
giftSave
}
=
api
;
import
checkUploadDetail
from
'./module/check-upload-detail'
;
export
default
{
components
:
{
// importCoupon
checkUploadDetail
,
},
data
()
{
let
marketPriceValidator
=
(
rule
,
value
,
callback
)
=>
{
...
...
@@ -183,12 +186,10 @@ export default {
}
],
goodsForm
:
{
enterpriseName
:
''
,
giftName
:
''
,
// 礼品名称
marketPrice
:
''
,
// 礼品市场价
giftImages
:
''
,
// 礼品主图URL,分割
giftDescrption
:
''
,
// 礼品详情
limitTimeBegin
:
''
,
checkList
:
[],
refundFlag
:
0
,
operatorAuth
:
''
,
// 操作人权限
...
...
@@ -229,6 +230,7 @@ export default {
giftSkuCode
:
''
,
skuBarCode
:
''
},
dialogVisible
:
false
};
},
mounted
()
{
...
...
@@ -246,6 +248,9 @@ export default {
});
},
methods
:
{
checkUploadDetail
(){
this
.
dialogVisible
=
true
;
},
uploadFile
(
file
){
console
.
log
(
file
);
},
...
...
@@ -514,15 +519,6 @@ export default {
.w-630
{
width
:
630px
;
}
.w-480
{
width
:
480px
;
}
.w-350
{
width
:
350px
;
}
.w-900
{
width
:
900px
;
}
.mb56
{
margin-bottom
:
56px
;
}
...
...
@@ -536,32 +532,11 @@ export default {
h3
{
color
:
#303133
;
font-size
:
14px
;
font-weight
:
5
00
;
font-weight
:
7
00
;
margin-bottom
:
20px
;
}
//
.add-btn
{
//
height
:
30px
;
//
line-height
:
30px
;
//
border
:
1px
dashed
#c4c6cf
;
//
cursor
:
pointer
;
//
border-radius
:
2px
;
//
color
:
#606266
;
//
text-align
:
center
;
//
font-size
:
14px
;
//
&:hover
{
//
border-color
:
#2f54eb
;
//
color
:
#2f54eb
;
//
}
//
}
.prefix-money
{
color
:
#303133
;
}
.add-time
{
color
:
#606266
;
margin-left
:
150px
;
&:hover
{
color
:
#2f54eb
;
}
margin-left
:
20px
;
padding-bottom
:
20px
;
border-bottom
:
1px
solid
#dfdfdf
;
}
.tip-warm
{
color
:
#909399
;
...
...
@@ -571,85 +546,6 @@ export default {
margin-right
:
5px
;
}
}
.standard-info
{
//规格信息
.add-sku-list
{
width
:
900px
;
margin-bottom
:
20px
;
.add-sku-item
{
width
:
100%
;
.sku-name
{
padding
:
8px
;
background
:
#f3f6f9
;
position
:
relative
;
.sku-title
{
color
:
#909399
;
margin-right
:
7px
;
}
.sku-value-title
{
color
:
#909399
;
width
:
55px
;
}
.delete-btn
{
color
:
#909399
;
font-size
:
14px
;
position
:
absolute
;
right
:
20px
;
cursor
:
pointer
;
&:hover
{
color
:
#2f54ed
;
}
}
}
.value-content
{
padding
:
15px
8px
5px
8px
;
display
:
flex
;
.sku-value-title
{
color
:
#909399
;
width
:
55px
;
}
.value-list
{
display
:
inline-block
;
flex
:
1
;
.value-item
{
border
:
1px
solid
#e4e7ed
;
padding
:
10px
8px
;
border-radius
:
4px
;
display
:
inline-block
;
margin-right
:
7px
;
position
:
relative
;
margin-bottom
:
10px
;
.el-icon-error
{
font-size
:
16px
;
position
:
absolute
;
right
:
-10px
;
top
:
-5px
;
color
:
#c0c4cc
;
display
:
none
;
cursor
:
pointer
;
}
&
:hover
.el-icon-error
{
display
:
inline-block
;
color
:
#909399
;
}
}
}
}
}
}
.sku-table-content
{
padding
:
10px
;
width
:
900px
;
border
:
1px
solid
#dcdfe6
;
border-radius
:
2px
;
.batch-box
{
padding-left
:
130px
;
font-size
:
0
;
height
:
40px
;
}
}
}
}
.fixed-btn
{
width
:
100%
;
...
...
@@ -668,7 +564,6 @@ export default {
}
}
}
.anchor-link
{
width
:
120px
;
position
:
fixed
;
...
...
@@ -697,44 +592,6 @@ export default {
.mr10
{
margin-right
:
10px
;
}
.mr16
{
margin-right
:
16px
;
}
.table-img
{
display
:
inline-block
;
width
:
32px
;
height
:
32px
;
border-radius
:
4px
;
border
:
1px
dashed
#d9d9d9
;
cursor
:
pointer
;
text-align
:
center
;
vertical-align
:
top
;
position
:
relative
;
}
.table-img
img
{
width
:
30px
;
height
:
30px
;
}
.table-img
:hover
{
border
:
1px
dashed
#2f54ed
;
}
.img-modal
{
width
:
32px
;
height
:
32px
;
position
:
absolute
;
left
:
-1px
;
top
:
-1px
;
background
:
rgba
(
0
,
0
,
0
,
0.5
);
display
:
none
;
cursor
:
pointer
;
border-radius
:
4px
;
}
.img-modal
.el-icon-delete
{
color
:
#fff
;
}
.table-img
:hover
.img-modal
{
display
:
inline-block
;
}
.tips-content
{
position
:
absolute
;
left
:
-4px
;
...
...
@@ -761,35 +618,9 @@ table th.star div::before {
content
:
'*'
;
color
:
red
;
}
.upload-ele
.el-upload
{
width
:
100%
;
}
/* .cord-list .el-select-dropdown__item {
position: relative;
}
.cord-list .delete-icon {
position: absolute;
right: 10px;
top: 9px;
display: none;
color: #909399;
}
.cord-list .delete-icon .el-icon-error {
color: #c0c4c0;
}
.cord-list .delete-icon:hover .el-icon-error {
color: #909399;
}
.cord-list .el-select-dropdown__item:hover .delete-icon {
display: inline-block;
} */
.right-border
{
border-right
:
1px
solid
#ebeef5
;
}
.sku-table-content
.sku-table
th
{
line-height
:
17px
!important
;
}
.mopney-input
span
{
display
:
none
!important
;
}
...
...
src/views/gift-manage/virtual-gift.vue
View file @
559e626f
...
...
@@ -121,13 +121,19 @@
<el-switch
v-model=
"scope.row.hiddenFlag"
:active-value=
"1"
:inactive-value=
"0"
@
change=
"changeShow"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
min-width=
"
17
0px"
fixed=
"right"
>
<el-table-column
label=
"操作"
min-width=
"
21
0px"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<div
style=
"font-size:0px"
>
<dm-perm-button
type=
"text"
@
click=
"edit(scope.row, 2)"
>
编辑
</dm-perm-button>
<dm-perm-button
type=
"text"
>
库存记录
</dm-perm-button>
<el-button
v-if=
"scope.row.statusFlag === 0"
type=
"text"
>
禁用
</el-button>
<el-button
type=
"text"
v-if=
"scope.row.statusFlag === 1"
>
启用
</el-button>
<el-dropdown
style=
"margin-left:20px;"
@
command=
"command => handleCommand(command, scope.row)"
placement=
"bottom-start"
>
<span
class=
"el-dropdown-link"
style=
"color:#2f54ed;cursor: pointer;"
>
更多
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</span>
<el-dropdown-menu
slot=
"dropdown"
style=
"width:110px;"
>
<el-dropdown-item
command=
"1"
>
查看记录
</el-dropdown-item>
<el-dropdown-item
command=
"2"
v-if=
"scope.row.statusFlag === 0"
>
禁用
</el-dropdown-item>
<el-dropdown-item
command=
"3"
v-if=
"scope.row.statusFlag === 1"
>
启用
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</
template
>
</el-table-column>
...
...
@@ -140,6 +146,16 @@
</div>
</div>
</div>
<el-dialog
:title=
"forbiddenTitle"
:visible
.
sync=
"forbiddenDialog"
width=
"30%"
>
<div
style=
"display:flex"
>
<i
class=
"el-icon-warning inline-block"
style=
"font-size:24px;color:#e6a23c"
></i>
<span
class=
"inline-block ml10"
style=
"font-size:16px;line-height:20px"
>
禁用礼品将在福利组件不展示,并且该礼品参加的活动将全部失效,确认禁用?
</span>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"forbiddenDialog = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"forbiddenDialog = false"
>
确 定
</el-button>
</span>
</el-dialog>
<!-- 调整成本 -->
<!-- <update-cost v-if="updateCostDialog" :update-cost-data="updateCostData" @closeUpdateCost="closeUpdateCost" @getTableList="getTableList"></update-cost> -->
<update-multi-cost
v-if=
"updateCostDialog"
:update-cost-data=
"updateCostData"
@
closeUpdateCost=
"closeUpdateCost"
@
getTableList=
"getTableList"
></update-multi-cost>
...
...
@@ -152,6 +168,7 @@
<!-- 多规格调整积分现金 -->
<!-- <update-sku-integral :integral-date="integralDate" v-if="integralDialog" @getList="getList" @closeIntegral="closeIntegral"></update-sku-integral> -->
<!-- <update-sku-integral :integral-date="integralDate" v-if="integralDialog" @getList="getList" @closeCost="closeCost"></update-sku-integral> -->
<check-upload-detail
v-if=
"dialogVisible"
></check-upload-detail>
</div>
</template>
<
script
>
...
...
@@ -163,11 +180,12 @@ import UpdateMultiCost from './module/update-multi-cost.vue';
import
updateName
from
'./module/update-name.vue'
;
// import updateStock from './module/update-stock.vue';
import
updateMultiStock
from
'./module/update-multi-stock.vue'
;
import
checkUploadDetail
from
'./module/check-upload-detail'
;
// import updateSkuIntegral from '../../components/updateSkuIntegral';
// import { mapGetters } from 'vuex';
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
import
api
from
'@/api/gift.js'
;
const
{
giftPage
}
=
api
;
const
{
giftPage
,
batchUpdate
}
=
api
;
export
default
{
components
:
{
// UpdateCost,
...
...
@@ -177,6 +195,7 @@ export default {
updateMultiStock
,
// goodsStock,
// updateSkuIntegral,
checkUploadDetail
,
},
data
()
{
return
{
...
...
@@ -208,14 +227,28 @@ export default {
{
costPrice
:
'99'
,
giftId
:
'111111'
,
giftName
:
'测试'
,
giftName
:
'测试1'
,
giftNo
:
'00000'
,
hiddenFlag
:
1
,
historyTotalStock
:
'9999'
,
occupyStock
:
'100'
,
totalStock
:
'800'
,
remainedStock
:
'700'
,
updateTime
:
'1610693597000'
,
statusFlag
:
1
,
},
{
costPrice
:
'99'
,
giftId
:
'111111'
,
giftName
:
'测试2'
,
giftNo
:
'00000'
,
hiddenFlag
:
1
,
historyTotalStock
:
'9999'
,
occupyStock
:
'100'
,
totalStock
:
'800'
,
remainedStock
:
'700'
,
updateTime
:
'1610693597000'
updateTime
:
'1610693597000'
,
statusFlag
:
0
,
}
],
selectList
:
[],
...
...
@@ -256,6 +289,9 @@ export default {
costValue2
:
''
,
// 条件筛选最高成本
remainedStock1
:
undefined
,
// 条件筛选最低可占库存
remainedStock2
:
undefined
,
// 条件筛选最高可占库存
dialogVisible
:
false
,
forbiddenDialog
:
false
,
forbiddenTitle
:
'禁用'
};
},
created
()
{
...
...
@@ -301,9 +337,9 @@ export default {
console
.
log
(
'获取列表详情'
);
let
params
=
{
giftType
:
'1'
,
startTime
:
''
,
startStock
:
''
,
startCostPrice
:
''
,
startTime
:
this
.
timeValue
[
0
]
,
startStock
:
this
.
remainedStock1
,
startCostPrice
:
this
.
costValue1
,
sortOrder
:
''
,
sortColumn
:
''
,
pageSize
:
''
,
...
...
@@ -313,9 +349,9 @@ export default {
giftName
:
''
,
giftId
:
''
,
giftBarNo
:
''
,
endTime
:
''
,
endStock
:
''
,
endCostPrice
:
''
endTime
:
this
.
timeValue
[
1
]
,
endStock
:
this
.
remainedStock2
,
endCostPrice
:
this
.
costValue2
};
giftPage
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
...
...
@@ -323,6 +359,15 @@ export default {
console
.
log
(
this
.
tableData
);
});
},
handleCommand
(
value1
,
value2
){
console
.
log
(
value1
);
console
.
log
(
value2
);
if
(
value1
==
1
){
this
.
dialogVisible
=
true
;
}
else
if
(
value1
==
2
){
this
.
forbiddenDialog
=
true
;
}
},
// 排序
sortChange
(
value
)
{
if
(
value
.
order
==
'ascending'
)
{
...
...
@@ -347,42 +392,35 @@ export default {
},
handleSelectAll
(
val
)
{
this
.
selectList
=
val
;
console
.
log
(
this
.
selectList
);
},
// 批量操作
handleBatch
()
{
// let goodsIdArr = [];
// for (let item of this.selectList) {
// goodsIdArr.push(item.goodsId);
// }
// let params = {
// goodsIds: goodsIdArr.join(','),
// type: 1
// };
this
.
$confirm
(
'<div>已添加被禁用礼品的活动将会失效,确认禁用?</div>'
,
'批量禁用'
,
{
closeOnClickModal
:
false
,
showClose
:
false
,
type
:
'warning'
,
customClass
:
'show-title'
,
dangerouslyUseHTMLString
:
true
,
confirmButtonText
:
'确认'
,
})
.
then
(()
=>
{
// this.batchRequest(params);
console
.
log
(
'批量禁用'
);
});
handleBatch
(
value
)
{
let
giftIdList
=
''
;
let
type
=
value
;
giftIdList
=
this
.
selectList
.
map
((
item
,
index
)
=>
{
return
item
.
giftId
;
}).
join
(
','
);
if
(
value
==
2
){
this
.
forbiddenTitle
=
'批量禁用'
;
this
.
forbiddenDialog
=
true
;
}
this
.
batchUpdate
(
type
,
giftIdList
);
},
// batchRequest(params) {
batchRequest
()
{
console
.
log
(
'批量删除'
);
batchUpdate
(
type
,
giftIdList
){
console
.
log
(
'批量处理'
);
let
params
=
{
type
:
type
,
giftIdList
:
giftIdList
};
batchUpdate
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
});
},
changeShow
(
value
){
console
.
log
(
'更改隐藏状态'
,
value
);
this
.
getTableList
();
},
// 删除
deleteList
(){
console
.
log
(
'删除数据'
);
},
// 更新名字
handleName
(
item
)
{
console
.
log
(
'更改商品名称'
,
item
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment