Commit a38a9380 by zhangxw

需求开发

1 parent c871cbd3
...@@ -153,6 +153,72 @@ const addGradeApi = params => { ...@@ -153,6 +153,72 @@ const addGradeApi = params => {
}) })
} }
// 获取延保权益部件列表数据
const getScreeningDataApi = params => {
params.method = `scrm.api.equity.service.items.extend.unit.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保权益列表数据
const getExtendedWarrantyListApi = params => {
params.method = `scrm.api.equity.service.items.extend.pages`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 导出延保权益项目列表
const exportExtendedWarrantyApi = params => {
params.method = `scrm.api.equity.service.items.extend.pages.export`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 新增编辑延保权益服务项目
const addExtendedWarrantyApi = params => {
params.method = `scrm.api.equity.service.items.extend.insert.or.update`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保权益服务项目详情
const getExtendedWarrantyDetailApi = params => {
params.method = `scrm.api.equity.service.items.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取延保合同列表
const getExtendedWarrantyContractListApi = params => {
params.method = `scrm.api.equity.service.contract.base.extend.template.list.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
get4SList, get4SList,
getEquityList, getEquityList,
...@@ -168,5 +234,11 @@ export default { ...@@ -168,5 +234,11 @@ export default {
addServicesProject, addServicesProject,
getServiceDetailApi, getServiceDetailApi,
getSpecificaListApi, getSpecificaListApi,
addGradeApi addGradeApi,
getScreeningDataApi,
getExtendedWarrantyListApi,
exportExtendedWarrantyApi,
addExtendedWarrantyApi,
getExtendedWarrantyDetailApi,
getExtendedWarrantyContractListApi
} }
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="container"> <div class="container" v-if="!routeInfo.extendedFlag">
<template v-if="firstPage"> <template v-if="firstPage">
<div class="base-info"> <div class="base-info">
<div class="global-title">基本信息</div> <div class="global-title">基本信息</div>
...@@ -109,6 +109,9 @@ ...@@ -109,6 +109,9 @@
</template> </template>
</div> </div>
</div> </div>
<div class="container" v-else>
<add-extended :route-info="routeInfo"></add-extended>
</div>
</template> </template>
<script> <script>
...@@ -118,6 +121,7 @@ import ServicesTable from './components/ServicesTable' ...@@ -118,6 +121,7 @@ import ServicesTable from './components/ServicesTable'
import Editor from '@/components/Editor' import Editor from '@/components/Editor'
import { addGradeItem, handleGradeData } from '@/util/gradeData' import { addGradeItem, handleGradeData } from '@/util/gradeData'
import NP from 'number-precision' import NP from 'number-precision'
import addExtended from './addExtended.vue'
const TIP_OBJ = { const TIP_OBJ = {
minPrice: '最小值', minPrice: '最小值',
maxPrice: '最大值', maxPrice: '最大值',
...@@ -131,7 +135,8 @@ export default { ...@@ -131,7 +135,8 @@ export default {
glsxCombiForm, glsxCombiForm,
Upload, Upload,
Editor, Editor,
ServicesTable ServicesTable,
addExtended
}, },
data() { data() {
return { return {
...@@ -310,6 +315,8 @@ export default { ...@@ -310,6 +315,8 @@ export default {
created() { created() {
const urlParam = this.$route.params const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id)) this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
// 延保服务项目配置在组件中
if (this.routeInfo.extendedFlag) return
if (this.routeInfo.type == 2) { if (this.routeInfo.type == 2) {
this.disabled = true this.disabled = true
this.formData.forEach(item => { this.formData.forEach(item => {
......
<template>
<div>
<GLDialog bigTitle="选择合同" mode="big" :visible.sync="contractObj.visible" :before-close="handleClose" :close-on-click-modal="false" @onOk="handleConfirm" @onCancel="handleClose">
<glsx-combi-form ref="showSearch" labelWidth="105px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="getTable">查询</el-button>
</span>
</glsx-combi-form>
<GLTable :hasNum="false" ref="contractTableRef" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="radioSlot" slot-scope="scope">
<el-radio v-model="curId" :label="scope.scope.id">&nbsp;</el-radio>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="1"></GLTableButton>
</span>
</GLTable>
</GLDialog>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
</div>
</template>
<script>
const TABLE_HEAD = [
{
label: '',
prop: 'radioSlot',
addHtml: 'radioSlot',
width: '50'
},
{
label: '合同编号',
prop: 'id'
}
]
import url from '@/assets/empty.png'
import pdfDialog from '@/views/beforeSale/pdfDialog'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'changeContract',
components: {
pdfDialog,
glsxCombiForm
},
props: {
contractObj: {
type: Object,
default: () => {}
}
},
data() {
return {
size: 'small',
isPdfVisible: false,
pdfUrl: '',
curId: '',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
getListApi: this.$apis.serviceConfig.getExtendedWarrantyContractListApi,
searchForm: {
templateName: ''
},
buttonList: [
{
type: 'el-button',
name: row => {
return '预览'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.handlePdf(row.scope)
}
}
],
searchFormData: [
{
label: '合同名称',
name: 'templateName',
type: 'input',
maxlength: 20,
isClear: true
}
],
tableParams: {
listName: 'list',
tableOption: {
width: '100px'
},
tableColumns: []
}
}
},
created() {
this.tableParams.tableColumns = [
...TABLE_HEAD,
{
label: '合同名称',
prop: 'templateName'
}
]
this.curId = this.contractObj?.curId || ''
},
mounted() {},
methods: {
handlePdfClose() {
this.isPdfVisible = !this.isPdfVisible
},
// 预览
handlePdf(row) {
this.pdfUrl = row?.previewUrl
this.handlePdfClose()
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
setTableFinishFun(data) {
this.tableData = data || []
},
getTable() {
this.$refs.contractTableRef.refreshTable()
},
handleConfirm() {
if (!this.curId)
return this.$message({
message: '请选择合同',
type: 'error',
customClass: 'msgHierarchy'
})
let params = this.tableData?.find(item => item.id == this.curId)
this.$emit('confirm', [params])
},
handleClose() {
this.$emit('closeDialog')
}
}
}
</script>
<style lang="scss"></style>
<template> <template>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLTabs class="tab" v-model="tabId" :tabPaneList="tabPaneList"></GLTabs>
<div class="table-wrapper"> <template v-if="tabId == '1'">
<div class="operate_wrap"> <carDamage></carDamage>
<span class="table_title">配置列表</span> </template>
<div class="operate_btn"> <template v-if="tabId == '2'">
<el-button :size="size" type="primary" @click="addClause(1)">新增</el-button> <extendedWarranty></extendedWarranty>
<el-button :size="size" @click="handleExport">导出</el-button> </template>
</div>
</div>
<GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="statusSlot" slot-scope="scope">
<span class="statsu-circle" :style="{ 'background-color': scope.scope.serviceStatus == 0 ? '#FDB757' : '#2CCA74' }"></span>
<span>{{ scope.scope.serviceStatus == 0 ? '待配置' : '已配置' }}</span>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</span>
</GLTable>
</div>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import carDamage from './carDamage.vue'
import utils from '../../util/util' import extendedWarranty from './extendedWarranty.vue'
export default { export default {
name: 'equityList', name: 'index',
components: {}, components: {
carDamage,
extendedWarranty
},
beforeRouteEnter(to, from, next) {
next(vm => {
if (from.path.indexOf('extendedFlag') > -1) {
vm.tabId = '2'
}
})
},
data() { data() {
return { return {
size: 'small', tabId: '1',
buttonList: [ tabPaneList: [
{ { name: '1', label: '车损权益' },
type: 'el-button', { name: '2', label: '延保权益' }
name: row => { ]
return '查看'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.addClause(2, row.scope)
}
},
{
type: 'el-button',
name: row => {
return '编辑'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.addClause(3, row.scope)
}
}
],
searchForm: {
serviceName: '',
serviceStatus: '',
createdDate: '',
updatedDate: ''
},
tableSearchForm: {},
searchFormData: [
{
label: '服务名称',
name: 'serviceName',
type: 'input',
isClear: true
},
{
label: '状态',
name: 'serviceStatus',
type: 'select',
optionList: [
{
id: '',
label: '全部'
},
{
id: '0',
label: '待配置'
},
{
id: '1',
label: '已配置'
}
],
optionId: 'id',
optionLabel: 'label',
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.serviceConfig.getServicesItemsList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '服务编号',
prop: 'serviceCode',
width: 200
},
{
label: '服务名称',
prop: 'serviceName',
width: 200
},
{
label: '可销售服务年限',
minWidth: 280,
prop: 'salePeriod',
formatter: cellValue => {
return cellValue.salePeriod?.length
? cellValue.salePeriod
.split(',')
.map(item => (item = item + '年'))
.join('、')
: '--'
}
},
{
label: '规格数量',
minWidth: 150,
prop: 'gradeCount'
},
{
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: '状态',
minWidth: 150,
prop: 'status',
addHtml: 'statusSlot'
},
{
label: '操作人',
prop: 'updatedBy',
width: 140
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
} }
}, },
mounted() {}, mounted() {},
methods: { methods: {}
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm?.createdDate?.length) {
params.beginCreateTime = new Date(this.searchForm.createdDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreateTime = new Date(this.searchForm.createdDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm?.updatedDate?.length) {
params.beginUpdateTime = new Date(this.searchForm.updatedDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endUpdateTime = new Date(this.searchForm.updatedDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createdDate
delete params.updatedDate
return { ...params }
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.serviceConfig.exportServicesItemsApi(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: '',
serviceStatus: '',
createdDate: '',
updatedDate: ''
}
this.handleSearch()
},
addClause(type, row) {
// 1新增 2查看 3编辑
const { id, serviceCode, serviceName } = row || {}
let query = {
type
}
if (type != 1) {
query.id = id
query.serviceCode = serviceCode
query.serviceName = serviceName
}
const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push('/serviceConfig/addService/' + queryStr)
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .tab {
background-color: #ffffff; margin-bottom: 16px;
padding: 20px;
.statsu-circle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #fdb757;
margin-right: 8px;
vertical-align: middle;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!