Commit a463bef2 by 前端

Merge branch 'ybw_dev_v2.0.0' into 'v2.0.0'

添加定向礼包2.00版本内容

See merge request !3
2 parents a39591c0 b085c291
......@@ -97,4 +97,15 @@ const insertGiftApi = params => {
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi }
const templateModal = params => {
params.method = 'scrm.api.coupon.directional.gift.approve.template.detail'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi,templateModal }
......@@ -117,6 +117,9 @@ html {
.marketing .edit-container {
margin-bottom: 84px;
}
.marketing .approval-container{
margin-bottom: 10px;
}
.marketing .edit-form-container {
margin-top: 20px;
......
......@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
......
<!-- 编辑礼包 -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div v-if="routeInfo.addOrEdit!='add'" class="container approval-container">
<p class="edit-title">审批信息</p>
<div class="approval-info">
<div class="approval_label">审批人:{{editForm.approveBy}}</div>
<div class="approval_label">审批状态:<span :style="{color:approvalStatusColor[approvalStatus]}">{{approvalStatusVal[approvalStatus]}}</span></div>
<div v-if="approvalStatus==2" class="approval_label">驳回说明:<div class="approval_con">{{editForm.approveExplain}}</div></div>
</div>
</div>
<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="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
......@@ -37,10 +45,23 @@
</div>
</div>
</glsx-combi-form>
<div v-if="routeInfo.addOrEdit!='add'" class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{editForm.createdDate}}</span>
<span class="">创建人:{{editForm.createdBy}}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{editForm.updatedDate}}</span>
<span class="">修改人:{{editForm.updatedBy}}</span>
</div>
</div>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="primary" @click="handleConfirm">提交</el-button>
</div>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedGiftList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
<select-staff-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchStaffForm" :selectedStaffList="selectedStaffList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-staff-dialog>
......@@ -50,6 +71,7 @@
<script>
import selectStaffDialog from './selectStaffDialog.vue'
import selectGiftDialog from './selectGiftDialog.vue'
import * as dayjs from 'dayjs'
export default {
name: 'editGift',
data() {
......@@ -224,7 +246,13 @@ export default {
maxlength: 50,
width: '567px'
}
]
],
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatus:1,
approvalStatusVal:['审批中','审批通过','已驳回'],
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E'],
isChangeCoupons:true,
isChangePeople:true,
}
},
......@@ -239,6 +267,16 @@ export default {
this.editStatus = true
},
deep: true
},
'editForm.couponList':{
handler(val){
this.isChangeCoupons = this.judgeAddOrDel(val,this.currentCoupons,'id')
}
},
'editForm.staffList':{
handler(val){
this.isChangePeople = this.judgeAddOrDel(val,this.currentPeople,'staffUUID')
}
}
},
......@@ -259,6 +297,9 @@ export default {
item.id = item.couponId
item.anticipatedCost = item.couponAnticipatedCost
})
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.approvalStatus = res.data.approveStatus - 1
this.editForm = res.data
this.editForm.receiveWay = this.editForm.receiveWay + ''
this.recoveryCoupon()
......@@ -280,9 +321,24 @@ export default {
this.editForm.couponList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
this.currentPeople = this.$common.utils.deepClone(this.editForm.staffList)
this.hasCouponBlock(false)
},
// 用来判断券和发放员工是否有增删 type: id为礼券 staffUUID为发放员工
judgeAddOrDel(newArr,oldArr,type='id'){
let id1 = [],id2 = []
newArr.forEach(item=>{
id1.push(item[type])
})
oldArr.forEach(item=>{
id2.push(item[type])
})
let flag = id1.length === id2.length && id1.sort().toString() === id2.sort().toString();
return flag
},
receiveWayChange(val) {
var receiveDetailsIdx = this.editFormData.findIndex(item => item.name == 'receiveDetails')
this.editFormData[receiveDetailsIdx].placeholder = val == '1' ? '请输入领取手机号' : '请输入领取车架号后6位'
......@@ -389,24 +445,44 @@ export default {
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
}
this.loading = true
this.$apis.giftBag
.insertGiftApi(params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
params.requestSource = 1
// 插入判断是否存在审批模板
const { session } = this.$globalState
this.$apis.giftBag.templateModal({merchantId:session.merchantId}).then((result)=>{
if(result.data!=null&&(!this.isChangeCoupons || !this.isChangePeople)){
this.$confirm(`<div>提交后立即生效,如需审批,请在企微工作台创建</div><div>是否继续提交</div>`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString:true
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
.then(() => {
this.insertHttp(params)
})
.catch(() => { })
}else{
this.insertHttp(params)
}
})
}
})
},
// 创建-更新接口
insertHttp(params){
this.loading = true
this.$apis.giftBag.insertGiftApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
},
cancelJump() {
this.$router.push({
path: '/giftBag/index'
......@@ -543,4 +619,48 @@ export default {
width: 100px;
}
}
// v2.0.0
.approval-info{
display: flex;
box-sizing: border-box;
padding: 32px 0 12px 82px;
.approval_label{
font-size: 14px;
font-weight: 400;
color: #666666;
width: 30%;
display: flex;
line-height: 20px;
white-space: nowrap;
.approval_con{
width: 80%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
.approval_note_container{
.line{
margin: 0 20px;
border-top: 1px solid #D8D8D8 ;
}
.note_container{
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,.right{
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40{
margin-right: 40px;
}
}
}
}
</style>
<!-- 礼包详情 -->
<template>
<div class="edit-gift marketing p-t-20 edit-box">
<div class="container approval-container">
<p class="edit-title">审批信息</p>
<div class="approval-info">
<div class="approval_label">审批人:{{editForm.approveBy}}</div>
<div class="approval_label">审批状态:<span :style="{color:approvalStatusColor[approvalStatus]}">{{approvalStatusVal[approvalStatus]}}</span></div>
<div v-if="approvalStatus==2" class="approval_label">驳回说明:<div class="approval_con">{{editForm.approveExplain}}</div></div>
</div>
</div>
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" 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">
......@@ -33,14 +41,29 @@
</div>
</div>
</glsx-combi-form>
<div class="approval_note_container">
<div class="line"></div>
<div class="note_container">
<div class="left">
<span class="mar40">创建时间:{{editForm.createdDate}}</span>
<span class="">创建人:{{editForm.createdBy}}</span>
</div>
<div class="right">
<span class="mar40">最后修改时间:{{editForm.updatedDate}}</span>
<span class="">修改人:{{editForm.updatedBy}}</span>
</div>
</div>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">返回</el-button>
<!-- <el-button type="default" @click="handleCancel">修改</el-button> -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'giftDetail',
data() {
......@@ -141,7 +164,11 @@ export default {
name: 'giveReason',
type: 'showTxt'
}
]
],
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatus:2,
approvalStatusVal:['审批中','审批通过','已驳回'],
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E'],
}
},
......@@ -158,7 +185,10 @@ export default {
this.$apis.giftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.editForm = res.data
this.approvalStatus = res.data.approveStatus - 1
this.recoveryCoupon()
this.recoveryTotalPrice()
})
......@@ -319,4 +349,49 @@ export default {
width: 100px;
}
}
// v2.0.0
.approval-info{
display: flex;
box-sizing: border-box;
padding: 32px 0 12px 82px;
.approval_label{
font-size: 14px;
font-weight: 400;
color: #666666;
width: 30%;
// width: 80px;
display: flex;
line-height: 20px;
white-space: nowrap;
.approval_con{
width: 80%;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
.approval_note_container{
.line{
margin: 0 20px;
border-top: 1px solid #D8D8D8 ;
}
.note_container{
box-sizing: border-box;
padding: 32px 68px 12px 68px;
display: flex;
justify-content: space-between;
.left,.right{
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: #666666;
.mar40{
margin-right: 40px;
}
}
}
}
</style>
......@@ -38,6 +38,9 @@
<div slot="name" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.name }}</p>
</div>
<div slot="approveStatus" slot-scope="scope">
<span :style="{color:approvalStatusColor[scope.scope.approveStatus-1]}">{{approvalStatusVal[scope.scope.approveStatus-1]}}</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
......@@ -61,6 +64,7 @@ export default {
searchForm: {
name: '',
staffName: '',
approveStatus:'',
createDate: []
},
tableSearchForm: {},
......@@ -82,6 +86,15 @@ export default {
isClear: true
},
{
label: '审批状态',
name: 'approveStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'approvalStatusList'
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
......@@ -140,6 +153,11 @@ export default {
}
},
{
label: '审批状态',
prop: 'approveStatus',
addHtml: 'approveStatus',
},
{
label: '创建时间',
prop: 'createdDate',
width: '180',
......@@ -160,8 +178,26 @@ export default {
confId: '1',
confName: '已发布'
}
],
approvalStatusList:[
{
confId: 1,
confName: '审批中'
},
{
confId: 2,
confName: '审批通过'
},
{
confId: 3,
confName: '已驳回'
},
]
}
},
// 1 审批中;2 审批通过; 3审批驳回
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatusColor:['#FF6D00','#2CCA74','#EB4E4E'],
approvalStatusVal:['审批中','审批通过','已驳回'],
}
},
......@@ -216,6 +252,13 @@ export default {
},
handleDelete(row) {
if(row.approveStatus==1){
this.$message({
message: '不支持删除审批中状态的礼包',
type: 'error'
})
return
}
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
},
......@@ -231,6 +274,13 @@ export default {
// add-新增;edit-编辑
handleEdit(addOrEdit, row) {
if(addOrEdit=='edit'&&row.approveStatus==1){
this.$message({
message: '不支持修改审批中状态的礼包',
type: 'error'
})
return
}
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新增礼包' : '编辑礼包')
......
......@@ -5,7 +5,7 @@
</template>
<script>
import E from 'wangeditor'
// import E from 'wangeditor'
export default {
name: 'textBox',
data() {
......@@ -15,23 +15,23 @@ export default {
}
},
mounted() {
this.getEdit()
// this.getEdit()
},
methods: {
getEdit() {
var editor = new E('#div-demo')
// getEdit() {
// var editor = new E('#div-demo')
editor.config.uploadImgShowBase64 = true
editor.config.showMenuTooltips = true
editor.config.menuTooltipPosition = 'down'
editor.config.height = 400
editor.config.uploadVideoServer = '/api/upload-video'
editor.config.excludeMenus = [
'code'
]
// editor.config.uploadImgShowBase64 = true
// editor.config.showMenuTooltips = true
// editor.config.menuTooltipPosition = 'down'
// editor.config.height = 400
// editor.config.uploadVideoServer = '/api/upload-video'
// editor.config.excludeMenus = [
// 'code'
// ]
editor.create()
}
// editor.create()
// }
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!