Commit 11b197f1 by 前端

Merge branch 'v5.8.7.1' into 'master'

上线合并

See merge request !98
2 parents 7bc6fc8b f7a2f28a
...@@ -135,6 +135,31 @@ const getGHClaimsListApi = params => { ...@@ -135,6 +135,31 @@ const getGHClaimsListApi = params => {
sign: true sign: true
}) })
} }
// 批量导入核赔订单
const batchImportGHClaims = params => {
params.method = 'scrm.api.equity.service.claims.batch.import'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true
})
}
// 导出核赔订单批量导入错误文件
const exportBatchImportError = params => {
params.method = 'scrm.api.equity.service.claims.batch.import.error.export'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 新增跟进记录 // 新增跟进记录
const addGHClaimFollowsListApi = params => { const addGHClaimFollowsListApi = params => {
params.method = 'scrm.api.equity.service.claims.operate.followLog.create' params.method = 'scrm.api.equity.service.claims.operate.followLog.create'
...@@ -472,4 +497,4 @@ const getFollowListApi = params => { ...@@ -472,4 +497,4 @@ const getFollowListApi = params => {
sign: true sign: true
}) })
} }
export default { renewalAudit, getMerchantApi, getMidMerchantApi, getBigMerchantApi, saveSign, saveClaimsCG, saveCG, cancelClaims, batchPassApi, checkClaimsOrderApi, checkOrderApi, getOrderOherInfo, uploadImgApi, getGHCountApi, getGHPhoneImageApi, getGHattachmentApi, getGHClaimsDetailApi, getGHhistoryListApi, checkGHClaimsListApi, exportGHClaimsListApi, getExportUrlApi, getGHClaimFollowsListApi, addGHClaimFollowsListApi, getGHClaimsListApi, getclaimsList, getclaimsCount, resubmitOrder, commitClaimsOrder, getClaimsDetail, exportClaimsData, checkContractNo, getDetailByWOCode, getBankList, getCityList, getAccountInfo, getFollowPersonList, delFollowPerson, addFollowPerson, getMerchantSubList, delCaseApi, getDjClaimsDetailApi, checkDjOrderApi, checkDjClaimsOrderApi, getFollowListApi } export default { renewalAudit, getMerchantApi, getMidMerchantApi, getBigMerchantApi, saveSign, saveClaimsCG, saveCG, cancelClaims, batchPassApi, checkClaimsOrderApi, checkOrderApi, getOrderOherInfo, uploadImgApi, getGHCountApi, getGHPhoneImageApi, getGHattachmentApi, getGHClaimsDetailApi, getGHhistoryListApi, checkGHClaimsListApi, exportGHClaimsListApi, getExportUrlApi, getGHClaimFollowsListApi, addGHClaimFollowsListApi, getGHClaimsListApi, batchImportGHClaims, exportBatchImportError, getclaimsList, getclaimsCount, resubmitOrder, commitClaimsOrder, getClaimsDetail, exportClaimsData, checkContractNo, getBankList, getCityList, getAccountInfo, getFollowPersonList, delFollowPerson, addFollowPerson, getMerchantSubList, delCaseApi, getDjClaimsDetailApi, checkDjOrderApi, checkDjClaimsOrderApi, getFollowListApi }
...@@ -193,6 +193,18 @@ const initProdPackageApi = params => { ...@@ -193,6 +193,18 @@ const initProdPackageApi = params => {
}) })
} }
// 批量替换套餐合同模板
const batchReplaceParentTemplateApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.batch.replaceTemplate`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取套餐详情 // 获取套餐详情
const getProdPackageDetailApi = params => { const getProdPackageDetailApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.detail` params.method = `scrm.api.equity.service.contract.parent.template.detail`
...@@ -245,6 +257,7 @@ export default { ...@@ -245,6 +257,7 @@ export default {
getProdPackageListApi, getProdPackageListApi,
exportProdPackageApi, exportProdPackageApi,
initProdPackageApi, initProdPackageApi,
batchReplaceParentTemplateApi,
getProdPackageDetailApi, getProdPackageDetailApi,
getProdPartListApi, getProdPartListApi,
getSkuCategoryListApi getSkuCategoryListApi
......
...@@ -40,6 +40,9 @@ const gradeObj = { ...@@ -40,6 +40,9 @@ const gradeObj = {
], ],
salePeriodData: [], salePeriodData: [],
serviceGrade: 'A', serviceGrade: 'A',
buyConditions: [],
prerequisite: '',
exclusionsResponsibility: [],
serviceOverview: '', serviceOverview: '',
serviceDetail: '' serviceDetail: ''
} }
...@@ -87,19 +90,20 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => { ...@@ -87,19 +90,20 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => {
const data = deepClone(dataFromApi) const data = deepClone(dataFromApi)
let arr = [] let arr = []
data.forEach(element => { data.forEach(element => {
const { serviceOverview, serviceDetail, serviceGrade, gradeConfigList, id } = element const { serviceOverview, serviceDetail, serviceGrade, buyConditions, prerequisite, exclusionsResponsibility, gradeConfigList, id } = element
let _gradeObj = { let _gradeObj = {
id, id,
serviceOverview, serviceOverview,
serviceDetail, serviceDetail,
serviceGrade, serviceGrade,
buyConditions: buyConditions?.split ? buyConditions.split(',').map(item => parseInt(item)) : buyConditions || [],
prerequisite: prerequisite || '',
exclusionsResponsibility: exclusionsResponsibility?.split ? exclusionsResponsibility.split(',').map(item => parseInt(item)) : exclusionsResponsibility || [],
gradeConfigList: [] gradeConfigList: []
} }
// 根据区间去重 // 根据区间去重
let intervalArr = gradeConfigList?.reduce((acc, current) => { let intervalArr = gradeConfigList?.reduce((acc, current) => {
const exists = acc.some( const exists = acc.some(item => item.maxPrice === current.maxPrice && item.minPrice === current.minPrice)
item => item.maxPrice === current.maxPrice && item.minPrice === current.minPrice
)
if (!exists) { if (!exists) {
acc.push(current) acc.push(current)
} }
......
...@@ -100,6 +100,16 @@ export default { ...@@ -100,6 +100,16 @@ export default {
} }
}, },
created() { created() {
if (this.changeContractObj.isParent) {
this.tableParams.tableColumns = [
...TABLE_HEAD,
{
label: '套餐名称',
prop: 'parentName'
}
]
return
}
if (this.changeContractObj.isBase == 1) { if (this.changeContractObj.isBase == 1) {
this.tableParams.tableColumns = [ this.tableParams.tableColumns = [
...TABLE_HEAD, ...TABLE_HEAD,
...@@ -140,7 +150,7 @@ export default { ...@@ -140,7 +150,7 @@ export default {
let params = { let params = {
packageCode: this.changeContractObj.isParent ? row.parentId : row.packageCode, packageCode: this.changeContractObj.isParent ? row.parentId : row.packageCode,
merchantId: row.merchantId || '', merchantId: row.merchantId || '',
baseFlag: this.changeContractObj.isParent ? 2 : (this.changeContractObj.isBase == 2 ? 1 : 0) baseFlag: this.changeContractObj.isParent ? 2 : this.changeContractObj.isBase == 2 ? 1 : 0
} }
this.$apis.contractManager.printContractApi(params).then(res => { this.$apis.contractManager.printContractApi(params).then(res => {
loading.close() loading.close()
...@@ -151,7 +161,7 @@ export default { ...@@ -151,7 +161,7 @@ export default {
}) })
}, },
beforeSearchFn() { beforeSearchFn() {
const _apiStr = this.changeContractObj.isParent ? 'getProdPackageListApi' : (this.changeContractObj.isBase == 1 ? 'getBaseContractListApi' : this.changeContractObj.isBase == 2 ? 'getBaseTempListApi' : 'getContractListApi') const _apiStr = this.changeContractObj.isParent ? 'getProdPackageListApi' : this.changeContractObj.isBase == 1 ? 'getBaseContractListApi' : this.changeContractObj.isBase == 2 ? 'getBaseTempListApi' : 'getContractListApi'
this.getListApi = this.$apis.contractManager[_apiStr] this.getListApi = this.$apis.contractManager[_apiStr]
return new Promise(resolve => { return new Promise(resolve => {
resolve() resolve()
...@@ -180,7 +190,7 @@ export default { ...@@ -180,7 +190,7 @@ export default {
} else { } else {
params = { params = {
sourceId: this.curId, sourceId: this.curId,
baseFlag: this.changeContractObj.isParent ? 2 : (this.changeContractObj.isBase == 2 ? 1 : 0) baseFlag: this.changeContractObj.isParent ? 2 : this.changeContractObj.isBase == 2 ? 1 : 0
} }
if (this.changeContractObj.id) { if (this.changeContractObj.id) {
//单个商品合同更换 //单个商品合同更换
...@@ -190,6 +200,11 @@ export default { ...@@ -190,6 +200,11 @@ export default {
//商品合同批量 //商品合同批量
params.targetIds = this.changeContractObj.ids params.targetIds = this.changeContractObj.ids
} }
// 套餐合同批量
if (this.changeContractObj.isParentBatch) {
params.baseFlag = 0
API = 'batchReplaceParentTemplateApi'
}
// 产品合同批量 // 产品合同批量
if (this.changeContractObj.isProdBatch) { if (this.changeContractObj.isProdBatch) {
params.targetIds = this.changeContractObj.ids params.targetIds = this.changeContractObj.ids
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<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">
<GLButton type="primary" fn="批量更换" plain :size="size" @click="batchChangeTmpl">批量更换</GLButton>
<el-button type="primary" plain :size="size" @click="handleExport">导出</el-button> <el-button type="primary" plain :size="size" @click="handleExport">导出</el-button>
</div> </div>
</div> </div>
...@@ -175,8 +176,8 @@ export default { ...@@ -175,8 +176,8 @@ export default {
getListApi: this.$apis.contractManager.getProdPackageListApi, getListApi: this.$apis.contractManager.getProdPackageListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
// mutiSelectName: 'tmplIndex', mutiSelectName: 'tmplIndex',
// mutiSelectUniqueKey: 'id', mutiSelectUniqueKey: 'id',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
...@@ -241,6 +242,18 @@ export default { ...@@ -241,6 +242,18 @@ export default {
this.changeContractObj.visible = false this.changeContractObj.visible = false
this.handleSearch() this.handleSearch()
}, },
batchChangeTmpl() {
const data = this.$refs.equityRef?.mutiSelectArr?.[this.tableParams.mutiSelectName] || []
const ids = data.map(item => item.id)
if (!ids.length) return this.$message.error('请选择需要替换模板的合同')
this.changeContractObj = {
visible: true,
id: '',
ids,
isParent: true,
isParentBatch: true
}
},
initTmpl(row) { initTmpl(row) {
this.tipObj = { this.tipObj = {
visible: true, visible: true,
......
<template>
<el-dialog title="批量导入" width="800px" :visible="visible" :close-on-click-modal="false" :close-on-press-escape="!importing" :show-close="!importing" :before-close="handleClose" @update:visible="handleDialogVisible">
<div class="import-content">
<div class="form-item">
<span class="label">导入文件:</span>
<div class="file-area">
<el-button size="small" icon="el-icon-plus" :disabled="importing" @click="$refs.fileInput.click()">导入文件</el-button>
<input ref="fileInput" class="file-input" type="file" accept=".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" :disabled="importing" @change="selectFile" />
<a class="template-link" :href="templateUrl" download>模板下载</a>
<p v-if="file.name" class="file-name">
{{ file.name }}
<el-button type="text" :disabled="importing" icon="el-icon-close" @click="removeFile"></el-button>
</p>
</div>
</div>
<p v-if="importing" class="importing-tip">导入中,请稍候...</p>
<div v-if="hasResult" class="result">
<p>共导入{{ result.totalCount }}条,成功{{ result.successCount }}条,失败{{ result.failCount }}条</p>
<el-button v-if="result.failCount > 0" type="text" @click="downloadErrorFile">导出错误文件</el-button>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button v-if="importing" disabled>导入中,请稍候...</el-button>
<template v-else>
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="startImport">确定</el-button>
</template>
</span>
</el-dialog>
</template>
<script>
const TEMPLATE_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/xlsx/核赔订单导入模板.xlsx'
export default {
name: 'ClaimsBatchImport',
props: { visible: { type: Boolean, default: false } },
data() {
return {
file: {},
importing: false,
hasResult: false,
templateUrl: TEMPLATE_URL,
result: { totalCount: 0, successCount: 0, failCount: 0, batchId: '' }
}
},
methods: {
selectFile(event) {
const file = event.target.files[0]
if (!file) return
if (file.name.substring(file.name.lastIndexOf('.')).toLowerCase() !== '.xlsx') {
this.$message({
message: '仅支持上传xlsx格式的文件',
type: 'error',
customClass: 'message-Z-zinde'
})
this.$refs.fileInput.value = ''
return
}
this.file = file
this.clearResult()
},
removeFile() {
if (this.importing) return
this.clearFile()
this.clearResult()
},
clearFile() {
this.file = {}
if (this.$refs.fileInput) this.$refs.fileInput.value = ''
},
clearResult() {
this.hasResult = false
this.result = { totalCount: 0, successCount: 0, failCount: 0, batchId: '' }
},
startImport() {
if (!this.file.size) {
return this.$message({
message: '请上传文件',
type: 'error',
customClass: 'message-Z-zinde'
})
}
const reader = new FileReader()
this.importing = true
reader.readAsDataURL(this.file)
reader.onload = event => {
const base64 = event.target.result.split(',')[1]
const fileType = this.file.name.split('.').pop()
this.$apis.claims
.batchImportGHClaims({ file: `${fileType}@${base64}` })
.then(res => {
if (res.code !== 0 && res.code !== '0') {
this.$message({
message: res.message || '导入失败,请检查文件后重试',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
this.setResult(res.data || {})
if (this.result.successCount > 0) this.$emit('success')
})
.catch(() => {})
.finally(() => {
this.importing = false
this.clearFile()
})
}
reader.onerror = () => {
this.importing = false
this.clearFile()
this.$message({
message: '文件读取失败,请重新上传',
type: 'error',
customClass: 'message-Z-zinde'
})
}
},
setResult(res) {
const successCount = Number(res.successCount || res.successNum || res.successfulCount || 0)
const failCount = Number(res.failCount || res.failedCount || res.failNum || 0)
this.result = {
totalCount: Number(res.totalCount || res.importCount || res.total || successCount + failCount),
successCount,
failCount,
batchId: res.batchId || res.batchID || ''
}
this.hasResult = true
},
downloadErrorFile() {
if (!this.result.batchId) {
return this.$message({
message: '未获取到导入批次,请联系管理员',
type: 'error',
customClass: 'message-Z-zinde'
})
}
this.$apis.claims
.exportBatchImportError({ batchId: this.result.batchId })
.then(res => {
if (res.code !== 0 && res.code !== '0') {
return this.$message({
message: res.message || '错误文件导出失败',
type: 'error',
customClass: 'message-Z-zinde'
})
}
const data = res.data || {}
const fileUrl = typeof data === 'string' ? data : data.fileUrl || data.url || data.downloadUrl || data.exportUrl || ''
if (!fileUrl) {
return this.$message({
message: '未获取到错误文件,请联系管理员',
type: 'error',
customClass: 'message-Z-zinde'
})
}
window.location.href = fileUrl
})
.catch(() => {})
},
handleClose(done) {
if (this.importing) return
this.clearFile()
this.clearResult()
this.$emit('update:visible', false)
if (done) done()
},
handleDialogVisible(visible) {
if (!visible) this.handleClose()
}
}
}
</script>
<style lang="scss" scoped>
.import-content {
min-height: 150px;
padding: 12px 20px;
.form-item {
display: flex;
align-items: flex-start;
.label {
width: 88px;
line-height: 32px;
text-align: right;
}
.file-area {
position: relative;
.file-input {
display: none;
}
.template-link {
margin-left: 12px;
line-height: 32px;
color: #5850ff;
}
.file-name {
margin: 8px 0 0;
color: #666;
}
}
}
.importing-tip {
margin: 24px 0 0 88px;
color: #999;
}
.result {
margin: 50px 0 0 88px;
text-align: left;
p {
display: inline-block;
margin-right: 12px;
}
}
}
</style>
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<span>核赔订单列表</span> <span>核赔订单列表</span>
<div class="table_top_btn flex_sc"> <div class="table_top_btn flex_sc">
<GLButton size="small" fn="订单详情" type="primary" @click="handleEdit(1)">新增核赔</GLButton> <GLButton size="small" fn="订单详情" type="primary" @click="handleEdit(1)">新增核赔</GLButton>
<GLButton size="small" plain fn="导入" type="primary" @click="handleImport">导入</GLButton>
<GLButton size="small" plain fn="跟进人配置" type="primary" @click="handleConfig">跟进人配置</GLButton> <GLButton size="small" plain fn="跟进人配置" type="primary" @click="handleConfig">跟进人配置</GLButton>
<GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton> <GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton>
<el-button plain size="small" @click="exportList">导出</el-button> <el-button plain size="small" @click="exportList">导出</el-button>
...@@ -41,10 +42,12 @@ ...@@ -41,10 +42,12 @@
</div> </div>
<!-- 跟进人配置 --> <!-- 跟进人配置 -->
<dj-follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></dj-follow-pop> <dj-follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></dj-follow-pop>
<batch-import :visible.sync="importVisible" @success="handleImportSuccess"></batch-import>
</div> </div>
</template> </template>
<script> <script>
import djFollowPop from './components/djFollowPop' import djFollowPop from './components/djFollowPop'
import batchImport from './components/batchImport'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
const statusList = [ const statusList = [
// { // {
...@@ -632,11 +635,13 @@ export default { ...@@ -632,11 +635,13 @@ export default {
color: '#C6C6C6' color: '#C6C6C6'
} }
}, },
isFollowSync: false isFollowSync: false,
importVisible: false
} }
}, },
components: { components: {
djFollowPop djFollowPop,
batchImport
}, },
created() { created() {
this.diffHost() this.diffHost()
...@@ -651,6 +656,12 @@ export default { ...@@ -651,6 +656,12 @@ export default {
window.sessionStorage.setItem('djPageInfo', JSON.stringify(djPageInfo)) window.sessionStorage.setItem('djPageInfo', JSON.stringify(djPageInfo))
}, },
methods: { methods: {
handleImport() {
this.importVisible = true
},
handleImportSuccess() {
this.handleOkFn()
},
getClaimsCount() { getClaimsCount() {
this.$apis.claims.getclaimsCount({}).then(res => { this.$apis.claims.getclaimsCount({}).then(res => {
this.orderCount = res this.orderCount = res
......
...@@ -37,41 +37,6 @@ ...@@ -37,41 +37,6 @@
<div class="global-title">服务介绍</div> <div class="global-title">服务介绍</div>
<div class="main-wrap"> <div class="main-wrap">
<glsx-combi-form ref="servicesRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="servicesformData" :formRules="myRule"> <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 :disabled="disabled" v-model="formObj.buyConditions">
<el-checkbox v-for="(item, index) in conditionList" :disabled="!item.id" :label="item.id" :key="index">
<span class="sign">条件{{ index + 1 }}</span>
<div class="condition-text">
<span v-if="!item.newItem" class="condition">{{ item.contractContent }}</span>
<el-input class="condition-input" v-focus v-else type="textarea" v-model="curEditCondition.value" @blur.stop="createConfig(0, item)"></el-input>
<i v-if="!item.newItem && !disabled" class="el-icon-edit-outline edit" @click.prevent="editConditionFn(item, 'conditionList')"></i>
</div>
</el-checkbox>
</el-checkbox-group>
<div v-if="!disabled" class="add-btn" @click="addCondition('conditionList')">
<i class="el-icon-circle-plus-outline"></i>
新增条件
</div>
</div>
<div slot="prerequisiteSlot">
<Editor :disabled="disabled" v-model="formObj.prerequisite"></Editor>
</div>
<div slot="responsibilitySlot" class="buy-condition">
<el-checkbox-group :disabled="disabled" v-model="formObj.exclusionsResponsibility">
<el-checkbox v-for="(item, index) in responsibilityList" :disabled="!item.id" :label="item.id" :key="index">
<span class="sign">责任{{ index + 1 }}</span>
<div class="condition-text">
<span v-if="!item.newItem" class="condition">{{ item.contractContent }}</span>
<el-input class="condition-input" v-focus v-else type="textarea" v-model="curEditCondition.value" @blur.stop="createConfig(1, item)"></el-input>
<i v-if="!item.newItem && !disabled" class="el-icon-edit-outline edit" @click.prevent="editConditionFn(item, 'responsibilityList')"></i>
</div>
</el-checkbox>
</el-checkbox-group>
<div v-if="!disabled" class="add-btn" @click="addCondition('responsibilityList')">
<i class="el-icon-circle-plus-outline"></i>
新增责任
</div>
</div>
<div slot="serviceDataSlot"> <div slot="serviceDataSlot">
<Editor :disabled="disabled" v-model="formObj.serviceData"></Editor> <Editor :disabled="disabled" v-model="formObj.serviceData"></Editor>
</div> </div>
...@@ -88,7 +53,7 @@ ...@@ -88,7 +53,7 @@
<el-input class="cost-input" placeholder="请输入每月投保成本" @input="changePrice($event, gradeFormObj, 'monthlyInsuranceCost')" :disabled="disabled" v-model="gradeFormObj.monthlyInsuranceCost"></el-input> <el-input class="cost-input" placeholder="请输入每月投保成本" @input="changePrice($event, gradeFormObj, 'monthlyInsuranceCost')" :disabled="disabled" v-model="gradeFormObj.monthlyInsuranceCost"></el-input>
</div> </div>
<div slot="specConfigSlot"> <div slot="specConfigSlot">
<ServicesTable :disabled="disabled" class="services-table" v-for="item in gradeList" :routeInfo="routeInfo" :key="item.serviceGrade" :tableData="item"></ServicesTable> <ServicesTable :disabled="disabled" class="services-table" v-for="item in gradeList" :routeInfo="routeInfo" :key="item.serviceGrade" :tableData="item" :conditionList="conditionList" :responsibilityList="responsibilityList" :curEditCondition="curEditCondition" @add-condition="addCondition" @edit-condition="editConditionFn" @create-config="createConfig"></ServicesTable>
<div v-if="!disabled" class="add-btn" @click="handleAddGrade"> <div v-if="!disabled" class="add-btn" @click="handleAddGrade">
<i class="el-icon-circle-plus-outline"></i> <i class="el-icon-circle-plus-outline"></i>
新增规格 新增规格
...@@ -196,9 +161,6 @@ export default { ...@@ -196,9 +161,6 @@ export default {
trigger: 'change' 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' }] serviceData: [{ required: true, message: '请输入服务资料', trigger: 'change' }]
}, },
formObj: { formObj: {
...@@ -212,10 +174,7 @@ export default { ...@@ -212,10 +174,7 @@ export default {
activatedLogo: '', activatedLogo: '',
detailLogo: '', detailLogo: '',
serviceData: '', serviceData: '',
prerequisite: '', salePeriod: []
exclusionsResponsibility: [],
salePeriod: [],
buyConditions: []
}, },
formData: [ formData: [
{ {
...@@ -261,21 +220,6 @@ export default { ...@@ -261,21 +220,6 @@ export default {
], ],
servicesformData: [ servicesformData: [
{ {
label: '购买条件:',
name: 'buyConditions',
addHtml: 'buyConditionSlot'
},
{
label: '前提条件:',
name: 'prerequisite',
addHtml: 'prerequisiteSlot'
},
{
label: '除外责任:',
name: 'exclusionsResponsibility',
addHtml: 'responsibilitySlot'
},
{
label: '服务资料:', label: '服务资料:',
name: 'serviceData', name: 'serviceData',
addHtml: 'serviceDataSlot' addHtml: 'serviceDataSlot'
...@@ -408,7 +352,7 @@ export default { ...@@ -408,7 +352,7 @@ export default {
const _gradeList = [] const _gradeList = []
try { try {
this.gradeList.forEach(item => { this.gradeList.forEach(item => {
const { id, serviceGrade, serviceOverview, serviceDetail, salePeriodData, gradeConfigList } = item const { id, serviceGrade, serviceOverview, serviceDetail, buyConditions, prerequisite, exclusionsResponsibility, salePeriodData, gradeConfigList } = item
let _gradeConfigList = [] let _gradeConfigList = []
if (!gradeConfigList?.length) throw new Error(`请配置规格${serviceGrade}的价格区间`) if (!gradeConfigList?.length) throw new Error(`请配置规格${serviceGrade}的价格区间`)
gradeConfigList.forEach((ele, eleIdx) => { gradeConfigList.forEach((ele, eleIdx) => {
...@@ -438,10 +382,13 @@ export default { ...@@ -438,10 +382,13 @@ export default {
standardShelfCost = NP.times(it?.standardShelfCost || 0, 100) // 标准上架成本 standardShelfCost = NP.times(it?.standardShelfCost || 0, 100) // 标准上架成本
let min_price = NP.times(minPrice || 0, 1000000) let min_price = NP.times(minPrice || 0, 1000000)
let max_price = NP.times(maxPrice || 0, 1000000) let max_price = NP.times(maxPrice || 0, 1000000)
let gradeConfigObj = { id: element.id, priceGrade: eleIdx, priceCoefficient: priceCoefficient ? priceCoefficient : undefined, minPrice: min_price, maxPrice: max_price, servicePeriod, standardSalesCost, standardShelfCost, computeFlag, salesCost, shelfCost} let gradeConfigObj = { id: element.id, priceGrade: eleIdx, priceCoefficient: priceCoefficient ? priceCoefficient : undefined, minPrice: min_price, maxPrice: max_price, servicePeriod, standardSalesCost, standardShelfCost, computeFlag, salesCost, shelfCost }
_gradeConfigList.push(gradeConfigObj) _gradeConfigList.push(gradeConfigObj)
}) })
}) })
if (!buyConditions?.length || !prerequisite || !exclusionsResponsibility?.length) {
throw new Error(`请完善${serviceGrade}规格的${!buyConditions?.length ? '购买条件' : !prerequisite ? '前提条件' : '除外责任'}`)
}
if (!serviceOverview || !serviceDetail) { if (!serviceOverview || !serviceDetail) {
throw new Error(`请输入${serviceGrade}规格的${serviceOverview ? '规格详细描述' : '服务条款概述'}`) throw new Error(`请输入${serviceGrade}规格的${serviceOverview ? '规格详细描述' : '服务条款概述'}`)
} }
...@@ -450,6 +397,9 @@ export default { ...@@ -450,6 +397,9 @@ export default {
serviceGrade, serviceGrade,
serviceOverview, serviceOverview,
serviceDetail, serviceDetail,
buyConditions: buyConditions.join(','),
prerequisite,
exclusionsResponsibility: exclusionsResponsibility.join(','),
gradeConfigList: _gradeConfigList gradeConfigList: _gradeConfigList
} }
_gradeList.push(_gradeObj) _gradeList.push(_gradeObj)
...@@ -531,7 +481,7 @@ export default { ...@@ -531,7 +481,7 @@ export default {
getServiceDetail() { getServiceDetail() {
this.$apis.serviceConfig.getServiceDetailApi({ id: this.routeInfo?.id }).then(res => { this.$apis.serviceConfig.getServiceDetailApi({ id: this.routeInfo?.id }).then(res => {
if (res) { if (res) {
const transKeyList = ['buyConditions', 'salePeriod', 'exclusionsResponsibility'] const transKeyList = ['salePeriod']
for (const key in this.formObj) { for (const key in this.formObj) {
this.formObj[key] = transKeyList.includes(key) && res[key].split ? res[key].split(',').map(item => parseInt(item)) : res[key] this.formObj[key] = transKeyList.includes(key) && res[key].split ? res[key].split(',').map(item => parseInt(item)) : res[key]
} }
...@@ -554,8 +504,6 @@ export default { ...@@ -554,8 +504,6 @@ export default {
this.$refs.servicesRef.$refs.formRef.validate(sValid => { this.$refs.servicesRef.$refs.formRef.validate(sValid => {
if (bValid && sValid) { if (bValid && sValid) {
const params = JSON.parse(JSON.stringify(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(',') params.salePeriod = params.salePeriod.join(',')
if (!params.copyServiceCode) { if (!params.copyServiceCode) {
params.guorenCode = params.copyServiceName params.guorenCode = params.copyServiceName
......
...@@ -78,6 +78,60 @@ ...@@ -78,6 +78,60 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr class="desc-wrap">
<td class="desc-td" :colspan="tableData.salePeriodData.length * 2 + 5">
<div class="desc condition-desc">
<label class="required-label">购买条件:</label>
<div class="buy-condition">
<el-checkbox-group :disabled="disabled" v-model="tableData.buyConditions">
<el-checkbox v-for="(item, index) in conditionList" :disabled="!item.id" :label="item.id" :key="item.id || index">
<span class="sign">条件{{ index + 1 }}</span>
<div class="condition-text">
<span v-if="!item.newItem" class="condition">{{ item.contractContent }}</span>
<el-input class="condition-input" v-focus v-else type="textarea" v-model="curEditCondition.value" @blur.stop="$emit('create-config', 0, item)"></el-input>
<i v-if="!item.newItem && !disabled" class="el-icon-edit-outline edit" @click.prevent="$emit('edit-condition', item, 'conditionList')"></i>
</div>
</el-checkbox>
</el-checkbox-group>
<div v-if="!disabled" class="add-btn" @click="$emit('add-condition', 'conditionList')">
<i class="el-icon-circle-plus-outline"></i>
新增条件
</div>
</div>
</div>
</td>
</tr>
<tr class="desc-wrap">
<td class="desc-td" :colspan="tableData.salePeriodData.length * 2 + 5">
<div class="desc">
<label class="required-label">前提条件:</label>
<Editor :disabled="disabled" v-model="tableData.prerequisite"></Editor>
</div>
</td>
</tr>
<tr class="desc-wrap">
<td class="desc-td" :colspan="tableData.salePeriodData.length * 2 + 5">
<div class="desc condition-desc">
<label class="required-label">除外责任:</label>
<div class="buy-condition">
<el-checkbox-group :disabled="disabled" v-model="tableData.exclusionsResponsibility">
<el-checkbox v-for="(item, index) in responsibilityList" :disabled="!item.id" :label="item.id" :key="item.id || index">
<span class="sign">责任{{ index + 1 }}</span>
<div class="condition-text">
<span v-if="!item.newItem" class="condition">{{ item.contractContent }}</span>
<el-input class="condition-input" v-focus v-else type="textarea" v-model="curEditCondition.value" @blur.stop="$emit('create-config', 1, item)"></el-input>
<i v-if="!item.newItem && !disabled" class="el-icon-edit-outline edit" @click.prevent="$emit('edit-condition', item, 'responsibilityList')"></i>
</div>
</el-checkbox>
</el-checkbox-group>
<div v-if="!disabled" class="add-btn" @click="$emit('add-condition', 'responsibilityList')">
<i class="el-icon-circle-plus-outline"></i>
新增责任
</div>
</div>
</div>
</td>
</tr>
</table> </table>
</div> </div>
</template> </template>
...@@ -95,7 +149,7 @@ export default { ...@@ -95,7 +149,7 @@ export default {
default: '' default: ''
}, },
tableData: { tableData: {
type: String, type: Object,
default: () => { default: () => {
return {} return {}
} }
...@@ -104,6 +158,18 @@ export default { ...@@ -104,6 +158,18 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
conditionList: {
type: Array,
default: () => []
},
responsibilityList: {
type: Array,
default: () => []
},
curEditCondition: {
type: Object,
default: () => ({})
},
url: { url: {
type: String, type: String,
default: '' default: ''
...@@ -144,6 +210,13 @@ export default { ...@@ -144,6 +210,13 @@ export default {
} }
} }
}, },
directives: {
focus: {
inserted(el) {
el.querySelector('textarea').focus()
}
}
},
methods: { methods: {
changePrice(value, item, key) { changePrice(value, item, key) {
const decimal = ['standardShelfCost', 'standardSalesCost', 'minPrice', 'maxPrice'].includes(key) ? 2 : 16 const decimal = ['standardShelfCost', 'standardSalesCost', 'minPrice', 'maxPrice'].includes(key) ? 2 : 16
...@@ -159,15 +232,15 @@ export default { ...@@ -159,15 +232,15 @@ export default {
.replace(/\./g, '') .replace(/\./g, '')
.replace('$#$', '.') .replace('$#$', '.')
.replace(new RegExp(`^(\\-)*(\\d+)\\.(\\d{${decimal}}).*`, 'g'), '$1$2.$3') .replace(new RegExp(`^(\\-)*(\\d+)\\.(\\d{${decimal}}).*`, 'g'), '$1$2.$3')
.replace(new RegExp(`^(-?\\d+(?:\\.\\d{0,${decimal}})?).*`), (match) => { .replace(new RegExp(`^(-?\\d+(?:\\.\\d{0,${decimal}})?).*`), match => {
if (maxNum !== null) { if (maxNum !== null) {
const num = parseFloat(match) const num = parseFloat(match)
if (num > maxNum) { if (num > maxNum) {
return maxNum.toString() return maxNum.toString()
}
} }
} return match
return match })
})
: '' : ''
}, },
changeComputeFlag(e, item) { changeComputeFlag(e, item) {
...@@ -306,6 +379,50 @@ export default { ...@@ -306,6 +379,50 @@ export default {
} }
} }
} }
.condition-desc {
align-items: flex-start;
text-align: left;
.buy-condition {
flex: 1;
.el-checkbox {
display: block;
width: fit-content;
margin-bottom: 10px;
}
.condition-text {
display: inline-flex;
align-items: center;
}
.condition-input {
width: 592px;
}
.sign {
margin-right: 8px;
}
.condition {
display: inline-block;
box-sizing: border-box;
vertical-align: text-top;
white-space: pre-wrap;
width: 592px;
line-height: 32px;
background: #f5f7fa;
border-radius: 4px;
padding: 0 12px;
font-size: 14px;
color: #333333;
}
.edit {
color: #c6c6c6;
margin-left: 8px;
}
}
}
.required-label::before {
content: '*';
margin-right: 4px;
color: #f56c6c;
}
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!