projectBook.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div class="_ProjectCenterBook">
  3. <div class="searchBox">
  4. <div class="form">
  5. <span class="formSpan">项目名称:</span>
  6. <el-input v-model="queryParams.xmmc" placeholder="请输入项目名称" style="width: 210px" />
  7. </div>
  8. <div class="form">
  9. <span class="formSpan">项目编号:</span>
  10. <el-input v-model="queryParams.xmbh" placeholder="请输入项目名称" style="width: 160px" />
  11. </div>
  12. <div class="form">
  13. <span class="formSpan">行政区:</span>
  14. <div style="width: 160px">
  15. <el-tree-select
  16. v-model="queryParams.xzqdm"
  17. node-key="id"
  18. check-strictly
  19. filterable
  20. :filter-node-method="filterNodeMethod"
  21. :props="{ label: 'name' }"
  22. :data="areaTree"
  23. :render-after-expand="false"
  24. />
  25. </div>
  26. </div>
  27. <div class="form">
  28. <span class="formSpan">行业:</span>
  29. <el-select width="160px" v-model="queryParams.hyId" class="m-2" placeholder="请选择行业">
  30. <el-option
  31. v-for="item in industryListAll"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value"
  35. />
  36. </el-select>
  37. </div>
  38. <div class="form">
  39. <span class="formSpan">立项时间:</span>
  40. <el-date-picker
  41. v-model="lxsjObj"
  42. type="daterange"
  43. unlink-panels
  44. range-separator="To"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期"
  47. />
  48. </div>
  49. <div class="form" style="margin-right: 80px">
  50. <span class="formSpan">合同:</span>
  51. <el-radio-group v-model="queryParams.isSign">
  52. <el-radio>全部</el-radio>
  53. <el-radio label="1">已签订</el-radio>
  54. <el-radio label="0">未签订</el-radio>
  55. </el-radio-group>
  56. </div>
  57. <div class="form">
  58. <span class="formSpan">项目状态:</span>
  59. <el-radio-group v-model="queryParams.xmzt">
  60. <el-radio :label="1">进行中(10)</el-radio>
  61. <el-radio :label="4">已验收(7)</el-radio>
  62. <el-radio :label="2">已结项(1)</el-radio>
  63. <el-radio :label="9">已终止(0)</el-radio>
  64. <el-radio>全部(19)</el-radio>
  65. </el-radio-group>
  66. </div>
  67. <div class="from">
  68. <div class="btnBox">
  69. <el-button type="primary" style="background: #3485ff" @click="searchHandle">
  70. <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
  71. 查询</el-button
  72. >
  73. <el-button type="primary">
  74. <img src="@/assets/imgs/OA/open.png" class="mr-8px" alt="" />
  75. 导出</el-button
  76. >
  77. </div>
  78. </div>
  79. </div>
  80. <div class="infoBox">
  81. <ul>
  82. <li v-for="(item, index) in infoList" :key="index" class="mr-40px">
  83. <img class="mr-8px" :src="getAssetURL(item.icon)" alt="" />
  84. <p>{{ item.name }}:</p>
  85. <h4 class="font-size-18px">{{ item.num }}</h4>
  86. </li>
  87. </ul>
  88. </div>
  89. <div class="tableBox">
  90. <div class="table" ref="tableRef">
  91. <el-table
  92. stripe
  93. :data="tableData"
  94. style="width: 100%; height: 100%"
  95. :style="{ height: tableHeight + 'px' }"
  96. :header-cell-style="{
  97. background: '#E5F0FB',
  98. color: '#233755',
  99. height: '50px'
  100. }"
  101. >
  102. <el-table-column label="序号" width="60">
  103. <template #default="scope">{{ scope.$index + 1 }}</template>
  104. </el-table-column>
  105. <el-table-column prop="xmmc" label="项目名称" width="320" />
  106. <el-table-column prop="xmbh" label="项目编号" width="180" />
  107. <el-table-column prop="xzqmc" label="行政区" width="100">
  108. <template #default="scope">
  109. {{ district[scope.row.xzqdm] }}
  110. </template>
  111. </el-table-column>
  112. <el-table-column prop="projectTypeName" label="项目类别" width="120" />
  113. <el-table-column prop="zrbm" label="责任部门" width="200" />
  114. <el-table-column prop="xmjl" label="项目经理" width="120" />
  115. <el-table-column prop="lxsj" label="立项时间" width="120" />
  116. <el-table-column prop="yssj" label="验收时间" width="120" />
  117. <el-table-column prop="outputValue" label="合同额" width="120" />
  118. <el-table-column prop="xmzt" label="项目状态" width="120">
  119. <template #default="scope">
  120. {{ xmztMap[scope.row.xmzt] }}
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="操作" width="80" fixed="right">
  124. <template #default="scope">
  125. <div class="operateBtn" @click="operateClick(scope.row)">
  126. <span>查看</span>
  127. </div>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. </div>
  132. <div class="pageBox">
  133. <el-pagination
  134. v-model:current-page="queryParams.pageNo"
  135. :page-size="10"
  136. background
  137. layout="total, prev, pager, next, jumper"
  138. :total="total"
  139. @current-change="handleCurrentChange"
  140. />
  141. </div>
  142. </div>
  143. </div>
  144. </template>
  145. <script setup lang="ts">
  146. import moment from 'moment'
  147. import { useRouter } from 'vue-router'
  148. import request from '@/config/axios'
  149. import { getAssetURL } from '@/utils/auth'
  150. import { industryListAll } from '@/utils/business'
  151. import district from '@/components/Area/district.js'
  152. defineOptions({ name: 'ProjectBook' })
  153. const xmztMap: any = { 0: '立项申请中', 1: '进行中', 2: '已结项', 3: '中止' }
  154. const router = useRouter()
  155. const tableRef: any = ref(null)
  156. const tableHeight: any = ref(0)
  157. const queryParams = reactive<{
  158. xmbh: string
  159. xmmc: string
  160. xmlbId: string
  161. lxsjOn: string
  162. lxsjOff: string
  163. pageNo: number
  164. xzqdm: number | string
  165. pageSize: number
  166. isSign: any
  167. xmzt: any
  168. hyId: any
  169. }>({
  170. xmbh: '',
  171. xmmc: '',
  172. xmlbId: '15',
  173. lxsjOn: '',
  174. lxsjOff: '',
  175. pageNo: 1,
  176. xzqdm: '',
  177. pageSize: 10,
  178. isSign: '',
  179. xmzt: '',
  180. hyId: 0
  181. })
  182. const lxsjObj = ref()
  183. const infoList: any = ref([
  184. {
  185. icon: 'xmzx/xmzcz',
  186. name: '项目总产值(元)',
  187. num: '0'
  188. },
  189. {
  190. icon: 'xmzx/xmzcb',
  191. name: '项目总成本(元)',
  192. num: '0'
  193. },
  194. {
  195. icon: 'xmzx/xmzlr',
  196. name: '项目总利润(元)',
  197. num: '-100000.57'
  198. }
  199. ])
  200. const handleCurrentChange = (pageNo: number) => {
  201. queryParams.pageNo = pageNo
  202. queryProjectListAjax()
  203. }
  204. const operateClick = (row: any) => {
  205. router.push({
  206. path: 'projectDetail',
  207. query: { id: row.id }
  208. })
  209. }
  210. const tableData = ref<Array<any>>([])
  211. const total = ref<number>()
  212. const searchHandle: () => void = () => {
  213. queryProjectListAjax()
  214. }
  215. const queryProjectListAjax = async (): Promise<void> => {
  216. const urlApi = `/project/page`
  217. if (lxsjObj.value && lxsjObj.value.length > 0) {
  218. queryParams.lxsjOn = moment(lxsjObj.value[0]).format('YYYY-MM-DD')
  219. queryParams.lxsjOff = moment(lxsjObj.value[1]).format('YYYY-MM-DD')
  220. } else {
  221. queryParams.lxsjOn = ''
  222. queryParams.lxsjOff = ''
  223. }
  224. const sendData = {
  225. ...queryParams,
  226. pageSize: 10
  227. }
  228. if (sendData['hyId'] == 0) {
  229. sendData['hyId'] = null
  230. }
  231. const result = await request.get({ url: urlApi, params: sendData }, '/business')
  232. tableData.value = result['records']
  233. total.value = result['total']
  234. }
  235. queryProjectListAjax()
  236. /**
  237. * 获取行政区tree结构数据
  238. */
  239. const areaTree = ref<Array<any>>()
  240. const filterNodeMethod = (value, data) => {
  241. return data.name.includes(value)
  242. }
  243. const queryAreaTreeAjax = async (): Promise<void> => {
  244. const urlApi = `/system/area/tree`
  245. const result = await request.get({ url: urlApi })
  246. areaTree.value = result
  247. }
  248. queryAreaTreeAjax()
  249. onMounted(() => {
  250. tableHeight.value = tableRef.value.clientHeight
  251. })
  252. </script>
  253. <style lang="scss" scoped>
  254. @import url('./projectBook.scss');
  255. </style>