yuhan 1 год назад
Родитель
Сommit
6d6a29742a

+ 39 - 1
src/views/module_kzks/projectContrastList/wuliaoList.vue

@@ -1,5 +1,8 @@
 <template>
   <div>
+    <!-- <div class="table-operator">
+      <a-button type="primary" icon="download" @click="handleExportXls('比对')">导出</a-button>
+    </div> -->
     <a-table
       ref="table"
       size="middle"
@@ -20,6 +23,7 @@ import '@/assets/less/TableExpand.less'
 import { mixinDevice } from '@/utils/mixin'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { getDbClList } from '@/api/kzksApi.js'
+import { downFile } from '@/api/manage'
 
 var columns = [
   {
@@ -78,7 +82,10 @@ export default {
       name: '',
       dataSource: [],
       // 表头
-      columns: []
+      columns: [],
+      url: {
+        exportXlsUrl: "/wzOutboundOrder/wzOutboundOrderH/compareCLFDetailListExportExcel",
+      },
     };
   },
   created(){
@@ -192,6 +199,37 @@ export default {
         }
       }
     },
+    handleExportXls(fileName){
+      if(!fileName || typeof fileName != "string"){
+        fileName = "导出文件"
+      }
+      let param = {};
+      // let param = this.getQueryParams();
+      // if(this.selectedRowKeys && this.selectedRowKeys.length>0){
+      //   param['selections'] = this.selectedRowKeys.join(",")
+      // }
+      param['tasknos'] = this.duibiTasknos
+      console.log("导出参数",param)
+      downFile(this.url.exportXlsUrl,param).then((data)=>{
+        if (!data) {
+          this.$message.warning("文件下载失败")
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
+        }else{
+          let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName+'.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link); //下载完成移除元素
+          window.URL.revokeObjectURL(url); //释放掉blob对象
+        }
+      })
+    },
   }
 };
 </script>

+ 11 - 1
src/views/module_kzks/projectCostList/modulesDetail/MaterialDetailList.vue

@@ -10,7 +10,7 @@
     <!-- 查询区域-END -->
 
     <!-- 操作按钮区域 -->
-    <div class="table-operator">
+    <div class="table-operator" v-if="!detail">
       <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
       <a-button type="primary" icon="download" @click="handleExportXls(taskno+'材料费明细')">导出</a-button>
       <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
@@ -106,6 +106,10 @@
       taskno: {
         type: String,
         default: ''
+      },
+      detail: {
+        type: Boolean,
+        default: false
       }
     },
     data () {
@@ -173,6 +177,12 @@
       this.getSuperFieldList();
       this.loadData()
     },
