|
@@ -65,7 +65,7 @@
|
|
|
<a-button type="primary" icon="download" @click="handleExportXls('染损报表')">导出</a-button>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 子表合计 table rowKey="id" :scroll="{ x: 1500 }" -->
|
|
|
+ <!-- 子表合计 table rowKey="id" :scroll="{ x: 1500 }" :pagination="ipagination"-->
|
|
|
<div>
|
|
|
<a-table
|
|
|
bordered
|
|
@@ -74,7 +74,7 @@
|
|
|
:columns="dyeLossRateColumns"
|
|
|
:data-source="dyeLossRateData"
|
|
|
:loading="loading"
|
|
|
- :pagination="ipagination"
|
|
|
+ :pagination="pagination"
|
|
|
@change="handleTableChange"
|
|
|
ref="table"
|
|
|
:footer="totalFooterShow"
|
|
@@ -86,12 +86,13 @@
|
|
|
<!-- 引入 echarts -->
|
|
|
<a-card :bordered="false">
|
|
|
<div class="chart">
|
|
|
- <div class="someoneLossChart" v-if="queryParam.cVenName">
|
|
|
+ <div class="someoneLossChart" v-if="queryParam.venName">
|
|
|
+ <!-- :fatherList="dyeLossRateData" -->
|
|
|
<someoneLossChart />
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="allLossChart">
|
|
|
- <allLossChart />
|
|
|
+ <allLossChart :fatherList="dyeLossRateData" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-card>
|
|
@@ -121,222 +122,112 @@ export default {
|
|
|
return {
|
|
|
// 表头
|
|
|
dyeLossRateColumns: [
|
|
|
- // {
|
|
|
- // title: '序号',
|
|
|
- // width: 60,
|
|
|
- // dataIndex: 'index',
|
|
|
- // customRender: (text, record, index) => `${index + 1}`,
|
|
|
- // className: 'replacecolor'
|
|
|
- // },
|
|
|
{
|
|
|
title: '物料编码',
|
|
|
width: 120,
|
|
|
- dataIndex: 'cInvCode',
|
|
|
+ dataIndex: 'cinvCode',
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: '物料名称',
|
|
|
width: 160,
|
|
|
- dataIndex: 'cInvName',
|
|
|
+ dataIndex: 'cinvName',
|
|
|
className: 'replacecolor'
|
|
|
},
|
|
|
{ title: '颜色', width: 160, dataIndex: 'color', customRender: t => ellipsis(t), className: 'replacecolor' },
|
|
|
- { title: '供应商', width: 120, dataIndex: 'cVenName', className: 'replacecolor' },
|
|
|
+ { title: '供应商', width: 120, dataIndex: 'cvenName', className: 'replacecolor' },
|
|
|
{
|
|
|
title: '订单号',
|
|
|
width: 160,
|
|
|
- dataIndex: 'cCode',
|
|
|
+ dataIndex: 'ccode',
|
|
|
className: 'replacecolor'
|
|
|
- // customRender: function(text) {
|
|
|
- // if (text == '1') {
|
|
|
- // return '销售类型1'
|
|
|
- // }
|
|
|
- // if (text == '2') {
|
|
|
- // return '销售类型2'
|
|
|
- // }
|
|
|
- // if (text == '3') {
|
|
|
- // return '销售类型3'
|
|
|
- // }
|
|
|
- // if (text == '4') {
|
|
|
- // return '销售类型4'
|
|
|
- // }
|
|
|
- // }
|
|
|
},
|
|
|
- { title: '订单数量', width: 100, dataIndex: 'iQuantity', className: 'replacecolor' },
|
|
|
- { title: '采购入库数', width: 100, dataIndex: 'iQuantity2', className: 'replacecolor' },
|
|
|
- { title: '材料出库数', width: 100, dataIndex: 'iQuantity3', className: 'replacecolor' },
|
|
|
- { title: '核销数量', width: 100, dataIndex: 'iMSQuantity', className: 'replacecolor' },
|
|
|
+ { title: '订单数量', width: 100, dataIndex: 'iquantity', className: 'replacecolor' },
|
|
|
+ { title: '采购入库数', width: 100, dataIndex: 'iquantity2', className: 'replacecolor' },
|
|
|
+ { title: '材料出库数', width: 100, dataIndex: 'iquantity3', className: 'replacecolor' },
|
|
|
+ { title: '核销数量', width: 100, dataIndex: 'imsquantity', className: 'replacecolor' },
|
|
|
{ title: '染损', width: 120, dataIndex: 'dyeLossRate', className: 'replacecolor' }
|
|
|
],
|
|
|
- dyeLossRateData: [
|
|
|
- // {
|
|
|
- // cInvCode: '3801000890',
|
|
|
- // cInvName: '女装印花袋鼠袋拉毛绒布带帽衫',
|
|
|
- // color: '女装印花袋鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '20',
|
|
|
- // iQuantity2: '20',
|
|
|
- // iQuantity3: '20',
|
|
|
- // iMSQuantity: '20',
|
|
|
- // dyeLossRate: '4.32%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '1901034590',
|
|
|
- // cInvName: '鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '30',
|
|
|
- // iQuantity2: '30',
|
|
|
- // iQuantity3: '30',
|
|
|
- // iMSQuantity: '30',
|
|
|
- // dyeLossRate: '31.34%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '3801000890',
|
|
|
- // cInvName: '女装印花袋鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '20',
|
|
|
- // iQuantity2: '20',
|
|
|
- // iQuantity3: '20',
|
|
|
- // iMSQuantity: '20',
|
|
|
- // dyeLossRate: '4.32%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '1901034590',
|
|
|
- // cInvName: '鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '30',
|
|
|
- // iQuantity2: '30',
|
|
|
- // iQuantity3: '30',
|
|
|
- // iMSQuantity: '30',
|
|
|
- // dyeLossRate: '31.34%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '3801000890',
|
|
|
- // cInvName: '女装印花袋鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '20',
|
|
|
- // iQuantity2: '20',
|
|
|
- // iQuantity3: '20',
|
|
|
- // iMSQuantity: '20',
|
|
|
- // dyeLossRate: '4.32%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '1901034590',
|
|
|
- // cInvName: '1',
|
|
|
- // iQuantity: '30',
|
|
|
- // color: 'red',
|
|
|
- // cVenName: 'uuuuu',
|
|
|
- // cCode: 'TT765',
|
|
|
- // iQuantity2: '3',
|
|
|
- // iQuantity3: '22',
|
|
|
- // iMSQuantity: '30',
|
|
|
- // dyeLossRate: '1%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '3801000890',
|
|
|
- // cInvName: '2',
|
|
|
- // iQuantity: '20',
|
|
|
- // iQuantity2: '2',
|
|
|
- // iQuantity3: '11',
|
|
|
- // color: 'orange',
|
|
|
- // cVenName: 'RRRR',
|
|
|
- // cCode: 'YY78',
|
|
|
- // iMSQuantity: '20',
|
|
|
- // dyeLossRate: '2%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '1901034590',
|
|
|
- // cInvName: '3',
|
|
|
- // iQuantity: '30',
|
|
|
- // iQuantity2: '3',
|
|
|
- // color: 'gray',
|
|
|
- // cVenName: 'AAAA',
|
|
|
- // cCode: 'AA78',
|
|
|
- // iQuantity3: '10',
|
|
|
- // iMSQuantity: '30',
|
|
|
- // dyeLossRate: '3%'
|
|
|
- // }
|
|
|
- // {
|
|
|
- // cInvCode: '3801000890',
|
|
|
- // cInvName: '女装印花袋鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '20',
|
|
|
- // iQuantity2: '20',
|
|
|
- // iQuantity3: '20',
|
|
|
- // iMSQuantity: '20',
|
|
|
- // dyeLossRate: '4.32%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '1901034590',
|
|
|
- // cInvName: '鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '30',
|
|
|
- // iQuantity2: '30',
|
|
|
- // iQuantity3: '30',
|
|
|
- // iMSQuantity: '30',
|
|
|
- // dyeLossRate: '31.34%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '3801000890',
|
|
|
- // cInvName: '女装印花袋鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '20',
|
|
|
- // iQuantity2: '20',
|
|
|
- // iQuantity3: '20',
|
|
|
- // iMSQuantity: '20',
|
|
|
- // dyeLossRate: '4.32%'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cInvCode: '1901034590',
|
|
|
- // cInvName: '鼠袋拉毛绒布带帽衫',
|
|
|
- // iQuantity: '30',
|
|
|
- // iQuantity2: '30',
|
|
|
- // iQuantity3: '30',
|
|
|
- // iMSQuantity: '30',
|
|
|
- // dyeLossRate: '31.34%'
|
|
|
- // }
|
|
|
- ],
|
|
|
+ dyeLossRateData: [], //染损数据
|
|
|
loading: false, // 表格加载
|
|
|
|
|
|
queryParam: {
|
|
|
code: '', //订单号
|
|
|
orderType: '', //订单类型
|
|
|
- venName: '', //供应商
|
|
|
+ cvenName: '', //供应商
|
|
|
planLotNumber: '', //计划单号
|
|
|
csocode: '', //销售订单号
|
|
|
- pageNo: '', // 初始页
|
|
|
- pageSize: '-1' // 为了显示数据总计数
|
|
|
+ pageNo: '1' // 初始页
|
|
|
+ // pageSize: '10' // 为了显示数据总计数
|
|
|
},
|
|
|
// 分页
|
|
|
pagination: {
|
|
|
- total: '',
|
|
|
+ total: 0,
|
|
|
current: 0,
|
|
|
pageSize: 0
|
|
|
- }
|
|
|
+ },
|
|
|
+ cvenNameArr: [], //供应商数组 chart
|
|
|
+ cinvNameArr: [], //物料名称数组chart
|
|
|
+ colorArr: [] //颜色数组chart
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // html渲染出来后,操作dom
|
|
|
+ mounted() {
|
|
|
+ this.cancelLoading()
|
|
|
+ this.initEcharts()
|
|
|
+ },
|
|
|
+
|
|
|
created() {
|
|
|
- this.getdyeLossList() // 渲染 染损列表
|
|
|
- console.log('000')
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.loading = !this.loading
|
|
|
+ // }, 1000)
|
|
|
+ this.getdyeLossList()
|
|
|
+ // // console.log('000')
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ cancelLoading() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false
|
|
|
+ }, 500)
|
|
|
+ },
|
|
|
// 分页查询 染损列表
|
|
|
getdyeLossList() {
|
|
|
this.$nextTick(() => {
|
|
|
console.log('111')
|
|
|
dyeLossList(this.queryParam).then(res => {
|
|
|
- console.log('2222')
|
|
|
- console.log(res.result);
|
|
|
+ console.log('查询接口调成')
|
|
|
+ console.log(res.result)
|
|
|
if (res.success) {
|
|
|
console.log('333')
|
|
|
this.dyeLossRateData = res.result.records
|
|
|
console.log('染损列表', this.dyeLossRateData)
|
|
|
+ console.log('染损列表cvenName', this.dyeLossRateData.cinvCode)
|
|
|
// 分页信息赋值
|
|
|
this.pagination = {
|
|
|
total: res.result.total,
|
|
|
current: res.result.current,
|
|
|
pageSize: res.result.size
|
|
|
}
|
|
|
+ console.log('this.pagination:', this.pagination)
|
|
|
+ console.log('res.result.total', res.result.total)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ // 分页、排序、筛选变化时触发
|
|
|
+ handleTableChange(pagination, filters, sorter) {
|
|
|
+ console.log('当前页信息>>>>', pagination)
|
|
|
+ if (Object.keys(sorter).length > 0) {
|
|
|
+ this.isorter.column = sorter.field
|
|
|
+ this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
|
|
|
+ }
|
|
|
+ this.queryParam.pageNo = pagination.current
|
|
|
+ console.log('this.queryParam.pageNo', this.queryParam.pageNo)
|
|
|
+ this.getdyeLossList()
|
|
|
+ },
|
|
|
// 查询按钮
|
|
|
searchQuery() {
|
|
|
this.getdyeLossList() // 渲染染损列表
|
|
@@ -346,11 +237,6 @@ export default {
|
|
|
this.getdyeLossList()
|
|
|
},
|
|
|
|
|
|
- handleTableChange() {
|
|
|
- console.log('??这是啥')
|
|
|
- this.$message.error('已取消选择')
|
|
|
- },
|
|
|
-
|
|
|
// 获取导出信息
|
|
|
// async getInfoXls(fileName) {},
|
|
|
// 导出
|
|
@@ -360,11 +246,9 @@ export default {
|
|
|
const params = this.queryParam
|
|
|
console.log('导出参数', params)
|
|
|
},
|
|
|
- // 合计行 TODO: 怎么合计数值 及 table 单元格合并
|
|
|
+ // 合计行 TODO: table 单元格合并
|
|
|
totalFooterShow(data) {
|
|
|
- // 后端传递的合计的数据
|
|
|
- console.log('染损报表----合计行')
|
|
|
- // console.log('data', data)
|
|
|
+ console.log('需合计数据(合计行)data', data)
|
|
|
return (
|
|
|
<a-table
|
|
|
rowKey={Math.random}
|
|
@@ -385,30 +269,30 @@ export default {
|
|
|
summary[attr] = '合计'
|
|
|
}
|
|
|
let iQuantityNum = 0 //订单数量 合计
|
|
|
- this.dyeLossRateData.forEach(({ iQuantity }) => {
|
|
|
- iQuantityNum = parseInt(iQuantityNum) + parseInt(iQuantity)
|
|
|
+ this.dyeLossRateData.forEach(({ iquantity }) => {
|
|
|
+ iQuantityNum = parseInt(iQuantityNum) + parseInt(iquantity)
|
|
|
})
|
|
|
- summary['iQuantity'] = iQuantityNum
|
|
|
+ summary['iquantity'] = iQuantityNum
|
|
|
|
|
|
let iQuantity2Num = 0 //采购入库数 合计
|
|
|
- this.dyeLossRateData.forEach(({ iQuantity2 }) => {
|
|
|
- iQuantity2Num = parseInt(iQuantity2Num) + parseInt(iQuantity2)
|
|
|
+ this.dyeLossRateData.forEach(({ iquantity2 }) => {
|
|
|
+ iQuantity2Num = parseInt(iQuantity2Num) + parseInt(iquantity2)
|
|
|
})
|
|
|
- summary['iQuantity2'] = iQuantity2Num
|
|
|
+ summary['iquantity2'] = iQuantity2Num
|
|
|
|
|
|
let iQuantity3Num = 0 //材料出库数 合计
|
|
|
- this.dyeLossRateData.forEach(({ iQuantity3 }) => {
|
|
|
- iQuantity3Num = parseInt(iQuantity3Num) + parseInt(iQuantity3)
|
|
|
+ this.dyeLossRateData.forEach(({ iquantity3 }) => {
|
|
|
+ iQuantity3Num = parseInt(iQuantity3Num) + parseInt(iquantity3)
|
|
|
})
|
|
|
- summary['iQuantity3'] = iQuantity3Num
|
|
|
+ summary['iquantity3'] = iQuantity3Num
|
|
|
|
|
|
let iMSQuantityNum = 0 //核销数量 合计
|
|
|
- this.dyeLossRateData.forEach(({ iMSQuantity }) => {
|
|
|
- iMSQuantityNum = parseInt(iMSQuantityNum) + parseInt(iMSQuantity)
|
|
|
+ this.dyeLossRateData.forEach(({ imsquantity }) => {
|
|
|
+ iMSQuantityNum = parseInt(iMSQuantityNum) + parseInt(imsquantity)
|
|
|
})
|
|
|
- summary['iMSQuantity'] = iMSQuantityNum
|
|
|
+ summary['imsquantity'] = iMSQuantityNum
|
|
|
|
|
|
- let dyeLossRateNum = 0 //染损
|
|
|
+ let dyeLossRateNum = 0 //染损合计
|
|
|
this.dyeLossRateData.forEach(({ dyeLossRate }) => {
|
|
|
dyeLossRateNum = parseInt(dyeLossRateNum) + parseInt(dyeLossRate)
|
|
|
})
|