Commit af255cce by 李长胜
2 parents a93665e2 170fa76a
...@@ -95,7 +95,7 @@ const updateCouponApi = params => { ...@@ -95,7 +95,7 @@ const updateCouponApi = params => {
}) })
} }
//获取 //获取当前门店自己增加的所有商品
const getAllGoodsApi = params => { const getAllGoodsApi = params => {
params.method = `scrm.api.shopmall.goods.page.curMerchant` params.method = `scrm.api.shopmall.goods.page.curMerchant`
return http({ return http({
......
import { http } from '@/main'
const path = 'org.ore.api.one.mass.'
const URL = 'rop-scrm-entmicro/router'
const customerList = params => {
params.type = 1
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerGroupList = params => {
params.type = 2
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${path}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const detail = params => {
params.type = 2
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const remindUserGroup = params => {
params.type = 2
params.method = `${path}remindUserGroup`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listRemindOperate = params => {
params.type = 2
params.method = `${path}listRemindOperate`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => {
params.method = 'datahub.api.label.querylabeltree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
customerList,
customerGroupList,
insert,
detail,
remindUserGroup,
listRemindOperate,
listDepartmentTree,
querylabeltree
}
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur.native.capture="handleInputBlur(e, item)"> <el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" >
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span> <span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input> </el-input>
......
...@@ -13,9 +13,11 @@ import glsxDialog from '@/components/glsx-dialog/index.vue' ...@@ -13,9 +13,11 @@ import glsxDialog from '@/components/glsx-dialog/index.vue'
import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue' import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue' import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog' import relateStoreDialog from '@/components/relate-store-dialog'
import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
Vue.component('select-muti-pro-dialog', selectMutiProDialog) Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog) Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog) Vue.component('relate-store-dialog', relateStoreDialog)
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
\ No newline at end of file \ No newline at end of file
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<el-form :inline="true" :model="searchProForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleConfigSearch">查询</el-button>
<el-button :size="size" @click="handleConfigReset">重置</el-button>
</el-form-item>
</el-form>
<GLTable ref="mutiProRef" :tableData="productList" :hasPage="false" :tableParams="tableParams" @refreshTable="getList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
</glsx-dialog>
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProForcouponDialog',
data() {
return {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchProForm: {
name: ''
},
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '零售价(元)',
prop: 'retailPrice'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
}
},
components: {
glsxDialog
},
mounted() {
this.getList(true)
},
methods: {
getList(isMounted = false) {
var params = {
goodsStatus: 1,
// goodsSource: 1,
// pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
// pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
currentPage: 1,
pageNum: 1,
pageSize: 100000,
pageStart: 0,
goodsName:this.searchProForm.name
}
var that = this
this.$apis.couponManage.getAllGoodsApi(params).then(res => {
// console.log(res)
// this.productList = res
this.productList = res.list
// this.$refs.mutiProRef.tableTotal = res.total
this.productList.forEach(function(item) {
// item.saleAmount = item.goodsStatistics.saleAmount
// if (item.specificationDetailList.length > 1) {
// let retailPriceList = item.specificationDetailList.sort(function(a, b) {
// return a.retailPrice - b.retailPrice
// })
// let stockeList = item.specificationDetailList.sort(function(a, b) {
// return a.stock - b.stock
// })
// let minRatilPrice = retailPriceList[0].retailPrice / 100
// let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
// let minStock = stockeList[0].stock
// let maxStock = stockeList[stockeList.length - 1].stock
// item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
// item.minRatilPrice = minRatilPrice.toFixed(2)
// item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
// } else if (item.specificationDetailList.length == 1) {
// item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
// item.minRatilPrice = item.retailPrice
// item.goodsStock = item.specificationDetailList[0].stock
// } else {
// item.retailPrice = (item.retailPrice / 100).toFixed(2)
// item.minRatilPrice = item.retailPrice
// }
item.retailPrice = (item.retailPrice / 100).toFixed(2)
})
this.recoverySelected()
})
},
recoverySelected() {
if (this.selectedProList.length) {
this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
},
handleConfigSearch(){
this.getList(true)
},
handleConfigReset(){
this.searchProForm.name = ''
this.getList(true)
},
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
...@@ -24,7 +24,7 @@ export async function start() { ...@@ -24,7 +24,7 @@ export async function start() {
// .forEach(item => { // .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1] // urlParams[item.split('=')[0]] = item.split('=')[1]
// }) // })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444' var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes) render('/', routes)
......
...@@ -48,9 +48,9 @@ export default { ...@@ -48,9 +48,9 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
title: '创建分类', title: '新增分类',
titleObj: { titleObj: {
1: '创建分类', 1: '新增分类',
2: '编辑分类' 2: '编辑分类'
}, },
footerLeft: '0', footerLeft: '0',
......
<!-- 编辑代金券 -->
<template>
<div class="edit-share marketing">
<div class="container edit-container">
<p class="edit-title">{{ title }}折扣卷</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveTime">
<el-date-picker
v-model="editForm.effectiveTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:disabled="editForm.effectiveType != 2||apear!='couponAdd'" clearable>
</el-date-picker>
</el-form-item>
</el-radio><br>
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveDays">
领取后&nbsp;&nbsp;<el-input v-model="editForm.effectiveDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />&nbsp;&nbsp;天内有效
</el-form-item>
</el-radio>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 308px" :autosize="{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear=='couponSee'" />
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button>
</div>
</div>
</template>
<script>
import { limitPrice } from '@/common/constant'
export default {
name: 'editDiscountCoupon',
data() {
return {
size: 'small',
title: '创建',
titleObj: {
1: '创建晒单',
2: '编辑晒单'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
// pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000;
// },
// disabledDate(time) {//禁用当前之后的日期
// return time.getTime() > Date.now() - 8.64e6
// }
// },
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
apear: '',
isDisabled: true,
editForm: {
couponName: '',
effectiveType: '2',
},
editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }],
stock: [{ required: true, message: '发放数量不能为空', trigger: 'change' }],
},
editFormData: [
{
label: '优惠券名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '发放数量',
name: 'stock',
width: '180px',
type: 'input',
append: '张',
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
}
]
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit
if (id) {
if(addOrEdit == 3){
this.apear = 'couponSee';
this.title = '查看';
}else if(addOrEdit == 2){
this.apear = 'couponEdit';
this.title = '编辑';
}
this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled
} else {
this.apear = 'couponAdd';
this.title = '创建';
this.isDisabled = false
}
},
watch: {
'editForm.effectiveDays'(newValue, oldValue){
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.stock'(newValue, oldValue){
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
}
},
methods: {
getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
console.log(res);
this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + ''
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime,this.editForm.effectiveEndTime]
}
})
},
validateRules(){
var form = this.editForm
if(form.effectiveType == '2'){//判断 有效期-日期选择是否验证
this.editRule.effectiveTime[0].required = true
}else {
this.editRule.effectiveTime[0].required = false
}
if(form.effectiveType == '1'){//判断 有效期-有效天数是否验证
this.editRule.effectiveDays[0].required = true
}else {
this.editRule.effectiveDays[0].required = false
}
},
getCouponInfoParams() {
var obj = {};
var id = this.routeInfo.id
var form = this.$common.utils.deepClone(this.editForm)
if (id) {
obj.couponId = id;
}else{//编辑时只允许编辑使用说明
//优惠券名称
obj.couponName = form.couponName;
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '2';
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) {//固定天数
obj.effectiveDays = form.effectiveDays;
} else if (form.effectiveType == 2) {//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00';
obj.effectiveEndTime = d[1] + ' 23:59:59';
}
}
//库存
obj.stock = form.stock;
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
obj.useAmount = 1
}
//使用描述
obj.useDescription = form.useDescription;
return obj;
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.getCouponInfoParams()
console.log(params);
let method = ''
if(params.couponId){
method = 'updateCouponApi'//后台修改优惠券
}else {
method = 'createCouponApi'//后台创建优惠券
}
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/couponManage/index'
})
}
}
}
</script>
<style scoped></style>
<!-- 编辑代金券 -->
<template>
<div class="edit-share marketing">
<div class="container edit-container">
<p class="edit-title">{{ title }}兑换券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveTime">
<el-date-picker
v-model="editForm.effectiveTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:disabled="editForm.effectiveType != 2||apear!='couponAdd'" clearable>
</el-date-picker>
</el-form-item>
</el-radio><br>
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveDays">
领取后&nbsp;&nbsp;<el-input v-model="editForm.effectiveDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />&nbsp;&nbsp;天内有效
</el-form-item>
</el-radio>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 308px" :autosize="{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear=='couponSee'" />
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button>
</div>
</div>
</template>
<script>
import { limitPrice } from '@/common/constant'
export default {
name: 'editDiscountCoupon',
data() {
return {
size: 'small',
title: '创建',
titleObj: {
1: '创建晒单',
2: '编辑晒单'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
// pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000;
// },
// disabledDate(time) {//禁用当前之后的日期
// return time.getTime() > Date.now() - 8.64e6
// }
// },
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
apear: '',
isDisabled: true,
editForm: {
couponName: '',
effectiveType: '2',
},
editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }],
stock: [{ required: true, message: '发放数量不能为空', trigger: 'change' }],
},
editFormData: [
{
label: '优惠券名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '发放数量',
name: 'stock',
width: '180px',
type: 'input',
append: '张',
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
}
]
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit
if (id) {
if(addOrEdit == 3){
this.apear = 'couponSee';
this.title = '查看';
}else if(addOrEdit == 2){
this.apear = 'couponEdit';
this.title = '编辑';
}
this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled
} else {
this.apear = 'couponAdd';
this.title = '创建';
this.isDisabled = false
}
},
watch: {
'editForm.effectiveDays'(newValue, oldValue){
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.stock'(newValue, oldValue){
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
}
},
methods: {
getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
console.log(res);
this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + ''
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime,this.editForm.effectiveEndTime]
}
})
},
validateRules(){
var form = this.editForm
if(form.effectiveType == '2'){//判断 有效期-日期选择是否验证
this.editRule.effectiveTime[0].required = true
}else {
this.editRule.effectiveTime[0].required = false
}
if(form.effectiveType == '1'){//判断 有效期-有效天数是否验证
this.editRule.effectiveDays[0].required = true
}else {
this.editRule.effectiveDays[0].required = false
}
},
getCouponInfoParams() {
var obj = {};
var id = this.routeInfo.id
var form = this.$common.utils.deepClone(this.editForm)
if (id) {
obj.couponId = id;
}else{//编辑时只允许编辑使用说明
//优惠券名称
obj.couponName = form.couponName;
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '4';
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) {//固定天数
obj.effectiveDays = form.effectiveDays;
} else if (form.effectiveType == 2) {//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00';
obj.effectiveEndTime = d[1] + ' 23:59:59';
}
}
//库存
obj.stock = form.stock;
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
obj.useAmount = 1
}
//使用描述
obj.useDescription = form.useDescription;
return obj;
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.getCouponInfoParams()
console.log(params);
let method = ''
if(params.couponId){
method = 'updateCouponApi'//后台修改优惠券
}else {
method = 'createCouponApi'//后台创建优惠券
}
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/couponManage/index'
})
}
}
}
</script>
<style scoped></style>
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
</template> </template>
<script> <script>
import { limitPrice } from '@/common/constant'
export default { export default {
name: 'editCashCoupon', name: 'editCashCoupon',
data() { data() {
...@@ -180,6 +181,30 @@ export default { ...@@ -180,6 +181,30 @@ export default {
} }
}, },
watch: {
'editForm.effectiveDays'(newValue, oldValue){
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.usageTimes'(newValue, oldValue){
this.editForm.usageTimes = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.useLimitDays'(newValue, oldValue){
this.editForm.useLimitDays = limitPrice(newValue, oldValue, 4, 0)
},
'editForm.usageTimes2'(newValue, oldValue){
this.editForm.usageTimes2 = limitPrice(newValue, oldValue, 3, 0)
},
'editForm.vipPrice'(newValue, oldValue){
this.editForm.vipPrice = limitPrice(newValue, oldValue, 5, 2)
},
'editForm.shopPrice'(newValue, oldValue){
this.editForm.shopPrice = limitPrice(newValue, oldValue, 5, 2)
},
'editForm.stock'(newValue, oldValue){
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
}
},
methods: { methods: {
getInfo() { getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<div class="m-b-20"> <div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="addCashCoupon()">新建代金券</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="addCashCoupon()">新建代金券</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addService()">新建会员服务</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="addService()">新建会员服务</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addService()">新建折扣卷</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="addDiscountCoupon()">新建折扣卷</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addExchangeCoupon()">新建兑换券</el-button>
</div> </div>
<div class="container"> <div class="container">
<div> <div>
...@@ -29,21 +30,10 @@ ...@@ -29,21 +30,10 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 下架 -->
<glsx-dialog title="下架" :isVisible.sync="isDownVisible" @confirmDialog="handleDownConfirm" @closeDialog="handleDownClose">
<el-form ref="downRef" label-width="100px" :rules="downRules" :model="downForm">
<el-form-item label="下架备注" prop="offReason">
<el-input :size="size" v-model="downForm.offReason" placeholder="请输入下架备注" maxlength="30"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
</div> </div>
</template> </template>
<script> <script>
import shareDialog from '../productGroup/components/shareDialog'
export default { export default {
name: 'coupon', name: 'coupon',
data() { data() {
...@@ -131,13 +121,17 @@ export default { ...@@ -131,13 +121,17 @@ export default {
label: '剩余', label: '剩余',
prop: 'residueAmount' prop: 'residueAmount'
}, },
// { {
// label: '使用途径', label: '使用途径',
// name: 'useChannel', name: 'useChannel',
// formatter: cellValue => { formatter: cellValue => {
// return this.baseData.useChannelList.find(item => item.confId == cellValue.useChannel).confName var useChannel = ''
// } if(cellValue.useChannel){
// }, useChannel = this.baseData.useChannelList.find(item => item.confId == cellValue.useChannel).confName
}
return useChannel
}
},
{ {
label: '优惠券状态', label: '优惠券状态',
name: 'status', name: 'status',
...@@ -150,9 +144,15 @@ export default { ...@@ -150,9 +144,15 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: { baseData: {
discountTypeList: [{ discountTypeList: [{
confId: '2',
confName: '折扣卷'
},{
confId: '3', confId: '3',
confName: '代金券' confName: '代金券'
}, { }, {
confId: '4',
confName: '兑换券'
}, {
confId: '7', confId: '7',
confName: '会员服务' confName: '会员服务'
}], }],
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
}, },
components: { components: {
shareDialog
}, },
mounted() { mounted() {
...@@ -264,75 +264,34 @@ export default { ...@@ -264,75 +264,34 @@ export default {
this.$router.push('/couponManage/editMemberService/1') this.$router.push('/couponManage/editMemberService/1')
}, },
//新增折扣卷
addDiscountCoupon() {
console.log('新增折扣卷');
this.$router.push('/couponManage/editDiscountCoupon/1')
},
//新增兑换卷
addExchangeCoupon() {
console.log('新增兑换卷');
this.$router.push('/couponManage/editExchangeCoupon/1')
},
// addOrEdit:1-新增;2-编辑;3-查看 // addOrEdit:1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
var goto = '' var goto = ''
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
if(row.discountType == '3'){//代金券 if(row.discountType == '3'){//代金券
goto = '/couponManage/editCashCoupon/' goto = '/couponManage/editCashCoupon/'
}else if(row.discountType == '7'){//会员服务 }else if(row.discountType == '7'){//会员服务
goto = '/couponManage/editMemberService/' goto = '/couponManage/editMemberService/'
}else if(row.discountType == '2'){//折扣卷
goto = '/couponManage/editDiscountCoupon/'
}else if(row.discountType == '4'){//兑换券
goto = '/couponManage/editExchangeCoupon/'
} }
console.log(goto + addOrEdit + '/' + row.id); console.log(goto + addOrEdit + '/' + row.id);
this.$router.push(goto + addOrEdit + '/' + row.id) this.$router.push(goto + addOrEdit + '/' + row.id)
}, },
// 下架通知
handleDwonNotice(row) {
this.$alert( '你带货的' + row.goodsName + '商品现已下架,下架原因:' + row.offReason, '商品下架通知', {
confirmButtonText: '确定',
callback: action => { }
})
},
handleUpOrDown(row) {
var title = row.goodsStatus == 0 ? '上架' : '下架'
this.secondConfirm(title, '是否确认' + title + '该商品?', 'proManage', 'updateStatusProApi', { id: row.id, goodsStatus: row.goodsStatus == 0 ? 1 : 0 })
},
// 取消带货
handleTakeGood(row) {
this.secondConfirm('取消带货', '是否确认取消带货该商品?', 'proManage', 'deleteTakeProApi', { id: row.id })
},
dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate()
this.isDownVisible = !this.isDownVisible
},
handleDownClose() {
this.dwonVisibleChange()
this.downForm = {
id: '',
offReason: '',
goodsStatus: 0
}
},
handleDownConfirm() {
this.$refs.downRef.validate(valid => {
if (valid) {
this.$apis.proManage.updateStatusProApi(this.downForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleDownClose()
this.handleSearch()
}
})
}
})
},
// 置顶
handleTop(row) {
this.secondConfirm('置顶', '是否确认置顶该商品?', 'proManage', 'topProApi', { id: row.id })
},
handleShare(row) {
this.$apis.proManage.getProShareApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
......
...@@ -10,11 +10,19 @@ ...@@ -10,11 +10,19 @@
<el-form-item label="群聊名称" prop="groupName"> <el-form-item label="群聊名称" prop="groupName">
<el-input v-model="basicForm.groupName" placeholder="群发名称仅内部可见" maxlength="10"></el-input> <el-input v-model="basicForm.groupName" placeholder="群发名称仅内部可见" maxlength="10"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="选择群主" prop="groupName"> <el-form-item label="选择群主" prop="userList">
<el-button size="small" @click="openMembers"> <el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
全部账号 全部账号
</el-button> </el-button>
<span>已选择{{ basicForm.userList.length }}人</span>
<div class="sale-select" v-show="basicForm.userList">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag v-for="(tag, idx) in basicForm.userList" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
</div>
</div>
<div class="form-tips">群主收到通知后,可选择他管理的客户群并群发该内容。</div> <div class="form-tips">群主收到通知后,可选择他管理的客户群并群发该内容。</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -41,7 +49,7 @@ ...@@ -41,7 +49,7 @@
<el-button type="primary" @click="handleCancel">取消</el-button> <el-button type="primary" @click="handleCancel">取消</el-button>
</div> </div>
<glsx-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible"> <glsx-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<SelectMembers ref="drawerForm" @closeDrawer="closeDrawer" @handSelectdEmp="handSelectdEmp"></SelectMembers> <SelectMembers ref="membersForm"></SelectMembers>
</glsx-dialog> </glsx-dialog>
</div> </div>
</template> </template>
...@@ -65,7 +73,8 @@ export default { ...@@ -65,7 +73,8 @@ export default {
name: [{ required: true, message: '请输入组名', trigger: 'blur' }], name: [{ required: true, message: '请输入组名', trigger: 'blur' }],
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }] groupName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }]
}, },
membersVisible: false membersVisible: false,
key: new Date()
} }
}, },
// mounted() { // mounted() {
...@@ -80,6 +89,18 @@ export default { ...@@ -80,6 +89,18 @@ export default {
}, },
handleCancel() { handleCancel() {
this.$router.go(-1) this.$router.go(-1)
},
// 成员弹窗
handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
this.basicForm.userList = this.$refs.membersForm.innerTags
this.openMembers()
},
remove(val) {
console.log(val, '00000')
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.key = new Date()
} }
} }
} }
......
...@@ -3,26 +3,30 @@ ...@@ -3,26 +3,30 @@
<div class="preview-content"> <div class="preview-content">
<div class="preview-time">{{ currentTime }}</div> <div class="preview-time">{{ currentTime }}</div>
<div class="preview-info" v-for="item in previewList" :key="item.id"> <div class="preview-info" v-for="item in previewList" :key="item.id">
<img class="avatar" src="../../../assets/logo.png" alt="" /> <img class="avatar" src="@/assets/logo.png" alt="" />
<template v-if="item.type == 'text'"> <template v-if="item.attType == 1">
<div class="preview-text text">{{ item.content }}</div> <div class="preview-text text">{{ item.attContent }}</div>
</template> </template>
<template v-else-if="item.type == 'link'"> <template v-else-if="item.attType == 4">
<div class="preview-text preview-link"> <div class="preview-text preview-link">
{{ item.url }} {{ item.attContent.url }}
<img src="../../../assets/guestCustom/preview-link.png" alt="" /> <img src="@/assets/guestCustom/preview-link.png" alt="" />
</div> </div>
</template> </template>
<template v-else-if="item.type == 'img'"> <template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.url" fit="contain"></el-image> <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template> </template>
<template v-else-if="item.type == 'applet'"> <template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<video style="width: 100px" :src="item.attContent"></video>
</template>
<template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet"> <div class="preview-text text preview-applet">
<div class="preview-applet-title"> <div class="preview-applet-title">
<img :src="item.appleIcon" alt="" /> <img :src="item.attContent.picUrl" alt="" />
<span>{{ item.title }}</span> <span>{{ item.attContent.title }}</span>
</div> </div>
{{ item.content }} {{ item.attContent.page }}
</div> </div>
</template> </template>
</div> </div>
...@@ -37,7 +41,6 @@ export default { ...@@ -37,7 +41,6 @@ export default {
data() { data() {
return { return {
previewList: [], previewList: [],
currentTime: '' currentTime: ''
} }
}, },
...@@ -48,7 +51,6 @@ export default { ...@@ -48,7 +51,6 @@ export default {
}) })
}, },
mounted() { mounted() {
console.log(1111, this.eventBus)
const date = new Date() const date = new Date()
let hours = date.getHours() let hours = date.getHours()
hours = hours < 10 ? `0${hours}` : hours hours = hours < 10 ? `0${hours}` : hours
...@@ -90,10 +92,11 @@ export default { ...@@ -90,10 +92,11 @@ export default {
} }
.preview-text { .preview-text {
position: relative; position: relative;
max-width: 190px; max-width: 169px;
color: #333; color: #333;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
word-wrap: break-word;
} }
.text { .text {
font-size: 16px; font-size: 16px;
......
...@@ -55,7 +55,8 @@ export default { ...@@ -55,7 +55,8 @@ export default {
} }
] ]
}, },
tableEmpData: [] tableEmpData: [],
group: {}
} }
}, },
methods: { methods: {
...@@ -63,7 +64,7 @@ export default { ...@@ -63,7 +64,7 @@ export default {
this.$emit('selectTable', val) this.$emit('selectTable', val)
}, },
listDepartmentTree() { listDepartmentTree() {
this.$apis.emp.listDepartmentTree({ id: 1 }).then(res => { this.$apis.customerTransform.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
this.listTree = res this.listTree = res
this.$nextTick(() => { this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click() document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
...@@ -72,6 +73,7 @@ export default { ...@@ -72,6 +73,7 @@ export default {
}) })
}, },
clearSelect(row) { clearSelect(row) {
console.log(row, '2222')
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row) this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
}, },
clearSelection() { clearSelection() {
...@@ -79,18 +81,19 @@ export default { ...@@ -79,18 +81,19 @@ export default {
}, },
handleNodeClick(data) { handleNodeClick(data) {
this.departmentId = data.id this.departmentId = data.id
this.listEntmicroStaff() this.tableEmpData = data.entmicroStaffResponses
}, // this.listEntmicroStaff()
listEntmicroStaff(staffName) {
let params = {
departmentId: this.departmentId,
staffName: staffName ? staffName : this.staffName,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.listEntmicroStaff(params).then(res => {
this.tableEmpData = res
})
} }
// listEntmicroStaff(staffName) {
// let params = {
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
}, },
mounted() { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
......
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div>
<div class="checkbox-group-box" :style="{ 'max-height': heightBox + 'px' }">
<div v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box">
<template v-for="item in labelTreeRets">
<el-tag class="tag-selected-item" v-for="(tag, idx) in item.tagChecked" :key="idx" closable :disable-transitions="false" @close="remove(item, idx)">
{{ tag.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'SelectLabel',
data() {
return {
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
labelTreeRets: [
{
labelGroup: { id: '109', name: '湖口123' },
labelList: [
{ id: '372', name: '12345678' },
{ id: '371', name: '7654321' },
{ id: '370', name: '1234567' }
],
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
},
{
labelGroup: { id: '65', name: '自店标签111' },
labelList: [
{ id: '179', name: '标签44' },
{ id: '178', name: '标签33' },
{ id: '176', name: '标签1112' }
],
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
]
}
},
watch: {
labelTreeRets: {
handler() {
this.selectNum = 0
this.labelTreeRets.forEach(item => {
this.selectNum += item.tagChecked.length
})
},
deep: true
}
},
methods: {
init() {
this.dialogVisible = true
this.querylabeltree()
},
handleSearch() {
this.querylabeltree()
},
querylabeltree() {
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName
}
})
.then(res => {
console.log(res)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
})
},
remove(item, idx) {
item.tagChecked.splice(idx, 1)
if (item.tagChecked.length == 0) item.checkAll = false
},
//全选
handleCheckAllChange(val, index) {
if (val) {
this.labelTreeRets[index].tagChecked = []
for (let i in this.labelTreeRets[index].labelList) {
this.labelTreeRets[index].tagChecked.push(this.labelTreeRets[index].labelList[i])
}
} else {
this.labelTreeRets[index].tagChecked = []
}
this.labelTreeRets[index].isIndeterminate = false
},
//选中
handleCheckedChange(value, index) {
let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 300
}
}
</script>
<style lang="scss" scoped>
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 22px;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 40px;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
display: flex;
align-items: center;
}
}
}
}
.checkbox-group-box {
overflow: auto;
}
.tag-selected-box {
min-height: 200px;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -13,28 +13,11 @@ ...@@ -13,28 +13,11 @@
</div> </div>
<div> <div>
<div class="select-sale-panel"> <div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp> <select-emp @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div> <div class="popper__arrow"></div>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - 3 }}个</div>
</el-form-item>
<!-- <el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item> -->
</el-form> </el-form>
</div> </div>
</template> </template>
...@@ -50,7 +33,7 @@ export default { ...@@ -50,7 +33,7 @@ export default {
addForm: {}, addForm: {},
typeIndex: 0, typeIndex: 0,
empType: [], empType: [],
empTypeValue: '', // empTypeValue: '',
newTag: '', newTag: '',
innerTags: [], innerTags: [],
dialog_temp: {} dialog_temp: {}
...@@ -69,14 +52,6 @@ export default { ...@@ -69,14 +52,6 @@ export default {
selectTable(val) { selectTable(val) {
this.innerTags = val this.innerTags = val
}, },
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() { foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) { if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return return
...@@ -85,58 +60,34 @@ export default { ...@@ -85,58 +60,34 @@ export default {
} }
}, },
remove(row) { remove(row) {
console.log(row, '111')
this.$refs.selectEmpTabel.clearSelect(row) this.$refs.selectEmpTabel.clearSelect(row)
}, },
//查询 //查询
searchEmp() { searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag) this.$refs.selectEmpTabel.listDepartmentTree(this.newTag)
}, },
addEmpType() { onSubmit() {
if (!this.empTypeValue) { if (this.innerTags.length == 0) {
this.$message.error('请输入类型名称') this.$message({
return message: '请选择成员',
} type: 'error'
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
}) })
this.empTypeValue = '' return
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
} }
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
}) })
}
// onSubmit() {
// if (this.innerTags.length == 0) {
// this.$message({
// message: '请选择员工',
// type: 'error'
// })
// return
// }
// let userIds = []
// this.innerTags.forEach(item => {
// userIds.push(item.userId)
// })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds) // this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
// }, }
// onCancel() { // onCancel() {
// this.$emit('closeDrawer') // this.$emit('closeDrawer')
// } // }
}, },
mounted() { mounted() {
this.listEntFollowerType() console.log(111)
// this.listEntFollowerType()
} }
} }
</script> </script>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 1)">新建群发</el-button> <el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 1)">新建群发</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="gueast" :tableData="gueastTableData" :tableParams="gueastTableParams" :pageConf="gueastPageConf"> <GLTable ref="gueast" :getListApi="customerList" :tableParams="gueastTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope"> <!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span> <span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> --> </div> -->
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</el-button> <el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="gueast" :tableData="gueastTableData" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf"> <GLTable ref="gueast" :getListApi="customerGroupList" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope"> <!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span> <span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> --> </div> -->
...@@ -102,32 +102,8 @@ export default { ...@@ -102,32 +102,8 @@ export default {
] ]
}, },
gueastPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, gueastPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
gueastTableData: [ customerList: this.$apis.customerTransform.customerList,
{ customerGroupList: this.$apis.customerTransform.customerGroupList,
id: 1,
massName: '守候专用服务一组dfajkfhakjdfhak[土盘]',
sendTime: '2021-11-05',
name: '群发任务命名',
sendType: 1,
sendUserNum: 1,
sendCustomerNum: 1,
unsendUserNum: 2,
unsendCustomerNum: 3,
isRemind: 1 // 1已提醒2 未提醒
},
{
id: 2,
massName: '守候专用服务一组dfajkfhakjdfhak[土盘]',
sendTime: '2021-11-05',
name: '群发任务命名',
sendType: 1,
sendUserNum: 1,
sendCustomerNum: 1,
unsendUserNum: 2,
unsendCustomerNum: 3,
isRemind: 2 // 1已提醒2 未提醒
}
],
gueastGroupTableParams: { gueastGroupTableParams: {
listName: 'data', listName: 'data',
tableOption: false, tableOption: false,
......
...@@ -27,9 +27,9 @@ export default { ...@@ -27,9 +27,9 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
title: '创建晒单', title: '新增晒单',
titleObj: { titleObj: {
1: '创建晒单', 1: '新增晒单',
2: '编辑晒单' 2: '编辑晒单'
}, },
footerLeft: '0', footerLeft: '0',
......
...@@ -223,9 +223,9 @@ export default { ...@@ -223,9 +223,9 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
title: '创建商品', title: '新增商品',
titleObj: { titleObj: {
1: '创建商品', 1: '新增商品',
2: '编辑商品' 2: '编辑商品'
}, },
footerLeft: '0', footerLeft: '0',
...@@ -858,7 +858,7 @@ export default { ...@@ -858,7 +858,7 @@ export default {
handleSpecsEdit(status, targetItem, targetIdx) { handleSpecsEdit(status, targetItem, targetIdx) {
if (status == 1 && this.specificationDetailList.length >= 5) { if (status == 1 && this.specificationDetailList.length >= 5) {
this.$message({ this.$message({
message: '只能创建5个规格值', message: '只能新增5个规格值',
type: 'error' type: 'error'
}) })
return true return true
......
...@@ -72,9 +72,9 @@ export default { ...@@ -72,9 +72,9 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
title: '创建商品', title: '新增商品',
titleObj: { titleObj: {
1: '创建商品', 1: '新增商品',
2: '编辑商品', 2: '编辑商品',
3: '查看商品' 3: '查看商品'
}, },
......
...@@ -18,9 +18,9 @@ export default { ...@@ -18,9 +18,9 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
title: '创建晒单', title: '新增晒单',
titleObj: { titleObj: {
1: '创建晒单', 1: '新增晒单',
2: '编辑晒单' 2: '编辑晒单'
}, },
footerLeft: '0', footerLeft: '0',
......
...@@ -44,9 +44,9 @@ export default { ...@@ -44,9 +44,9 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
title: '创建专区', title: '新增专区',
titleObj: { titleObj: {
1: '创建专区', 1: '新增专区',
2: '编辑专区' 2: '编辑专区'
}, },
footerLeft: '0', footerLeft: '0',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!