index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" size="small" label-width="100px">
  4. <el-form-item label="省" prop="provinceId">
  5. <el-select v-model="queryParams.provinceId" placeholder="请选择省" @change="getCityData" filterable style="width: 200px;">
  6. <el-option v-for="(item,index) in provinceDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item label="市" prop="cityId">
  10. <el-select v-model="queryParams.cityId" placeholder="请选择市" @change="getDistrictData" filterable style="width: 200px;">
  11. <el-option v-for="(item, index) in cityDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="区" prop="districtId">
  15. <el-select v-model="queryParams.districtId" placeholder="请选择区" filterable style="width: 200px;">
  16. <el-option v-for="(item, index) in districtDataList" :key="index" :label="item.name" :value="item.id"></el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="年份">
  20. <el-date-picker v-model="queryParams.year" type="year" placeholder="选择年" style="width: 200px;"></el-date-picker>
  21. </el-form-item>
  22. <el-form-item label="企业名称">
  23. <el-input v-model="queryParams.entName" clearable style="width: 200px;"></el-input>
  24. </el-form-item>
  25. <el-form-item label="社会信用代码">
  26. <el-input v-model="queryParams.license" style="width: 200px;"></el-input>
  27. </el-form-item>
  28. <el-form-item label="项目编号">
  29. <el-input v-model="queryParams.projectNo" style="width: 200px;"></el-input>
  30. </el-form-item>
  31. <el-form-item label="项目名称">
  32. <el-input v-model="queryParams.projectName" style="width: 200px;"></el-input>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="primary" @click="handleQuery">搜索</el-button>
  36. <el-button @click="resetQuery">重置</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <h3 class="toolbar">
  40. <span class="title">列表</span>
  41. <div class="tool">
  42. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
  43. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchAdd">批量新增</el-button>
  44. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleDownloadMode">模板下载</el-button>
  45. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpload">一键上传</el-button>
  46. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleDownload">下载</el-button>
  47. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDelte">批量删除</el-button>
  48. </div>
  49. </h3>
  50. <el-table v-loading="loading" :data="list" border>
  51. <el-table-column label="项目编号" prop="projectNo" width="120" align="center" />
  52. <el-table-column label="项目名称" prop="projectName" align="center" width="120"></el-table-column>
  53. <el-table-column label="企业名称" prop="entName" align="center" width="120"/>
  54. <el-table-column label="社会信用代码" prop="license" align="center" width="120" />
  55. <el-table-column label="项目年份" prop="projectYear" align="center" width="120" />
  56. <el-table-column label="项目跨年" prop="overYearFlag" align="center" width="120"></el-table-column>
  57. <el-table-column label="创建时间" align="center" prop="createTime" width="160"></el-table-column>
  58. <el-table-column label="留存备查时间" prop="linkMobile" align="center" width="120"></el-table-column>
  59. <el-table-column label="资料完善度" prop="linkEmail" align="center" width="120"></el-table-column>
  60. <el-table-column label="负责状态" prop="createTime" align="center" width="160"></el-table-column>
  61. <el-table-column label="项目状态" align="center" width="120">
  62. </el-table-column>
  63. <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
  64. <template slot-scope="scope">
  65. <el-button type="text" @click="handleView(scope.row)">查看</el-button>
  66. <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
  67. <el-button type="text" @click="handleDownload(scope.row)">下载</el-button>
  68. <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <pagination
  73. v-show="total>0"
  74. :total="total"
  75. :page.sync="queryParams.pageNum"
  76. :limit.sync="queryParams.pageSize"
  77. @pagination="getList"/>
  78. <add-project v-if="addProjectVisible" ref="addProject" @refreshData="getList()"></add-project>
  79. </div>
  80. </template>
  81. <script>
  82. import {getProvinceDataApi,getRegionChildrenApi} from "@/api/common/common"
  83. import {listProjectApi, deleteEntApi} from '@/api/enterprise/project/project'
  84. import {entStateOptions, getLabel, authStateOptions} from '@/utils/dataFormat'
  85. import AddProject from './components/addProject'
  86. export default {
  87. components: {
  88. AddProject
  89. },
  90. // ADMIN,GOV_PROV,GOV_CITY,GOV_DISTRI,ENT_ADMIN,ENT_TECH,ENT_ADMIN_TECH,ENT_FIN,ENT_ADMIN_FIN
  91. data () {
  92. return {
  93. loading: false,
  94. addProjectVisible: false,
  95. provinceDataList: [],
  96. cityDataList: [],
  97. districtDataList: [],
  98. entStateOptions: entStateOptions,
  99. authStateOptions: authStateOptions,
  100. // 模板状态
  101. // statusOptions: accessStatus,
  102. dateRange: [],
  103. queryParams: {
  104. pageNum: 1,
  105. pageSize: 10,
  106. provinceId: undefined,
  107. cityId: undefined,
  108. districtId: undefined
  109. },
  110. list: [],
  111. total: 0,
  112. open: false,
  113. openInfo: false,
  114. }
  115. },
  116. computed: {
  117. userType() {
  118. return this.$store.state.user.userType
  119. },
  120. roles() {
  121. return this.$store.state.user.roles
  122. }
  123. },
  124. created() {
  125. this.getList()
  126. this.getProvinceData()
  127. },
  128. methods: {
  129. //选择省份
  130. getCityData() {
  131. this.queryParams.cityId = ''
  132. this.queryParams.districtId = ''
  133. getRegionChildrenApi(this.queryParams.provinceId).then(res => {
  134. if(res.code == 200) {
  135. this.cityDataList = res.data
  136. }
  137. })
  138. },
  139. //选择市
  140. getDistrictData() {
  141. this.queryParams.districtId = ''
  142. getRegionChildrenApi(this.queryParams.cityId).then(res => {
  143. if(res.code == 200) {
  144. this.districtDataList = res.data
  145. }
  146. })
  147. },
  148. getProvinceData() {
  149. getProvinceDataApi().then(res => {
  150. if(res.code == 200) {
  151. this.provinceDataList = res.data
  152. }
  153. })
  154. },
  155. getList() {
  156. this.loading = true;
  157. if(this.userType == 'ENT_ADMIN' || this.userType == 'ENT_TECH' || this.userType == 'ENT_ADMIN_TECH' || this.userType == 'ENT_FIN' || this.userType == 'ENT_ADMIN_FIN') {
  158. listProjectApi(this.queryParams).then(response => {
  159. this.list = response.data.records;
  160. this.total = response.data.total;
  161. this.loading = false;
  162. });
  163. }
  164. },
  165. handleAdd() {
  166. this.addProjectVisible = true
  167. this.$nextTick(() => {
  168. this.$refs.addProject.init()
  169. })
  170. },
  171. handleEdit(row) {
  172. this.$router.push({name: 'editProject', query: {id: row.id, entId: row.entId}})
  173. },
  174. handleUpdate(row) {
  175. this.$router.push("/ent/edit/"+row.id)
  176. },
  177. // 审核
  178. handleAudit(row) {
  179. this.$router.push("/ent/info/"+row.id+'?type=audit')
  180. },
  181. // 查看
  182. handleView(row) {
  183. this.$router.push("/ent/info/"+row.id+'?type=view')
  184. },
  185. handleDelete(row) {
  186. const id = row.id;
  187. this.$confirm('是否确认删除该数据?', "警告", {
  188. confirmButtonText: "确定",
  189. cancelButtonText: "取消",
  190. type: "warning"
  191. }).then(function() {
  192. return deleteEntApi(id);
  193. }).then(() => {
  194. this.queryParams.pageNum = 1;
  195. this.getList();
  196. this.msgSuccess("删除成功");
  197. })
  198. },
  199. // 重置
  200. resetQuery() {
  201. this.dateRange = [];
  202. this.resetForm("queryForm");
  203. this.handleQuery();
  204. },
  205. // 搜索
  206. handleQuery() {
  207. this.queryParams.pageNum = 1;
  208. this.getList();
  209. },
  210. statusFormat(row, col, val, index) {
  211. return getLabel(accessStatus, val)
  212. },
  213. entSateFormat(row, col, val, index) {
  214. return getLabel(entStateOptions, val)
  215. },
  216. authStateFormat(row, col, val, index) {
  217. return getLabel(authStateOptions, val)
  218. }
  219. }
  220. }
  221. </script>
  222. <style>
  223. </style>