Commit 71e8f65b by chenwq

定向礼包列表

1 parent 4128198c
......@@ -171,6 +171,10 @@ html {
margin-top: 10px;
}
.marketing .m-b-10 {
margin-bottom: 10px;
}
.marketing .m-b-20 {
margin-bottom: 20px;
}
......
......@@ -218,6 +218,12 @@ const staticRoutes = Object.freeze([{
path: '/giftBag/giftDetail',
component: resolve => require([`@/views/giftBag/giftDetail.vue`], resolve),
meta: {}
},
{
name: 'editGift',
path: '/giftBag/editGift',
component: resolve => require([`@/views/giftBag/editGift.vue`], resolve),
meta: {}
}
])
export default staticRoutes
\ No newline at end of file
<!-- 编辑专区 -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
export default {
name: 'editGift',
data() {
return {
size: 'small',
title: '新增信息',
titleObj: {
add: '新增信息',
edit: '编辑信息'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
routeInfo: {
// add-新增;edit-编辑;look-查看
addOrEdit: 'add',
id: ''
},
editStatus: false,
labelWidth: '144px',
editForm: {
name: ''
},
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }]
// zoneImg: [{ required: true, message: '请选择专区图片', trigger: 'change' }]
},
isEdit: true,
editFormData: [
{
label: '礼包名称',
name: 'name',
type: 'input',
maxlength: 15
},
{
label: '备注名称',
name: 'remarkName',
type: 'input',
maxlength: 30
}
// {
// label: '专区图片',
// name: 'zoneImg',
// type: 'upload',
// limitSize: 10,
// maxPhotoNum: 1,
// handleUpload: (e, file, targetItem) => {
// const imgFile = e.target.result
// const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
// this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
// this.editForm[targetItem.name] = res
// this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
// })
// }
// }
]
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
console.log(this.routeInfo.addOrEdit)
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
},
methods: {
getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.name = res.name
// this.editForm.zoneImg = res.zoneImg
// this.editForm.merchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
params.merchantList = []
this.editForm.merchantList.forEach(item => {
params.merchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
// console.log(params)
this.$apis.zoneList.insertZoneApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
}
})
},
cancelJump() {
this.$router.push({
path: '/giftBag/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
}
}
}
</script>
<style scoped>
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
</style>
<template>
<div>
</div>
<div>
</div>
</template>
<script>
export default {
name: 'giftDetail',
name: 'giftDetail',
data() {
return {
}
},
data() {
return {
};
},
mounted() {
mounted() {
},
},
methods: {
},
methods: {
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<!-- 定向礼包-->
<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">
<img class="tips-img" src="@/assets/icon-info.png" />
<span>
定向礼包:将多种券和服务组合成定向礼包,由指定的员工向指定的客户发放,客户需准确输入设定内容才能成功领取。
</span>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="commentRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<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>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.commentStatus == '0'" type="text" @click="handleRevoke(scope.scope)">发布</el-button>
<el-button v-if="scope.scope.commentStatus == '1'" type="text" @click="handleRevoke(scope.scope)">撤回</el-button>
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> -->
<GLButton type="text" fn="评价详情" @click="handleDetail(scope.scope)">查看</GLButton>
<!-- <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<!-- <GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton> -->
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -29,6 +45,7 @@
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'giftList',
data() {
......@@ -44,27 +61,24 @@ export default {
// 搜索
searchFormData: [
{
label: '评价日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '评价状态',
name: 'commentStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'commentStatusList'
label: '礼包名称',
name: 'orderCode',
type: 'input',
maxlength: 15,
isClear: true
},
{
label: '订单编号',
label: '发放员工',
name: 'orderCode',
type: 'input',
maxlength: 17,
isClear: true
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
......@@ -74,34 +88,50 @@ export default {
tableOption: true,
tableColumns: [
{
label: '订单编号',
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
},
{
label: '序号',
prop: 'idx'
},
{
label: '礼包名称',
prop: 'orderCode'
},
{
label: '备注名称',
prop: 'orderCode',
width: '200'
},
{
label: '评价日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
label: '预估成本/元',
prop: 'orderCode'
},
{
label: '评价状态',
prop: 'commentStatus',
line: 1,
formatter: cellValue => {
return this.baseData.commentStatusList.find(item => item.confId == cellValue.commentStatus).confName
}
label: '发放员工',
prop: 'orderCode'
},
{
label: '预估成本/元',
prop: 'orderCode'
},
{
label: '评论人',
prop: 'customerName',
line: 1,
label: '赠送原因',
prop: 'orderCode'
},
{
label: '创建时间',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return cellValue.customerName || '-'
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
......@@ -164,23 +194,38 @@ export default {
})
},
// 查看
handleDetail(row) {
this.$router.push({
path: '/orderComment/commentDetail',
query: {
id: row.id
}
})
},
// handleDetail(row) {
// this.$router.push({
// path: '/orderComment/commentDetail',
// query: {
// id: row.id
// }
// })
// },
// 发布/撤回
handleRevoke(row) {
var txt = row.commentStatus == '0' ? '发布' : '撤回'
this.secondConfirm(txt, '是否确认'+ txt +'该评论?', 'orderComment', 'changeCommentStatusApi', { id: row.id, commentStatus: row.commentStatus == '0' ? 1 : 0 })
handleExport() {
var params = this.getParams()
// this.$apis.couponManage.couponExportApi(params).then(res => {
// exportFn(res)
// })
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该评论?', 'orderComment', 'deleteCommentApi', { id: row.id })
// this.secondConfirm('删除', '是否确认删除该评论?', 'orderComment', 'deleteCommentApi', { id: row.id })
},
// 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' ? '新增信息' : '编辑信息')
}
addOrEdit != 'add' && (params.id = row.id)
this.$router.push({
path: '/giftBag/editGift',
query: params
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
......@@ -209,12 +254,17 @@ export default {
}
},
setTableFinishFun() {
var page = this.$refs.giftListRef.page
// 添加序号
this.$refs.giftListRef.data.forEach((item, index) => {
item.idx = index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
},
handleSearch() {
this.$refs.commentRef.refreshTable()
this.$refs.giftListRef.refreshTable()
},
handleReset() {
......
<!-- 编辑晒单 -->
<!-- 编辑专区 -->
<template>
<div class="edit-share marketing">
<div class="edit-gift marketing p-t-20 edit-box">
<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"></glsx-combi-form>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
......@@ -14,23 +14,25 @@
<script>
export default {
name: 'editShare',
name: 'editGift',
data() {
return {
size: 'small',
title: '新增晒单',
title: '新增信息',
titleObj: {
1: '新增晒单',
2: '编辑晒单'
add: '新增信息',
edit: '编辑信息'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
// add-新增;edit-编辑;look-查看
addOrEdit: 'add',
id: ''
},
editStatus: false,
labelWidth: '144px',
editForm: {
// 专区类型(1发现频道,2商城专区)
zoneType: '2',
......@@ -43,11 +45,11 @@ export default {
zoneImg: [{ required: true, message: '请选择专区图片', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }]
},
isEdit: true,
editFormData: [
{
label: '专区名称',
name: 'zoneName',
width: '320px',
type: 'input',
maxlength: 20
},
......@@ -55,7 +57,6 @@ export default {
label: '专区图片',
name: 'zoneImg',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
handleUpload: (e, file, targetItem) => {
......@@ -71,12 +72,22 @@ export default {
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
this.routeInfo = this.$route.query
console.log(this.routeInfo.addOrEdit)
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
},
methods: {
......@@ -88,33 +99,67 @@ export default {
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// this.$nextTick(() => {
// this.editStatus = false
// })
// })
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 2) {
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleCancel()
// }
// })
params.merchantList = []
// 专区类型(1发现频道,2商城专区)
params.zoneType = '2'
this.editForm.merchantList.forEach(item => {
params.merchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
// console.log(params)
this.$apis.zoneList.insertZoneApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
}
})
},
handleCancel() {
cancelJump() {
// this.$router.push({
// path: '/orderShare/index'
// path: '/giftBag/index'
// })
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
}
}
}
</script>
<style scoped></style>
<style scoped>
.marketing.edit-gift .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!