Commit ebb75afb by 周子尧

Merge branch 'v1.2.0' of http://192.168.3.233:8090/saas/scrm-micro-marketing into v1.2.0

2 parents 2e0f85e5 6939434a
......@@ -26,7 +26,7 @@
</div>
</div>
</div>
<div slot="receiveDetails" class="edit-tips m-t-8">客户需要输入该{{ editForm.receiveWay == '0' ? '手机号' : '车架号后6位' }}才能成功领取</div>
<div slot="receiveDetails" class="edit-tips m-t-8">客户需要输入该{{ editForm.receiveWay == '1' ? '手机号' : '车架号后6位' }}才能成功领取</div>
<el-button slot="selectStaffBtn" class="el-icon-plus" @click="handleSelectStaff">选择员工</el-button>
<div slot="staffListBlock" class="sale-select" :style="{ 'margin-left': labelWidth }" v-show="editForm.staffList && editForm.staffList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper">
......@@ -55,10 +55,10 @@ export default {
data() {
return {
size: 'small',
title: '新增信息',
title: '新增礼包',
titleObj: {
add: '新增信息',
edit: '编辑信息'
add: '新增礼包',
edit: '编辑礼包'
},
footerLeft: '0',
footerWidth: '0',
......@@ -80,7 +80,7 @@ export default {
editForm: {
name: '',
remarkName: '',
receiveWay: '0',
receiveWay: '1',
receiveDetails: '',
staffList: [],
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
......@@ -152,7 +152,7 @@ export default {
if (!value) {
return callback()
}
if (this.editForm.receiveWay == '0') {
if (this.editForm.receiveWay == '1') {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的手机号'))
} else {
......@@ -198,11 +198,11 @@ export default {
optionLabel: 'confName',
optionList: [
{
confId: '0',
confId: '1',
confName: '指定手机号'
},
{
confId: '1',
confId: '2',
confName: '指定车架号后6位'
}
],
......@@ -271,10 +271,15 @@ export default {
this.$apis.giftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
res.data.couponList.forEach(item => {
item.id = item.couponId
item.anticipatedCost = item.couponAnticipatedCost
})
this.editForm = res.data
this.editForm.receiveWay = this.editForm.receiveWay + ''
this.recoveryCoupon()
this.recoveryTotalPrice()
this.hasStaffBlock(false)
this.$nextTick(() => {
this.editStatus = false
})
......@@ -295,8 +300,8 @@ export default {
receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '0' ? '请输入领取手机号' : '请输入领取车架号后6位'
this.editFormData[receiveDetailsIdx].maxlength = val == '0' ? 11 : 6
this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位'
this.editFormData[receiveDetailsIdx].maxlength = val == '1' ? 11 : 6
},
// 计算预估成本
......@@ -306,7 +311,7 @@ export default {
this.couponObj[item].list.forEach(subItem => {
// 失效券不加入预估成本
if (subItem.status != '3') {
this.totalEstimatedCost = this.totalEstimatedCost + subItem.couponAnticipatedCost * subItem.couponAmount
this.totalEstimatedCost = this.totalEstimatedCost + parseInt(subItem.couponAnticipatedCost) * parseInt(subItem.couponAmount)
}
})
})
......@@ -351,10 +356,10 @@ export default {
this.key = new Date()
},
hasStaffBlock() {
hasStaffBlock(isValidate = true) {
var idx = this.editFormData.findIndex(item => item.name == 'staffListBlock')
this.editFormData[idx].isHide = !this.editForm.staffList.length
this.$refs.editFormRef.$refs[this.editChildRef].validateField('staffList')
isValidate && this.$refs.editFormRef.$refs[this.editChildRef].validateField('staffList')
},
handleSelectStaff() {
......@@ -384,6 +389,9 @@ export default {
var params = this.$common.utils.deepClone(this.editForm)
params.staffCreateRequests = this.$common.utils.deepClone(params.staffList)
params.couponCreateRequests = this.$common.utils.deepClone(params.couponList)
params.couponCreateRequests.forEach(item => {
item.couponId = item.id
})
delete params.staffList
delete params.couponList
if (this.routeInfo.addOrEdit == 'edit') {
......
......@@ -23,7 +23,7 @@
</div>
</div>
</div>
<div slot="receiveDetails">{{ editForm.receiveWay == '0' ? '指定手机号' : '指定车架号后6位' }}:{{ editForm.receiveDetails }}</div>
<div slot="receiveDetails">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:{{ editForm.receiveDetails }}</div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper-detail">
<el-tag effect="plain" type="info" v-for="(tag, idx) in editForm.staffList" :key="idx" :disable-transitions="false" @close="handleStaffRemove(tag, idx)">
......@@ -36,7 +36,7 @@
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">返回</el-button>
<el-button type="primary" @click="handleEdit">编辑</el-button>
<el-button v-show="editForm.receivedFlag == 1" type="primary" @click="handleEdit">编辑</el-button>
</div>
</div>
</template>
......@@ -61,8 +61,9 @@ export default {
editForm: {
name: '',
remarkName: '',
receiveWay: '0',
receiveWay: '1',
receiveDetails: '',
receivedFlag: 2,
staffList: [],
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
......@@ -178,8 +179,8 @@ export default {
receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '0' ? '请输入领取手机号' : '请输入领取车架号后6位'
this.editFormData[receiveDetailsIdx].maxlength = val == '0' ? 11 : 6
this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位'
this.editFormData[receiveDetailsIdx].maxlength = val == '1' ? 11 : 6
},
// 计算预估成本
......@@ -199,7 +200,7 @@ export default {
handleEdit() {
var params = {
addOrEdit: 'edit',
$title: encodeURI('编辑信息')
$title: encodeURI('编辑礼包')
}
params.id = this.routeInfo.id
this.$router.push({
......
......@@ -29,8 +29,13 @@
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="giftInfo" slot-scope="scope">
<div>礼包明细</div>
<div>{{ scope.scope }}</div>
<div class="p-b-12">礼包明细</div>
<div class="gift-detail flex-default">
<div class="gift-item" v-for="(item, index) in scope.scope.couponList" :key="index">
<p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p>
<p v-show="item.status == '3'" class="gift-tips">已失效</p>
</div>
</div>
</div>
<div slot="name" slot-scope="scope">
<el-button :size="size" type="text" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</el-button>
......@@ -131,7 +136,10 @@ export default {
},
{
label: '赠送原因',
prop: 'giveReason'
prop: 'giveReason',
formatter: cellValue => {
return cellValue.giveReason || '-'
}
},
{
label: '创建时间',
......@@ -228,7 +236,7 @@ export default {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增信息' : '编辑信息')
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
......@@ -288,4 +296,27 @@ export default {
}
</script>
<style scoped></style>
<style lang="scss">
.p-b-12 {
margin-bottom: 14px;
}
.gift-detail .gift-item {
margin-right: 80px;
.gift-coupon-name {
display: inline-block;
margin-right: 7px;
}
.gift-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
.gift-detail .gift-item:last-child {
margin-right: 0;
}
</style>
......@@ -3,10 +3,10 @@
<div class="gift-bag">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="定向礼包" name="giftList">
<gift-list></gift-list>
<gift-list v-if="activeName == 'giftList'"></gift-list>
</el-tab-pane>
<el-tab-pane label="已领取" name="receivedGiftList">
<receivedGiftList></receivedGiftList>
<receivedGiftList v-if="activeName == 'receivedGiftList'"></receivedGiftList>
</el-tab-pane>
</el-tabs>
</div>
......
......@@ -299,7 +299,7 @@ export default {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增信息' : '编辑信息')
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
......
......@@ -19,7 +19,10 @@
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<GLTable v-loading="loading" ref="giftRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'service'" ref="serviceRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'cash'" ref="cashRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'discount'" ref="discountRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'exchange'" ref="exchangeRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
</div>
</div>
<div class="selected-list">
......@@ -173,19 +176,22 @@ export default {
var params = {
...this.searchForm,
discountType: this.selectedGiftList[this.activeName].discountType,
pageNum: isReset ? 1 : this.$refs.giftRef.page.pageNum,
pageSize: isReset ? 10 : this.$refs.giftRef.page.pageSize
pageNum: isReset ? 1 : this.$refs[this.activeName + 'Ref'].page.pageNum,
pageSize: isReset ? 10 : this.$refs[this.activeName + 'Ref'].page.pageSize
}
this.loading = true
this.$apis.giftBag
.getDirectionalGiftListApi(params)
.then(res => {
this.giftList = res.list
this.giftList.forEach(item => {
item.couponAnticipatedCost = item.anticipatedCost
})
this.fnCallBack = true
this.$refs.giftRef.tableTotal = res.total
this.$refs[this.activeName + 'Ref'].tableTotal = res.total
this.recoverySelected()
this.recoveryTotal()
this.$refs.giftRef.tableHeightValues = '50vh'
this.$refs[this.activeName + 'Ref'].tableHeightValues = '50vh'
})
.finally(() => {
this.loading = false
......@@ -203,7 +209,9 @@ export default {
recoverySelected() {
if (this.selectedGiftList[this.activeName].list && this.selectedGiftList[this.activeName].list.length) {
this.selectedGiftList[this.activeName].list.forEach(row => {
this.$refs.giftRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
if (row.status != '3') {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
}
})
}
},
......@@ -218,7 +226,7 @@ export default {
this.selectedSum = 0
this.orderShow.forEach(itme => {
this.selectedGiftList[itme].list.forEach(subItem => {
this.selectedSum = this.selectedSum + subItem.couponAmount
this.selectedSum = this.selectedSum + parseInt(subItem.couponAmount)
})
})
},
......@@ -230,20 +238,23 @@ export default {
this.selectedGiftList[this.activeName].list = []
val.forEach(item => {
let isSelected = list.find(k => k.id == item.id)
this.selectedGiftList[this.activeName].list.push({
id: item.id,
discountType: item.discountType,
couponName: item.couponName,
couponAmount: isSelected ? list.find(k => k.id == item.id).couponAmount : '1',
couponAnticipatedCost: item.anticipatedCost,
status: '2'
})
if (this.selectedGiftList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') {
this.selectedGiftList[this.activeName].list.push({
id: item.id,
discountType: item.discountType,
couponName: item.couponName,
couponAmount: isSelected ? list.find(k => k.id == item.id).couponAmount : '1',
couponAnticipatedCost: item.couponAnticipatedCost,
status: '2'
})
}
})
list.forEach(item => {
if (item.status == '3') {
this.selectedGiftList[this.activeName].list.push(item)
}
})
this.recoveryTotal()
},
handleGiftConfirm() {
......@@ -259,7 +270,7 @@ export default {
// })
// return true
// }
// var selectedData = this.$refs.giftRef.mutiSelectArr[this.tableParams.mutiSelectName]
// var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr[this.tableParams.mutiSelectName]
var selectedData = JSON.parse(JSON.stringify(this.selectedGiftList))
this.$emit('handleGiftConfirm', selectedData)
},
......@@ -359,6 +370,9 @@ export default {
margin-right: 7px;
}
}
.gift-item:last-child {
margin-bottom: 0;
}
}
.gift-content:last-child {
border-bottom: 0px;
......
......@@ -97,7 +97,7 @@ export default {
recoverySelected() {
if (this.selectedStaffList && this.selectedStaffList.length) {
this.selectedStaffList.forEach(row => {
row.userOneId = row.staffId
row.userOneId = row.staffUUID
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!