Przeglądaj źródła

材料费对比和外协价格库参数

yuhan 1 rok temu
rodzic
commit
f956cbe614

Plik diff jest za duży
+ 41 - 1253
src/views/module_kzks/costModelWxContract/CostModelWxContractList.vue


+ 281 - 254
src/views/module_kzks/projectContrastList/allList.vue

@@ -1,7 +1,20 @@
 <template>
   <div>
     <!-- <a-table :columns="columns" :data-source="data" bordered :scroll="{ x: 4750 }" :pagination="ipagination" rowKey="id"> -->
-    <a-table :columns="columns" :data-source="tableData" bordered :scroll="{ x:true }" :pagination="false" rowKey="id">
+    <!-- <a-table :columns="columns" :data-source="tableData" bordered :scroll="{ x:true }" :pagination="false" rowKey="id">
+    </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">
     </a-table>
     <!-- <div class="extra-item" style="margin-top: 20px;">
       <a-button :type="selectedMode==='single'?'primary':'link'" @click="selectedMode = 'single'">单选</a-button>
@@ -12,265 +25,258 @@
   
 </template>
 <script>
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getDbList, getHjList } from '@/api/kzksApi.js'
 import lineBarChart from './components/lineBarChart.vue'
 
-const columns = [
-  {
-    title:'任务号',
-    fixed:"left",
-    align:"center",
-    width: 140,
-    dataIndex: 'taskno',
-  },
-  {
-    title:'任务名称',
-    align:"center",
-    fixed:"left",
-    width: 120,
-    dataIndex: 'taskname'
-  },
-  {
-    title:'型号',
-    align:"center",
-    dataIndex: 'xhname'
-  },
-  {
-    title:'计划完成时间',
-    align:"center",
-    dataIndex: 'jhwcsj',
-  },
-  {
-    title:'阶段',
-    align:"center",
-    dataIndex: 'yzjdname'
-  },
-  {
-    title:'项目进度',
-    align:"center",
-    dataIndex: 'processpercent'
-  },
-  {
-    title:'成本进度',
-    align:"center",
-    dataIndex: 'costPercent'
-  },
-  {
-    title:'研制数量',
-    align:"center",
-    dataIndex: 'yzsl',
-  },
-  {
-    title:'单台收入',
-    align:"center",
-    dataIndex: 'oneIncome',
-    isEcharts: true,
-  },
-  {
-    title:'单台成本',
-    align:"center",
-    dataIndex: 'oneCost',
-    isEcharts: true,
-  },
-  {
-    title:'单台利润',
-    align:"center",
-    dataIndex: 'oneProfit',
-    isEcharts: true,
-  },
-  {
-    title:'利润额',
-    align:"center",
-    dataIndex: 'lre',
-  },
-  {
-    title:'利润率',
-    align:"center",
-    dataIndex: 'lrl',
-  },
-  {
-    title:'预估价',
-    align:"center",
-    dataIndex: 'estimationcoat',
-  },
-  {
-    title:'合同额',
-    align:"center",
-    dataIndex: 'contractfpe',
-  },
-  {
-    title:'已收款',
-    align:"center",
-    dataIndex: 'taskmoney',
-  },
-  {
-    title:'总成本',
-    align:"center",
-    dataIndex: 'zcb',
-  },
-  {
-    title:'材料费',
-    align:"center",
-    dataIndex: 'clf',
-    isEcharts: true,
-  },
-  {
-    title:'专用费',
-    align:"center",
-    dataIndex: 'zyf',
-    isEcharts: true,
-  },
-  {
-    title:'事务费',
-    align:"center",
-    dataIndex: 'swf',
-    isEcharts: true,
-  },
-  {
-    title:'外协费',
-    align:"center",
-    dataIndex: 'wxf',
-    isEcharts: true,
-  },
-  {
-    title:'燃动费',
-    align:"center",
-    dataIndex: 'rldlf',
-    isEcharts: true,
-  },
-  {
-    title:'折旧费',
-    align:"center",
-    dataIndex: 'gdzczj',
-    isEcharts: true,
-  },
-  {
-    title:'工时费',
-    align:"center",
-    dataIndex: 'gzjlwf',
-    isEcharts: true,
-  },
-  {
-    title:'管理费',
-    align:"center",
-    dataIndex: 'glf',
-    isEcharts: true,
-  },
-  {
-    title:'装机成本',
-    align:"center",
-    dataIndex: 'zjcb',
-    isEcharts: true,
-  },
-  {
-    title:'内部试验',
-    align:"center",
-    dataIndex: 'lbsy',
-    isEcharts: true,
-  },
-  {
-    title:'工时(h)',
-    align:"center",
-    dataIndex: 'workhour',
-    isEcharts: true,
-  },
-  {
-    title:'责任部门',
-    align:"center",
-    dataIndex: 'zrbm'
-  },
-  {
-    title:'下达部门',
-    align:"center",
-    dataIndex: 'jycs'
-  },
-  {
-    title:'横向纵向',
-    align:"center",
-    dataIndex: 'hxzxname'
-  },
-  {
-    title:'任务类型',
-    align:"center",
-    dataIndex: 'tasktype'
-  },
-  {
-    title:'审计审价',
-    align:"center",
-    dataIndex: 'auditprice'
-  },
-  {
-    title:'任务状态',
-    align:"center",
-    dataIndex: 'iflag'
-  },
-  {
-    title:'提出单位简称',
-    align:"center",
-    dataIndex: 'brief'
-  },
-  {
-    title:'父级任务',
-    align:"center",
-    dataIndex: 'reftaskno'
-  },
-  {
-    title:'批产任务号',
-    align:"center",
-    dataIndex: 'pccode'
-  },
-  {
-    title:'备产任务号',
-    align:"center",
-    dataIndex: 'bccode'
-  },
-  {
-    title:'备料任务号',
-    align:"center",
-    dataIndex: 'blcode'
-  },
-  {
-    title:'业务员',
-    align:"center",
-    dataIndex: 'businessman'
-  },
-  {
-    title:'设计工时',
-    align:"center",
-    dataIndex: 'sjgs',
-  },
-  {
-    title:'生产工时',
-    align:"center",
-    dataIndex: 'scgs',
-  },
-];
 export default {
+  mixins:[JeecgListMixin, mixinDevice],
   components: { lineBarChart },
-  props: {
-    // 对比表格数据
-    duibiList: {
-      type: Object,
-      default: ()=>{},
-      required: false
-    }
-  },
+  // props: {
+  //   // 对比表格数据
+  //   duibiList: {
+  //     type: Object,
+  //     default: ()=>{},
+  //     required: false
+  //   }
+  // },
+  props: ['chooseRowType', 'duibiIds'],
   data() {
     return {
       tableData: [],
       compareOne: [],
-      columns,
-      /* 分页参数 */
-      ipagination:{
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '20', '30'],
-        showTotal: (total, range) => {
-          return range[0] + "-" + range[1] + " 共" + total + "条"
-        },
-        showQuickJumper: true,
-        showSizeChanger: true,
-        total: 0
-      },
+      columns: [
+        {
+          title:'任务号',
+          fixed:"left",
+          align:"center",
+          width: 140,
+          dataIndex: 'taskno',
+        },
+        {
+          title:'任务名称',
+          align:"center",
+          fixed:"left",
+          width: 120,
+          dataIndex: 'taskname'
+        },
+        {
+          title:'型号',
+          align:"center",
+          dataIndex: 'xhname'
+        },
+        {
+          title:'计划完成时间',
+          align:"center",
+          dataIndex: 'jhwcsj',
+        },
+        {
+          title:'阶段',
+          align:"center",
+          dataIndex: 'yzjdname'
+        },
+        {
+          title:'项目进度',
+          align:"center",
+          dataIndex: 'processpercent'
+        },
+        {
+          title:'成本进度',
+          align:"center",
+          dataIndex: 'costPercent'
+        },
+        {
+          title:'研制数量',
+          align:"center",
+          dataIndex: 'yzsl',
+        },
+        {
+          title:'单台收入',
+          align:"center",
+          dataIndex: 'oneIncome',
+          isEcharts: true,
+        },
+        {
+          title:'单台成本',
+          align:"center",
+          dataIndex: 'oneCost',
+          isEcharts: true,
+        },
+        {
+          title:'单台利润',
+          align:"center",
+          dataIndex: 'oneProfit',
+          isEcharts: true,
+        },
+        {
+          title:'利润额',
+          align:"center",
+          dataIndex: 'lre',
+        },
+        {
+          title:'利润率',
+          align:"center",
+          dataIndex: 'lrl',
+        },
+        {
+          title:'预估价',
+          align:"center",
+          dataIndex: 'estimationcoat',
+        },
+        {
+          title:'合同额',
+          align:"center",
+          dataIndex: 'contractfpe',
+        },
+        {
+          title:'已收款',
+          align:"center",
+          dataIndex: 'taskmoney',
+        },
+        {
+          title:'总成本',
+          align:"center",
+          dataIndex: 'zcb',
+        },
+        {
+          title:'材料费',
+          align:"center",
+          dataIndex: 'clf',
+          isEcharts: true,
+        },
+        {
+          title:'专用费',
+          align:"center",
+          dataIndex: 'zyf',
+          isEcharts: true,
+        },
+        {
+          title:'事务费',
+          align:"center",
+          dataIndex: 'swf',
+          isEcharts: true,
+        },
+        {
+          title:'外协费',
+          align:"center",
+          dataIndex: 'wxf',
+          isEcharts: true,
+        },
+        {
+          title:'燃动费',
+          align:"center",
+          dataIndex: 'rldlf',
+          isEcharts: true,
+        },
+        {
+          title:'折旧费',
+          align:"center",
+          dataIndex: 'gdzczj',
+          isEcharts: true,
+        },
+        {
+          title:'工时费',
+          align:"center",
+          dataIndex: 'gzjlwf',
+          isEcharts: true,
+        },
+        {
+          title:'管理费',
+          align:"center",
+          dataIndex: 'glf',
+          isEcharts: true,
+        },
+        {
+          title:'装机成本',
+          align:"center",
+          dataIndex: 'zjcb',
+          isEcharts: true,
+        },
+        {
+          title:'内部试验',
+          align:"center",
+          dataIndex: 'lbsy',
+          isEcharts: true,
+        },
+        {
+          title:'工时(h)',
+          align:"center",
+          dataIndex: 'workhour',
+          isEcharts: true,
+        },
+        {
+          title:'责任部门',
+          align:"center",
+          dataIndex: 'zrbm'
+        },
+        {
+          title:'下达部门',
+          align:"center",
+          dataIndex: 'jycs'
+        },
+        {
+          title:'横向纵向',
+          align:"center",
+          dataIndex: 'hxzxname'
+        },
+        {
+          title:'任务类型',
+          align:"center",
+          dataIndex: 'tasktype'
+        },
+        {
+          title:'审计审价',
+          align:"center",
+          dataIndex: 'auditprice'
+        },
+        {
+          title:'任务状态',
+          align:"center",
+          dataIndex: 'iflag'
+        },
+        {
+          title:'提出单位简称',
+          align:"center",
+          dataIndex: 'brief'
+        },
+        {
+          title:'父级任务',
+          align:"center",
+          dataIndex: 'reftaskno'
+        },
+        {
+          title:'批产任务号',
+          align:"center",
+          dataIndex: 'pccode'
+        },
+        {
+          title:'备产任务号',
+          align:"center",
+          dataIndex: 'bccode'
+        },
+        {
+          title:'备料任务号',
+          align:"center",
+          dataIndex: 'blcode'
+        },
+        {
+          title:'业务员',
+          align:"center",
+          dataIndex: 'businessman'
+        },
+        {
+          title:'设计工时',
+          align:"center",
+          dataIndex: 'sjgs',
+        },
+        {
+          title:'生产工时',
+          align:"center",
+          dataIndex: 'scgs',
+        },
+      ],
       selectedMode: 'multiple',
       // echarts
       // xAxisData: ['单台成本', '收入', '利润', '材料费', '外协费', '事务费', '专用费', '工时费', '燃动费', '管理费', '折旧费', '装机成本', '内部试验', '工时']
@@ -305,7 +311,7 @@ export default {
       if(this.tableData.length === 0){
         return []
       }
-      var arr = columns.filter(cur => cur.isEcharts)
+      var arr = this.columns.filter(cur => cur.isEcharts)
       var data = arr.map(res => {
         return res.title
       })
@@ -316,7 +322,7 @@ export default {
       if(this.tableData.length === 0){
         return []
       }
-      var arr = columns.filter(cur => cur.isEcharts)
+      var arr = this.columns.filter(cur => cur.isEcharts)
       var data = this.compareOne.map(res => {
         // console.log(res)
         var liData = arr.map((item) => {
@@ -335,5 +341,26 @@ export default {
   },
   created(){
   },
+  methods: {
+    // 数据处理
+    loadData(){
+      // console.log(this.duibiclList)
+      if (this.chooseRowType == 1) {
+        getHjList({ids: this.duibiIds}).then((res) => {
+          console.log(res)
+          // this.duibiList = res
+          this.tableData = res.compareAll
+          this.compareOne = res.compareOne
+        })
+      } else {
+        getDbList({ids: this.duibiIds}).then((res) => {
+          console.log(res)
+          // this.duibiList = res
+          this.tableData = res.compareAll
+          this.compareOne = res.compareOne
+        })
+      }
+    }
+  },
 };
 </script>

+ 137 - 82
src/views/module_kzks/projectContrastList/wuliaoList.vue

@@ -1,100 +1,155 @@
 <template>
-  <!-- <a-table :columns="columns" :data-source="data" bordered :pagination="ipagination2" rowKey="id"> -->
-  <a-table :columns="columns" :data-source="data" bordered :pagination="false" rowKey="id">
-  </a-table>
+  <div>
+    <a-table
+      ref="table"
+      size="middle"
+      :scroll="{x:true}"
+      bordered
+      rowKey="id"
+      :columns="columns"
+      :dataSource="dataSource"
+      :pagination="ipagination"
+      :loading="loading"
+      class="j-table-force-nowrap"
+      @change="handleTableChange">
+    </a-table>
+  </div>
 </template>
 <script>
-const columns = [
-  {
-    title: '物资编码',
-    align:"center",
-    dataIndex: 'wlbm',
-    key: 'wlbm',
-    customRender:function (t,r,index) {
-        return {children: t,attrs: {rowSpan:r.rowSpan}};
-    },
-  },
-  {
-    title: '任务号',
-    align:"center",
-    dataIndex: 'rwh',
-    key: 'rwh',
-  },
-  {
-    title: '总数量',
-    align:"center",
-    dataIndex: 'zsl',
-    key: 'zsl',
-  },
-  {
-    title: '总金额',
-    align:"center",
-    key: 'zje',
-    dataIndex: 'zje',
-    // scopedSlots: { customRender: 'tags' },
-  },
-];
-
-const data = [];
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getDbClList } from '@/api/kzksApi.js'
 
 export default {
-  props: {
-    // 对比表格数据
-    duibiclList: {
-      type: Array,
-      default: ()=>{},
-      required: false
-    }
-  },
+  mixins:[JeecgListMixin, mixinDevice],
+  // props: {
+  //   // 对比表格数据
+  //   // duibiclList: {
+  //   //   type: Array,
+  //   //   default: ()=>{},
+  //   //   required: false
+  //   // }
+  //   chooseRowType: {
+  //     type: Number,
+  //     default: 1
+  //   },
+  //   duibiTasknos: {
+  //     type: String,
+  //     default: ''
+  //   }
+  // },
+  props: ['chooseRowType', 'duibiTasknos'],
   data() {
     return {
-      data,
-      columns,
-      /* 分页参数 */
-      ipagination2:{
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '20', '30'],
-        showTotal: (total, range) => {
-          return range[0] + "-" + range[1] + " 共" + total + "条"
+      name: '',
+      dataSource: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: '',
+          key:'rowIndex',
+          width:60,
+          align:"center",
+          customRender:function (t,r,index) {
+            return parseInt(index)+1;
+          }
         },
-        showQuickJumper: true,
-        showSizeChanger: true,
-        total: 0
-      },
+        {
+          title: '物料编码',
+          dataIndex: 'wlbm',
+          width: 100,
+          align: 'center'
+        },
+        {
+          title: '物料名称',
+          dataIndex: 'wlmc',
+          width: 100,
+          align: 'center'
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'ggxh',
+          width: 100,
+          align: 'center'
+        },
+      ],
     };
   },
   created(){
-    this.data = this.duibiclList
-    this.getHebing()
   },
   methods: {
-    getHebing(){
-      if(this.data.length === 0){
-        return
-      }
-      let rowSpan = 0
-      let wlbm = ''
-      for (let i = this.data.length-1; i >= 0; i--) {
-        // 任务号合并
-        if (wlbm == '') {
-          this.data[i].rowSpan = 0
-          wlbm = this.data[i].wlbm
-          rowSpan++
-          } else {
-          if(wlbm == this.data[i].wlbm){
-            this.data[i].rowSpan = 0
-              rowSpan++
-          }else{
-            this.data[i+1].rowSpan = rowSpan
-              this.data[i].rowSpan = 0
-              rowSpan = 1
-              wlbm = this.data[i].wlbm
-          }
+    // 数据处理
+    loadData(){
+      console.log(this.duibiTasknos)
+      getDbClList({tasknos: this.duibiTasknos}).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:'-'
+          })
+          console.log(objItem)
+          this.dataSource.push(objItem)
+        })
+        console.log(this.dataSource)
+      })
+    },
+    setCustomCell(record, index){
+      // console.log(record, index)
+      // var arr = []
+      // for (const item in record) {
+      //   if(item.includes('unitPrice')){
+      //     console.log(record[item])
+      //     arr.push(record[item])
+      //   }
+      // }
+      // console.log(arr)
+      if(!record.equal){
+        return {
+          style: {
+            'color': '#1890ff',
+          },
         }
       }
-      that.data[0].rowSpan = rowSpan
-    }
+    },
   }
 };
 </script>

