综合办公系统
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.vue 10KB

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