Commit bec4dba6 by 前端

精品升级订单导出弹窗

1 parent b60f25d8
......@@ -210,4 +210,16 @@ const listContracts = params => {
})
}
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi, getCrowdfundingParams, getCountApi, orderExportApi, getOrderDetailApi, getQuotationPageApi, quotationFindByIdApi, exportOrderApi, quotationExportApi, quotationPrintApi, contractExportApi, listContracts }
// 订单管理excel导出表头字段模板
const exportHeadTemplate = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.ordermanage.export.head.template`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi, getCrowdfundingParams, getCountApi, orderExportApi, getOrderDetailApi, getQuotationPageApi, quotationFindByIdApi, exportOrderApi, quotationExportApi, quotationPrintApi, contractExportApi, listContracts, exportHeadTemplate }
......@@ -2,38 +2,62 @@
<template>
<div class="purchase">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<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>
<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">
<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">
<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">
<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">
<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">
<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>
......@@ -45,13 +69,46 @@
<span>{{ scope.scope.status | orderStatus }}</span>
</div>
</template> -->
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看详情</el-button>
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
@click="handleDetail(scope.scope)">查看详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<orderDeatilDialog :visible.sync="detailVisible" :paramsObj="paramsObj"></orderDeatilDialog>
<orderDeatilDialog :visible.sync="detailVisible"
:paramsObj="paramsObj"></orderDeatilDialog>
<!-- 导出字段选择 -->
<GLDialog title="请选择导出的字段"
:visible.sync="chooseFieldVisible"
class="statementOfAccountDialog"
:destroy-on-close="true"
:close-on-click-modal="false"
:before-close="handleClose"
:width="'850px'"
@onOk="exportExcel_handleConfirm"
@onCancel="handleClose">
<div class="add-dialog">
<el-form ref="editFormRef"
:model="infoForm"
label-width="1px"
size="small">
<el-form-item class="elItem">
<el-checkbox-group v-model="infoForm.fields"
@change="handleCheckChange">
<el-checkbox v-for="(item, index) in baseData.fieldList"
:key="index"
:label="item.code"
:disabled="item.required"
class="region-list-item">{{
item.name }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</div>
</GLDialog>
</div>
</template>
......@@ -415,14 +472,19 @@ export default {
storeIdList: [],
channelTypeList: [],
manageTypeList: manageTypeList,
subShopMerchantList: []
subShopMerchantList: [],
fieldList: []
},
totalCount: '',
subShopMerchanShowHide: true
subShopMerchanShowHide: true,
chooseFieldVisible: false,
infoForm: {
fields: [],
},
}
},
created() {},
created() { },
mounted() {
this.getChannelType()
......@@ -559,11 +621,45 @@ export default {
this.$refs.orderRef.data.length ? (this.$refs.orderRef.tableHeightValues = '') : this.$refs.orderRef.setTableHeightFun()
},
exportExcel() {
this.$apis.order.exportHeadTemplate({}).then(res => {
this.baseData.fieldList = res
this.chooseFieldVisible = true
console.log(this.baseData.fieldList);
this.infoForm.fields = []
this.baseData.fieldList.forEach(item => {
if (item.selected) {
this.infoForm.fields.push(item.code)
}
})
})
},
exportExcel_handleConfirm() {
let fields = this.infoForm.fields
this.baseData.fieldList = this.baseData.fieldList.map(item => {
if (fields.find(code => (code == item.code))) {
item.selected = true
} else {
item.selected = false
}
return item
})
console.log(this.baseData.fieldList);
var params = this.getParams()
params.pageNum = 1
params.fieldList = this.baseData.fieldList
this.$apis.order.exportOrderApi(params).then(res => {
console.log(res);
downLoadFile(res)
this.chooseFieldVisible = false
})
},
handleClose() {
this.chooseFieldVisible = false
},
handleSearch() {
this.$refs.orderRef.refreshTable()
this.getOrderCount()
......@@ -649,5 +745,21 @@ export default {
color: #2a58ad;
margin: 0 2px;
}
.add-dialog {
// margin: 20px 0;
/* 用来调整每一项的宽度 */
.region-list-item {
width: 100px;
white-space: nowrap;
/* text-overflow: ellipsis; */
overflow: hidden;
}
::v-deep .el-form-item {
.el-form-item__content {
width: 100%;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!