| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <!--
- * @Author: ysh
- * @Date: 2025-05-14 16:09:56
- * @LastEditors: wrh
- * @LastEditTime: 2025-12-31 16:26:40
- -->
- <template>
- <div class="app-container">
- <transition name="fade-transform" mode="out-in">
- <div v-if="!projectId" key="selection">
- <div class="selection-header">
- <h3 style="font-weight: bold; color: #FF5733;">选择核算项目</h3>
- </div>
- <el-form :model="queryParams" ref="queryForm" :inline="true" class="search-form">
- <el-form-item prop="projectId" label="是否勘察项目">
- <el-radio-group v-model="isSurvey" @change="handleIsSurveyChange">
- <el-radio :label="0">否</el-radio>
- <el-radio :label="1">是</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item prop="projectId">
- <el-select v-model="queryType" style="width: 120px;">
- <el-option label="项目编号" value="1"></el-option>
- <el-option label="项目名称" value="2"></el-option>
- </el-select>
- <el-select v-model="queryParams.projectId" clearable filterable remote reserve-keyword placeholder="请输入关键字"
- :remote-method="remoteMethod" :loading="loading" style="width: 300px;">
- <el-option v-for="project in projectList" :key="project.projectId"
- :label="project.projectNumber + '-' + project.projectName" :value="project.projectId">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="编制人" prop="compiler">
- <el-select v-model="queryParams.compiler" filterable clearable>
- <el-option :key="item.userId" v-for="item of $store.state.user.userList" :label="item.nickName"
- :value="item.userId"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-table v-loading="loading" :data="budgetList">
- <el-table-column label="序号" align="center" type="index" width="60" />
- <el-table-column label="状态" align="center" width="90">
- <template slot-scope="scope">
- <el-tag :type="statusTypeStyle(scope.row.disabled)"> {{ statusTypeText(scope.row.disabled) }}</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
- <el-table-column label="项目名称" align="center" prop="project.projectName" />
- <el-table-column label="预算总额" align="center" prop="totalBudget" />
- <el-table-column label="编制人" align="center" prop="compiler">
- <template slot-scope="scope">
- {{ getUserName(scope.row.compiler) }}
- </template>
- </el-table-column>
- <el-table-column label="编制时间" align="center" prop="createTime" />
- <el-table-column label="预算当前流程节点" align="center" prop="taskName" />
- <!-- <el-table-column label="审核人" align="center" prop="auditor">
- <template slot-scope="scope">
- {{ getUserName(scope.row.auditor) }}
- </template>
- </el-table-column> -->
- <el-table-column label="操作" align="center" width="120">
- <template slot-scope="scope">
- <el-button type="primary" size="mini" @click="handleSelect(scope.row)"
- :disabled="scope.row.disabled == '1'">选择</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
- @pagination="getList" />
- </div>
- <div v-else key="adjust">
- <div class="adjust-header" v-if="hideReturn">
- <el-button icon="el-icon-back" type="text" @click="handleBack">返回选择</el-button>
- <h3>预算调整</h3>
- </div>
- <budget-adjust :taskForm="taskForm" :taskName="taskName" :row="selectedRows" @preserve="preserve"
- @goBack="$emit('goBack')"></budget-adjust>
- </div>
- </transition>
- </div>
- </template>
-
- <script>
- import { listBudget, getBudget } from '@/api/oa/budget/budget';
- import { listCheck, getCheck, delCheck, addCheck, updateCheck } from "@/api/oa/budget/check";
- import { listProject } from '@/api/oa/project/project';
- import { currentNodeByFormId } from "@/api/flowable/definition";
- import BudgetAdjust from './budgetAdjust.vue';
- export default {
- props: {
- taskForm: {
- type: Object,
- require: true
- },
- taskName: {
- type: String,
- }
- },
- components: {
- BudgetAdjust
- },
- data() {
- return {
- loading: true,
- projectId: '',
- budgetList: [],
- total: 0,
- selectedRows: {},
- queryParams: {
- pageNum: 1,
- pageSize: 20,
- projectNumber: undefined,
- projectName: undefined,
- auditor: 7
- },
- queryType: '1',
- projectList: [],
- hideReturn: true,
- isSurvey: 0,
- }
- },
- created() {
- this.initForm();
- this.getBudgetList();
- },
- methods: {
- initForm() {
- getCheck(this.taskForm.formId).then(res => {
- if (res.data) {
- this.hideReturn = false;
- this.projectId = res.data.projectId;
- getBudget(res.data.budgetId).then(response => {
- this.selectedRows = response.data;
- })
- }
- })
- },
- getBudgetList() {
- listBudget(this.queryParams).then(res => {
- this.budgetList = res.rows;
- for (let b of this.budgetList) {
- this.isDisabled(b).then(res => {
- if (!b.disabled && b.disabled != '2')
- this.$set(b, 'disabled', res);
- })
- this.getCurrentTaskName(b).then(res => {
- this.$set(b, 'taskName', res);
- if (res != '预算批准' || res == '') {
- this.$set(b, 'disabled', '2');
- }
- })
- }
- this.total = res.total;
- this.loading = false;
- });
- },
- handleSelect(row) {
- this.projectId = row.projectId;
- this.selectedRows = row;
- },
- async isDisabled(row) {
- let res = await listCheck({ budgetId: row.budgetId })
- if (res.total > 0) {
- return '1';
- } else {
- return '0';
- }
- },
- async getCurrentTaskName(row) {
- let resData = await currentNodeByFormId({ formId: row.projectId, name: '3045' })
- if (resData.code == 200) {
- return resData.msg;
- }
- else
- return ''
- },
- handleBack() {
- this.projectId = '';
- },
- getList() {
- this.loading = true;
- this.getBudgetList();
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- /** 重置表单 */
- resetForm(refName) {
- if (this.$refs[refName]) {
- this.$refs[refName].resetFields();
- }
- },
- remoteMethod(val) {
- let params1 = {
- pageNum: 1,
- pageSize: 20,
- projectNumber: val,
- undertakingDept: ''
- }
- let params2 = {
- pageNum: 1,
- pageSize: 20,
- projectName: val,
- undertakingDept: ''
- }
- if (this.isSurvey == 1) {
- params1.undertakingDept = '113'
- params2.undertakingDept = '113'
- } else {
- params1.undertakingDept = ''
- params2.undertakingDept = ''
- }
- let params = {};
- if (this.queryType == '1') {
- params = params1
- } else {
- params = params2
- }
- listProject(params).then(res => {
- this.projectList = res.rows;
- })
- },
- preserve() {
- this.hideReturn = false;
- },
- handleIsSurveyChange(val) {
- this.isSurvey = val;
- },
- statusTypeText(row) {
- if (row == '0') {
- return '待核算'
- }
- if (row == '1') {
- return '已核算'
- }
- if (row == '2') {
- return '预算未批'
- }
- },
- statusTypeStyle(row) {
- if (row == '0') {
- return 'primary'
- }
- if (row == '1') {
- return 'warning'
- }
- if (row == '2') {
- return 'danger'
- }
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .selection-header,
- .adjust-header {
- margin-bottom: 20px;
- display: flex;
- align-items: center;
-
- h3 {
- margin: 0;
- margin-left: 10px;
- }
- }
-
- .search-form {
- margin-bottom: 20px;
- padding: 20px;
- background-color: #f5f7fa;
- border-radius: 4px;
- }
-
- .fade-transform-enter-active,
- .fade-transform-leave-active {
- transition: all 0.5s;
- }
-
- .fade-transform-enter {
- opacity: 0;
- transform: translateX(-30px);
- }
-
- .fade-transform-leave-to {
- opacity: 0;
- transform: translateX(30px);
- }
- </style>
|