Commit 2c2615e0 by zhangquan

联调

1 parent dc154ed5
......@@ -82,6 +82,16 @@ const getServicesItemsList = params => {
})
}
const exportServicesItemsApi = params => {
params.method = `scrm.api.equity.service.items.pages.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const createCommonConfig = params => {
params.method = `scrm.api.equity.service.items.common.config.insert.or.update`
return http({
......@@ -113,6 +123,16 @@ const addServicesProject = params => {
})
}
const getServiceDetailApi = params => {
params.method = `scrm.api.equity.service.items.detail`
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({
......@@ -122,6 +142,17 @@ const getSpecificaListApi = params => {
sign: true
})
}
const addGradeApi = params => {
params.method = `scrm.api.equity.service.items.grade.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
get4SList,
getEquityList,
......@@ -131,8 +162,11 @@ export default {
updateEquity,
getEquityDetail,
getServicesItemsList,
exportServicesItemsApi,
createCommonConfig,
getCommonConfig,
addServicesProject,
getSpecificaListApi
getServiceDetailApi,
getSpecificaListApi,
addGradeApi
}
\ No newline at end of file
<template>
<div class="bar-content">
<label for="" class="content-label">{{label}}</label>
<label v-if="label" for="" class="content-label">{{label}}</label>
<div class="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>
<quill-editor placeholder="请输入" ref="myQuillEditor" class="quill" v-model="value" :options="editorOption" @change="$emit('change', $event.html)"></quill-editor>
<div class="extend-bar" v-if="operateList && operateList.length">
<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>
......@@ -23,23 +21,34 @@ export default {
components:{
quillEditor,
},
model: {
prop: 'value',
event: 'change'
},
props: {
obj: {
type: Object
},
attr: {
type: String,
default: '',
},
label:{
type: String,
default: '',
value: {
type: Object
},
label:{
type: String,
default: '',
},
operateList: {
type: Array,
default: ()=>{
return []
},
editorOption: {
type: String,
default: ()=>{
return {
modules: {
},
disable: {
type: Boolean,
default: false
},
editorOption: {
type: String,
default: ()=>{
return {
placeholder: '请输入内容',
modules: {
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
......@@ -53,36 +62,30 @@ export default {
// ['link', 'image']
],
}
}
}
}
}
}
}
}
}
},
data() {
return {
}
},
mounted(){
if(this.disable) this.$refs.myQuillEditor.quill.enable(false);
},
methods: {
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>
<style lang="scss" scoped>
.bar-content{
background: #F9F9F9;
padding: 20px;
margin-bottom: 10px;
.content-label{
width: 154px;
display: inline-block;
......@@ -99,7 +102,6 @@ export default {
background-color: #fff;
.quill{
background-color: #fff;
display: inline-block;
border-color: #E5E5E5;
/deep/ .ql-toolbar.ql-snow, /deep/ .ql-container.ql-snow{
border-color: #E5E5E5;
......
const gradeObj = {
gradeConfigList: [
{
servicePeriod: '',
priceGrade: '0',
maxPrice: '',
minPrice: '',
priceCoefficient: '',
standardShelfCost: '',
standardSalesCost: ''
},
{
servicePeriod: '',
priceGrade: '1',
maxPrice: '',
minPrice: '',
priceCoefficient: '',
standardShelfCost: '',
standardSalesCost: ''
},
{
servicePeriod: '',
priceGrade: '2',
maxPrice: '',
minPrice: '',
priceCoefficient: '',
standardShelfCost: '',
standardSalesCost: ''
},
],
salePeriodData: [],
serviceGrade: 'A',
serviceOverview: '',
serviceDetail: ''
}
const deepClone = (obj)=> {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
}
export const addGradeItem = (grade='A' , salePeriodList=[])=>{
let _gradeObj = deepClone(gradeObj)
_gradeObj.serviceGrade = grade
_gradeObj.salePeriodData = salePeriodList.map(item=>{
return { servicePeriod: item, standardShelfCost: '', standardSalesCost: ''}
})
console.log(_gradeObj)
return _gradeObj
}
export const handleGradeData = (dataFromApi, salePeriodList=[])=>{
console.log(dataFromApi)
const data = deepClone(dataFromApi)
let arr = []
data.forEach(element => {
const { serviceOverview, serviceDetail, serviceGrade, gradeConfigList, id } = element
let _gradeObj = {
id,
serviceOverview,
serviceDetail,
serviceGrade,
gradeConfigList: []
}
const gradeList = ['0','1','2'] //三个区间等级,后端定义的
gradeList.forEach(item => {
const _target = gradeConfigList.find(o => o.priceGrade == item)
const { id, servicePeriod, maxPrice, minPrice, priceCoefficient } = _target || {}
_gradeObj.gradeConfigList.push({ servicePeriod, priceGrade: item, maxPrice, minPrice, priceCoefficient, id })
})
_gradeObj.salePeriodData = salePeriodList.map(item=>{
const _target = element.gradeConfigList.find( o => o.servicePeriod == item)
return { servicePeriod: item, standardShelfCost: _target?.standardShelfCost, standardSalesCost: _target?.standardSalesCost}
})
arr.push(_gradeObj)
});
return arr
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
</div>
</FoldFrame>
<FoldFrame name="合同介绍区域">
<Editor label="标题和介绍:" :obj="obj" attr="content"></Editor>
<Editor label="标题和介绍:" v-model="obj.content"></Editor>
</FoldFrame>
</div>
<div class="preview-area">
......
......@@ -5,59 +5,59 @@
<th rowspan="2">规格</th>
<th rowspan="2">价格区间(万元)</th>
<th rowspan="2">价格系数</th>
<th colspan="2" v-for="(item, index) in list" :key="index">{{item.name}}</th>
<th colspan="2" v-for="(item, index) in tableData.salePeriodData" :key="index">{{item.servicePeriod}}年版</th>
</tr>
<tr>
<template v-for="(item, index) in list">
<template v-for="(item, index) in tableData.salePeriodData">
<th :key="index">上架成本</th>
<th :key="index">销售成本</th>
</template>
</tr>
<tr>
<td rowspan="4">A</td>
<td rowspan="4">{{ tableData.serviceGrade }}</td>
<td>标准</td>
<td>-</td>
<template v-for="(item, index) in list">
<td :key="index"><el-input></el-input></td>
<td :key="index"> <el-input></el-input></td>
<template v-for="(item, index) in tableData.salePeriodData">
<td :key="index"><el-input :disabled="disable" v-model="item.standardShelfCost"></el-input></td>
<td :key="index"> <el-input :disabled="disable" v-model="item.standardSalesCost"></el-input></td>
</template>
</tr>
<tr v-for="(item, index) in [1,2,3]" :key="index">
<tr v-for="(item, index) in tableData.gradeConfigList" :key="index">
<td class="price">
<el-input></el-input>
<el-input :disabled="disable" v-model="item.minPrice"></el-input>
<span class="sign">-</span>
<el-input></el-input>
<el-input :disabled="disable" v-model="item.maxPrice"></el-input>
</td>
<td><el-input></el-input></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><el-input :disabled="disable" v-model="item.priceCoefficient"></el-input></td>
<template v-for="(ele, eIdx) in tableData.salePeriodData">
<td :key="eIdx">{{ Number((ele.standardShelfCost * item.priceCoefficient).toFixed(2))}}</td>
<td :key="eIdx">{{ Number((ele.standardSalesCost * item.priceCoefficient).toFixed(2))}}</td>
</template>
</tr>
<tr class="desc-wrap">
<td colspan="9">
<td :colspan="tableData.salePeriodData.length*2 + 3">
<div class="desc">
<label for="">服务条款概述:</label>
<el-input
:disabled="disable"
type="textarea"
:rows="3"
placeholder="请输入内容"
v-model="textarea">
v-model="tableData.serviceOverview">
</el-input>
</div>
</td>
</tr>
<tr class="desc-wrap">
<td colspan="9">
<td :colspan="tableData.salePeriodData.length*2+3">
<div class="desc">
<label for="">规格详细描述:</label>
<el-input
:disabled="disable"
type="textarea"
:rows="3"
placeholder="请输入内容"
v-model="textarea">
v-model="tableData.serviceDetail">
</el-input>
</div>
</td>
......@@ -65,7 +65,7 @@
</table>
</div>
</template>
<script>
export default {
name: 'ServicesTable',
......@@ -74,6 +74,16 @@
type: String,
default: ''
},
tableData: {
type: String,
default: ()=>{
return {}
}
},
disable: {
type: Boolean,
default: false
},
url: {
type: String,
default: ''
......@@ -85,23 +95,6 @@
},
data() {
return {
list:[
{
name: '1年版',
shelfPrice: '2',
salePrice: '3'
},
{
name: '2年版',
shelfPrice: '4',
salePrice: '5'
},
{
name: '3年版',
shelfPrice: '6',
salePrice: '7'
}
]
}
},
methods: {
......@@ -111,6 +104,10 @@
</script>
<style lang="scss" scoped>
.table-wrap{
/deep/ .el-input__inner{
padding: 0 2px;
text-align: center;
}
th, td{
border: 1px solid #E5E5E5;
padding: 0 16px;
......@@ -135,7 +132,7 @@
margin: 0 6px;
}
.el-input{
width: 42px;
width: 50px;
}
}
.desc-wrap{
......
......@@ -130,7 +130,10 @@
{
label: '可销售服务年限',
minWidth: 280,
prop: 'serviceContent'
prop: 'salePeriod',
formatter: cellValue => {
return cellValue.salePeriod?.length ? cellValue.salePeriod.split(',').join('、') : '--'
}
},
{
label: '规格数量',
......@@ -199,7 +202,7 @@
// 导出
handleExport() {
var params = this.getParams()
this.$apis.serviceConfig.exportEquityApi(params).then(res => {
this.$apis.serviceConfig.exportServicesItemsApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
......@@ -229,13 +232,12 @@
addClause(type, row) {
// 1新增 2查看 3编辑
const { id, merchantId } = row || {}
const { id } = row || {}
let query = {
type
}
if(type!=1){
query.id = id
query.merchantId = merchantId
}
const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push('/serviceConfig/addService/' + queryStr)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!