综合办公系统
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.

budgetInfo.vue 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2024-04-03 16:28:09
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2024-04-17 15:21:14
  6. -->
  7. <template>
  8. <div class="main">
  9. <h2 style="text-align: center">项目直接生产成本预算表</h2>
  10. <table border="1" class="table">
  11. <tr>
  12. <td class="head">项目名称</td>
  13. <td colspan="3">{{ budgetForm.project ? budgetForm.project.projectName : '' }}</td>
  14. <td class="head">项目编号</td>
  15. <td colspan="2">{{ budgetForm.project ? budgetForm.project.projectNumber : '' }}</td>
  16. </tr>
  17. <tr>
  18. <td :rowspan="userLen" class="head vertical-text">人员</td>
  19. <td class="head" style="width:250px">姓名</td>
  20. <td class="head">部门</td>
  21. <td class="head">岗位工资</td>
  22. <td class="head">人员成本(天)</td>
  23. <!-- <td class="head">进出场单价</td> -->
  24. <td class="head">预算天数</td>
  25. <td class="head">金额</td>
  26. </tr>
  27. <tr v-for="user, index in chooseUser" :key="'user' + index">
  28. <td>{{ user.user ? user.user.nickName : '' }}</td>
  29. <td>{{ user.dept? user.dept.deptName : '' }}</td>
  30. <td>{{ user.salary.salary }}</td>
  31. <td>{{ parseFloat(user.salary.salary / 31).toFixed(2) }}</td>
  32. <td>{{ user.days }}</td>
  33. <td>{{ user.staffCost }}</td>
  34. </tr>
  35. <tr>
  36. <td :rowspan="carLen" class="head vertical-text">车辆</td>
  37. <td class="head">车牌号</td>
  38. <td class="head">油耗</td>
  39. <td class="head">总里程</td>
  40. <td class="head">折旧成天(天)</td>
  41. <td class="head">预算天数</td>
  42. <td class="head">金额</td>
  43. </tr>
  44. <tr v-for="car, index in chooseCar" :key="'car' + index">
  45. <td>{{ car.car ? car.car.licensePlate : '' }}</td>
  46. <td>{{ car.mileage }}</td>
  47. <td>{{ car.distance }}</td>
  48. <td>{{ car.car ? car.car.dayCost : '' }}</td>
  49. <td>{{ car.days }}</td>
  50. <td>{{ car.expense }}</td>
  51. </tr>
  52. <tr>
  53. <td :rowspan="deviceLen" class="head vertical-text">设备</td>
  54. <td class="head">设备名称</td>
  55. <td class="head">规格型号</td>
  56. <td class="head">品牌</td>
  57. <td class="head">折旧成本(天)</td>
  58. <td class="head">预算天数</td>
  59. <td class="head">金额</td>
  60. </tr>
  61. <tr v-for="device, index in chooseDevice" :key="'device' + index">
  62. <td>{{ device.device ? device.device.name : '' }}</td>
  63. <td>{{ device.device ? device.device.series : '' }}</td>
  64. <td>{{ device.device ? device.device.brand : '' }}</td>
  65. <td>{{ device.device ? device.device.dayCost : '' }}</td>
  66. <td>{{ device.days }}</td>
  67. <td>{{ device.depreciation }}</td>
  68. </tr>
  69. <tr>
  70. <td colspan="6" class="head">固定成本小计</td>
  71. <td>{{ budgetForm.fixCost }}</td>
  72. </tr>
  73. <tr>
  74. <td :rowspan="workLen" class="head vertical-text">预计结算金额</td>
  75. <td class="head">工作内容</td>
  76. <td class="head">比例尺</td>
  77. <td class="head">总工作量</td>
  78. <td class="head">单价</td>
  79. <td class="head">系数</td>
  80. <td class="head">金额</td>
  81. </tr>
  82. <tr v-for="(work, index) in workList" :key="'work' + index">
  83. <td>{{ workContentList.length != 0 ? workContentList[index].content : "" }}</td>
  84. <td>{{ work.scaleGrade }}</td>
  85. <td>{{ work.workload }}</td>
  86. <td>{{ work.price }}</td>
  87. <td>{{ work.coefficient }}</td>
  88. <td>{{ work.settle }}</td>
  89. </tr>
  90. <tr>
  91. <td colspan="5" class="head">进出场津贴</td>
  92. <td>{{ budgetForm.inOutPriceSum }}</td>
  93. </tr>
  94. <tr>
  95. <td colspan="5" class="head">外协费用</td>
  96. <td>{{ budgetForm.outExpense }}</td>
  97. </tr>
  98. <tr>
  99. <td colspan="5" class="head">商务费用</td>
  100. <td>{{ budgetForm.businessExpense }}</td>
  101. </tr>
  102. <tr>
  103. <td colspan="5" class="head">车船租赁</td>
  104. <td>{{ budgetForm.rentExpense }}</td>
  105. </tr>
  106. <tr>
  107. <td colspan="5" class="head">其他费用</td>
  108. <td>{{ budgetForm.otherExpense }}</td>
  109. </tr>
  110. <tr>
  111. <td colspan="6" class="head">直接成本小计</td>
  112. <td>{{ budgetForm.directExpense }}</td>
  113. </tr>
  114. <tr>
  115. <td colspan="6" class="head">总成本=(固定成本+直接成本)*120%</td>
  116. <td>{{ budgetForm.totalBudget }}</td>
  117. </tr>
  118. <tr>
  119. <td class="head">编制人</td>
  120. <td colspan="2">{{ budgetForm.compilerUser ? budgetForm.compilerUser.nickName :'' }}</td>
  121. <td class="head">审核人</td>
  122. <td colspan="3">{{ name }}</td>
  123. </tr>
  124. </table>
  125. </div>
  126. </template>
  127. <script>
  128. import { listBudget } from "@/api/oa/budget/budget";
  129. import { listBudgetCar, getBudgetCar } from "@/api/oa/budget/budgetCar";
  130. import { listBudgetDevice, getBudgetDevice } from "@/api/oa/budget/budgetDevice";
  131. import { listBudgetSettle, getBudgetSettle } from "@/api/oa/budget/budgetSettle";
  132. import { listBudgetStaff, getBudgetStaff } from "@/api/oa/budget/budgetStaff";
  133. import { getProjectWork } from "@/api/oa/project/projectWork";
  134. import { mapGetters } from 'vuex';
  135. export default {
  136. computed: {
  137. ...mapGetters(["name", "userId"]),
  138. },
  139. props: {
  140. taskForm: {
  141. type: Object,
  142. require: true
  143. }
  144. },
  145. data() {
  146. return {
  147. projectId: '',
  148. budgetForm: {
  149. },
  150. projectForm: {},
  151. userLen: 1,
  152. carLen: 1,
  153. deviceLen: 1,
  154. workLen: 1,
  155. totalBudget: 0,
  156. chooseCar: [],
  157. chooseDevice: [],
  158. chooseUser: [],
  159. workList: [],
  160. workContentList: []
  161. };
  162. },
  163. created() {
  164. this.initBudgetForm();
  165. this.totalBudget = (
  166. (Number(this.budgetForm.directExpense) + Number(this.budgetForm.fixCost)) *
  167. 1.2
  168. ).toFixed(2);
  169. },
  170. methods: {
  171. initBudgetForm() {
  172. listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(res => {
  173. console.log(res);
  174. this.budgetForm = res.rows[0];
  175. getBudgetDevice(this.budgetForm.budgetId).then(res => {
  176. this.chooseDevice = res.data;
  177. this.deviceLen = res.data.length + 1;
  178. })
  179. getBudgetStaff(this.budgetForm.budgetId).then(res => {
  180. this.chooseUser = res.data;
  181. this.userLen = res.data.length + 1;
  182. let days = 0;
  183. for(let d of this.chooseUser){
  184. days = days + d.days
  185. }
  186. this.budgetForm.inOutPriceSum = Number(days) * Number(this.chooseUser[0].inOutPrice)
  187. })
  188. getBudgetCar(this.budgetForm.budgetId).then(res => {
  189. this.chooseCar = res.data;
  190. this.carLen = res.data.length + 1;
  191. })
  192. getBudgetSettle(this.budgetForm.budgetId).then(res => {
  193. this.workList = res.data;
  194. this.workLen = res.data.length + 6;
  195. for(let work of this.workList){
  196. if(work.groundType == '0'){
  197. work.price = work.cmcPrice.commonPrice
  198. work.scaleGrade = work.cmcPrice.scaleGrade
  199. }else{
  200. work.price = work.cmcPrice.complexPrice
  201. }
  202. }
  203. this.getProjectWorkList();
  204. })
  205. });
  206. },
  207. getProjectWorkList() {
  208. getProjectWork(this.$route.query.formId).then(res => {
  209. this.workContentList = res.data;
  210. })
  211. },
  212. },
  213. };
  214. </script>
  215. <style lang="scss" scoped>
  216. .main {
  217. width: 1200px;
  218. margin: 0 auto;
  219. text-align: center;
  220. }
  221. table {
  222. text-align: center;
  223. border-collapse: collapse;
  224. margin: 0 auto;
  225. /*设置背景颜色*/
  226. /* background-color: #bfa; */
  227. td {
  228. padding: 5px;
  229. }
  230. }
  231. .head {
  232. line-height: 35px;
  233. font-weight: bold;
  234. }
  235. </style>