Commit 788066ea by yancanhua

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

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