Commit dc154ed5 by zhangquan

接口联调

1 parent 5d96362a
import { http } from '@/main' import { http } from '@/main'
const CUR_BASE_URL = 'rop-scrm-equity/router'
const get4SList = params => { const get4SList = params => {
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant` params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
...@@ -71,6 +72,56 @@ const getEquityDetail = params => { ...@@ -71,6 +72,56 @@ const getEquityDetail = params => {
}) })
} }
const getServicesItemsList = params => {
params.method = `scrm.api.equity.service.items.pages`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const createCommonConfig = params => {
params.method = `scrm.api.equity.service.items.common.config.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getCommonConfig = params => {
params.method = `scrm.api.equity.service.items.common.config.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const addServicesProject = params => {
params.method = `scrm.api.equity.service.items.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getSpecificaListApi = params => {
params.method = `scrm.api.equity.service.items.grade.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
get4SList, get4SList,
getEquityList, getEquityList,
...@@ -78,5 +129,10 @@ export default { ...@@ -78,5 +129,10 @@ export default {
getServiceList, getServiceList,
craeteEquity, craeteEquity,
updateEquity, updateEquity,
getEquityDetail getEquityDetail,
getServicesItemsList,
createCommonConfig,
getCommonConfig,
addServicesProject,
getSpecificaListApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
<div class="bar-content"> <div class="bar-content">
<label for="" class="content-label">{{label}}</label> <label for="" class="content-label">{{label}}</label>
<div class="editor"> <div class="editor">
<quill-editor ref="myQuillEditor" class="quill" v-model="content[key]" :options="editorOption"></quill-editor> <quill-editor ref="myQuillEditor" class="quill" v-model="obj[attr]" :options="editorOption" @change="onEditorChange($event)"></quill-editor>
<div class="extend-bar"> <div class="extend-bar">
<i class="el-icon-circle-plus extend-icon" @click="insertContent">购买条件</i> <i class="el-icon-circle-plus extend-icon" @click="insertContent">购买条件</i>
</div> </div>
</div> </div>
<el-input type="text" v-model="obj[attr]" name="" id=""></el-input>
<button @click="sss">ss</button>
</div> </div>
</template> </template>
...@@ -22,13 +24,10 @@ export default { ...@@ -22,13 +24,10 @@ export default {
quillEditor, quillEditor,
}, },
props: { props: {
content: { obj: {
type: Object, type: Object
default: ()=>{
return {}
},
}, },
key: { attr: {
type: String, type: String,
default: '', default: '',
}, },
...@@ -69,6 +68,12 @@ export default { ...@@ -69,6 +68,12 @@ export default {
let length = quill.selection.savedRange.index; let length = quill.selection.savedRange.index;
quill.insertEmbed(length, 'label', 132); quill.insertEmbed(length, 'label', 132);
quill.setSelection(length + 1); quill.setSelection(length + 1);
},
onEditorChange(e){
console.log(e)
},
sss(){
console.log(this.obj)
} }
} }
} }
......
<template> <template>
<div class="upload-ctnr"> <div class="upload-ctnr">
<label v-if="name" class="label" for="">{{name}}</label> <label v-if="name" class="label" for="">{{name}}</label>
<div :class="['upload-wrap']" :style="defaultStyle"> <div class="upload-wrap" :style="defaultStyle">
<img v-if="url" class="image" :src="url" alt="" /> <img v-if="url" class="image" :src="url" alt="" />
<div v-else class="add-img"> <div v-else class="add-img">
<input type="file" class="file" id="file" ref="input" @change="upload" accept="image/png, image/jpeg, image/gif, image/jpg" />
<i class="el-icon-plus add"></i> <i class="el-icon-plus add"></i>
<p>上传照片</p> <p>上传照片</p>
</div> </div>
<div class="operate" v-if="url"> <div class="operate" v-if="url">
<div class="btn-wrap"> <div class="btn-wrap">
<i class="el-icon-view"></i> <i class="el-icon-view"></i>
<i class="el-icon-delete"></i> <i class="el-icon-delete" @click="del"></i>
</div> </div>
</div> </div>
</div> </div>
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
type: String, type: String,
default: 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/assets/glsx/logo_menu.png' default: 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/assets/glsx/logo_menu.png'
}, },
key: { attr: {
type: String, type: String,
default: '' default: ''
}, },
...@@ -46,12 +47,28 @@ ...@@ -46,12 +47,28 @@
} }
}, },
methods: { methods: {
upload(e) {
const file = e.target.files[0]
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const base64 = file.name.split('.').pop() + '@' + arrBase64[1]
this.$apis.claims.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.$emit('uploadSuccess', {attr : this.attr, url: res})
})
}
},
del(){
this.$emit('delImage', {attr : this.attr})
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.upload-ctnr{ .upload-ctnr{
display: flex;
.label{ .label{
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
...@@ -66,7 +83,7 @@ ...@@ -66,7 +83,7 @@
.upload-wrap{ .upload-wrap{
display: inline-flex; display: inline-flex;
border: 1px dashed #00000026; border: 1px dashed #00000026;
// box-sizing: border-box; box-sizing: border-box;
width: 104px; width: 104px;
height: 104px; height: 104px;
background: #0000000a; background: #0000000a;
...@@ -92,6 +109,16 @@ ...@@ -92,6 +109,16 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: #666666; color: #666666;
position: relative;
.file{
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
position: absolute;
opacity: 0;
}
.add { .add {
font-size: 18px; font-size: 18px;
} }
......
...@@ -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.dev.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config') return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get(' https://oss-config.test.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' })
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
</FoldFrame> </FoldFrame>
<FoldFrame name="合同介绍区域"> <FoldFrame name="合同介绍区域">
<Editor label="标题和介绍:" :content="obj" key="content"></Editor> <Editor label="标题和介绍:" :obj="obj" attr="content"></Editor>
</FoldFrame> </FoldFrame>
</div> </div>
<div class="preview-area"> <div class="preview-area">
......
<template> <template>
<div class="container"> <div class="container">
<div class="find_wrap">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
</div> <div class="table-wrapper">
<div class="table_wrapper">
<div class="operate_wrap"> <div class="operate_wrap">
<span class="table_title">配置列表</span> <span class="table_title">配置列表</span>
<div class="operate_btn"> <div class="operate_btn">
...@@ -12,8 +10,9 @@ ...@@ -12,8 +10,9 @@
</div> </div>
</div> </div>
<GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="serviceContent" slot-scope="scope"> <div slot="statusSlot" slot-scope="scope">
<div v-html="scope.scope.serviceContent"></div> <span class="statsu-circle" :style="{'background-color': scope.scope.serviceStatus == 0 ? '#FDB757' : '#2CCA74'}"></span>
<span>{{ scope.scope.serviceStatus == 0 ? '待配置': '已配置' }}</span>
</div> </div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
...@@ -61,7 +60,7 @@ ...@@ -61,7 +60,7 @@
], ],
searchForm: { searchForm: {
serviceName: '', serviceName: '',
status: '', serviceStatus: '',
createdDate: '', createdDate: '',
updatedDate: '' updatedDate: ''
}, },
...@@ -69,14 +68,30 @@ ...@@ -69,14 +68,30 @@
searchFormData: [ searchFormData: [
{ {
label: '服务名称', label: '服务名称',
name: 'serveiceName', name: 'serviceName',
type: 'input', type: 'input',
isClear: true, isClear: true,
}, },
{ {
label: '状态', label: '状态',
name: 'status', name: 'serviceStatus',
type: 'input', type: 'select',
optionList: [
{
id: '',
label: '全部'
},
{
id: '0',
label: '待配置'
},
{
id: '1',
label: '已配置'
}
],
optionId: 'id',
optionLabel: 'label',
isClear: true, isClear: true,
}, },
{ {
...@@ -97,14 +112,14 @@ ...@@ -97,14 +112,14 @@
} }
], ],
// 表格 // 表格
getListApi: this.$apis.serviceConfig.getEquityList, getListApi: this.$apis.serviceConfig.getServicesItemsList,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '服务编号', label: '服务编号',
prop: 'sno', prop: 'serviceCode',
width: 200 width: 200
}, },
{ {
...@@ -115,39 +130,38 @@ ...@@ -115,39 +130,38 @@
{ {
label: '可销售服务年限', label: '可销售服务年限',
minWidth: 280, minWidth: 280,
prop: 'serviceContent', prop: 'serviceContent'
addHtml: 'serviceContent'
}, },
{ {
label: '规格数量', label: '规格数量',
minWidth: 150, minWidth: 150,
prop: 'instruct' prop: 'gradeCount'
}, },
{ {
label: '创建时间', label: '创建时间',
prop: 'createDate', prop: 'createdDate',
width: 200, width: 200,
formatter: cellValue => { formatter: cellValue => {
return cellValue.createDate ? dayjs(cellValue.createDate).format('YYYY-MM-DD HH:mm:ss') : '--' return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
} }
}, },
{ {
label: '更新时间', label: '更新时间',
prop: 'updateDate', prop: 'updatedDate',
width: 200, width: 200,
formatter: cellValue => { formatter: cellValue => {
return cellValue.updateDate ? dayjs(cellValue.updateDate).format('YYYY-MM-DD HH:mm:ss') : '--' return cellValue.updatedDate ? dayjs(cellValue.updatedDate).format('YYYY-MM-DD HH:mm:ss') : '--'
} }
}, },
{ {
label: '状态', label: '状态',
minWidth: 280, minWidth: 150,
prop: 'serviceContent', prop: 'status',
addHtml: 'serviceContent' addHtml: 'statusSlot'
}, },
{ {
label: '操作人', label: '操作人',
prop: 'updateBy', prop: 'updatedBy',
width: 140 width: 140
} }
] ]
...@@ -163,12 +177,12 @@ ...@@ -163,12 +177,12 @@
getParams() { getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm?.createdDate?.length) { if (this.searchForm?.createdDate?.length) {
params.minCreateTime = new Date(this.searchForm.createdDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.beginCreateTime = 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' params.endCreateTime = new Date(this.searchForm.createdDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
if (this.searchForm?.updatedDate?.length) { if (this.searchForm?.updatedDate?.length) {
params.minUpdateTime = new Date(this.searchForm.updatedDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.beginUpdateTime = 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' params.endUpdateTime = new Date(this.searchForm.updatedDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.createdDate delete params.createdDate
delete params.updatedDate delete params.updatedDate
...@@ -206,7 +220,7 @@ ...@@ -206,7 +220,7 @@
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
serviceName: '', serviceName: '',
status: '', serviceStatus: '',
createdDate: '', createdDate: '',
updatedDate: '' updatedDate: ''
} }
...@@ -231,21 +245,18 @@ ...@@ -231,21 +245,18 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.find_wrap { .container{
background: #ffffff; background-color: #ffffff;
padding: 20px 20px 2px 20px; padding: 20px;
.resetBtn { .statsu-circle{
background: #ffffff; display: inline-block;
color: #5850ff; width: 6px;
border: 1px solid #5850ff; height: 6px;
} border-radius: 50%;
.m-r-l-20 { background-color: #FDB757;
margin: 0 20px; margin-right: 8px;
} vertical-align: middle;
} }
.table_wrapper {
background: #ffffff;
padding: 0 20px 20px;
} }
</style> </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!