系统报表需求添加(丽知项目)
This commit is contained in:
parent
6565b8f7d2
commit
9e04345fe1
|
@ -40,152 +40,152 @@ export const constantRoutes = [{
|
||||||
component: () => import('@/views/redirect')
|
component: () => import('@/views/redirect')
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/apiLogs',
|
path: '/apiLogs',
|
||||||
component: () => import('@/views/apiLogs/index.vue'),
|
component: () => import('@/views/apiLogs/index.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/apiLogsError',
|
path: '/apiLogsError',
|
||||||
component: () => import('@/views/apiLogsError/index.vue'),
|
component: () => import('@/views/apiLogsError/index.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: () => import('@/views/login'),
|
component: () => import('@/views/login'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/test',
|
path: '/test',
|
||||||
component: () => import('@/views/test'),
|
component: () => import('@/views/test'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/register',
|
path: '/register',
|
||||||
component: () => import('@/views/register/index'),
|
component: () => import('@/views/register/index'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/systemInit',
|
path: '/systemInit',
|
||||||
// name: "databaseIndex",
|
// name: "databaseIndex",
|
||||||
component: () => import('@/views/systemInit/index'),
|
component: () => import('@/views/systemInit/index'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
component: () => import('@/views/error/404'),
|
component: () => import('@/views/error/404'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/401',
|
path: '/401',
|
||||||
component: () => import('@/views/error/401'),
|
component: () => import('@/views/error/401'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// path: "/contractAssistant",
|
// path: "/contractAssistant",
|
||||||
// component: () => import("@/views/contractAssistant"),
|
// component: () => import("@/views/contractAssistant"),
|
||||||
// hidden: true,
|
// hidden: true,
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: 'index',
|
redirect: 'index',
|
||||||
children: [{
|
children: [{
|
||||||
path: 'index',
|
path: 'index',
|
||||||
component: () => import('@/views/index_v2'),
|
component: () => import('@/views/index_v2'),
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页',
|
title: '首页',
|
||||||
icon: 'dashboard',
|
icon: 'dashboard',
|
||||||
affix: true
|
affix: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'notFound',
|
||||||
|
component: () => import('@/views/notFound'),
|
||||||
|
name: 'notFound',
|
||||||
|
meta: {
|
||||||
|
title: '404',
|
||||||
|
icon: 'dashboard'
|
||||||
|
// affix: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'message',
|
||||||
|
component: () => import('@/views/newVersionView/message/index'),
|
||||||
|
name: 'message',
|
||||||
|
meta: {
|
||||||
|
title: '消息',
|
||||||
|
icon: 'dashboard'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'Workbench',
|
||||||
|
component: () => import('@/views/newVersionView/Workbench/index'),
|
||||||
|
name: 'Workbench',
|
||||||
|
meta: {
|
||||||
|
title: '工作台',
|
||||||
|
icon: 'dashboard'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'MasterDataCenter',
|
||||||
|
component: () => import('@/views/newVersionView/MasterDataCenter/index'),
|
||||||
|
name: 'MasterDataCenter',
|
||||||
|
meta: {
|
||||||
|
title: '主数据中心',
|
||||||
|
icon: 'dashboard'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'ApplicationCenter',
|
||||||
|
component: () => import('@/views/newVersionView/ApplicationCenter/index'),
|
||||||
|
name: 'ApplicationCenter',
|
||||||
|
meta: {
|
||||||
|
title: '应用管理',
|
||||||
|
icon: 'dashboard'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'IntegrationTaskCenter',
|
||||||
|
component: () => import('@/views/newVersionView/IntegrationTaskCenter/index'),
|
||||||
|
name: 'IntegrationTaskCenter',
|
||||||
|
meta: {
|
||||||
|
title: '集成任务',
|
||||||
|
icon: 'dashboard'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'businessCenter',
|
||||||
|
component: () => import('@/views/newVersionView/businessCenter/index'),
|
||||||
|
name: 'businessCenter',
|
||||||
|
meta: {
|
||||||
|
title: '业务中心',
|
||||||
|
icon: 'dashboard'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'notFound',
|
path: '/user',
|
||||||
component: () => import('@/views/notFound'),
|
component: Layout,
|
||||||
name: 'notFound',
|
hidden: true,
|
||||||
meta: {
|
redirect: 'Profile',
|
||||||
title: '404',
|
children: [{
|
||||||
icon: 'dashboard'
|
path: 'Profile',
|
||||||
// affix: true,
|
// component: () => import('@/views/system/user/personalCenter/index'),
|
||||||
}
|
component: () =>
|
||||||
},
|
import(
|
||||||
{
|
'@/views/systemSettings/userSettings/PersonnelSettings/personalCenter/index'
|
||||||
path: "message",
|
),
|
||||||
component: () => import("@/views/newVersionView/message/index"),
|
name: 'Profile',
|
||||||
name: "message",
|
meta: {
|
||||||
meta: {
|
title: '个人中心',
|
||||||
title: "消息",
|
icon: 'user'
|
||||||
icon: "dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "Workbench",
|
|
||||||
component: () => import("@/views/newVersionView/Workbench/index"),
|
|
||||||
name: "Workbench",
|
|
||||||
meta: {
|
|
||||||
title: "工作台",
|
|
||||||
icon: "dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "MasterDataCenter",
|
|
||||||
component: () => import("@/views/newVersionView/MasterDataCenter/index"),
|
|
||||||
name: "MasterDataCenter",
|
|
||||||
meta: {
|
|
||||||
title: "主数据中心",
|
|
||||||
icon: "dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "ApplicationCenter",
|
|
||||||
component: () => import("@/views/newVersionView/ApplicationCenter/index"),
|
|
||||||
name: "ApplicationCenter",
|
|
||||||
meta: {
|
|
||||||
title: "应用管理",
|
|
||||||
icon: "dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "IntegrationTaskCenter",
|
|
||||||
component: () => import("@/views/newVersionView/IntegrationTaskCenter/index"),
|
|
||||||
name: "IntegrationTaskCenter",
|
|
||||||
meta: {
|
|
||||||
title: "集成任务",
|
|
||||||
icon: "dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "businessCenter",
|
|
||||||
component: () => import("@/views/newVersionView/businessCenter/index"),
|
|
||||||
name: "businessCenter",
|
|
||||||
meta: {
|
|
||||||
title: "业务中心",
|
|
||||||
icon: "dashboard",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/user',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
redirect: 'Profile',
|
|
||||||
children: [{
|
|
||||||
path: 'Profile',
|
|
||||||
// component: () => import('@/views/system/user/personalCenter/index'),
|
|
||||||
component: () =>
|
|
||||||
import(
|
|
||||||
'@/views/systemSettings/userSettings/PersonnelSettings/personalCenter/index'
|
|
||||||
),
|
|
||||||
name: 'Profile',
|
|
||||||
meta: {
|
|
||||||
title: '个人中心',
|
|
||||||
icon: 'user'
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
},
|
}
|
||||||
// {
|
// {
|
||||||
// path: "/integrationOption",
|
// path: "/integrationOption",
|
||||||
// component: Layout,
|
// component: Layout,
|
||||||
|
|
|
@ -0,0 +1,748 @@
|
||||||
|
<template>
|
||||||
|
<div class="MachineSchedulingTable">
|
||||||
|
<!-- 搜索框-->
|
||||||
|
|
||||||
|
<div class="search">
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.businessDate_start"
|
||||||
|
type="date"
|
||||||
|
placeholder="出库日期-开始"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.businessDate_end"
|
||||||
|
type="date"
|
||||||
|
placeholder="交易采购-结束"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.successfulTradeDate_start"
|
||||||
|
type="date"
|
||||||
|
placeholder="交易成功开始时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.successfulTradeDate_end"
|
||||||
|
type="date"
|
||||||
|
placeholder="交易成功结束时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<!-- TOB销售-库存 -->
|
||||||
|
<div class="chunk">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.newPushDate"
|
||||||
|
type="date"
|
||||||
|
placeholder="TOB库存推送时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newTransmitInfo" placeholder="TOB库存报错详情"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<el-select v-model="queryCriteria.newstate" placeholder="TOB出库同步成功">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemnumber" placeholder="TOB库存下游单号"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemprimary" placeholder="TOB库存下游主键"></el-input>
|
||||||
|
</div>
|
||||||
|
<!-- TOB销售-确认收入 -->
|
||||||
|
<div class="chunk">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.def5"
|
||||||
|
type="date"
|
||||||
|
placeholder="TOB确认收入推送时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.def6" placeholder="TOB确认收入报错详情"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<el-select v-model="queryCriteria.newState4" placeholder="TOB确认收入交易成功-红">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newSystemNumber4" placeholder="TOB确认收入下游单号"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newSystemPrimary4" placeholder="TOB确认收入下游主键"></el-input>
|
||||||
|
</div>
|
||||||
|
<!-- toc销售-库存 -->
|
||||||
|
<div class="chunk">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.newpushdate"
|
||||||
|
type="date"
|
||||||
|
placeholder="TOC库存推送时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newtransmitinfo" placeholder="TOC库存推送详情"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<el-select v-model="queryCriteria.newstate" placeholder="TOC出库同步成功">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemnumber" placeholder="TOC库存下游单号"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemprimary" placeholder="TOC库存下游主键"></el-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="query"
|
||||||
|
:loading="loading"
|
||||||
|
size="small"
|
||||||
|
style=" margin: 5px 5px"
|
||||||
|
>查询
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="primary"-->
|
||||||
|
<!-- @click="downLoad"-->
|
||||||
|
<!-- :loading="loading"-->
|
||||||
|
<!-- size="small"-->
|
||||||
|
<!-- style=" margin: 5px 5px"-->
|
||||||
|
<!-- >excel导出-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
@click="reset"
|
||||||
|
:loading="loading"
|
||||||
|
size="small"
|
||||||
|
style="margin: 5px 5px"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- 主体内容-->
|
||||||
|
<div class="main">
|
||||||
|
<baseNewTable
|
||||||
|
:tableData="mainTableData"
|
||||||
|
:tableColumn="mainTableColumn"
|
||||||
|
:tableLoading="tableLoading"
|
||||||
|
:tableDataMergeList="tableDataMergeList"
|
||||||
|
:pageModel="pageModel"
|
||||||
|
@pageSizeChange="(val) => pageSizeChange(val, pageModel)"
|
||||||
|
@pageChange="(val) => pageChange(val, pageModel)"
|
||||||
|
exportEventName="ToB库存报表"
|
||||||
|
>
|
||||||
|
</baseNewTable>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import baseNewTable from './baseNewTable2/index.vue'
|
||||||
|
import { authApi, downFilesBasedFileNameFileTypeAPI } from '@/api/apis/auth'
|
||||||
|
import {
|
||||||
|
basePrintJS
|
||||||
|
} from '@/utils/util.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MachineSchedulingTable',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
stateOptions: [
|
||||||
|
{ label: '全部', value: 'all' },
|
||||||
|
{ label: '成功', value: 'Y' },
|
||||||
|
{ label: '失败', value: 'N' }
|
||||||
|
],
|
||||||
|
//搜索框内容
|
||||||
|
queryCriteria: {
|
||||||
|
newPushDate: '',
|
||||||
|
newTransmitInfo: '',
|
||||||
|
newstate: '',
|
||||||
|
newsystemnumber: '',
|
||||||
|
newsystemprimary: '',
|
||||||
|
def5: '',
|
||||||
|
def6: '',
|
||||||
|
newState4: '',
|
||||||
|
newSystemNumber4: '',
|
||||||
|
newSystemPrimary4: '',
|
||||||
|
newpushdate: '',
|
||||||
|
newtransmitinfo: '',
|
||||||
|
def1: '',
|
||||||
|
def2: '',
|
||||||
|
newstate2: '',
|
||||||
|
newsystemnumber2: '',
|
||||||
|
newsystemprimary2: '',
|
||||||
|
def3: '',
|
||||||
|
def4: '',
|
||||||
|
newstate3: '',
|
||||||
|
newsystemnumber3: '',
|
||||||
|
newsystemprimary3: '',
|
||||||
|
businessType: 'TOB_ORDER',
|
||||||
|
businessDate_start: '',
|
||||||
|
businessDate_end: '',
|
||||||
|
successfulTradeDate_start: '',
|
||||||
|
successfulTradeDate_end: ''
|
||||||
|
|
||||||
|
},
|
||||||
|
pageModel: {
|
||||||
|
'pageSize': 100,
|
||||||
|
'pageNum': 1,
|
||||||
|
pageTotal: 0
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'TOB销售',
|
||||||
|
value: 'TOB_ORDER'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOC销售',
|
||||||
|
value: 'TOC_ORDER'
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
//搜索按钮loading
|
||||||
|
loading: false,
|
||||||
|
//表单loading
|
||||||
|
tableLoading: false,
|
||||||
|
workshop: [],
|
||||||
|
//客户下拉
|
||||||
|
queryCriteriaOption: [],
|
||||||
|
//色号下拉
|
||||||
|
colorNumOption: [],
|
||||||
|
//批号下拉
|
||||||
|
contractCodeOption: [],
|
||||||
|
//机台下拉
|
||||||
|
workBenchIDOption: [],
|
||||||
|
//生产名称下拉
|
||||||
|
cInvNameOption: [],
|
||||||
|
// 产品类型下拉
|
||||||
|
cInvCNameOption: [],
|
||||||
|
//生产班组
|
||||||
|
stateNameOption: [
|
||||||
|
{
|
||||||
|
label: '甲',
|
||||||
|
value: '甲'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '乙',
|
||||||
|
value: '乙'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '丙',
|
||||||
|
value: '丙'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 右侧按钮
|
||||||
|
fixedButtonList: [
|
||||||
|
{
|
||||||
|
icon: 'el-icon-printer',
|
||||||
|
title: '打印'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'el-icon-folder',
|
||||||
|
title: '导出'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
//正常表单
|
||||||
|
mainTableData: [],
|
||||||
|
//缺少字段产品大类、本次生产重量
|
||||||
|
mainTableColumn: [
|
||||||
|
{
|
||||||
|
label: '出库明细主键',
|
||||||
|
prop: 'id',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-推送时间',
|
||||||
|
prop: 'newpushdate',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-报错详情',
|
||||||
|
prop: 'newtransmitinfo',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-推送状态',
|
||||||
|
prop: 'newstate',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-推送状态',
|
||||||
|
prop: 'newstate4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游单号',
|
||||||
|
prop: 'newsystemnumber',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游主键',
|
||||||
|
prop: 'newsystemprimary',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-推送状态',
|
||||||
|
prop: 'newstate4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游单号',
|
||||||
|
prop: 'newsystemnumber',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游主键',
|
||||||
|
prop: 'newsystemprimary',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-下游单号',
|
||||||
|
prop: 'newsystemnumber4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-下游主键',
|
||||||
|
prop: 'newsystemprimary4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '业务类型',
|
||||||
|
prop: 'businesstype',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-推送时间',
|
||||||
|
prop: 'def5',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-报错详情',
|
||||||
|
prop: 'def6',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '货主编码',
|
||||||
|
prop: 'headCompanyCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '仓库编码',
|
||||||
|
prop: 'headFacilityCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '平台编码',
|
||||||
|
prop: 'headSourcePlatformCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '店铺编码',
|
||||||
|
prop: 'headStoreCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
//正常合并
|
||||||
|
tableDataMergeList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async downLoad() {
|
||||||
|
if (this.queryCriteria.business_date_start && this.queryCriteria.business_date_end) {
|
||||||
|
let startDate = new Date(this.queryCriteria.business_date_start)
|
||||||
|
let endDate = new Date(this.queryCriteria.business_date_end)
|
||||||
|
let differenceInMillis = endDate - startDate
|
||||||
|
let differenceInDays = differenceInMillis / (1000 * 60 * 60 * 24)
|
||||||
|
// 判断差值是否在15天以内
|
||||||
|
if (!isNaN(differenceInDays) && differenceInDays < 31) {
|
||||||
|
} else {
|
||||||
|
this.$vmNews('开始时间和结束时间范围请选择在30天内')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$vmNews('请选择开始时间和结束时间')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
...this.queryCriteria,
|
||||||
|
...this.pageModel,
|
||||||
|
pageSize: 9999,
|
||||||
|
pageNum: 1
|
||||||
|
}
|
||||||
|
this.openLoading('detail')
|
||||||
|
const res = await authApi('busidataTocsalesServiceImpl', 'busidataTocsalesServiceImpl', 'queryToCSalesReportExcel', '', params)
|
||||||
|
|
||||||
|
if (res.status == 200) {
|
||||||
|
const response = await downFilesBasedFileNameFileTypeAPI(res.attribute)
|
||||||
|
// console.log(res)
|
||||||
|
const url = window.URL.createObjectURL(new Blob([response]), { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.setAttribute('download', 'toc正向流程报表.xlsx') // 设置下载的文件名
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.pageModel.pageNum = 1
|
||||||
|
this.queryCriteria = {
|
||||||
|
newPushDate: '',
|
||||||
|
newTransmitInfo: '',
|
||||||
|
newstate: '',
|
||||||
|
newsystemnumber: '',
|
||||||
|
newsystemprimary: '',
|
||||||
|
def5: '',
|
||||||
|
def6: '',
|
||||||
|
newState4: '',
|
||||||
|
newSystemNumber4: '',
|
||||||
|
newSystemPrimary4: '',
|
||||||
|
newpushdate: '',
|
||||||
|
newtransmitinfo: '',
|
||||||
|
def1: '',
|
||||||
|
def2: '',
|
||||||
|
newstate2: '',
|
||||||
|
newsystemnumber2: '',
|
||||||
|
newsystemprimary2: '',
|
||||||
|
def3: '',
|
||||||
|
def4: '',
|
||||||
|
newstate3: '',
|
||||||
|
newsystemnumber3: '',
|
||||||
|
newsystemprimary3: '',
|
||||||
|
businessType: 'TOB_ORDER',
|
||||||
|
businessDate_start: '',
|
||||||
|
businessDate_end: '',
|
||||||
|
successfulTradeDate_start: '',
|
||||||
|
successfulTradeDate_end: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//limit改变
|
||||||
|
pageSizeChange(val, obj) {
|
||||||
|
obj.pageSize = val
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
//页码变更
|
||||||
|
pageChange(val, obj) {
|
||||||
|
obj.page = val
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
//搜索联想
|
||||||
|
async remoteMethod(val, row, options) {
|
||||||
|
// 客户
|
||||||
|
if (row == 'cusCode') {
|
||||||
|
const res = await GetCustomerListAPI(val)
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({ label: item.cCusName, value: item.cCusCode })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (row === 'workBenchID') {
|
||||||
|
//这个不需要动态搜索
|
||||||
|
if (this[options].length) return
|
||||||
|
const res = await WorkbenchGetBillListAPI({
|
||||||
|
page: 1,
|
||||||
|
limit: 999,
|
||||||
|
Sequence: '',
|
||||||
|
SequenceName: '',
|
||||||
|
CodeOrName: '',
|
||||||
|
areaID: '',
|
||||||
|
workShopID: ''
|
||||||
|
})
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({
|
||||||
|
label: item.workName,
|
||||||
|
value: item.workID
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (row === 'cInvCode') {
|
||||||
|
const res = await U8BaseGetInvenListAPI({
|
||||||
|
page: 1,
|
||||||
|
limit: 200,
|
||||||
|
codeOrName: val
|
||||||
|
})
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({ label: item.cInvName, value: item.cInvCode })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (row === 'cInvCCode') {
|
||||||
|
const res = await U8BaseGetInvClassListAPI({
|
||||||
|
page: 1,
|
||||||
|
limit: 200,
|
||||||
|
codeOrName: val
|
||||||
|
})
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({
|
||||||
|
label: item.cInvCName,
|
||||||
|
value: item.cInvCCode
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击查询
|
||||||
|
query() {
|
||||||
|
this.pageModel.pageNum = 1
|
||||||
|
// if (this.queryCriteria.business_date_start && this.queryCriteria.business_date_end) {
|
||||||
|
// let startDate = new Date(this.queryCriteria.business_date_start)
|
||||||
|
// let endDate = new Date(this.queryCriteria.business_date_end)
|
||||||
|
// let differenceInMillis = endDate - startDate
|
||||||
|
// let differenceInDays = differenceInMillis / (1000 * 60 * 60 * 24)
|
||||||
|
// // 判断差值是否在15天以内
|
||||||
|
// if (!isNaN(differenceInDays) && differenceInDays < 11) {
|
||||||
|
// } else {
|
||||||
|
// this.$vmNews('开始时间和结束时间范围请选择在10天内')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// this.$vmNews('请选择开始时间和结束时间')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* 导出、打印功能
|
||||||
|
* item:当前按钮信息
|
||||||
|
* boxId:打印表单id(仅导出)
|
||||||
|
* name:导出后文件名(仅导出)
|
||||||
|
* tableData:传打印表格当前tableData(仅打印)
|
||||||
|
* tableColumn:传打印表格当前tableColumn(仅打印)
|
||||||
|
* */
|
||||||
|
fixedClick(item, boxId, name, tableData, tableColumn) {
|
||||||
|
if (item.title == '导出') {
|
||||||
|
this.exportEvent(name, boxId)
|
||||||
|
} else if (item.title == '打印') {
|
||||||
|
this.duplicate(tableData, tableColumn)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//导出功能
|
||||||
|
exportEvent(excelName, boxId) {
|
||||||
|
console.log(document.querySelector(boxId), '123', boxId)
|
||||||
|
let gatherData = {
|
||||||
|
raw: true
|
||||||
|
}
|
||||||
|
let grid = XLSX.utils.table_to_book(
|
||||||
|
document.querySelector(boxId),
|
||||||
|
gatherData
|
||||||
|
)
|
||||||
|
let workbook = XLSX.write(grid, {
|
||||||
|
bookType: 'xlsx',
|
||||||
|
bookSST: true,
|
||||||
|
type: 'array'
|
||||||
|
})
|
||||||
|
try {
|
||||||
|
FileSaver.saveAs(
|
||||||
|
new Blob([workbook], {
|
||||||
|
type: 'application/octet-stream'
|
||||||
|
}),
|
||||||
|
excelName + '.xlsx'
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
if (typeof console !== 'undefined') console.log(e, workbook)
|
||||||
|
}
|
||||||
|
return workbook
|
||||||
|
},
|
||||||
|
//打印
|
||||||
|
duplicate(tableData, tableColumn) {
|
||||||
|
basePrintJS(tableData, tableColumn)
|
||||||
|
},
|
||||||
|
//初始化表单
|
||||||
|
async init() {
|
||||||
|
this.tableLoading = true
|
||||||
|
let params = {
|
||||||
|
...this.queryCriteria,
|
||||||
|
...this.pageModel
|
||||||
|
}
|
||||||
|
//初始化表单
|
||||||
|
const res = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'queryToCSalesReport', '', params)
|
||||||
|
console.log(res, '初始化res')
|
||||||
|
this.pageModel.pageTotal = res.attribute.total
|
||||||
|
this.mainTableData = this.dataDispose(
|
||||||
|
res.attribute.list,
|
||||||
|
this.tableDataMergeList
|
||||||
|
)
|
||||||
|
this.tableLoading = false
|
||||||
|
},
|
||||||
|
//data处理
|
||||||
|
dataDispose(data, arr) {
|
||||||
|
if (!arr.length) return data
|
||||||
|
//分类存放分组
|
||||||
|
let tempObj = {}
|
||||||
|
//结果
|
||||||
|
let result = []
|
||||||
|
//将层级转变为 [[1],[1,2],[1,2,3]]
|
||||||
|
const transformedArray = arr.reduce((acc, currentValue) => {
|
||||||
|
acc.push([...(acc.length ? acc[acc.length - 1] : []), currentValue])
|
||||||
|
return acc
|
||||||
|
}, [])
|
||||||
|
//开始对表单进行排序
|
||||||
|
//排序后的arr
|
||||||
|
let newArr = []
|
||||||
|
let sortObj = {}
|
||||||
|
data.forEach((item) => {
|
||||||
|
let keyValue = ''
|
||||||
|
arr.forEach((key2, index) => {
|
||||||
|
keyValue += item[key2]
|
||||||
|
})
|
||||||
|
if (!sortObj[keyValue]) {
|
||||||
|
sortObj[keyValue] = data.filter((item01) => {
|
||||||
|
return arr.every((prop) => item01[prop] === item[prop])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Object.keys(sortObj)
|
||||||
|
.sort()
|
||||||
|
.forEach((key) => {
|
||||||
|
newArr = [...newArr, ...sortObj[key]]
|
||||||
|
})
|
||||||
|
// 开始循环
|
||||||
|
newArr.forEach((item) => {
|
||||||
|
transformedArray.forEach((key) => {
|
||||||
|
//keyValue:当前key下的value加一起,用于tempObj的key
|
||||||
|
let keyValue = ''
|
||||||
|
key.forEach((keyItem, index) => {
|
||||||
|
keyValue += item[keyItem]
|
||||||
|
if (index < key.length - 1) {
|
||||||
|
keyValue += '|'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!tempObj[keyValue]) {
|
||||||
|
//拿到所有当前key下相同数据
|
||||||
|
tempObj[keyValue] = newArr.filter((item01) => {
|
||||||
|
return key.every((prop) => item01[prop] === item[prop])
|
||||||
|
})
|
||||||
|
// 计算总数
|
||||||
|
tempObj[keyValue][0][`${key[key.length - 1]}Length`] =
|
||||||
|
tempObj[keyValue].length
|
||||||
|
|
||||||
|
if (key.length === 1) {
|
||||||
|
result = [...tempObj[keyValue], ...result]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
baseNewTable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.MachineSchedulingTable {
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.div_title {
|
||||||
|
color: #696969;
|
||||||
|
background-color: #f1efef;
|
||||||
|
line-height: 35px;
|
||||||
|
height: 35px;
|
||||||
|
margin: 20px 0 10px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
> span {
|
||||||
|
width: 23%;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .search {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-left: 10px !important;
|
||||||
|
width: 200px !important;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
> .main {
|
||||||
|
> .tableBox {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-select {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,732 @@
|
||||||
|
<template>
|
||||||
|
<div class="MachineSchedulingTable">
|
||||||
|
<!-- 搜索框-->
|
||||||
|
|
||||||
|
<div class="search">
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.businessDate_start"
|
||||||
|
type="date"
|
||||||
|
placeholder="出库日期-开始"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.businessDate_end"
|
||||||
|
type="date"
|
||||||
|
placeholder="交易采购-结束"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.successfulTradeDate_start"
|
||||||
|
type="date"
|
||||||
|
placeholder="交易成功开始时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<div class="datepickBox" style="">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryCriteria.successfulTradeDate_end"
|
||||||
|
type="date"
|
||||||
|
placeholder="交易成功结束时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
<!-- toc销售-库存 -->
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newpushdate" placeholder="TOC库存推送时间"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newtransmitinfo" placeholder="TOC库存推送详情"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<el-select v-model="queryCriteria.newstate" placeholder="TOC出库同步成功">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemnumber" placeholder="TOC库存下游单号"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemprimary" placeholder="TOC库存下游主键"></el-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- toc销售 - 确认收入-红 -->
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.def1" placeholder="TOC确认收入-红-推送时间"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.def2" placeholder="TOC确认收入-红-推送详情"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<el-select v-model="queryCriteria.newstate2" placeholder="TOC确认收入-红-交易成功">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemnumber2" placeholder="TOC确认收入-红-下游单号"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemprimary2" placeholder="TOC确认收入-红-下游主键"></el-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- toc销售 - 确认收入-蓝 -->
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.def3" placeholder="TOC确认收入-蓝-推送时间"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.def4" placeholder="TOC确认收入-蓝-推送详情"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="radio">
|
||||||
|
<el-select v-model="queryCriteria.newstate3" placeholder="TOC确认收入-蓝-交易成功">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemnumber3" placeholder="TOC确认收入-蓝-下游单号"></el-input>
|
||||||
|
</div>
|
||||||
|
<div class="chunk">
|
||||||
|
<el-input v-model="queryCriteria.newsystemprimary3" placeholder="TOC确认收入-蓝-下游主键"></el-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="query"
|
||||||
|
:loading="loading"
|
||||||
|
size="small"
|
||||||
|
style=" margin: 5px 5px"
|
||||||
|
>查询
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="primary"-->
|
||||||
|
<!-- @click="downLoad"-->
|
||||||
|
<!-- :loading="loading"-->
|
||||||
|
<!-- size="small"-->
|
||||||
|
<!-- style=" margin: 5px 5px"-->
|
||||||
|
<!-- >excel导出-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
@click="reset"
|
||||||
|
:loading="loading"
|
||||||
|
size="small"
|
||||||
|
style="margin: 5px 5px"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- 主体内容-->
|
||||||
|
<div class="main">
|
||||||
|
<baseNewTable
|
||||||
|
:tableData="mainTableData"
|
||||||
|
:tableColumn="mainTableColumn"
|
||||||
|
:tableLoading="tableLoading"
|
||||||
|
:tableDataMergeList="tableDataMergeList"
|
||||||
|
:pageModel="pageModel"
|
||||||
|
@pageSizeChange="(val) => pageSizeChange(val, pageModel)"
|
||||||
|
@pageChange="(val) => pageChange(val, pageModel)"
|
||||||
|
exportEventName="ToC确认收入报表"
|
||||||
|
>
|
||||||
|
</baseNewTable>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import baseNewTable from './baseNewTable2/index.vue'
|
||||||
|
import { authApi, downFilesBasedFileNameFileTypeAPI } from '@/api/apis/auth'
|
||||||
|
import {
|
||||||
|
basePrintJS
|
||||||
|
} from '@/utils/util.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MachineSchedulingTable',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
stateOptions: [
|
||||||
|
{ label: '全部', value: 'all' },
|
||||||
|
{ label: '成功', value: 'Y' },
|
||||||
|
{ label: '失败', value: 'N' }
|
||||||
|
],
|
||||||
|
//搜索框内容
|
||||||
|
queryCriteria: {
|
||||||
|
newPushDate:"",
|
||||||
|
newTransmitInfo:"",
|
||||||
|
newstate:"",
|
||||||
|
newsystemnumber:"",
|
||||||
|
newsystemprimary:"",
|
||||||
|
def5:"",
|
||||||
|
def6:"",
|
||||||
|
newState4:"",
|
||||||
|
newSystemNumber4:"",
|
||||||
|
newSystemPrimary4:"",
|
||||||
|
newpushdate:"",
|
||||||
|
newtransmitinfo:"",
|
||||||
|
def1:"",
|
||||||
|
def2:"",
|
||||||
|
newstate2:"",
|
||||||
|
newsystemnumber2:"",
|
||||||
|
newsystemprimary2:"",
|
||||||
|
def3:"",
|
||||||
|
def4:"",
|
||||||
|
newstate3:"",
|
||||||
|
newsystemnumber3:"",
|
||||||
|
newsystemprimary3:"",
|
||||||
|
businessType:"TOC_ORDER",
|
||||||
|
businessDate_start: '',
|
||||||
|
businessDate_end: '',
|
||||||
|
successfulTradeDate_start: '',
|
||||||
|
successfulTradeDate_end: ''
|
||||||
|
},
|
||||||
|
pageModel: {
|
||||||
|
'pageSize': 100,
|
||||||
|
'pageNum': 1,
|
||||||
|
pageTotal: 0
|
||||||
|
},
|
||||||
|
options:[
|
||||||
|
{
|
||||||
|
label:"TOB销售",
|
||||||
|
value:"TOB_ORDER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label:"TOC销售",
|
||||||
|
value:"TOC_ORDER"
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
//搜索按钮loading
|
||||||
|
loading: false,
|
||||||
|
//表单loading
|
||||||
|
tableLoading: false,
|
||||||
|
workshop: [],
|
||||||
|
//客户下拉
|
||||||
|
queryCriteriaOption: [],
|
||||||
|
//色号下拉
|
||||||
|
colorNumOption: [],
|
||||||
|
//批号下拉
|
||||||
|
contractCodeOption: [],
|
||||||
|
//机台下拉
|
||||||
|
workBenchIDOption: [],
|
||||||
|
//生产名称下拉
|
||||||
|
cInvNameOption: [],
|
||||||
|
// 产品类型下拉
|
||||||
|
cInvCNameOption: [],
|
||||||
|
//生产班组
|
||||||
|
stateNameOption: [
|
||||||
|
{
|
||||||
|
label: '甲',
|
||||||
|
value: '甲'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '乙',
|
||||||
|
value: '乙'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '丙',
|
||||||
|
value: '丙'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 右侧按钮
|
||||||
|
fixedButtonList: [
|
||||||
|
{
|
||||||
|
icon: 'el-icon-printer',
|
||||||
|
title: '打印'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: 'el-icon-folder',
|
||||||
|
title: '导出'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
//正常表单
|
||||||
|
mainTableData: [],
|
||||||
|
//缺少字段产品大类、本次生产重量
|
||||||
|
mainTableColumn: [
|
||||||
|
{
|
||||||
|
label: '出库明细主键',
|
||||||
|
prop: 'id',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-推送时间',
|
||||||
|
prop: 'newpushdate',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-报错详情',
|
||||||
|
prop: 'newtransmitinfo',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-推送状态',
|
||||||
|
prop: 'newstate',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-推送状态',
|
||||||
|
prop: 'newstate4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游单号',
|
||||||
|
prop: 'newsystemnumber',
|
||||||
|
tooltip: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游主键',
|
||||||
|
prop: 'newsystemprimary',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-推送状态',
|
||||||
|
prop: 'newstate4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游单号',
|
||||||
|
prop: 'newsystemnumber',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB库存-下游主键',
|
||||||
|
prop: 'newsystemprimary',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-下游单号',
|
||||||
|
prop: 'newsystemnumber4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-下游主键',
|
||||||
|
prop: 'newsystemprimary4',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '业务类型',
|
||||||
|
prop: 'businesstype',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-推送时间',
|
||||||
|
prop: 'def5',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TOB确认收入-报错详情',
|
||||||
|
prop: 'def6',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '货主编码',
|
||||||
|
prop: 'headCompanyCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '仓库编码',
|
||||||
|
prop: 'headFacilityCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '平台编码',
|
||||||
|
prop: 'headSourcePlatformCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '店铺编码',
|
||||||
|
prop: 'headStoreCode',
|
||||||
|
tooltip: true,
|
||||||
|
width: 150
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
//正常合并
|
||||||
|
tableDataMergeList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async downLoad() {
|
||||||
|
if (this.queryCriteria.business_date_start && this.queryCriteria.business_date_end) {
|
||||||
|
let startDate = new Date(this.queryCriteria.business_date_start)
|
||||||
|
let endDate = new Date(this.queryCriteria.business_date_end)
|
||||||
|
let differenceInMillis = endDate - startDate
|
||||||
|
let differenceInDays = differenceInMillis / (1000 * 60 * 60 * 24)
|
||||||
|
// 判断差值是否在15天以内
|
||||||
|
if (!isNaN(differenceInDays) && differenceInDays < 31) {
|
||||||
|
} else {
|
||||||
|
this.$vmNews('开始时间和结束时间范围请选择在30天内')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$vmNews('请选择开始时间和结束时间')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
...this.queryCriteria,
|
||||||
|
...this.pageModel,
|
||||||
|
pageSize: 9999,
|
||||||
|
pageNum: 1
|
||||||
|
}
|
||||||
|
this.openLoading('detail')
|
||||||
|
const res = await authApi('busidataTocsalesServiceImpl', 'busidataTocsalesServiceImpl', 'queryToCSalesReportExcel', '', params)
|
||||||
|
|
||||||
|
if (res.status == 200) {
|
||||||
|
const response = await downFilesBasedFileNameFileTypeAPI(res.attribute)
|
||||||
|
// console.log(res)
|
||||||
|
const url = window.URL.createObjectURL(new Blob([response]), { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.setAttribute('download', 'toc正向流程报表.xlsx') // 设置下载的文件名
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.pageModel.pageNum = 1
|
||||||
|
this.queryCriteria = {
|
||||||
|
newPushDate:"",
|
||||||
|
newTransmitInfo:"",
|
||||||
|
newstate:"",
|
||||||
|
newsystemnumber:"",
|
||||||
|
newsystemprimary:"",
|
||||||
|
def5:"",
|
||||||
|
def6:"",
|
||||||
|
newState4:"",
|
||||||
|
newSystemNumber4:"",
|
||||||
|
newSystemPrimary4:"",
|
||||||
|
newpushdate:"",
|
||||||
|
newtransmitinfo:"",
|
||||||
|
def1:"",
|
||||||
|
def2:"",
|
||||||
|
newstate2:"",
|
||||||
|
newsystemnumber2:"",
|
||||||
|
newsystemprimary2:"",
|
||||||
|
def3:"",
|
||||||
|
def4:"",
|
||||||
|
newstate3:"",
|
||||||
|
newsystemnumber3:"",
|
||||||
|
newsystemprimary3:"",
|
||||||
|
businessType:"TOC_ORDER",
|
||||||
|
businessDate_start: '',
|
||||||
|
businessDate_end: '',
|
||||||
|
successfulTradeDate_start: '',
|
||||||
|
successfulTradeDate_end: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//limit改变
|
||||||
|
pageSizeChange(val, obj) {
|
||||||
|
obj.pageSize = val
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
//页码变更
|
||||||
|
pageChange(val, obj) {
|
||||||
|
obj.page = val
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
//搜索联想
|
||||||
|
async remoteMethod(val, row, options) {
|
||||||
|
// 客户
|
||||||
|
if (row == 'cusCode') {
|
||||||
|
const res = await GetCustomerListAPI(val)
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({ label: item.cCusName, value: item.cCusCode })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (row === 'workBenchID') {
|
||||||
|
//这个不需要动态搜索
|
||||||
|
if (this[options].length) return
|
||||||
|
const res = await WorkbenchGetBillListAPI({
|
||||||
|
page: 1,
|
||||||
|
limit: 999,
|
||||||
|
Sequence: '',
|
||||||
|
SequenceName: '',
|
||||||
|
CodeOrName: '',
|
||||||
|
areaID: '',
|
||||||
|
workShopID: ''
|
||||||
|
})
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({
|
||||||
|
label: item.workName,
|
||||||
|
value: item.workID
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (row === 'cInvCode') {
|
||||||
|
const res = await U8BaseGetInvenListAPI({
|
||||||
|
page: 1,
|
||||||
|
limit: 200,
|
||||||
|
codeOrName: val
|
||||||
|
})
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({ label: item.cInvName, value: item.cInvCode })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (row === 'cInvCCode') {
|
||||||
|
const res = await U8BaseGetInvClassListAPI({
|
||||||
|
page: 1,
|
||||||
|
limit: 200,
|
||||||
|
codeOrName: val
|
||||||
|
})
|
||||||
|
this[options] = []
|
||||||
|
if (res.code == 1) {
|
||||||
|
res.data[1].forEach((item) => {
|
||||||
|
this[options].push({
|
||||||
|
label: item.cInvCName,
|
||||||
|
value: item.cInvCCode
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击查询
|
||||||
|
query() {
|
||||||
|
this.pageModel.pageNum = 1
|
||||||
|
// if (this.queryCriteria.business_date_start && this.queryCriteria.business_date_end) {
|
||||||
|
// let startDate = new Date(this.queryCriteria.business_date_start)
|
||||||
|
// let endDate = new Date(this.queryCriteria.business_date_end)
|
||||||
|
// let differenceInMillis = endDate - startDate
|
||||||
|
// let differenceInDays = differenceInMillis / (1000 * 60 * 60 * 24)
|
||||||
|
// // 判断差值是否在15天以内
|
||||||
|
// if (!isNaN(differenceInDays) && differenceInDays < 11) {
|
||||||
|
// } else {
|
||||||
|
// this.$vmNews('开始时间和结束时间范围请选择在10天内')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// this.$vmNews('请选择开始时间和结束时间')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* 导出、打印功能
|
||||||
|
* item:当前按钮信息
|
||||||
|
* boxId:打印表单id(仅导出)
|
||||||
|
* name:导出后文件名(仅导出)
|
||||||
|
* tableData:传打印表格当前tableData(仅打印)
|
||||||
|
* tableColumn:传打印表格当前tableColumn(仅打印)
|
||||||
|
* */
|
||||||
|
fixedClick(item, boxId, name, tableData, tableColumn) {
|
||||||
|
if (item.title == '导出') {
|
||||||
|
this.exportEvent(name, boxId)
|
||||||
|
} else if (item.title == '打印') {
|
||||||
|
this.duplicate(tableData, tableColumn)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//导出功能
|
||||||
|
exportEvent(excelName, boxId) {
|
||||||
|
console.log(document.querySelector(boxId), '123', boxId)
|
||||||
|
let gatherData = {
|
||||||
|
raw: true
|
||||||
|
}
|
||||||
|
let grid = XLSX.utils.table_to_book(
|
||||||
|
document.querySelector(boxId),
|
||||||
|
gatherData
|
||||||
|
)
|
||||||
|
let workbook = XLSX.write(grid, {
|
||||||
|
bookType: 'xlsx',
|
||||||
|
bookSST: true,
|
||||||
|
type: 'array'
|
||||||
|
})
|
||||||
|
try {
|
||||||
|
FileSaver.saveAs(
|
||||||
|
new Blob([workbook], {
|
||||||
|
type: 'application/octet-stream'
|
||||||
|
}),
|
||||||
|
excelName + '.xlsx'
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
if (typeof console !== 'undefined') console.log(e, workbook)
|
||||||
|
}
|
||||||
|
return workbook
|
||||||
|
},
|
||||||
|
//打印
|
||||||
|
duplicate(tableData, tableColumn) {
|
||||||
|
basePrintJS(tableData, tableColumn)
|
||||||
|
},
|
||||||
|
//初始化表单
|
||||||
|
async init() {
|
||||||
|
this.tableLoading = true
|
||||||
|
let params = {
|
||||||
|
...this.queryCriteria,
|
||||||
|
...this.pageModel
|
||||||
|
}
|
||||||
|
//初始化表单
|
||||||
|
const res = await authApi('tocofsSaleoutServiceImplReport', 'tocofsSaleoutServiceImplReport', 'queryToCSalesReport', '', params)
|
||||||
|
console.log(res, '初始化res')
|
||||||
|
this.pageModel.pageTotal = res.attribute.total
|
||||||
|
this.mainTableData = this.dataDispose(
|
||||||
|
res.attribute.list,
|
||||||
|
this.tableDataMergeList
|
||||||
|
)
|
||||||
|
this.tableLoading = false
|
||||||
|
},
|
||||||
|
//data处理
|
||||||
|
dataDispose(data, arr) {
|
||||||
|
if (!arr.length) return data
|
||||||
|
//分类存放分组
|
||||||
|
let tempObj = {}
|
||||||
|
//结果
|
||||||
|
let result = []
|
||||||
|
//将层级转变为 [[1],[1,2],[1,2,3]]
|
||||||
|
const transformedArray = arr.reduce((acc, currentValue) => {
|
||||||
|
acc.push([...(acc.length ? acc[acc.length - 1] : []), currentValue])
|
||||||
|
return acc
|
||||||
|
}, [])
|
||||||
|
//开始对表单进行排序
|
||||||
|
//排序后的arr
|
||||||
|
let newArr = []
|
||||||
|
let sortObj = {}
|
||||||
|
data.forEach((item) => {
|
||||||
|
let keyValue = ''
|
||||||
|
arr.forEach((key2, index) => {
|
||||||
|
keyValue += item[key2]
|
||||||
|
})
|
||||||
|
if (!sortObj[keyValue]) {
|
||||||
|
sortObj[keyValue] = data.filter((item01) => {
|
||||||
|
return arr.every((prop) => item01[prop] === item[prop])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Object.keys(sortObj)
|
||||||
|
.sort()
|
||||||
|
.forEach((key) => {
|
||||||
|
newArr = [...newArr, ...sortObj[key]]
|
||||||
|
})
|
||||||
|
// 开始循环
|
||||||
|
newArr.forEach((item) => {
|
||||||
|
transformedArray.forEach((key) => {
|
||||||
|
//keyValue:当前key下的value加一起,用于tempObj的key
|
||||||
|
let keyValue = ''
|
||||||
|
key.forEach((keyItem, index) => {
|
||||||
|
keyValue += item[keyItem]
|
||||||
|
if (index < key.length - 1) {
|
||||||
|
keyValue += '|'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!tempObj[keyValue]) {
|
||||||
|
//拿到所有当前key下相同数据
|
||||||
|
tempObj[keyValue] = newArr.filter((item01) => {
|
||||||
|
return key.every((prop) => item01[prop] === item[prop])
|
||||||
|
})
|
||||||
|
// 计算总数
|
||||||
|
tempObj[keyValue][0][`${key[key.length - 1]}Length`] =
|
||||||
|
tempObj[keyValue].length
|
||||||
|
|
||||||
|
if (key.length === 1) {
|
||||||
|
result = [...tempObj[keyValue], ...result]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
baseNewTable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.MachineSchedulingTable {
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.div_title {
|
||||||
|
color: #696969;
|
||||||
|
background-color: #f1efef;
|
||||||
|
line-height: 35px;
|
||||||
|
height: 35px;
|
||||||
|
margin: 20px 0 10px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
> span {
|
||||||
|
width: 23%;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .search {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-left: 10px !important;
|
||||||
|
width: 200px !important;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
> .main {
|
||||||
|
> .tableBox {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-select {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -35,7 +35,7 @@
|
||||||
:tableData="tableData"
|
:tableData="tableData"
|
||||||
:tableColumn="tableColumn"
|
:tableColumn="tableColumn"
|
||||||
:tableDataMergeList="tableDataMergeList"
|
:tableDataMergeList="tableDataMergeList"
|
||||||
tableHeight="70vh"
|
tableHeight="calc(100vh - 440px)"
|
||||||
id="mainTable"
|
id="mainTable"
|
||||||
>
|
>
|
||||||
<template #new_state="{row}">
|
<template #new_state="{row}">
|
||||||
|
|
124
vue.config.js
124
vue.config.js
|
@ -1,17 +1,17 @@
|
||||||
"use strict";
|
'use strict'
|
||||||
const path = require("path");
|
const path = require('path')
|
||||||
|
|
||||||
function resolve(dir) {
|
function resolve(dir) {
|
||||||
return path.join(__dirname, dir);
|
return path.join(__dirname, dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
const CompressionPlugin = require("compression-webpack-plugin");
|
const CompressionPlugin = require('compression-webpack-plugin')
|
||||||
|
|
||||||
const name = process.env.VUE_APP_TITLE || "用安数智中台"; // 网页标题
|
const name = process.env.VUE_APP_TITLE || '用安数智中台' // 网页标题
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80; // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack')
|
||||||
|
|
||||||
// vue.config.js 配置说明
|
// vue.config.js 配置说明
|
||||||
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
||||||
|
@ -21,18 +21,18 @@ module.exports = {
|
||||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||||
// publicPath: process.env.NODE_ENV === "production" ? "/" : "./",
|
// publicPath: process.env.NODE_ENV === "production" ? "/" : "./",
|
||||||
publicPath: "./",
|
publicPath: './',
|
||||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||||
outputDir: "dist",
|
outputDir: 'dist',
|
||||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||||
assetsDir: "webPc",
|
assetsDir: 'webPc',
|
||||||
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
||||||
lintOnSave: process.env.NODE_ENV === "development",
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
// webpack-dev-server 相关配置
|
// webpack-dev-server 相关配置
|
||||||
devServer: {
|
devServer: {
|
||||||
host: "0.0.0.0",
|
host: '0.0.0.0',
|
||||||
// host:"localhost",z
|
// host:"localhost",z
|
||||||
port: port,
|
port: port,
|
||||||
open: true,
|
open: true,
|
||||||
|
@ -40,109 +40,109 @@ module.exports = {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
// target: `http://hzya.ufyct.com:9067/`,
|
// target: `http://hzya.ufyct.com:9067/`,
|
||||||
target: `http://ufidahz.com.cn:9067/`,
|
// target: `http://ufidahz.com.cn:9067/`,
|
||||||
// target: `http://127.0.0.1:9081/`,
|
// target: `http://127.0.0.1:9081/`,
|
||||||
// target: `http://192.168.2.78:9999`,
|
// target: `http://192.168.2.78:9999`,
|
||||||
// target: `http://192.168.2.85:9999`,
|
// target: `http://192.168.2.85:9999`,
|
||||||
// target: `http://192.168.2.78:8080`,
|
// target: `http://192.168.2.78:8080`,
|
||||||
// target: `http://192.168.2.78:10086`,
|
// target: `http://192.168.2.78:10086`,
|
||||||
// target: `http://192.168.2.185:9999`,
|
// target: `http://192.168.2.185:9999`,
|
||||||
// target: `http://192.168.2.83:9999`,
|
target: `http://192.168.2.86:9999`,
|
||||||
// target:'http://127.0.0.1:9999/',
|
// target:'http://127.0.0.1:9999/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
["^" + process.env.VUE_APP_BASE_API]: "",
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
disableHostCheck: true,
|
disableHostCheck: true
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
loaderOptions: {
|
loaderOptions: {
|
||||||
sass: {
|
sass: {
|
||||||
sassOptions: { outputStyle: "expanded" },
|
sassOptions: { outputStyle: 'expanded' }
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
name: name,
|
name: name,
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": resolve("src"),
|
'@': resolve('src')
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
||||||
new CompressionPlugin({
|
new CompressionPlugin({
|
||||||
cache: false, // 不启用文件缓存
|
cache: false, // 不启用文件缓存
|
||||||
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
||||||
filename: "[path].gz[query]", // 压缩后的文件名
|
filename: '[path].gz[query]', // 压缩后的文件名
|
||||||
algorithm: "gzip", // 使用gzip压缩
|
algorithm: 'gzip', // 使用gzip压缩
|
||||||
minRatio: 0.8, // 压缩率小于1才会压缩
|
minRatio: 0.8 // 压缩率小于1才会压缩
|
||||||
}),
|
}),
|
||||||
new webpack.ProvidePlugin({
|
new webpack.ProvidePlugin({
|
||||||
'window.Quill': 'quill/dist/quill.js',
|
'window.Quill': 'quill/dist/quill.js',
|
||||||
'Quill': 'quill/dist/quill.js'
|
'Quill': 'quill/dist/quill.js'
|
||||||
})
|
})
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
chainWebpack(config) {
|
chainWebpack(config) {
|
||||||
config.plugins.delete("preload"); // TODO: need test
|
config.plugins.delete('preload') // TODO: need test
|
||||||
config.plugins.delete("prefetch"); // TODO: need test
|
config.plugins.delete('prefetch') // TODO: need test
|
||||||
|
|
||||||
// set svg-sprite-loader
|
// set svg-sprite-loader
|
||||||
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
|
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
|
||||||
config.module
|
config.module
|
||||||
.rule("icons")
|
.rule('icons')
|
||||||
.test(/\.svg$/)
|
.test(/\.svg$/)
|
||||||
.include.add(resolve("src/assets/icons"))
|
.include.add(resolve('src/assets/icons'))
|
||||||
.end()
|
.end()
|
||||||
.use("svg-sprite-loader")
|
.use('svg-sprite-loader')
|
||||||
.loader("svg-sprite-loader")
|
.loader('svg-sprite-loader')
|
||||||
.options({
|
.options({
|
||||||
symbolId: "icon-[name]",
|
symbolId: 'icon-[name]'
|
||||||
})
|
})
|
||||||
.end();
|
.end()
|
||||||
|
|
||||||
config.when(process.env.NODE_ENV !== "development", (config) => {
|
config.when(process.env.NODE_ENV !== 'development', (config) => {
|
||||||
config
|
config
|
||||||
.plugin("ScriptExtHtmlWebpackPlugin")
|
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||||
.after("html")
|
.after('html')
|
||||||
.use("script-ext-html-webpack-plugin", [
|
.use('script-ext-html-webpack-plugin', [
|
||||||
{
|
{
|
||||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||||
inline: /runtime\..*\.js$/,
|
inline: /runtime\..*\.js$/
|
||||||
},
|
}
|
||||||
])
|
])
|
||||||
.end();
|
.end()
|
||||||
config.optimization.splitChunks({
|
config.optimization.splitChunks({
|
||||||
chunks: "all",
|
chunks: 'all',
|
||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
libs: {
|
libs: {
|
||||||
name: "chunk-libs",
|
name: 'chunk-libs',
|
||||||
test: /[\\/]node_modules[\\/]/,
|
test: /[\\/]node_modules[\\/]/,
|
||||||
priority: 10,
|
priority: 10,
|
||||||
chunks: "initial", // only package third parties that are initially dependent
|
chunks: 'initial' // only package third parties that are initially dependent
|
||||||
},
|
},
|
||||||
elementUI: {
|
elementUI: {
|
||||||
name: "chunk-elementUI", // split elementUI into a single package
|
name: 'chunk-elementUI', // split elementUI into a single package
|
||||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
|
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||||
},
|
},
|
||||||
commons: {
|
commons: {
|
||||||
name: "chunk-commons",
|
name: 'chunk-commons',
|
||||||
test: resolve("src/components"), // can customize your rules
|
test: resolve('src/components'), // can customize your rules
|
||||||
minChunks: 3, // minimum common number
|
minChunks: 3, // minimum common number
|
||||||
priority: 5,
|
priority: 5,
|
||||||
reuseExistingChunk: true,
|
reuseExistingChunk: true
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
config.optimization.runtimeChunk("single"),
|
config.optimization.runtimeChunk('single'),
|
||||||
{
|
{
|
||||||
from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
|
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
||||||
to: "./", //到根目录下
|
to: './' //到根目录下
|
||||||
};
|
}
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
|
|
Loading…
Reference in New Issue