feat(order):投递、清运订单统计前端代码提交;

master
jiyufei 4 months ago
parent 857f57d62d
commit 5f76932204

@ -376,6 +376,9 @@ public class RecycleCleanOrderServiceImpl extends ServiceImpl<RecycleCleanOrderM
@Override
public List<OrderStatisticsResponse> cleanCount(OrderStatisticsRequest request) {
log.info("查询清运统计request:{}", request);
if (StringUtils.isBlank(request.getCompanyId())) {
return Collections.emptyList();
}
List<String> finalDeviceCodes = Lists.newArrayList();
//只勾选了商户 则查询商户底下的所有设备编码
if (StringUtils.isNoneBlank(request.getCompanyId()) && CollectionUtils.isEmpty(request.getStationIds()) && CollectionUtils.isEmpty(request.getDeviceCodes())) {

@ -657,6 +657,9 @@ public class RecycleDeliveryOrderServiceImpl extends ServiceImpl<RecycleDelivery
public List<OrderStatisticsResponse> deliveryCount(OrderStatisticsRequest request) {
log.info("查询投递统计request:{}", request);
List<String> finalDeviceCodes = Lists.newArrayList();
if (StringUtils.isBlank(request.getCompanyId())) {
return Collections.emptyList();
}
//只勾选了商户 则查询商户底下的所有设备编码
if (StringUtils.isNoneBlank(request.getCompanyId()) && CollectionUtils.isEmpty(request.getStationIds()) && CollectionUtils.isEmpty(request.getDeviceCodes())) {
List<String> stationIds = recycleDeviceService.getStationByCompanyId(request.getCompanyId());

@ -0,0 +1,351 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="*商户">
<JnpfOrganizeSelect v-model="query.companyId" placeholder="请选择商户" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="回收站">
<JnpfSelect v-model="query.stationIds" placeholder="请选择回收站" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="设备">
<JnpfSelect v-model="query.deviceCodes" placeholder="请选择设备" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="*审核状态 ">
<JnpfSelect v-model="query.auditStatus" placeholder="请选择审核状态" clearable :options="adjustStatusOptions"
:props="adjustStatusProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="*年份">
<el-select v-model="query.year" placeholder="请选择年份">
<el-option v-for="year in years" :key="year" :label="year" :value="year">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="*月份">
<el-select v-model="query.month" placeholder="请选择月份">
<el-option v-for="month in 12" :key="month" :label="`${month}月`" :value="month">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<JNPF-table v-loading="listLoading" :data="list" @sort-change="sortChange" :span-method="arraySpanMethod">
<el-table-column prop="date" label="日期(年-月-日)" align="center">
</el-table-column>
<el-table-column prop="weight" label="总重量(kg)" align="left">
</el-table-column>
<el-table-column prop="price" label="总金额(元)" align="left">
</el-table-column>
<el-table-column prop="adjustWeight" label="审核后总重量(kg)" align="left">
</el-table-column>
<el-table-column prop="adjustPrice" label="审核后总金额(元)" align="left">
</el-table-column>
</JNPF-table>
</div>
</div>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import ExportBox from "@/components/ExportBox";
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getConfigData } from "@/api/onlineDev/visualDev";
import { getDefaultCurrentValueUserIdAsync } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentIdAsync } from "@/api/permission/organize";
import { thousandsFormat } from "@/components/Generator/utils/index";
import SuperQuery from "@/components/SuperQuery";
export default {
components: {
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
const currentYear = new Date().getFullYear();
const currentMonth = new Date().getMonth() + 1;
return {
keyword: "",
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
showAll: false,
superQueryVisible: false,
uploadBoxVisible: false,
query: {
companyId:"543048783756268357",
stationIds:[],
deviceCodes:[],
auditStatus: undefined,
year: currentYear,
month: currentMonth
},
years: this.generateYears(currentYear, 3),
treeProps: {
children: "children",
label: "fullName",
value: "id",
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
},
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
adjustStatusOptions: [],
adjustStatusProps: { label: "fullName", value: "enCode" },
interfaceRes: {}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
if (this.$route.query.deviceCode) {
this.query.deviceCode = [this.$route.query.deviceCode];
}
this.getadjustStatusOptions();
this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getadjustStatusOptions() {
getDictionaryDataSelector("565908107083911685").then(res => {
this.adjustStatusOptions = res.data.list;
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() { },
initData() {
this.listLoading = true;
let _query = {
...this.query,
};
request({
url: `/api/scm/RecycleCleanOrder/cleanCount`,
method: "post",
data: _query
}).then(res => {
this.list = res.data.map(o => ({
...o,
weight: o.weight || 0,
adjustWeight: o.adjustWeight || 0,
price: o.price || 0,
adjustPrice: o.adjustPrice || 0,
...this.expandObj
}));
this.listLoading = false;
});
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/RecycleDeliveryOrder");
});
},
openSuperQuery() {
this.superQueryVisible = true;
this.$nextTick(() => {
this.$refs.SuperQuery.init();
});
},
superQuery(queryJson) {
this.listQuery.currentPage = 1;
this.initData();
},
exportData() {
this.exportBoxVisible = true;
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList);
});
},
search() {
if (this.query.companyId == null) {
this.$message.error('请选择商户');
return;
}
if (this.query.auditStatus == null) {
this.$message.error('请选择审核状态');
return;
}
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.initData();
},
refresh(isrRefresh) {
if (isrRefresh) this.reset();
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData));
this.search();
},
colseFlow(isrRefresh) {
this.flowVisible = false;
if (isrRefresh) this.reset();
},
generateYears(startYear, yearsCount) {
const years = [];
for (let i = 0; i < yearsCount; i++) {
years.push(startYear - i);
}
return years;
},
}
};
</script>

