project-list.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. <template>
  2. <div v-loading="!isAfterRender" element-loading-text="加载中..." class="hc-full">
  3. <hc-table
  4. v-if="isAfterRender" :column="tableColumn" :datas="tableData" :index-style="{ width: 60 }" is-check
  5. :check-style="{ fixed: true, width: 29 }" class="hc-project-list-table" @selection-change="tableCheckChange"
  6. >
  7. <template #name="{ row }">
  8. <el-link type="primary" @click="rowNameClick(row)">{{ row.name }}</el-link>
  9. </template>
  10. <template #action="{ row }">
  11. <el-link v-if="isAdminAuth" type="warning" @click="completion(row)">项目完成情况</el-link>
  12. <el-link type="primary" @click="examine(row)">查看</el-link>
  13. <el-link v-if="isAdminAuth" v-del-com:[delTableItem]="row" type="danger">删除</el-link>
  14. <el-link v-if="!isAdminAuth" type="warning" @click="projectStatus(row)">项目情况</el-link>
  15. <el-link v-yes-com:[deriveTableItem]="row" type="success">导出</el-link>
  16. </template>
  17. </hc-table>
  18. <!-- 查看详情 -->
  19. <hc-drawer v-model="isDrawer" to-id="hc-main-box" is-close>
  20. <hc-card class="hc-project-list-drawer" :scrollbar="true">
  21. <template #header>
  22. <div class="flex-1 text-center text-[24px] font-bold">项目详情</div>
  23. </template>
  24. <HcInfoTable>
  25. <tr>
  26. <hc-info-table-td is-title width="10%" center>项目阶段</hc-info-table-td>
  27. <hc-info-table-td center width="40%">{{ rowDetail?.projectStageName }}</hc-info-table-td>
  28. <hc-info-table-td is-title width="10%" center>项目类型</hc-info-table-td>
  29. <hc-info-table-td center width="40%">{{ rowDetail?.projectTypeName }}</hc-info-table-td>
  30. </tr>
  31. <tr>
  32. <hc-info-table-td is-title width="10%" center>项目名称</hc-info-table-td>
  33. <hc-info-table-td center width="40%">{{ rowDetail?.name }}</hc-info-table-td>
  34. <hc-info-table-td is-title width="10%" center>建设规模</hc-info-table-td>
  35. <hc-info-table-td center width="40%">{{ rowDetail?.buildScaleName }}</hc-info-table-td>
  36. </tr>
  37. </HcInfoTable>
  38. <HcInfoTable class="mt-[-1px]">
  39. <tr>
  40. <hc-info-table-td is-title width="10%" center>计划开工年</hc-info-table-td>
  41. <hc-info-table-td center width="15%">{{ rowDetail?.startYear }}</hc-info-table-td>
  42. <hc-info-table-td is-title width="10%" center>计划完工年</hc-info-table-td>
  43. <hc-info-table-td center width="15%">{{ rowDetail?.endYear }}</hc-info-table-td>
  44. <hc-info-table-td is-title width="10%" center>总投资</hc-info-table-td>
  45. <hc-info-table-td center width="40%">{{ rowDetail?.allInvestMoney }}</hc-info-table-td>
  46. </tr>
  47. </HcInfoTable>
  48. <HcInfoTable class="mt-[-1px]">
  49. <tr>
  50. <hc-info-table-td is-title width="10%" center>交通强国建设试点任务</hc-info-table-td>
  51. <hc-info-table-td center width="40%">{{ rowDetail?.isPilotPlan === 1 ? '是' : '否' }}</hc-info-table-td>
  52. <hc-info-table-td is-title width="10%" center>责任单位</hc-info-table-td>
  53. <hc-info-table-td center width="40%">{{ rowDetail?.dutyUnit }}</hc-info-table-td>
  54. </tr>
  55. </HcInfoTable>
  56. <div class="hc-project-list-drawer-year">
  57. <el-scrollbar>
  58. <div class="relative p-2 pt-3">
  59. <hc-card-item class="year-detail">
  60. <template #header>
  61. <div class="flex-1 text-center text-[14px]">
  62. <HcDropdown v-model="yearKey" :datas="yearData.list" text="年" :props="{ key: 'planYear', label: 'planYear' }" @change="yearChange" />
  63. </div>
  64. </template>
  65. <el-table v-if="yearData.list && yearData.list.length > 0" :data="yearData.list[yearIndex].list" border class="w-full" :span-method="tableYearMethod">
  66. <el-table-column prop="planQuarterName" label="季度" width="100" align="center" />
  67. <el-table-column prop="planMonthName" class-name="line" width="120" align="center">
  68. <template #header>
  69. <div class="hc-table-th-line">
  70. <span class="left">月份</span>
  71. <span class="right">完成情况</span>
  72. </div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="投资情况(亿元)" align="center">
  76. <el-table-column prop="planInvestMoney" label="计划完成投资额" width="100" align="center" />
  77. <el-table-column prop="investMoney" label="当月完成投资额" width="100" align="center" />
  78. <el-table-column prop="investUnfinishedMoney" label="与计划投资的差距" width="100" align="center" />
  79. </el-table-column>
  80. <el-table-column label="建设情况" align="center">
  81. <el-table-column prop="yearlyTarget" label="年度主要目标任务" width="100" align="center" />
  82. <el-table-column prop="workPlan" label="工作计划" width="100" align="center" />
  83. <el-table-column prop="workProgress" label="当月重大进展" align="center" />
  84. <el-table-column prop="workProgressAll" label="累计进展计划" align="center" />
  85. <el-table-column prop="planRatio" label="工作总体形象进度(%)" width="100" align="center" />
  86. </el-table-column>
  87. </el-table>
  88. <HcInfoTable v-if="yearData.list && yearData.list.length > 0" class="mt-[-1px]">
  89. <tr>
  90. <hc-info-table-td is-title width="128px" center>全年计划完成投资</hc-info-table-td>
  91. <hc-info-table-td center width="100px">{{ yearData.list[yearIndex].yearlyInvest || "-" }}</hc-info-table-td>
  92. <hc-info-table-td is-title width="100px" center>存在问题</hc-info-table-td>
  93. <hc-info-table-td center>{{ yearData.list[yearIndex]?.questionable || '-' }}</hc-info-table-td>
  94. <hc-info-table-td is-title width="100px" center>工作建议</hc-info-table-td>
  95. <hc-info-table-td center>{{ yearData.list[yearIndex]?.workAdvise || '-' }}</hc-info-table-td>
  96. </tr>
  97. <tr>
  98. <hc-info-table-td is-title width="128px" center>开工累计完成投资</hc-info-table-td>
  99. <hc-info-table-td center width="100px">{{ yearData.list[yearIndex].yearFinishInvest || "-" }}</hc-info-table-td>
  100. <hc-info-table-td is-title width="100px" center>联系人</hc-info-table-td>
  101. <hc-info-table-td center>{{ yearData.list[yearIndex]?.linkman || '-' }}</hc-info-table-td>
  102. <hc-info-table-td is-title width="100px" center>联系电话</hc-info-table-td>
  103. <hc-info-table-td center>{{ yearData.list[yearIndex]?.phone || '-' }}</hc-info-table-td>
  104. </tr>
  105. </HcInfoTable>
  106. </hc-card-item>
  107. </div>
  108. </el-scrollbar>
  109. </div>
  110. </hc-card>
  111. </hc-drawer>
  112. <!-- 项目完成情况 -->
  113. <hc-drawer v-model="isCompletionDrawer" to-id="hc-main-box" is-close>
  114. <hc-card class="hc-project-list-drawer" is-action-btn :scrollbar="true">
  115. <template #header>
  116. <div class="flex-1 text-center text-[24px] font-bold">项目完成情况</div>
  117. </template>
  118. <HcInfoTable>
  119. <tr>
  120. <hc-info-table-td is-title width="30px" center>项目名称</hc-info-table-td>
  121. <hc-info-table-td center>{{ rowDetail?.name }}</hc-info-table-td>
  122. <hc-info-table-td is-title width="30px" center>建设规模</hc-info-table-td>
  123. <hc-info-table-td center>{{ rowDetail?.buildScaleName }}</hc-info-table-td>
  124. </tr>
  125. </HcInfoTable>
  126. <div class="hc-project-list-drawer-year detail">
  127. <el-scrollbar>
  128. <div class="relative p-2 pt-3">
  129. <hc-card-item class="year-detail edit">
  130. <template #header>
  131. <div class="flex-1 text-center text-[14px]">
  132. <HcDropdown v-model="yearKey" :datas="yearData.list" text="年" :props="{ key: 'planYear', label: 'planYear' }" @change="yearChange" />
  133. </div>
  134. </template>
  135. <el-table v-if="yearData.list && yearData.list.length > 0" :data="yearData.list[yearIndex].list" border class="w-full" :span-method="tableYearMethod1">
  136. <el-table-column prop="planQuarterName" label="季度" width="100" align="center" />
  137. <el-table-column prop="planMonthName" class-name="line" width="120" align="center">
  138. <template #header>
  139. <div class="hc-table-th-line">
  140. <span class="left">月份</span>
  141. <span class="right">完成情况</span>
  142. </div>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="投资情况(亿元)" align="center">
  146. <el-table-column prop="planInvestMoney" label="计划完成投资额" width="100" align="center">
  147. <template #default="{ row }">
  148. <hc-body>
  149. <hc-table-input v-model="row.planInvestMoney" disabled />
  150. </hc-body>
  151. </template>
  152. </el-table-column>
  153. <el-table-column prop="investMoney" label="当月完成投资额" width="100" align="center">
  154. <template #default="{ row, $index }">
  155. <hc-body>
  156. <!-- <hc-table-input v-model="row.investMoney" /> -->
  157. <el-input v-model="row.investMoney" clearable :formatter="formatInput" :disabled="(yearData.list[yearIndex].isCanFill === 1 ? false : true) || !row.planInvestMoney" @change="changeInvestMoney($event, row, $index)" />
  158. </hc-body>
  159. </template>
  160. </el-table-column>
  161. <el-table-column prop="investUnfinishedMoney" label="与计划投资的差距" width="100" align="center">
  162. <template #default="{ row }">
  163. <hc-body>
  164. <hc-table-input v-model="row.investUnfinishedMoney" disabled />
  165. </hc-body>
  166. </template>
  167. </el-table-column>
  168. </el-table-column>
  169. <el-table-column label="建设情况" align="center">
  170. <el-table-column prop="workPlan" label="工作计划" width="100" align="center">
  171. <template #default="{ row }">
  172. <hc-body>
  173. <hc-table-input v-model="row.workPlan" type="textarea" disabled resize="none" />
  174. </hc-body>
  175. </template>
  176. </el-table-column>
  177. <el-table-column prop="workProgress" label="当月重大进展" align="center">
  178. <template #default="{ row }">
  179. <hc-body>
  180. <hc-table-input v-model="row.workProgress" type="textarea" resize="none" :disabled="(yearData.list[yearIndex].isCanFill === 1 ? false : true) || !row.workPlan" />
  181. </hc-body>
  182. </template>
  183. </el-table-column>
  184. <el-table-column prop="workProgressAll" label="累计进展情况" align="center">
  185. <template #default="{ row }">
  186. <hc-body>
  187. <hc-table-input v-model="row.workProgressAll" type="textarea" resize="none" :disabled="(yearData.list[yearIndex].isCanFill === 1 ? false : true) || !row.workPlan" />
  188. </hc-body>
  189. </template>
  190. </el-table-column>
  191. <el-table-column prop="planRatio" label="工作总体形象进度(%)" width="100" align="center">
  192. <template #default="{ row, $index }">
  193. <hc-body>
  194. <!-- <hc-table-input v-model="row.planRatio" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" /> -->
  195. <el-input v-model="row.planRatio" :disabled="(yearData.list[yearIndex].isCanFill === 1 ? false : true) || !row.workPlan" :formatter="formatInput" @change="changePlanRatio($enent, row, $index)" />
  196. </hc-body>
  197. </template>
  198. </el-table-column>
  199. </el-table-column>
  200. </el-table>
  201. <HcInfoTable v-if="yearData.list && yearData.list.length > 0" class="mt-[-1px]">
  202. <tr>
  203. <hc-info-table-td is-title width="30px" center>存在问题</hc-info-table-td>
  204. <hc-info-table-td center>
  205. <el-input v-model="yearData.list[yearIndex].questionable" type="textarea" resize="none" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
  206. </hc-info-table-td>
  207. <hc-info-table-td is-title width="30px" center>工作建议</hc-info-table-td>
  208. <hc-info-table-td center>
  209. <el-input v-model=" yearData.list[yearIndex].workAdvise" type="textarea" resize="none" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
  210. </hc-info-table-td>
  211. </tr>
  212. <tr>
  213. <hc-info-table-td is-title width="30px" center>联系人</hc-info-table-td>
  214. <hc-info-table-td center>
  215. <el-input v-model="yearData.list[yearIndex].linkman " :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
  216. </hc-info-table-td>
  217. <hc-info-table-td is-title width="30px" center>联系电话</hc-info-table-td>
  218. <hc-info-table-td center>
  219. <el-input v-model="yearData.list[yearIndex].phone" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
  220. </hc-info-table-td>
  221. </tr>
  222. </HcInfoTable>
  223. </hc-card-item>
  224. </div>
  225. </el-scrollbar>
  226. </div>
  227. <template #action>
  228. <el-button type="info" @click="isCompletionDrawer = false">取消</el-button>
  229. <el-button type="warning" :loading="saveCompleLoading" @click="saveComplete">保存</el-button>
  230. </template>
  231. </hc-card>
  232. </hc-drawer>
  233. <!-- 项目情况 -->
  234. <hc-dialog v-model="isStatusShow" widths="60rem" title="项目情况" is-table :footer="false" @close="statusClose">
  235. <div class="project-status-dialog relative h-390px">
  236. <hc-card-item title="项目投资情况">
  237. <HcStatusCharts :datas="{ a: [150, 100, 240, 100], b: [100, 160, 280, 120] }" />
  238. </hc-card-item>
  239. </div>
  240. <div class="project-status-dialog relative mt-14px">
  241. <hc-card-item title="项目进度情况">
  242. <hc-table :column="statusColumn" :datas="statusData" :is-index="false" />
  243. </hc-card-item>
  244. </div>
  245. </hc-dialog>
  246. </div>
  247. </template>
  248. <script setup>
  249. import { onMounted, ref, watch } from 'vue'
  250. import mainApi from '~api/project/project'
  251. import { getArrValue, getObjValue } from 'js-fast-way'
  252. import BigNumber from 'bignumber.js'
  253. import dayjs from 'dayjs'
  254. import HcStatusCharts from './components/charts.vue'
  255. const props = defineProps({
  256. isAdmin: {
  257. type: Boolean,
  258. default: false,
  259. },
  260. loading: {
  261. type: Boolean,
  262. default: false,
  263. },
  264. datas: {
  265. type: Array,
  266. default: () => ([]),
  267. },
  268. })
  269. //事件
  270. const emit = defineEmits(['tap', 'completion', 'examine', 'del', 'export', 'check', 'change'])
  271. //监听权限
  272. const isAdminAuth = ref(props.isAdmin)
  273. watch(() => props.isAdmin, (admin) => {
  274. isAdminAuth.value = admin
  275. })
  276. //渲染完成
  277. const currentYear = ref('')
  278. const isAfterRender = ref(false)
  279. onMounted(() => {
  280. //表格太复杂,渲染较慢,等页面先加载完成,再渲染表格,不然会卡住一下不动。
  281. //因为表头涉及到年份,如果年份很多,那么会更卡。
  282. currentYear.value = new dayjs().format('YYYY')
  283. setTimeout(() => {
  284. isAfterRender.value = true
  285. }, 200)
  286. })
  287. //表头
  288. const tableColumn = ref([
  289. { key: 'projectStageName', name: '项目阶段', width: 120, align: 'center' },
  290. { key: 'projectTypeName', name: '项目类型', width: 120, align: 'center' },
  291. { key: 'name', name: '项目名称' },
  292. { key: 'buildScaleName', name: '建设规模', width: 120, align: 'center' },
  293. { key: 'allInvestMoney', name: '总投资(亿元)', width: 100, align: 'center' },
  294. { key: 'startYear', name: '计划开工年', width: 100, align: 'center' },
  295. { key: 'endYear', name: '计划完工年', width: 100, align: 'center' },
  296. { key: 'dutyUnit', name: '责任单位' },
  297. { key: 'isPilotPlanName', name: '交通强国建设试点任务', width: 100, align: 'center' },
  298. { key: 'finishedInvestMoney', name: '开工累计完成投资', width: 100, align: 'center' },
  299. { key: 'progressRatio', name: '项目进展比例(%)', width: 100, align: 'center' },
  300. /*{ key: 'fourteenFiveInvest', name: '\“十四五”\'计划投资(亿元)' },
  301. { key: 'isFocusProjectName', name: '市级重点项目' },
  302. { key: 'finishedInvestMoney', name: '完成投资金额(亿元)' },
  303. { key: 'finishedFillRatio', name: '完成情况填写比例(%)' },
  304. { key: 'leaderUnit', name: '牵头单位' },
  305. { key: 'assistUnit', name: '配合单位' },*/
  306. { key: 'action', name: '操作', width: isAdminAuth.value ? 220 : 150, fixed:'right', align: 'center' },
  307. ])
  308. //监听数据
  309. const tableData = ref(props.datas)
  310. watch(() => props.datas, (data) => {
  311. tableData.value = data
  312. })
  313. //表格被选择
  314. const tableCheckKeys = ref([])
  315. const tableCheckChange = (rows) => {
  316. tableCheckKeys.value = rows
  317. emit('check', rows)
  318. }
  319. //项目名称被点击
  320. const rowNameClick = (row) => {
  321. emit('tap', row)
  322. }
  323. //项目完成情况
  324. const isCompletionDrawer = ref(false)
  325. const completion = (row) => {
  326. isCompletionDrawer.value = true
  327. emit('completion', row)
  328. getDetailData(row.id)
  329. }
  330. //查看
  331. const rowDetail = ref({})
  332. const isDrawer = ref(false)
  333. const isDrawerType = ref('view')
  334. const examine = (row) => {
  335. isDrawer.value = true
  336. isDrawerType.value = 'view'
  337. rowDetail.value = row
  338. getDetailData(row.id)
  339. // emit('examine', row)
  340. }
  341. const getDetailData = async (id) => {
  342. const { error, code, data, msg } = await mainApi.detailMore(id)
  343. if (error || code !== 200) {
  344. window.$message.error(msg ?? '获取数据失败')
  345. drawerCancel()
  346. return
  347. }
  348. //处理数据
  349. const res = getObjValue(data)
  350. const list = getArrValue(res.list)
  351. res.list = list
  352. rowDetail.value = res
  353. yearData.value = res
  354. //设置默认数据
  355. if (list.length > 0) {
  356. let isIndex = false
  357. for (let i = 0; i < list.length; i++) {
  358. const planYear = list[i].planYear.toString()
  359. if (planYear === currentYear.value) {
  360. yearIndex.value = i
  361. yearKey.value = list[i].planYear
  362. isIndex = true
  363. }
  364. }
  365. //默认值
  366. if (!isIndex) {
  367. yearIndex.value = 0
  368. yearKey.value = list[0].planYear
  369. }
  370. } else {
  371. yearIndex.value = -1
  372. yearKey.value = null
  373. }
  374. }
  375. //删除
  376. const delTableItem = async ({ item }, resolve) => {
  377. const { error, code, msg } = await mainApi.del(item.id)
  378. if (!error && code === 200) {
  379. window.$message.success('删除成功')
  380. resolve()
  381. emit('change')
  382. } else {
  383. window.$message.error(msg ?? '删除失败')
  384. resolve()
  385. }
  386. }
  387. //关闭抽屉
  388. const drawerCancel = () => {
  389. isDrawer.value = false
  390. isDrawerType.value = ''
  391. yearData.value = {}
  392. yearIndex.value = -1
  393. yearKey.value = null
  394. }
  395. //导出数据
  396. const deriveTableItem = async ({ item }, resolve) => {
  397. /*const { error, val } = await mainApi.exportWorkfocus(item.id)
  398. if (error) {
  399. window.$message?.error('数据异常')
  400. resolve()
  401. return
  402. }
  403. await newDownBlob(val)*/
  404. window.$message?.error('暂未开放')
  405. resolve()
  406. }
  407. //年数据
  408. const yearKey = ref('')
  409. const yearData = ref({})
  410. const yearIndex = ref(-1)
  411. const yearChange = (_, index) => {
  412. yearIndex.value = index
  413. }
  414. //合并列或行
  415. const tableYearMethod = ({ rowIndex, columnIndex }) => {
  416. return setSpanMethod(columnIndex, rowIndex)
  417. }
  418. //合并列或行
  419. const tableYearMethod1 = ({ rowIndex, columnIndex }) => {
  420. return setSpanMethod(columnIndex, rowIndex, false)
  421. }
  422. const saveCompleLoading = ref(false)
  423. const saveComplete = async ()=>{
  424. saveCompleLoading.value = true
  425. //发起请求
  426. const { error, code, msg } = await mainApi.updateProFin({
  427. ...yearData.value,
  428. })
  429. //判断状态
  430. saveCompleLoading.value = false
  431. if (!error && code === 200) {
  432. window.$message.success('操作成功')
  433. getDetailData(rowDetail.value.id)
  434. } else {
  435. window.$message.error(msg ?? '操作失败')
  436. }
  437. }
  438. const setSpanMethod = (column, row, isAllYear = true) => {
  439. if (column === 0) { //第一列
  440. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  441. if (rows.indexOf(row) !== -1) {
  442. //主要季度隐藏
  443. return { rowspan: 3, colspan: 1 }
  444. } else if (irows.indexOf(row) !== -1) {
  445. //非主要的季度隐藏
  446. return { rowspan: 0, colspan: 0 }
  447. } else {
  448. return { rowspan: 1, colspan: 1 }
  449. }
  450. } else if (column === 2) { //第三列
  451. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  452. if (rows.indexOf(row) !== -1) {
  453. //主要隐藏
  454. return { rowspan: 3, colspan: 1 }
  455. } else if (irows.indexOf(row) !== -1) {
  456. //非主要的隐藏
  457. return { rowspan: 0, colspan: 0 }
  458. } else {
  459. return { rowspan: 1, colspan: 1 }
  460. }
  461. } else if (column === 4) { //第五列
  462. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  463. if (rows.indexOf(row) !== -1) {
  464. //主要隐藏
  465. return { rowspan: 3, colspan: 1 }
  466. } else if (irows.indexOf(row) !== -1) {
  467. //非主要的隐藏
  468. return { rowspan: 0, colspan: 0 }
  469. } else {
  470. return { rowspan: 1, colspan: 1 }
  471. }
  472. } else if (column === 5) { //第六列
  473. if (isAllYear) {
  474. if (row === 0) {
  475. return { rowspan: 12, colspan: 1 }
  476. } else if (row > 0 && row < 12) {
  477. return { rowspan: 0, colspan: 0 }
  478. } else {
  479. return { rowspan: 1, colspan: 1 }
  480. }
  481. } else {
  482. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  483. if (rows.indexOf(row) !== -1) {
  484. //主要隐藏
  485. return { rowspan: 3, colspan: 1 }
  486. } else if (irows.indexOf(row) !== -1) {
  487. //非主要的隐藏
  488. return { rowspan: 0, colspan: 0 }
  489. } else {
  490. return { rowspan: 1, colspan: 1 }
  491. }
  492. }
  493. } else if (column === 6) { //第七列
  494. if (isAllYear) {
  495. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  496. if (rows.indexOf(row) !== -1) {
  497. //主要隐藏
  498. return { rowspan: 3, colspan: 1 }
  499. } else if (irows.indexOf(row) !== -1) {
  500. //非主要的隐藏
  501. return { rowspan: 0, colspan: 0 }
  502. } else {
  503. return { rowspan: 1, colspan: 1 }
  504. }
  505. }
  506. }
  507. }
  508. const formatInput = (value)=>{
  509. // 移除非数字和小数点
  510. value = value.replace(/[^\d.]/g, '')
  511. // 将输入值转换为浮点数
  512. let floatValue = parseFloat(value)
  513. // 检查输入是否为数字且不小于0
  514. if (!isNaN(floatValue) && floatValue >= 0) {
  515. // 如果是数字且不小于0,则返回原始值
  516. return value
  517. } else {
  518. // 如果输入不符合要求,则返回空字符串
  519. return ''
  520. }
  521. }
  522. const changeInvestMoney = (val, row, index)=>{
  523. let table = yearData.value.list[yearIndex.value].list
  524. table.forEach((ele, index)=>{
  525. if (index === 0) {
  526. table[index].investMoneyAll = Number(table[index].investMoney )
  527. } else if (0 < index < 12) {
  528. // table[index].investMoneyAll = Number(table[index].investMoney ) + Number(table[index - 1].investMoneyAll)
  529. let a = Number( table[index].investMoney )
  530. let b = Number(table[index - 1].investMoneyAll)
  531. a = BigNumber(a)
  532. b = BigNumber(b)
  533. let c = a.plus(b).toNumber()
  534. table[index].investMoneyAll = c
  535. }
  536. })
  537. }
  538. const changePlanRatio = (val, row, index)=>{
  539. /*let table = yearData.value.list[yearIndex.value].list
  540. if (index > 0) {
  541. let topVal = Number(table[index - 1].planRatio)
  542. if (Number(row.planRatio) < topVal) {
  543. window.$message.warning('形象进度百分比:每季度应为增加情况,当月不得低于上月')
  544. row.planRatio = ''
  545. }
  546. } else if (index === 0) {
  547. let nextVal = Number(table[index + 1].planRatio)
  548. if (nextVal > 0 && Number(row.planRatio) > nextVal) {
  549. window.$message.warning('形象进度百分比:每季度应为增加情况,当月不得低于上月')
  550. row.planRatio = ''
  551. }
  552. }*/
  553. }
  554. //项目情况
  555. const isStatusShow = ref(false)
  556. const statusColumn = [
  557. { key: 'key1', name: '月份', align: 'center' },
  558. { key: 'key2', name: '工作计划', align: 'center' },
  559. { key: 'key3', name: '当月重大进度', align: 'center' },
  560. { key: 'key4', name: '累计完成情况', align: 'center' },
  561. { key: 'key5', name: '工程总体形象进度(%)', align: 'center' },
  562. ]
  563. const statusData = ref([
  564. { key1:'1月' }, { key1:'2月' }, { key1:'3月' }, { key1:'4月' }, { key1:'5月' }, { key1:'6月' },
  565. { key1:'7月' }, { key1:'8月' }, { key1:'9月' }, { key1:'10月' }, { key1:'11月' }, { key1:'12月' },
  566. ])
  567. const projectStatus = (row) => {
  568. console.log(row)
  569. isStatusShow.value = true
  570. }
  571. //关闭弹窗
  572. const statusClose = () => {
  573. isStatusShow.value = false
  574. }
  575. </script>
  576. <style lang="scss">
  577. .hc-project-list-table .el-table[hc].new {
  578. --el-table-header-bg-color: #101010;
  579. --el-table-header-text-color: #fff;
  580. --el-table-text-color: #101010;
  581. thead.is-group th.el-table__cell {
  582. background: var(--el-table-header-bg-color);
  583. }
  584. thead .el-table-fixed-column--left.el-table__cell,
  585. thead .el-table-fixed-column--right.el-table__cell {
  586. background: var(--el-table-header-bg-color) !important;
  587. }
  588. tbody .el-table-fixed-column--left.el-table__cell,
  589. tbody .el-table-fixed-column--right.el-table__cell {
  590. background: var(--el-table-tr-bg-color) !important;
  591. }
  592. .el-table__body tr.current-row>td.el-table__cell {
  593. background-color: var(--el-table-current-row-bg-color) !important;
  594. }
  595. }
  596. .hc-project-list-drawer-year {
  597. position: relative;
  598. border: 1px solid #dddddd;
  599. border-top: 0;
  600. height: calc(100% - 170px);
  601. &.detail {
  602. height: calc(100% - 34px);
  603. }
  604. .year-detail {
  605. padding: 14px;
  606. background: #f7f7f7;
  607. border-radius: 5px;
  608. .hc-card-item-header {
  609. border-bottom: 1px solid #ecebeb;
  610. padding-bottom: 10px;
  611. .item-header {
  612. justify-content: center;
  613. }
  614. }
  615. .el-table {
  616. --el-table-border-color: #dcdcdc;
  617. --el-table-header-text-color: #101010;
  618. --el-table-row-hover-bg-color: transparent;
  619. }
  620. .el-table th.el-table__cell.line {
  621. padding: 0;
  622. height: 100%;
  623. .cell {
  624. padding: 0;
  625. height: 100%;
  626. display: contents;
  627. }
  628. .hc-table-th-line {
  629. position: relative;
  630. height: 100%;
  631. font-size: 14px;
  632. display: contents;
  633. .left {
  634. position: absolute;
  635. bottom: 20px;
  636. left: 12px;
  637. }
  638. .right {
  639. position: absolute;
  640. top: 18px;
  641. right: 8px;
  642. font-size: 13px;
  643. }
  644. &::after {
  645. content: '';
  646. position: absolute;
  647. top: 51px;
  648. left: -30px;
  649. width: 180px;
  650. height: 1px;
  651. background: #dcdcdc;
  652. transform: rotate(41deg);
  653. }
  654. }
  655. }
  656. &.edit .el-table--enable-row-transition .el-table__body td.el-table__cell {
  657. height: 60px;
  658. }
  659. .el-table .el-table__cell .cell {
  660. .hc-new-main-body_content {
  661. padding: 4px !important;
  662. .el-input, .el-textarea {
  663. height: 100%;
  664. .el-input__inner {
  665. text-align: center;
  666. }
  667. .el-textarea__inner {
  668. height: 100%;
  669. }
  670. }
  671. }
  672. }
  673. }
  674. }
  675. .project-status-dialog .hc-card-item-box {
  676. background: #f8f8f8;
  677. .hc-card-item-header {
  678. color: #101010;
  679. }
  680. }
  681. </style>