综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

budgetAdjust.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-05-07 11:01:39
  4. * @LastEditors:
  5. * @LastEditTime: 2025-05-12 17:18:35
  6. -->
  7. <template>
  8. <div class="main">
  9. <h2 class="text-center">项目直接生产成本预算—核算表</h2>
  10. <p style="text-align: center">编制人:{{ budgetForm.compilerUser ? budgetForm.compilerUser.nickName : '' }}</p>
  11. <el-divider></el-divider>
  12. <el-descriptions :column="3" border class="descriptions">
  13. <el-descriptions-item label="项目编号">
  14. {{ project.projectNumber }}
  15. </el-descriptions-item>
  16. <el-descriptions-item label="项目名称">
  17. {{ project.projectName }}
  18. </el-descriptions-item>
  19. <el-descriptions-item label="项目负责人">
  20. {{ getUserName(project.projectLeader) }}
  21. </el-descriptions-item>
  22. <el-descriptions-item label="承担部门">
  23. {{ getDeptNames(project.undertakingDept) }}
  24. </el-descriptions-item>
  25. <el-descriptions-item label="项目备注" :span="3">
  26. {{ project.remark }}
  27. </el-descriptions-item>
  28. <el-descriptions-item label="预算表单备注" :span="5">
  29. {{ budgetForm.remark }}
  30. </el-descriptions-item>
  31. <el-descriptions-item label="项目计划工作量" :span="3">
  32. <div>
  33. <table border="1" style="width: 100%;">
  34. <tr style="background-color:#f8f8f9">
  35. <td style="width: 250px">工作内容</td>
  36. <td style="width: 100px">比例尺/等级</td>
  37. <td style="width: 100px">单位</td>
  38. <td style="width: 100px">工作量</td>
  39. <td style="width: 100px">要求完成时间</td>
  40. <td style="width: 200px">备注</td>
  41. </tr>
  42. <tr v-for="(work, index) in workContentList" :key="index">
  43. <td>
  44. {{ work.content }}
  45. </td>
  46. <td>
  47. {{ work.scale }}
  48. </td>
  49. <td>
  50. {{ work.unit }}
  51. </td>
  52. <td>
  53. {{ work.workload }}
  54. </td>
  55. <td>
  56. {{ work.deadline }}
  57. </td>
  58. <td>
  59. {{ work.remark }}
  60. </td>
  61. </tr>
  62. </table>
  63. </div>
  64. </el-descriptions-item>
  65. <el-descriptions-item label="内业绩效额" :span="3">
  66. <table border="1" style="width:100%">
  67. <tr style="background-color:#f8f8f9" v-if="workList.length != 0">
  68. <td style="min-width:50px">工作简述</td>
  69. <td style="min-width:50px">工作内容</td>
  70. <td style="min-width:50px">比例尺/等级</td>
  71. <td style="min-width:50px">数量</td>
  72. <td style="min-width:50px">单价</td>
  73. <td style="min-width:50px">单位</td>
  74. <td style="min-width:50px">系数</td>
  75. <td style="min-width:80px">金额</td>
  76. <td style="min-width: 150px;">备注</td>
  77. </tr>
  78. <tr v-for="work in workList">
  79. <td>{{ work.content }}</td>
  80. <td>{{ work.cmcPrice ? work.cmcPrice.workItem : '' }}</td>
  81. <td>
  82. {{ work.scaleGrade }}
  83. </td>
  84. <td>
  85. {{ work.workload }}
  86. </td>
  87. <td>{{ work.price }}</td>
  88. <td>{{ work.unit }}</td>
  89. <td>
  90. {{ work.coefficient }}
  91. </td>
  92. <td style="text-align:right;">{{ work.settle ? work.settle.toFixed(2) : '0.00' }}</td>
  93. <td>{{ work.remark ? work.remark : '' }}</td>
  94. </tr>
  95. <tr>
  96. <td :colspan="7" class="head">内业绩效额合计</td>
  97. <td :colspan="1" class="head" style="text-align:right;">
  98. {{ budgetForm.settleExpense ? budgetForm.settleExpense.toFixed(2) : '0.00' }}
  99. </td>
  100. <td></td>
  101. </tr>
  102. <tr style="color:#F56C6C">
  103. <td :colspan="7" class="head">内业核算绩效额</td>
  104. <td :colspan="1" class="head">
  105. <el-input-number v-model="budgetForm.settleAdjust" :controls="false" style="width:100%"></el-input-number>
  106. </td>
  107. </tr>
  108. </table>
  109. </el-descriptions-item>
  110. <el-descriptions-item label="内业人员成本" :span="3" v-if="innerStaffList.length > 0">
  111. <inner-staff-cost :staffList.sync="innerStaffList"
  112. @update:staffList="handleInnerStaffChange"></inner-staff-cost>
  113. </el-descriptions-item>
  114. <el-descriptions-item label="外业人员成本" :span="3" v-if="outerStaffList.length > 0">
  115. <outer-staff-cost :staffList.sync="outerStaffList"
  116. @update:staffList="handleOuterStaffChange"></outer-staff-cost>
  117. </el-descriptions-item>
  118. <el-descriptions-item label="车辆成本" :span="3" v-if="carList.length > 0">
  119. <car-cost :carList.sync="carList"></car-cost>
  120. </el-descriptions-item>
  121. <el-descriptions-item label="设备成本" :span="3" v-if="deviceList.length > 0">
  122. <device-cost :deviceList.sync="deviceList"></device-cost>
  123. </el-descriptions-item>
  124. <el-descriptions-item label="现场开支" :span="3">
  125. <table border="1" style="width:100%;">
  126. <tr style="background-color:#f8f8f9">
  127. <td>开支项</td>
  128. <td>金额</td>
  129. <td class="adjust">核算金额</td>
  130. </tr>
  131. <tr>
  132. </tr>
  133. </table>
  134. </el-descriptions-item>
  135. <el-descriptions-item label="经营相关" :span="3">
  136. </el-descriptions-item>
  137. <el-descriptions-item label="预算外开销" :span="3">
  138. </el-descriptions-item>
  139. </el-descriptions>
  140. </div>
  141. </template>
  142. <script>
  143. import { listBudget, updateBudget } from "@/api/oa/budget/budget";
  144. import { listBudgetCar, updateBudgetCar } from "@/api/oa/budget/budgetCar";
  145. import { listBudgetDevice, updateBudgetDevice } from "@/api/oa/budget/budgetDevice";
  146. import { listBudgetSettle, updateBudgetSettle } from "@/api/oa/budget/budgetSettle";
  147. import { listBudgetStaff } from "@/api/oa/budget/budgetStaff";
  148. import { listProjectWork } from "@/api/oa/project/projectWork";
  149. import { getProject } from "@/api/oa/project/project";
  150. import InnerStaffCost from './components/InnerStaffCost.vue';
  151. import OuterStaffCost from './components/OuterStaffCost.vue';
  152. import CarCost from './components/CarCost.vue';
  153. import DeviceCost from './components/DeviceCost.vue';
  154. export default {
  155. components: {
  156. InnerStaffCost,
  157. OuterStaffCost,
  158. CarCost,
  159. DeviceCost
  160. },
  161. props: {
  162. taskForm: {
  163. type: Object,
  164. require: true
  165. },
  166. taskName: {
  167. type: String,
  168. }
  169. },
  170. data() {
  171. return {
  172. loading: true,
  173. budgetForm: {},
  174. project: {},
  175. workContentList: [],
  176. workList: [],
  177. innerStaffList: [],
  178. outerStaffList: [],
  179. carList: [],
  180. deviceList: [],
  181. }
  182. },
  183. created() {
  184. this.initBudgetForm();
  185. this.getProjectWorkList();
  186. },
  187. methods: {
  188. initBudgetForm() {
  189. this.loading = true;
  190. listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(async res => {
  191. this.budgetForm = res.rows[0];
  192. if (this.budgetForm) {
  193. const budgetId = this.budgetForm.budgetId;
  194. // 获取设备数据
  195. let deviceRes = await listBudgetDevice({ pageSize: 100, budgetId });
  196. this.deviceList = deviceRes.rows;
  197. // 获取车辆数据
  198. let carRes = await listBudgetCar({ pageSize: 100, budgetId });
  199. this.carList = carRes.rows;
  200. // 获取内业人员数据
  201. let innerStaffRes = await listBudgetStaff({ pageSize: 100, budgetId });
  202. this.innerStaffList = innerStaffRes.rows;
  203. // 获取外业人员数据
  204. let outerStaffRes = await listBudgetStaff({ pageSize: 100, budgetId });
  205. this.outerStaffList = outerStaffRes.rows;
  206. // 获取内业绩效额数据
  207. let settleRes = await listBudgetSettle({ pageSize: 100, budgetId });
  208. this.workList = settleRes.rows;
  209. for (let work of this.workList) {
  210. if (work.groundType == '0') {
  211. work.price = work.cmcPrice.commonPrice
  212. work.scaleGrade = work.cmcPrice.scaleGrade
  213. work.unit = work.cmcPrice.unit
  214. } else {
  215. work.price = work.cmcPrice.complexPrice
  216. work.scaleGrade = work.cmcPrice.scaleGrade
  217. work.unit = work.cmcPrice.unit
  218. }
  219. }
  220. }
  221. this.loading = false;
  222. }).catch(() => {
  223. this.loading = false;
  224. });
  225. },
  226. getProjectWorkList() {
  227. getProject(this.taskForm.formId).then(res => {
  228. this.project = res.data;
  229. })
  230. listProjectWork({ pageSize: 999, projectId: this.taskForm.formId }).then(res => {
  231. this.workContentList = res.rows;
  232. })
  233. },
  234. // 处理内业人员数据变化
  235. handleInnerStaffChange(newList) {
  236. this.innerStaffList = newList;
  237. console.log(newList)
  238. // 计算内业人员总成本
  239. const totalAmount = this.innerStaffList.reduce((sum, staff) => {
  240. return sum + (staff.amountAdjust || 0);
  241. }, 0);
  242. // 更新预算表单中的内业人员成本
  243. if (this.budgetForm) {
  244. this.budgetForm.innerStaffAmount = totalAmount;
  245. // 可以在这里调用API保存数据
  246. // updateBudget(this.budgetForm);
  247. }
  248. },
  249. // 处理外业人员数据变化
  250. handleOuterStaffChange(newList) {
  251. this.outerStaffList = newList;
  252. // 计算外业人员总成本
  253. const totalAmount = this.outerStaffList.reduce((sum, staff) => {
  254. return sum + (staff.amountAdjust || 0);
  255. }, 0);
  256. // 更新预算表单中的外业人员成本
  257. if (this.budgetForm) {
  258. this.budgetForm.outerStaffAmount = totalAmount;
  259. // 可以在这里调用API保存数据
  260. // updateBudget(this.budgetForm);
  261. }
  262. },
  263. },
  264. }
  265. </script>
  266. <style lang="scss" scoped>
  267. .mylabel {
  268. font-weight: bold;
  269. }
  270. .main {
  271. width: 85%;
  272. margin: 0 auto;
  273. text-align: center;
  274. }
  275. .descriptions {
  276. width: 100%;
  277. margin: 0 auto;
  278. }
  279. table {
  280. text-align: center;
  281. border-collapse: collapse;
  282. margin: 0 auto;
  283. /*设置背景颜色*/
  284. /* background-color: #bfa; */
  285. td {
  286. padding: 5px;
  287. }
  288. }
  289. .adjust {
  290. color: #F56C6C;
  291. width: 120px;
  292. }
  293. ::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
  294. border: 1px solid #838894;
  295. }
  296. ::v-deep .el-descriptions-item__label.is-bordered-label {
  297. color: #434141;
  298. background: #eaeaea;
  299. }
  300. </style>