Commit dc154ed5 by zhangquan

接口联调

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