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">
......
......@@ -4,14 +4,14 @@
<div class="base-info">
<div class="global-title">基本信息</div>
<div class="main-wrap">
<glsx-combi-form ref="editFormRefCar" labelWidth="154px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="editRuleCar">
<glsx-combi-form ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="timeLimitSlot">
<el-checkbox-group v-model="formObj.nianxian">
<el-checkbox v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox>
<el-checkbox-group v-model="formObj.salePeriod">
<el-checkbox v-for="item in salePeriodList" :label="item.key" :key="item.key">{{ item.label }}</el-checkbox>
</el-checkbox-group>
</div>
<div slot="logoSettingSlot" class="logo-setting">
<Upload v-for="(item,idx) in formObj.logo" :key="idx" :name="item.name"></Upload>
<Upload v-for="item in logoList" :url="formObj[item.key]" @delImage="delImage" @uploadSuccess="uploadSuccess" :attr="item.key" :key="item.key" :name="item.name"></Upload>
<span class="upload-tip">建议尺寸:88px*88px,图片格式为jpg,jpeg,png</span>
</div>
</glsx-combi-form>
......@@ -20,26 +20,34 @@
<div class="services-wrap">
<div class="global-title">服务介绍</div>
<div class="main-wrap">
<glsx-combi-form ref="editFormRefCar" labelWidth="154px" :isInline="false" :formObj.sync="formObj" :formData="servicesformData" :formRules="editRuleCar">
<glsx-combi-form ref="servicesRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="servicesformData" :formRules="myRule">
<div slot="buyConditionSlot" class="buy-condition">
<el-checkbox-group v-model="formObj.nianxian">
<el-checkbox v-for="(city,index) in cities" :key="city">
<span>条件{{index+1}}</span>
<span class="condition">
asdasdasdasdasdasdasdasdasd
</span>
<i class="el-icon-delete del" @click.prevent="delCondition($event)"></i>
<el-checkbox-group v-model="formObj.buyConditions">
<el-checkbox v-for="(item,index) in conditionList" :label="item.id" :key="index">
<span class="sign">条件{{index+1}}</span>
<span v-if="!item.newItem" class="condition">{{item.contractContent}}</span>
<el-input v-else type="text" v-model="curEditCondition.value" @blur.stop="createConfig(0)"></el-input>
<i v-if="!item.newItem" class="el-icon-edit-outline edit" @click.prevent="editCondition(item)"></i>
</el-checkbox>
</el-checkbox-group>
<div class="add-btn">
<div class="add-btn" @click="addCondition('conditionList')">
<i class="el-icon-circle-plus-outline"></i>
新增条件
</div>
</div>
<div slot="logoSettingSlot" class="logo-setting">
<Upload v-for="(item,idx) in formObj.logo" :key="idx" :name="item.name"></Upload>
<span class="upload-tip">建议尺寸:88px*88px,图片格式为jpg,jpeg,png</span>
<div slot="responsibilitySlot" class="buy-condition">
<el-checkbox-group v-model="formObj.exclusionsResponsibility">
<el-checkbox v-for="(item,index) in responsibilityList" :label="item.id" :key="index">
<span class="sign">责任{{index+1}}</span>
<span v-if="!item.newItem" class="condition">{{item.contractContent}}</span>
<el-input v-else type="text" v-model="curEditCondition.value" @blur.stop="createConfig(1)"></el-input>
<i v-if="!item.newItem" class="el-icon-edit-outline edit" @click.prevent="editCondition(item)"></i>
</el-checkbox>
</el-checkbox-group>
<div class="add-btn" @click="addCondition('responsibilityList')">
<i class="el-icon-circle-plus-outline"></i>
新增责任
</div>
</div>
</glsx-combi-form>
</div>
......@@ -62,7 +70,7 @@
</div>
</template>
<div class="footer-btn">
<el-button @click="addClause(1)">取消</el-button>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="firstPage = true">上一步</el-button>
<el-button type="primary" @click="nextStep">下一步</el-button>
</div>
......@@ -83,60 +91,129 @@ export default {
data() {
return {
firstPage: true,
cities: ['上海', '北京', '广州', '深圳'],
formObj:{
serviceName: '',
nianxian: '',
logo:[
{
name: '未激活:',
url: ''
},
{
name: '已激活:',
url: ''
},
curEditCondition: {
id: '',
value: ''
},
conditionList: [],
responsibilityList: [],
salePeriodList: [
{label: '1年' ,key: '1'},
{label: '2年' ,key: '2'},
{label: '3年' ,key: '3'},
{label: '4年' ,key: '4'},
{label: '5年' ,key: '5'},],
logoList: [
{
name: '未激活:',
url: '',
key: 'unactivatedLogo'
},
{
name: '已激活:',
url: '',
key: 'activatedLogo'
},
{
name: '详情页Logo:',
url: '',
key: 'detailLogo'
}
],
myRule: {
serviceName: [{ required: true, message: '请输入服务项目名称', trigger: 'change' }],
serviceShortName: [{ required: true, message: '请输入服务项目简称', trigger: 'change' }],
guorenCode: [{ required: true, message: '请输入国任理赔编码', trigger: 'change' }],
salePeriod: [{ required: true, message: '请选择销售年限', trigger: 'change' }],
logoUrl: [
{
name: '详情页Logo:',
url: ''
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.unactivatedLogo) {
callback(new Error('请上传未激活Logo图'))
} else if (!this.formObj.activatedLogo) {
callback(new Error('请上传已激活Logo图'))
} else if (!this.formObj.detailLogo) {
callback(new Error('请上传详情页Logo图'))
} else{
callback()
}
},
trigger: 'change'
}
]
],
buyConditions: [{ required: true, message: '请选择购买条件', trigger: 'change' }],
prerequisite: [{ required: true, message: '请输入前提条件', trigger: 'change' }],
exclusionsResponsibility: [{ required: true, message: '请选择除外责任', trigger: 'change' }],
serviceData: [{ required: true, message: '请输入服务资料', trigger: 'change' }],
},
formObj:{
serviceName: '',
serviceShortName: '',
guorenCode: '',
logoUrl: '',
unactivatedLogo: '',
activatedLogo: '',
detailLogo: '',
serviceData: '',
prerequisite: '',
exclusionsResponsibility: [],
salePeriod: [],
buyConditions: []
},
formData:[
{
label: '服务项目名称:',
name: 'serviceName',
placeholder: '请输入服务项目名称',
type: 'input',
maxlength: 50
},
{
label: '服务项目简称:',
name: 'serviceShortName',
placeholder: '请输入服务项目简称',
type: 'input',
maxlength: 8
maxlength: 50
},
{
label: '国任理赔编码:',
name: 'guorenCode',
placeholder: '请输入国任理赔编码',
type: 'input',
maxlength: 50
},
{
label: '销售年限:',
name: 'nianxian',
name: 'salePeriod',
addHtml: 'timeLimitSlot'
},
{
label: 'Logo设置:',
name: 'logoUrl',
addHtml: 'logoSettingSlot'
},
],
servicesformData: [
{
label: '购买条件:',
name: 'buyCondition',
name: 'buyConditions',
addHtml: 'buyConditionSlot'
},
{
label: '前提条件:',
name: 'prerequisite',
type: 'input',
inputType: 'textarea'
},
{
label: '除外责任:',
name: 'nianxian',
addHtml: 'timeLimitSlot'
name: 'exclusionsResponsibility',
addHtml: 'responsibilitySlot'
},
{
label: '服务资料:',
name: 'serviceData',
type: 'input',
inputType: 'textarea'
},
......@@ -155,21 +232,89 @@ export default {
name: 'nianxian',
addHtml: 'specConfigSlot'
},
]
],
}
},
created() {
this.getConfigList()
},
mounted() {
},
methods: {
delCondition(){
console.log(123)
editCondition(row){
this.curEditCondition = {
id: row.id,
value: row.contractContent
}
const target = this.conditionList.find(item => item.id==row.id)
this.$set(target, 'newItem', true)
},
addCondition(key){
this[key].push({newItem: true})
},
getSpecificaList(){
const params = { serviceCode: 'SC0027'}
this.$apis.serviceConfig.getSpecificaListApi(params).then(res => {
console.log(res)
})
},
cancel(){
this.getSpecificaList()
},
nextStep(){
this.firstPage = false
this.$refs.baseInfoRef.$refs.formRef.validate(bValid => {
this.$refs.servicesRef.$refs.formRef.validate(sValid => {
if(bValid && sValid){
console.log(this.formObj)
const params = JSON.parse(JSON.stringify(this.formObj))
params.exclusionsResponsibility = params.exclusionsResponsibility.join(',')
params.buyConditions = params.buyConditions.join(',')
params.salePeriod = params.salePeriod.join(',')
this.$apis.serviceConfig.addServicesProject(params).then(res => {
if(res) {
this.firstPage = false
}
})
}
})
})
},
uploadSuccess(e){
console.log(e)
this.formObj[e.attr] = e.url
},
delImage(e){
this.formObj[e.attr] = ''
},
getConfigList() {
this.$apis.serviceConfig.getCommonConfig({}).then(res => {
this.conditionList = res.filter(item => item.contentType == 0)
this.responsibilityList = res.filter(item => item.contentType == 1)
})
},
createConfig(type){
const {id, value} = this.curEditCondition
if(!value) {
this.conditionList = this.conditionList.filter(item => item.contractContent)
this.$message.error(`${type==0 ? '购买条件' : '除外责任'}不能为空`)
return
}
const params = {
contentType: type,
contractContent: value
}
if(id) params.id = id
this.$apis.serviceConfig.createCommonConfig(params).then(res=>{
console.log(res)
if(res){
this.$message.success('操作成功')
this.getConfigList()
}
})
}
}
}
......@@ -200,7 +345,7 @@ export default {
width: 778px;
background: #F9F9F9;
padding: 20px 0;
.upload-wrap{
.upload-ctnr{
margin-bottom: 20px;
&:nth-child(3){
margin-bottom: 0;
......@@ -220,6 +365,12 @@ export default {
margin-top: 20px;
background-color: #fff;
.buy-condition{
.el-checkbox{
width: fit-content;
}
.sign{
margin-right: 8px;
}
.condition{
height: 32px;
line-height: 32px;
......@@ -228,12 +379,11 @@ export default {
padding: 0 12px;
font-size: 14px;
color: #333333;
margin-left: 8px;
}
.el-checkbox{
display: block;
}
.del{
.edit{
color: #C6C6C6;
margin-left: 8px;
}
......
<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!