Commit 2b9892d8 by zhangquan

合同模板联调

1 parent 47e82381
import { http } from '@/main' import { http } from '@/main'
const CUR_BASE_URL = 'rop-scrm-equity/router' const CUR_BASE_URL = 'rop-scrm-equity/router'
const getBaseContractListApi = params => {
params.method = `scrm.api.equity.service.contract.base.template.list.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
//获取产品合同更换模板列表
const getContractListApi = params => { const getContractListApi = params => {
params.method = `scrm.api.equity.service.contract.template.list` params.method = `scrm.api.equity.service.contract.template.list`
return http({ return http({
...@@ -51,6 +61,17 @@ const copyTemplateApi = params => { ...@@ -51,6 +61,17 @@ const copyTemplateApi = params => {
}) })
} }
//更换产品合同模板
const copyBaseTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.base.template.replace`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
//批量变更合同模板 //批量变更合同模板
const babchCopyTemplateApi = params => { const babchCopyTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.template.batch.copyTemplate` params.method = `scrm.api.equity.service.contract.template.batch.copyTemplate`
...@@ -106,10 +127,12 @@ const exportProdContractApi = params => { ...@@ -106,10 +127,12 @@ const exportProdContractApi = params => {
export default { export default {
getContractListApi, getContractListApi,
getBaseContractListApi,
saveContractTemplateApi, saveContractTemplateApi,
getContractDetailApi, getContractDetailApi,
printContractApi, printContractApi,
copyTemplateApi, copyTemplateApi,
copyBaseTemplateApi,
babchCopyTemplateApi, babchCopyTemplateApi,
babchInitTemplateApi, babchInitTemplateApi,
exportContractApi, exportContractApi,
......
...@@ -37,6 +37,7 @@ const errorTipObj = { ...@@ -37,6 +37,7 @@ const errorTipObj = {
contractIntroduce: '合同介绍', contractIntroduce: '合同介绍',
relevantDefinition: '相关定义', relevantDefinition: '相关定义',
useConditions: '使用条件', useConditions: '使用条件',
baseContext: '使用条件',
serviceScope: '服务范围', serviceScope: '服务范围',
exclusionLiability: '除外责任', exclusionLiability: '除外责任',
serviceData: '服务所需资料', serviceData: '服务所需资料',
...@@ -157,16 +158,41 @@ export default { ...@@ -157,16 +158,41 @@ export default {
this.$apis.contractManager.getContractDetailApi({ id: this.routerInfo.id }).then(res => { this.$apis.contractManager.getContractDetailApi({ id: this.routerInfo.id }).then(res => {
if (res && res.templateConfig) { if (res && res.templateConfig) {
this.placeholderList = res.placeholderList this.placeholderList = res.placeholderList
this.templateType = res.templateConfig.templateType
if (res.templateConfig.templateType == 1) {
this.contentList = [
{
title: 'Logo区域',
label: 'Logo图',
key: 'logoUrl',
type: 'img'
},
{
title: '合同介绍区域',
label: '合同介绍:',
key: 'contractIntroduce',
type: 'richText'
},
{
title: '使用条件区域',
label: '使用条件:',
key: 'useConditions',
type: 'richText'
}
]
}
for (const key in this.contentObj) { for (const key in this.contentObj) {
if (key != 'useConditions') { if (key != 'useConditions') {
this.contentObj[key] = res.templateConfig[key] this.contentObj[key] = res.templateConfig[key]
} else { } else {
// 如果是自定义模板类型,使用条件的值取的是baseContext,自动化取useConditions,传参也是
let useConditions = res.templateConfig.templateType == 1 ? res.templateConfig.baseContext : res.templateConfig.useConditions
for (var i = 0; i < res.placeholderList.length; i++) { for (var i = 0; i < res.placeholderList.length; i++) {
var placeholder = res.placeholderList[i] var placeholder = res.placeholderList[i]
let targetStr = `<span data-w-e-type="text" data-key="${placeholder.key}" data-name="${placeholder.name}">${placeholder.name}</span>` let targetStr = `<span data-w-e-type="text" data-key="${placeholder.key}" data-name="${placeholder.name}">${placeholder.name}</span>`
res.templateConfig.useConditions = res.templateConfig.useConditions.replace(new RegExp(placeholder.key, 'g'), targetStr) useConditions = useConditions.replace(new RegExp(placeholder.key, 'g'), targetStr)
} }
this.contentObj.useConditions = res.templateConfig.useConditions this.contentObj.useConditions = useConditions
} }
} }
this.pdfObj = { this.pdfObj = {
...@@ -183,6 +209,14 @@ export default { ...@@ -183,6 +209,14 @@ export default {
let params = this.$common.utils.deepClone(this.contentObj) let params = this.$common.utils.deepClone(this.contentObj)
let errorTip = '' let errorTip = ''
params.useConditions = params.useConditions?.replace(/<span.*?data-w-e-type.*?data-key="(.*?)".*?<\/span>/g, '$1') params.useConditions = params.useConditions?.replace(/<span.*?data-w-e-type.*?data-key="(.*?)".*?<\/span>/g, '$1')
if (this.templateType == 1) {
params = {
baseContext: params.useConditions,
contractTitle: params.contractTitle,
contractIntroduce: params.contractIntroduce,
logoUrl: params.logoUrl
}
}
for (const key in params) { for (const key in params) {
if (key != 'id' && !params[key]) { if (key != 'id' && !params[key]) {
if (key == 'electronicSealUrl' || key == 'logoUrl') { if (key == 'electronicSealUrl' || key == 'logoUrl') {
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
<span slot="auth-button" slot-scope="row" :data="scope.scope"> <span slot="auth-button" slot-scope="row" :data="scope.scope">
<el-button type="text" v-if="scope.scope.packageType == 1" @click="handlePdf(row.scope)">打印</el-button> <el-button type="text" v-if="scope.scope.packageType == 1" @click="handlePdf(row.scope)">打印</el-button>
<el-button type="text" v-if="scope.scope.packageType == 1" @click="editContract(row.scope)">编辑</el-button> <el-button type="text" v-if="scope.scope.packageType == 1" @click="editContract(row.scope)">编辑</el-button>
<el-button type="text" v-if="scope.scope.packageType == 1" @click="changeTmpl(row.scope)">更换模板</el-button>
<el-button type="text" v-if="scope.scope.packageType == 1" @click="initTmpl(row.scope)">初始化模板</el-button>
</span> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -55,6 +57,14 @@ ...@@ -55,6 +57,14 @@
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
<changeContractDialog v-if="changeContractObj.visible" @closeDialog="closeTmplDialog" :changeContractObj="changeContractObj"></changeContractDialog>
<GLDialog :visible.sync="tipObj.visible" :close-on-click-modal="false" mode="small" title="提示" @onOk="toInitTmpl" @onCancel="closeTipDialog" :before-close="closeTipDialog">
<div class="tip-body">
<i class="el-icon-warning icon"></i>
<p class="title">是否确认初始化?</p>
<p class="content">选中的商品合同模板将初始化,读取后台的最新配置</p>
</div>
</GLDialog>
</div> </div>
</template> </template>
...@@ -127,10 +137,12 @@ const PROD_ENUM = { ...@@ -127,10 +137,12 @@ const PROD_ENUM = {
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import utils from '../../util/util' import utils from '../../util/util'
import pdfDialog from '@/views/beforeSale/pdfDialog' import pdfDialog from '@/views/beforeSale/pdfDialog'
import changeContractDialog from './components/changeContractDialog'
export default { export default {
name: 'prodIndex', name: 'prodIndex',
components: { components: {
pdfDialog pdfDialog,
changeContractDialog
}, },
data() { data() {
return { return {
...@@ -287,7 +299,18 @@ export default { ...@@ -287,7 +299,18 @@ export default {
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
changeContractObj: {
visible: false,
isBase: true,
skuId: '',
skuPackageCode: '',
baseTemplateId: ''
},
tipObj: {
visible: false,
ids: []
}
} }
}, },
...@@ -309,6 +332,56 @@ export default { ...@@ -309,6 +332,56 @@ export default {
this.detailData.packageTypeName = row.packageType == 1 ? '权益类' : '延保类' this.detailData.packageTypeName = row.packageType == 1 ? '权益类' : '延保类'
this.drawer = true this.drawer = true
}, },
// 更换模板
changeTmpl({ skuPackageCode, skuId }) {
this.changeContractObj = {
visible: true,
isBase: true, // true产品模板
skuId,
skuPackageCode,
baseTemplateId: ''
}
},
closeTmplDialog() {
this.changeContractObj.visible = false
this.handleSearch()
},
initTmpl(row) {
this.tipObj = {
visible: true,
ids: [row.contractId]
}
},
toInitTmpl() {
const params = {
templateIds: this.tipObj.ids,
baseFlag: 1
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.contractManager
.babchInitTemplateApi(params)
.then(res => {
if (res) {
this.$message.success('初始化模板成功')
this.closeTipDialog()
}
})
.finally(end => {
loading.close()
})
},
closeTipDialog() {
this.tipObj = {
visible: false,
ids: []
}
this.handleSearch()
},
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) {
......
...@@ -99,6 +99,14 @@ ...@@ -99,6 +99,14 @@
</div> </div>
</div> </div>
</GLDialog> </GLDialog>
<!-- 上传签名授权书 -->
<GLDialog title="提示" mode="small" okText="确认" cancelText="取消" :visible.sync="delReasonObj.showDelVisible" @onOk="confirmDel" @onCancel="closeDelDialog">
<div class="del-reason-body">
<div class="label">删除原因:</div>
<el-input type="text" v-model="delReasonObj.delReason" :maxlength="20" :show-word-limit="true" size="small"></el-input>
</div>
</GLDialog>
<!-- 跟进人配置 --> <!-- 跟进人配置 -->
<follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></follow-pop> <follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></follow-pop>
</div> </div>
...@@ -184,6 +192,10 @@ const statusList = [ ...@@ -184,6 +192,10 @@ const statusList = [
confId: 28, confId: 28,
confName: '运营经理审核不通过' confName: '运营经理审核不通过'
}, },
{
confId: 29,
confName: '已删除'
}
] ]
const describeList = [ const describeList = [
{ {
...@@ -216,6 +228,7 @@ const RE_SUMBIT = [2] //重新提交 ...@@ -216,6 +228,7 @@ const RE_SUMBIT = [2] //重新提交
const RETURN_IT = [7, 13, 28] // 撤销 const RETURN_IT = [7, 13, 28] // 撤销
const UPLOAD_INFO = [11] // 上传资料 const UPLOAD_INFO = [11] // 上传资料
const TO_HANDLE = [0] // 去处理 const TO_HANDLE = [0] // 去处理
const TO_DEL = [5]
const Operations_Mananger = [26] // 运营经理审核 const Operations_Mananger = [26] // 运营经理审核
export default { export default {
name: 'index', name: 'index',
...@@ -224,6 +237,10 @@ export default { ...@@ -224,6 +237,10 @@ export default {
isFollowSync: false, isFollowSync: false,
signImage: '', signImage: '',
showUpload: false, showUpload: false,
delReasonObj: {
showDelVisible: false,
delReason: ''
},
tableStatus, tableStatus,
orderCount: {}, orderCount: {},
buttonList: [ buttonList: [
...@@ -382,6 +399,22 @@ export default { ...@@ -382,6 +399,22 @@ export default {
listeners: { listeners: {
click: row => this.handleEdit(4, row.scope) click: row => this.handleEdit(4, row.scope)
} }
},
{
type: 'el-button',
name: row => {
return '删除'
},
condition: row => {
return TO_DEL.includes(row.scope.status)
},
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.handleDel(row.scope)
}
} }
], ],
getListApi: this.$apis.claims.getGHClaimsListApi, getListApi: this.$apis.claims.getGHClaimsListApi,
...@@ -393,7 +426,7 @@ export default { ...@@ -393,7 +426,7 @@ export default {
status: '', status: '',
commitDate: '', commitDate: '',
shopDate: '', shopDate: '',
merchantUpdatedDate:'', merchantUpdatedDate: '',
cityMerchantId: '', cityMerchantId: '',
provinceMerchantId: '', provinceMerchantId: '',
merchantId: '' merchantId: ''
...@@ -550,7 +583,7 @@ export default { ...@@ -550,7 +583,7 @@ export default {
prop: 'merchantUpdatedDate', prop: 'merchantUpdatedDate',
width: 180, width: 180,
formatter: cellValue => { formatter: cellValue => {
return cellValue.merchantUpdatedDate ? cellValue.merchantUpdatedDate: '-' return cellValue.merchantUpdatedDate ? cellValue.merchantUpdatedDate : '-'
} }
}, },
{ {
...@@ -724,10 +757,10 @@ export default { ...@@ -724,10 +757,10 @@ export default {
this.getFollowPersonList() this.getFollowPersonList()
}, },
mounted() {}, mounted() {},
beforeDestroy(){ beforeDestroy() {
const {pageNum, pageSize} = this.$refs?.equityRef?.page || {} const { pageNum, pageSize } = this.$refs?.equityRef?.page || {}
const ghPageInfo = {...this.searchForm,pageNum, pageSize} const ghPageInfo = { ...this.searchForm, pageNum, pageSize }
window.sessionStorage.setItem('ghPageInfo',JSON.stringify(ghPageInfo)) window.sessionStorage.setItem('ghPageInfo', JSON.stringify(ghPageInfo))
}, },
methods: { methods: {
getFollowPersonList() { getFollowPersonList() {
...@@ -746,9 +779,9 @@ export default { ...@@ -746,9 +779,9 @@ export default {
}, },
batchAudit() { batchAudit() {
const data = this.$refs.equityRef?.mutiSelectArr?.[this.tableParams.mutiSelectName] || [] const data = this.$refs.equityRef?.mutiSelectArr?.[this.tableParams.mutiSelectName] || []
if(!data?.length) return this.$message.error('请选择需要审批的记录') if (!data?.length) return this.$message.error('请选择需要审批的记录')
const _target = data.find(item => item.status!=12&item.status!=26) //批量操作只操作 待审核 和 待运营经理审核 const _target = data.find(item => (item.status != 12) & (item.status != 26)) //批量操作只操作 待审核 和 待运营经理审核
if(_target) return this.$message.error('请选择待审核的记录') if (_target) return this.$message.error('请选择待审核的记录')
const parmas = { const parmas = {
idList: data.map(item => item.id) idList: data.map(item => item.id)
} }
...@@ -758,14 +791,17 @@ export default { ...@@ -758,14 +791,17 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)' background: 'rgba(0, 0, 0, 0.3)'
}) })
this.$apis.claims.batchPassApi(parmas).then(res => { this.$apis.claims
if(res) { .batchPassApi(parmas)
this.$message.success('操作成功') .then(res => {
this.handleOkFn() if (res) {
} this.$message.success('操作成功')
}).finally(end => { this.handleOkFn()
loading.close() }
}) })
.finally(end => {
loading.close()
})
}, },
handleClose() { handleClose() {
this.isFollowSync = false this.isFollowSync = false
...@@ -861,6 +897,19 @@ export default { ...@@ -861,6 +897,19 @@ export default {
this.orderCount = res this.orderCount = res
}) })
}, },
handleDel(row) {
this.delReasonObj.showDelVisible = true
},
confirmDel() {
console.log(this.delReasonObj)
},
closeDelDialog() {
this.delReasonObj = {
showDelVisible: false,
delReason: '',
id: ''
}
},
// 1.新增 2.查看 6.重新提交 4.去处理 5.定损审核 7.核赔审核 8.运营经理审核 // 1.新增 2.查看 6.重新提交 4.去处理 5.定损审核 7.核赔审核 8.运营经理审核
handleEdit(editNo, row) { handleEdit(editNo, row) {
let urlParam = {} let urlParam = {}
...@@ -897,7 +946,7 @@ export default { ...@@ -897,7 +946,7 @@ export default {
status: '', status: '',
commitDate: '', commitDate: '',
shopDate: '', shopDate: '',
merchantUpdatedDate:'', merchantUpdatedDate: '',
cityMerchantId: '', cityMerchantId: '',
provinceMerchantId: '', provinceMerchantId: '',
merchantId: '' merchantId: ''
...@@ -907,17 +956,17 @@ export default { ...@@ -907,17 +956,17 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.searchParams = { ...this.getParams() } this.searchParams = { ...this.getParams() }
const {pageNum, pageSize} = JSON.parse(window.sessionStorage.getItem('ghPageInfo') || '{}') const { pageNum, pageSize } = JSON.parse(window.sessionStorage.getItem('ghPageInfo') || '{}')
if(pageNum && pageSize){ if (pageNum && pageSize) {
this.searchParams.pageNum = pageNum this.searchParams.pageNum = pageNum
this.searchParams.pageSize = pageSize this.searchParams.pageSize = pageSize
} }
resolve() resolve()
}) })
}, },
setTableFinishFun(){ setTableFinishFun() {
const {pageNum, pageSize} = JSON.parse(window.sessionStorage.getItem('ghPageInfo') || '{}') const { pageNum, pageSize } = JSON.parse(window.sessionStorage.getItem('ghPageInfo') || '{}')
if(pageNum && pageSize){ if (pageNum && pageSize) {
this.$refs.equityRef.page.pageNum = pageNum this.$refs.equityRef.page.pageNum = pageNum
this.$refs.equityRef.page.pageSize = pageSize this.$refs.equityRef.page.pageSize = pageSize
this.$forceUpdate() this.$forceUpdate()
...@@ -927,10 +976,10 @@ export default { ...@@ -927,10 +976,10 @@ export default {
getParams() { getParams() {
const sessionInfo = window.sessionStorage.getItem('ghPageInfo') const sessionInfo = window.sessionStorage.getItem('ghPageInfo')
const searchForm = JSON.parse(sessionInfo || '{}') const searchForm = JSON.parse(sessionInfo || '{}')
if(sessionInfo) { if (sessionInfo) {
delete searchForm.pageNum delete searchForm.pageNum
delete searchForm.pageSize delete searchForm.pageSize
this.searchForm = {...this.searchForm, ...searchForm} this.searchForm = { ...this.searchForm, ...searchForm }
} }
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
if (Array.isArray(params.commitDate) && params.commitDate.length > 0) { if (Array.isArray(params.commitDate) && params.commitDate.length > 0) {
...@@ -1171,4 +1220,16 @@ export default { ...@@ -1171,4 +1220,16 @@ export default {
// } // }
// } // }
// } // }
.del-reason-body {
display: flex;
align-items: center;
margin-top: 12px;
.label {
width: 154px;
text-align: right;
}
/deep/ .el-input {
width: 350px;
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!