Browse Source

搜索条件

刘湘琪 3 years ago
parent
commit
3cc23e9605

+ 7 - 0
src/api/common/common.js

@@ -24,3 +24,10 @@ export function getIndexDataApi(query) {
     params: query
   })
 }
+//下载列表项目
+export function downloadProjectByIDApi(projectId) {
+  return request({
+    url: `/project/download/${projectId}`,
+    method: 'get'
+  })
+}

+ 5 - 1
src/views/enterprise/declare/index.vue

@@ -103,7 +103,11 @@
           provinceId: undefined,
           cityId: undefined,
           districtId: undefined,
-          year: ''
+          year: '',
+          entName: '',
+          license: '',
+          projectNo: '',
+          projectName: ''
         },
         list: [],
         total: 0,

+ 4 - 1
src/views/enterprise/ent/index.vue

@@ -135,7 +135,10 @@
           pageSize: 10,
           provinceId: undefined,
           cityId: undefined,
-          districtId: undefined
+          districtId: undefined,
+          entName: '',
+          license: '',
+          entState: ''
         },
         list: [],
         total: 0,

+ 21 - 16
src/views/enterprise/project/index.vue

@@ -2,34 +2,34 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" size="small" label-width="100px">
       <el-form-item label="省" prop="provinceId">
-        <el-select v-model="queryParams.provinceId" placeholder="请选择省" @change="getCityData" filterable style="width: 200px;">
+        <el-select v-model="queryParams.provinceId" placeholder="请选择省" @change="getCityData" filterable style="width: 200px;" clearable>
           <el-option v-for="(item,index) in provinceDataList" :key="index" :label="item.name" :value="item.id"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="市" prop="cityId">
-        <el-select v-model="queryParams.cityId" placeholder="请选择市" @change="getDistrictData" filterable style="width: 200px;">
+        <el-select v-model="queryParams.cityId" placeholder="请选择市" @change="getDistrictData" filterable style="width: 200px;" clearable>
           <el-option v-for="(item, index) in cityDataList" :key="index" :label="item.name" :value="item.id"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="区" prop="districtId">
-        <el-select v-model="queryParams.districtId" placeholder="请选择区" filterable style="width: 200px;">
+        <el-select v-model="queryParams.districtId" placeholder="请选择区" filterable style="width: 200px;" clearable>
           <el-option v-for="(item, index) in districtDataList" :key="index" :label="item.name" :value="item.id"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="年份">
-        <el-date-picker v-model="queryParams.year" type="year" placeholder="选择年" style="width: 200px;"></el-date-picker>
+        <el-date-picker v-model="queryParams.year" type="year" placeholder="选择年" style="width: 200px;" clearable></el-date-picker>
       </el-form-item>
       <el-form-item label="企业名称">
         <el-input v-model="queryParams.entName" clearable style="width: 200px;" placeholder="请填入企业名称"></el-input>
       </el-form-item>
       <el-form-item label="社会信用代码">
-        <el-input v-model="queryParams.license" style="width: 200px;" placeholder="请输入社会信用代码"></el-input>
+        <el-input v-model="queryParams.license" style="width: 200px;" placeholder="请输入社会信用代码" clearable></el-input>
       </el-form-item>
       <el-form-item label="项目编号">
-        <el-input v-model="queryParams.projectNo" style="width: 200px;" placeholder="请输入项目编号"></el-input>
+        <el-input v-model="queryParams.projectNo" style="width: 200px;" placeholder="请输入项目编号" clearable></el-input>
       </el-form-item>
       <el-form-item label="项目名称">
-        <el-input v-model="queryParams.projectName" style="width: 200px;" placeholder="请输入项目名称"></el-input>
+        <el-input v-model="queryParams.projectName" style="width: 200px;" placeholder="请输入项目名称" clearable></el-input>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="handleQuery">搜索</el-button>
@@ -40,10 +40,7 @@
       <span class="title">列表</span>
       <div class="tool">
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-if="roleType == 'entAdmin' || roleType == 'entUser'">新增</el-button>
-        <!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchAdd">批量新增</el-button> -->
-        <!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleDownloadMode">模板下载</el-button> -->
-        <!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpload">一键上传</el-button> -->
-        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleDownload">下载</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleDownloadBatch">下载</el-button>
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDel" v-if="roleType == 'entAdmin' || roleType == 'entUser'">批量删除</el-button>
       </div>
     </h3>
@@ -123,6 +120,7 @@
   import declare from './components/declare'
   import {projectAuditApi} from '@/api/admin/project/project'
   import AuditProject from './components/audit'
+  import {downloadProjectByIDApi} from '@/api/common/common'
   export default {
     components: {
       AddProject,
@@ -149,7 +147,12 @@
           pageSize: 10,
           provinceId: undefined,
           cityId: undefined,
-          districtId: undefined
+          districtId: undefined,
+          entName: '',
+          year: '',
+          license: '',
+          projectNo: '',
+          projectName: ''
         },
         list: [],
         total: 0,
@@ -224,13 +227,15 @@
       handleBatchAdd() {
 
       },
-      handleDownload() {
-
+      handleDownload(row) {
+        downloadProjectByIDApi(row.id).then(response => {
+          this.download(response.msg);
+        });
       },
       handleBatchDel() {
 
       },
-      handleDownloadMode() {
+      handleDownloadBatch() {
 
       },
       handleUpload() {
@@ -269,7 +274,7 @@
         this.$nextTick(() => {
           this.$refs.auditProject.init(row.id)
         })
-        
+
       },
       // 查看
       handleView(row) {