|
@@ -13,9 +13,9 @@
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="开始日期">
|
|
|
+ <a-form-item label="开始月份">
|
|
|
<a-date-picker
|
|
|
- placeholder="请选择开始日期"
|
|
|
+ placeholder="请选择开始月份"
|
|
|
style="width: 100%"
|
|
|
format="YYYY-MM"
|
|
|
v-model="queryParam.startDate"
|
|
@@ -24,9 +24,9 @@
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="结束日期">
|
|
|
+ <a-form-item label="结束月份">
|
|
|
<a-date-picker
|
|
|
- placeholder="请选择结束日期"
|
|
|
+ placeholder="请选择结束月份"
|
|
|
style="width: 100%"
|
|
|
format="YYYY-MM"
|
|
|
v-model="queryParam.endDate"
|
|
@@ -37,19 +37,19 @@
|
|
|
<template v-if="toggleSearchStatus">
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<a-form-item label="订单类型">
|
|
|
- <a-input placeholder="请输入订单类型" v-model="queryParam.iOrderType"></a-input>
|
|
|
+ <a-input placeholder="请输入订单类型" v-model="queryParam.orderType"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<a-form-item label="供应商">
|
|
|
- <a-input placeholder="请输入供应商" v-model="queryParam.cVenCode"></a-input>
|
|
|
+ <a-input placeholder="请输入供应商" v-model="queryParam.venCode"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<a-form-item label="计划单号">
|
|
|
- <a-input placeholder="请输入计划单号" v-model="queryParam.cPlanLotNumber"></a-input>
|
|
|
+ <a-input placeholder="请输入计划单号" v-model="queryParam.planLotNumber"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
@@ -73,8 +73,12 @@
|
|
|
<a-card :bordered="false" style="marginTop:10px;">
|
|
|
<div class="table-operator">
|
|
|
<a-button type="primary" @click="handleExportXls('供应链产能报表')" icon="download">合并导出</a-button>
|
|
|
- <a-button type="primary" @click="monthSupplyExport" icon="download">月份供应商合计导出</a-button>
|
|
|
- <a-button type="primary" @click="monthDepartExport" icon="download">月份部门合计导出</a-button>
|
|
|
+ <a-button type="primary" @click="monthSupplyExport('月份供应商合计导出')" icon="download"
|
|
|
+ >月份供应商合计导出</a-button
|
|
|
+ >
|
|
|
+ <a-button type="primary" @click="monthDepartExport('月份部门合计导出')" icon="download"
|
|
|
+ >月份部门合计导出</a-button
|
|
|
+ >
|
|
|
</div>
|
|
|
|
|
|
<!-- 合计 table rowKey="id" :scroll="{ x: 1500 }" :pagination="ipagination -->
|
|
@@ -97,8 +101,8 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
-import { supplyCapList, handleXls, monthSupplyXls, monthDepartXls } from '@api/reportForms/supply-capacity-table'
|
|
|
-
|
|
|
+import { supplyCapList } from '@api/reportForms/supply-capacity-table'
|
|
|
+import { downFile } from '@/api/manage'
|
|
|
export default {
|
|
|
name: 'SupplyCapacityTable', // 供应商产能报表
|
|
|
mixins: [JeecgListMixin],
|
|
@@ -119,12 +123,12 @@ export default {
|
|
|
{
|
|
|
title: '计划单号',
|
|
|
width: 120,
|
|
|
- dataIndex: 'cPlanLotNumber',
|
|
|
+ dataIndex: 'planLotNumber',
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
{ title: '部门', width: 120, dataIndex: 'cDepCode', className: 'replacecolor' },
|
|
|
{ title: '业务员', width: 120, dataIndex: 'cPersonCode', className: 'replacecolor' },
|
|
|
- { title: '供应商', width: 120, dataIndex: 'cVenCode', className: 'replacecolor' },
|
|
|
+ { title: '供应商', width: 120, dataIndex: 'venCode', className: 'replacecolor' },
|
|
|
// customRender: function(text) {
|
|
|
// if (text == '1') {
|
|
|
// return '销售类型1'
|
|
@@ -139,8 +143,8 @@ export default {
|
|
|
// return '销售类型4'
|
|
|
// }
|
|
|
// }
|
|
|
- { title: '供应商类型', width: 120, dataIndex: 'cVenCodeType', className: 'replacecolor' },
|
|
|
- { title: '订单类型', width: 120, dataIndex: 'iOrderType', className: 'replacecolor' },
|
|
|
+ { title: '供应商类型', width: 120, dataIndex: 'venCodeType', className: 'replacecolor' },
|
|
|
+ { title: '订单类型', width: 120, dataIndex: 'orderType', className: 'replacecolor' },
|
|
|
{
|
|
|
title: '数量',
|
|
|
width: 120,
|
|
@@ -176,9 +180,9 @@ export default {
|
|
|
csrccode: '',
|
|
|
startDate: '',
|
|
|
endDate: '',
|
|
|
- iOrderType: '',
|
|
|
- cVenCode: '',
|
|
|
- cPlanLotNumber: '',
|
|
|
+ orderType: '',
|
|
|
+ venCode: '',
|
|
|
+ planLotNumber: '',
|
|
|
pageNo: '' // 当前页
|
|
|
},
|
|
|
// 分页
|
|
@@ -192,7 +196,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getSupplyCapList() // 渲染 供应链产能报表
|
|
|
- console.log('000')
|
|
|
+ // console.log('000')
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -200,9 +204,9 @@ export default {
|
|
|
getSupplyCapList() {
|
|
|
this.$nextTick(() => {
|
|
|
supplyCapList(this.queryParam).then(res => {
|
|
|
- console.log('111')
|
|
|
+ // console.log('111')
|
|
|
if (res.success) {
|
|
|
- console.log('222')
|
|
|
+ // console.log('222')
|
|
|
this.supplyCapacityData = res.result.records
|
|
|
console.log('【供应商产能报表数据】:', this.supplyCapacityData)
|
|
|
this.pagination = {
|
|
@@ -216,22 +220,79 @@ export default {
|
|
|
},
|
|
|
|
|
|
//合并导出
|
|
|
- handleExportXls() {
|
|
|
- handleXls().then(res => {
|
|
|
- console.log('合并导出ok')
|
|
|
+ handleExportXls(fileName) {
|
|
|
+ console.log('需导出的fileName:', fileName)
|
|
|
+ const params = this.supplyCapacityData
|
|
|
+ console.log('导出参数', params)
|
|
|
+ downFile('/scas/supplierCapacity/excel1', params).then(data => {
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', fileName + '.xls')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// 月份供应链合计导出
|
|
|
- monthSupplyExport() {
|
|
|
- monthSupplyXls().then(res => {
|
|
|
- console.log('月份供应链合计导出ok')
|
|
|
+ monthSupplyExport(fileName) {
|
|
|
+ console.log('需导出的fileName:', fileName)
|
|
|
+ const params = this.supplyCapacityData
|
|
|
+ console.log('导出参数', params)
|
|
|
+ downFile('/scas/supplierCapacity/excel3', params).then(data => {
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', fileName + '.xls')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 月份部门合计导出
|
|
|
- monthDepartExport() {
|
|
|
- monthDepartXls().then(res => {
|
|
|
- console.log('月份部门合计导出ok')
|
|
|
+ monthDepartExport(fileName) {
|
|
|
+ console.log('需导出的fileName:', fileName)
|
|
|
+ const params = this.supplyCapacityData
|
|
|
+ console.log('导出参数', params)
|
|
|
+ downFile('/scas/supplierCapacity/excel2', params).then(data => {
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', fileName + '.xls')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
|