Przeglądaj źródła

材料费对比

wyh 1 rok temu
rodzic
commit
f614810f7f

+ 3 - 0
src/api/kzksApi.js

@@ -19,6 +19,8 @@ const proCostYSKdetail = (params)=>getAction("/xmcbDetail/comContractInfoExchang
 
 // 项目成本对比————总体对比
 const getDbList = (params)=>getAction("/projectCost/projectCost/compareList", params);
+// 项目成本对比————材料费对比
+const getDbClList = (params)=>getAction("wzOutboundOrder/wzOutboundOrderH/compareCLFDetailList", params);
 
 
 export {
@@ -28,6 +30,7 @@ export {
   proCostContractdetail,
   proCostYSKdetail,
   getDbList,
+  getDbClList
 }
 
 

+ 1 - 1
src/views/module_kzks/projectContrastList/allList.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-table :columns="columns" :data-source="data" bordered :scroll="{ x: 4750 }" :pagination="ipagination">
+  <a-table :columns="columns" :data-source="data" bordered :scroll="{ x: 4750 }" :pagination="ipagination" rowKey="id">
   </a-table>
 </template>
 <script>

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

@@ -1,77 +1,56 @@
 <template>
-  <a-table :columns="columns" :data-source="data" bordered :pagination="ipagination">
+  <a-table :columns="columns" :data-source="data" bordered :pagination="ipagination2" rowKey="id">
   </a-table>
 </template>
 <script>
 const columns = [
   {
-    title: '任务号',
+    title: '物资编码',
     align:"center",
-    dataIndex: 'name',
-    key: 'name',
+    dataIndex: 'wlbm',
+    key: 'wlbm',
     customRender:function (t,r,index) {
         return {children: t,attrs: {rowSpan:r.rowSpan}};
     },
   },
   {
-    title: '物资编码',
+    title: '任务号',
     align:"center",
-    dataIndex: 'age',
-    key: 'age',
+    dataIndex: 'rwh',
+    key: 'rwh',
   },
   {
     title: '总数量',
     align:"center",
-    dataIndex: 'address',
-    key: 'address',
+    dataIndex: 'zsl',
+    key: 'zsl',
   },
   {
     title: '总金额',
     align:"center",
-    key: 'tags',
-    dataIndex: 'tags',
+    key: 'zje',
+    dataIndex: 'zje',
     // scopedSlots: { customRender: 'tags' },
   },
 ];
 
-const data = [
-  {
-    key: '1',
-    name: 'John Brown',
-    age: 32,
-    address: 'New York No. 1 Lake Park',
-    tags: ['nice', 'developer'],
-  },
-  {
-    key: '2',
-    name: 'Jim Green',
-    age: 42,
-    address: 'London No. 1 Lake Park',
-    tags: ['loser'],
-  },
-  {
-    key: '3',
-    name: 'Joe Black',
-    age: 32,
-    address: 'Sidney No. 1 Lake Park',
-    tags: ['cool', 'teacher'],
-  },
-  {
-    key: '4',
-    name: 'Joe Black',
-    age: 32,
-    address: 'Sidney No. 1 Lake Park',
-    tags: ['cool', 'teacher'],
-  },
-];
+const data = [];
 
 export default {
+    props: {
+        // 对比表格数据
+        duibiclList: {
+        type: Array,
+        default: ()=>{},
+        required: false
+        }
+    },
   data() {
     return {
       data,
       columns,
       /* 分页参数 */
-      ipagination:{
+      ipagination2:{
         current: 1,
         pageSize: 10,
         pageSizeOptions: ['10', '20', '30'],
@@ -85,28 +64,29 @@ export default {
     };
   },
   created(){
+    this.data = this.duibiclList
     this.getHebing()
   },
   methods: {
     getHebing(){
         let that = this
         let rowSpan = 0
-        let name = ''
+        let wlbm = ''
         for (let i = that.data.length-1; i >= 0; i--) {
             // 任务号合并
-            if (name == '') {
+            if (wlbm == '') {
                 that.data[i].rowSpan = 0
-                name = that.data[i].name
+                wlbm = that.data[i].wlbm
                 rowSpan++
                 } else {
-                if(name == that.data[i].name){
+                if(wlbm == that.data[i].wlbm){
                     that.data[i].rowSpan = 0
                     rowSpan++
                 }else{
                     that.data[i+1].rowSpan = rowSpan
                     that.data[i].rowSpan = 0
                     rowSpan = 1
-                    name = that.data[i].name
+                    wlbm = that.data[i].wlbm
                 }
             }
         }

+ 16 - 3
src/views/module_kzks/projectCostList/ProjectCostList.vue

@@ -234,7 +234,7 @@
           <all-list :duibiList="duibiList"></all-list>
         </a-tab-pane>
         <a-tab-pane key="2" tab="材料费对比" force-render>
-          <wuliao-list></wuliao-list>
+          <wuliao-list :duibiclList="duibiclList"></wuliao-list>
         </a-tab-pane>
       </a-tabs>
 
@@ -247,7 +247,7 @@
 
 <script>
   import Vue from 'vue'
-  import { columnsSelect, columnsEdit, proCostYSKdetail, proCostContractdetail, getDbList } from '@/api/kzksApi.js'
+  import { columnsSelect, columnsEdit, proCostYSKdetail, proCostContractdetail, getDbList, getDbClList } from '@/api/kzksApi.js'
 
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
@@ -269,6 +269,8 @@ import WuliaoList from '../projectContrastList/wuliaoList.vue'
         description: '项目成本管理页面',
         // 获取到的对比数据
         duibiList: [],
+        // 获取到的材料费对比数据
+        duibiclList: [],
         // 对比弹框是否显示
         duiBi: false,
         // 表头:当前显示的列,初始为全部
@@ -677,19 +679,30 @@ import WuliaoList from '../projectContrastList/wuliaoList.vue'
       },
       // 对比
       batchDuiBi(){
-        console.log(this.selectedRowKeys)
+        console.log(this.selectedRowKeys,this.selectionRows)
         // console.log(JSON.stringify(this.selectedRowKeys))
         var a = this.selectedRowKeys
         var ids = a.toString()
         getDbList({ids: ids}).then((res) => {
           console.log(res)
           this.duibiList = res
+        })
+        var selectTasknos = this.selectionRows.map( res => {
+          return res.taskno
+        })
+        var tasknos = selectTasknos.toString()
+        console.log(tasknos)
+        getDbClList({tasknos: tasknos}).then((res) => {
+          console.log(res)
+          this.duibiclList = res
           this.duiBi = true
         })
       },
       // 关闭对比弹框
       handleGb(){
         this.duiBi = false
+        this.duibiList = []
+        this.duibiclList = []
       }
     }
   }