Commit c2d8ed41 by zhangquan

服务配置开发

1 parent fe0b463e
...@@ -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
})
}
export default {
get4SList
}
\ No newline at end of file \ No newline at end of file
...@@ -519,4 +519,26 @@ ...@@ -519,4 +519,26 @@
.el-form-item { .el-form-item {
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
...@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get(' https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config') return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get(' https://oss-config.dev.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config')
//return window.fetch('https://', {}).then(res => res.json()) //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' }) // request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
} }
......
<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 class="el-icon-plus" @click="selectMerchant()">选择门店</el-button>
<div v-if="formObj.merchantName">{{ formObj.merchantName }}</div>
</div>
<div class="equity-class" slot="selectEquity">
<div class="equity-area">
<el-checkbox v-model="checked1">备选项1</el-checkbox>
<div>
<el-input class="desc" v-model="txt" placeholder="请输入概述"></el-input>
<quill-editor class="quill" v-model="txt" :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 class="page-btm-btn">
<el-button class="custom_black">取消</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',
txt: '',
relateStoreVisible: false,
selectedList: [],
editorOption: {
placeholder: '请输入具体条款内容',
modules: {
toolbar: false
}
},
editRule:{
merchantId: { required: true, message: '请选择门店', trigger: 'change' },
selectedList: { required: true, message: '至少选择一个权益', trigger: 'change' },
},
formObj: {
merchantId: '',
merchantName: ''
},
formData: [
{
label: '门店名称:',
name:'merchantId',
addHtml:'merchantName'
},
{
label: '选中权益:',
name:'selectedList',
addHtml:'selectEquity'
}
]
}
},
mounted() {
},
methods: {
selectMerchant(){
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(e){
console.log(e)
this.formObj = e
this.selectMerchant()
},
submit(){
let a = this.$refs.editArea
console.log(a.innerHTML)
}
}
}
</script>
<style lang="scss" scoped>
.container{
.main-warp{
height: calc(100vh - 200px);
padding: 32px 20px;
background-color: #fff;
.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) {
console.log(pageCon, 'pageCon')
pageCon && (this.pageConfig = pageCon)
var params = {
merchantId: this.merchantId,
...this.searchForm,
...this.pageConfig
// merchantId: '44209390',
}
console.log(params)
this.$apis.serviceConfig.get4SList(params).then(res => {
console.log(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)
console.log(nowIndex)
this.storeList.forEach((item, index) => {
item.idx = index + 1 + nowIndex
})
console.log(this.storeList)
// 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) {
console.log(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()">新增</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">
<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.download(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '编辑'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.download(row.scope)
}
}
],
searchForm: {
completionStatus: '',
packageCode: '',
channel: '',
successDate: [],
effectiveDate: []
},
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.beforeSale.getOrdersummary,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '服务名称',
prop: 'serveiceName',
line: 1,
width: 200
},
{
label: '条款描述',
prop: 'description',
},
{
label: '使用说明',
line: 1,
prop: 'useRemark'
},
{
label: '创建时间',
line: 1,
prop: 'createdDate',
width: 160,
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '--'
}
},
{
label: '更新时间',
line: 1,
prop: 'updatedDate',
width: 160,
formatter: cellValue => {
return cellValue.effectiveDate ? dayjs(cellValue.effectiveDate).format('YYYY-MM-DD') : '--'
}
},
{
label: '操作人',
line: 1,
prop: 'updatedBy',
width: 140
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageCount', totalCount: 'total' },
}
},
mounted() {
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.successDate.length) {
params.successStartDates = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDates = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDates = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDates = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.beforeSale.getSummaryExportApi(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 = {
completionStatus: '',
packageCode: '',
channel: '',
successDate: [],
effectiveDate: []
}
this.handleSearch()
},
addClause() {
let urlpara = 1
this.$router.push('/serviceConfig/addClause/' + urlpara)
}
}
}
</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!