|
@@ -82,54 +82,73 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 数据处理
|
|
// 数据处理
|
|
loadData(){
|
|
loadData(){
|
|
- console.log(this.duibiTasknos)
|
|
|
|
- getDbClList({tasknos: this.duibiTasknos}).then((res) => {
|
|
|
|
|
|
+ // console.log(this.duibiTasknos)
|
|
|
|
+ var params = {
|
|
|
|
+ tasknos: this.duibiTasknos,
|
|
|
|
+ pageNo: this.ipagination.current,
|
|
|
|
+ pageSize: this.ipagination.pageSize,
|
|
|
|
+ }
|
|
|
|
+ getDbClList(params).then((res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
- var arrList = res.result.resultVOList
|
|
|
|
- // 头部
|
|
|
|
- arrList[0].taskVoList.forEach(item => {
|
|
|
|
- this.columns.push({
|
|
|
|
- title: item.taskno,
|
|
|
|
- // dataIndex: Object.keys(item)[1],
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- title: '是否含有',
|
|
|
|
- align: 'center',
|
|
|
|
- width: 100,
|
|
|
|
- dataIndex: 'flag_' + item.taskno,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '实发总数量',
|
|
|
|
- align: 'center',
|
|
|
|
- dataIndex: 'totalCount_' + item.taskno,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '归一化单价',
|
|
|
|
- align: 'center',
|
|
|
|
- dataIndex: 'unitPrice_' + item.taskno,
|
|
|
|
- customCell: this.setCustomCell,
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- })
|
|
|
|
- });
|
|
|
|
- // 表格数据处理
|
|
|
|
- arrList.forEach(item=>{
|
|
|
|
- // console.log(item)
|
|
|
|
- var objItem = {}
|
|
|
|
- objItem.ggxh = item.ggxh
|
|
|
|
- objItem.wlbm = item.wlbm
|
|
|
|
- objItem.wlmc = item.wlmc
|
|
|
|
- objItem.equal = item.equal
|
|
|
|
- item.taskVoList.forEach(ele=>{
|
|
|
|
- // console.log(ele)
|
|
|
|
- objItem['flag_'+ele.taskno] = ele.flag==='yes'?'√':'×'
|
|
|
|
- objItem['totalCount_'+ele.taskno] = ele.totalCount?ele.totalCount:'-'
|
|
|
|
- objItem['unitPrice_'+ele.taskno] = ele.unitPrice?ele.unitPrice:'-'
|
|
|
|
|
|
+ if(res.success){
|
|
|
|
+ // 分页
|
|
|
|
+ if(res.result.total) {
|
|
|
|
+ this.ipagination.total = res.result.total;
|
|
|
|
+ } else {
|
|
|
|
+ this.ipagination.total = 0;
|
|
|
|
+ }
|
|
|
|
+ // 处理数据
|
|
|
|
+ var arrList = res.result.records
|
|
|
|
+ // 头部
|
|
|
|
+ arrList[0].taskVoList.forEach(item => {
|
|
|
|
+ this.columns.push({
|
|
|
|
+ title: item.taskno,
|
|
|
|
+ // dataIndex: Object.keys(item)[1],
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ title: '是否含有',
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 100,
|
|
|
|
+ dataIndex: 'flag_' + item.taskno,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '实发总数量',
|
|
|
|
+ align: 'center',
|
|
|
|
+ dataIndex: 'totalCount_' + item.taskno,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '归一化单价(元)',
|
|
|
|
+ align: 'center',
|
|
|
|
+ dataIndex: 'unitPrice_' + item.taskno,
|
|
|
|
+ customCell: this.setCustomCell,
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ // 表格数据处理
|
|
|
|
+ arrList.forEach(item=>{
|
|
|
|
+ // console.log(item)
|
|
|
|
+ var objItem = {}
|
|
|
|
+ objItem.id = item.id
|
|
|
|
+ objItem.ggxh = item.ggxh
|
|
|
|
+ objItem.wlbm = item.wlbm
|
|
|
|
+ objItem.wlmc = item.wlmc
|
|
|
|
+ objItem.equal = item.equal
|
|
|
|
+ item.taskVoList.forEach(ele=>{
|
|
|
|
+ // console.log(ele)
|
|
|
|
+ objItem['flag_'+ele.taskno] = ele.flag==='yes'?'√':'×'
|
|
|
|
+ objItem['totalCount_'+ele.taskno] = ele.totalCount?ele.totalCount:'-'
|
|
|
|
+ objItem['unitPrice_'+ele.taskno] = ele.unitPrice?ele.unitPrice:'-'
|
|
|
|
+ })
|
|
|
|
+ // console.log(objItem)
|
|
|
|
+ this.dataSource.push(objItem)
|
|
})
|
|
})
|
|
- console.log(objItem)
|
|
|
|
- this.dataSource.push(objItem)
|
|
|
|
- })
|
|
|
|
- console.log(this.dataSource)
|
|
|
|
|
|
+ // console.log(this.dataSource)
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.warning(res.message)
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
setCustomCell(record, index){
|
|
setCustomCell(record, index){
|
|
@@ -145,7 +164,8 @@ export default {
|
|
if(!record.equal){
|
|
if(!record.equal){
|
|
return {
|
|
return {
|
|
style: {
|
|
style: {
|
|
- 'color': '#1890ff',
|
|
|
|
|
|
+ 'color': '#ff1832',
|
|
|
|
+ // 'color': '#1890ff',
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|