Browse Source

Merge branch 'pre-production'

master
pref_mail@163.com 4 months ago
parent
commit
c7f208b9e5
  1. 19
      src/api/reportforms/AuditTimelinessRatioReport.js
  2. 19
      src/api/reportforms/CreateOrderTimelinessRatioReport.js
  3. 133
      src/option/reportforms/AuditTimelinessRatioReport.js
  4. 193
      src/option/reportforms/CreateOrderTimelinessRatioReport.js
  5. 9
      src/views/cost/Deliverycostmanagement/Financialreview.vue
  6. 25
      src/views/cost/Deliverycostmanagement/ServiceProviderPrice.vue
  7. 9
      src/views/cost/Deliverycostmanagement/Traincostbreakdown.vue
  8. 1
      src/views/cost/Deliverycostmanagement/WarehouseDeliveryCost.vue
  9. 20
      src/views/cost/Deliverycostmanagement/WarehousePricingTemplate.vue
  10. 7
      src/views/distribution/artery/VehicleNodeImgs.vue
  11. 7
      src/views/distribution/inventory/delivery/OrderInTransit.vue
  12. 528
      src/views/reportforms/AuditTimelinessRatioReport.vue
  13. 2
      src/views/reportforms/ConsigneeReport.vue
  14. 509
      src/views/reportforms/CreateOrderTimelinessRatioReport.vue

19
src/api/reportforms/AuditTimelinessRatioReport.js

@ -0,0 +1,19 @@
import request from '@/axios';
/** 报表列表 */
export const postCheckWaybillTimePage = data => {
return request({
url: '/api/logpm-report/reportTime/checkWaybillTimePage',
method: 'post',
data,
});
};
/** 报表导出 */
export const postCheckWaybillTimeExport = data => {
return request({
url: '/api/logpm-report/reportTime/checkWaybillTimeExport',
method: 'post',
data,
responseType: 'blob',
});
};

19
src/api/reportforms/CreateOrderTimelinessRatioReport.js

@ -0,0 +1,19 @@
import request from '@/axios';
/** 报表列表 */
export const postOpenTimePage = data => {
return request({
url: '/api/logpm-report/reportTime/openTimePage',
method: 'post',
data,
});
};
/** 报表导出 */
export const postOpenTimeExport = data => {
return request({
url: '/api/logpm-report/reportTime/openTimeExport',
method: 'post',
data,
responseType: 'blob',
});
};

133
src/option/reportforms/AuditTimelinessRatioReport.js