+ 52 - 38
src/views/module_kzks/projectCostList/ProjectCostList.vue

@@ -298,10 +298,12 @@
 
       <a-tabs default-active-key="1">
         <a-tab-pane key="1" tab="总体比对">
-          <all-list :duibiList="duibiList"></all-list>
+          <all-list :duibiIds="duibiIds" :chooseRowType="chooseRowType"></all-list>
+          <!-- <all-list :duibiList="duibiList"></all-list> -->
         </a-tab-pane>
         <a-tab-pane key="2" tab="材料费比对" force-render>
-          <wuliao-list :duibiclList="duibiclList"></wuliao-list>
+          <wuliao-list :chooseRowType="chooseRowType" :duibiTasknos="duibiTasknos" ></wuliao-list>
+          <!-- <wuliao-list :duibiclList="duibiclList"></wuliao-list> -->
         </a-tab-pane>
       </a-tabs>
 
@@ -757,6 +759,10 @@ import { number } from 'echarts';
         isClick: false,
         mouseFlag: false,
         mouseOffset: null,
+
+        // 比对
+        duibiIds: '',
+        duibiTasknos: '',
       }
     },
     created() {
@@ -975,42 +981,50 @@ import { number } from 'echarts';
       batchDuiBi(){
         console.log(this.selectedRowKeys,this.selectionRows)
         // console.log(JSON.stringify(this.selectedRowKeys))
-        if (this.chooseRowType == 1) {
-          var a = this.selectedRowKeys
-          var ids = a.toString()
-          getHjList({ids: ids}).then((res) => {
-            console.log(res)
-            this.duibiList = res
-            this.duibiclList = []
-          })
-          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
-          })
-        } else {
-          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
-          })
-        }
+
+        var selectTasknos = this.selectionRows.map( res => {
+          return res.taskno
+        })
+        this.duibiTasknos = selectTasknos.toString()
+        this.duibiIds = this.selectedRowKeys.toString()
+        this.duiBi = true
+
+        // if (this.chooseRowType == 1) {
+        //   var a = this.selectedRowKeys
+        //   var ids = a.toString()
+        //   getHjList({ids: ids}).then((res) => {
+        //     console.log(res)
+        //     this.duibiList = res
+        //     this.duibiclList = []
+        //   })
+        //   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.result.resultVOList
+        //     this.duiBi = true
+        //   })
+        // } else {
+        //   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.result.resultVOList
+        //     this.duiBi = true
+        //   })
+        // }
         // var a = this.selectedRowKeys
         // var ids = a.toString()
         // getDbList({ids: ids}).then((res) => {