123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <!--
- * @Author: ysh
- * @Date: 2024-05-10 14:45:03
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2024-05-31 14:51:49
- -->
- <template>
- <div class="mt20">
- <div class="nav-btn">
- <div>
- <el-button class="mb20" type="primary" plain size="mini" icon="el-icon-plus"
- @click="addSettleFlow">结算申请</el-button>
- </div>
- <div>
- <el-button icon="el-icon-refresh" circle size="mini" @click="getSettleData()"></el-button>
- </div>
- </div>
-
- <el-table :data="dataList" style="width: 100%">
- <el-table-column type="index" label="序号" width="50" />
- <el-table-column label="上报人" prop="reporterName" />
- <el-table-column label="申请时间" prop="reportTime" width="100" />
- <el-table-column label="综合事务部意见" prop="zhComment" show-overflow-tooltip width="120" />
- <el-table-column label="技术质量部意见" prop="jsComment" show-overflow-tooltip width="120" />
- <el-table-column label="项目管理部意见" prop="xmComment" show-overflow-tooltip width="120" />
- <el-table-column label="承担部门意见" prop="deptComment" show-overflow-tooltip width="120" />
- <el-table-column label="经营管理部意见" prop="jyComment" show-overflow-tooltip width="120" />
- <el-table-column label="分管审核意见" prop="managerComment" show-overflow-tooltip width="120" />
- <el-table-column label="总经理意见" prop="gmComment" show-overflow-tooltip width="120" />
- <el-table-column label="操作" fixed="right" header-align="center">
- <template slot-scope="scope">
- <el-button icon="el-icon-view" type="text" size="mini" @click="handleLook(scope.row)">查看明细</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-dialog title="结算明细" :visible.sync="open" append-to-body width="65%">
- <settle-print :form="clickRow" :chooseProject="chooseProject" :workList="workList"
- :settleList="summaryList"></settle-print>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import { getProject } from "@/api/oa/project/project";
- import { listSettle, getSettle, delSettle, addSettle, updateSettle } from "@/api/oa/settle/settle";
- import { listSettleWork } from '@/api/oa/settle/settleWork';
- import { listSettleSummary } from '@/api/oa/settle/settleSummary';
- import { getPrice } from "@/api/oa/price/price";
- import { listDefinition } from "@/api/flowable/definition";
- import { getNextFlowNodeByStart } from "@/api/flowable/todo";
- import { definitionStart } from "@/api/flowable/definition";
- import { todoList } from "@/api/flowable/todo";
- import { MessageBox } from 'element-ui'
- import { listUser, getUser } from "@/api/system/user";
- import { Snowflake } from '@/utils/snowFlake.js'
- import SettleForm from '../settleForm.vue';
- import SettlePrint from '../components/settlePrint.vue';
- export default {
- components: {
- SettleForm,
- SettlePrint
- },
- props: {
- taskForm: {
- type: Object,
- required: true
- },
- taskName: {
- type: String,
- default: ''
- }
- },
- data() {
- return {
- open: false,
- dataList: [],
- definitionList: [], //流程列表
- summaryList: [],
- workList: [],
- settleList: [],
- userList: [],
- chooseProject: {},
- clickRow: {}
- }
- },
- mounted() {
- this.getUserList();
- this.getSettleData();
- this.listDefinition();
- if (this.taskName != '项目登记')
- this.getChooseProject();
- },
- methods: {
- getUserList() {
- listUser({
- pageNum: 1,
- pageSize: 9999
- }).then(res => {
- if (res.code == 200) {
- this.userList = res.rows
- }
- })
- },
- getSettleData() {
- listSettle({ projectId: this.taskForm.formId }).then(res => {
- if (res.code == 200) {
- this.dataList = res.rows
- for (let row of res.rows) {
- this.getReporter(row);
- }
- }
- })
- },
- getChooseProject() {
- getProject(this.taskForm.formId).then(res => {
- if (res.data)
- this.chooseProject = res.data
- })
- },
- getSettleWorkList(settleId) {
- listSettleWork({ pageNum: 1, pageSize: 9999, settleId }).then(res => {
- if (res.code == 200) {
- this.workList = res.rows;
- for (let work of this.workList) {
- getPrice(work.priceId).then(res => {
- if (res.data) {
- this.$set(work, "scale", res.data.scaleGrade);
- this.$set(work, "unit", res.data.unit);
- if (work.groundType == "0") {
- work.price = res.data.commonPrice;
- } else {
- work.price = res.data.complexPrice;
- }
- }
- });
- }
- }
- })
- },
- getReporter(row) {
- getUser(row.reporter).then(res => {
- this.$set(row, 'reporterName', res.data.nickName)
- })
- },
- getSummaryList(settleId) {
- listSettleSummary({ settleId }).then(res => {
- if (res.rows) {
- this.summaryList = res.rows
- }
- })
- },
- listDefinition() {
- listDefinition({
- pageNum: 1,
- pageSize: 9999,
- name: '项目结算'
- }).then(response => {
- this.definitionList = response.data.records;
- });
- },
- handleLook(row) {
- this.clickRow = row
- this.clickRow.zhUserName = this.getUserNickName(row.zhUserId);
- this.clickRow.jsUserName = this.getUserNickName(row.jsUserId);
- this.clickRow.xmUserName = this.getUserNickName(row.xmUserId);
- this.clickRow.deptUserName = this.getUserNickName(row.deptUserId);
- this.clickRow.jyUserName = this.getUserNickName(row.jyUserId);
- this.clickRow.managerUserName = this.getUserNickName(row.managerUserId);
- this.clickRow.gmUserName = this.getUserNickName(row.gmUserId);
- this.getSummaryList(row.settleId)
- this.getSettleWorkList(row.settleId)
- this.open = true
- },
- getUserNickName(id) {
- for (let user of this.userList) {
- if (user.userId == id) {
- return user.nickName
- }
- }
- },
- addSettleFlow() {
- let row = this.definitionList[0];
- let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
- getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
- const variables = {};
- const formData = {};
- formData.formId = formId;
- if (row.id) {
- MessageBox.confirm('是否发起项目结算?', '系统提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => {
- variables.variables = formData;
- // 启动流程并将表单数据加入流程变量
- definitionStart(row.id, JSON.stringify(variables)).then(res => {
- this.$modal.msgSuccess(res.msg);
- let procInstanceId = res.data;
- todoList({
- pageNum: 1,
- pageSize: 99999999,
- processInsId: procInstanceId
- }).then(toDoRes => {
- let records = toDoRes.data.records;
- if (records.length == 1) {
- records = records[0]
- }
- this.$router.push({
- path: '/applyForm/settleApply',
- query: {
- procInsId: records.procInsId,
- executionId: records.executionId,
- deployId: records.deployId,
- taskId: records.taskId,
- taskName: records.taskName,
- startUser: records.startUserName + '--' + records.startDeptName,
- formId: formData.formId,
- procDefName: records.procDefName,
- projectId: this.taskForm.formId
- }
- })
- })
- })
- })
- }
- })
- },
-
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .nav-btn {
- display: flex;
- justify-content: space-between;
- }
- </style>
|