@ -0,0 +1,133 @@
export const columnList = [
{
prop: '',
label: '复选框',
type: 0,
width: 55,
fixed: true,
},
{
prop: '',
label: '序号',
type: 12,
values: '',
width: 55,
fixed: true,
},
{
prop: 'businessLine',
label: '事业线',
type: 1,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'departureWarehouseName',
label: '发站仓',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'destinationWarehouseName',
label: '目的仓',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'brand',
label: '品牌',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'totalNum',
label: '总运单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'hasCheckNum',
label: '已审单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'hasCheckRate',
label: '审单率',
type: 6,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'onTimeCheckNum',
label: '准时审单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'onTimeCheckRate',
label: '审单准时率',
type: 6,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'avgCheckTime',
label: '平均审单时效(小时)',
type: 1,
values: '',
width: '160',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
];

193
src/option/reportforms/CreateOrderTimelinessRatioReport.js

@ -0,0 +1,193 @@
export const columnList = [
{
prop: '',
label: '复选框',
type: 0,
width: 55,
fixed: true,
},
{
prop: '',
label: '序号',
type: 12,
values: '',
width: 55,
fixed: true,
},
{
prop: 'businessLine',
label: '事业线',
type: 1,
values: '',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'warehouseName',
label: '导入仓库',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'brand',
label: '品牌',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'totalNum',
label: '总单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'hasOpenNum',
label: '已开单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'noOpenNum',
label: '未开单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'noOpenRate',
label: '未开单占比',
type: 6,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{
prop: 'noOpenHasFreezeNum',
label: '未开单已冻结数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'noOpenHasFreezeRate',
label: '未开单已冻结占比',
type: 6,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'noOpenNoFreezeNum',
label: '未开单未处理数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'noOpenNoFreezeRate',
label: '未处理占比',
type: 6,
values: '',
width: '200',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
{
prop: 'onTimeNum',
label: '准时开单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'overTimeNum',
label: '超期开单数',
type: 1,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'onTimeRate',
label: '开单准时率',
type: 6,
values: '',
width: '150',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: true, //开启统计
},
{
prop: 'avgTime',
label: '平均开单时效(小时)',
type: 1,
values: '',
width: '160',
checkarr: [],
fixed: false,
sortable: true,
head: false,
isshowSummary: false, //开启统计
},
];

9
src/views/cost/Deliverycostmanagement/Financialreview.vue

@ -164,8 +164,7 @@ import {
$_expenseDispatchFinancialReview,
} from '@/api/storagecost/index.js';
import { getDictionaryBiz } from '@/api/system/dict'; //
import { processRowProperty, setNodeHeight } from '@/utils/util';
import functions from '@/utils/functions.js';
import { processRowProperty, setNodeHeight,handleClearTableQuery } from '@/utils/util';
import { ElMessageBox, ElMessage } from 'element-plus';
import { downloadXls } from '@/utils/util';
import { useStore } from 'vuex';
@ -326,6 +325,12 @@ const currentChange = val => {
const searchChangeS = () => {
onLoad();
};
//
const searchReset = () => {
details.query = {};
handleClearTableQuery(details.columnList);
onLoad();
};
//
const searchHide = () => {
console.log(details);

25
src/views/cost/Deliverycostmanagement/ServiceProviderPrice.vue

@ -163,8 +163,7 @@
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue';
import { columnList } from '@/option/storagecost/ServiceProviderPrice.js';
import { getDictionaryBiz } from '@/api/system/dict'; //
import { processRowProperty, setNodeHeight } from '@/utils/util';
import functions from '@/utils/functions.js';
import { processRowProperty, setNodeHeight,handleClearTableQuery } from '@/utils/util';
import { getDriverList } from '@/api/basicdata/basicdataDriverArtery'; //
import {
$_getMyWarehouseList,
@ -333,8 +332,15 @@ const selectionChange = list => {
};
//
const searchChange = () => {
details.search = false; //
// details.search = false; //
onLoad()
};
const searchReset=()=>{
details.query={}
queryTop.value={}
handleClearTableQuery(details.columnList);
onLoad()
}
//
const sizeChange = val => {
details.page.pageSize = val;
@ -471,7 +477,13 @@ const PageOnload = async () => {
await MyWarehouseList(); //
onLoad();
};
const AddInfo=()=>{
ElMessage({
message: '功能维护',
type: 'warning',
})
return
}
//
PageOnload();
//
@ -628,10 +640,13 @@ const deleteTemplate = row => {
width: 100%;
display: flex;
justify-content: space-between;
.el-btn {
:deep(.el-btn) {
margin-right: 0;
width: 15%;
align-items: flex-start;
.el-form-item__content{
justify-content: flex-end;
}
}
}
</style>

9
src/views/cost/Deliverycostmanagement/Traincostbreakdown.vue

@ -156,7 +156,7 @@
style="width: 100%"
:rows="4"
type="textarea"
placeholder="请填写结算备注(必填)"
placeholder="请填写结算备注"
/>
</el-form-item>
</el-form>
@ -579,13 +579,6 @@ const confirmation = row => {
};
//
const SettlementconfirmationSubmit = async row => {
if (!Confirmsettlement.value.form.settlementNote) {
ElMessage({
message: '请填写结算备注',
type: 'warning',
});
return;
}
try {
Confirmsettlement.value.loading = true;
let Submit = {

1
src/views/cost/Deliverycostmanagement/WarehouseDeliveryCost.vue

@ -413,6 +413,7 @@ const searchReset = () => {
item.values = '';
});
details.query = {};
queryTop.value={}
onLoad();
};
//

20
src/views/cost/Deliverycostmanagement/WarehousePricingTemplate.vue

@ -7,7 +7,7 @@
<!-- 查询模块 -->
<el-form :inline="true" :model="queryTop" class="el-fr-d">
<div>
<el-form-item label="中转仓">
<el-form-item label="仓库名称">
<el-select
v-model="queryTop.warehouse"
multiple
@ -23,7 +23,7 @@
</el-select>
</el-form-item>
<el-form-item label="签收时间">
<el-form-item label="修改时间">
<el-date-picker
v-model="queryTop.costSettlementYear"
type="datetimerange"
@ -128,12 +128,10 @@ import {
$_removeTemplate,
} from '@/api/storagecost/index.js';
import { processRowProperty, setNodeHeight } from '@/utils/util';
import functions from '@/utils/functions.js';
import { ElMessageBox, ElMessage } from 'element-plus';
import { downloadXls } from '@/utils/util';
import { downloadXls,handleClearTableQuery } from '@/utils/util';
import { useStore } from 'vuex';
import dayjs from 'dayjs';
import error from '@/error';
const $router = useRouter(); //
const $useStore = useStore(); //
const $route = useRoute(); //
@ -273,6 +271,13 @@ const selectionChange = list => {
const searchChange = () => {
onLoad();
};
//
const searchReset=()=>{
queryTop.value = {};
details.query = {};
handleClearTableQuery(details.columnList);
onLoad();
}
//
const sizeChange = val => {
details.page.pageSize = val;
@ -426,10 +431,13 @@ const lyadded = () => {
width: 100%;
display: flex;
justify-content: space-between;
.el-btn {
:deep(.el-btn) {
margin-right: 0;
width: 15%;
align-items: flex-start;
.el-form-item__content{
justify-content: flex-end;
}
}
}
</style>

7
src/views/distribution/artery/VehicleNodeImgs.vue

@ -495,10 +495,9 @@ const initImgList = async () => {
_obj.nodeId = carsLoadLineEntity.nodeId;
_obj.nowWarehouseId = nowWarehouseId;
if (details.myWarehouseId === _obj.nodeId) {
details.nowWarehoseIndex = i;
details.activeIndex = i;
}
if (details.myWarehouseId === _obj.nodeId) details.activeIndex = i;
if (nowWarehouseId === _obj.nodeId) details.nowWarehoseIndex = i;
} else {
ElMessage.warning('存在异常节点信息');
return;

7
src/views/distribution/inventory/delivery/OrderInTransit.vue

@ -318,8 +318,11 @@ const initData = async () => {
onLoad(false),
]);
await nextTick();
handleTranslationDataSeclect(details.data, details.columnList);
const timer = setTimeout(() => {
handleTranslationDataSeclect(details.data, details.columnList);
clearTimeout(timer);
}, 100);
console.log('details.columnList :>> ', details.columnList);
} catch (error) {
console.log('error :>> ', error);

528
src/views/reportforms/AuditTimelinessRatioReport.vue

@ -0,0 +1,528 @@
<template>
<basic-container v-loading="details.loadingObj.pageLoading">
<div class="avue-crud">
<!-- 搜索模块 -->
<div v-h5uShow="search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="header_search" label-width="100px">
<el-form-item label="品牌" prop="brandId">
<el-select
class="w100"
v-model="query.brandList"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="item in details.brandOptions"
:key="item.brandId"
:label="item.brandName"
:value="item.brandName"
/>
</el-select>
</el-form-item>
<el-form-item label="运单创建时间">
<el-date-picker
v-model="query.timeArr"
type="daterange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="YYYY-MM-DD"
@change="
() => {
delete details.query.year;
delete details.query.month;
}
"
/>
</el-form-item>
<el-form-item label="事业线">
<el-select
class="w100"
v-model="query.businessLineList"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="item in details.businessLineOption"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="发站仓">
<el-select
class="w100"
v-model="query.departureWarehouseIds"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="value in details.warehouseOption"
:key="value.dictKey"
:label="value.dictValue"
:value="value.dictKey"
/>
</el-select>
</el-form-item>
<el-form-item label="目的仓">
<el-select
class="w100"
v-model="query.destinationWarehouseIds"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="value in details.warehouseOption"
:key="value.dictKey"
:label="value.dictValue"
:value="value.dictKey"
/>
</el-select>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset"> </el-button>
</el-form-item>
</el-form>
</div>
<!-- 控件模块 -->
<div class="avue-crud__header flex-c-sb">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Download" @click="ExportData"> 导出 </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 表格 -->
<!-- 列表模块 -->
<tablecmt
ref="tableNodeRef"
:columnList="details.columnList"
:tableData="details.data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="{ scope: { row, column } }">
<div>
{{ row[column.property] + '%' }}
</div>
</template>
</tablecmt>
<!-- 分页模块 -->
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.pageNum"
:page-sizes="[30, 50, 80, 120, 500]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</basic-container>
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="details.columnList"
v-model="details.columnList"
></edittablehead>
</template>
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick, defineAsyncComponent } from 'vue';
import functions from '@/utils/functions.js';
import dayjs from 'dayjs';
import { mapGetters, useStore } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import { postFindBrandList } from '@/api/waybill/TemporaryStorageList';
import { postFindbusinessLine } from '@/api/reportforms/SalesDepartmentIncomeReport';
import {
postCheckWaybillTimePage,
postCheckWaybillTimeExport,
} from '@/api/reportforms/AuditTimelinessRatioReport';
import { getListName } from '@/api/basicdata/basicdataVehicle';
import {
setNodeHeight,
getHtmls,
deepClone,
getObjType,
handleTranslationDataSeclect,
handleClearTableQuery,
handleSelectQuery,
handleInputQuery,
downloadXls,
} from '@/utils/util';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { columnList } from '@/option/reportforms/AuditTimelinessRatioReport';
//
const $router = useRouter();
const $store = useStore();
//
const tableNodeRef = ref();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
columnList: deepClone(columnList),
data: [],
/** 头部搜索配置 */
titleSearchOption: [],
/** 流转节点数据 */
flowNodeData: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
packageListLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
pageNum: 1,
pageSize: 30,
total: 0,
},
/** 品牌 */
brandOptions: [],
/** 事业线 */
businessLineOption: [],
/** 仓库 */
warehouseOption: [],
/** 弹出层显示 */
popUpShow: {},
/** 全屏 */
fullscreenObj: {},
});
const { search, query, shortcuts, loadingObj, selectionList, drawerShow, page } = toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
console.log('permission :>> ', permission);
/** 权限按钮 */
const permissionObj = reactive({});
/** 请求页面数据 */
const onLoad = async (params = {}) => {
try {
details.loadingObj.list = true;
const submitData = { ...details.page, ...details.query, ...params };
for (const key in submitData) {
const element = submitData[key];
if (!element && element !== 0) delete submitData[key];
}
//
if (getObjType(submitData.timeArr) === 'array' && submitData.timeArr.length > 0) {
submitData.startTimeStr = submitData.timeArr[0];
submitData.endTimeStr = submitData.timeArr[1];
}
if (getObjType(submitData.timeArr) !== 'array' || submitData.timeArr.length === 0) {
details.data = [];
return ElMessage.warning('请选择时间');
}
delete submitData.timeArr;
delete submitData.total;
const res = await postCheckWaybillTimePage(submitData);
const { code, data } = res.data;
if (code !== 200) return;
details.data = getObjType(data.records) === 'array' ? data.records : [];
details.page.total = data.total;
handleTranslationDataSeclect(details.data, details.columnList);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
const init = () => {
const time = new Date().getTime();
details.query.timeArr = [
dayjs(time - 1000 * 60 * 60 * 24 * 7).format('YYYY-MM-DD'),
dayjs(time).format('YYYY-MM-DD'),
];
onLoad();
};
init();
/** 查询品牌 */
const handleFindBrand = async () => {
try {
const res = await postFindBrandList();
console.log('res :>> ', res);
const { data, code } = res.data;
if (code !== 200) return;
console.log('data :>> ', data);
details.brandOptions = data || [];
} catch (error) {
console.log('error :>> ', error);
}
};
/** 初始化请求仓库数据 */
getListName({ name: '' }).then(res => {
const { code, data } = res.data;
if (code !== 200 || getObjType(data) !== 'array') return;
details.warehouseOption = data.map(val => {
return {
dictKey: val.id,
dictValue: val.name,
};
});
});
/** 查询事业线 */
const handleFindbusinessLine = async () => {
try {
const res = await postFindbusinessLine();
console.log('res :>> ', res);
const { data, code } = res.data;
if (code !== 200) return;
console.log('data :>> ', data);
details.businessLineOption = data || [];
} catch (error) {
console.log('error :>> ', error);
}
};
handleFindbusinessLine();
handleFindBrand();
/** 搜索 */
const searchChange = () => {
onLoad();
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.page.pageNum = 1;
handleClearTableQuery(details.columnList);
onLoad();
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean) => {
details.drawerShow = _flag;
};
/** 是否开启搜索区 */
const searchHide = () => {
details.search = !details.search;
setNodeHeight(tableNodeRef.value.$el, '', true);
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
handleInputQuery(index, row, details.query);
onLoad();
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
onLoad();
};
/** 表格表头输入框搜索 */
const btnsc = () => {};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
handleSelectQuery(index, row, details.query);
onLoad();
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (pageSize: number) => {
details.page.pageSize = pageSize;
onLoad();
};
/** 页码改变执行的回调 */
const currentChange = pageNum => {
details.page.pageNum = pageNum;
onLoad();
};
/** 弹出层开启前清除数据 */
const beforeClose = done => {
done();
details.form = {};
details.selectionList = [];
details.view = false;
};
//
const ExportData = async () => {
try {
details.loadingObj.list = true;
const submitData = { ...details.page, ...details.query };
for (const key in submitData) {
const element = submitData[key];
if (!element && element !== 0) delete submitData[key];
}
//
if (submitData.month) {
const _arr = submitData.month.split('-');
submitData.year = _arr[0];
submitData.month = _arr[1];
}
//
else if (getObjType(submitData.timeArr) === 'array' && submitData.timeArr.length > 0) {
submitData.startTimeStr = submitData.timeArr[0];
submitData.endTimeStr = submitData.timeArr[1];
}
if (
(getObjType(submitData.timeArr) !== 'array' || submitData.timeArr.length === 0) &&
!submitData.year &&
!submitData.month
) {
return ElMessage.warning('请选择时间');
}
delete submitData.timeArr;
delete submitData.total;
const res = await postCheckWaybillTimeExport(submitData);
const { status, data } = res;
if (status !== 200) return;
const time = new Date().getTime();
downloadXls(data, '审单及时率报表 -' + time + '.xlsx');
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
</script>
<style scoped lang="scss">
//
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-form-item__content) {
height: fit-content;
}
.el_div_input {
width: 100%;
display: flex;
align-items: center;
.el_dy_icon {
font-size: 1.5em;
}
}
</style>

2
src/views/reportforms/ConsigneeReport.vue

@ -492,7 +492,7 @@ const ExportData = async () => {
const { status, data } = res;
if (status !== 200) return;
const time = new Date().getTime();
downloadXls(data, '营业部收入报表 -' + time + '.xlsx');
downloadXls(data, '收货单位收入报表 -' + time + '.xlsx');
} catch (error) {
console.log('error :>> ', error);
} finally {

509
src/views/reportforms/CreateOrderTimelinessRatioReport.vue

@ -0,0 +1,509 @@
<template>
<basic-container v-loading="details.loadingObj.pageLoading">
<div class="avue-crud">
<!-- 搜索模块 -->
<div v-h5uShow="search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="header_search" label-width="100px">
<el-form-item label="品牌" prop="brandId">
<el-select
class="w100"
v-model="query.brandList"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="item in details.brandOptions"
:key="item.brandId"
:label="item.brandName"
:value="item.brandName"
/>
</el-select>
</el-form-item>
<el-form-item label="导入时间">
<el-date-picker
v-model="query.timeArr"
type="daterange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="YYYY-MM-DD"
@change="
() => {
delete details.query.year;
delete details.query.month;
}
"
/>
</el-form-item>
<el-form-item label="事业线">
<el-select
class="w100"
v-model="query.businessLineList"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="item in details.businessLineOption"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="导入仓库">
<el-select
class="w100"
v-model="query.warehouseIds"
filterable
placeholder="请选择"
default-first-option
multiple
clearable
>
<el-option
v-for="value in details.warehouseOption"
:key="value.dictKey"
:label="value.dictValue"
:value="value.dictKey"
/>
</el-select>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset"> </el-button>
</el-form-item>
</el-form>
</div>
<!-- 控件模块 -->
<div class="avue-crud__header flex-c-sb">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Download" @click="ExportData"> 导出 </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 表格 -->
<!-- 列表模块 -->
<tablecmt
ref="tableNodeRef"
:columnList="details.columnList"
:tableData="details.data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="{ scope: { row, column } }">
<div>
{{ row[column.property] + '%' }}
</div>
</template>
</tablecmt>
<!-- 分页模块 -->
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.pageNum"
:page-sizes="[30, 50, 80, 120, 500]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</basic-container>
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="details.columnList"
v-model="details.columnList"
></edittablehead>
</template>
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick, defineAsyncComponent } from 'vue';
import functions from '@/utils/functions.js';
import dayjs from 'dayjs';
import { mapGetters, useStore } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import { postFindBrandList } from '@/api/waybill/TemporaryStorageList';
import { postFindbusinessLine } from '@/api/reportforms/SalesDepartmentIncomeReport';
import {
postOpenTimePage,
postOpenTimeExport,
} from '@/api/reportforms/CreateOrderTimelinessRatioReport';
import { getListName } from '@/api/basicdata/basicdataVehicle';
import {
setNodeHeight,
getHtmls,
deepClone,
getObjType,
handleTranslationDataSeclect,
handleClearTableQuery,
handleSelectQuery,
handleInputQuery,
downloadXls,
} from '@/utils/util';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { columnList } from '@/option/reportforms/CreateOrderTimelinessRatioReport';
//
const $router = useRouter();
const $store = useStore();
//
const tableNodeRef = ref();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
columnList: deepClone(columnList),
data: [],
/** 头部搜索配置 */
titleSearchOption: [],
/** 流转节点数据 */
flowNodeData: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
packageListLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
pageNum: 1,
pageSize: 30,
total: 0,
},
/** 品牌 */
brandOptions: [],
/** 事业线 */
businessLineOption: [],
/** 仓库 */
warehouseOption: [],
/** 弹出层显示 */
popUpShow: {},
/** 全屏 */
fullscreenObj: {},
});
const { search, query, shortcuts, loadingObj, selectionList, drawerShow, page } = toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
console.log('permission :>> ', permission);
/** 权限按钮 */
const permissionObj = reactive({});
/** 请求页面数据 */
const onLoad = async (params = {}) => {
try {
details.loadingObj.list = true;
const submitData = { ...details.page, ...details.query, ...params };
for (const key in submitData) {
const element = submitData[key];
if (!element && element !== 0) delete submitData[key];
}
//
if (getObjType(submitData.timeArr) === 'array' && submitData.timeArr.length > 0) {
submitData.startTimeStr = submitData.timeArr[0];
submitData.endTimeStr = submitData.timeArr[1];
}
if (getObjType(submitData.timeArr) !== 'array' || submitData.timeArr.length === 0) {
details.data = [];
return ElMessage.warning('请选择时间');
}
delete submitData.timeArr;
delete submitData.total;
const res = await postOpenTimePage(submitData);
const { code, data } = res.data;
if (code !== 200) return;
details.data = getObjType(data.records) === 'array' ? data.records : [];
details.page.total = data.total;
handleTranslationDataSeclect(details.data, details.columnList);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
const init = () => {
const time = new Date().getTime();
details.query.timeArr = [
dayjs(time - 1000 * 60 * 60 * 24 * 7).format('YYYY-MM-DD'),
dayjs(time).format('YYYY-MM-DD'),
];
onLoad();
};
init();
/** 查询品牌 */
const handleFindBrand = async () => {
try {
const res = await postFindBrandList();
console.log('res :>> ', res);
const { data, code } = res.data;
if (code !== 200) return;
console.log('data :>> ', data);
details.brandOptions = data || [];
} catch (error) {
console.log('error :>> ', error);
}
};
/** 初始化请求仓库数据 */
getListName({ name: '' }).then(res => {
const { code, data } = res.data;
if (code !== 200 || getObjType(data) !== 'array') return;
details.warehouseOption = data.map(val => {
return {
dictKey: val.id,
dictValue: val.name,
};
});
});
/** 查询事业线 */
const handleFindbusinessLine = async () => {
try {
const res = await postFindbusinessLine();
console.log('res :>> ', res);
const { data, code } = res.data;
if (code !== 200) return;
console.log('data :>> ', data);
details.businessLineOption = data || [];
} catch (error) {
console.log('error :>> ', error);
}
};
handleFindbusinessLine();
handleFindBrand();
/** 搜索 */
const searchChange = () => {
onLoad();
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.page.pageNum = 1;
handleClearTableQuery(details.columnList);
onLoad();
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean) => {
details.drawerShow = _flag;
};
/** 是否开启搜索区 */
const searchHide = () => {
details.search = !details.search;
setNodeHeight(tableNodeRef.value.$el, '', true);
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
handleInputQuery(index, row, details.query);
onLoad();
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
onLoad();
};
/** 表格表头输入框搜索 */
const btnsc = () => {};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
handleSelectQuery(index, row, details.query);
onLoad();
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (pageSize: number) => {
details.page.pageSize = pageSize;
onLoad();
};
/** 页码改变执行的回调 */
const currentChange = pageNum => {
details.page.pageNum = pageNum;
onLoad();
};
/** 弹出层开启前清除数据 */
const beforeClose = done => {
done();
details.form = {};
details.selectionList = [];
details.view = false;
};
//
const ExportData = async () => {
try {
details.loadingObj.list = true;
const submitData = { ...details.page, ...details.query };
for (const key in submitData) {
const element = submitData[key];
if (!element && element !== 0) delete submitData[key];
}
//
if (submitData.month) {
const _arr = submitData.month.split('-');
submitData.year = _arr[0];
submitData.month = _arr[1];
}
//
else if (getObjType(submitData.timeArr) === 'array' && submitData.timeArr.length > 0) {
submitData.startTimeStr = submitData.timeArr[0];
submitData.endTimeStr = submitData.timeArr[1];
}
if (
(getObjType(submitData.timeArr) !== 'array' || submitData.timeArr.length === 0) &&
!submitData.year &&
!submitData.month
) {
return ElMessage.warning('请选择时间');
}
delete submitData.timeArr;
delete submitData.total;
const res = await postOpenTimeExport(submitData);
const { status, data } = res;
if (status !== 200) return;
const time = new Date().getTime();
downloadXls(data, '开单及时率报表 -' + time + '.xlsx');
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
</script>
<style scoped lang="scss">
//
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-form-item__content) {
height: fit-content;
}
.el_div_input {
width: 100%;
display: flex;
align-items: center;
.el_dy_icon {
font-size: 1.5em;
}
}
</style>
Loading…
Cancel
Save