Commit d5f442b1 by 前端

Merge branch 'SAAS+V4.49-0121' into 'master'

上线合并

See merge request !82
2 parents 82a3402b 02eab0f5
...@@ -435,4 +435,49 @@ const getUpdateRecordApi = params => { ...@@ -435,4 +435,49 @@ const getUpdateRecordApi = params => {
}) })
} }
export default { getOrdersummary, getChannelTypeApi, getSummaryPackage, getSummaryExportApi, getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getNewPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo, activeCodeList, updateActiveCode, getUpdateRecordApi } // 获取批量新增任务列表
const getBatchTaskListApi = params => {
params.method = 'scrm.api.equity.order.common.config.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取新增任务详情列表
const getTaskDetailListApi = params => {
params.method = 'scrm.api.equity.order.common.config.detail'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 新建任务
const createBatchTaskApi = params => {
params.method = 'scrm.api.equity.order.common.config.import'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 下载错误数据
const exportErrorDataApi = params => {
params.method = 'scrm.api.equity.order.common.config.fail.export'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getOrdersummary, getChannelTypeApi, getSummaryPackage, getSummaryExportApi, getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getNewPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo, activeCodeList, updateActiveCode, getUpdateRecordApi, getBatchTaskListApi, getTaskDetailListApi, createBatchTaskApi, exportErrorDataApi}

9.2 KB | W: | H:

13.1 KB | W: | H:

src/assets/beforeSale/idCard.png
src/assets/beforeSale/idCard.png
src/assets/beforeSale/idCard.png
src/assets/beforeSale/idCard.png
  • 2-up
  • Swipe
  • Onion skin

9.07 KB | W: | H:

13 KB | W: | H:

src/assets/beforeSale/idCardBack.png
src/assets/beforeSale/idCardBack.png
src/assets/beforeSale/idCardBack.png
src/assets/beforeSale/idCardBack.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<div class="container">
<GLCombiForm ref="searchRef" :rowNumber="2" :formObj="searchForm" :formData="searchFormData" @handleOk="handleOk" @handleRest="handleRest">
<div slot="dateSlot">
<el-date-picker class="month-class" v-model="searchForm.taskMonth" type="month" placeholder="选择月份"></el-date-picker>
</div>
</GLCombiForm>
<div class="operate_wrap">
<span class="table_title">线下订单导入</span>
<div class="operate_btn">
<el-button :size="size" type="primary" @click="createTask()">新建任务</el-button>
</div>
</div>
<GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" :searchForm="realSearchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi">
<div slot="taskStatusSlot" slot-scope="scope">
<span class="status" :style="{ 'background-color': taskStatusEnum[scope.scope.taskStatus].color }"></span>
{{ taskStatusEnum[scope.scope.taskStatus] ? taskStatusEnum[scope.scope.taskStatus].label : '--' }}
</div>
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<GLDialog :title="uploadFormObj.id ? '导入' : '新建任务'" mode="mid" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" @onOk="onOk" @onCancel="handleClose" :close-on-click-modal="false">
<div class="dialog_wrap">
<glsx-combi-form :isInline="false" ref="uploadRef" defaultWidth="320px" :formObj.sync="uploadFormObj" :formData="uploadFormData" :formRules="uploadRules">
<div slot="dateSlot">
<el-date-picker class="task-input" v-model="uploadFormObj.taskMonth" type="month" placeholder="选择月份"></el-date-picker>
</div>
<div slot="taskSlot"><el-input class="task-input" v-model.trim="uploadFormObj.taskCount" placeholder="请输入任务数量" @input="taskCountInput" clearable /></div>
<div slot="instructionSlot"><el-input class="task-input" maxLength="20" v-model.trim="uploadFormObj.taskInstructions" placeholder="请输入任务说明" clearable></el-input></div>
<div slot="uploadSlot">
<el-button icon="el-icon-plus" :size="size" @click="upload">
上传文件
<input type="file" style="opacity: 0;width: 0;height: 0;" ref="file" accept=".xlsx" @change="uploadFile" />
</el-button>
<el-button v-if="!uploadFormObj.id" style="margin-left: 0;" type="text" @click="downloadTemplate">下载模板</el-button>
<img v-if="fileLoading" class="loading-img" :src="require('@/assets/loading.png')" alt="" />
<div class="file-wrap" v-if="uploadFormObj.fileName">
<div class="file-box" @click="toOpenPDF(uploadFormObj.fileUrl)">
<div class="info" v-if="uploadFormObj.fileName">
<span class="name">{{ uploadFormObj.fileName }}</span>
</div>
<div
class="process"
:style="{
width: uploadFormObj.fileUrl ? '320px' : (compress * 320) / 100 + 'px'
}"
></div>
</div>
<img v-if="uploadFormObj.fileUrl" class="del-btn" :src="require('@/assets/del.png')" alt="" @click="delFile()" />
</div>
</div>
</glsx-combi-form>
</div>
</GLDialog>
</div>
</template>
<script>
import util from '@/util/util'
import glsxCombiForm from '@/components/glsx-combi-form'
import dayjs from 'dayjs'
export default {
name: 'index',
components: {
glsxCombiForm
},
data() {
return {
size: 'small',
taskStatusEnum: {
0: {
label: '待执行',
color: '#C6C6C6'
},
1: {
label: '部分成功',
color: '#FDB757'
},
2: {
label: '全部成功',
color: '#2CCA74'
}
},
isVisible: false,
fileLoading: false,
uploadRules: {
taskMonth: [{ required: true, message: '请选择任务时间', trigger: 'change' }],
taskInstructions: [{ required: true, message: '请输入任务说明', trigger: 'change' }],
taskCount: [{ required: true, message: '请输入任务数量', trigger: 'change' }],
fileUrl: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
uploadFormObj: {
id: '',
fileUrl: '',
fileName: '',
taskCount: '',
taskMonth: '',
taskInstructions: ''
},
uploadFormData: [
{
label: '任务时间:',
name: 'taskMonth',
addHtml: 'dateSlot',
isHide: false
},
{
label: '任务说明:',
name: 'taskInstructions',
addHtml: 'instructionSlot',
isHide: false
},
{
label: '任务数量:',
name: 'taskCount',
addHtml: 'taskSlot'
},
{
label: '任务明细:',
name: 'fileUrl',
addHtml: 'uploadSlot',
isHide: false
}
],
buttonList: [
{
type: 'el-button',
name: row => {
return '详情'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.goDetailPage(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '导入'
},
condition: row => {
return [1].includes(row.scope.taskStatus)
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.createTask(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '下载错误数据'
},
condition: row => {
return [1].includes(row.scope.taskStatus)
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.downloadExcel(row.scope)
}
}
],
getListApi: this.$apis.beforeSale.getBatchTaskListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [10, 20, 30, 40, 50],
tableParams: {
listName: 'list',
tableOption: null,
tableColumns: [
{
label: '任务时间',
prop: 'taskMonth'
},
{
label: '任务数量',
prop: 'taskCount'
},
{
label: '任务说明',
prop: 'taskInstructions',
line: 1,
width: 200
},
{
label: '任务状态',
addHtml: 'taskStatusSlot'
},
{
label: '成功数',
prop: 'successCount'
},
{
label: '失败数',
prop: 'failCount'
},
{
label: '创建时间',
prop: 'createdDate',
width: 180,
formatter: cell => {
return util.dateFormat(cell.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
},
{
label: '更新时间',
prop: 'updatedDate',
width: 180,
formatter: cell => {
return util.dateFormat(cell.updatedDate, 'YYYY-MM-DD HH:mm:ss')
}
},
{
label: '操作人',
prop: 'updatedBy',
formatter: cell => {
return cell.updatedBy || cell.createdBy
}
},
{
label: '操作',
width: 210,
addHtml: 'table-btns'
}
]
},
realSearchForm: {},
searchForm: {
taskMonth: '',
taskStatus: '',
createDate: '',
upadteDate: ''
},
searchFormData: [
{
label: '任务时间',
name: 'taskMonth',
addHtml: 'dateSlot'
},
{
label: '任务状态',
name: 'taskStatus',
type: 'select',
optionList: [
{
id: '',
label: '全部'
},
{
id: 0,
label: '待执行'
},
{
id: 1,
label: '部分成功'
},
{
id: 2,
label: '全部成功'
}
],
optionId: 'id',
optionLabel: 'label'
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
isClear: true
},
{
label: '更新时间',
name: 'upadteDate',
type: 'datePicker',
isClear: true
}
]
}
},
methods: {
upload() {
this.$refs.file.click()
},
// 任务数量输入框
taskCountInput(e) {
e = e ? String(e) : ''
let value = e
value = e.replace(/[^\d]/g, '')
if (+e <= 0) {
value = ''
} else if (+e >= 10000) {
value = 10000
}
this.$set(this.uploadFormObj, 'taskCount', value)
},
// 下载导入模板
downloadTemplate() {
let res = 'https://qcimg01.glsx.com.cn/rpc-scrm-equity/upload/pdf/线下订单导入模板.xlsx'
let tempaa = util.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
},
//查询表格
handleOk() {
this.$refs.tableRef.refreshTable()
},
goDetailPage(row) {
this.$router.push(`/beforeSale/importDetail/${row.id}`)
},
downloadExcel(row) {
this.$apis.beforeSale.exportErrorDataApi({ taskId: row.id }).then(res => {
let tempaa = util.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
})
},
// 重置表格
handleRest() {
this.searchForm = {
taskMonth: '',
taskStatus: '',
createDate: '',
upadteDate: ''
}
this.realSearchForm = {}
this.handleOk()
},
getParams() {
let params = this.$common.utils.deepClone(this.searchForm)
if (params.createDate) {
params.createBeginDate = dayjs(this.searchForm.createDate[0]).format('YYYY-MM-DD') + ' 00:00:00'
params.createEndDate = dayjs(this.searchForm.createDate[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (params.upadteDate) {
params.updateBeginDate = dayjs(this.searchForm.upadteDate[0]).format('YYYY-MM-DD') + ' 00:00:00'
params.updateEndDate = dayjs(this.searchForm.upadteDate[1]).format('YYYY-MM-DD') + ' 23:59:59'
}
if (params.taskMonth) params.taskMonth = dayjs(params.taskMonth).format('YYYY-MM')
delete params.createDate
delete params.upadteDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.realSearchForm = this.getParams()
resolve()
})
},
// 上传excel
uploadFile(e) {
this.fileLoading = true
const file = e.srcElement.files[0]
let AllImgExt = '.xlsx' //文件格式判断
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt !== extName) {
this.$message.error('文件格式不正确')
this.$refs.file.value = ''
this.fileLoading = false
return false
}
this.uploadFormObj.fileName = file.name
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileName = file.name.split('.')
//fileUrl: 文件名 + @ + base64拼接
const fileUrl = fileName.pop() + '@' + arrBase64[1]
this.$apis.common
.pictureUpload({ file: fileUrl })
.then(res => {
if (res.data) {
this.uploadFormObj.fileUrl = res.data
this.$refs?.uploadRef?.$refs.formRef && this.$refs.uploadRef.$refs.formRef.clearValidate('fileUrl')
} else {
this.uploadFormObj.fileName = ''
}
})
.catch(err => {
this.uploadFormObj.fileName = ''
})
.finally(end => {
this.$refs.file.value = ''
this.fileLoading = false
})
}
},
createTask(row) {
if (row) {
this.uploadFormObj.id = row.id
}
this.uploadFormData.forEach(item => {
item.isHide = item.name != 'fileUrl' && row?.id
if (item.name == 'fileUrl') {
item.label = row?.id ? '导入明细' : '任务明细'
}
})
this.isVisible = true
this.$refs?.uploadRef?.$refs.formRef && this.$refs.uploadRef.$refs.formRef.clearValidate()
},
delFile() {
this.uploadFormObj.fileUrl = ''
this.uploadFormObj.fileName = ''
},
onOk() {
const { fileUrl, fileName } = this.uploadFormObj
if (fileName && !fileUrl) {
return this.$message({
message: `文件还在上传,请稍后再点击确定`,
type: `error`,
customClass: 'msgHierarchy'
})
}
this.$refs?.uploadRef?.$refs.formRef.validate(valid => {
if (valid) {
let baseInfo = window.sessionStorage.getItem('SCRM_BASE_SESSION') || '{}'
const { accountName } = JSON.parse(baseInfo) || {}
let { fileUrl, taskCount, taskMonth, id, taskInstructions } = this.uploadFormObj
taskMonth = dayjs(taskMonth).format('YYYY-MM')
let params = { fileUrl, taskCount, taskMonth, taskInstructions, createdBy: accountName }
if (id) {
delete params.taskCount
delete params.taskMonth
delete params.taskInstructions
params.taskId = id
}
this.$apis.beforeSale.createBatchTaskApi(params).then(res => {
if (res.code == '0') {
this.handleClose()
this.handleOk()
}
this.$message({
message: `${res.code == '0' ? '操作成功' : res.message}`,
type: `${res.code == '0' ? 'success' : 'error'}`,
customClass: 'msgHierarchy'
})
})
}
})
},
handleClose() {
this.isVisible = false
this.fileLoading = false
this.uploadFormObj = {
id: '',
fileUrl: '',
fileName: '',
taskCount: '',
taskMonth: ''
}
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #fff;
padding: 20px;
.dialog_wrap {
/deep/ .el-form-item__label {
width: 154px;
}
/deep/ .el-form-item__error {
margin-left: 154px;
}
/deep/ .task-input {
width: 284px;
}
.loading-img {
width: 24px;
height: 24px;
vertical-align: middle;
margin-left: 12px;
animation: rotate 2s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg); /* 动画开始时的旋转角度 */
}
to {
transform: rotate(360deg); /* 动画结束时的旋转角度 */
}
}
.file-wrap {
margin: 8px 0 0 154px;
display: flex;
align-items: center;
.file-box {
width: 320px;
height: 26px;
border-radius: 4px;
position: relative;
cursor: pointer;
.info {
height: inherit;
display: flex;
align-items: center;
margin-left: 8px;
position: relative;
z-index: 1;
.logo {
margin-right: 8px;
}
.name {
color: #1d1d1d;
font-size: 14px;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
.process {
position: absolute;
height: 26px;
left: 0;
top: 0;
background: #f4f6f7;
}
}
.del-btn {
width: 16px;
height: 16px;
cursor: pointer;
margin-left: 10px;
}
}
}
}
.status {
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
background-color: antiquewhite;
margin-right: 8px;
vertical-align: middle;
}
</style>
...@@ -198,7 +198,7 @@ export default { ...@@ -198,7 +198,7 @@ export default {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
.element_label { .element_label {
width: 154px; width: 164px;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-select> </el-select>
</template> </template>
<template slot="vehicleSeriesId" slot-scope="scope"> <template slot="vehicleSeriesId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSeriesId" class="m-r-10" placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width: 215px" :disabled="scope.scope.isDisabled"> <el-select v-model="editForm.vehicle.vehicleSeriesId" class="m-r-10" placeholder="请选择车系" @change="getCarTypeList(false)" style="width: 215px" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" /> <el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select> </el-select>
</template> </template>
...@@ -2327,11 +2327,9 @@ export default { ...@@ -2327,11 +2327,9 @@ export default {
// 获取车型 // 获取车型
getCarTypeList(isRecovery = false) { getCarTypeList(isRecovery = false) {
if (!isRecovery) { if (!isRecovery) {
// this.editForm.vehicle.vehicleShapeId = '' this.editForm.vehicle.vehicleShapeId = ''
this.baseData.carTypeOptions = [] this.baseData.carTypeOptions = []
} }
// 将车型清空
this.editForm.vehicle.vehicleShapeId = ''
const params = { const params = {
carSeriesId: this.editForm.vehicle.vehicleSeriesId carSeriesId: this.editForm.vehicle.vehicleSeriesId
} }
......
<template>
<div class="container">
<div class="global-title">任务详情</div>
<div class="main">
<GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi">
<div slot="taskStatusSlot" slot-scope="scope">
<span class="status" :style="{ 'background-color': detailTaskStatusEnum[scope.scope.taskStatus].color }"></span>
{{ detailTaskStatusEnum[scope.scope.taskStatus] ? detailTaskStatusEnum[scope.scope.taskStatus].label : '--' }}
</div>
</GLTable>
</div>
</div>
</template>
<script>
export default {
name: 'index',
data() {
return {
size: 'small',
detailTaskStatusEnum: {
0: {
label: '待执行',
color: '#C6C6C6'
},
2: {
label: '失败',
color: '#EB4E4E'
},
1: {
label: '成功',
color: '#2CCA74'
}
},
getListApi: this.$apis.beforeSale.getTaskDetailListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [10, 20, 30, 40, 50],
searchForm: {},
tableParams: {
listName: 'list',
tableOption: null,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName',
width: 260,
line: 1
},
{
label: '客户名称',
prop: 'customerName',
width: 200
},
{
label: '车架号',
prop: 'vin',
width: 240,
line: 1
},
{
label: '产品名称',
prop: 'packageName',
width: 280,
line: 1
},
{
label: '服务期限',
prop: 'servicePeriod',
formatter: cell => {
return cell.servicePeriod ? cell.servicePeriod + '年' : '--'
}
},
{
label: '任务状态',
addHtml: 'taskStatusSlot'
},
{
label: '任务状态描述',
prop: 'failReason',
width: 280,
line: 1
}
]
}
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = { taskId: this.$route.params.id }
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #fff;
.main {
padding: 20px;
}
}
.status {
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
background-color: antiquewhite;
margin-right: 8px;
vertical-align: middle;
}
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="widget"> <div class="widget">
<uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0001')" title="购车发票" limitNum="1" :imagesList="uploadMessage.buyCar"></uploadHandler> <uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0001')" title="购车发票" limitNum="1" :imagesList="uploadMessage.buyCar"></uploadHandler>
<uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0002')" title="合同购买时里程数" limitNum="1" :imagesList="uploadMessage.mileage"></uploadHandler> <uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0002')" title="合同购买时里程数" limitNum="1" :imagesList="uploadMessage.mileage"></uploadHandler>
<uploadHandler :isRequire="true" :disabled="disabled" @getCardImg="getCardImg" uploadType="1" title="行驶证" :cardImg="cardImg"></uploadHandler> <uploadHandler :isRequire="true" :disabled="disabled" @getCardImg="getCardImg" uploadType="1" title="行驶证或车辆合格证" :cardImg="cardImg"></uploadHandler>
<uploadHandler :disabled="disabled" @getImages="getImages($event, 'YB0005')" title="其他" limitNum="9" :imagesList="uploadMessage.others"></uploadHandler> <uploadHandler :disabled="disabled" @getImages="getImages($event, 'YB0005')" title="其他" limitNum="9" :imagesList="uploadMessage.others"></uploadHandler>
</div> </div>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!