@ -0,0 +1,351 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="*商户">
<JnpfOrganizeSelect v-model="query.companyId" placeholder="请选择商户" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="回收站">
<JnpfSelect v-model="query.stationIds" placeholder="请选择回收站" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="设备">
<JnpfSelect v-model="query.deviceCodes" placeholder="请选择设备" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="*审核状态 ">
<JnpfSelect v-model="query.auditStatus" placeholder="请选择审核状态" clearable :options="adjustStatusOptions"
:props="adjustStatusProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="*年份">
<el-select v-model="query.year" placeholder="请选择年份">
<el-option v-for="year in years" :key="year" :label="year" :value="year">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="*月份">
<el-select v-model="query.month" placeholder="请选择月份">
<el-option v-for="month in 12" :key="month" :label="`${month}月`" :value="month">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<JNPF-table v-loading="listLoading" :data="list" @sort-change="sortChange" :span-method="arraySpanMethod">
<el-table-column prop="date" label="日期(年-月-日)" align="center">
</el-table-column>
<el-table-column prop="weight" label="总重量(kg)" align="left">
</el-table-column>
<el-table-column prop="price" label="总金额(元)" align="left">
</el-table-column>
<el-table-column prop="adjustWeight" label="审核后总重量(kg)" align="left">
</el-table-column>
<el-table-column prop="adjustPrice" label="审核后总金额(元)" align="left">
</el-table-column>
</JNPF-table>
</div>
</div>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import ExportBox from "@/components/ExportBox";
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getConfigData } from "@/api/onlineDev/visualDev";
import { getDefaultCurrentValueUserIdAsync } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentIdAsync } from "@/api/permission/organize";
import { thousandsFormat } from "@/components/Generator/utils/index";
import SuperQuery from "@/components/SuperQuery";
export default {
components: {
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
const currentYear = new Date().getFullYear();
const currentMonth = new Date().getMonth() + 1;
return {
keyword: "",
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
showAll: false,
superQueryVisible: false,
uploadBoxVisible: false,
query: {
companyId: "543048783756268357",
stationIds: [],
deviceCodes: [],
auditStatus: undefined,
year: currentYear,
month: currentMonth
},
years: this.generateYears(currentYear, 3),
treeProps: {
children: "children",
label: "fullName",
value: "id",
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
},
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
adjustStatusOptions: [],
adjustStatusProps: { label: "fullName", value: "enCode" },
interfaceRes: {}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
if (this.$route.query.deviceCode) {
this.query.deviceCode = [this.$route.query.deviceCode];
}
this.getadjustStatusOptions();
this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getadjustStatusOptions() {
getDictionaryDataSelector("565908107083911685").then(res => {
this.adjustStatusOptions = res.data.list;
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() { },
initData() {
this.listLoading = true;
let _query = {
...this.query,
};
request({
url: `/api/scm/RecycleDeliveryOrder/deliveryCount`,
method: "post",
data: _query
}).then(res => {
this.list = res.data.map(o => ({
...o,
weight: o.weight || 0,
adjustWeight: o.adjustWeight || 0,
price: o.price || 0,
adjustPrice: o.adjustPrice || 0,
...this.expandObj
}));
this.listLoading = false;
});
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/RecycleDeliveryOrder");
});
},
openSuperQuery() {
this.superQueryVisible = true;
this.$nextTick(() => {
this.$refs.SuperQuery.init();
});
},
superQuery(queryJson) {
this.listQuery.currentPage = 1;
this.initData();
},
exportData() {
this.exportBoxVisible = true;
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList);
});
},
search() {
if (this.query.companyId == null) {
this.$message.error('请选择商户');
return;
}
if (this.query.auditStatus == null) {
this.$message.error('请选择审核状态');
return;
}
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.initData();
},
refresh(isrRefresh) {
if (isrRefresh) this.reset();
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData));
this.search();
},
colseFlow(isrRefresh) {
this.flowVisible = false;
if (isrRefresh) this.reset();
},
generateYears(startYear, yearsCount) {
const years = [];
for (let i = 0; i < yearsCount; i++) {
years.push(startYear - i);
}
return years;
},
}
};
</script>
Loading…
Cancel
Save