Commit 22b4247b by 李伟康

车损升级

1 parent 3a2da5db
......@@ -137,4 +137,5 @@ const getOrderDetailApi = params => {
})
}
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi, getCrowdfundingParams, getCountApi, orderExportApi, getOrderDetailApi }
......@@ -181,6 +181,11 @@ function getExplorer() {
}
return browserType
}
// 园区店模式/经营模式
export const manageTypeList = [
{ confId: 0, confLabel: "园区店" },
{ confId: 1, confLabel: "驻店" }
]
function exportFn(url) {
let browserType = getExplorer()
......
<template>
<div>
恒河猴
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'carDamageDetail',
data () {
return {
}
},
mounted () {
const params = this.$route
console.log(params)
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file
<!-- 精品升级订单 -->
<template>
<div class="purchase">
<div class="container">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="showFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="table-header">
<span class="priceSpan">累计订单金额:¥{{ totalCount }}元</span>
<el-button
type="primary"
class="btn"
size="small"
@click="exportExcel"
>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable
ref="orderRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<template
slot="carTypeName"
slot-scope="scope"
>
<span v-show="scope.scope.carBrand">{{ scope.scope.carBrand }}</span>
<span v-show="scope.scope.carChildsBrandName">-{{ scope.scope.carChildsBrandName }}</span>
<span v-show="scope.scope.carSeriesName">-{{ scope.scope.carSeriesName }}</span>
</template>
<template
slot="upgradeGoodsNames"
slot-scope="scope"
>
<span
v-for="(item, index) in scope.scope.subOrderList"
:key="index"
>
<p v-if="item.upgradeGoodsId">{{ item.upgradeGoodsName }}</p>
<p v-else>{{ item.baseGoodsName }}</p>
</span>
</template>
<template
slot="upgradeGoodsAlias"
slot-scope="scope"
>
<span
v-for="(item, index) in scope.scope.subOrderList"
:key="index"
>
<p>{{ item.upgradeGoodsAlias }}</p>
</span>
</template>
<template
slot="goodsPrice"
slot-scope="scope"
>
<span
v-for="(item, index) in scope.scope.subOrderList"
:key="index"
>
<p v-if="item.upgradeGoodsId">¥ {{ item.totalPrice }}</p>
<p v-else>¥ {{ item.baseRetailPrice }}</p>
</span>
</template>
<template
slot="upgradeWarrantyPeriod"
slot-scope="scope"
>
<span
v-for="(item, index) in scope.scope.subOrderList"
:key="index"
>
<p>{{ item.upgradeWarrantyPeriod ? (item.upgradeWarrantyPeriod + '年') : '无' }}</p>
</span>
</template>
<!-- <template slot="status"
slot-scope="scope">
<div>
<span
:class="[scope.scope.status == 1 ? 'yellowSpot' : scope.scope.status == 2 ? 'greenSpot' : 'ashSpot']"></span>
<span>{{ scope.scope.status | orderStatus }}</span>
</div>
</template> -->
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<orderDeatilDialog
:visible.sync="detailVisible"
:paramsObj="paramsObj"
></orderDeatilDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { Util } from '@/common/util'
import { manageTypeList } from '@/common/constant.js'
export default {
name: 'CarDamage',
components: {
},
data () {
return {
sessionInfo: this.$globalState.session,
size: 'small',
url: url,
statusOpts: {
// 1: "待升级",
// 2: "战败",
3: "待支付",
4: "已支付",
// // 5: '已退款',
// 6: "已评价",
// 9: "已撤销",
// 10: "已关闭",
// 11: "错误订单",
// 12: "已退款"
// Y: "已升级",
// N: "不升级"
},
upgradeOpts: {
Y: "已升级",
N: "不升级"
},
profitAllocationStatusOpts: {
1: '未分账',
2: '已分账',
4: '待分账'
},
searchForm: {
sceneType: 0,
status: '',
upgradeFinishFlag: '',
customerName: '',
yqMerchantId: '',
merchantId: '',
orderTime: '',
constructionFlag: '',
sourceList: '',
channelType: '',
businessModel: '',
subShopMerchantId: ''
},
showFormData: [
{
label: "订单状态",
name: "status",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "orderStatusList"
},
{
label: "升级状态",
name: "upgradeFinishFlag",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "upgradeList"
},
// {
// label: "施工状态",
// name: "constructionFlag",
// type: "select",
// optionId: "confId",
// optionLabel: "confLabel",
// optionsName: "constructionList"
// },
{
label: "商品名称",
name: "orderGoodsName",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "客户姓名",
name: "customerName",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
},
{
// label: '园区店',
label: "服务对接",
name: "yqMerchantId",
type: "select",
optionList: [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "parkServiceList",
changeAttr: (value, targetItem) => {
if (value) {
// 获取流量方
this.getServiceStore(value)
} else {
this.baseData.storeIdList = []
}
this.searchForm.merchantId = ""
this.getOptionsList()
}
},
{
label: "流量来源",
name: "merchantId",
type: "select",
noDataText: "请先选择服务对接",
// noDataText: '请先选择园区店',
optionList: [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "storeIdList",
changeAttr: (value, targetItem) => {
if (value) {
// // 获取二级流量方
this.getDiversionMerchantRef(value)
} else {
this.baseData.subShopMerchantList = []
}
this.searchForm.subShopMerchantId = ""
this.getOptionsList()
}
},
{
label: "下单日期",
name: "orderTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
},
{
label: "订单编号",
name: "orderCode",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "订单来源",
name: "sourceList",
type: "select",
noDataText: "请先选择订单来源",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "sourceList"
},
{
label: "渠道",
name: "channelType",
type: "select",
optionList: [],
optionId: "value",
optionLabel: "name",
// optionsName: 'sourceChannelTypeList'
optionsName: "channelTypeList"
},
{
label: "服务对接模式",
// label: '园区店模式',
name: "businessModel",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "manageTypeList"
},
{
label: "二级流量方",
name: "subShopMerchantId",
type: "select",
noDataText: "请先选择流量来源",
isHide: this.subShopMerchanShowHide,
optionList: [],
optionId: "subMerchantId",
optionLabel: "subMerchantName",
optionsName: "subShopMerchantList"
},
{
label: '分账状态',
name: 'profitAllocationStatus',
type: 'select',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'profitAllocationStatusList'
},
],
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '查看详情',
attrs: {
type: 'text',
fn: '查看详情'
},
listeners: {
click: this.handleDetail
}
},
],
tableSearchForm: {},
// 表格
getListApi: this.$apis.order.getList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '订单编号',
prop: 'orderCode',
width: '160'
},
{
label: '订单时间',
prop: 'orderTimeStr',
width: 170
},
{
label: '支付时间',
prop: 'paySuccessDate',
width: 170
},
// {
// label: '下单时间',
// prop: 'orderTime',
// formatter: cellValue => {
// return dayjs(cellValue.orderTime).format('YYYY-MM-DD HH:mm:ss')
// },
// width: 180
// },
{
label: '客户姓名',
prop: 'customerName',
minWidth: 100,
},
{
label: '客户性别',
prop: 'customerSex',
minWidth: 100,
formatter: (cellValue) => {
return { 1: "男", 2: "女" }[cellValue.customerSex] || "-"
}
},
{
label: '客户车型',
prop: 'carTypeName',
addHtml: 'carTypeName',
minWidth: 200
},
{
label: '客户车牌号',
prop: 'plateNumber',
minWidth: 110
},
{
label: '升级状态',
prop: 'upgradeFlag',
minWidth: 100,
formatter: (cellValue) => {
return this.baseData.upgradeList.find(item => item.confId === cellValue.status)?.confLabel || "待升级"
}
},
{
label: '订单状态',
prop: 'status',
minWidth: 100,
formatter: cellValue => {
return this.baseData.orderStatusList.find(item => item.confId === cellValue.status)?.confLabel || '-'
}
},
{
label: '商品名称',
prop: 'upgradeGoodsNames',
addHtml: 'upgradeGoodsNames',
minWidth: 150
},
{
label: '商品单价',
prop: 'goodsPrice',
addHtml: 'goodsPrice',
minWidth: 100
},
{
label: '总价',
prop: 'totalPrice',
minWidth: 100,
formatter: (cellValue) => {
return cellValue.totalPrice ? '¥' + cellValue.totalPrice : '-'
}
},
{
label: '质保年限',
prop: 'upgradeWarrantyPeriod',
addHtml: 'upgradeWarrantyPeriod',
minWidth: 100
},
{
label: '流量方',
prop: 'merchantName',
minWidth: 170
},
{
label: '二级流量方',
prop: 'subShopMerchantName',
minWidth: 170
},
{
label: '服务对接',
prop: 'sellerMerchantName',
minWidth: 170
},
{
label: '安装服务商',
prop: 'installMerchantName',
minWidth: 170
},
{
label: '营销服务商',
prop: 'marketingMerchantName',
minWidth: 170
},
{
label: '销售顾问',
prop: 'employeeName',
minWidth: 100
},
{
label: '转化人员',
prop: 'sellerName',
minWidth: 100
},
{
label: '订单来源',
prop: 'source',
minWidth: 110,
formatter: (cellValue) => {
return cellValue.source == 7 ? '系统导入' : '小程序订单'
}
},
{
label: '分账状态',
prop: 'profitAllocationStatus',
minWidth: 100,
formatter: cellValue => {
return this.baseData.profitAllocationStatusList.find(item => item.confId === cellValue.status)?.confLabel || '-'
}
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 基本数据
baseData: {
orderStatusList: [
// {
// confId: 1,
// confLabel: "待升级"
// },
// {
// confId: 2,
// confLabel: "战败"
// },
{
confId: 3,
confLabel: "待支付"
},
{
confId: 4,
confLabel: "已支付"
},
// {
// confId: 6,
// confLabel: "已评价"
// },
// {
// confId: 9,
// confLabel: "已撤销"
// },
// {
// confId: 10,
// confLabel: "已关闭"
// },
// {
// confId: 11,
// confLabel: "错误订单"
// },
// {
// confId: 12,
// confLabel: "已退款"
// }
],
upgradeList: [
{
confId: "Y",
confLabel: "已升级"
},
// {
// confId: "N",
// confLabel: "战败"
// },
{
confId: "R",
confLabel: "待升级"
}
],
constructionList: [
{
confId: "Y",
confLabel: "已施工"
},
{
confId: "N",
confLabel: "未施工"
}
],
parkServiceList: [],
storeIdList: [],
// sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList),
manageTypeList: Util.deepClone(manageTypeList),
sourceList: [
{
confId: "1",
confLabel: "小程序订单"
},
{
confId: "7",
confLabel: "系统导入"
}
],
channelTypeList: [],
subShopMerchantList: [],
profitAllocationStatusList: [
{
confId: '1',
confLabel: '未分账'
},
{
confId: '2',
confLabel: '已分账'
},
{
confId: '4',
confLabel: '待分账'
}
],
},
totalCount: '',
subShopMerchanShowHide: true,
}
},
created () {
},
mounted () {
const { merchantId } = this.sessionInfo
this.getParkStore()
this.getServiceStore(merchantId)
this.getChannelType(merchantId)
this.getOrderCount()
},
watch: {
'baseData.subShopMerchantList': {
handler (val) {
console.log('baseData.subShopMerchantList', val)
if (val.length > 0) {
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = false
} else {
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = true
}
},
immediate: true
}
},
methods: {
getParkStore () {
this.$apis.public.getParkStore({}).then((res) => {
res.forEach((item) => {
item.merchantId = item.merchantNo
})
this.baseData.parkServiceList = res
this.getOptionsList()
})
},
findFormIdx (name) {
return this.showFormData.findIndex(item => item.name === name)
},
getChannelType (merchantId) {
this.$apis.public.getChannelType({
merchantId
}).then(res => {
this.baseData.channelTypeList = res || []
this.getOptionsList()
})
},
getServiceStore (merchantId) {
this.$apis.order.getServiceStore({
merchantId,
scene: 0
}).then(res => {
this.baseData.storeIdList = res || []
this.$set(this.baseData, 'storeIdList', res || [])
this.getOptionsList()
})
},
getAllServiceStore () {
this.$apis.merchant.listShop4sByRef({
scene: 1
}).then(res => {
console.log('this.getAllServiceStore()', res)
this.baseData.storeIdList = res || []
this.getOptionsList()
})
},
getDiversionMerchantRef (merchantId) {
this.$apis.merchant.getDiversionMerchantRef({
merchantId
}).then(res => {
this.baseData.subShopMerchantList = res || []
this.getOptionsList()
})
},
getParams () {
var params = Util.deepClone(this.searchForm)
const form = this.searchForm
if (form.orderTime && form.orderTime.length) {
params.placeOrderStartDateStr = Util.dateFormate(form.orderTime[0], 'YYYY-MM-DD HH:mm:ss')
params.placeOrderEndDateStr = Util.dateFormate(form.orderTime[1], 'YYYY-MM-DD') + ' 23:59:59'
}
// delete params.placeOrderTimeStr
// delete params.warehousingTimeStr
return params
},
getOrderCount () {
var params = this.getParams()
params = {
...params
}
this.$apis.order.getOrderCount(params).then(res => {
this.totalCount = res.totalPriceCount
})
},
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.warehousingTimeStr
delete this.tableSearchForm.placeOrderTimeStr
resolve()
})
},
// 查看详情
handleDetail (row) {
this.$router.push({
path: '/orderManage/carDamageDetail',
query: row
})
},
getOptionsList () {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.orderRef.data.length ? (this.$refs.orderRef.tableHeightValues = '') : this.$refs.orderRef.setTableHeightFun()
},
exportExcel () {
var params = this.getParams()
this.$apis.purchaseShopping.exportExcel(params).then(res => {
window.location.href = res
})
},
handleSearch () {
this.$refs.orderRef.refreshTable()
},
handleReset () {
this.searchForm = {
sceneType: 0,
status: "",
upgradeFinishFlag: "",
customerName: "",
yqMerchantId: "",
merchantId: "",
orderTime: "",
constructionFlag: "",
sourceList: "",
channelType: "",
businessModel: "",
subShopMerchantId: ""
}
this.baseData.storeIdList = []
this.handleSearch()
this.getOptionsList()
}
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.purchase {
.table-header {
display: flex;
align-items: center;
margin-bottom: 25px;
margin-top: 20px;
h2 {
font-weight: 600;
font-size: 16px;
color: #333;
}
.glbtn {
left: 46px;
position: absolute;
}
.btn {
right: 47px;
position: absolute;
}
}
.greenSpot {
@include dot;
background: $color-green;
}
.yellowSpot {
@include dot;
background: $color-yellow;
}
.ashSpot {
@include dot;
background: $color-gray;
}
.table-btns /deep/.el-button--text {
min-width: 0 !important;
padding: 0;
}
.priceSpan {
font-size: 14px;
color: #909399;
}
}
</style>
......@@ -59,10 +59,12 @@ import url from '@/assets/empty.png'
import { dateFormat } from '../../utils/index'
import Order from "./components/order.vue"
import Crowdfunding from "./components/crowdfunding.vue"
import CarDamage from "./components/carDamage.vue"
export default {
components: {
Order,
Crowdfunding
Crowdfunding,
CarDamage
},
data() {
return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!