Commit 0e059011 by cwq0219

售前-权益订单

1 parent 08d68ed9
...@@ -22,4 +22,15 @@ const getExportApi = params => { ...@@ -22,4 +22,15 @@ const getExportApi = params => {
}) })
} }
export default { getListApi, getExportApi } const updateHotlineApi = params => {
params.method = `${defaultPath}merchant.hotline.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, getExportApi, updateHotlineApi }
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange"> <el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker> <el-date-picker v-else-if="item.type === 'datePicker'" :value-format="item.valueFormat" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :placeholder="item.placeholder || '请选择' + item.label" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p> <p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || '100%' }"> <div v-if="!item.isDisabled" :style="{ width: item.width || '100%' }">
......
...@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
return new Http().get(' https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config') return new Http().get('https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config')
//return window.fetch('https://', {}).then(res => res.json()) //return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }) // request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
} }
......
...@@ -21,8 +21,14 @@ const staticRoutes = Object.freeze([{ ...@@ -21,8 +21,14 @@ const staticRoutes = Object.freeze([{
}, },
{ {
name: 'beforeSale', name: 'beforeSale',
path: '/beforeSale/saleList', path: '/beforeSale/index',
component: resolve => require([`@/views/beforeSale/index.vue`], resolve), component: resolve => require([`@/views/beforeSale/index.vue`], resolve),
meta: {} meta: {}
},
{
name: 'editEquity',
path: '/beforeSale/editEquity/:addOrEdit/:id',
component: resolve => require([`@/views/beforeSale/editEquity.vue`], resolve),
meta: {}
} ]) } ])
export default staticRoutes export default staticRoutes
...@@ -17,7 +17,20 @@ import { routes } from '@/router' ...@@ -17,7 +17,20 @@ import { routes } from '@/router'
export async function start() { export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig() const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } }) var urlParams = {}
window.location.href.split('?').length > 2
? window.location.href
.split('?')[1]
.split('&')
.forEach(item => {
urlParams[item.split('=')[0]] = item.split('=')[1]
})
: ''
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '1112223333444'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.prototype.$common = {
utils: utils
}
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes) render('/', routes)
} }
<!-- 编辑权益 -->
<template>
<div class="before-sale edit-equity">
<div class="container">
<p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="140px" :formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar" :formRules="editRuleCar"></glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">客户信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefUser" labelWidth="140px" :formRef="editChildRefUser" :formObj="editForm" :formData="editFormDataUser" :formRules="editRuleUser"></glsx-combi-form>
</div>
<!-- <div class="container">
<p class="edit-title">选择产品</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</div> -->
<div class="container">
<p class="edit-title">其他信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefOther" labelWidth="140px" :formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }">
<el-button type="primary" @click="handleDraft">草稿</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'editEquity',
data() {
return {
size: 'small',
// title: '新增权益',
// titleObj: {
// 1: '新增权益',
// 2: '编辑权益',
// 3: '查看权益'
// },
// footerLeft: '0',
// footerWidth: '0',
editCarChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
editForm: {
vehicle: {
licensing: ''
}
},
// 车辆信息
editRuleCar: {
licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }],
licensePlate: [{ required: true, message: '请输入车牌号码', trigger: 'change' }],
engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' }],
invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }],
vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }],
billingDate: [{ required: true, message: '请选择开票日期', trigger: 'change' }],
seatesNum: [{ required: true, message: '请选择座位数', trigger: 'change' }]
},
editFormDataCar: [
{
label: '是否上牌',
name: 'licensing',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'licensingList'
},
{
label: '车牌号码',
name: 'licensePlate',
type: 'input',
maxlength: 32
},
{
label: '发动机号',
name: 'engineNo',
type: 'input',
maxlength: 32
},
{
label: '发票价格',
name: 'invoicePrice',
type: 'input',
append: '元',
maxlength: 11
},
{
label: '车身颜色',
name: 'vehicleColor',
type: 'input',
maxlength: 32
},
{
label: '品牌车型',
name: '',
type: 'input',
maxlength: 20
},
{
label: '开票日期',
name: 'billingDate',
type: 'datePicker',
dateType: 'date',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '座位数',
name: 'seatesNum',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'seatesNumList'
}
],
// 客户信息
editRuleUser: {
customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }],
cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
cardNo: [{ required: true, message: '请输入身份证', trigger: 'change' }],
customerPhone: [{ required: true, message: '请输入联系号码', trigger: 'change' }],
customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }]
},
editFormDataUser: [
{
label: '客户类型',
name: 'customerType',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'customerTypeList'
},
{
label: '客户姓名',
name: 'customerName',
type: 'input',
maxlength: 128
},
{
label: '证件类型',
name: 'cardType',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'cardTypeList'
},
{
label: '身份证',
name: 'cardNo',
type: 'input',
maxlength: 18
},
{
label: '联系号码',
name: 'customerPhone',
type: 'input',
maxlength: 11
},
{
label: '联系地址',
name: 'customerAddress',
type: 'input',
maxlength: 128
}
],
// 其他信息
editRuleOther: {
suggestedSellingPrice: [{ required: true, message: '请输入建议销售价', trigger: 'change' }],
actualSalesPrice: [{ required: true, message: '请输入实际销售价', trigger: 'change' }],
servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }],
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }]
},
editFormDataOther: [
{
label: '建议销售价',
name: 'suggestedSellingPrice',
type: 'input',
append: '元',
isDisabled: true,
maxlength: 11
},
{
label: '实际销售价',
name: 'actualSalesPrice',
type: 'input',
append: '元',
maxlength: 11
},
{
label: '服务期限',
name: 'servicePeriod',
type: 'select',
noFilter: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'servicePeriodList'
},
{
label: '生效日期',
name: 'effectiveDate',
type: 'datePicker',
dateType: 'date',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions'
},
],
// 公共数据
baseData: {
licensingList: [
{
confId: '0',
confName: '否'
},
{
confId: '1',
confName: '是'
}
],
seatesNumList: [
{
confId: '2',
confName: '2'
},
{
confId: '3',
confName: '3'
},
{
confId: '4',
confName: '4'
},
{
confId: '5',
confName: '5'
},
{
confId: '6',
confName: '6'
},
{
confId: '7',
confName: '7'
}
],
customerTypeList: [
{
confId: '1',
confName: '个人'
},
{
confId: '2',
confName: '企业'
}
],
cardTypeList: [
{
confId: '1',
confName: '身份证'
},
{
confId: '2',
confName: '统一社会信息代码'
}
],
servicePeriodList: [
{
confId: '1',
confName: '1年'
}
]
}
}
},
components: {
glsxCombiForm
},
mounted() {
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
this.getOptionsList('editFormDataCar', false)
this.getOptionsList('editFormDataUser', false)
this.getOptionsList('editFormDataOther', false)
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
},
methods: {
getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.zoneName = res.zoneName
// this.editForm.zoneImg = res.zoneImg
// this.editForm.merchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleDraft() {},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id
}
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleCancel()
// }
// })
}
})
},
handleCancel() {
this.$router.push({
path: '/beforeSale/index'
})
}
}
}
</script>
<style scoped>
.before-sale .container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
margin-bottom: 20px;
}
.before-sale .edit-container {
margin-bottom: 84px;
}
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer {
/* position: absolute;
bottom: 0; */
width: 100%;
height: 64px;
/* left: 220px; */
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
}
.before-sale .flex-grow {
flex: 1;
}
.before-sale .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
border-bottom: 1px solid #E7EAEC;
margin: 0 0;
}
.before-sale .edit-sub-title {
position: relative;
font-size: 13px;
font-weight: 700;
height: 32px;
line-height: 32px;
color: #333333;
margin-bottom: 20px;
padding-left: 8px;
background-color: rgba(242, 242, 242, 1);
}
.before-sale .message-Z-zinde {
z-index: 3000 !important;
}
.before-sale .txt-red {
color: red;
}
.one-line-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
</style>
<!-- 权益订单列表 -->
<template>
<div class="before-sale">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="110px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(4, scope.scope)">查看</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleUpload(scope.scope)">上传资料</el-button>
<el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(3, scope.scope)">修改</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">退保</el-button>
<el-button v-if="[4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">重新提单</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'equityList',
data() {
return {
size: 'small',
searchForm: {
queryText: '',
orderStatus: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '搜索内容',
name: 'queryText',
type: 'input',
placeholder: '输入车主、单号、车架号',
maxlength: 100
},
{
label: '服务状态',
name: 'orderStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList'
},
{
label: '产品名称',
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
},
{
label: '提单成功时间',
name: 'successDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '生效时间',
name: 'effectiveDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'afterRangePickerOptions'
},
{
label: '总部',
name: 'merchantIds',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
}
],
// 表格
getListApi: this.$apis.beforeSale.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '车主姓名',
prop: 'customerName'
},
{
label: '合同号',
prop: ''
},
{
label: '提单成功时间',
prop: 'successDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '新车开票日期',
prop: 'expirationDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '160px',
line: 2
},
{
label: '车品牌',
prop: 'vehicleBrandName'
},
{
label: '车系',
prop: 'vehicleSeriesName'
},
{
label: '车架',
prop: 'vin'
},
{
label: '电话',
prop: 'customerPhone',
width: '160px'
},
{
label: '产品名称',
prop: 'packageName'
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
return (cellValue.actualSalesPrice / 100).toFixed(2)
}
},
{
label: '服务期限',
prop: ''
},
{
label: '生效时间',
prop: 'expirationDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '状态',
prop: 'orderStatus',
formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
}
},
{
label: '大区',
prop: ''
},
{
label: '片区',
prop: ''
},
{
label: '操作人',
prop: ''
}
]
},
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据
baseData: {
orderStatusList: [
{
confId: '0',
confName: '初始化'
},
{
confId: '2',
confName: '提单成功'
},
{
confId: '3',
confName: '提单失败'
},
{
confId: '4',
confName: '已退单'
},
{
confId: '5',
confName: '已过期'
}
]
}
}
},
components: {
glsxCombiForm
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.successDate.length) {
params.successStartDate = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDate = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDate = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDate = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.successDate
delete params.effectiveDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
addOrEdit == 1 ? this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + -1) : this.$router.push('/beforeSale/editEquity/' + addOrEdit + '/' + row.id)
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该专区?', 'zoneList', 'deleteZoneApi', { id: row.id })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => {
window.open(res)
})
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
successDate: [],
effectiveDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped>
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale .m-b-20 {
margin-bottom: 20px;
}
.before-sale .footer-btns {
float: right;
margin-bottom: 18px;
}
.before-sale .el-table .cell {
line-height: 16px;
}
.before-sale .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
.before-sale .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
</style>
<!-- 权益订单列表 --> <!-- 权益订单 -->
<template> <template>
<div class="before-sale"> <div class="equity">
<div class="m-b-20"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增权益</el-button> <el-tab-pane label="其他权益订单" name="equityList">
</div> <equity-list></equity-list>
<div class="container"> </el-tab-pane>
<div> <el-tab-pane label="店面服务设置" name="serviceSet">
<glsx-combi-form ref="showSearch" labelWidth="110px" :formObj="searchForm" :formData="searchFormData"> <service-set></service-set>
<span slot="footer" class="footer-btns"> </el-tab-pane>
<el-button :size="size" @click="handleReset">重置</el-button> </el-tabs>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(4, scope.scope)">查看</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleUpload(scope.scope)">上传资料</el-button>
<el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(3, scope.scope)">修改</el-button>
<el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">退保</el-button>
<el-button v-if="[4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleDelete(scope.scope)">重新提单</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import equityList from './equityList'
import glsxCombiForm from '@/components/glsx-combi-form' import serviceSet from './serviceSet'
export default { export default {
name: 'beforeSale', name: 'index',
data() { data() {
return { return {
size: 'small', activeName: 'equityList'
searchForm: {
queryText: '',
orderStatus: '',
successDate: [],
effectiveDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '搜索内容',
name: 'queryText',
type: 'input',
placeholder: '输入车主、单号、车架号',
maxlength: 100
},
{
label: '服务状态',
name: 'orderStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList'
},
{
label: '产品名称',
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
},
{
label: '提单成功时间',
name: 'successDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '生效时间',
name: 'effectiveDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '总部',
name: 'merchantIds',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
}
],
// 表格
getListApi: this.$apis.beforeSale.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '车主姓名',
prop: 'customerName'
},
{
label: '合同号',
prop: ''
},
{
label: '提单成功时间',
prop: 'successDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.successDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '新车开票日期',
prop: 'expirationDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '店面名称',
prop: 'merchantName',
width: '160px',
line: 2
},
{
label: '车品牌',
prop: 'vehicleBrandName'
},
{
label: '车系',
prop: 'vehicleSeriesName'
},
{
label: '车架',
prop: 'vin'
},
{
label: '电话',
prop: 'customerPhone',
width: '160px'
},
{
label: '产品名称',
prop: 'packageName'
},
{
label: '实际销售价',
prop: 'actualSalesPrice',
width: '160px',
formatter: cellValue => {
return (cellValue.actualSalesPrice / 100).toFixed(2)
}
},
{
label: '服务期限',
prop: ''
},
{
label: '生效时间',
prop: 'expirationDate',
width: '160px',
formatter: cellValue => {
return dayjs(cellValue.expirationDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '状态',
prop: 'orderStatus',
formatter: cellValue => {
return this.baseData.orderStatusList.map(item => item.confId).includes(cellValue.orderStatus) ? this.baseData.orderStatusList.find(item => item.confId == cellValue.orderStatus).confName : '-'
}
},
{
label: '大区',
prop: ''
},
{
label: '片区',
prop: ''
},
{
label: '操作人',
prop: ''
}
]
},
pageConf: { pageSize: 'pageCount', pageNum: 'pageSize', totalCount: 'total' },
// 公共数据
baseData: {
orderStatusList: [
{
confId: '0',
confName: '初始化'
},
{
confId: '2',
confName: '提单成功'
},
{
confId: '3',
confName: '提单失败'
},
{
confId: '4',
confName: '已退单'
},
{
confId: '5',
confName: '已过期'
}
]
}
} }
}, },
components: { components: {
glsxCombiForm equityList,
}, serviceSet
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.successDate.length) {
params.successStartDate = new Date(this.searchForm.successDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.successEndDate = new Date(this.searchForm.successDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.effectiveDate.length) {
params.effectiveStartDate = new Date(this.searchForm.effectiveDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.effectiveEndDate = new Date(this.searchForm.effectiveDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.successDate
delete params.effectiveDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { mounted() {},
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
},
handleDelete(row) { methods: {}
this.secondConfirm('删除', '是否确认删除该专区?', 'zoneList', 'deleteZoneApi', { id: row.id })
},
// 导出
handleExport() {
var params = this.getParams()
this.$apis.beforeSale.getExportApi(params).then(res => {
window.open(res)
})
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
queryText: '',
orderStatus: '',
successDate: [],
effectiveDate: []
}
this.handleSearch()
}
}
} }
</script> </script>
<style>
<style scoped> .equity .el-tabs__nav-wrap:after {
.before-sale .container { opacity: 0;
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
} }
.equity .el-tabs__item {
.before-sale .m-b-20 { height: 20px !important;
margin-bottom: 20px; line-height: 10px !important;
} font-weight: 400;
font-size: 16px;
.before-sale .footer-btns {
float: right;
margin-bottom: 18px;
}
.before-sale .el-table .cell {
line-height: 16px;
}
.before-sale .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #dcdfe6;
border-radius: 0;
}
.before-sale .table-btns .el-button:first-child {
padding: 0;
border: 0;
} }
</style> </style>
<!-- 店面服务设置 -->
<template>
<div class="before-sale edit-equity">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer" :style="{ width: '100%' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<!-- <el-button type="default" @click="handleCancel">取消</el-button> -->
</div>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'serviceSet',
data() {
return {
size: 'small',
title: '店面服务设置',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
editForm: {
hotline: ''
},
editRule: {
hotline: [{ required: true, message: '请输入服务热线', trigger: 'change' }]
},
editFormData: [
{
label: '服务热线',
name: 'hotline',
width: '320px',
type: 'input',
maxlength: 20
}
]
}
},
components: {
glsxCombiForm
},
mounted() {},
methods: {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
this.$apis.beforeSale.updateHotlineApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
})
}
})
}
}
}
</script>
<style scoped>
.before-sale .container {
padding: 0px 20px 20px 40px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.before-sale .edit-container {
margin-bottom: 84px;
}
.before-sale .edit-form-container {
margin-top: 20px;
}
.before-sale .txt-center {
text-align: center;
}
.before-sale .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 64px;
/* left: 220px; */
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
}
.before-sale .flex-grow {
flex: 1;
}
.before-sale .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
line-height: 48px;
border-bottom: 1px solid #E7EAEC;
margin: 0 0;
}
.before-sale .edit-sub-title {
position: relative;
font-size: 13px;
font-weight: 700;
height: 32px;
line-height: 32px;
color: #333333;
margin-bottom: 20px;
padding-left: 8px;
background-color: rgba(242, 242, 242, 1);
}
.before-sale .message-Z-zinde {
z-index: 3000 !important;
}
.before-sale .txt-red {
color: red;
}
.one-line-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!