index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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;" clearable>
  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;" clearable>
  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;" clearable>
  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;" clearable></el-date-picker>
  21. </el-form-item>
  22. <el-form-item label="企业名称">
  23. <el-input v-model="queryParams.entName" clearable style="width: 200px;" placeholder="请填入企业名称"></el-input>
  24. </el-form-item>
  25. <el-form-item label="社会信用代码">
  26. <el-input v-model="queryParams.license" style="width: 200px;" placeholder="请输入社会信用代码" clearable></el-input>
  27. </el-form-item>
  28. <el-form-item label="项目编号">
  29. <el-input v-model="queryParams.projectNo" style="width: 200px;" placeholder="请输入项目编号" clearable></el-input>
  30. </el-form-item>
  31. <el-form-item label="项目名称">
  32. <el-input v-model="queryParams.projectName" style="width: 200px;" placeholder="请输入项目名称" clearable></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" v-if="roleType == 'entAdmin' || roleType == 'entUser'">新增</el-button>
  43. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleDownloadBatch">下载</el-button>
  44. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDel" v-if="roleType == 'entAdmin' || roleType == 'entUser'">批量删除</el-button>
  45. </div>
  46. </h3>
  47. <el-table v-loading="loading" :data="list" border>
  48. <el-table-column label="项目编号" prop="projectNo" width="120" align="center" />
  49. <el-table-column label="项目名称" prop="projectName" align="center" width="120"></el-table-column>
  50. <el-table-column label="企业名称" prop="entName" align="center" width="120"/>
  51. <el-table-column label="社会信用代码" prop="license" align="center" width="120" />
  52. <el-table-column label="项目年份" prop="projectYear" align="center" width="120" />
  53. <el-table-column label="项目跨年" prop="overYearFlag" align="center" width="120"></el-table-column>
  54. <el-table-column label="创建时间" align="center" prop="createTime" width="160"></el-table-column>
  55. <el-table-column label="资料完善度" prop="linkEmail" align="center" width="340">
  56. <template slot-scope="scope">
  57. <span>企业 {{scope.row.compRate}} 科德技术 {{scope.row.techCompRate}} 科德财务 {{scope.row.finCompRate}}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="负责状态" align="center" width="160">
  61. <template slot-scope="scope">
  62. <template v-if="scope.row.finCompRate !='100.0%'">
  63. <span>待完善</span>
  64. </template>
  65. <template v-if="scope.row.finCompRate =='100.0%' && scope.row.authState == '1'">
  66. <span>已完善</span>
  67. </template>
  68. <template v-if="scope.row.authState == '2'">
  69. <span>待审核</span>
  70. </template>
  71. <template v-if="scope.row.authState == '3'">
  72. <span>审核通过</span>
  73. </template>
  74. <template v-if="scope.row.authState == '4'">
  75. <span>审核通过</span>
  76. </template>
  77. </template>
  78. </el-table-column>
  79. </el-table-column>
  80. <el-table-column label="项目状态" prop="reportState" align="center" width="160" :formatter="reportStateFormat"></el-table-column>
  81. </el-table-column>
  82. <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
  83. <template slot-scope="scope">
  84. <el-button type="text" @click="handleView(scope.row)">查看</el-button>
  85. <el-button type="text" @click="handleDownload(scope.row)">下载</el-button>
  86. <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
  87. <template v-if="roleType == 'entAdmin' || roleType == 'entUser'">
  88. <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
  89. <template v-if="scope.row.finCompRate == '100.0%'">
  90. <el-button type="text" @click="handleDeclare(scope.row)">提交申报</el-button>
  91. </template>
  92. <template v-if="scope.row.finCompRate == '100.0%' && (userType == 'ENT_TECH' || userType == 'ENT_FIN')">
  93. <el-button type="text" @click="handleAudit(scope.row)">提交审核</el-button>
  94. </template>
  95. <template v-if="scope.row.authState == '2' && (userType == 'ENT_ADMIN_TECH' || userType == 'ENT_ADMIN_FIN')">
  96. <el-button type="text" @click="handleAuditAdmin(scope.row)">审核</el-button>
  97. </template>
  98. </template>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. <pagination
  103. v-show="total>0"
  104. :total="total"
  105. :page.sync="queryParams.pageNum"
  106. :limit.sync="queryParams.pageSize"
  107. @pagination="getList"/>
  108. <add-project v-if="addProjectVisible" ref="addProject" @refreshData="getList()"></add-project>
  109. <declare v-if="declareVisible" ref="declare" @refreshData="getList()"></declare>
  110. <audit-project v-if="auditVisible" ref="auditProject" @refreshData="getList()"></audit-project>
  111. </div>
  112. </template>
  113. <script>
  114. import {getProvinceDataApi,getRegionChildrenApi} from "@/api/common/common"
  115. import {listProjectApi, deleteEntApi, deleteProjectApi} from '@/api/enterprise/project/project'
  116. import {listProjectAdminApi} from '@/api/admin/project/project'
  117. import {entStateOptions, getLabel, authStateOptions, reportStateOptions} from '@/utils/dataFormat'
  118. import AddProject from './components/addProject'
  119. import declare from './components/declare'
  120. import {projectAuditApi} from '@/api/admin/project/project'
  121. import AuditProject from './components/audit'
  122. import {downloadProjectByIDApi} from '@/api/common/common'
  123. export default {
  124. components: {
  125. AddProject,
  126. declare,
  127. AuditProject
  128. },
  129. // ADMIN,GOV_PROV,GOV_CITY,GOV_DISTRI,ENT_ADMIN,ENT_TECH,ENT_ADMIN_TECH,ENT_FIN,ENT_ADMIN_FIN
  130. data () {
  131. return {
  132. loading: false,
  133. addProjectVisible: false,
  134. declareVisible: false,
  135. auditVisible: false,
  136. provinceDataList: [],
  137. cityDataList: [],
  138. districtDataList: [],
  139. entStateOptions: entStateOptions,
  140. authStateOptions: authStateOptions,
  141. // 模板状态
  142. // statusOptions: accessStatus,
  143. dateRange: [],
  144. queryParams: {
  145. pageNum: 1,
  146. pageSize: 10,
  147. provinceId: undefined,
  148. cityId: undefined,
  149. districtId: undefined,
  150. entName: '',
  151. year: '',
  152. license: '',
  153. projectNo: '',
  154. projectName: ''
  155. },
  156. list: [],
  157. total: 0,
  158. open: false,
  159. openInfo: false,
  160. roleType: '',
  161. }
  162. },
  163. computed: {
  164. userType() {
  165. return this.$store.state.user.userType
  166. },
  167. roles() {
  168. return this.$store.state.user.roles
  169. }
  170. },
  171. created() {
  172. this.getList()
  173. this.getProvinceData()
  174. this.roleType = this.roles.join(',')
  175. },
  176. methods: {
  177. //选择省份
  178. getCityData() {
  179. this.queryParams.cityId = ''
  180. this.queryParams.districtId = ''
  181. getRegionChildrenApi(this.queryParams.provinceId).then(res => {
  182. if(res.code == 200) {
  183. this.cityDataList = res.data
  184. }
  185. })
  186. },
  187. //选择市
  188. getDistrictData() {
  189. this.queryParams.districtId = ''
  190. getRegionChildrenApi(this.queryParams.cityId).then(res => {
  191. if(res.code == 200) {
  192. this.districtDataList = res.data
  193. }
  194. })
  195. },
  196. getProvinceData() {
  197. getProvinceDataApi().then(res => {
  198. if(res.code == 200) {
  199. this.provinceDataList = res.data
  200. }
  201. })
  202. },
  203. getList() {
  204. this.loading = true;
  205. if(this.userType == 'ENT_ADMIN' || this.userType == 'ENT_TECH' || this.userType == 'ENT_ADMIN_TECH' || this.userType == 'ENT_FIN' || this.userType == 'ENT_ADMIN_FIN') {
  206. listProjectApi(this.queryParams).then(response => {
  207. this.list = response.data.records;
  208. this.total = response.data.total;
  209. this.loading = false;
  210. });
  211. }else if(this.userType == 'ADMIN') {
  212. listProjectAdminApi(this.queryParams).then(response => {
  213. this.list = response.data.records;
  214. this.total = response.data.total;
  215. this.loading = false;
  216. });
  217. }
  218. },
  219. handleAdd() {
  220. this.addProjectVisible = true
  221. this.$nextTick(() => {
  222. this.$refs.addProject.init()
  223. })
  224. },
  225. handleBatchAdd() {
  226. },
  227. handleDownload(row) {
  228. downloadProjectByIDApi(row.id).then(response => {
  229. this.download(response.msg);
  230. });
  231. },
  232. handleBatchDel() {
  233. },
  234. handleDownloadBatch() {
  235. },
  236. handleUpload() {
  237. },
  238. handleDeclare(row) {
  239. this.declareVisible = true
  240. this.$nextTick(() => {
  241. this.$refs.declare.init(row.id)
  242. })
  243. },
  244. handleEdit(row) {
  245. this.$router.push({name: 'editProject', query: {id: row.id, entId: row.entId}})
  246. },
  247. // 审核
  248. handleAudit(row) {
  249. const projectId = row.id;
  250. const authState = '2'
  251. this.$confirm('是否确认提交审核该数据?', "警告", {
  252. confirmButtonText: "确定",
  253. cancelButtonText: "取消",
  254. type: "warning"
  255. }).then(function() {
  256. return projectAuditApi(projectId,authState);
  257. }).then(() => {
  258. this.queryParams.pageNum = 1;
  259. this.getList();
  260. this.$message({
  261. message: '提交成功',
  262. type: 'success'
  263. });
  264. })
  265. },
  266. handleAuditAdmin(row) {
  267. this.auditVisible = true
  268. this.$nextTick(() => {
  269. this.$refs.auditProject.init(row.id)
  270. })
  271. },
  272. // 查看
  273. handleView(row) {
  274. this.$router.push("/project/info/"+row.id)
  275. },
  276. handleDelete(row) {
  277. const id = row.id;
  278. this.$confirm('是否确认删除该数据?', "警告", {
  279. confirmButtonText: "确定",
  280. cancelButtonText: "取消",
  281. type: "warning"
  282. }).then(function() {
  283. return deleteProjectApi(id);
  284. }).then(() => {
  285. this.queryParams.pageNum = 1;
  286. this.getList();
  287. this.$message({
  288. message: '删除成功',
  289. type: 'success'
  290. });
  291. })
  292. },
  293. // 重置
  294. resetQuery() {
  295. this.dateRange = [];
  296. this.resetForm("queryForm");
  297. this.handleQuery();
  298. },
  299. // 搜索
  300. handleQuery() {
  301. this.queryParams.pageNum = 1;
  302. this.getList();
  303. },
  304. reportStateFormat(row, col, val, index) {
  305. return getLabel(reportStateOptions, val)
  306. }
  307. }
  308. }
  309. </script>
  310. <style>
  311. </style>