Commit f188122e by 张立顺

feat 批量导入功能开发

1 parent a26961c6
import request from "./request"
const path = "dj.api.quotation.smartcarlife."
const path2 = "dj.api.smartcarlife.vd.orders."
// 分页列表
export function getList(data) {
data.method = `${path}quotation.page`
......@@ -43,3 +43,47 @@ export function quotationFindById(data) {
data.method = `dj.api.quotation.smartcarlife.quotation.detail`
return request(data)
}
// 车损报价单导入任务错误订单异步导出
export function ordersExportAsync(data) {
data.method = `${path2}import.error.orders.export.async`
return request(data)
}
// 导入任务列表分页查询
export function importTaskPage(data) {
data.method = `${path2}import.task.page`
return request(data)
}
// 任务订单详情列表分页查询
export function importTaskOrderDetailPage(data) {
data.method = `${path2}import.task.order.detail.page`
return request(data)
}
// 门店列表查询
export function importMerchantList(data) {
data.method = `${path2}import.merchant.list`
return request(data)
}
// 车损报价单导入(错误数据重新导入)
export function reimportData(data) {
data.method = `${path2}reimport.data`
return request(data, "post", ["file"])
// return request(data)
}
// 车损报价单导入模板异步导出
export function importTemplateExportAsync(data) {
data.method = `${path2}import.template.export.async`
return request(data)
}
// 车损报价单导入
export function importData(data) {
data.method = `${path2}import.data`
return request(data, "post", ["file"])
// return request(data)
}
export const taskStatusList = [
// 1-失败,0-待执行,1-部分成功,2-全部成功
{
id: "-1",
label: "失败"
},
{
id: "0",
label: "执行中"
},
{
id: "1",
label: "部分成功"
},
{
id: "2",
label: "全部成功"
}
]
export const checkStatusList = [
// -1-失败,0-待执行,1-部分上架,2-全部上架
{
id: "-1",
label: "失败"
},
{
id: "0",
label: "执行中"
},
{
id: "1",
label: "部分上架"
},
{
id: "2",
label: "全部上架"
}
]
export const taskOrderStatusList = [
// -1-导入失败,0-待导入,1-导入失败,2-导入成功
{
id: "-1",
label: "导入失败"
},
{
id: "0",
label: "待导入"
},
{
id: "1",
label: "导入失败"
},
{
id: "2",
label: "导入成功"
}
]
......@@ -12,17 +12,20 @@
@selection-change="handleSelect"
:tree-props="{ children: 'upgradeGoodsList' }"
:span-method="arraySpanMethod"
v-bind="$attrs">
v-bind="$attrs"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection"
align="center"
:selectable="selectableFn"
width="55" />
width="55"
/>
<el-table-column
v-if="tableParams.singleSelectUniqueKey"
align="center"
width="55">
width="55"
>
<template slot-scope="scope">
<slot name="single-button" :scope="scope.row" />
</template>
......@@ -40,9 +43,10 @@
? pagination.currentPage
: page.currentPage) -
1) *
(pagination.pageSize ? pagination.pageSize : page.pageSize) +
(pagination.pageSize ? pagination.pageSize : page.pageSize) +
1
" />
"
/>
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
:key="index"
......@@ -53,7 +57,8 @@
:align="item.align || 'center'"
:sortable="item.sortable"
:render-header="item.renderHeader"
:show-overflow-tooltip="item.showOverFlow">
:show-overflow-tooltip="item.showOverFlow"
>
<template slot="header">
<span>{{ item.label }}</span>
<table-head-search
......@@ -61,7 +66,8 @@
:search-form="headSearchForm"
:option-config="item.optionConfig"
:base-data="baseData"
@handleTableHeadChange="handleTableHeadChange" />
@handleTableHeadChange="handleTableHeadChange"
/>
</template>
<template slot-scope="scope">
<slot
......@@ -70,7 +76,8 @@
:scope="scope.row"
:index="scope.$index"
:prop="item.prop"
:width="item.width" />
:width="item.width"
/>
<template v-else-if="item.type == 'ownSerialNum'">
<span>{{
scope.row[item.prop] >= 0
......@@ -79,9 +86,9 @@
? pagination.currentPage
: page.currentPage) -
1) *
(pagination.pageSize
? pagination.pageSize
: page.pageSize) +
(pagination.pageSize
? pagination.pageSize
: page.pageSize) +
1
: ""
}}</span>
......@@ -90,11 +97,13 @@
<el-tag
v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]" />
v-text="tableParams.tag.label[scope.row[item.prop]]"
/>
<el-tag
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]" />
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
/>
</template>
<template v-else-if="item.formatter">
<span v-if="item.html" v-html="item.formatter(scope.row)" />
......@@ -125,13 +134,15 @@
label="操作"
fixed="right"
:align="tableParams.tableOption.align || 'center'"
:width="tableParams.tableOption.width || 'auto'">
:width="tableParams.tableOption.width || 'auto'"
>
<template slot-scope="scope">
<slot name="auth-button" :scope="scope.row" :index="scope.$index" />
<slot
name="auth-button-other"
:scope="scope.row"
:index="scope.$index" />
:index="scope.$index"
/>
</template>
</el-table-column>
</el-table>
......@@ -144,7 +155,8 @@
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
:layout="layout" />
:layout="layout"
/>
</div>
</template>
......@@ -508,4 +520,8 @@ export default {
@include spotBase();
background: #5850ff;
}
.deepBlueSpot {
@include spotBase();
background: #185efe;
}
</style>
......@@ -205,8 +205,10 @@ export const routerName = {
component: _import("orderManage/carDamageDetail")
},
90406: {
path: "/vehicleDamageList",
name: "vehicleDamageList",
path: "/vehicleDamageTabList",
name: "vehicleDamageTabList",
// path: "/vehicleDamageList",
// name: "vehicleDamageList",
meta: {
title: "车损报价单",
authId: "90406",
......@@ -252,9 +254,51 @@ export const routerName = {
parentId: "90406",
label: "打印合同",
handle: "handlePrintContract"
},
{
authId: "9040606",
parentId: "90406",
label: "新建任务",
category: "Button",
type: "primary",
handle: "newTask"
},
{
authId: "9040607",
parentId: "90406",
label: "下载模板",
category: "Button",
type: "primary",
handle: "downloadTemplate"
},
{
authId: "9040608",
parentId: "90406",
label: "详情",
addRoutePath: [
{
authId: "9040611",
name: "vehicleDamageOderImportDetail",
parentId: "90406"
}
],
handle: "viewDetail"
},
{
authId: "9040609",
parentId: "90406",
label: "导入",
// handle: "importCurrentData"
handle: "handleImportRest"
},
{
authId: "90406010",
parentId: "90406",
label: "下载错误数据",
handle: "downloadIncorrectData"
}
],
component: _import("vehicleDamage/vehicleDamageList")
component: _import("vehicleDamage/vehicleDamageTabList")
},
9040604: {
path: "/vehicleDamageDetail",
......@@ -268,6 +312,18 @@ export const routerName = {
},
component: _import("vehicleDamage/vehicleDamageDetail")
},
9040611: {
path: "/vehicleDamageOderImportDetail",
name: "vehicleDamageOderImportDetail",
meta: {
title: "详情",
authId: "9040611",
parentId: "90406",
cache: false,
activePath: "/vehicleDamageOderImportDetail"
},
component: _import("vehicleDamage/vehicleDamageOderImportDetail")
},
90407: {
path: "/configUpgradationDetail",
name: "configUpgradationDetail",
......
......@@ -11,8 +11,10 @@ export const routerName = {
}
},
91101: {
path: "/vehicleDamageList",
name: "vehicleDamageList",
path: "/vehicleDamageTabList",
// path: "/vehicleDamageList",
// name: "vehicleDamageList",
name: "vehicleDamageTabList",
meta: {
title: "车损报价单",
authId: "91101",
......
<!-- 车损报价单 -->
<template>
<div>
<d2-container>
<div class="header"
slot="header"
style="padding: 10px 20px">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData" />
<d2-container class="m-t-40">
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset"> 重置 </el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<el-button class="default-blue-btn"
plain
@click="handleExport"
size="small">导出</el-button>
<el-button
class="default-blue-btn"
plain
@click="handleExport"
size="small"
>导出</el-button
>
</d2-table-header>
<d2-table ref="damageTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<div slot-scope="scope"
slot="auth-button"
class="btnClass">
<d2-table
ref="damageTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot-scope="scope" slot="auth-button" class="btnClass">
<!-- 查看 -->
<!-- <auth-button
v-if="[1, 2, 3, -1, 5].includes(scope.scope.orderStatus) || [2].includes(scope.scope.equityOrderStatus)"
:show-btn-ids="['9040601']" :data="scope.scope" /> -->
<!-- 打印报价单 -->
<auth-button v-if="[1, 2, 3, -1, 5].includes(scope.scope.orderStatus) || [2].includes(scope.scope.equityOrderStatus)"
:show-btn-ids="['9040603']"
:data="scope.scope" />
<auth-button
v-if="
[1, 2, 3, -1, 5].includes(scope.scope.orderStatus) ||
[2].includes(scope.scope.equityOrderStatus)
"
:show-btn-ids="['9040603']"
:data="scope.scope"
/>
<!-- 打印合同 -->
<auth-button v-if="[2].includes(scope.scope.equityOrderStatus) && [3, 5].includes(scope.scope.orderStatus)"
:show-btn-ids="['9040605']"
:data="scope.scope" />
<auth-button :show-btn-ids="['9040602']"
:data="scope.scope" />
<auth-button
v-if="
[2].includes(scope.scope.equityOrderStatus) &&
[3, 5].includes(scope.scope.orderStatus)
"
:show-btn-ids="['9040605']"
:data="scope.scope"
/>
<auth-button :show-btn-ids="['9040602']" :data="scope.scope" />
</div>
</d2-table>
</div>
</d2-container>
<baseDialog :is-show.sync="previewVisible"
:dialog-config="dialogConfig.config"
:config="dialogConfig.setting">
<div class="previewItem"
v-for="(item, index) in previewList"
:key="index">
<baseDialog
:is-show.sync="previewVisible"
:dialog-config="dialogConfig.config"
:config="dialogConfig.setting"
>
<div
class="previewItem"
v-for="(item, index) in previewList"
:key="index"
>
<span v-if="!item.goodName">合同{{ index + 1 }}</span>
<span class="goodName one-line-ellipsis"
v-else>合同名称: {{ item.goodName }}</span>
<i class="el-icon-download downloadIcon"
@click="exportFile({ contractNo: item.contractNo })"></i>
<span class="goodName one-line-ellipsis" v-else
>合同名称: {{ item.goodName }}</span
>
<i
class="el-icon-download downloadIcon"
@click="exportFile({ contractNo: item.contractNo })"
></i>
</div>
</baseDialog>
<!-- 查看 -->
......@@ -79,7 +94,13 @@
<script>
import { mapActions, mapState } from "vuex"
import { getList, quotationPrint, quotationExport, contractExport, listContracts } from "@api/vehicleDamage"
import {
getList,
quotationPrint,
quotationExport,
contractExport,
listContracts
} from "@api/vehicleDamage"
export default {
name: "VehicleDamageList",
data() {
......@@ -138,7 +159,7 @@ export default {
getListApi: getList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
listName: "list",
tableOption: true,
tableColumns: [
{
......@@ -155,8 +176,8 @@ export default {
label: "客户来源",
prop: "salesType",
width: "100px",
formatter:(cellValue)=>{
return cellValue.salesType==1?'售后':'售前'
formatter: (cellValue) => {
return cellValue.salesType == 1 ? "售后" : "售前"
}
},
{
......@@ -180,8 +201,8 @@ export default {
.map((item) => item.severType)
.includes(cellValue.orderStatus)
? this.baseData.severTypeList.find(
(item) => item.severType === cellValue.orderStatus
).severName
(item) => item.severType === cellValue.orderStatus
).severName
: "-"
}
}
......@@ -202,7 +223,11 @@ export default {
if (cellValue.vdQuotationGoodsList) {
return cellValue.vdQuotationGoodsList.reduce(
(merchString, item) => {
merchString = merchString + (item.packageName ? `<p>${item.packageName}</p>` : `<p>-</p>`)
merchString =
merchString +
(item.packageName
? `<p>${item.packageName}</p>`
: `<p>-</p>`)
return merchString
},
""
......@@ -225,7 +250,11 @@ export default {
if (cellValue.vdQuotationGoodsList) {
return cellValue.vdQuotationGoodsList.reduce(
(merchString, item) => {
merchString = merchString + (item.goodsName ? `<p>${item.goodsName}</p>` : `<p>-</p>`)
merchString =
merchString +
(item.goodsName
? `<p>${item.goodsName}</p>`
: `<p>-</p>`)
return merchString
},
""
......@@ -248,7 +277,11 @@ export default {
if (cellValue.vdQuotationGoodsList) {
return cellValue.vdQuotationGoodsList.reduce(
(merchString, item) => {
merchString = merchString + (item.goodsNameAlias ? `<p>${item.goodsNameAlias}</p>` : `<p>-</p>`)
merchString =
merchString +
(item.goodsNameAlias
? `<p>${item.goodsNameAlias}</p>`
: `<p>-</p>`)
return merchString
},
""
......@@ -264,7 +297,9 @@ export default {
prop: "quotedPrice",
width: "200px",
formatter: (cellValue) => {
return cellValue.quotedPrice ? (cellValue.quotedPrice / 100).toFixed(2) : "-"
return cellValue.quotedPrice
? (cellValue.quotedPrice / 100).toFixed(2)
: "-"
}
},
{
......@@ -272,7 +307,9 @@ export default {
prop: "estEquityPrice",
width: "250px",
formatter: (cellValue) => {
return cellValue.estEquityPrice ? (cellValue.estEquityPrice / 100).toFixed(2) : "-"
return cellValue.estEquityPrice
? (cellValue.estEquityPrice / 100).toFixed(2)
: "-"
}
},
{
......@@ -281,7 +318,9 @@ export default {
prop: "quotedPriceUpdate",
width: "250px",
formatter: (cellValue) => {
return !isNaN(cellValue.quotedPriceUpdate) ? (cellValue.quotedPriceUpdate / 100).toFixed(2) : "-"
return !isNaN(cellValue.quotedPriceUpdate)
? (cellValue.quotedPriceUpdate / 100).toFixed(2)
: "-"
}
},
{
......@@ -312,8 +351,8 @@ export default {
// appendToBody: true,
},
config: {
title: '打印合同',
width: '480px'
title: "打印合同",
width: "480px"
}
},
previewList: [],
......@@ -364,7 +403,7 @@ export default {
// 打印权益合同
async handlePrintContract(row) {
const res = await listContracts({ orderId: row.orderId })
console.log(res, 'res')
console.log(res, "res")
if (res.length == 1) {
// 获取权益合同PDF 用订单号
// this.exportFile({ orderId: row.orderId })
......@@ -409,7 +448,7 @@ export default {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
......@@ -463,7 +502,7 @@ export default {
handleView(row) {
this.close({ tagName: "/vehicleDamageDetail" })
this.$router.push({
name: 'vehicleDamageDetail',
name: "vehicleDamageDetail",
params: {
detail: row
}
......@@ -513,4 +552,8 @@ export default {
margin-left: 10px;
color: #185efe;
}
.m-t-40 {
margin-top: 40px;
}
</style>
<!-- 车损报价单 -->
<template>
<d2-container class="m-t-40 d2-con">
<div class="header" slot="header"></div>
<div class="d2-container-content">
<d2-table
ref="damageTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
>
</d2-table>
</div>
</d2-container>
</template>
<script>
import { taskOrderStatusList } from "@/common/constant/vehicle"
import { Util, deepClone } from "@/common/util"
import { importTaskOrderDetailPage } from "@api/vehicleDamage"
export default {
name: "VehicleDamageList",
data() {
return {
getListApi: importTaskOrderDetailPage,
searchFormSearch: {
taskId: ""
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "门店名称",
prop: "merchantName4s"
// width: "160px"
},
{
label: "客户姓名",
prop: "customerName"
// width: "250px"
},
{
label: "支付时间",
prop: "payTime",
// width: "100px",
formatter: (cellValue) => {
return Util.dateFormate(cellValue.payTime, "YYYY-MM-DD HH:mm:ss")
}
},
{
label: "交易参考号",
prop: "transactionNo",
width: "250px"
},
{
label: "单价",
prop: "goodsPrice"
},
{
label: "总价",
prop: "goodsTotalPrice"
},
{
label: "任务状态",
prop: "taskOrderStatus",
formatter: (cellValue) => {
return (
taskOrderStatusList.find(
(item) => item.id == cellValue.taskOrderStatus
)?.label || "-"
)
},
className: (cellValue) => {
return (
{
"-1": "redSpot",
0: "yellowSpot",
1: "deepBlueSpot",
2: "greenSpot"
}[cellValue.taskOrderStatus] || "ashSpot"
)
}
},
{
label: "任务状态描述",
prop: "errorMsg"
}
]
}
}
},
computed: {
taskId() {
return this.$route.query.taskId
}
},
mounted() {
this.searchFormSearch.taskId = this.taskId
// this.
},
methods: {
handleDetail(row) {
quotationPrint({ id: row.id }).then((res) => {
window.open(res)
})
}
}
}
</script>
<style scoped lang="scss">
.d2-con {
.d2-header-switch {
display: none;
}
}
</style>
<template>
<div class="order-list-wrap">
<div class="header" slot="header" style="background: #e7eaec">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index"
>
</el-tab-pane>
</el-tabs>
<components :is="tabName"></components>
</div>
</div>
</template>
<script>
import vehicleDamageList from "./vehicleDamageList.vue"
import vehicleDamageOderImport from "./vehicleDamageOderImport.vue"
// import carDamage from "./carDamage.vue"
// import configUpgradation from "./configUpgradation.vue"
// import integralShopping from "./integralShopping.vue"
export default {
name: "OrderList",
components: {
vehicleDamageList,
vehicleDamageOderImport
// carDamage,
// configUpgradation,
// integralShopping
},
data() {
return {
activeName: "2",
tabPaneList: [
{
label: "车损报价单",
name: "1"
},
{
label: "导入订单",
name: "2"
}
],
// tabName: "vehicleDamageList"
tabName: "vehicleDamageOderImport"
}
},
mounted() {},
watch: {},
methods: {
handleClick() {
const arr = {
1: "vehicleDamageList",
2: "vehicleDamageOderImport"
}
this.tabName = arr[+this.activeName]
}
}
}
</script>
<style lang="scss" scoped>
.order-list-wrap {
padding: 0 24px;
.header {
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!