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

adjustIndex.vue 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-05-14 16:09:56
  4. * @LastEditors: wrh
  5. * @LastEditTime: 2025-12-31 16:26:40
  6. -->
  7. <template>
  8. <div class="app-container">
  9. <transition name="fade-transform" mode="out-in">
  10. <div v-if="!projectId" key="selection">
  11. <div class="selection-header">
  12. <h3 style="font-weight: bold; color: #FF5733;">选择核算项目</h3>
  13. </div>
  14. <el-form :model="queryParams" ref="queryForm" :inline="true" class="search-form">
  15. <el-form-item prop="projectId" label="是否勘察项目">
  16. <el-radio-group v-model="isSurvey" @change="handleIsSurveyChange">
  17. <el-radio :label="0">否</el-radio>
  18. <el-radio :label="1">是</el-radio>
  19. </el-radio-group>
  20. </el-form-item>
  21. <el-form-item prop="projectId">
  22. <el-select v-model="queryType" style="width: 120px;">
  23. <el-option label="项目编号" value="1"></el-option>
  24. <el-option label="项目名称" value="2"></el-option>
  25. </el-select>
  26. <el-select v-model="queryParams.projectId" clearable filterable remote reserve-keyword placeholder="请输入关键字"
  27. :remote-method="remoteMethod" :loading="loading" style="width: 300px;">
  28. <el-option v-for="project in projectList" :key="project.projectId"
  29. :label="project.projectNumber + '-' + project.projectName" :value="project.projectId">
  30. </el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item label="编制人" prop="compiler">
  34. <el-select v-model="queryParams.compiler" filterable clearable>
  35. <el-option :key="item.userId" v-for="item of $store.state.user.userList" :label="item.nickName"
  36. :value="item.userId"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  41. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  42. </el-form-item>
  43. </el-form>
  44. <el-table v-loading="loading" :data="budgetList">
  45. <el-table-column label="序号" align="center" type="index" width="60" />
  46. <el-table-column label="状态" align="center" width="90">
  47. <template slot-scope="scope">
  48. <el-tag :type="statusTypeStyle(scope.row.disabled)"> {{ statusTypeText(scope.row.disabled) }}</el-tag>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
  52. <el-table-column label="项目名称" align="center" prop="project.projectName" />
  53. <el-table-column label="预算总额" align="center" prop="totalBudget" />
  54. <el-table-column label="编制人" align="center" prop="compiler">
  55. <template slot-scope="scope">
  56. {{ getUserName(scope.row.compiler) }}
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="编制时间" align="center" prop="createTime" />
  60. <el-table-column label="预算当前流程节点" align="center" prop="taskName" />
  61. <!-- <el-table-column label="审核人" align="center" prop="auditor">
  62. <template slot-scope="scope">
  63. {{ getUserName(scope.row.auditor) }}
  64. </template>
  65. </el-table-column> -->
  66. <el-table-column label="操作" align="center" width="120">
  67. <template slot-scope="scope">
  68. <el-button type="primary" size="mini" @click="handleSelect(scope.row)"
  69. :disabled="scope.row.disabled == '1'">选择</el-button>
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  74. @pagination="getList" />
  75. </div>
  76. <div v-else key="adjust">
  77. <div class="adjust-header" v-if="hideReturn">
  78. <el-button icon="el-icon-back" type="text" @click="handleBack">返回选择</el-button>
  79. <h3>预算调整</h3>
  80. </div>
  81. <budget-adjust :taskForm="taskForm" :taskName="taskName" :row="selectedRows" @preserve="preserve"
  82. @goBack="$emit('goBack')"></budget-adjust>
  83. </div>
  84. </transition>
  85. </div>
  86. </template>
  87. <script>
  88. import { listBudget, getBudget } from '@/api/oa/budget/budget';
  89. import { listCheck, getCheck, delCheck, addCheck, updateCheck } from "@/api/oa/budget/check";
  90. import { listProject } from '@/api/oa/project/project';
  91. import { currentNodeByFormId } from "@/api/flowable/definition";
  92. import BudgetAdjust from './budgetAdjust.vue';
  93. export default {
  94. props: {
  95. taskForm: {
  96. type: Object,
  97. require: true
  98. },
  99. taskName: {
  100. type: String,
  101. }
  102. },
  103. components: {
  104. BudgetAdjust
  105. },
  106. data() {
  107. return {
  108. loading: true,
  109. projectId: '',
  110. budgetList: [],
  111. total: 0,
  112. selectedRows: {},
  113. queryParams: {
  114. pageNum: 1,
  115. pageSize: 20,
  116. projectNumber: undefined,
  117. projectName: undefined,
  118. auditor: 7
  119. },
  120. queryType: '1',
  121. projectList: [],
  122. hideReturn: true,
  123. isSurvey: 0,
  124. }
  125. },
  126. created() {
  127. this.initForm();
  128. this.getBudgetList();
  129. },
  130. methods: {
  131. initForm() {
  132. getCheck(this.taskForm.formId).then(res => {
  133. if (res.data) {
  134. this.hideReturn = false;
  135. this.projectId = res.data.projectId;
  136. getBudget(res.data.budgetId).then(response => {
  137. this.selectedRows = response.data;
  138. })
  139. }
  140. })
  141. },
  142. getBudgetList() {
  143. listBudget(this.queryParams).then(res => {
  144. this.budgetList = res.rows;
  145. for (let b of this.budgetList) {
  146. this.isDisabled(b).then(res => {
  147. if (!b.disabled && b.disabled != '2')
  148. this.$set(b, 'disabled', res);
  149. })
  150. this.getCurrentTaskName(b).then(res => {
  151. this.$set(b, 'taskName', res);
  152. if (res != '预算批准' || res == '') {
  153. this.$set(b, 'disabled', '2');
  154. }
  155. })
  156. }
  157. this.total = res.total;
  158. this.loading = false;
  159. });
  160. },
  161. handleSelect(row) {
  162. this.projectId = row.projectId;
  163. this.selectedRows = row;
  164. },
  165. async isDisabled(row) {
  166. let res = await listCheck({ budgetId: row.budgetId })
  167. if (res.total > 0) {
  168. return '1';
  169. } else {
  170. return '0';
  171. }
  172. },
  173. async getCurrentTaskName(row) {
  174. let resData = await currentNodeByFormId({ formId: row.projectId, name: '3045' })
  175. if (resData.code == 200) {
  176. return resData.msg;
  177. }
  178. else
  179. return ''
  180. },
  181. handleBack() {
  182. this.projectId = '';
  183. },
  184. getList() {
  185. this.loading = true;
  186. this.getBudgetList();
  187. },
  188. /** 搜索按钮操作 */
  189. handleQuery() {
  190. this.queryParams.pageNum = 1;
  191. this.getList();
  192. },
  193. /** 重置按钮操作 */
  194. resetQuery() {
  195. this.resetForm("queryForm");
  196. this.handleQuery();
  197. },
  198. /** 重置表单 */
  199. resetForm(refName) {
  200. if (this.$refs[refName]) {
  201. this.$refs[refName].resetFields();
  202. }
  203. },
  204. remoteMethod(val) {
  205. let params1 = {
  206. pageNum: 1,
  207. pageSize: 20,
  208. projectNumber: val,
  209. undertakingDept: ''
  210. }
  211. let params2 = {
  212. pageNum: 1,
  213. pageSize: 20,
  214. projectName: val,
  215. undertakingDept: ''
  216. }
  217. if (this.isSurvey == 1) {
  218. params1.undertakingDept = '113'
  219. params2.undertakingDept = '113'
  220. } else {
  221. params1.undertakingDept = ''
  222. params2.undertakingDept = ''
  223. }
  224. let params = {};
  225. if (this.queryType == '1') {
  226. params = params1
  227. } else {
  228. params = params2
  229. }
  230. listProject(params).then(res => {
  231. this.projectList = res.rows;
  232. })
  233. },
  234. preserve() {
  235. this.hideReturn = false;
  236. },
  237. handleIsSurveyChange(val) {
  238. this.isSurvey = val;
  239. },
  240. statusTypeText(row) {
  241. if (row == '0') {
  242. return '待核算'
  243. }
  244. if (row == '1') {
  245. return '已核算'
  246. }
  247. if (row == '2') {
  248. return '预算未批'
  249. }
  250. },
  251. statusTypeStyle(row) {
  252. if (row == '0') {
  253. return 'primary'
  254. }
  255. if (row == '1') {
  256. return 'warning'
  257. }
  258. if (row == '2') {
  259. return 'danger'
  260. }
  261. }
  262. }
  263. }
  264. </script>
  265. <style lang="scss" scoped>
  266. .selection-header,
  267. .adjust-header {
  268. margin-bottom: 20px;
  269. display: flex;
  270. align-items: center;
  271. h3 {
  272. margin: 0;
  273. margin-left: 10px;
  274. }
  275. }
  276. .search-form {
  277. margin-bottom: 20px;
  278. padding: 20px;
  279. background-color: #f5f7fa;
  280. border-radius: 4px;
  281. }
  282. .fade-transform-enter-active,
  283. .fade-transform-leave-active {
  284. transition: all 0.5s;
  285. }
  286. .fade-transform-enter {
  287. opacity: 0;
  288. transform: translateX(-30px);
  289. }
  290. .fade-transform-leave-to {
  291. opacity: 0;
  292. transform: translateX(30px);
  293. }
  294. </style>