Commit 788066ea by yancanhua

fix: 车辆回收偏好功能开发

1 parent 3579c312
......@@ -11,7 +11,7 @@
<span>{{ item.content }}</span>
</div>
<div class="logBox-time">
<div class="logBox-point">M</div>
<div class="logBox-point">{{ item.updateNameCnFirst }}</div>
<span class="p-l-4">{{ item.opBy }}</span>
<span class="p-l-8">{{ item.createTime }}</span>
</div>
......
......@@ -3,14 +3,14 @@
<a-popover placement="top">
<template #content>
<div style="display: flex; flex-wrap: wrap;">
<div v-for="(item, index) in returnPageList()" :key="index" class="tag-box">{{ item.label }}</div>
<div v-for="(item, index) in returnPageList" :key="index" class="tag-box">{{ item.label }}</div>
</div>
</template>
<div style="float: left;">
<div v-for="(item, index) in returnPageList()" :key="index" style="float: left;">
<div v-for="(item, index) in returnPageList" :key="index" style="float: left;">
<div v-if="index < 2" class="tag-box tag-box-max">{{ item.label }}</div>
</div>
<div v-if="returnPageList().length > 2" class="tag-box">+ {{ returnPageList().length - 2 }}</div>
<div v-if="returnPageList.length > 2" class="tag-box">+ {{ returnPageList.length - 2 }}</div>
</div>
</a-popover>
</div>
......@@ -36,6 +36,10 @@ export default class PageMultipleTag extends Vue {
private cachedTagList: TagItem[] = [];
created() {
this.updateTagList();
}
@Watch('tagValue')
@Watch('listValue')
updateTagList() {
......@@ -56,10 +60,7 @@ export default class PageMultipleTag extends Vue {
});
}
returnPageList(): TagItem[] {
if (this.cachedTagList.length === 0) {
this.updateTagList();
}
get returnPageList(): TagItem[] {
return this.cachedTagList;
}
}
......
......@@ -10,9 +10,9 @@
</m-pagination-query-render>
<div class="table-download">
<div class="selectedList">已选 0 项</div>
<div class="selectedList">已选 {{ selectIds.length }} 项</div>
<div class="selectedBut">
<a-button type="primary" @click="downloadExcel" :disabled="exporting">
<a-button type="primary" @click="modalVisible = true, excelValue = '1'" :disabled="exporting">
导出
</a-button>
</div>
......@@ -20,8 +20,9 @@
<a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false"
@change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn" size="small" :pagination="pageState"
:row-key="record => record.transactionId" :scroll="{ y: 'calc(100vh - 400px)' }"
:row-key="record => record.id" :scroll="{ y: 'calc(100vh - 400px)' }"
:row-selection="{ selectedRowKeys: selectIds, onChange: onSelectChange, type: 'checkbox', preserveSelectedRowKeys: true, }">
<template #customFilterDropdown="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }">
<m-filter-text-render :pagination="pagination" :column="column" :confirm="confirm"></m-filter-text-render>
<m-filter-checkbox-group-render :pagination="pagination" :column="column"
......@@ -45,6 +46,10 @@
{{ record.businessModel == '1' ? '批发' : record.businessModel == '2' ? '零售' : '--' }}
</template>
<template v-if="column.key === 'cityName'">
{{ record.provinceName }}-{{ record.cityName }}
</template>
<template v-if="column.key === 'vehicleCondition'">
<PageMultipleTag :listValue="'vehicleConditionList'" :tagValue="record.vehicleCondition" />
</template>
......@@ -71,6 +76,17 @@
</template>
</template>
</a-table>
<a-modal :visible="modalVisible" @ok="handleVisibleOk" @cancel="modalVisible = false" title="导出范围" width="420px">
<div>
<div class="visible-title">请选择导出范围 <span class="validate">*</span> </div>
<a-select v-model:value="excelValue" style="width: 100%" placeholder="请选择导出范围">
<a-select-option value="1">导出全部</a-select-option>
<a-select-option value="2">导出当前筛选结果</a-select-option>
</a-select>
</div>
</a-modal>
</template>
<script lang="ts">
import { Component } from 'vue-facing-decorator';
......@@ -104,6 +120,8 @@ export default class PreferencePage extends PaginationComponent<Deposit> {
selectedItems = [];
exporting = false;
modalVisible = false;
excelValue = '1';
businessModelList = [
{ label: '全部', value: '' },
......@@ -193,7 +211,6 @@ export default class PreferencePage extends PaginationComponent<Deposit> {
if (e && e.length > 0) {
const cityObj = e[e.length - 1];
code = cityObj.value || '';
console.log('11111111111111111111111cityObj', cityObj)
}
this.pagination.queryForm.cityCode = code;
}
......@@ -204,9 +221,29 @@ export default class PreferencePage extends PaginationComponent<Deposit> {
this.pageReset();
}
handleVisibleOk() {
this.modalVisible = false;
this.downloadExcel();
}
downloadExcel(): void {
this.exporting = true;
PreferenceController.exportPreference(this.axios, this.pagination.requestParams, { responseType: 'blob' }).then(response => {
let paramsData = {
...this.pagination.requestParams,
}
if (this.excelValue == '2') {
if (!this.selectIds.length) {
message.error('请选择需要导出的数据');
this.exporting = false;
return false
} else {
if (!paramsData.filters) {
paramsData.filters = []
}
paramsData.filters.push({ field: "id", logic: "and", operator: "in", value: this.selectIds, })
}
}
PreferenceController.exportPreference(this.axios, paramsData, { responseType: 'blob' }).then(response => {
message.success('导出任务已创建,请在下载中心查看');
ExportUtil.downloadExcelFile(response.data, '收车偏好列表');
}).catch(error => {
......@@ -220,7 +257,6 @@ export default class PreferencePage extends PaginationComponent<Deposit> {
this.selectIds = selectedRowKeys;
this.selectedItems = selectedRows;
}
}
</script>
......@@ -276,4 +312,17 @@ export default class PreferencePage extends PaginationComponent<Deposit> {
line-height: 24px;
margin: 0 auto;
}
.visible-title {
width: 100%;
height: 32px;
line-height: 32px;
color: #777C85FF;
}
.validate {
color: #ee3040;
font-size: 16px;
padding-left: 2px;
}
</style>
......@@ -36,7 +36,7 @@
{{ pageData.businessModel == '1' ? '批发' : pageData.businessModel == '2' ? '零售' : '--' }}
</a-descriptions-item>
<a-descriptions-item label="注册地区">
{{ pageData.cityName }}
{{ pageData.provinceName }}-{{ pageData.cityName }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="3" size="small" layout="vertical">
......
......@@ -42,7 +42,7 @@ export default class stepOne extends Vue {
//页面数据
pageData = {
businessModel: '',
businessModel: '1',
cityCode: '',
cityName: '',
cityCn: ''
......
......@@ -53,7 +53,7 @@ export default class indexPage extends Vue {
stepActive = 'ONE';//ONE,TWO,THREE
//页面提交数据
pageData = {
businessModel: '',
businessModel: '1',
cityCode: '',
cityName: '',
cityCn: '',
......@@ -77,7 +77,7 @@ export default class indexPage extends Vue {
const data = response.data || {};
if (data.success) {
const itemData = data.data || {};
this.pageData.businessModel = itemData.businessModel || '';
this.pageData.businessModel = itemData.businessModel || '1';
this.pageData.cityCode = itemData.cityCode || '';
this.pageData.cityName = itemData.cityName || '';
this.pageData.cityCn = itemData.cityCn || '';
......@@ -120,9 +120,7 @@ export default class indexPage extends Vue {
status: status,
brandList: JSON.stringify(this.pageData.brandList)
};
if (status == 1) {
uni.showLoading({ title: '提交中...', mask: true });
}
uni.showLoading({ title: '保存中...', mask: true });
PreferenceController.savePreference(this.axios, postData).then((response: any) => {
const data = response.data || {};
if (data.success && status == 1) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!