Commit c7ffd792 by 杨北旺

Merge branch 'master' of 192.168.3.233:saas/scrm-micro-services

2 parents 9feeea0f 08d68ed9
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
}, },
"dependencies": { "dependencies": {
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
......
import { http } from '@/main'
const defaultPath = 'scrm.api.equity.service.package.'
const getListApi = params => {
params.method = `${defaultPath}order.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
const getExportApi = params => {
params.method = `${defaultPath}order.export.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getListApi, getExportApi }
...@@ -142,103 +142,3 @@ ...@@ -142,103 +142,3 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
\ No newline at end of file \ No newline at end of file
// .live-room .container {
// background: #FFFFFF;
// margin: 20px 40px;
// padding: 15px 20px;
// box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
// }
// .el-scrollbar__bar.is-horizontal{
// height: 10px !important;
// left: 10px;
// }
// .base-container-right .el-main-scroll .el-scrollbar__thumb {
// background-color: rgba(144, 147, 153, 0.5) !important;
// }
// .live-room .el-table .cell {
// line-height: 16px;
// }
// .live-room .table-btns .el-button {
// padding: 0 0 0 5px;
// margin-left: 5px;
// border-left: 1px solid #DCDFE6;
// border-radius: 0;
// }
// .live-room .table-btns .el-button:first-child {
// padding: 0;
// border: 0;
// }
// .live-room .img-60 {
// width: 60px;
// height: 60px;
// }
// .live-room .edit-container {
// margin: 20px 40px 84px;
// }
// .live-room .footer {
// position: absolute;
// bottom: 0;
// width: 100%;
// height: 64px;
// text-align: center;
// line-height: 64px;
// background: #FFFFFF;
// z-index: 999;
// }
// .live-room .flex {
// display: flex;
// justify-content: space-between;
// }
// .live-room .edit-title {
// font-size: 16px;
// font-weight: bold;
// height: 48px;
// line-height: 48px;
// // color: #0947C6;
// border-bottom: 1px solid #E7EAEC;
// // padding-left: 20px;
// margin: 0 0;
// }
// .live-room .edit-sub-title::before {
// position: absolute;
// display: inline-block;
// content: '';
// height: 18px;
// width: 4px;
// top: 2px;
// left: 0;
// background-color: #0947C6;
// }
// .live-room .edit-sub-title {
// position: relative;
// font-size: 16px;
// font-weight: 700;
// color: #333333;
// margin: 0 0 30px 0;
// padding-left: 8px;
// }
// .live-room table {
// width: 98%;
// color: #666666;
// border: 1px solid #e5e6e7;
// border-width: 1px 0 0 1px;
// }
// .live-room table tr {
// height: 30px;
// // line-height: 30px;
// }
// .live-room table th,
// .live-room table td {
// font-size: 12px;
// font-weight: normal;
// padding: 0px 10px;
// border: 1px solid #e5e6e7;
// border-width: 0px 1px 1px 0px;
// border-spacing: 0;
// text-align: center;
// vertical-align: middle;
// }
// .live-room table td {
// min-width: 50px;
// }
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="glsx-combi-form"> <div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="small" class="glsx-combi-form-block"> <el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData"> <template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :class="{ 'no-label': !item.label, isBlock: isBlock }" :label="item.label ? item.label + ':' : ''" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :id="item.name" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ ...item.style }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label"> <span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span> <span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'"> <el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'"> <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'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"></el-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)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- 选择-输入框 --> <!-- 选择-输入框 -->
...@@ -41,7 +44,7 @@ ...@@ -41,7 +44,7 @@
</template> </template>
<!-- 选择框 --> <!-- 选择框 -->
<div v-else-if="item.type === 'select'"> <div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || '100%' }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option> <el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select> </el-select>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
...@@ -50,35 +53,38 @@ ...@@ -50,35 +53,38 @@
<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'" 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'" :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>
<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"> <div v-if="!item.isDisabled" :style="{ width: item.width || '100%' }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div> <div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span> <span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)" /> <input v-if="item.uploadType == 'video'" type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div> </div>
</div> </div>
<template> <template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])"> <span v-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h"> <span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h">
<img class="img-w-h" :src="subItem.content" /> <video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns"> <span class="img-btns">
<span class="btn-item"> <span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i> <i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(subItem.content)"></i> <i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
</span> </span>
</span> </span>
</span> </span>
</span> </span>
<span v-else class="muti-imgs"> <span v-else class="muti-imgs">
<img class="img-w-h" :src="formObj[item.name]" /> <video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :src="formObj[item.name]" />
<span class="img-btns"> <span class="img-btns">
<span class="btn-item"> <span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i> <i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name])"></i> <i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
</span> </span>
</span> </span>
</span> </span>
...@@ -89,8 +95,11 @@ ...@@ -89,8 +95,11 @@
</template> </template>
<slot name="footer"></slot> <slot name="footer"></slot>
</el-form> </el-form>
<el-dialog :visible.sync="isImgVisible"> <el-dialog :visible.sync="isImgVisible" class="dialog-look">
<img class="dialog-img" width="100%" :src="dialogImageUrl" alt="" /> <video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -106,7 +115,10 @@ export default { ...@@ -106,7 +115,10 @@ export default {
afterRangePickerOptions: afterRangePickerOptions afterRangePickerOptions: afterRangePickerOptions
}, },
isImgVisible: false, isImgVisible: false,
dialogImageUrl: '' dialogObj: {
url: '',
uploadType: 'img'
}
} }
}, },
...@@ -115,6 +127,10 @@ export default { ...@@ -115,6 +127,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
defaultWidth: {
type: String,
default: '220px'
},
formRef: { formRef: {
type: String, type: String,
default: 'formRef' default: 'formRef'
...@@ -159,43 +175,47 @@ export default { ...@@ -159,43 +175,47 @@ export default {
} }
}, },
// 图片 // 图片
handleImgChange(e, targetItem) { handleUploadChange(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img'
// console.log(file) // console.log(file)
// 默认1MB // 默认1MB
const limitSize = targetItem.limitSize || 1 const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
const isType = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type) const isType = uploadType == 'img' ? ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type) : ['video/mp4'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1 const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300 const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300 const heightLt = targetItem.heightLt || 300
if (maxPhotoNum == this.formObj[targetItem.name].length) { if (maxPhotoNum == this.formObj[targetItem.name].length) {
this.$message.error('只能上传' + maxPhotoNum + '张图片') this.$message.error('只能上传' + maxPhotoNum + (uploadType == 'img' ? '张图片' : '个视频'))
return true return true
} }
if (!isType) { if (!isType) {
this.$message.error('上传图片不是jpg、jpeg或png的格式!') this.$message.error(uploadType == 'img' ? '上传图片不是jpg、jpeg或png的格式!' : '上传视频不是MP4的格式!')
return true return true
} }
if (!isLt) { if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!') this.$message.error('上传' + (uploadType == 'img' ? '图片' : '视频') + '大小不能超过' + limitSize + 'MB!')
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
if (uploadType == 'img') {
var image = new Image() var image = new Image()
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
var imgWidth = image.width var imgWidth = image.width
var imgHeight = image.height var imgHeight = image.height
if (!targetItem.noPixel && ( imgWidth > wdithLt || imgHeight > heightLt)) { if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素') this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else { } else {
targetItem.handleUpload(e, file, targetItem) targetItem.handleUpload(e, file, targetItem)
// this.$emit('handleUpload', { e: e, file: file, targetItem: targetItem })
} }
} }
} else {
targetItem.handleUpload(e, file, targetItem)
}
} }
}, },
// 图片删除 // 图片删除
...@@ -204,9 +224,12 @@ export default { ...@@ -204,9 +224,12 @@ export default {
this.$emit('handleImgDelete', targetItem) this.$emit('handleImgDelete', targetItem)
}, },
// 图片查看 // 图片查看
handleImgLook(src) { handleImgLook(src, targetItem) {
this.isImgVisible = true this.isImgVisible = true
this.dialogImageUrl = src this.dialogObj = {
url: src,
uploadType: targetItem.uploadType || 'img'
}
} }
} }
} }
...@@ -219,7 +242,7 @@ export default { ...@@ -219,7 +242,7 @@ export default {
padding: 16px 40px 0; padding: 16px 40px 0;
} */ } */
.glsx-combi-form .isBlock { .glsx-combi-form .isBlock {
display: block; display: block !important;
} }
/* .glsx-combi-form .el-form-item { /* .glsx-combi-form .el-form-item {
width: 65%; width: 65%;
...@@ -363,5 +386,14 @@ export default { ...@@ -363,5 +386,14 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.glsx-combi-form .dialog-look {
text-align: center;
}
.glsx-combi-form .dialog-video {
width: 50%;
height: 50%;
}
/* 图片上传 */ /* 图片上传 */
</style> </style>
...@@ -18,5 +18,11 @@ const staticRoutes = Object.freeze([{ ...@@ -18,5 +18,11 @@ const staticRoutes = Object.freeze([{
path: '/inSale/accountRules', path: '/inSale/accountRules',
component: resolve => require([`@/views/inSale/accountRules.vue`], resolve), component: resolve => require([`@/views/inSale/accountRules.vue`], resolve),
meta: {} meta: {}
}, ]) },
{
name: 'beforeSale',
path: '/beforeSale/saleList',
component: resolve => require([`@/views/beforeSale/index.vue`], resolve),
meta: {}
} ])
export default staticRoutes export default staticRoutes
<!-- 权益订单列表 -->
<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: 'beforeSale',
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: '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: {
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('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + 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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!