Commit 2000132b by zhangquan

合并合同模板

1 parent f3d2548c
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"glsx-common": "^2.1.0", "glsx-common": "^2.1.0",
"glsx-components": "^1.5.2", "glsx-components": "^1.5.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"number-precision": "^1.6.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2"
......
...@@ -25,8 +25,20 @@ const downLoads = params => { ...@@ -25,8 +25,20 @@ const downLoads = params => {
data: params data: params
}) })
} }
const getTypelistApi = params => {
params.method =`${defaultPath}service.package.select.get`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getWorryBatcnList, getWorryBatcnList,
addCards, addCards,
downLoads downLoads,
getTypelistApi
} }
import { http } from '@/main'
const CUR_BASE_URL = 'rop-scrm-equity/router'
const getContractListApi = params => {
params.method = `scrm.api.equity.service.contract.template.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const saveContractTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.template.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const getContractDetailApi = params => {
params.method = `scrm.api.equity.service.contract.template.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
const printContractApi = params => {
params.method = `scrm.api.equity.service.contract.template.printTest`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getContractListApi,
saveContractTemplateApi,
getContractDetailApi,
printContractApi
}
\ No newline at end of file \ No newline at end of file
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,87 @@ const getEquityDetail = params => { ...@@ -71,6 +72,87 @@ 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 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({
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 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({
url: CUR_BASE_URL,
method: 'POST',
data: 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 { export default {
get4SList, get4SList,
getEquityList, getEquityList,
...@@ -78,5 +160,13 @@ export default { ...@@ -78,5 +160,13 @@ export default {
getServiceList, getServiceList,
craeteEquity, craeteEquity,
updateEquity, updateEquity,
getEquityDetail getEquityDetail,
getServicesItemsList,
exportServicesItemsApi,
createCommonConfig,
getCommonConfig,
addServicesProject,
getServiceDetailApi,
getSpecificaListApi,
addGradeApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -541,4 +541,20 @@ ...@@ -541,4 +541,20 @@
margin-left: 8px; margin-left: 8px;
} }
} }
}
.global-title {
padding: 0 20px;
font-size: 20px;
font-weight: 600;
height: 60px;
line-height: 60px;
border-bottom: 1px solid #d8d8d8;
color: #333;
}
.required-field::before {
content: "*";
color: #f56c6c;
margin-right: 4px;
} }
\ No newline at end of file \ No newline at end of file
<template>
<div class="editor-ctnr">
<label v-if="label" for="" :class="['content-label', {'required-field': required}]">{{label}}</label>
<div :class="['editor',{'disabled-editor': disabled}]">
<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 v-for="item in operateList" :key="item.key" class="el-icon-circle-plus extend-icon" @click="insertContent(item.name, item.key, -1)">{{ item.name }}</i>
</div>
</div>
</div>
</template>
<script>
import { quillEditor, Quill } from 'vue-quill-editor'
import Label from '@/util/quillTool'
Quill.register(Label, true)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import { cpSync } from 'fs'
export default {
name: 'FoldFrame',
components:{
quillEditor,
},
model: {
prop: 'value',
event: 'change'
},
props: {
required: {
type: Boolean,
default: false
},
value: {
type: Object
},
label:{
type: String,
default: '',
},
operateList: {
type: Array,
default: ()=>{
return []
},
},
disabled: {
type: Boolean,
default: false
},
editorOption: {
type: String,
default: ()=>{
return {
placeholder: '请输入内容',
modules: {
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
// [{ list: 'ordered' }],
// [{ script: 'sub' }, { script: 'super' }],
[{ color: [] }, { background: [] }],
[{'indent': '-1'}, {'indent': '+1'}],
// [{ align: [] }],
[{ size: ['small', false, 'large', 'huge'] }],
// ['clean']
// ['link', 'image']
],
}
}
}
}
}
},
data() {
return {
}
},
mounted(){
if(this.disabled) this.$refs.myQuillEditor.quill.enable(false);
},
methods: {
insertContent(name, key, index){
let quill = this.$refs.myQuillEditor.quill;
let length = index >-1 ? index : quill.selection.savedRange.index
quill.insertEmbed(length, 'label', {name, key});
quill.setSelection(length + 1);
},
compare (attr,rev) {
if(rev == undefined){
rev = 1;
}else{
rev = (rev) ? 1 : -1;
}
return (a,b) => {
a = a[attr];
b = b[attr];
if(a < b){
return rev * -1;
}
if(a > b){
return rev * 1;
}
return 0;
}
},
replaceText(){
let quill = this.$refs.myQuillEditor.quill;
if(!quill.container.innerText || !this.operateList?.length) return
let num = 0
const offsetArr = []
this.operateList.forEach(item => {
let subStr = item.key
let offset = 0;
do{
offset = quill.getText().indexOf(subStr, offset);
if(offset != -1){
// this.insertContent(item.name, subStr, offset)
// num = offsetArr.filter((item)=>{
// return item < offset
// }).length
/*** 为什么加num? 我也不知道,大概是插入一个自定义节点的话,就要加1,
所以在offset为100要插入节点时,就要判断(位置100)前面插入了多少自定义节点 ***/
// quill.updateContents([ //相当于replace内容
// { retain: offset + num },
// { delete: subStr.length },
// { insert: { label: {name: item.name, key: subStr} } }
// ]);
offsetArr.push({...item, offset})
offset += subStr.length
}
}while(offset != -1)
})
let arr = offsetArr.sort(this.compare('offset', true))
arr.forEach((item,index)=>{
let realOffset = item.offset - num + index
if(realOffset==0) {
quill.deleteText(0,item.key?.length || 0)
this.insertContent(item.name, item.key, 0)
}else{
quill.updateContents([
{ retain: realOffset },
{ delete: item.key.length },
{ insert: { label: {name: item.name, key: item.key} } }
]);
}
num += item.key.length
})
},
}
}
</script>
<style lang="scss" scoped>
.editor-ctnr{
width: 100%;
height: 100%;
display: flex;
.content-label{
flex-shrink: 0;
width: 154px;
display: inline-block;
vertical-align: top;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
}
.editor{
display: inline-block;
background-color: #fff;
width: 100%;
height: 100%;
.quill{
width: 100%;
height: 100%;
background-color: #fff;
border-color: #E5E5E5;
/deep/ .ql-formats{
margin-right: 0;
display: inline-flex;
align-items: center;
&:nth-child(2){
margin-bottom: 6px;
}
&:nth-child(4){
.ql-picker-label{
display: flex;
align-items: center;
width: 80px;
}
}
}
/deep/ .ql-toolbar.ql-snow, /deep/ .ql-container.ql-snow{
border-color: #E5E5E5;
}
/deep/ .ql-label{
color: #26a2ff;
}
}
.extend-bar{
width: 100%;
height: 40px;
padding: 0 20px;
line-height: 40px;
margin-top: -1px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
border-top: none;
.extend-icon{
cursor: pointer;
margin-right: 10px;
&::before{
// font-size: 16px;
margin-right: 4px;
}
font-size: 14px;
color: #3f3b3b;
}
}
}
/deep/ .disabled-editor{
.ql-snow, .ql-editor, .ql-editor p, .ql-formats button{
background-color: #F5F7FA;
cursor: not-allowed;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="upload-ctnr">
<label v-if="name" :class="['label',{'required-field': required}]" for="">{{name}}</label>
<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" @click="handleLook"></i>
<i v-if="!disabled" class="el-icon-delete del-icon" @click="del"></i>
</div>
</div>
</div>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="url" dialogType="img"></big-view>
</el-dialog>
</div>
</template>
<script>
import bigView from '@/components/big-view'
export default {
name: 'Upload',
components: {
bigView
},
props: {
required: {
type: Boolean,
default: false
},
name: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
},
url: {
type: String,
default: ''
},
attr: {
type: String,
default: ''
},
defaultStyle: {
type: Object,
default: ()=>{
return {}
}
}
},
data() {
return {
dialogVisibleImg: false
}
},
methods: {
handleLook(){
this.dialogVisibleImg = true
},
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;
width: 154px;
height: 20px;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
box-sizing: border-box;
}
.upload-wrap{
display: inline-flex;
border: 1px dashed #00000026;
box-sizing: border-box;
width: 104px;
height: 104px;
background: #0000000a;
border-radius: 4px;
position: relative;
&:hover{
.operate{
display: block;
}
}
.image{
width: 100%;
height: 100%;
z-index: 2;
position: relative;
}
.add-img{
width: 100%;
height: 100%;
cursor: pointer;
display: inline-flex;
flex-direction: column;
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;
}
p {
height: 32px;
line-height: 32px;
}
}
.operate{
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 4px;
z-index: 5;
.btn-wrap{
color: #fff;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
.del-icon{
margin-left: 12px;
}
i{
font-size: 16px;
cursor: pointer;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-28 10:12:36
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-28 10:25:09
* @FilePath: \live\src\components\big-view\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
import NP from 'number-precision'
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
salePeriodList = salePeriodList.sort(function(a,b){return a-b});
_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)
let { id, servicePeriod, maxPrice, minPrice, priceCoefficient } = _target || {}
maxPrice = NP.divide(maxPrice || 0, 100)
minPrice = NP.divide(minPrice || 0, 100)
_gradeObj.gradeConfigList.push({ servicePeriod, priceGrade: item, maxPrice, minPrice, priceCoefficient, id })
})
salePeriodList = salePeriodList.sort(function(a,b){return a-b})
_gradeObj.salePeriodData = salePeriodList.map(item=>{
const _target = element.gradeConfigList.find( o => o.servicePeriod == item)
return { servicePeriod: item, standardShelfCost: NP.divide(_target?.standardShelfCost || 0, 100), standardSalesCost: NP.divide(_target?.standardSalesCost || 0, 100)}
})
arr.push(_gradeObj)
});
return arr
}
\ No newline at end of file \ No newline at end of file
import { Quill } from 'vue-quill-editor'
const Parchment = Quill.imports.parchment;
const Delta = Quill.imports.delta;
class Label extends Parchment.Embed {
static create(value) {
const node = super.create(value.name);
node.setAttribute('keyName', value.key)
node.innerText = value.name;
node.contentEditable = 'false';
// this._addRemovalButton(node, value.key); //创建额外的标签,比如删除键
return node;
}
static value(node) {
return node.childNodes[0].textContent;
}
static _addRemovalButton(node, key) {
// const button = document.createElement('button');
// button.innerText = 'x';
// button.onclick = () => node.remove();
// button.contentEditable = 'false';
// node.appendChild(button);
// Extra span forces the cursor to the end of the label, otherwise it appears inside the removal button
const span = document.createElement('span');
span.setAttribute('keyName', key)
span.innerText = '';
node.appendChild(span);
}
}
Label.blotName = 'label';
Label.tagName = 'SPAN';
Label.className = 'ql-label';
export default Label
// Quill.register(Label);
\ No newline at end of file \ No newline at end of file
<template>
<div class="container">
<div class="global-title">编辑</div>
<div class="main">
<div class="edit-bar">
<FoldFrame :name="item.title" v-for="item in contentList" :key="item.key">
<div v-if="item.type=='img'" class="bar-content">
<div v-if="item.key=='electronicSealUrl'" class="input-content">
<label class="required-field" for="">服务主体:</label>
<el-input size="small" type="text" v-model="contentObj.serviceSubject" ></el-input>
</div>
<Upload :required="true" @uploadSuccess="uploadSuccess" @delImage="delImage" class="upload" :name="item.label+':'" :attr="item.key" :url="contentObj[item.key]" :defaultStyle="{width:'208px'}"></Upload>
<span class="upload-tip">建议高度:48px</span>
</div>
<div v-if="item.type=='richText'" class="bar-content">
<div v-if="item.key=='contractIntroduce'" class="input-content">
<label class="required-field" for="">合同标题:</label>
<el-input size="small" type="text" v-model="contentObj.contractTitle"></el-input>
</div>
<Editor :required="true" :ref="item.key+'Ref'" :operateList="item.key=='useConditions' ? placeholderList : []" :label="item.label" v-model="contentObj[item.key]"></Editor>
</div>
</FoldFrame>
</div>
<div class="footer-btn">
<el-button @click="handelCancel">取消</el-button>
<el-button type="primary" @click="commitTemplate">提交</el-button>
</div>
</div>
</div>
</template>
<script>
const errorTipObj = {
contractTitle: '合同标题',
contractIntroduce: '合同介绍',
relevantDefinition: '相关定义',
useConditions: '使用条件',
serviceScope: '服务范围',
exclusionLiability: '除外责任',
serviceData: '服务所需资料',
specialStatement: '特别声明',
serviceSubject: '服务主体'
}
import FoldFrame from './components/FoldFrame'
import Upload from '@/components/Upload'
import Editor from '@/components/Editor'
const replaceArr = ['contractIntroduce', 'relevantDefinition', 'useConditions','serviceScope', 'exclusionLiability','serviceData', 'specialStatement']
export default {
name: 'AddTmpl',
components:{
Editor,
Upload,
FoldFrame
},
data() {
return {
placeholderList: [],
contentObj: {
id: '',
logoUrl: '',
contractTitle: '',
contractIntroduce: '',
relevantDefinition: '',
useConditions: '',
serviceScope: '',
exclusionLiability: '',
serviceData: '',
specialStatement: '',
serviceSubject: '',
electronicSealUrl: ''
},
contentList: [
{
title: 'Logo区域',
label: 'Logo图',
key: 'logoUrl',
type: 'img'
},
// {
// label: '合同标题区域',
// label: '合同标题',
// key: 'contractTitle',
// type: 'input'
// },
{
title: '合同介绍区域',
label: '合同介绍:',
key: 'contractIntroduce',
type: 'richText'
},
{
title: '相关定义区域',
label: '相关定义:',
key: 'relevantDefinition',
type: 'richText'
},
{
title: '使用条件区域',
label: '使用条件:',
key: 'useConditions',
type: 'richText'
},
{
title: '服务范围区域',
label: '服务范围:',
key: 'serviceScope',
type: 'richText'
},
{
title: '除外责任区域',
label: '除外责任:',
key: 'exclusionLiability',
type: 'richText'
},
{
title: '服务所需资料区域',
label: '服务所需资料:',
key: 'serviceData',
type: 'richText'
},
{
title: '特别声明区域',
label: '特别声明:',
key: 'specialStatement',
type: 'richText'
},
{
title: '电子章图片区域',
label: '电子章图片',
key: 'electronicSealUrl',
type: 'img'
},
]
}
},
created(){
},
mounted() {
this.getContractDetail()
},
methods: {
getContractDetail() {
this.$apis.contractManager.getContractDetailApi({id: this.$route.params.id}).then(res => {
if(res && res.templateConfig){
this.placeholderList = res.placeholderList
for(const key in this.contentObj){
if(replaceArr.includes(key)){
res.templateConfig[key] = res.templateConfig[key]?.replace('<p></p>', '<p><br></p>')
}
this.contentObj[key] = res.templateConfig[key]
}
this.$nextTick(()=>{
this.$refs.useConditionsRef[0].replaceText()
})
}
})
},
handelCancel(){
this.$router.push('/ContractManager/index')
},
getParams(){
const params = this.$common.utils.deepClone(this.contentObj)
let errorTip = '';
params.useConditions = params.useConditions?.replace(/<span.*?class.*?keyname="(.*?)".*?<\/span>/g,'$1')
for(const key in params){
if(replaceArr.includes(key)){
params[key] = params[key]?.replace('<br>', '')
}
if(key!='id' && !params[key]){
if(key == 'electronicSealUrl' || key == 'logoUrl'){
errorTip = `请上传${key == 'logoUrl' ? 'Logo图': '电子章图片'}`
}else{
errorTip = `${errorTipObj[key]}不能为空`
}
}
}
if(errorTip) return {status: -1, errorTip}
return params
},
commitTemplate(){
const params = this.getParams()
if(params.status == -1) return this.$message.error(params.errorTip)
this.$apis.contractManager.saveContractTemplateApi({...params}).then(res => {
if(res){
this.$message.success('编辑成功')
this.$router.push('/ContractManager/index')
}
})
},
uploadSuccess(e){
this.contentObj[e.attr] = e.url
},
delImage(e){
this.contentObj[e.attr] = ''
},
}
}
</script>
<style lang="scss" scoped>
.container{
background-color: #fff;
.footer-btn{
text-align: center;
margin-top: 16px;
}
.input-content{
display: flex;
align-items: center;
margin-bottom: 24px;
label{
flex-shrink: 0;
width: 154px;
white-space: nowrap;
text-align: right;
font-weight: 400;
font-size: 14px;
color: #333333;
}
/deep/ .el-input__inner{
width: 342px;
}
}
.main{
padding: 10px 20px 32px;
.edit-bar{
.bar-content{
background: #F9F9F9;
padding: 20px;
margin-bottom: 10px;
.upload{
display: inline-block;
}
.upload-tip{
height: 20px;
font-weight: 400;
font-size: 14px;
color: #999999;
vertical-align: bottom;
margin-left: 10px;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="bar-title" @click="changeStatus()">
<i class="el-icon-caret-right btn" v-if="!isExpansion"></i>
<i class="el-icon-caret-bottom btn" v-else></i>
<span class="title">{{name}}</span>
</div>
<slot v-if="isExpansion"></slot>
</div>
</template>
<script>
export default {
name: 'FoldFrame',
props: {
name: {
type: String,
default: ''
}
},
data() {
return {
isExpansion: true
}
},
methods: {
changeStatus(){
this.isExpansion = !this.isExpansion
}
}
}
</script>
<style lang="scss" scoped>
.bar-title{
font-weight: 600;
font-size: 14px;
color: #000000d9;
height: 40px;
line-height: 40px;
padding: 0 20px;
cursor: pointer;
.btn{
margin-right: 9px;
font-size: 16px;
}
}
</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" @click="handleExport">导出</el-button>
</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>
</GLTable>
</div>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import utils from '../../util/util'
import pdfDialog from '@/views/beforeSale/pdfDialog'
export default {
name: 'equityList',
components:{
pdfDialog
},
data() {
return {
size: 'small',
isPdfVisible: false,
buttonList: [
{
type: 'el-button',
name: row => {
return '打印'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.handlePdf(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '编辑'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.editContract(row.scope)
}
}
],
searchForm: {
merchantName: '',
createdDate: '',
updatedDate: ''
},
tableSearchForm: {},
searchFormData: [
{
label: '商户名称',
name: 'merchantName',
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.contractManager.getContractListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '合同编号',
prop: 'id',
width: 200
},
{
label: '商户名称',
prop: 'merchantName'
},
{
label: '创建时间',
prop: 'createdDate',
width: 200,
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '更新时间',
prop: 'updatedDate',
width: 200,
formatter: cellValue => {
return cellValue.updatedDate ? dayjs(cellValue.updatedDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
},
{
label: '操作人',
prop: 'updatedBy',
width: 140
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
}
},
mounted() {
},
methods: {
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm?.createdDate?.length) {
params.beginCreateDate = new Date(this.searchForm.createdDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreateDate = new Date(this.searchForm.createdDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm?.updatedDate?.length) {
params.beginUpdateDate = new Date(this.searchForm.updatedDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endUpdateDate = new Date(this.searchForm.updatedDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createdDate
delete params.updatedDate
return {...params}
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handlePdfClose() {
this.isPdfVisible = !this.isPdfVisible
},
// 打印
handlePdf(row) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.contractManager.printContractApi({ packageCode : row.packageCode , merchantId: row.merchantId }).then(res => {
this.pdfUrl = res
this.handlePdfClose()
loading.close()
})
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.serviceConfig.exportEquityApi(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 = {
serviceName: '',
createdDate: '',
updatedDate: ''
}
this.handleSearch()
},
editContract(row) {
const { id, merchantId } = row || {}
let query = {
id
}
const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push('/ContractManager/addTmpl/' + id)
}
}
}
</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
...@@ -115,29 +115,9 @@ export default { ...@@ -115,29 +115,9 @@ export default {
label: '适用类型', label: '适用类型',
name: 'packageCode', name: 'packageCode',
type: 'select', type: 'select',
optionList: [ optionList: [],
{ optionId: 'packageCode',
value: 'PC0005', optionLabel: 'packageName'
label: '盗抢全损无忧'
},
{
value: 'PC0006',
label: '轮胎无忧'
},
{
value: 'PC0007',
label: '整车全损无忧'
},
{
value: 'PC0008',
label: '碰撞无忧'
}
],
optionId: 'value',
optionLabel: 'label',
changeAttr:(e)=>{
this.changePgCode(e)
}
}, },
{ {
type: 'input', type: 'input',
...@@ -169,6 +149,14 @@ export default { ...@@ -169,6 +149,14 @@ export default {
{ {
value: '3', value: '3',
label: '3年' label: '3年'
},
{
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
} }
], ],
optionId: 'value', optionId: 'value',
...@@ -226,33 +214,43 @@ export default { ...@@ -226,33 +214,43 @@ export default {
} }
} }
}, },
created() {
this.getTypelist()
},
mounted() {}, mounted() {},
methods: { methods: {
changePgCode(e){ getTypelist(){
const arr = [{ this.$apis.addWorryFree.getTypelistApi({}).then(res => {
value: '1', if(!res?.length) return;
label: '1年' let target = this.addDialogFormData.find(item => item.name == 'packageCode')
}, target.optionList = res
{ })
value: '2',
label: '2年'
},
{
value: '3',
label: '3年'
}]
const moreArr = [{
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
}]
const target = this.addDialogFormData.find(item => item.name=='servicePeriod')
target.optionList = (e=='PC0005' || e=='PC0007') ? [ ...arr, ...moreArr] : [...arr]
this.addDialogForm.servicePeriod = ''
}, },
// changePgCode(e){
// const arr = [{
// value: '1',
// label: '1年'
// },
// {
// value: '2',
// label: '2年'
// },
// {
// value: '3',
// label: '3年'
// }]
// const moreArr = [{
// value: '4',
// label: '4年'
// },
// {
// value: '5',
// label: '5年'
// }]
// const target = this.addDialogFormData.find(item => item.name=='servicePeriod')
// target.optionList = (e=='PC0005' || e=='PC0007') ? [ ...arr, ...moreArr] : [...arr]
// this.addDialogForm.servicePeriod = ''
// },
//批量下载 //批量下载
download(e) { download(e) {
this.$apis.addWorryFree.downLoads({ id: e.id }).then(res => { this.$apis.addWorryFree.downLoads({ id: e.id }).then(res => {
......
...@@ -92,6 +92,9 @@ ...@@ -92,6 +92,9 @@
</el-form-item> </el-form-item>
<el-form-item v-for="item in newPackageList" :key="item.packageCode"> <el-form-item v-for="item in newPackageList" :key="item.packageCode">
<el-checkbox v-model="item.isChecked">{{item.packageName}}</el-checkbox> <el-checkbox v-model="item.isChecked">{{item.packageName}}</el-checkbox>
<div>
<el-checkbox v-model="item.cardName" true-label="card" false-label="">卡输入</el-checkbox>
</div>
</el-form-item> </el-form-item>
</template> </template>
</el-form> </el-form>
...@@ -437,8 +440,8 @@ export default { ...@@ -437,8 +440,8 @@ export default {
} }
this.newPackageList.forEach(item=>{ this.newPackageList.forEach(item=>{
if(item.isChecked){ if(item.isChecked){
let {packageCode, packageServicePeriod} = item let {packageCode, packageServicePeriod, cardName} = item
params.push({packageCode, servicePeriod: packageServicePeriod }) params.push({packageCode, servicePeriod: packageServicePeriod, cardName})
} }
}) })
let targetParams = { let targetParams = {
......
<template>
<div class="table-wrap">
<table>
<tr>
<th rowspan="2">规格</th>
<th rowspan="2">价格区间(万元)</th>
<th rowspan="2">价格系数</th>
<th colspan="2" v-for="(item, index) in tableData.salePeriodData" :key="index">{{item.servicePeriod}}年版</th>
</tr>
<tr>
<template v-for="(item, index) in tableData.salePeriodData">
<th :key="index">上架成本</th>
<th :key="index">销售成本</th>
</template>
</tr>
<tr>
<td rowspan="4">{{ tableData.serviceGrade }}</td>
<td>标准</td>
<td>-</td>
<template v-for="(item, index) in tableData.salePeriodData">
<td :key="index"><el-input onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disabled" v-model="item.standardShelfCost"></el-input></td>
<td :key="index"> <el-input onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disabled" v-model="item.standardSalesCost"></el-input></td>
</template>
</tr>
<tr v-for="(item, index) in tableData.gradeConfigList" :key="index">
<td class="price">
<el-input onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disabled" v-model="item.minPrice"></el-input>
<span class="sign">-</span>
<el-input onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disabled" v-model="item.maxPrice"></el-input>
</td>
<td><el-input onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disabled" 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 class="desc-td" :colspan="tableData.salePeriodData.length*2 + 3">
<div class="desc">
<label for="">服务条款概述:</label>
<Editor :disabled="disabled" :editorOption="overviewOption" v-model="tableData.serviceOverview"></Editor>
</div>
</td>
</tr>
<tr class="desc-wrap">
<td class="desc-td" :colspan="tableData.salePeriodData.length*2+3">
<div class="desc">
<label for="">规格详细描述:</label>
<Editor :disabled="disabled" :editorOption="DetailOption" v-model="tableData.serviceDetail"></Editor>
</div>
</td>
</tr>
</table>
</div>
</template>
<script>
import Editor from '@/components/Editor'
export default {
name: 'ServicesTable',
components:{
Editor,
},
props: {
name: {
type: String,
default: ''
},
tableData: {
type: String,
default: ()=>{
return {}
}
},
disabled: {
type: Boolean,
default: false
},
url: {
type: String,
default: ''
},
key: {
type: String,
default: ''
}
},
data() {
return {
overviewOption: {
placeholder: '请输入服务条款概述',
modules: {
toolbar: false,
clipboard: {
// 粘贴版,处理粘贴时候的自带样式
matchers: [[Node.ELEMENT_NODE, this.HandleCustomMatcher]],
},
}
},
DetailOption: {
placeholder: '请输入规格详细描述',
modules: {
toolbar: false,
clipboard: {
// 粘贴版,处理粘贴时候的自带样式
matchers: [[Node.ELEMENT_NODE, this.HandleCustomMatcher]],
},
}
}
}
},
methods: {
HandleCustomMatcher(node, Delta) {
// 文字、图片等,从别处复制而来,清除自带样式,转为纯文本
let ops = []
Delta.ops.forEach(op => {
if (op.insert && typeof op.insert === 'string') {
ops.push({
insert: op.insert,
})
}
})
Delta.ops = ops
return Delta
},
}
}
</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;
vertical-align: middle;
text-align: center;
}
th{
background: #F4F6FC;
font-weight: 600;
font-size: 14px;
color: #333333;
}
td{
font-weight: 400;
height: 56px;
font-size: 14px;
color: #666666;
}
.price{
width: 136px;
.sign{
margin: 0 6px;
}
.el-input{
width: 50px;
}
}
.desc-wrap{
height: 88px;
.desc-td{
padding: 12px 16px;
}
.desc{
display: flex;
height: 100%;
label{
white-space: nowrap;
}
/deep/ .editor-ctnr{
height: 100%;
.ql-container{
border-radius: 4px;
.ql-editor{
padding: 8px;
}
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<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 class="table-wrapper">
</div>
<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,12 +10,13 @@ ...@@ -12,12 +10,13 @@
</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>
</div> <span>{{ scope.scope.serviceStatus == 0 ? '待配置': '已配置' }}</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> </div>
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <span slot="auth-button" slot-scope="scope" :data="scope.scope">
</span> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</span>
</GLTable> </GLTable>
</div> </div>
</div> </div>
...@@ -60,30 +59,39 @@ ...@@ -60,30 +59,39 @@
} }
], ],
searchForm: { searchForm: {
merchantName: '',
serviceName: '', serviceName: '',
serviceContent: '', serviceStatus: '',
createdDate: '', createdDate: '',
updatedDate: '' updatedDate: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
searchFormData: [ searchFormData: [
{ {
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true,
},
{
label: '服务名称', label: '服务名称',
name: 'serveiceName', name: 'serviceName',
type: 'input', type: 'input',
isClear: true, isClear: true,
}, },
{ {
label: '条款描述', label: '状态',
name: 'serviceClause', name: 'serviceStatus',
type: 'input', type: 'select',
optionList: [
{
id: '',
label: '全部'
},
{
id: '0',
label: '待配置'
},
{
id: '1',
label: '已配置'
}
],
optionId: 'id',
optionLabel: 'label',
isClear: true, isClear: true,
}, },
{ {
...@@ -104,46 +112,59 @@ ...@@ -104,46 +112,59 @@
} }
], ],
// 表格 // 表格
getListApi: this.$apis.serviceConfig.getEquityList, getListApi: this.$apis.serviceConfig.getServicesItemsList,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '服务编号',
prop: 'serviceCode',
width: 200
},
{
label: '服务名称', label: '服务名称',
prop: 'serviceName', prop: 'serviceName',
width: 200 width: 200
}, },
{ {
label: '条款描述', label: '可销售服务年限',
minWidth: 280, minWidth: 280,
prop: 'serviceContent', prop: 'salePeriod',
addHtml: 'serviceContent' formatter: cellValue => {
return cellValue.salePeriod?.length ? cellValue.salePeriod.split(',').map(item => item = item+'年').join('、') : '--'
}
}, },
{ {
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: '状态',
minWidth: 150,
prop: 'status',
addHtml: 'statusSlot'
},
{
label: '操作人', label: '操作人',
prop: 'updateBy', prop: 'updatedBy',
width: 140 width: 140
} }
] ]
...@@ -159,12 +180,12 @@ ...@@ -159,12 +180,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
...@@ -181,7 +202,7 @@ ...@@ -181,7 +202,7 @@
// 导出 // 导出
handleExport() { handleExport() {
var params = this.getParams() var params = this.getParams()
this.$apis.serviceConfig.exportEquityApi(params).then(res => { this.$apis.serviceConfig.exportServicesItemsApi(params).then(res => {
// window.open(res) // window.open(res)
let tempaa = utils.getExplorer() let tempaa = utils.getExplorer()
if (tempaa == 'QQ') { if (tempaa == 'QQ') {
...@@ -201,9 +222,8 @@ ...@@ -201,9 +222,8 @@
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
merchantName: '',
serviceName: '', serviceName: '',
serviceContent: '', serviceStatus: '',
createdDate: '', createdDate: '',
updatedDate: '' updatedDate: ''
} }
...@@ -212,37 +232,35 @@ ...@@ -212,37 +232,35 @@
addClause(type, row) { addClause(type, row) {
// 1新增 2查看 3编辑 // 1新增 2查看 3编辑
const { id, merchantId } = row || {} const { id, serviceCode, serviceName } = row || {}
let query = { let query = {
type type
} }
if(type!=1){ if(type!=1){
query.id = id query.id = id
query.merchantId = merchantId query.serviceCode = serviceCode
query.serviceName = serviceName
} }
const queryStr = encodeURIComponent(JSON.stringify(query)) const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push('/serviceConfig/addClause/' + queryStr) this.$router.push('/serviceConfig/addService/' + queryStr)
} }
} }
} }
</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%;
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> </style>
\ No newline at end of file \ No newline at end of file
...@@ -52,6 +52,7 @@ export default { ...@@ -52,6 +52,7 @@ export default {
}, },
data() { data() {
return { return {
applyTypelist: [],
date_format, date_format,
buttonList: [ buttonList: [
{ {
...@@ -83,7 +84,8 @@ export default { ...@@ -83,7 +84,8 @@ export default {
packageCode: '', packageCode: '',
servicePeriod: '', servicePeriod: '',
actualPrice: '', actualPrice: '',
status: '' status: '',
cardNumber: ''
}, },
detailFormData: [ detailFormData: [
{ {
...@@ -93,6 +95,12 @@ export default { ...@@ -93,6 +95,12 @@ export default {
isClear: true isClear: true
}, },
{ {
type: 'input',
label: '卡编号',
name: 'cardNumber',
isClear: true
},
{
label: '版本', label: '版本',
name: 'batchType', name: 'batchType',
type: 'select', type: 'select',
...@@ -118,30 +126,9 @@ export default { ...@@ -118,30 +126,9 @@ export default {
name: 'packageCode', name: 'packageCode',
type: 'select', type: 'select',
isClear: true, isClear: true,
optionList: [ optionList: [],
{ optionId: 'packageCode',
confId: '', optionLabel: 'packageName'
confName: '全部'
},
{
confId: 'PC0005',
confName: '盗抢全损无忧'
},
{
confId: 'PC0006',
confName: '轮胎无忧'
},
{
confId: 'PC0007',
confName: '整车全损无忧'
},
{
confId: 'PC0008',
confName: '碰撞无忧'
}
],
optionId: 'confId',
optionLabel: 'confName'
}, },
{ {
label: '状态', label: '状态',
...@@ -234,29 +221,9 @@ export default { ...@@ -234,29 +221,9 @@ export default {
label: '适用类型', label: '适用类型',
name: 'packageCode', name: 'packageCode',
type: 'select', type: 'select',
optionList: [ optionList: [],
{ optionId: 'packageCode',
value: 'PC0005', optionLabel: 'packageName'
label: '盗抢全损无忧'
},
{
value: 'PC0006',
label: '轮胎无忧'
},
{
value: 'PC0007',
label: '整车全损无忧'
},
{
value: 'PC0008',
label: '碰撞无忧'
}
],
optionId: 'value',
optionLabel: 'label',
changeAttr:(e)=>{
this.changePgCode(e)
}
}, },
{ {
type: 'input', type: 'input',
...@@ -281,6 +248,14 @@ export default { ...@@ -281,6 +248,14 @@ export default {
{ {
value: '3', value: '3',
label: '3年' label: '3年'
},
{
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
} }
], ],
optionId: 'value', optionId: 'value',
...@@ -419,6 +394,11 @@ export default { ...@@ -419,6 +394,11 @@ export default {
}, },
tableColumns: [ tableColumns: [
{ {
label: '卡编号',
prop: 'cardNumber',
width: 100
},
{
label: '序列号', label: '序列号',
prop: 'seqNo', prop: 'seqNo',
width: 100 width: 100
...@@ -448,14 +428,10 @@ export default { ...@@ -448,14 +428,10 @@ export default {
label: '适用类型', label: '适用类型',
prop: 'packageCode', prop: 'packageCode',
formatter: cellValue => { formatter: cellValue => {
return { let targer = this.applyTypelist.find(item => item.packageCode == cellValue.packageCode)
PC0005: '盗抢全损无忧', return targer && targer.packageName ? targer.packageName : '--'
PC0006: '轮胎无忧',
PC0007: '整车全损无忧',
PC0008: '碰撞无忧'
}[cellValue.packageCode]
}, },
width: 220 width: 220
}, },
{ {
label: '使用时间', label: '使用时间',
...@@ -491,33 +467,44 @@ export default { ...@@ -491,33 +467,44 @@ export default {
}, },
mounted() { mounted() {
this.getTotal() this.getTotal()
this.getTypelist()
}, },
methods: { methods: {
changePgCode(e){ getTypelist(){
const arr = [{ this.$apis.addWorryFree.getTypelistApi({}).then(res => {
value: '1', if(!res?.length) return;
label: '1年' let target = this.addDialogFormData.find(item => item.name == 'packageCode')
}, target.optionList = res
{ let serachTarget = this.detailFormData.find(item => item.name == 'packageCode')
value: '2', serachTarget.optionList = [{packageCode: '',packageName: '全部'}, ...res]
label: '2年' this.applyTypelist = res
}, })
{
value: '3',
label: '3年'
}]
const moreArr = [{
value: '4',
label: '4年'
},
{
value: '5',
label: '5年'
}]
const target = this.addDialogFormData.find(item => item.name=='servicePeriod')
target.optionList = (e=='PC0005' || e=='PC0007') ? [ ...arr, ...moreArr] : [...arr]
this.detailDialogForm.servicePeriod = ''
}, },
// changePgCode(e){
// const arr = [{
// value: '1',
// label: '1年'
// },
// {
// value: '2',
// label: '2年'
// },
// {
// value: '3',
// label: '3年'
// }]
// const moreArr = [{
// value: '4',
// label: '4年'
// },
// {
// value: '5',
// label: '5年'
// }]
// const target = this.addDialogFormData.find(item => item.name=='servicePeriod')
// target.optionList = (e=='PC0005' || e=='PC0007') ? [ ...arr, ...moreArr] : [...arr]
// this.detailDialogForm.servicePeriod = ''
// },
check() { check() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var reg = /^[+]{0,1}(\d+)$/g var reg = /^[+]{0,1}(\d+)$/g
...@@ -561,7 +548,7 @@ export default { ...@@ -561,7 +548,7 @@ export default {
} }
}, },
modify(e) { modify(e) {
this.changePgCode(e.packageCode) // this.changePgCode(e.packageCode)
let obj = JSON.parse(JSON.stringify(e)) let obj = JSON.parse(JSON.stringify(e))
this.detailDialog = true this.detailDialog = true
obj.servicePeriod = obj.servicePeriod +'' obj.servicePeriod = obj.servicePeriod +''
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!