综合办公系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

settleData.vue 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2024-05-10 14:45:03
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2024-05-31 14:51:49
  6. -->
  7. <template>
  8. <div class="mt20">
  9. <div class="nav-btn">
  10. <div>
  11. <el-button class="mb20" type="primary" plain size="mini" icon="el-icon-plus"
  12. @click="addSettleFlow">结算申请</el-button>
  13. </div>
  14. <div>
  15. <el-button icon="el-icon-refresh" circle size="mini" @click="getSettleData()"></el-button>
  16. </div>
  17. </div>
  18. <el-table :data="dataList" style="width: 100%">
  19. <el-table-column type="index" label="序号" width="50" />
  20. <el-table-column label="上报人" prop="reporterName" />
  21. <el-table-column label="申请时间" prop="reportTime" width="100" />
  22. <el-table-column label="综合事务部意见" prop="zhComment" show-overflow-tooltip width="120" />
  23. <el-table-column label="技术质量部意见" prop="jsComment" show-overflow-tooltip width="120" />
  24. <el-table-column label="项目管理部意见" prop="xmComment" show-overflow-tooltip width="120" />
  25. <el-table-column label="承担部门意见" prop="deptComment" show-overflow-tooltip width="120" />
  26. <el-table-column label="经营管理部意见" prop="jyComment" show-overflow-tooltip width="120" />
  27. <el-table-column label="分管审核意见" prop="managerComment" show-overflow-tooltip width="120" />
  28. <el-table-column label="总经理意见" prop="gmComment" show-overflow-tooltip width="120" />
  29. <el-table-column label="操作" fixed="right" header-align="center">
  30. <template slot-scope="scope">
  31. <el-button icon="el-icon-view" type="text" size="mini" @click="handleLook(scope.row)">查看明细</el-button>
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. <el-dialog title="结算明细" :visible.sync="open" append-to-body width="65%">
  36. <settle-print :form="clickRow" :chooseProject="chooseProject" :workList="workList"
  37. :settleList="summaryList"></settle-print>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. import { getProject } from "@/api/oa/project/project";
  43. import { listSettle, getSettle, delSettle, addSettle, updateSettle } from "@/api/oa/settle/settle";
  44. import { listSettleWork } from '@/api/oa/settle/settleWork';
  45. import { listSettleSummary } from '@/api/oa/settle/settleSummary';
  46. import { getPrice } from "@/api/oa/price/price";
  47. import { listDefinition } from "@/api/flowable/definition";
  48. import { getNextFlowNodeByStart } from "@/api/flowable/todo";
  49. import { definitionStart } from "@/api/flowable/definition";
  50. import { todoList } from "@/api/flowable/todo";
  51. import { MessageBox } from 'element-ui'
  52. import { listUser, getUser } from "@/api/system/user";
  53. import { Snowflake } from '@/utils/snowFlake.js'
  54. import SettleForm from '../settleForm.vue';
  55. import SettlePrint from '../components/settlePrint.vue';
  56. export default {
  57. components: {
  58. SettleForm,
  59. SettlePrint
  60. },
  61. props: {
  62. taskForm: {
  63. type: Object,
  64. required: true
  65. },
  66. taskName: {
  67. type: String,
  68. default: ''
  69. }
  70. },
  71. data() {
  72. return {
  73. open: false,
  74. dataList: [],
  75. definitionList: [], //流程列表
  76. summaryList: [],
  77. workList: [],
  78. settleList: [],
  79. userList: [],
  80. chooseProject: {},
  81. clickRow: {}
  82. }
  83. },
  84. mounted() {
  85. this.getUserList();
  86. this.getSettleData();
  87. this.listDefinition();
  88. if (this.taskName != '项目登记')
  89. this.getChooseProject();
  90. },
  91. methods: {
  92. getUserList() {
  93. listUser({
  94. pageNum: 1,
  95. pageSize: 9999
  96. }).then(res => {
  97. if (res.code == 200) {
  98. this.userList = res.rows
  99. }
  100. })
  101. },
  102. getSettleData() {
  103. listSettle({ projectId: this.taskForm.formId }).then(res => {
  104. if (res.code == 200) {
  105. this.dataList = res.rows
  106. for (let row of res.rows) {
  107. this.getReporter(row);
  108. }
  109. }
  110. })
  111. },
  112. getChooseProject() {
  113. getProject(this.taskForm.formId).then(res => {
  114. if (res.data)
  115. this.chooseProject = res.data
  116. })
  117. },
  118. getSettleWorkList(settleId) {
  119. listSettleWork({ pageNum: 1, pageSize: 9999, settleId }).then(res => {
  120. if (res.code == 200) {
  121. this.workList = res.rows;
  122. for (let work of this.workList) {
  123. getPrice(work.priceId).then(res => {
  124. if (res.data) {
  125. this.$set(work, "scale", res.data.scaleGrade);
  126. this.$set(work, "unit", res.data.unit);
  127. if (work.groundType == "0") {
  128. work.price = res.data.commonPrice;
  129. } else {
  130. work.price = res.data.complexPrice;
  131. }
  132. }
  133. });
  134. }
  135. }
  136. })
  137. },
  138. getReporter(row) {
  139. getUser(row.reporter).then(res => {
  140. this.$set(row, 'reporterName', res.data.nickName)
  141. })
  142. },
  143. getSummaryList(settleId) {
  144. listSettleSummary({ settleId }).then(res => {
  145. if (res.rows) {
  146. this.summaryList = res.rows
  147. }
  148. })
  149. },
  150. listDefinition() {
  151. listDefinition({
  152. pageNum: 1,
  153. pageSize: 9999,
  154. name: '项目结算'
  155. }).then(response => {
  156. this.definitionList = response.data.records;
  157. });
  158. },
  159. handleLook(row) {
  160. this.clickRow = row
  161. this.clickRow.zhUserName = this.getUserNickName(row.zhUserId);
  162. this.clickRow.jsUserName = this.getUserNickName(row.jsUserId);
  163. this.clickRow.xmUserName = this.getUserNickName(row.xmUserId);
  164. this.clickRow.deptUserName = this.getUserNickName(row.deptUserId);
  165. this.clickRow.jyUserName = this.getUserNickName(row.jyUserId);
  166. this.clickRow.managerUserName = this.getUserNickName(row.managerUserId);
  167. this.clickRow.gmUserName = this.getUserNickName(row.gmUserId);
  168. this.getSummaryList(row.settleId)
  169. this.getSettleWorkList(row.settleId)
  170. this.open = true
  171. },
  172. getUserNickName(id) {
  173. for (let user of this.userList) {
  174. if (user.userId == id) {
  175. return user.nickName
  176. }
  177. }
  178. },
  179. addSettleFlow() {
  180. let row = this.definitionList[0];
  181. let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
  182. getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
  183. const variables = {};
  184. const formData = {};
  185. formData.formId = formId;
  186. if (row.id) {
  187. MessageBox.confirm('是否发起项目结算?', '系统提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => {
  188. variables.variables = formData;
  189. // 启动流程并将表单数据加入流程变量
  190. definitionStart(row.id, JSON.stringify(variables)).then(res => {
  191. this.$modal.msgSuccess(res.msg);
  192. let procInstanceId = res.data;
  193. todoList({
  194. pageNum: 1,
  195. pageSize: 99999999,
  196. processInsId: procInstanceId
  197. }).then(toDoRes => {
  198. let records = toDoRes.data.records;
  199. if (records.length == 1) {
  200. records = records[0]
  201. }
  202. this.$router.push({
  203. path: '/applyForm/settleApply',
  204. query: {
  205. procInsId: records.procInsId,
  206. executionId: records.executionId,
  207. deployId: records.deployId,
  208. taskId: records.taskId,
  209. taskName: records.taskName,
  210. startUser: records.startUserName + '--' + records.startDeptName,
  211. formId: formData.formId,
  212. procDefName: records.procDefName,
  213. projectId: this.taskForm.formId
  214. }
  215. })
  216. })
  217. })
  218. })
  219. }
  220. })
  221. },
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. .nav-btn {
  227. display: flex;
  228. justify-content: space-between;
  229. }
  230. </style>