project-list.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  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].yearFinishInvest || "-" }}</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 isAfterRender = ref(false)
  278. onMounted(() => {
  279. //表格太复杂,渲染较慢,等页面先加载完成,再渲染表格,不然会卡住一下不动。
  280. //因为表头涉及到年份,如果年份很多,那么会更卡。
  281. setTimeout(() => {
  282. isAfterRender.value = true
  283. }, 200)
  284. })
  285. //表头
  286. const tableColumn = ref([
  287. { key: 'projectStageName', name: '项目阶段', width: 120, align: 'center' },
  288. { key: 'projectTypeName', name: '项目类型', width: 120, align: 'center' },
  289. { key: 'name', name: '项目名称' },
  290. { key: 'buildScaleName', name: '建设规模', width: 120, align: 'center' },
  291. { key: 'allInvestMoney', name: '总投资(亿元)', width: 100, align: 'center' },
  292. { key: 'startYear', name: '计划开工年', width: 100, align: 'center' },
  293. { key: 'endYear', name: '计划完工年', width: 100, align: 'center' },
  294. { key: 'dutyUnit', name: '责任单位' },
  295. { key: 'isPilotPlanName', name: '交通强国建设试点任务', width: 100, align: 'center' },
  296. { key: 'finishedInvestMoney', name: '开工累计完成投资', width: 100, align: 'center' },
  297. { key: 'progressRatio', name: '项目进展比例(%)', width: 100, align: 'center' },
  298. /*{ key: 'fourteenFiveInvest', name: '\“十四五”\'计划投资(亿元)' },
  299. { key: 'isFocusProjectName', name: '市级重点项目' },
  300. { key: 'finishedInvestMoney', name: '完成投资金额(亿元)' },
  301. { key: 'finishedFillRatio', name: '完成情况填写比例(%)' },
  302. { key: 'leaderUnit', name: '牵头单位' },
  303. { key: 'assistUnit', name: '配合单位' },*/
  304. { key: 'action', name: '操作', width: isAdminAuth.value ? 220 : 150, fixed:'right', align: 'center' },
  305. ])
  306. //监听数据
  307. const tableData = ref(props.datas)
  308. watch(() => props.datas, (data) => {
  309. tableData.value = data
  310. })
  311. //表格被选择
  312. const tableCheckKeys = ref([])
  313. const tableCheckChange = (rows) => {
  314. tableCheckKeys.value = rows
  315. emit('check', rows)
  316. }
  317. //项目名称被点击
  318. const rowNameClick = (row) => {
  319. emit('tap', row)
  320. }
  321. //项目完成情况
  322. const isCompletionDrawer = ref(false)
  323. const completion = (row) => {
  324. isCompletionDrawer.value = true
  325. emit('completion', row)
  326. getDetailData(row.id)
  327. }
  328. //查看
  329. const rowDetail = ref({})
  330. const isDrawer = ref(false)
  331. const isDrawerType = ref('view')
  332. const examine = (row) => {
  333. isDrawer.value = true
  334. isDrawerType.value = 'view'
  335. rowDetail.value = row
  336. getDetailData(row.id)
  337. // emit('examine', row)
  338. }
  339. const getDetailData = async (id) => {
  340. const { error, code, data, msg } = await mainApi.detailMore(id)
  341. if (error || code !== 200) {
  342. window.$message.error(msg ?? '获取数据失败')
  343. drawerCancel()
  344. return
  345. }
  346. //处理数据
  347. const res = getObjValue(data)
  348. const list = getArrValue(res.list)
  349. res.list = list
  350. rowDetail.value = res
  351. yearData.value = res
  352. //设置默认数据
  353. const currentYear = new dayjs().format('YYYY')
  354. if (list.length > 0) {
  355. let isIndex = false
  356. for (let i = 0; i < list.length; i++) {
  357. const planYear = list[i].planYear.toString()
  358. if (planYear === currentYear) {
  359. yearIndex.value = i
  360. yearKey.value = list[i].planYear
  361. isIndex = true
  362. }
  363. }
  364. //默认值
  365. if (!isIndex) {
  366. yearIndex.value = 0
  367. yearKey.value = list[0].planYear
  368. }
  369. } else {
  370. yearIndex.value = -1
  371. yearKey.value = null
  372. }
  373. }
  374. //删除
  375. const delTableItem = async ({ item }, resolve) => {
  376. const { error, code, msg } = await mainApi.del(item.id)
  377. if (!error && code === 200) {
  378. window.$message.success('删除成功')
  379. resolve()
  380. emit('change')
  381. } else {
  382. window.$message.error(msg ?? '删除失败')
  383. resolve()
  384. }
  385. }
  386. //关闭抽屉
  387. const drawerCancel = () => {
  388. isDrawer.value = false
  389. isDrawerType.value = ''
  390. yearData.value = {}
  391. yearIndex.value = -1
  392. yearKey.value = null
  393. }
  394. //导出数据
  395. const deriveTableItem = async ({ item }, resolve) => {
  396. /*const { error, val } = await mainApi.exportWorkfocus(item.id)
  397. if (error) {
  398. window.$message?.error('数据异常')
  399. resolve()
  400. return
  401. }
  402. await newDownBlob(val)*/
  403. window.$message?.error('暂未开放')
  404. resolve()
  405. }
  406. //年数据
  407. const yearKey = ref('2023')
  408. const yearData = ref({})
  409. const yearIndex = ref(-1)
  410. const yearChange = (_, index) => {
  411. yearIndex.value = index
  412. }
  413. //合并列或行
  414. const tableYearMethod = ({ rowIndex, columnIndex }) => {
  415. return setSpanMethod(columnIndex, rowIndex)
  416. }
  417. //合并列或行
  418. const tableYearMethod1 = ({ rowIndex, columnIndex }) => {
  419. return setSpanMethod(columnIndex, rowIndex, false)
  420. }
  421. const saveCompleLoading = ref(false)
  422. const saveComplete = async ()=>{
  423. saveCompleLoading.value = true
  424. //发起请求
  425. const { error, code, msg } = await mainApi.updateProFin({
  426. ...yearData.value,
  427. })
  428. //判断状态
  429. saveCompleLoading.value = false
  430. if (!error && code === 200) {
  431. window.$message.success('操作成功')
  432. getDetailData(rowDetail.value.id)
  433. } else {
  434. window.$message.error(msg ?? '操作失败')
  435. }
  436. }
  437. const setSpanMethod = (column, row, isAllYear = true) => {
  438. if (column === 0) { //第一列
  439. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  440. if (rows.indexOf(row) !== -1) {
  441. //主要季度隐藏
  442. return { rowspan: 3, colspan: 1 }
  443. } else if (irows.indexOf(row) !== -1) {
  444. //非主要的季度隐藏
  445. return { rowspan: 0, colspan: 0 }
  446. } else {
  447. return { rowspan: 1, colspan: 1 }
  448. }
  449. } else if (column === 2) { //第三列
  450. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  451. if (rows.indexOf(row) !== -1) {
  452. //主要隐藏
  453. return { rowspan: 3, colspan: 1 }
  454. } else if (irows.indexOf(row) !== -1) {
  455. //非主要的隐藏
  456. return { rowspan: 0, colspan: 0 }
  457. } else {
  458. return { rowspan: 1, colspan: 1 }
  459. }
  460. } else if (column === 4) { //第五列
  461. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  462. if (rows.indexOf(row) !== -1) {
  463. //主要隐藏
  464. return { rowspan: 3, colspan: 1 }
  465. } else if (irows.indexOf(row) !== -1) {
  466. //非主要的隐藏
  467. return { rowspan: 0, colspan: 0 }
  468. } else {
  469. return { rowspan: 1, colspan: 1 }
  470. }
  471. } else if (column === 5) { //第六列
  472. if (isAllYear) {
  473. if (row === 0) {
  474. return { rowspan: 12, colspan: 1 }
  475. } else if (row > 0 && row < 12) {
  476. return { rowspan: 0, colspan: 0 }
  477. } else {
  478. return { rowspan: 1, colspan: 1 }
  479. }
  480. } else {
  481. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  482. if (rows.indexOf(row) !== -1) {
  483. //主要隐藏
  484. return { rowspan: 3, colspan: 1 }
  485. } else if (irows.indexOf(row) !== -1) {
  486. //非主要的隐藏
  487. return { rowspan: 0, colspan: 0 }
  488. } else {
  489. return { rowspan: 1, colspan: 1 }
  490. }
  491. }
  492. } else if (column === 6) { //第七列
  493. if (isAllYear) {
  494. const rows = [0, 3, 6, 9], irows = [1, 2, 4, 5, 7, 8, 10, 11]
  495. if (rows.indexOf(row) !== -1) {
  496. //主要隐藏
  497. return { rowspan: 3, colspan: 1 }
  498. } else if (irows.indexOf(row) !== -1) {
  499. //非主要的隐藏
  500. return { rowspan: 0, colspan: 0 }
  501. } else {
  502. return { rowspan: 1, colspan: 1 }
  503. }
  504. }
  505. }
  506. }
  507. const formatInput = (value)=>{
  508. // 移除非数字和小数点
  509. value = value.replace(/[^\d.]/g, '')
  510. // 将输入值转换为浮点数
  511. let floatValue = parseFloat(value)
  512. // 检查输入是否为数字且不小于0
  513. if (!isNaN(floatValue) && floatValue >= 0) {
  514. // 如果是数字且不小于0,则返回原始值
  515. return value
  516. } else {
  517. // 如果输入不符合要求,则返回空字符串
  518. return ''
  519. }
  520. }
  521. const changeInvestMoney = (val, row, index)=>{
  522. let table = yearData.value.list[yearIndex.value].list
  523. table.forEach((ele, index)=>{
  524. if (index === 0) {
  525. table[index].investMoneyAll = Number(table[index].investMoney )
  526. } else if (0 < index < 12) {
  527. // table[index].investMoneyAll = Number(table[index].investMoney ) + Number(table[index - 1].investMoneyAll)
  528. let a = Number( table[index].investMoney )
  529. let b = Number(table[index - 1].investMoneyAll)
  530. a = BigNumber(a)
  531. b = BigNumber(b)
  532. let c = a.plus(b).toNumber()
  533. table[index].investMoneyAll = c
  534. }
  535. })
  536. }
  537. const changePlanRatio = (val, row, index)=>{
  538. /*let table = yearData.value.list[yearIndex.value].list
  539. if (index > 0) {
  540. let topVal = Number(table[index - 1].planRatio)
  541. if (Number(row.planRatio) < topVal) {
  542. window.$message.warning('形象进度百分比:每季度应为增加情况,当月不得低于上月')
  543. row.planRatio = ''
  544. }
  545. } else if (index === 0) {
  546. let nextVal = Number(table[index + 1].planRatio)
  547. if (nextVal > 0 && Number(row.planRatio) > nextVal) {
  548. window.$message.warning('形象进度百分比:每季度应为增加情况,当月不得低于上月')
  549. row.planRatio = ''
  550. }
  551. }*/
  552. }
  553. //项目情况
  554. const isStatusShow = ref(false)
  555. const statusColumn = [
  556. { key: 'key1', name: '月份', align: 'center' },
  557. { key: 'key2', name: '工作计划', align: 'center' },
  558. { key: 'key3', name: '当月重大进度', align: 'center' },
  559. { key: 'key4', name: '累计完成情况', align: 'center' },
  560. { key: 'key5', name: '工程总体形象进度(%)', align: 'center' },
  561. ]
  562. const statusData = ref([
  563. { key1:'1月' }, { key1:'2月' }, { key1:'3月' }, { key1:'4月' }, { key1:'5月' }, { key1:'6月' },
  564. { key1:'7月' }, { key1:'8月' }, { key1:'9月' }, { key1:'10月' }, { key1:'11月' }, { key1:'12月' },
  565. ])
  566. const projectStatus = (row) => {
  567. console.log(row)
  568. isStatusShow.value = true
  569. }
  570. //关闭弹窗
  571. const statusClose = () => {
  572. isStatusShow.value = false
  573. }
  574. </script>
  575. <style lang="scss">
  576. .hc-project-list-table .el-table[hc].new {
  577. --el-table-header-bg-color: #101010;
  578. --el-table-header-text-color: #fff;
  579. --el-table-text-color: #101010;
  580. thead.is-group th.el-table__cell {
  581. background: var(--el-table-header-bg-color);
  582. }
  583. thead .el-table-fixed-column--left.el-table__cell,
  584. thead .el-table-fixed-column--right.el-table__cell {
  585. background: var(--el-table-header-bg-color) !important;
  586. }
  587. tbody .el-table-fixed-column--left.el-table__cell,
  588. tbody .el-table-fixed-column--right.el-table__cell {
  589. background: var(--el-table-tr-bg-color) !important;
  590. }
  591. .el-table__body tr.current-row>td.el-table__cell {
  592. background-color: var(--el-table-current-row-bg-color) !important;
  593. }
  594. }
  595. .hc-project-list-drawer-year {
  596. position: relative;
  597. border: 1px solid #dddddd;
  598. border-top: 0;
  599. height: calc(100% - 170px);
  600. &.detail {
  601. height: calc(100% - 34px);
  602. }
  603. .year-detail {
  604. padding: 14px;
  605. background: #f7f7f7;
  606. border-radius: 5px;
  607. .hc-card-item-header {
  608. border-bottom: 1px solid #ecebeb;
  609. padding-bottom: 10px;
  610. .item-header {
  611. justify-content: center;
  612. }
  613. }
  614. .el-table {
  615. --el-table-border-color: #dcdcdc;
  616. --el-table-header-text-color: #101010;
  617. --el-table-row-hover-bg-color: transparent;
  618. }
  619. .el-table th.el-table__cell.line {
  620. padding: 0;
  621. height: 100%;
  622. .cell {
  623. padding: 0;
  624. height: 100%;
  625. display: contents;
  626. }
  627. .hc-table-th-line {
  628. position: relative;
  629. height: 100%;
  630. font-size: 14px;
  631. display: contents;
  632. .left {
  633. position: absolute;
  634. bottom: 20px;
  635. left: 12px;
  636. }
  637. .right {
  638. position: absolute;
  639. top: 18px;
  640. right: 8px;
  641. font-size: 13px;
  642. }
  643. &::after {
  644. content: '';
  645. position: absolute;
  646. top: 51px;
  647. left: -30px;
  648. width: 180px;
  649. height: 1px;
  650. background: #dcdcdc;
  651. transform: rotate(41deg);
  652. }
  653. }
  654. }
  655. &.edit .el-table--enable-row-transition .el-table__body td.el-table__cell {
  656. height: 60px;
  657. }
  658. .el-table .el-table__cell .cell {
  659. .hc-new-main-body_content {
  660. padding: 4px !important;
  661. .el-input, .el-textarea {
  662. height: 100%;
  663. .el-input__inner {
  664. text-align: center;
  665. }
  666. .el-textarea__inner {
  667. height: 100%;
  668. }
  669. }
  670. }
  671. }
  672. }
  673. }
  674. .project-status-dialog .hc-card-item-box {
  675. background: #f8f8f8;
  676. .hc-card-item-header {
  677. color: #101010;
  678. }
  679. }
  680. </style>