Commit c7b89bcc by 周子尧

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

2 parents 45b6a239 c6a6ebf5
......@@ -127,6 +127,11 @@ html {
margin-bottom: 18px;
}
.marketing .default-blue-btn {
color: #5850ff;
border-color: #5850ff;
}
.el-scrollbar__bar.is-horizontal {
height: 10px !important;
left: 10px;
......@@ -261,6 +266,11 @@ html {
justify-content: space-between;
}
.marketing .flex-wrap {
display: flex;
flex-wrap: wrap;
}
.marketing .flex-grow {
flex: 1;
}
......
......@@ -5,7 +5,7 @@
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div>
<el-button slot="selectGiftBtn" @click="handleGiftAdd">选择礼包内容</el-button>
<el-button slot="selectGiftBtn" class="default-blue-btn" @click="handleGiftAdd">选择礼包内容</el-button>
<div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': labelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
......@@ -126,23 +126,26 @@ export default {
remarkName: [{ required: true, message: '请输入备注名称', trigger: 'change' }],
receiveWay: [{ required: true, message: '请选择领取条件', trigger: 'change' }],
staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }],
receiveDetails: [{ required: true, message: '请输入领取条件', trigger: 'change' },
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
return callback()
}
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 {
let cjhReg = /^[0-9a-zA-Z]{6}$/
return cjhReg.test(value) ? callback() : callback(new Error('请输入正确的车架号后6位'))
}
},
trigger: 'change'
}]
couponList: [{ required: true, message: '请选择礼包', trigger: 'change' }],
receiveDetails: [
{ required: true, message: '请输入领取条件', trigger: 'change' },
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
return callback()
}
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 {
let cjhReg = /^[0-9a-zA-Z]{6}$/
return cjhReg.test(value) ? callback() : callback(new Error('请输入正确的车架号后6位'))
}
},
trigger: 'change'
}
]
},
isEdit: true,
editFormData: [
......@@ -167,7 +170,8 @@ export default {
},
{
label: '',
name: '',
name: 'couponListBlock',
isHide: true,
addHtml: 'couponListBlock'
},
{
......@@ -276,6 +280,7 @@ export default {
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
this.hasCouponBlock(false)
},
receiveWayChange(val) {
......@@ -298,6 +303,12 @@ export default {
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
hasCouponBlock(isValidate = true) {
var idx = this.editFormData.findIndex(item => item.name == 'couponListBlock')
this.editFormData[idx].isHide = !this.editForm.couponList.length
isValidate && this.$refs.editFormRef.$refs[this.editChildRef].validateField('couponList')
},
// 礼包
recoveryGiftList() {
this.editForm.couponList = []
......@@ -306,6 +317,7 @@ export default {
this.editForm.couponList.push(k)
})
})
this.hasCouponBlock()
},
handleGiftAdd() {
......@@ -377,7 +389,6 @@ export default {
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
console.log(params)
this.loading = true
this.$apis.giftBag
.insertGiftApi(params)
......@@ -421,7 +432,6 @@ export default {
</script>
<style lang="scss">
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
.marketing.edit-gift .staff-block {
......@@ -433,11 +443,12 @@ export default {
.marketing.edit-gift {
// 礼包
.gift-block {
width: 567px;
width: 878px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
background-color: #f4f6fc;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
......@@ -514,7 +525,6 @@ export default {
height: 26px;
line-height: 24px;
margin-bottom: 5px;
// background: #fff !important;
}
.el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
......
......@@ -36,10 +36,6 @@
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">返回</el-button>
<!-- <span v-show="editForm.receivedFlag == 1"> -->
<!-- <el-button type="primary" @click="handleEdit">编辑</el-button> -->
<!-- <GLButton type="primary" fn="编辑" @click="handleEdit">编辑</GLButton> -->
<!-- </span> -->
</div>
</div>
</template>
......@@ -200,17 +196,6 @@ export default {
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
handleEdit() {
var params = {
addOrEdit: 'edit',
$title: encodeURI('编辑礼包')
}
params.id = this.routeInfo.id
this.$router.push({
path: '/giftBag/editGift',
query: params
})
},
handleCancel() {
this.$router.push({
path: '/giftBag/index'
......@@ -233,11 +218,12 @@ export default {
.marketing.edit-gift {
// 礼包
.gift-block {
width: 567px;
width: 878px;
border-radius: 4px;
border: 1px solid #e5e5e5;
.gift-title {
padding: 10px;
background-color: #f4f6fc;
border-bottom: 1px solid #e5e5e5;
.price {
font-size: 18px;
......
......@@ -2,7 +2,6 @@
<template>
<div class="marketing p-t-20">
<div class="m-b-10">
<!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit('add')">新增礼包</el-button> -->
<GLButton :size="size" type="primary" fn="新增礼包" class="el-icon-plus" @click="handleEdit('add')">新增礼包</GLButton>
</div>
<div class="list-tips m-b-10">
......@@ -21,8 +20,7 @@
</glsx-combi-form>
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<!-- <el-button :size="size" type="default" @click="handleExport">导出</el-button> -->
<GLButton :size="size" type="default" fn="导出" @click="handleExport">导出</GLButton>
<GLButton :size="size" class="default-blue-btn" type="default" fn="导出" @click="handleExport">导出</GLButton>
</span>
</glsx-combi-form>
</div>
......@@ -31,7 +29,7 @@
<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 class="p-b-12">礼包明细</div>
<div class="gift-detail flex-default">
<div class="gift-detail flex-wrap">
<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>
......@@ -39,12 +37,9 @@
</div>
</div>
<div slot="name" slot-scope="scope">
<!-- <el-button :size="size" type="text">{{ scope.scope.name }}</el-button> -->
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<!-- <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<!-- <el-button type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button> -->
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
</div>
......@@ -237,7 +232,6 @@ export default {
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
......
......@@ -13,7 +13,7 @@
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<!-- <el-button :size="size" type="default" @click="handleExport">导出</el-button> -->
<GLButton :size="size" type="default" fn="已领取导出" @click="handleExport">导出</GLButton>
<GLButton :size="size" class="default-blue-btn" type="default" fn="已领取导出" @click="handleExport">导出</GLButton>
</span>
</glsx-combi-form>
</div>
......
......@@ -7,7 +7,7 @@
</div> -->
<div class="flex-default">
<div class="gift-table flex-grow">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tabs class="gift-tabs" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="门店服务" name="service"></el-tab-pane>
<el-tab-pane label="代金券" name="cash"></el-tab-pane>
<el-tab-pane label="折扣券" name="discount"></el-tab-pane>
......@@ -66,7 +66,6 @@
<el-input-number v-if="subItem.discountType == 7" :disabled="subItem.status == '3'" class="sum-input" v-model="subItem.couponAmount" @change="handleChange" :min="1" :max="10" size="mini" label="描述文字"></el-input-number>
<p :class="[subItem.status == '3' ? ' txt-grey' : '']" v-else>×{{ subItem.couponAmount }}</p>
</div>
<!-- <p v-show="subItem.status == '3'" class="gift-tips">已失效</p> -->
</div>
</div>
</div>
......@@ -77,7 +76,6 @@
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import url from '@/assets/empty.png'
import glsxDialog from '@/components/glsx-dialog'
export default {
......@@ -85,7 +83,6 @@ export default {
data() {
return {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
activeName: 'service',
userInfo: {},
giftList: [],
......@@ -293,7 +290,6 @@ export default {
// 选择/取消
handleSelectionTable(val) {
console.log(val)
var list = JSON.parse(JSON.stringify(this.selectedGiftList[this.activeName].list))
this.selectedGiftList[this.activeName].list = []
val.forEach(item => {
......@@ -330,7 +326,6 @@ export default {
// })
// return true
// }
// var selectedData = this.$refs[this.activeName + 'Ref'].mutiSelectArr[this.tableParams.mutiSelectName]
var selectedData = JSON.parse(JSON.stringify(this.selectedGiftList))
this.$emit('handleGiftConfirm', selectedData)
},
......@@ -341,8 +336,12 @@ export default {
}
</script>
<style lang="scss">
.muti-gift .el-tabs__nav-wrap:after {
opacity: 0;
.muti-gift .el-tabs__active-bar {
display: block;
}
.muti-gift .el-tabs__nav-scroll {
display: block;
border-bottom: 1px solid #eeeeee;
}
.muti-gift .el-tabs__item {
font-weight: 400;
......@@ -354,20 +353,12 @@ export default {
.muti-gift .el-tabs__item:hover,
.muti-gift .el-tabs__item.is-active {
color: #5f5efb;
background: #fff !important;
border-width: 0px !important;
}
.muti-gift .m-t-10 {
margin-top: 10px;
}
/* .muti-gift .nogiftP {
width: 100%;
height: 20px;
font-family: PingFangSC-Medium;
font-size: 16px;
color: #666666;
line-height: 20px;
font-weight: 500;
text-align: center;
} */
.muti-gift .gift-table {
border: 1px solid #eeeeee;
margin-right: 10px;
......
......@@ -13,7 +13,6 @@
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import url from '@/assets/empty.png'
import glsxDialog from '@/components/glsx-dialog'
export default {
......@@ -21,7 +20,6 @@ export default {
data() {
return {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
userInfo: {},
staffList: [],
fnCallBack: false,
......@@ -103,18 +101,6 @@ export default {
}
},
handleMutiSelectConfirm() {
// if (!this.staffList.length) {
// var params = {
// addOrEdit: 1,
// groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
// $title: '新建员工'
// }
// this.$router.push({
// path: '/productGroup/editProduct',
// query: params
// })
// return true
// }
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
this.$emit('handleMutiSelectConfirm', selectedData)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!