Bladeren bron

外协详情优化

wyh 1 jaar geleden
bovenliggende
commit
9a58165298
1 gewijzigde bestanden met toevoegingen van 110 en 58 verwijderingen
  1. 110 58
      src/views/module_kzks/costModelList/modulesDetail/CostModelXmxqWxList.vue

+ 110 - 58
src/views/module_kzks/costModelList/modulesDetail/CostModelXmxqWxList.vue

@@ -1,7 +1,7 @@
 <template>
   <a-card :bordered="false">
     <!-- 查询区域 -->
-    <div class="table-page-search-wrapper">
+    <!-- <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -33,32 +33,32 @@
           </a-col>
         </a-row>
       </a-form>
-    </div>
+    </div> -->
     <!-- 查询区域-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>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
+      </a-upload> -->
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
       </a-dropdown>
-    </div>
+    </div> -->
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
+      </div> -->
 
       <a-table
         ref="table"
@@ -94,7 +94,7 @@
           </a-button>
         </template>
 
-        <span slot="action" slot-scope="text, record">
+        <!-- <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
           <a-divider type="vertical" />
@@ -111,7 +111,7 @@
               </a-menu-item>
             </a-menu>
           </a-dropdown>
-        </span>
+        </span> -->
 
       </a-table>
     </div>
@@ -183,59 +183,59 @@
           //   align:"center",
           //   dataIndex: 'price'
           // },
-          {
-            title:'单价(最大值)',
-            align:"center",
-            dataIndex: 'maxDanjia'
-          },
-          {
-            title:'单价(最小值)',
-            align:"center",
-            dataIndex: 'minDanjia'
-          },
-          {
-            title:'单价(平均值)',
-            align:"center",
-            dataIndex: 'aveDanjia'
-          },
-          {
-            title:'单价(近期值)',
-            align:"center",
-            dataIndex: 'recentDanjia'
-          },
-          {
-            title:'价格(最大值)',
-            align:"center",
-            dataIndex: 'maxPrice'
-          },
-          {
-            title:'价格(最小值)',
-            align:"center",
-            dataIndex: 'minPrice'
-          },
-          {
-            title:'价格(平均值)',
-            align:"center",
-            dataIndex: 'avePrice'
-          },
-          {
-            title:'价格(近期值)',
-            align:"center",
-            dataIndex: 'recentPrice'
-          },
+          // {
+          //   title:'单价(最大值)',
+          //   align:"center",
+          //   dataIndex: 'maxDanjia'
+          // },
+          // {
+          //   title:'单价(最小值)',
+          //   align:"center",
+          //   dataIndex: 'minDanjia'
+          // },
+          // {
+          //   title:'单价(平均值)',
+          //   align:"center",
+          //   dataIndex: 'aveDanjia'
+          // },
+          // {
+          //   title:'单价(近期值)',
+          //   align:"center",
+          //   dataIndex: 'recentDanjia'
+          // },
+          // {
+          //   title:'价格(最大值)',
+          //   align:"center",
+          //   dataIndex: 'maxPrice'
+          // },
+          // {
+          //   title:'价格(最小值)',
+          //   align:"center",
+          //   dataIndex: 'minPrice'
+          // },
+          // {
+          //   title:'价格(平均值)',
+          //   align:"center",
+          //   dataIndex: 'avePrice'
+          // },
+          // {
+          //   title:'价格(近期值)',
+          //   align:"center",
+          //   dataIndex: 'recentPrice'
+          // },
           {
             title:'描述',
             align:"center",
             dataIndex: 'remark'
           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            fixed:"right",
-            width:147,
-            scopedSlots: { customRender: 'action' }
-          }
+          // {
+          //   title: '操作',
+          //   dataIndex: 'action',
+          //   align:"center",
+          //   fixed:"right",
+          //   width:147,
+          //   scopedSlots: { customRender: 'action' }
+          // }
         ],
         url: {
           list: "/costModelXmxqWx/costModelXmxqWx/list",
@@ -258,6 +258,36 @@
       },
     },
     methods: {
+      // 获取页面列表
+      loadData(arg) {
+        if(!this.url.list){
+          this.$message.error("请设置url.list属性!")
+          return
+        }
+        //加载数据 若传入参数1则加载第一页的内容
+        if (arg === 1) {
+          this.ipagination.current = 1;
+        }
+        var params = this.getQueryParams();//查询条件
+        this.loading = true;
+        getAction(this.url.list, params).then((res) => {
+          if (res.success) {
+            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+            this.dataSource = res.result.records||res.result;
+            if(res.result.total)
+            {
+              this.ipagination.total = res.result.total;
+            }else{
+              this.ipagination.total = 0;
+            }
+            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+          }else{
+            this.$message.warning(res.message)
+          }
+        }).finally(() => {
+          this.loading = false
+        })
+      },
       initDictConfig(){
       },
       getSuperFieldList(){
@@ -272,6 +302,28 @@
         fieldList.push({type:'string',value:'price',text:'价格(单价*数量)',dictCode:''})
         fieldList.push({type:'string',value:'remark',text:'描述',dictCode:''})
         this.superFieldList = fieldList
+      },
+      getList(id,type){
+        this.queryParam.id = id
+        this.loadData(1)
+        if (type == 'max') {
+          // this.columns.push({ title:'单价(最大值)', align:"center", dataIndex: 'maxDanjia' })
+          // this.columns.push({ title:'价格(最大值)', align:"center", dataIndex: 'maxPrice' })
+          this.columns.splice(7,0,{ title:'单价(最大值)', align:"center", dataIndex: 'maxDanjia' },
+          { title:'价格(最大值)', align:"center", dataIndex: 'maxPrice' })
+        }
+        if (type == 'min') {
+          // this.columns.push({ title:'单价(最小值)', align:"center", dataIndex: 'minDanjia' })
+          // this.columns.push({ title:'价格(最小值)', align:"center", dataIndex: 'minPrice' })
+          this.columns.splice(7,0,{ title:'单价(最小值)', align:"center", dataIndex: 'minDanjia' },
+          { title:'价格(最小值)', align:"center", dataIndex: 'minPrice' })
+        }
+        if (type == 'ave') {
+          // this.columns.push({ title:'单价(平均值)', align:"center", dataIndex: 'aveDanjia' })
+          // this.columns.push({ title:'价格(平均值)', align:"center", dataIndex: 'avePrice' })
+          this.columns.splice(7,0,{ title:'单价(平均值)', align:"center", dataIndex: 'aveDanjia' },
+          { title:'价格(平均值)', align:"center", dataIndex: 'avePrice' })
+        }
       }
     }
   }