Commit 1fce0f73 by 杨北旺

模拟数据方便处理业务逻辑

1 parent 545b0f65
......@@ -3,7 +3,7 @@
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px': '30px', ...item.style }" :label="item.label" :prop="item.name">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
......@@ -12,11 +12,11 @@
{{ item.label }}
</span>
<span v-else-if="!item.isHide && item.label" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? (item.labelWidth + labelPaddingRight) + 'px' : '', 'padding-right': isEdit ? '12px' : (labelPaddingRight + 'px') }">{{ item.label }}</span>
<span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" >
<el-input @change="item.inputChange" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
......@@ -24,7 +24,7 @@
</div>
<!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || defaultWidth }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || labelWidth + 'px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</el-input>
......@@ -95,6 +95,8 @@
</template>
<slot :name="item.suffixSlot" :scope="item"></slot>
</template>
<!-- 省市区 -->
<el-cascader v-else-if="item.type === 'cascader'" filterable :disabled="item.isDisabled" ref="cascader" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" placeholder="请选择省/请选择市/请选择区" size="small " :options="regionData" v-model="formObj[item.name]" @change="item.handleChange"></el-cascader>
</el-form-item>
</template>
<slot name="footer"></slot>
......@@ -102,7 +104,7 @@
<el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4">
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
......@@ -112,6 +114,7 @@
<script>
import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
import cityList from '../../common/city'
export default {
name: 'glsx-combi-form',
data() {
......@@ -124,7 +127,8 @@ export default {
dialogObj: {
url: '',
uploadType: 'img'
}
},
regionData: cityList
}
},
......@@ -353,7 +357,7 @@ export default {
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
background-color: #F7F7F7;
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
}
......@@ -433,16 +437,16 @@ export default {
/* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #E8E8EA;
color: #e8e8ea;
background-color: #5850ff !important;
}
.glsx-combi-form .el-tag.el-tag--info {
border-color: #5850ff;
}
.glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
background-color: #e8e8ea;
}
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
background-color: #e8e8ea;
}
</style>
......@@ -85,7 +85,7 @@ const staticRoutes = Object.freeze([
},
{
name: 'order',
path: '/claims/order',
path: '/claims/order/:id',
component: resolve => require([`@/views/claims/order.vue`], resolve),
meta: {}
}
......
<template>
<div class="city-select-components">
<el-cascader :disabled="isDisabled" ref="cascader" style="width:320px" placeholder="请选择省/请选择市/请选择区" size="small " :options="regionData" v-model="selectedOptions" @change="handleChange"></el-cascader>
</div>
</template>
<script>
import cityList from '../../../common/city'
export default {
name: '',
data() {
return {
regionData: cityList,
selectedOptions: ''
}
},
props: {
isDisabled: {
type: Boolean,
default: false
}
},
methods: {
handleChange(e) {
let nodesInfo = this.$refs.cascader.getCheckedNodes()[0].pathLabels
let newObj = {
value: e,
label: nodesInfo
}
this.$emit('onChange', newObj)
}
}
}
</script>
<style lang="scss" scoped>
.city-select-components /deep/ .el-cascader-panel {
height: 250px !important;
}
</style>
<template>
<div class="report-components">
<div class="title">报案信息(客户提交)</div>
<glsxCombiForm class="edit-form-container " ref="editFormRefReport" labelWidth="144px" defaultWidth="320px" formRef="editRefReport" :formObj="editForm" :formData="editFormData">
<template slot="citySelect">
<city-select :isDisabled="pageType == 'add' ? false : true" @onChange="selectAddress"></city-select>
</template>
</glsxCombiForm>
<glsxCombiForm class="edit-form-container " ref="editFormRefReport" labelWidth="144px" defaultWidth="320px" formRef="editRefReport" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsxCombiForm>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import citySelect from './citySelect.vue'
export default {
name: '',
components: {
glsxCombiForm,
'city-select': citySelect
glsxCombiForm
},
props: {
editForm: Object,
pageType: {
type: String,
default: 'add' //add为新增 look为查看加编辑
type: Number,
default: 1 // 1.新增 2.查看 3.重新提交 4.去处理
}
},
data() {
return {
editFormData: [],
showGh: false
showGh: false,
editRule: {
contractNo: [{ required: true, message: '请输入合同号', trigger: 'change' }],
reportDate: [{ required: true, message: '请选择报案日期', trigger: 'change' }],
reimbursementDate: [{ required: true, message: '请选择出险日期', trigger: 'change' }],
reportName: [{ required: true, message: '请输入报案人', trigger: 'change' }],
reportPhone: [{ required: true, message: '请输入报案人联系号码', trigger: 'change' }],
reimbursementAddress: [{ required: true, message: '请选择出险地点', trigger: 'change' }]
}
}
},
created() {
this.diffHost()
},
methods: {
selectAddress(e) {
this.editForm.reimbursementAddress = e.label.join('')
},
// 从域名判断是不是广汇的
diffHost() {
let href = window.location.host
......@@ -50,14 +49,18 @@ export default {
},
// 处理广汇嘀加不同字段显示
diffKeyHandle(showGh) {
const isDisabled = this.pageType == 'add' ? false : true
const isDisabled = this.pageType == 2 ? true : false
const dj = [
{
label: '合同号',
name: 'contractNo',
type: 'input',
maxlength: 100,
isDisabled
isDisabled,
isClear: true,
inputChange: e => {
this.toSearchOrderDetail(e, showGh)
}
},
{
label: '报案日期',
......@@ -66,7 +69,8 @@ export default {
dateType: 'datetime',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'afterTodayRangePickerOptions',
isDisabled
isDisabled,
isClear: true
},
{
label: '出险日期',
......@@ -75,27 +79,38 @@ export default {
dateType: 'datetime',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'afterTodayRangePickerOptions',
isDisabled
isDisabled,
isClear: true
},
{
label: '出险地点',
name: 'reimbursementAddress',
addHtml: 'citySelect',
isDisabled
type: 'cascader',
isDisabled,
isClear: true,
handleChange: cellValue => {
if (!cellValue || !cellValue.length) {
return
}
let nodesInfo = this.$refs.editFormRefReport.$refs.cascader[0].getCheckedNodes()[0].pathLabels
this.currentAddress = nodesInfo
}
},
{
label: '报案人',
name: 'reportName',
type: 'input',
maxlength: 100,
isDisabled
isDisabled,
isClear: true
},
{
label: '报案人联系号码',
name: 'reportPhone',
type: 'input',
maxlength: 11,
isDisabled
isDisabled,
isClear: true
}
]
const gh = [
......@@ -104,7 +119,11 @@ export default {
name: 'writeOffCode',
type: 'input',
maxlength: 8,
isDisabled
isDisabled,
isClear: true,
inputChange: e => {
this.toSearchOrderDetail(e, showGh)
}
},
{
label: '报案日期',
......@@ -113,7 +132,8 @@ export default {
dateType: 'datetime',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'afterTodayRangePickerOptions',
isDisabled
isDisabled,
isClear: true
},
{
label: '出险日期',
......@@ -122,30 +142,50 @@ export default {
dateType: 'datetime',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'afterTodayRangePickerOptions',
isDisabled
isDisabled,
isClear: true
},
{
label: '出险地点',
name: 'reimbursementAddress',
addHtml: 'citySelect',
isDisabled
type: 'cascader',
isDisabled,
isClear: true,
handleChange: cellValue => {
if (!cellValue || !cellValue.length) {
return
}
let nodesInfo = this.$refs.editFormRefReport.$refs.cascader[0].getCheckedNodes()[0].pathLabels
this.editForm.reimbursementAddress = nodesInfo.join('')
}
},
{
label: '报案人',
name: 'reportName',
type: 'input',
maxlength: 100,
isDisabled
isDisabled,
isClear: true
},
{
label: '报案人联系号码',
name: 'reportPhone',
type: 'input',
maxlength: 11,
isDisabled
isDisabled,
isClear: true
}
]
this.editFormData = showGh ? gh : dj
},
// 查询订单详情信息(嘀加:合同号,广汇:核销码)
toSearchOrderDetail(value, isGH) {
let param = {}
param.contractNo = value
if (isGH) {
param.writeOffCode = value
}
console.log(param)
}
}
}
......
......@@ -2,41 +2,27 @@
<template>
<div class="app">
<div class="header_btn_widget flex_sc">
<el-button size="small" type="primary" class="el-icon-plus">新增核赔</el-button>
<GLButton size="small" fn="订单详情" icon="el-icon-plus" type="primary" @click="handleEdit(1)">新增核赔</GLButton>
</div>
<div class="header_info_widget">
<span class="el-icon-warning"></span>
请注意:订单列表还有0单待提交国任,0单校验不通过退回处理,为保障客户权益,请尽快处理哦!
</div>
<div class="table_widget">
<GLTable ref="equityRef" :pageSizes="sizeList" :tableParams="tableParams" :pageConf="pageConf"></GLTable>
</div>
<!-- <div class="upload_widget">
<div class="safe-upload-panel" id="drop_area">
<div class="image-uploader">
<input type="file" style="opacity: 0" ref="file" accept="*" @change="changeInput" />
<div class="safe-upload-icon"><i class="el-icon-tickets"></i></div>
<GLTable ref="equityRef" :tableData="tableData" :tableTotal="tableTotal" :pageSizes="sizeList" :tableParams="tableParams" :pageConf="pageConf">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton v-if="[0].includes(scope.scope.serviceStatus)" fn="去处理" type="text" @click="handleEdit(4, scope.scope)">去处理</GLButton>
<GLButton v-if="[2, 3, 4].includes(scope.scope.serviceStatus)" fn="查看" type="text" @click="handleEdit(2, scope.scope)">查看</GLButton>
<GLButton v-if="[1].includes(scope.scope.serviceStatus)" fn="重新提交" type="text" @click="handleEdit(3, scope.scope)">重新提交</GLButton>
</div>
<div class="safe-upload-tips">点击或将文件拖拽到这里{{ importName ? '重新' : '' }}上传</div>
<div class="safe-upload-xl" v-if="importName">{{ importName }}</div>
<div class="safe-upload-xl">支持扩展名:.zip .rar</div>
</div>
<div class="safe-upload-footer">
<el-button type="primary" size="small" @click="handleSubmit">提交</el-button>
</div>
</div> -->
<!-- <div class="area_widget">
<city-select @onChange="handleChangeCity"></city-select>
</div> -->
</GLTable>
</div>
</div>
</template>
<script>
// import citySelect from './components/citySelect.vue'
import * as dayjs from 'dayjs'
export default {
name: 'index',
// components: {
// 'city-select': citySelect
// },
data() {
return {
sizeList: [5, 10, 20, 30, 40],
......@@ -47,128 +33,176 @@ export default {
tableColumns: [
{
label: '核销码',
prop: 'customerName'
prop: 'writeOffCode',
width: '90px',
formatter: cellValue => {
return cellValue.writeOffCode || '-'
}
},
{
label: '报案号',
prop: 'contractNo',
width: '200px'
prop: 'reportNo',
width: '200px',
formatter: cellValue => {
return cellValue.reportNo || '-'
}
},
{
label: '客户名',
label: '客户名称',
prop: 'customerName',
width: '200px'
width: '160px'
},
{
label: '合同号',
prop: 'contractNo',
width: '160px'
width: '160px',
formatter: cellValue => {
return cellValue.contractNo || '-'
}
},
{
label: '价格区间',
prop: 'merchantName',
width: '200px'
prop: 'pricePeriod',
width: '200px',
formatter: cellValue => {
return cellValue.pricePeriod || '-'
}
},
{
label: '门店提交时间',
prop: 'vehicleBrandName',
width: '160px'
prop: 'shopCreateDate',
width: '160px',
formatter: cellValue => {
return cellValue.shopCreateDate ? dayjs(cellValue.shopCreateDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '提交国任时间',
prop: 'vehicleSeriesName',
width: '200px'
prop: 'reportCreateDate',
width: '200px',
formatter: cellValue => {
return cellValue.reportCreateDate ? dayjs(cellValue.reportCreateDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '服务名称',
prop: 'vin'
prop: 'serviceName',
width: '300px'
},
{
label: '服务状态',
prop: 'customerPhone',
width: '160px'
prop: 'serviceStatus',
width: '160px',
formatter: cellValue => {
return this.serviceStatusType.map(item => item.confId).includes(cellValue.serviceStatus) ? this.serviceStatusType.find(item => item.confId == cellValue.serviceStatus).confName : '-'
}
},
{
label: '状态描述',
prop: 'packageName',
line: 1,
width: '200px'
prop: 'desc',
width: '200px',
formatter: cellValue => {
return cellValue.desc || '-'
}
},
{
label: '批准金额',
prop: 'actualSalesPrice',
width: '160px'
prop: 'money',
width: '160px',
formatter: cellValue => {
return cellValue.money ? (cellValue.money / 100).toFixed(2) : '-'
}
},
{
label: '支付金额',
prop: 'servicePeriod'
prop: 'payMoney',
formatter: cellValue => {
return cellValue.payMoney ? (cellValue.payMoney / 100).toFixed(2) : '-'
}
},
{
label: '操作',
prop: '',
width: '200px',
fixed: 'right',
addHtml: 'table-btns'
}
]
},
tableData: [],
serviceStatusType: [
{
confId: 0,
confName: '待提交国任'
},
{
confId: 1,
confName: '校验失败'
},
{
confId: 2,
confName: '待支付'
},
{
confId: 3,
confName: '支付成功'
},
{
confId: 4,
confName: '支付失败'
}
]
}
},
created() {
this.diffHost()
this.tableData = []
for (let i = 0; i < 5; i++) {
let obj = {
contractNo: '511013594067116032',
reportNo: '511013594067116032',
customerName: '王老吉',
pricePeriod: '20万-80万',
shopCreateDate: 1648708356000,
reportCreateDate: 1648708356000,
serviceName: '钥匙及车牌重置服务+车辆置换补偿服务',
serviceStatus: i,
desc: '处理成功',
money: 2000,
payMoney: 2000,
writeOffCode: '12345678'
}
this.tableData.push(obj)
}
this.tableTotal = this.tableData.length
},
created() {},
mounted() {
// this.handleUploadBefore()
},
methods: {
// 获取省市区编码 Array
handleChangeCity(value) {
this.cityCode = value
console.log(value)
// 从域名判断是不是广汇的
diffHost() {
let href = window.location.host
if (href.indexOf('cgacar') != -1) {
this.showGh = true
} else {
this.showGh = false
}
},
// 1.新增 2.查看 3.重新提交 4.去处理
handleEdit(editNo, row) {
let urlParam = {
editNo,
isGH: this.showGh,
contractNo: editNo == 1 ? -1 : row.contractNo // 嘀加的用合同号
}
if (this.showGh) {
// 广汇的用核销码
urlParam.contractNo = row.writeOffCode
}
const temp = encodeURIComponent(JSON.stringify(urlParam))
this.$router.push({ path: '/claims/order/' + temp })
}
// handleUploadBefore() {
// let _this = this
// var dropbox = document.getElementById('drop_area')
// dropbox.addEventListener('drop', this.enentDrop, false)
// dropbox.addEventListener('dragleave', function(e) {
// e.stopPropagation()
// e.preventDefault()
// _this.borderhover = false
// })
// dropbox.addEventListener('dragenter', function(e) {
// e.stopPropagation()
// e.preventDefault()
// _this.borderhover = true
// })
// dropbox.addEventListener('dragover', function(e) {
// e.stopPropagation()
// e.preventDefault()
// _this.borderhover = true
// })
// },
// changeInput(e) {
// this.uploadFile(e.target.files[0])
// },
// uploadFile(e) {
// let AllImgExt = '.zip|.rar'
// let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
// console.log(e)
// console.log(extName)
// if (AllImgExt.indexOf(extName) === -1) {
// this.$message.error('上传格式不正确')
// return false
// }
// const size = e.size / 1024 / 1024
// if (size < 9) {
// // // 转码base64
// const reader = new FileReader()
// reader.readAsDataURL(e)
// reader.onload = event => {
// const imgFile = event.target.result
// const arrBase64 = imgFile.split(',')
// const targetNameList = e.name.split('.')
// const fileInfo = targetNameList[targetNameList.length - 1] + '@' + arrBase64[1]
// this.$apis.common.uploadImg({ file: fileInfo }).then(res => {
// this.fileInfo = res
// this.importName = e.name
// this.$refs.file.value = ''
// })
// }
// } else {
// this.$message.error('上传文件不可超过9M')
// }
// }
}
}
</script>
......@@ -199,70 +233,4 @@ export default {
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
// .upload_widget {
// margin-top: 20px;
// .image-uploader {
// position: relative;
// height: 40px;
// display: flex;
// margin: 20px 0px;
// justify-content: center;
// input {
// cursor: pointer;
// position: absolute;
// top: 0px;
// width: 35px;
// height: 35px;
// font-size: 0px;
// }
// /deep/ {
// .el-upload-list {
// display: none;
// }
// }
// }
// .safe-upload-panel {
// margin: 20px auto;
// padding: 20px;
// box-sizing: border-box;
// width: 384px;
// height: 214px;
// background: rgba(0, 0, 0, 0.02);
// border-radius: 4px;
// border: 1px solid rgba(0, 0, 0, 0.15);
// text-align: center;
// .safe-upload-icon {
// i {
// font-size: 35px;
// color: #5850ff;
// }
// }
// .safe-upload-tips {
// font-size: 14px;
// font-weight: 400;
// color: rgba(0, 0, 0, 0.65);
// line-height: 22px;
// }
// .safe-upload-xl {
// font-size: 12px;
// font-weight: 400;
// color: rgba(0, 0, 0, 0.45);
// line-height: 20px;
// }
// .safe-upload-link {
// font-size: 14px;
// font-weight: 400;
// color: #5850ff;
// line-height: 22px;
// margin-top: 10px;
// cursor: pointer;
// }
// }
// .safe-upload-footer {
// width: 300px;
// display: flex;
// justify-content: center;
// margin: 0 auto;
// }
// }
</style>
......@@ -19,17 +19,32 @@ export default {
reimbursementDate: '',
reimbursementAddress: '',
reportName: '',
reportPhone: ''
reportPhone: '',
writeOffCode: ''
},
pageType: 'add'
pageType: 1
}
},
created() {},
created() {
const urlParam = this.$route.params
const urlQuery = JSON.parse(decodeURIComponent(urlParam.id))
this.pageType = urlQuery.editNo
this.routeInfo = urlQuery
this.handleFormInfo(urlQuery.contractNo, urlQuery.isGH)
},
mounted() {},
methods: {
// 处理表单数据
handlerForm() {
console.log(this.editForm)
},
// 根据页面跳转参数处理表单信息-自动填入
// 步骤流程:拿到核销码/者合同号后==》请求接口获取该合同号/核销码下对应的套餐,下发数据到维修信息模块,上传资料模块,报案信息模块
handleFormInfo(contractNo, isGH) {
if (isGH) {
this.editForm.writeOffCode = contractNo
}
this.editForm.contractNo = contractNo
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!