+    watch: {
+      taskno(newV, oldV){
+        console.log(newV, oldV)
+        this.loadData()
+      }
+    },
     computed: {
       // importExcelUrl: function(){
       //   return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;

+ 56 - 58
src/views/module_kzks/projectCostList/modulesDetail/PichanTaskList.vue

@@ -10,10 +10,10 @@
     <!-- 查询区域-END -->
 
     <!-- 操作按钮区域 -->
-    <div class="table-operator">
+    <!-- <div class="table-operator"> -->
       <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
       <!-- <a-button type="primary" icon="download" @click="handleExportXls('批产任务')">导出</a-button> -->
-      <span style="float: right;font-weight: bold;margin-bottom: 10px;">占比:{{ pichanInfo.proportion * 100 + '%' }}</span>
+      <!-- <span style="float: right;font-weight: bold;margin-bottom: 10px;">占比:{{ pichanInfo.proportion * 100 + '%' }}</span> -->
       <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload> -->
@@ -25,7 +25,7 @@
         </a-menu>
         <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
       </a-dropdown> -->
-    </div>
+    <!-- </div> -->
 
     <!-- table区域-begin -->
     <div>
@@ -34,62 +34,36 @@
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div> -->
 
-      <a-table
-        v-if="dataSource.length > 0"
-        ref="table"
-        size="middle"
-        :scroll="{x:true}"
-        bordered
-        rowKey="id"
-        :columns="columns"
-        :dataSource="dataSource"
-        :pagination="false"
-        :loading="loading"
-        defaultExpandAllRows
-        class="j-table-force-nowrap"
-        @change="handleTableChange">
-        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
-
-        <!-- <template slot="htmlSlot" slot-scope="text">
-          <div v-html="text"></div>
-        </template>
-        <template slot="imgSlot" slot-scope="text,record">
-          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
-          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
-        </template>
-        <template slot="fileSlot" slot-scope="text">
-          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
-          <a-button
-            v-else
-            :ghost="true"
-            type="primary"
-            icon="download"
-            size="small"
-            @click="downloadFile(text)">
-            下载
-          </a-button>
-        </template> -->
+      <a-row :gutter="24">
+        <a-col :span="14">
+          <div class="table-operator">
+            <span style="float: right;font-weight: bold;margin-bottom: 10px;">占比:{{ pichanInfo.proportion * 100 + '%' }}</span>
+          </div>
 
-        <!-- <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
+          <a-table
+            v-if="dataSource.length > 0"
+            ref="table"
+            size="middle"
+            :scroll="{x:true}"
+            bordered
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="false"
+            :loading="loading"
+            defaultExpandAllRows
+            class="j-table-force-nowrap"
+            @change="handleTableChange">
 
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="handleDetail(record)">详情</a>
-              </a-menu-item>
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span> -->
-
-      </a-table>
+          </a-table>
+        </a-col>
+        <a-col :span="10">
+          <!-- 材料费 -->
+          <div style="height: 31px;">{{ tasknoCl+'材料费明细' }}</div>
+          <material-detail-list :taskno="tasknoCl" detail></material-detail-list>
+        </a-col>
+      </a-row>
+      
     </div>
 
   </a-card>
@@ -97,6 +71,7 @@
 
 <script>
 
+  import MaterialDetailList from './MaterialDetailList.vue'
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@@ -105,6 +80,9 @@
   export default {
     name: 'PichanTaskList',
     mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      MaterialDetailList,
+    },
     props: {
       pichanInfo: {
         type: Object,
@@ -114,6 +92,7 @@
     data () {
       return {
         description: '批产任务页面',
+        tasknoCl: '',
         // 表头
         columns: [],
         // settingColumns: ['taskno', 'pccode', 'taskname', 'zjcb', 'scgs', 'contractfpe', 'estimationcoat', 'costPercent', 'processpercent', 'sjgs', 'clf', 'zyf', 'swf', 'wxf', 'taskmoney', 'oneIncome', 'oneProfit', 'lrl', 'xhname', 'yzjdname', 'jhwcsj', 'yzsl', 'oneCost', 'lre', 'zcb', 'glf', 'lbsy', 'zrbm', 'gdzczj', 'gzjlwf', 'rldlf', 'tasktype', 'jycs', 'workhour', 'hxzxname', 'auditprice', 'brief', 'blcode', 'businessman', 'bccode', 'reftaskno', 'iflag'],
@@ -339,7 +318,8 @@
             title:'材料费',
             align:"center",
             dataIndex: 'clf',
-            fixed: 'right'
+            fixed: 'right',
+            customCell: this.getClickColumn,
           },
           {
             title:'专用费',
@@ -415,6 +395,24 @@
         })
         this.columns =  cols;
       },
+      getClickColumn(record, index){
+        return {
+          style: {
+            'color': '#1890ff',
+            'cursor': 'pointer',
+          },
+          on: {
+            click: (event)=> {
+              // 没有值不弹窗
+              console.log(record, index)
+              // if(!event.target.textContent){
+              //   return
+              // }
+              this.tasknoCl = record.taskno
+            },
+          }
+        }
+      },
       initDictConfig(){
       },
       getSuperFieldList(){