|
@@ -87,12 +87,11 @@
|
|
|
<a-card :bordered="false">
|
|
|
<div class="chart">
|
|
|
<div class="someoneLossChart" v-if="queryParam.venName">
|
|
|
- <!-- :fatherList="dyeLossRateData" -->
|
|
|
- <someoneLossChart />
|
|
|
+ <someoneLossChart ref="someoneLossChart" />
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="allLossChart">
|
|
|
- <allLossChart :fatherList="dyeLossRateData" />
|
|
|
+ <allLossChart />
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-card>
|
|
@@ -107,7 +106,7 @@ import moment from 'moment'
|
|
|
import allLossChart from '@views/reportForms/dye-loss-table/allLossChart.vue'
|
|
|
import someoneLossChart from '@views/reportForms/dye-loss-table/someoneLossChart'
|
|
|
|
|
|
-import { dyeLossList } from '@api/reportForms/dye-loss-table.js'
|
|
|
+import { dyeLossList, exportXls } from '@api/reportForms/dye-loss-table.js'
|
|
|
|
|
|
// import FileSaver from 'file-saver'
|
|
|
// import XLSX from 'xlsx'
|
|
@@ -166,24 +165,22 @@ export default {
|
|
|
// current: '', //当前页
|
|
|
// pageSize: '' //一页多少
|
|
|
},
|
|
|
- cvenNameArr: [], //供应商数组 chart
|
|
|
- cinvNameArr: [], //物料名称数组chart
|
|
|
- colorArr: [] //颜色数组chart
|
|
|
+ someoneChartData: {
|
|
|
+ cvenNameArr: [], //供应商数组 chart
|
|
|
+ cinvNameArr: [], //物料名称数组chart
|
|
|
+ colorArr: [] //颜色数组chart
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// html渲染出来后,操作dom
|
|
|
mounted() {
|
|
|
this.cancelLoading()
|
|
|
- this.initEcharts()
|
|
|
+ // this.initEcharts()
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- // setTimeout(() => {
|
|
|
- // this.loading = !this.loading
|
|
|
- // }, 1000)
|
|
|
- this.getdyeLossList()
|
|
|
- // // console.log('000')
|
|
|
+ this.getdyeLossList() //查询染损列表
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -192,37 +189,36 @@ export default {
|
|
|
this.loading = false
|
|
|
}, 500)
|
|
|
},
|
|
|
- // 分页查询 染损列表
|
|
|
+
|
|
|
+ // 查询染损列表
|
|
|
getdyeLossList() {
|
|
|
this.$nextTick(() => {
|
|
|
dyeLossList(this.queryParam).then(res => {
|
|
|
- // console.log(res.result)
|
|
|
if (res.success) {
|
|
|
this.dyeLossRateData = res.result.records
|
|
|
- console.log('染损列表', this.dyeLossRateData)
|
|
|
this.pagination = {
|
|
|
total: res.result.total,
|
|
|
current: res.result.current,
|
|
|
pageSize: res.result.size
|
|
|
}
|
|
|
- console.log('分页器赋值:', this.pagination.total, this.pagination.current, this.pagination.pageSize)
|
|
|
+ // console.log('染损列表', this.dyeLossRateData)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- // 分页变化时触发
|
|
|
- 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() {
|
|
|
+ if (this.queryParam.venName) {
|
|
|
+ console.log('查询的是该供应商', this.queryParam.venName)
|
|
|
+ console.log('应该调指定供应商接口,渲染chart')
|
|
|
+ // 赋值给子组件作为接口参数
|
|
|
+ this.$refs.someoneLossChart.venName = this.queryParam.venName
|
|
|
+ console.log('[查询的供应商名称]', this.$refs.someoneLossChart.venName)
|
|
|
+ this.$refs.someoneLossChart.getSomeoneLossData()
|
|
|
+
|
|
|
+ console.log('父调子方法成功000')
|
|
|
+ }
|
|
|
this.getdyeLossList() // 渲染染损列表
|
|
|
},
|
|
|
searchReset() {
|
|
@@ -230,19 +226,20 @@ export default {
|
|
|
this.getdyeLossList()
|
|
|
},
|
|
|
|
|
|
- // 获取导出信息
|
|
|
- // async getInfoXls(fileName) {},
|
|
|
// 导出
|
|
|
handleExportXls(fileName) {
|
|
|
this.loading = false
|
|
|
console.log('需导出的fileName:', fileName)
|
|
|
const params = this.queryParam
|
|
|
console.log('导出参数', params)
|
|
|
+ exportXls().then(res => {
|
|
|
+ console.log('导出', res.result)
|
|
|
+ })
|
|
|
},
|
|
|
// 合计行 TODO: table 单元格合并
|
|
|
totalFooterShow(data) {
|
|
|
if (data) {
|
|
|
- console.log('需合计数据(合计行)data', data)
|
|
|
+ // console.log('需合计数据(合计行)data', data)
|
|
|
return (
|
|
|
<a-table
|
|
|
rowKey={Math.random}
|
|
@@ -254,6 +251,18 @@ export default {
|
|
|
></a-table>
|
|
|
)
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ // 分页变化时触发
|
|
|
+ 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()
|
|
|
}
|
|
|
},
|
|
|
computed: {
|