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
bfc9fabc
Commit
bfc9fabc
authored
Feb 17, 2021
by
萱草
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 礼品管理
parent
035e7412
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
566 additions
and
144 deletions
+566
-144
gift.js
src/api/gift.js
+14
-2
update-cost.vue
src/views/gift-manage/module/update-cost.vue
+27
-5
update-multi-cost.vue
src/views/gift-manage/module/update-multi-cost.vue
+55
-14
update-multi-stock.vue
src/views/gift-manage/module/update-multi-stock.vue
+76
-29
update-name.vue
src/views/gift-manage/module/update-name.vue
+29
-31
update-stock.vue
src/views/gift-manage/module/update-stock.vue
+33
-9
update-virtual-stock.vue
src/views/gift-manage/module/update-virtual-stock.vue
+250
-0
real-gift-detail.vue
src/views/gift-manage/real-gift-detail.vue
+4
-4
real-gift.vue
src/views/gift-manage/real-gift.vue
+0
-0
stock-record.vue
src/views/gift-manage/stock-record.vue
+39
-45
virtual-gift-detail.vue
src/views/gift-manage/virtual-gift-detail.vue
+36
-2
virtual-gift.vue
src/views/gift-manage/virtual-gift.vue
+3
-3
No files found.
src/api/gift.js
View file @
bfc9fabc
...
...
@@ -39,13 +39,25 @@ let realGift = {
giftStandardValueNew
:
'/gift/spec-value-save'
,
// 规格值新建
giftStandardValueList
:
'/gift/spec-value-list'
,
// 规格值查询
virtualCardList
:
'/gift/vir-card-page'
,
// 虚拟礼品卡券卡密列表
virtualUploadLog
:
'/gift/vir-card-log-page'
,
// 库存上传记录
virtualUploadLog
:
{
url
:
'/gift/vir-card-log-page'
,
method
:
'post'
},
// 库存上传记录
batchUpdate
:
{
url
:
'/gift/batch-update'
,
method
:
'post'
},
},
// 批量操作
realCostUpdate
:
{
url
:
'/gift/real-cost-updat'
,
method
:
'post'
},
// 实物礼品调整成本
realStockUpdate
:
{
url
:
'/gift/real-stock-update'
,
method
:
'post'
},
// 实物礼品调整库存
getPickupList
:
'/pickup/get-pickup-list'
,
// 获取自提点列表
getGiftShopList
:
'/gift/get-gift-shop-list'
,
// 获取当前礼品的自提点
updateName
:
'/gift/update-name'
,
// 修改礼品名称
};
realGift
=
getFetch
(
realGift
,
welfarePrefix
);
...
...
src/views/gift-manage/module/update-cost.vue
View file @
bfc9fabc
...
...
@@ -2,7 +2,7 @@
<el-dialog
title=
"调整成本费用"
:visible
.
sync=
"dialogVisible"
width=
"500px"
@
close=
"cancelSubmit()"
>
<div
v-loading=
"loading"
>
<el-input-number
v-model=
"updateCostData.costPrice"
precision=
"2"
:min=
"0"
:max=
"999999.99"
style=
"width:400px"
></el-input-number>
<el-input
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"updateCostData.textarea"
:max
=
"240"
></el-input>
<el-input
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"updateCostData.textarea"
:max
length=
"240"
show-word-limit
></el-input>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelSubmit()"
>
取消
</el-button>
...
...
@@ -13,6 +13,8 @@
<
script
>
// import request from '../service/request.js';
import
api
from
'@/api/gift.js'
;
const
{
realCostUpdate
}
=
api
;
export
default
{
props
:
{
updateCostData
:
{
...
...
@@ -33,10 +35,30 @@ export default {
},
methods
:
{
submitProNanme
()
{
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateCost'
);
},
10
);
if
(
this
.
loading
)
return
;
if
(
!
this
.
updateCostData
.
costPrice
){
this
.
$message
.
error
(
'请完善成本'
);
}
if
(
!
this
.
updateCostData
.
textarea
){
this
.
$message
.
error
(
'请完善备注'
);
}
this
.
loading
=
true
;
let
params
=
{
giftId
:
this
.
updateCostData
.
id
,
costPrice
:
this
.
updateCostData
.
costPrice
,
remark
:
this
.
updateCostData
.
textarea
};
realCostUpdate
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
'000'
){
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateCost'
);
},
10
);
this
.
$message
.
success
(
'修改成功'
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
}).
finally
(()
=>
this
.
loading
=
false
);
},
// 取消修改
cancelSubmit
()
{
...
...
src/views/gift-manage/module/update-multi-cost.vue
View file @
bfc9fabc
...
...
@@ -14,11 +14,11 @@
</el-table-column>
<el-table-column
label=
"成本费用"
>
<
template
slot-scope=
"scope"
>
<dm-input-amount
width=
"200px"
@
change=
"changeSingleCost(scope.row.giftId, scope.row.costPrice)"
v-model
.
trim=
"scope.row.costPrice"
precision=
"2"
:min=
"0"
:max=
"999999.99"
></dm-input-amount>
<dm-input-amount
width=
"200px"
@
change=
"changeSingleCost(scope.row.gift
Sku
Id, scope.row.costPrice)"
v-model
.
trim=
"scope.row.costPrice"
precision=
"2"
:min=
"0"
:max=
"999999.99"
></dm-input-amount>
</
template
>
</el-table-column>
</el-table>
<el-input
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"updateCostData.textarea"
:max=
"240"
></el-input>
<el-input
class=
"mt20"
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"updateCostData.textarea"
:maxlength=
"240"
show-word-limit
></el-input>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelSubmit()"
>
取消
</el-button>
...
...
@@ -29,6 +29,8 @@
<
script
>
// import request from '../service/request.js';
import
api
from
'@/api/gift.js'
;
const
{
realCostUpdate
}
=
api
;
export
default
{
props
:
{
updateCostData
:
{
...
...
@@ -48,36 +50,37 @@ export default {
color
:
'红色'
,
size
:
'L'
,
costPrice
:
'10'
,
giftId
:
'1111'
gift
Sku
Id
:
'1111'
},
{
color
:
'红色'
,
size
:
'XL'
,
costPrice
:
'20'
,
giftId
:
'2222'
gift
Sku
Id
:
'2222'
},
{
color
:
'红色'
,
size
:
'M'
,
costPrice
:
'30'
,
giftId
:
'3333'
gift
Sku
Id
:
'3333'
},
{
color
:
'黑色'
,
size
:
'L'
,
costPrice
:
'10'
,
giftId
:
'4444'
gift
Sku
Id
:
'4444'
},
{
color
:
'黑色'
,
size
:
'M'
,
costPrice
:
'20'
,
giftId
:
'55555'
gift
Sku
Id
:
'55555'
}
],
spanArr
:
[],
// 用于存放每一行记录的合并数
// costChangeObj: [], // 用于存放批量修改后的数据
banthCost
:
''
banthCost
:
''
,
updateList
:
[]
};
},
mounted
()
{
...
...
@@ -90,10 +93,27 @@ export default {
console
.
log
(
'获取成本数据'
);
},
submitProNanme
()
{
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateCost'
);
},
10
);
if
(
this
.
loading
)
return
;
if
(
!
this
.
updateCostData
.
textarea
){
this
.
$message
.
error
(
'请完善备注'
);
}
this
.
loading
=
true
;
let
params
=
{
giftId
:
this
.
updateCostData
.
id
,
updateList
:
this
.
updateList
,
remark
:
this
.
updateCostData
.
textarea
};
realCostUpdate
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
'000'
){
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateCost'
);
},
10
);
this
.
$message
.
success
(
'修改成功'
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
}).
finally
(()
=>
this
.
loading
=
false
);
},
// 取消修改
cancelSubmit
()
{
...
...
@@ -141,13 +161,34 @@ export default {
// this.costChangeObj[item].costPrice = this.banthCost;
// // this.costChangeObj[item].stockType = this.stockType;
// }
this
.
updateList
=
[];
this
.
tableData
.
forEach
(
item
=>
{
item
.
costPrice
=
this
.
banthCost
;
this
.
updateList
.
push
({
giftSkuId
:
item
.
giftSkuId
,
costPrice
:
item
.
costPrice
});
});
console
.
log
(
this
.
tableData
);
// console.log(this.tableData);
console
.
log
(
this
.
updateList
);
},
changeSingleCost
(
id
,
cost
){
console
.
log
(
this
.
tableData
);
if
(
!
cost
){
this
.
$message
.
error
(
'请完善成本'
);
}
if
(
this
.
updateList
.
length
>
0
){
let
iii
;
let
result
=
this
.
updateList
.
some
((
item
,
index
)
=>
{
if
(
item
.
giftSkuId
==
id
){
iii
=
index
;
return
true
;
}
});
if
(
result
){
// 如果存在
this
.
updateList
[
iii
].
costPrice
=
cost
;
}
else
{
this
.
updateList
.
push
({
giftSkuId
:
id
,
costPrice
:
cost
});
}
}
else
{
this
.
updateList
.
push
({
giftSkuId
:
id
,
costPrice
:
cost
});
}
}
}
};
...
...
src/views/gift-manage/module/update-multi-stock.vue
View file @
bfc9fabc
...
...
@@ -3,10 +3,10 @@
<div
v-loading=
"loading"
>
<div
class=
"fr mb20"
>
<el-select
v-model=
"stockType"
style=
"width:100px;margin-right:10px"
>
<el-option
label=
"增加"
:value=
"
1
"
></el-option>
<el-option
label=
"减少"
:value=
"
2
"
></el-option>
<el-option
label=
"增加"
:value=
"
0
"
></el-option>
<el-option
label=
"减少"
:value=
"
1
"
></el-option>
</el-select>
<el-input
placeholder=
"输入库存"
style=
"width:85px;margin-right:10px"
v-model=
"banthStock"
precision=
"
2
"
:min=
"0"
:max=
"999999"
></el-input>
<el-input
placeholder=
"输入库存"
style=
"width:85px;margin-right:10px"
v-model=
"banthStock"
precision=
"
0
"
:min=
"0"
:max=
"999999"
></el-input>
<el-button
type=
"primary"
@
click=
"handleStock"
>
批量填充
</el-button>
</div>
<el-table
:data=
"tableData"
:span-method=
"objectSpanMethod"
border
>
...
...
@@ -22,18 +22,18 @@
<el-table-column
label=
"增加/减少"
width=
"150px"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.stockType"
style=
"width:100px"
>
<el-option
label=
"增加"
:value=
"
1
"
></el-option>
<el-option
label=
"减少"
:value=
"
2
"
></el-option>
<el-option
label=
"增加"
:value=
"
0
"
></el-option>
<el-option
label=
"减少"
:value=
"
1
"
></el-option>
</el-select>
</
template
>
</el-table-column>
<el-table-column
label=
"库存"
>
<
template
slot-scope=
"scope"
>
<dm-input-amount
width=
"200px"
@
change=
"changeSingleStock(scope.row.gift
Id, scope.row.costPrice)"
v-model
.
trim=
"scope.row.stock"
precision=
"2
"
:min=
"0"
:max=
"999999"
></dm-input-amount>
<dm-input-amount
width=
"200px"
@
change=
"changeSingleStock(scope.row.gift
SkuId, scope.row.stock, scope.row.stockType)"
v-model
.
trim=
"scope.row.stock"
precision=
"0
"
:min=
"0"
:max=
"999999"
></dm-input-amount>
</
template
>
</el-table-column>
</el-table>
<el-input
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"stockData.textarea"
:max=
"240"
></el-input>
<el-input
type=
"textarea"
class=
"mt20"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"textarea"
:maxlength=
"240"
show-word-limit
></el-input>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelSubmit()"
>
取消
</el-button>
...
...
@@ -44,6 +44,8 @@
<
script
>
// import request from '../service/request.js';
import
api
from
'@/api/gift.js'
;
const
{
realStockUpdate
}
=
api
;
export
default
{
props
:
{
stockData
:
{
...
...
@@ -63,7 +65,7 @@ export default {
color
:
'红色'
,
size
:
'L'
,
remainedStock
:
'10'
,
giftId
:
'1111'
,
gift
Sku
Id
:
'1111'
,
stock
:
'10'
,
stockType
:
1
},
...
...
@@ -71,7 +73,7 @@ export default {
color
:
'红色'
,
size
:
'XL'
,
remainedStock
:
'20'
,
giftId
:
'2222'
,
gift
Sku
Id
:
'2222'
,
stock
:
'20'
,
stockType
:
1
},
...
...
@@ -79,7 +81,7 @@ export default {
color
:
'红色'
,
size
:
'M'
,
remainedStock
:
'30'
,
giftId
:
'3333'
,
gift
Sku
Id
:
'3333'
,
stock
:
'12'
,
stockType
:
1
},
...
...
@@ -87,7 +89,7 @@ export default {
color
:
'黑色'
,
size
:
'L'
,
remainedStock
:
'10'
,
giftId
:
'4444'
,
gift
Sku
Id
:
'4444'
,
stock
:
'13'
,
stockType
:
1
},
...
...
@@ -95,7 +97,7 @@ export default {
color
:
'黑色'
,
size
:
'M'
,
remainedStock
:
'20'
,
giftId
:
'55555'
,
gift
Sku
Id
:
'55555'
,
stock
:
'14'
,
stockType
:
1
}
...
...
@@ -103,7 +105,9 @@ export default {
spanArr
:
[],
// 用于存放每一行记录的合并数
// costChangeObj: [], // 用于存放批量修改后的数据
banthStock
:
''
,
stockType
:
1
stockType
:
0
,
updateList
:
[],
textarea
:
''
};
},
mounted
()
{
...
...
@@ -116,10 +120,24 @@ export default {
console
.
log
(
'获取成本数据'
);
},
submitProNanme
()
{
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateStock'
);
},
10
);
if
(
this
.
loading
)
return
;
let
params
=
{
giftId
:
this
.
stockData
.
id
,
updateList
:
this
.
updateList
,
remark
:
this
.
textarea
};
this
.
loading
=
true
;
realStockUpdate
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
'0000'
){
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateStock'
);
},
10
);
this
.
$message
.
success
(
'修改成功'
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
}).
finally
(()
=>
this
.
loading
=
false
);
},
// 取消修改
cancelSubmit
()
{
...
...
@@ -167,21 +185,50 @@ export default {
// this.costChangeObj[item].costPrice = this.banthCost;
// // this.costChangeObj[item].stockType = this.stockType;
// }
if
(
this
.
stockType
===
1
){
this
.
tableData
.
forEach
(
item
=>
{
item
.
stock
=
Number
(
item
.
stock
)
+
Number
(
this
.
banthStock
);
item
.
stockType
=
this
.
stockType
;
this
.
updateList
=
[];
// if(this.stockType === 1){
// this.tableData.forEach(item => {
// // item.stock = Number(item.stock) + Number(this.banthStock);
// item.stock = this.banthStock;
// item.stockType = this.stockType;
// this.updateList.push({ giftSkuId: item.giftSkuId, stock: item.stock, stockType: item.stockType });
// });
// }else{
// this.tableData.forEach(item => {
// // item.stock = Number(item.stock) - Number(this.banthStock);
// item.stock = this.banthStock;
// item.stockType = this.stockType;
// this.updateList.push({ giftSkuId: item.giftSkuId, stock: item.stock, stockType: item.stockType });
// });
// }
this
.
tableData
.
forEach
(
item
=>
{
item
.
stock
=
this
.
banthStock
;
item
.
stockType
=
this
.
stockType
;
this
.
updateList
.
push
({
giftSkuId
:
item
.
giftSkuId
,
stock
:
item
.
stock
,
stockType
:
item
.
stockType
});
});
console
.
log
(
this
.
updateList
);
},
changeSingleStock
(
id
,
stock
,
stockType
){
if
(
!
stock
){
this
.
$message
.
error
(
'请完善库存'
);
}
if
(
this
.
updateList
.
length
>
0
){
let
iii
;
let
result
=
this
.
updateList
.
some
((
item
,
index
)
=>
{
if
(
item
.
giftSkuId
==
id
){
iii
=
index
;
return
true
;
}
});
if
(
result
){
// 如果存在
this
.
updateList
[
iii
].
stock
=
stock
;
}
else
{
this
.
updateList
.
push
({
giftSkuId
:
id
,
stock
:
stock
,
stockType
:
stockType
});
}
}
else
{
this
.
tableData
.
forEach
(
item
=>
{
item
.
stock
=
Number
(
item
.
stock
)
-
Number
(
this
.
banthStock
);
item
.
stockType
=
this
.
stockType
;
});
this
.
updateList
.
push
({
giftSkuId
:
id
,
stock
:
stock
,
stockType
:
stockType
});
}
console
.
log
(
this
.
tableData
);
},
changeSingleStock
(
id
,
cost
){
console
.
log
(
this
.
tableData
);
console
.
log
(
this
.
updateList
);
}
}
};
...
...
src/views/gift-manage/module/update-name.vue
View file @
bfc9fabc
<
template
>
<el-dialog
title=
"修改礼品名称"
:visible
.
sync=
"dialogVisible"
width=
"600px"
@
close=
"cancelSubmit('editInfoModal')"
>
<el-form
:model=
"editInfoModal"
ref=
"editInfoModal"
:rules=
"modalRules"
:label-position=
"labelPosition"
v-loading=
"loading"
>
<el-form-item
label=
"礼品名称"
label-width=
"80px"
prop=
"
goodsN
ame"
style=
"width:560px"
>
<dm-input
type=
"text"
v-model=
"editInfoModal.
goodsN
ame"
:byte-type=
"1"
:maxlength=
"30"
>
</dm-input>
<el-form-item
label=
"礼品名称"
label-width=
"80px"
prop=
"
n
ame"
style=
"width:560px"
>
<dm-input
type=
"text"
v-model=
"editInfoModal.
n
ame"
:byte-type=
"1"
:maxlength=
"30"
>
</dm-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -14,6 +14,8 @@
<
script
>
// import request from '../service/request.js';
// import api from '@/api/gift.js';
// const { updateName } = api;
export
default
{
props
:
{
updateNameForm
:
{
...
...
@@ -42,41 +44,37 @@ export default {
mounted
()
{
this
.
dialogVisible
=
true
;
// this.editInfoModal.goodsName = this.updateNameForm.name;
//
this.editInfoModal.goodsId = this.updateNameForm.id;
this
.
editInfoModal
.
goodsId
=
this
.
updateNameForm
.
id
;
},
methods
:
{
submitProNanme
(
formName
)
{
console
(
'修改礼品名称'
);
// if(this.loading) return;
// this.$refs[formName].validate(valid => {
// if (valid) {
// let params = {
// goodsId: this.editInfoModal.goodsId,
// goodsName: this.editInfoModal.goodsName
// };
// this.loading = true;
// // request.post('/api-integral-mall/update-integral-gift-info', params).then(res => {
// // if (res.data.code === '0000') {
// // this.dialogVisible = false;
// // setInterval(() => {
// // this.$emit('closeUpdateName');
// // }, 10);
// // this.$message.success('修改成功');
// // this.$emit('getList');
// // } else {
// // this.$message.error(res.data.message);
// // }
// // }).finally(() => this.loading = false);
// } else {
// return false;
// }
// });
submitProNanme
()
{
if
(
this
.
loading
)
return
;
let
params
=
{
giftId
:
this
.
editInfoModal
.
goodsId
,
name
:
this
.
editInfoModal
.
goodsName
};
this
.
loading
=
true
;
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateName'
);
},
10
);
console
.
log
(
params
);
// updateName(params).then(res => {
// if(res.code === '0000'){
// console.log(res.data);
// this.dialogVisible = false;
// setInterval(() => {
// this.$emit('closeUpdateName');
// }, 10);
// this.$message.success('修改成功');
// }else{
// this.$message.error(res.message);
// }
// }).finally(() => this.loading = false);
},
// 取消修改
cancelSubmit
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
();
// this.editInfoModal.goodsName = '';
// this.editInfoModal.goodsId = '';
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateName'
);
...
...
src/views/gift-manage/module/update-stock.vue
View file @
bfc9fabc
...
...
@@ -2,11 +2,11 @@
<el-dialog
title=
"调整库存"
:visible
.
sync=
"dialogVisible"
width=
"500px"
@
close=
"cancelSubmit()"
>
<div
v-loading=
"loading"
>
<el-select
v-model=
"stockType"
style=
"width:100px;display:inline-block;margin-right:10px"
>
<el-option
label=
"增加"
:value=
"
1
"
></el-option>
<el-option
label=
"减少"
:value=
"
2
"
></el-option>
<el-option
label=
"增加"
:value=
"
0
"
></el-option>
<el-option
label=
"减少"
:value=
"
1
"
></el-option>
</el-select>
<el-input-number
v-model=
"stock
Data.remainedStock"
precision=
"2
"
:min=
"0"
:max=
"999999"
style=
"width:300px"
></el-input-number>
<el-input
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"stockData.textarea"
:max=
"240"
></el-input>
<el-input-number
v-model=
"stock
"
precision=
"0
"
:min=
"0"
:max=
"999999"
style=
"width:300px"
></el-input-number>
<el-input
class=
"mt20"
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"textarea"
:maxlength=
"240"
show-word-limit
></el-input>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelSubmit()"
>
取消
</el-button>
...
...
@@ -17,6 +17,8 @@
<
script
>
// import request from '../service/request.js';
import
api
from
'@/api/gift.js'
;
const
{
realStockUpdate
}
=
api
;
export
default
{
props
:
{
stockData
:
{
...
...
@@ -30,7 +32,9 @@ export default {
return
{
dialogVisible
:
false
,
loading
:
false
,
stockType
:
1
stockType
:
0
,
stock
:
''
,
textarea
:
''
};
},
mounted
()
{
...
...
@@ -39,10 +43,30 @@ export default {
},
methods
:
{
submitProNanme
()
{
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateStock'
);
},
10
);
if
(
this
.
loading
)
return
;
let
params
=
{
giftId
:
this
.
stockData
.
id
,
updateList
:
[
{
giftSkuId
:
''
,
stock
:
this
.
stock
,
stockType
:
this
.
stockType
}
],
remark
:
this
.
textarea
};
this
.
loading
=
true
;
realStockUpdate
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
'0000'
){
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateStock'
);
},
10
);
this
.
$message
.
success
(
'修改成功'
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
}).
finally
(()
=>
this
.
loading
=
false
);
},
// 取消修改
cancelSubmit
()
{
...
...
src/views/gift-manage/module/update-virtual-stock.vue
0 → 100644
View file @
bfc9fabc
<
template
>
<el-dialog
title=
"调整库存"
:visible
.
sync=
"dialogVisible"
width=
"750px"
@
close=
"cancelSubmit()"
>
<div
v-loading=
"loading"
>
<el-input
type=
"textarea"
:rows=
"3"
placeholder=
"请填入调整备注"
v-model=
"textarea"
:maxlength=
"240"
show-word-limit
></el-input>
<div
class=
"upload-btn mt20"
>
<el-upload
class=
"upload-ele"
show-file-list
:action=
"uploadAction"
:on-success=
"uploadFile"
with-credentials
>
<el-button><i
class=
"el-icon-upload2"
style=
"margin-right:5px"
></i>
点击上传
</el-button>
</el-upload>
</div>
<div
class=
"uploadText"
>
<p
class=
"mt10"
>
1.发放内容内部模板导出,点击
<el-button
type=
"text"
>
下载模板
</el-button>
;
</p>
<p>
2.填充空缺内容,导出所有项均为必填项;
</p>
<p>
3.请勿导入重复的内容,导入的内容在原来基础上增加库存;
</p>
<p>
4.上传完整仅支持.xlsx .xls文件的导入,填充数据不超过“10万”条;
</p>
</div>
</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
{
realStockUpdate
}
=
api
;
export
default
{
props
:
{
stockData
:
{
type
:
Object
,
default
()
{
return
{};
}
}
},
data
()
{
return
{
dialogVisible
:
false
,
loading
:
false
,
// tableData: [],
tableData
:
[
{
color
:
'红色'
,
size
:
'L'
,
remainedStock
:
'10'
,
giftSkuId
:
'1111'
,
stock
:
'10'
,
stockType
:
1
},
{
color
:
'红色'
,
size
:
'XL'
,
remainedStock
:
'20'
,
giftSkuId
:
'2222'
,
stock
:
'20'
,
stockType
:
1
},
{
color
:
'红色'
,
size
:
'M'
,
remainedStock
:
'30'
,
giftSkuId
:
'3333'
,
stock
:
'12'
,
stockType
:
1
},
{
color
:
'黑色'
,
size
:
'L'
,
remainedStock
:
'10'
,
giftSkuId
:
'4444'
,
stock
:
'13'
,
stockType
:
1
},
{
color
:
'黑色'
,
size
:
'M'
,
remainedStock
:
'20'
,
giftSkuId
:
'55555'
,
stock
:
'14'
,
stockType
:
1
}
],
spanArr
:
[],
// 用于存放每一行记录的合并数
// costChangeObj: [], // 用于存放批量修改后的数据
banthStock
:
''
,
stockType
:
0
,
updateList
:
[],
textarea
:
''
,
// uploadAction: window.location.origin + '/api-marketing/upload/upload-image?requestProject=marketing',
uploadAction
:
'https://four.gicdev.com/api-marketing/upload/upload-image?requestProject=marketing'
,
};
},
mounted
()
{
this
.
dialogVisible
=
true
;
this
.
getData
();
this
.
getSpanArr
(
this
.
tableData
);
},
methods
:
{
getData
(){
console
.
log
(
'获取成本数据'
);
},
submitProNanme
()
{
if
(
this
.
loading
)
return
;
let
params
=
{
giftId
:
this
.
stockData
.
id
,
updateList
:
this
.
updateList
,
remark
:
this
.
textarea
};
this
.
loading
=
true
;
realStockUpdate
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
'0000'
){
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateStock'
);
},
10
);
this
.
$message
.
success
(
'修改成功'
);
}
else
{
this
.
$message
.
error
(
res
.
message
);
}
}).
finally
(()
=>
this
.
loading
=
false
);
},
// 取消修改
cancelSubmit
()
{
this
.
dialogVisible
=
false
;
setInterval
(()
=>
{
this
.
$emit
(
'closeUpdateStock'
);
},
10
);
},
uploadFile
(
file
){
console
.
log
(
file
);
},
// 合并单元格,行合并
getSpanArr
(
data
)
{
// data就是我们从后台拿到的数据
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
i
===
0
)
{
this
.
spanArr
.
push
(
1
);
this
.
pos
=
0
;
}
else
{
// 判断当前元素与上一个元素是否相同
if
(
data
[
i
].
color
===
data
[
i
-
1
].
color
)
{
this
.
spanArr
[
this
.
pos
]
+=
1
;
this
.
spanArr
.
push
(
0
);
}
else
{
this
.
spanArr
.
push
(
1
);
this
.
pos
=
i
;
}
}
// console.log(this.spanArr);
}
},
objectSpanMethod
({
row
,
column
,
rowIndex
,
columnIndex
})
{
// if (columnIndex === 0 || columnIndex === 1) {
if
(
columnIndex
===
0
)
{
const
_row
=
this
.
spanArr
[
rowIndex
];
const
_col
=
_row
>
0
?
1
:
0
;
// console.log(`rowspan:${_row} colspan:${_col}`);
return
{
// [0,0] 表示这一行不显示, [2,1]表示行的合并数
rowspan
:
_row
,
colspan
:
_col
};
}
},
// 批量修改成本
handleStock
(){
// for (let item in this.costChangeObj) {
// this.costChangeObj[item].costPrice = this.banthCost;
// // this.costChangeObj[item].stockType = this.stockType;
// }
this
.
updateList
=
[];
// if(this.stockType === 1){
// this.tableData.forEach(item => {
// // item.stock = Number(item.stock) + Number(this.banthStock);
// item.stock = this.banthStock;
// item.stockType = this.stockType;
// this.updateList.push({ giftSkuId: item.giftSkuId, stock: item.stock, stockType: item.stockType });
// });
// }else{
// this.tableData.forEach(item => {
// // item.stock = Number(item.stock) - Number(this.banthStock);
// item.stock = this.banthStock;
// item.stockType = this.stockType;
// this.updateList.push({ giftSkuId: item.giftSkuId, stock: item.stock, stockType: item.stockType });
// });
// }
this
.
tableData
.
forEach
(
item
=>
{
item
.
stock
=
this
.
banthStock
;
item
.
stockType
=
this
.
stockType
;
this
.
updateList
.
push
({
giftSkuId
:
item
.
giftSkuId
,
stock
:
item
.
stock
,
stockType
:
item
.
stockType
});
});
console
.
log
(
this
.
updateList
);
},
changeSingleStock
(
id
,
stock
,
stockType
){
if
(
!
stock
){
this
.
$message
.
error
(
'请完善库存'
);
}
if
(
this
.
updateList
.
length
>
0
){
let
iii
;
let
result
=
this
.
updateList
.
some
((
item
,
index
)
=>
{
if
(
item
.
giftSkuId
==
id
){
iii
=
index
;
return
true
;
}
});
if
(
result
){
// 如果存在
this
.
updateList
[
iii
].
stock
=
stock
;
}
else
{
this
.
updateList
.
push
({
giftSkuId
:
id
,
stock
:
stock
,
stockType
:
stockType
});
}
}
else
{
this
.
updateList
.
push
({
giftSkuId
:
id
,
stock
:
stock
,
stockType
:
stockType
});
}
console
.
log
(
this
.
updateList
);
}
}
};
</
script
>
<
style
scoped
>
.upload-btn
{
height
:
40px
;
border
:
1px
dashed
rgba
(
192
,
196
,
204
,
1
);
display
:
inline-block
;
font-size
:
14px
;
color
:
#c0c4cc
;
cursor
:
pointer
;
margin-right
:
10px
;
width
:
250px
;
border-radius
:
4px
;
}
.upload-btn
.el-icon-upload2
{
font-size
:
18px
;
color
:
#c0c4cc
;
}
.upload-btn
:hover
{
border-color
:
#1890ff
;
}
.upload-ele
.el-button
{
border
:
none
;
color
:
#c0c4cc
;
margin-left
:
60px
;
}
.upload-ele
.el-button--small
{
padding
:
0
;
}
.uploadText
p
{
line-height
:
26px
;
}
</
style
>
src/views/gift-manage/real-gift-detail.vue
View file @
bfc9fabc
...
...
@@ -292,12 +292,12 @@ export default {
};
let
validateGoodsIntegral
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
&&
value
!=
0
)
{
this
.
$message
.
error
(
'
积分
不能为空'
);
return
callback
(
new
Error
(
'
积分
不能为空'
));
this
.
$message
.
error
(
'
成本
不能为空'
);
return
callback
(
new
Error
(
'
成本
不能为空'
));
}
else
{
if
(
Number
(
value
)
>
9999999
){
this
.
$message
.
error
(
'
积分
最大为7位数'
);
return
callback
(
new
Error
(
'
积分
最大为7位数'
));
this
.
$message
.
error
(
'
成本
最大为7位数'
);
return
callback
(
new
Error
(
'
成本
最大为7位数'
));
}
callback
();
}
...
...
src/views/gift-manage/real-gift.vue
View file @
bfc9fabc
This diff is collapsed.
Click to expand it.
src/views/gift-manage/stock-record.vue
View file @
bfc9fabc
...
...
@@ -8,8 +8,8 @@
<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=
"date
timerange"
align=
"right"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']
"
></el-date-picker>
<el-input
placeholder=
"请输入操作人姓名搜索"
prefix-icon=
"el-icon-search"
v-model=
"
creatorName
"
class=
"mr10 w220"
clearable
@
keyup
.
enter
.
native=
"getSearchList"
@
clear=
"getSearchList"
></el-input>
<el-date-picker
v-model=
"timeValue"
type=
"date
range"
@
change=
"changeTime"
align=
"right"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期
"
></el-date-picker>
</div>
<div
class=
"table-content"
v-loading=
"loading"
>
<el-table
:data=
"tableData"
ref=
"multipleTable"
style=
"width: 100%"
>
...
...
@@ -28,7 +28,7 @@
</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>
<dm-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"
currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"
pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
v-if=
"total != 0"
>
</dm-pagination>
</div>
</div>
</div>
...
...
@@ -45,7 +45,7 @@
import
{
page
,
formate
}
from
'@/mixins/table.js'
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
import
api
from
'@/api/gift.js'
;
const
{
giftPage
}
=
api
;
const
{
virtualUploadLog
}
=
api
;
export
default
{
components
:
{
// klal
...
...
@@ -60,16 +60,9 @@ export default {
breadName
:
'库存上传记录'
}
],
formatDateTimeByType
,
// activeName: '0',
mixins
:
[
page
,
formate
],
listParams
:
{
search
:
''
,
search2
:
''
,
startTime
:
''
,
endTime
:
''
,
currentPage
:
1
,
pageSize
:
20
,
},
proType
:
''
,
status
:
''
,
batchOperate
:
''
,
...
...
@@ -110,33 +103,29 @@ export default {
}
],
loading
:
false
,
// 搜索条件
search
:
''
,
giftId
:
''
,
giftName
:
''
,
giftNo
:
''
,
creatorName
:
''
,
startTime
:
''
,
endTime
:
''
,
currentPage
:
1
,
pageSize
:
20
,
searchType
:
1
,
placeholderText
:
'请输入关键词搜索'
,
isShow
:
false
,
timeValue
:
''
,
timeValue
:
[
new
Date
()
-
7
*
24
*
60
*
60
*
1000
,
new
Date
().
valueOf
()
]
,
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
();
},
...
...
@@ -144,40 +133,45 @@ export default {
this
.
pageNum
=
1
;
this
.
getTableList
();
},
changeTime
(){
if
(
this
.
timeValue
){
this
.
startTime
=
this
.
formatDateTimeByType
(
this
.
timeValue
[
0
],
'yyyy-MM-dd'
);
this
.
endTime
=
this
.
formatDateTimeByType
(
this
.
timeValue
[
1
],
'yyyy-MM-dd'
);
}
else
{
this
.
startTime
=
''
;
this
.
endTime
=
''
;
};
this
.
currentPage
=
1
;
this
.
pageSize
=
20
;
this
.
getTableList
();
},
// 列表筛选条件更改
handleChangeType
()
{
if
(
this
.
searchType
===
1
)
{
this
.
placeholderText
=
'请输入礼品名称'
;
this
.
giftName
=
this
.
search
;
}
else
if
(
this
.
searchType
===
2
)
{
this
.
placeholderText
=
'请输入礼品编码'
;
this
.
giftNo
=
this
.
search
;
}
else
if
(
this
.
searchType
===
3
)
{
this
.
placeholderText
=
'条形码'
;
}
else
if
(
this
.
searchType
===
4
)
{
this
.
placeholderText
=
'福利id'
;
this
.
giftId
=
this
.
search
;
}
},
// 实物礼品列表
getTableList
()
{
console
.
log
(
'获取列表详情'
);
let
params
=
{
giftType
:
'1'
,
startTime
:
''
,
startStock
:
''
,
startCostPrice
:
''
,
sortOrder
:
''
,
sortColumn
:
''
,
pageSize
:
''
,
pageNum
:
''
,
hiddenFlag
:
''
,
giftNo
:
''
,
giftName
:
''
,
giftId
:
''
,
giftBarNo
:
''
,
endTime
:
''
,
endStock
:
''
,
endCostPrice
:
''
giftNo
:
this
.
giftNo
,
giftName
:
this
.
giftName
,
giftId
:
this
.
giftId
,
creatorName
:
this
.
creatorName
,
pageNum
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
,
startTime
:
this
.
startTime
,
endTime
:
this
.
endTime
};
giftPage
(
params
).
then
(
res
=>
{
virtualUploadLog
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
this
.
tableData
=
res
.
result
;
console
.
log
(
this
.
tableData
);
...
...
src/views/gift-manage/virtual-gift-detail.vue
View file @
bfc9fabc
...
...
@@ -90,7 +90,7 @@
<p>
1.上传完整仅支持.xlsx .xls文件的导入,填充数据不超过“10万”条;
</p>
</div>
</div>
<el-button
class=
"mt10"
type=
"primary"
>
保存
</el-button>
<el-button
class=
"mt10"
type=
"primary"
@
click=
"saveDescription"
>
保存
</el-button>
</
template
>
</el-form-item>
<el-form-item
label=
"库存消耗方式"
prop=
"checkList"
>
...
...
@@ -230,7 +230,8 @@ export default {
giftSkuCode
:
''
,
skuBarCode
:
''
},
dialogVisible
:
false
dialogVisible
:
false
,
description
:
''
};
},
mounted
()
{
...
...
@@ -260,6 +261,39 @@ export default {
return
'star'
;
}
},
handleChange2
(
value
){
this
.
description
=
value
;
console
.
log
(
this
.
goodsForm
.
giftDescrption
);
},
saveDescription
(){
console
.
log
(
this
.
description
);
let
index
=
this
.
description
.
indexOf
(
'{'
);
// 字符出现的位置
let
indexCopy
;
let
index2
=
this
.
description
.
indexOf
(
'}'
);
// 字符出现的位置
// let index3Copy = index2;
let
num2
=
0
;
// 这个字符出现的次数
let
num
=
0
;
// 这个字符出现的次数
while
(
index
!==
-
1
)
{
console
.
log
(
index
);
// 打印字符串出现的位置
indexCopy
=
index
;
num
++
;
// 每出现一次 次数加一
index
=
this
.
description
.
indexOf
(
'{'
,
index
+
1
);
// 从字符串出现的位置的下一位置开始继续查找
console
.
log
(
index
,
indexCopy
);
console
.
log
(
index
-
indexCopy
==
1
);
if
(
index
-
indexCopy
==
1
){
this
.
$message
.
error
(
'{}不能嵌套出现'
);
}
}
while
(
index2
!==
-
1
)
{
console
.
log
(
index2
);
// 打印字符串出现的位置
num2
++
;
// 每出现一次 次数加一
index2
=
this
.
description
.
indexOf
(
'}'
,
index2
+
1
);
// 从字符串出现的位置的下一位置开始继续查找
}
console
.
log
(
num
,
num2
);
if
(
num
!==
num2
||
num
>
3
||
num2
>
3
){
this
.
$message
.
error
(
'请填写正确的格式'
);
}
},
changeDelivery
(
value
){
console
.
log
(
value
);
},
...
...
src/views/gift-manage/virtual-gift.vue
View file @
bfc9fabc
...
...
@@ -163,7 +163,7 @@
<update-name
:update-name-form=
"updateNameForm"
v-if=
"updateNameDialog"
@
closeUpdateName=
"closeUpdateName"
@
getTableList=
"getTableList"
></update-name>
<!-- 调整库存 -->
<!-- <update-stock :stock-data="stockData" v-if="StockDialog" @getTableList="getTableList" @closeUpdateStock="closeUpdateStock"></update-stock> -->
<update-
multi-stock
:stock-data=
"stockData"
v-if=
"StockDialog"
@
getTableList=
"getTableList"
@
closeUpdateStock=
"closeUpdateStock"
></update-multi
-stock>
<update-
virtual-stock
:stock-data=
"stockData"
v-if=
"StockDialog"
@
getTableList=
"getTableList"
@
closeUpdateStock=
"closeUpdateStock"
></update-virtual
-stock>
<!-- <goods-stock :stock-data="stockData" v-if="StockDialog" @getList="getList" @closeStock="closeStock"></goods-stock> -->
<!-- 多规格调整积分现金 -->
<!-- <update-sku-integral :integral-date="integralDate" v-if="integralDialog" @getList="getList" @closeIntegral="closeIntegral"></update-sku-integral> -->
...
...
@@ -179,7 +179,7 @@ import UpdateMultiCost from './module/update-multi-cost.vue';
// import common from '../../utils/common';
import
updateName
from
'./module/update-name.vue'
;
// import updateStock from './module/update-stock.vue';
import
update
MultiStock
from
'./module/update-multi
-stock.vue'
;
import
update
VirtualStock
from
'./module/update-virtual
-stock.vue'
;
import
checkUploadDetail
from
'./module/check-upload-detail'
;
// import updateSkuIntegral from '../../components/updateSkuIntegral';
// import { mapGetters } from 'vuex';
...
...
@@ -192,7 +192,7 @@ export default {
UpdateMultiCost
,
updateName
,
// updateStock,
update
Multi
Stock
,
update
Virtual
Stock
,
// goodsStock,
// updateSkuIntegral,
checkUploadDetail
,
...
...
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