Commit 93152940 by 前端

Merge branch 'v3.6.0' into 'master'

V3.6.0  ==》 master

See merge request !30
2 parents 559b3fd7 57e26adf
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"glsx-components": "^1.5.2", "glsx-components": "^1.5.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2"
}, },
......
...@@ -102,7 +102,7 @@ const get4SList = params => { ...@@ -102,7 +102,7 @@ const get4SList = params => {
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant` params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
return http({ return http({
url: 'rop-scrm-carlife/router', url: 'rop-scrm-carlife/router',
method: 'GET', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
......
import { http } from '@/main'
const get4SList = params => {
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取权益列表
const getEquityList = params => {
params.method = 'scrm.api.equity.serviceterms.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const exportEquityApi = params => {
params.method = `scrm.api.equity.serviceterms.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getServiceList = params => {
params.method = `scrm.api.equity.serviceterms.itemslist`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const craeteEquity = params => {
params.method = `scrm.api.equity.serviceterms.insert`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquity = params => {
params.method = `scrm.api.equity.serviceterms.update`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getEquityDetail = params => {
params.method = `scrm.api.equity.serviceterms.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
get4SList,
getEquityList,
exportEquityApi,
getServiceList,
craeteEquity,
updateEquity,
getEquityDetail
}
\ No newline at end of file \ No newline at end of file
...@@ -520,3 +520,25 @@ ...@@ -520,3 +520,25 @@
margin: 0 !important; margin: 0 !important;
} }
} }
.operate_wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table_title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate_btn {
.export_btn {
margin-left: 8px;
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -582,7 +582,7 @@ export default { ...@@ -582,7 +582,7 @@ export default {
reimbursementCountiesCode reimbursementCountiesCode
} }
Object.assign(this.editForm, obj) Object.assign(this.editForm, obj)
this.serviceItemsList = itemsList this.serviceItemsList = itemsList || []
this.getAccountInfo(contractNo) this.getAccountInfo(contractNo)
}) })
}, },
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
this.accountForm.objectType = 0 this.accountForm.objectType = 0
} }
if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0 if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0
this.serviceItemsList = serviceItemsList this.serviceItemsList = serviceItemsList || []
// 以下是文件数据 // 以下是文件数据
res.files.forEach(item => { res.files.forEach(item => {
let obj = { url: item.fileUrl, fileType: item.fileType, name: item.fileName, progress: 100 } let obj = { url: item.fileUrl, fileType: item.fileType, name: item.fileName, progress: 100 }
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
for (let key in this.editForm) { for (let key in this.editForm) {
this.editForm[key] = res[key] || this.editForm[key] this.editForm[key] = res[key] || this.editForm[key]
} }
this.serviceItemsList = serviceItemsList this.serviceItemsList = serviceItemsList || []
this.getAccountInfo(contractNo) this.getAccountInfo(contractNo)
}) })
}, },
......
<template>
<div class="container">
<div class="main-warp">
<glsx-combi-form ref="submitRef" labelWidth="154px" defaultWidth="284px" :isInline="false" :formObj="formObj" :formData="formData" :formRules="editRule">
<div slot="merchantName">
<el-button v-if="routeInfo.type==1 || (routeInfo.type==3 && routeInfo.merchantId) " class="el-icon-plus" @click="selectMerchant()">选择门店</el-button>
<div
class="merchantNameLabel"
v-if="formObj.merchantName && formObj.merchantId"
>
<p>所属门店</p>
<div class="merchantName ellipsis-1">{{ formObj.merchantName }}</div>
</div>
<div v-if="routeInfo.type!=1 && !routeInfo.merchantId">所有门店适用</div>
</div>
<div class="equity-class" slot="selectEquity">
<div class="equity-area" v-for="item in formObj.serviceList" :key="item.serviceCode">
<el-checkbox @change="checkField" v-model="item.checked">{{item.serviceName}}</el-checkbox>
<div v-if="item.checked">
<el-input class="desc" v-model="item.summary" placeholder="请输入概述"></el-input>
<quill-editor class="quill" v-model="item.serviceContent" :options="editorOption"></quill-editor>
</div>
</div>
</div>
</glsx-combi-form>
<select-store
v-if="relateStoreVisible"
ref="relateStore"
:dialogVisible="relateStoreVisible"
:merchantInfo="formObj"
@handleRelateStoreConfirm="handleRelateStoreConfirm"
@handleRelateStoreClose="selectMerchant"
>
</select-store>
</div>
<div v-if="routeInfo.type!=2" class="page-btm-btn">
<el-button class="custom_black" @click="back">取消</el-button>
<el-button type="primary" @click="submit">提交</el-button>
</div>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import selectStore from './components/selectStore.vue'
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
export default {
name: 'addClause',
components:{
glsxCombiForm,
quillEditor,
selectStore
},
data() {
return {
size: 'small',
routeInfo: {},
serviceList: [],
relateStoreVisible: false,
selectedList: [],
editorOption: {
placeholder: '请输入具体条款内容',
modules: {
toolbar: false,
clipboard: {
// 粘贴版,处理粘贴时候的自带样式
matchers: [[Node.ELEMENT_NODE, this.HandleCustomMatcher]],
},
}
},
editRule:{
merchantId: { required: true, message: '请选择门店', trigger: 'change' },
serviceList: { trigger: 'blur', validator: (rule, value, callback) => {
const target = value?.find(item => item.checked)
if (!target) {
callback(new Error("至少选择一个权益"));
} else {
callback();
}
} },
},
formObj: {
merchantId: '',
merchantName: '',
serviceList: []
},
formData: [
{
label: '门店名称:',
name:'merchantId',
addHtml:'merchantName'
},
{
label: '选中权益:',
name:'serviceList',
addHtml:'selectEquity'
}
]
}
},
created() {
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
if(this.routeInfo?.id) {
this.getServiceDetail()
}else{
this.getServiceList()
}
},
mounted() {
},
methods: {
HandleCustomMatcher(node, Delta) {
// 文字、图片等,从别处复制而来,清除自带样式,转为纯文本
let ops = []
Delta.ops.forEach(op => {
if (op.insert && typeof op.insert === 'string') {
ops.push({
insert: op.insert,
})
}
})
Delta.ops = ops
return Delta
},
getServiceDetail(){
const { id } = this.routeInfo
this.$apis.serviceConfig.getEquityDetail({id}).then(res => {
if(res?.id) {
const { id, merchantId, merchantName, serviceCode, serviceContent, serviceName, summary} = res
let list = [{ checked: true, serviceCode, serviceContent, serviceName, summary }]
this.formObj = {
id,
merchantId,
merchantName,
serviceList: list
}
}
})
},
getServiceList(){
this.$apis.serviceConfig.getServiceList({}).then(res => {
if(res?.length){
this.formObj.serviceList = res.map(item => {
item.checked=false
item.serviceContent = ''
item.summary = ''
return item
})
}
})
},
selectMerchant(){
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(e = {}){
const {merchantId, merchantName} = e
this.formObj.merchantId = merchantId
this.formObj.merchantName = merchantName
this.$refs.submitRef.$refs.formRef.validateField('merchantId')
this.selectMerchant()
},
checkField(){
this.$refs.submitRef.$refs.formRef.validateField('serviceList')
},
back(){
this.$router.back()
},
editService(){
const { id, merchantId, merchantName, serviceList } = this.formObj
const { serviceCode, serviceContent, serviceName, summary } = serviceList?.[0] || {}
const params = { id, merchantId, merchantName, serviceCode, serviceContent, serviceName, summary}
this.$apis.serviceConfig.updateEquity(params).then(res => {
if(res){
this.$message.success('修改成功')
this.$router.push('/serviceConfig/index')
}
})
},
submit(){
if(this.routeInfo.type!=1 && !this.routeInfo.merchantId){
this.$refs.submitRef.$refs.formRef.validateField('serviceList', valid => {
if(valid) return; //检验单个规则空才是通过
this.addConfigApi()
})
}else{
this.$refs.submitRef.$refs.formRef.validate(valid => {
console.log(222, valid)
if(!valid) return;
this.addConfigApi()
})
}
},
addConfigApi(){
if(this.routeInfo.id){
this.editService()
return;
}
let { merchantId, merchantName } = this.formObj
let serviceIterm = []
this.formObj.serviceList.forEach(item => {
if(item.checked) {
let {serviceCode, serviceContent, serviceName, summary } = item
serviceIterm.push({serviceCode, serviceContent, serviceName, summary })
}
})
let params = {
merchantId,
merchantName,
serviceIterm
}
this.$apis.serviceConfig.craeteEquity(params).then(res => {
if(res?.length){
this.$message.success('操作成功')
this.$router.push('/serviceConfig/index')
}
})
}
}
}
</script>
<style lang="scss" scoped>
.container{
.main-warp{
// height: calc(100vh - 200px);
padding: 32px 20px;
background-color: #fff;
.merchantNameLabel {
width: 510px;
color: #1d1d1d;
// margin-left: 50px;
padding: 16px;
margin-top: 8px;
border: 1px solid #e6e6e6;
border-radius: 8rpx;
background: #f9f9f9;
.merchantName {
box-sizing: border-box;
width: 284px;
height: 32px;
background: #ffffff;
border: 1px solid #e6e6e6;
border-radius: 4px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #999999;
line-height: 32px;
padding: 0 8px;
}
}
.equity-class{
.equity-area{
.desc{
margin-bottom: 10px;
width: 432px;
}
/deep/ .el-checkbox{
display: block;
}
.quill{
width: 580px;
height: 80px;
/deep/ .ql-container{
border-radius: 4px;
border-color: #dcdfe6;
}
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="select-store">
<!-- width="600px" -->
<GLDialog bigTitle="选择门店"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
<span slot="footer">
<el-button :size="size"
type="primary"
@click="getTable">查询</el-button>
<el-button :size="size"
@click="resetTable">重置</el-button>
</span>
</glsx-combi-form>
<!-- : :hasPage="false"
:getListApi="getListApi"
:tableData="storeList" -->
<GLTable ref="storeRef"
:noDataImg="url"
:tableTotal="total"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun">
<div slot="radioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="merchantId"
:label="scope.scope.merchantNo"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
</GLTable>
<!-- <span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span> -->
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'selectStore',
components: {
glsxCombiForm
},
data() {
return {
url: url,
size: 'small',
searchForm: {
merchantId: '',
merchantName: ''
},
// getListApi: this.$apis.common.getMerchantList,
total: 0,
storeList: [],
heightBox: 200,
merchantId: '',
merchantName: '',
// 搜索
searchFormData: [
{
label: '商户名称',
name: 'merchantName',
type: 'input',
placeholder: '请输入商户名称',
width: '300px',
labelWidth: '10px'
},
{
label: '商户ID',
name: 'merchantId',
type: 'input',
inputType: 'number',
placeholder: '请输入商户ID',
width: '300px',
labelWidth: '10px'
}
],
pageConfig: {
pageSize: 10,
currentPage: 1
},
tableParams: {
listName: 'list',
// tableOption: true,
// 行数据的key
// mutiSelectUniqueKey: 'staffId',
// checkSelectKey: 'staffId',
// checkSelectVal: [],
// 多选ref的名称
// mutiSelectName: 'list',
tableColumns: [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '序号',
prop: 'idx',
width: 80
},
{
label: '商户名称',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '商户id',
prop: 'merchantNo',
formatter: cellValue => {
return cellValue.merchantNo || '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
storeSearchForm: {
type: Object
},
merchantInfo: {
required: true
}
// merchantId: {
// type: String,
//
// }
// orderCode: {
// type: String,
// required: true
// }
},
mounted() {
// this.userInfo = this.$globalState.session
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.merchantId = this.merchantInfo.merchantId
this.merchantName = this.merchantInfo.merchantName
this.getList()
},
methods: {
getList(pageCon) {
pageCon && (this.pageConfig = pageCon)
var params = {
merchantId: this.merchantId,
...this.searchForm,
...this.pageConfig
// merchantId: '44209390',
}
this.$apis.serviceConfig.get4SList(params).then(res => {
this.storeList = res.list
this.total = res.total
// // this.storeList = res.staffUnitList
// // var page = this.$refs.staffRef.page
// // // 添加序号
// pageConfig
let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
this.storeList.forEach((item, index) => {
item.idx = index + 1 + nowIndex
})
// this.$refs.staffRef.tableHeightValues = '460px'
// })
})
},
getTable() {
this.$refs.storeRef.page.currentPage = 1
this.getList()
},
setTableFinishFun() {
// console.log(this.$refs.staffRef.data)
// this.storeList = this.$refs.staffRef.data
//接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px'
},
handleClick(val) {
// let { merchantId, merchantName } =val
this.merchantId = val.merchantNo
this.merchantName = val.merchantName
// let temp = JSON.parse(JSON.stringify(val))
// delete temp.idx
// this.staffUuid = val.uuid
// this.store = val
},
resetTable() {
this.searchForm = {
merchantId: '',
merchantName: ''
}
this.getTable()
// this.$refs.showSearch.refreshTable()
},
handleClose() {
this.$emit('handleRelateStoreClose')
},
handleConfirm() {
// if (!this.staffUuid)
// return this.$message({
// message: '请先选择员工',
// type: 'error'
// })
// let parmas = {
// subOrderCode: this.orderCode,
// staffUuid: this.staffUuid
// }
// this.$apis.orderManage.signerOrder(parmas).then(res => {
// console.log(res)
// })
// this.staffUuid
this.$emit('handleRelateStoreConfirm', {
merchantId: this.merchantId,
merchantName: this.merchantName
})
}
}
}
</script>
<style lang="scss">
.select-store {
.storeDailog {
width: 500px;
}
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
.store-table .el-radio__label {
display: none;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="container">
<div class="find_wrap">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="table_wrapper">
<div class="operate_wrap">
<span class="table_title">配置列表</span>
<div class="operate_btn">
<el-button :size="size" type="primary" @click="addClause(1)">新增</el-button>
<el-button :size="size" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="serviceContent" slot-scope="scope">
<div v-html="scope.scope.serviceContent"></div>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import utils from '../../util/util'
export default {
name: 'equityList',
components:{
},
data() {
return {
size: 'small',
buttonList: [
{
type: 'el-button',
name: row => {
return '查看'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.addClause(2,row.scope)
}
},
{
type: 'el-button',
name: row => {
return '编辑'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.addClause(3,row.scope)
}
}
],
searchForm: {
merchantName: '',
serviceName: '',
serviceContent: '',
createdDate: '',
updatedDate: ''
},
tableSearchForm: {},
searchFormData: [
{
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true,
},
{
label: '服务名称',
name: 'serveiceName',
type: 'input',
isClear: true,
},
{
label: '条款描述',
name: 'serviceClause',
type: 'input',
isClear: true,
},
{
label: '创建时间',
name: 'createdDate',
type: 'datePicker',
labelWidth: 95,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '更新时间',
name: 'updatedDate',
type: 'datePicker',
labelWidth: 95,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.serviceConfig.getEquityList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '服务名称',
prop: 'serviceName',
width: 200
},
{
label: '条款描述',
minWidth: 280,
prop: 'serviceContent',
addHtml: 'serviceContent'
},
{
label: '使用说明',
minWidth: 150,
prop: 'instruct'
},
{
label: '创建时间',
prop: 'createDate',
width: 200,
formatter: cellValue => {
return cellValue.createDate ? dayjs(cellValue.createDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '更新时间',
prop: 'updateDate',
width: 200,
formatter: cellValue => {
return cellValue.updateDate ? dayjs(cellValue.updateDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '操作人',
prop: 'updateBy',
width: 140
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm?.createdDate?.length) {
params.minCreateTime = new Date(this.searchForm.createdDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.maxCreateTime = new Date(this.searchForm.createdDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm?.updatedDate?.length) {
params.minUpdateTime = new Date(this.searchForm.updatedDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.maxUpdateTime = new Date(this.searchForm.updatedDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createdDate
delete params.updatedDate
return {...params}
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.serviceConfig.exportEquityApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
})
},
handleSearch() {
this.$refs.equityRef.refreshTable()
},
handleReset() {
this.searchForm = {
merchantName: '',
serviceName: '',
serviceContent: '',
createdDate: '',
updatedDate: ''
}
this.handleSearch()
},
addClause(type, row) {
// 1新增 2查看 3编辑
const { id, merchantId } = row || {}
let query = {
type
}
if(type!=1){
query.id = id
query.merchantId = merchantId
}
const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push('/serviceConfig/addClause/' + queryStr)
}
}
}
</script>
<style lang="scss" scoped>
.find_wrap {
background: #ffffff;
padding: 20px 20px 2px 20px;
.resetBtn {
background: #ffffff;
color: #5850ff;
border: 1px solid #5850ff;
}
.m-r-l-20 {
margin: 0 20px;
}
}
.table_wrapper {
background: #ffffff;
padding: 0 20px 20px;
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!