Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

lizhenhao 2 rokov pred
rodič
commit
aa0dae7a3a

+ 7 - 0
src/api/program/ProgramProjectListInfoService.js

@@ -86,6 +86,13 @@ export default class ProgramProjectListInfoService {
       params: {id: ids}
     })
   }
+  deleteAll (ids) {
+    return request({
+      url: '/program/projectList/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
   findContractPageList (params) {
     return request({
       url: '/program/projectList/findContractPageList',

+ 20 - 1
src/views/modules/program/registered/ProjectList.vue

@@ -64,7 +64,7 @@
       <vxe-toolbar :refresh="{query: refreshList}" custom>
         <template #buttons>
           <el-button v-if="hasPermission('program:registered:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
-          <el-button v-if="hasPermission('program:registered:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.typeDictTable && $refs.typeDictTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+          <el-button v-if="hasPermission('program:registered:del')" type="danger"   size="small" icon="el-icon-delete" @click="deleteAll()" :disabled="$refs.typeDictTable && $refs.typeDictTable.getCheckboxRecords().length === 0" plain>删除</el-button>
           <el-button v-if="hasPermission('program:registered:export')"  type="warning" plain @click="exportFile()" size="small">导出</el-button>
         </template>
       </vxe-toolbar>
@@ -375,6 +375,24 @@
         this.refreshList()
       },
       // 删除
+      deleteAll (id) {
+        let ids = id || this.$refs.typeDictTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.programProjectListInfoService.deleteAll(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      // 删除
       del (id) {
         let ids = id || this.$refs.typeDictTable.getCheckboxRecords().map(item => {
           return item.id
@@ -897,6 +915,7 @@
         this.loading = true
         this.programProjectListInfoService.exportFile({
           'itemType': '1',
+          'tabType': '1',
           ...this.searchForm
         }).then((res) => {
           // 将二进制流文件写入excel表,以下为重要步骤

+ 23 - 3
src/views/modules/program/registered/ProjectList2022.vue

@@ -65,8 +65,8 @@
         <template #buttons>
           <el-button v-if="hasPermission('program:registered:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
 <!--          <el-button v-if="hasPermission('program:registered:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>-->
-<!--          <el-button v-if="hasPermission('program:registered:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.typeDictTable && $refs.typeDictTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
-<!--          <el-button v-if="hasPermission('program:registered:export')"  type="warning" plain @click="exportFile()" size="small">导出</el-button>-->
+          <el-button v-if="hasPermission('program:registered:del')" type="danger"   size="small" icon="el-icon-delete" @click="deleteAll()" :disabled="$refs.typeDictTable && $refs.typeDictTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+          <el-button v-if="hasPermission('program:registered:export')"  type="warning" plain @click="exportFile()" size="small">导出</el-button>
         </template>
       </vxe-toolbar>
       <div style="height: calc(100% - 90px)">
@@ -402,6 +402,25 @@
           })
         })
       },
+
+      // 删除
+      deleteAll (id) {
+        let ids = id || this.$refs.typeDictTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.programProjectListInfoService.deleteAll(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
       resetSearch () {
         this.$refs.searchForm.resetFields()
         this.refreshList()
@@ -907,10 +926,11 @@
         this.loading = true
         this.programProjectListInfoService.exportFile({
           'itemType': '1',
+          'tabType': '2022',
           ...this.searchForm
         }).then((res) => {
           // 将二进制流文件写入excel表,以下为重要步骤
-          this.$utils.downloadExcel(res.data, '项目登记列表信息')
+          this.$utils.downloadExcel(res.data, '2022年项目登记列表信息')
           this.loading = false
         }).catch(function (err) {
           this.loading = false