Commit f8e2a6e9 by 前端

Merge branch 'SAAS+V5.3.0' into 'master'

上线合并

See merge request !87
2 parents d7a19f60 207c939d
import { http } from '@/main'
// 销售日报配置项数据
const getSalesDailyConfig = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.sale`
params.routerMethod = 'dj.api.sale.store.daily.report.config.data'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'post',
data: params,
sign: true
})
}
// 保存销售日报配置项
const saveSalesDailyConfig = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.sale`
params.routerMethod = 'dj.api.sale.store.daily.report.config.save'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
export default {
getSalesDailyConfig,
saveSalesDailyConfig
}
......@@ -94,6 +94,16 @@ const staticRoutes = Object.freeze([
path: '/saasOrder/index',
component: resolve => require([`@/views/saasOrder/index.vue`], resolve),
meta: {}
},
// 销售日报管理
{
name: 'salesDaily',
path: '/salesDaily/index',
component: resolve => require([`@/views/salesDaily/index.vue`], resolve),
meta: {}
}
])
export default staticRoutes
<template>
<div class="marketing">
<div class="addConfig-wrap">
<div class="header color-3 weight-6 text-16">
销售日报配置
</div>
<div class="config-wrap gl-form-page" v-loading="loading">
<glsx-combi-form ref="showSearch" labelWidth="130px" :isBlock="true" :formObj="editForm" :formData="editFormData"></glsx-combi-form>
</div>
<!--
<el-form ref="form" :model="form" label-width="154px">
<el-form-item label="所属企业:">
<el-select v-model="config.merchantId" placeholder="请选择" @change="handleMerchatChange" @visible-change="hideSelect">
<el-option v-for="item in merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId"></el-option>
</el-select>
</el-form-item>
</el-form>
</div> -->
</div>
<GLFooter class="footer-panel">
<!-- <el-button @click="handleStaffClose" size="medium">取消</el-button> -->
<el-button type="primary" @click="handleStaffConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
editForm: {
dailyReportStaffList: [],
randomCheckStaffList: []
},
editFormData: [
{
label: '所属企业',
name: 'merchantName',
type: 'input',
width: '436px',
isDisabled: true
},
{
label: '推送人',
name: 'robotStaffName',
type: 'input',
width: '436px',
isDisabled: true
},
{
label: '配置群',
name: 'groupName',
type: 'input',
width: '436px',
isDisabled: true
},
{
label: '日报人员名单',
name: 'dailyReportStaffList',
type: 'select',
width: '436px',
multiple: true,
isClear: true,
optionList: [],
optionId: 'staffUuid',
optionLabel: 'staffName',
optionsName: 'staffList'
},
{
label: '抽检人员名单',
name: 'randomCheckStaffList',
type: 'select',
width: '436px',
multiple: true,
isClear: true,
optionList: [],
optionId: 'staffUuid',
optionLabel: 'staffName',
optionsName: 'staffList'
}
],
baseData: {
staffList: []
}
}
},
mounted() {
this.getSalesDailyConfig()
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]?.length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
// 处理再次编辑时,之前已选人员当前已离职/职务变更的情况,直接去掉
dealSelectUser() {
const existUserList = this.baseData.staffList.map(item => item.staffUuid)
this.editForm.dailyReportStaffList = this.editForm.dailyReportStaffList.filter(item => existUserList.includes(item))
this.editForm.randomCheckStaffList = this.editForm.randomCheckStaffList.filter(item => existUserList.includes(item))
},
getSalesDailyConfig() {
this.$apis.salesDaily.getSalesDailyConfig({}).then(res => {
const { groupName, merchantName, robotStaffName, dailyReportStaffList = [], randomCheckStaffList = [] } = res
this.editForm = { groupName, merchantName, robotStaffName, dailyReportStaffList: dailyReportStaffList.map(item => item.staffUuid), randomCheckStaffList: randomCheckStaffList.map(item => item.staffUuid) }
this.baseData.staffList = res.staffList || []
console.log(res, 'staffList')
this.dealSelectUser()
this.getOptionsList('editFormData', false)
})
},
handleStaffConfirm() {
console.log(this.editForm)
if (this.loading) {
return true
}
this.loading = true
var params = {
dailyReportStaffList: [],
randomCheckStaffList: []
}
const attrList = ['dailyReportStaffList', 'randomCheckStaffList']
attrList.forEach(item => {
this.editForm[item].forEach(k => {
params[item].push({
staffUuid: k,
staffName: this.baseData.staffList.find(n => n.staffUuid == k).staffName
})
})
})
console.log(params, 'params')
this.$apis.salesDaily.saveSalesDailyConfig(params).then(res => {
console.log(res)
this.$message({
message: res.code == '0' ? '配置成功!' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
.finally(() => {
this.loading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.footer-panel {
margin-top: 20px;
}
.search-groomname {
width: 402px;
margin: 12px 16px 0;
/deep/.el-input {
width: 402px;
}
}
.addConfig-wrap {
background: #fff;
.header {
width: 100%;
height: 58px;
font-size: 20px;
border-bottom: 1px solid #e5e5e5;
line-height: 58px;
padding-left: 20px;
}
.ml12 {
margin-left: 12px;
}
.config-wrap {
padding: 20px;
min-height: 280px;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
}
.is-reverse {
transform: rotate(180deg);
}
/* 页面内定制:禁用输入框样式与多选选中样式,仅作用于本页 */
.marketing {
/deep/ .glsx-combi-form-block {
/* 禁用输入框样式 */
.el-input.is-disabled .el-input__inner {
border-radius: 4px;
background: #f7f8fa; /* 设计稿的浅灰底 */
border-color: #e8e8ea; /* 边框更浅 */
color: #999999; /* 文本灰色 */
-webkit-text-fill-color: #999999; /* 修复Chrome禁用文本颜色 */
}
.el-input.is-disabled .el-input__icon {
color: #c0c4cc;
}
/* 多选选中标签(输入框内的tag)样式 */
.el-select .el-select__tags .el-tag {
background-color: #f2efff !important; /* 淡紫底 */
border: 1px solid #9994ff !important; /* 边框为浅紫 */
color: #5850ff !important; /* 文本为主题紫 */
border-radius: 4px !important;
height: 24px;
line-height: 22px;
padding: 0 8px;
}
.el-select .el-select__tags .el-tag .el-tag__close {
font-size: 16px;
font-weight: bold;
color: #5850ff;
background-color: #f2efff !important;
}
.el-select .el-select__tags .el-tag .el-tag__close:hover {
color: #4b41ff;
background: transparent;
}
/* 多选下拉面板中已选项样式 */
.el-select-dropdown__item.selected {
background-color: rgba(88, 80, 255, 0.08);
color: #5850ff;
}
.el-select-dropdown__item.selected .el-icon-check {
color: #5850ff !important;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!