yuhan il y a 1 an
Parent
commit
19dbc2f31f

+ 9 - 8
src/views/module_kzks/projectContrastList/allList.vue

@@ -5,17 +5,17 @@
     </a-table> -->
     <a-table
       ref="table"
-      size="middle"
       :scroll="{x:true}"
       bordered
       rowKey="id"
       :columns="columns"
       :dataSource="tableData"
-      :pagination="ipagination"
-      :loading="loading"
-      class="j-table-force-nowrap"
-      @change="handleTableChange">
+      :pagination="false"
+      class="j-table-force-nowrap">
     </a-table>
+    <!-- :loading="loading" -->
+    <!-- size="middle" -->
+    <!-- :pagination="ipagination" -->
     <!-- <div class="extra-item" style="margin-top: 20px;">
       <a-button :type="selectedMode==='single'?'primary':'link'" @click="selectedMode = 'single'">单选</a-button>
       <a-button :type="selectedMode==='multiple'?'primary':'link'" @click="selectedMode = 'multiple'">多选</a-button>
@@ -26,13 +26,13 @@
 </template>
 <script>
 import '@/assets/less/TableExpand.less'
-import { mixinDevice } from '@/utils/mixin'
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+// import { mixinDevice } from '@/utils/mixin'
+// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { getDbList, getHjList } from '@/api/kzksApi.js'
 import lineBarChart from './components/lineBarChart.vue'
 
 export default {
-  mixins:[JeecgListMixin, mixinDevice],
+  // mixins:[JeecgListMixin, mixinDevice],
   components: { lineBarChart },
   // props: {
   //   // 对比表格数据
@@ -340,6 +340,7 @@ export default {
     },
   },
   created(){
+    this.loadData()
   },
   methods: {
     // 数据处理

+ 67 - 47
src/views/module_kzks/projectContrastList/wuliaoList.vue

@@ -82,54 +82,73 @@ export default {
   methods: {
     // 数据处理
     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)
-        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){
@@ -145,7 +164,8 @@ export default {
       if(!record.equal){
         return {
           style: {
-            'color': '#1890ff',
+            'color': '#ff1832',
+            // 'color': '#1890ff',
           },
         }
       }