myTask.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. <template>
  2. <!-- <div class="app-container">-->
  3. <div>
  4. <el-card shadow="hover">
  5. <!-- 查询表单区域 -->
  6. <el-form :model="queryParams" ref="queryForm" size="small" inline label-position="top">
  7. <el-row :gutter="20">
  8. <el-col :span="6">
  9. <el-form-item label="项目名称" prop="projectName">
  10. <el-input v-model.trim="queryParams.projectName" placeholder="请输入项目名称" clearable
  11. @keyup.enter.native="handleQuery" />
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="6">
  15. <el-form-item label="股权/其他合作商务条款" prop="provision">
  16. <el-input v-model.trim="queryParams.provision" placeholder="请输入股权/其他合作商务条款" clearable
  17. @keyup.enter.native="handleQuery" />
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="6">
  21. </el-col>
  22. <el-col :span="6">
  23. </el-col>
  24. </el-row>
  25. <el-row :gutter="20">
  26. <el-col :span="6">
  27. </el-col>
  28. <el-col :span="6">
  29. </el-col>
  30. <el-col :span="6"></el-col>
  31. <el-col :span="6"></el-col>
  32. </el-row>
  33. <!-- 可继续扩展其他查询表单项目,比如项目编号、负责人等 -->
  34. <el-row :gutter="20">
  35. <el-col :span="6">
  36. <el-form-item label="搜索">
  37. <el-button style="width: 100%;" type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="6">
  41. <el-form-item label="重置">
  42. <el-button style="width: 100%;" icon="el-icon-refresh" type="primary" @click="resetQuery">重置</el-button>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="6">
  46. <el-form-item label="导出">
  47. <el-button style="width: 100%;" type="primary" icon="el-icon-download"
  48. @click="exportQuery">导出</el-button>
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. </el-form>
  53. <!-- Tab 切换区域 -->
  54. <el-tabs v-model="activeTab" type="border-card" @tab-click="handleTabClick">
  55. <el-tab-pane label="待办任务" name="list1">
  56. <!-- 列表一内容 -->
  57. <el-table height="450" ref="dataTable" @row-click="clickRow" class="tableWrapper" v-loading="loading" border
  58. :data="myTaskList">
  59. <!-- <el-table-column type="selection" width="40" align="center" />-->
  60. <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
  61. <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
  62. <el-table-column label="项目名称" align="center" prop="projectName" width="200">
  63. <template slot-scope="scope">
  64. <div :title="scope.row.projectName" class="public-text-blue public-cursor"
  65. @click.stop="handleInvestOppDetail(scope.row)">
  66. {{ scope.row.projectName }}
  67. </div>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="所属行业" align="center" prop="industry"><template slot-scope="scope">
  71. <dict-tag :options="dict.type.CUSTOMER_TRADE" :value="scope.row.industry" />
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="项目阶段" align="center" prop="projectStage">
  75. <template slot-scope="scope">
  76. <dict-tag :options="dict.type.project_stage" :value="scope.row.projectStage" />
  77. </template>
  78. </el-table-column>
  79. <!-- <el-table-column
  80. label="项目状态"
  81. align="center"
  82. prop="projectState"
  83. width="120"
  84. >
  85. <template slot-scope="scope">
  86. <dict-tag
  87. :options="dict.type.project_state"
  88. :value="scope.row.projectState"
  89. />
  90. </template>
  91. </el-table-column>-->
  92. <el-table-column label="项目机会状态" align="center" prop="projectStatus">
  93. <template slot-scope="scope">
  94. <!-- 定义状态文本映射对象 -->
  95. <el-tag :type="{
  96. 0: 'success',
  97. 1: 'danger',
  98. 2: 'warning'
  99. }[scope.row.projectStatus] || 'info'">
  100. {{ {
  101. 0: '正常',
  102. 1: '终止',
  103. 2: '观望'
  104. }[scope.row.projectStatus] || '未知状态' }}
  105. </el-tag>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="项目负责人" align="center" prop="investHead">
  109. <template slot-scope="scope">
  110. <div :title="scope.row.investHead">
  111. {{ scope.row.investHead }}
  112. </div>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="股权/其他合作商务条款" align="center" prop="provision">
  116. <template slot-scope="scope">
  117. <div :title="scope.row.provision">
  118. {{ scope.row.provision }}
  119. </div>
  120. </template>
  121. </el-table-column>
  122. <!-- delFlag -->
  123. <el-table-column label="状态" align="center" prop="delFlag">
  124. <template slot-scope="scope">
  125. <div :title="scope.row.delFlag === '1' ? '终止' : '正常'">
  126. {{ scope.row.delFlag === "1" ? "终止" : "正常" }}
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="申请人" align="center" prop="startUserName">
  131. <template slot-scope="scope">
  132. <div :title="scope.row.startUserName">
  133. {{ scope.row.startUserName }}
  134. </div>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="申请日期" align="center" prop="createTime">
  138. <template slot-scope="scope">
  139. <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="当前节点" align="center" prop="taskName">
  143. <template slot-scope="scope">
  144. <div :title="scope.row.taskName" class="public-text-blue public-cursor"
  145. @click="handleReadImage(scope.row)">
  146. {{ scope.row.taskName }}
  147. </div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="当前处理人" align="center" prop="assigneeName">
  151. <template slot-scope="scope">
  152. <div :title="scope.row.assigneeName">
  153. {{ scope.row.assigneeName }}
  154. </div>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="流程状态" align="center" prop="status">
  158. <template slot-scope="scope">
  159. <div :title="scope.row.status">
  160. <span v-if="scope.row.status === 0">暂存</span>
  161. <span v-else-if="scope.row.status === 1">已提交</span>
  162. <span v-else-if="scope.row.status === 2">审批中</span>
  163. <span v-else-if="scope.row.status === 3">审批完成</span>
  164. <span v-else-if="scope.row.status === 4">关闭</span>
  165. </div>
  166. </template>
  167. </el-table-column>
  168. <!-- -->
  169. <el-table-column label="操作" align="center" width="90" class-name="small-padding fixed-width">
  170. <template slot-scope="scope">
  171. <el-button v-if="scope.row.taskDefKey == 'modifyApply'" type="text" size="small"
  172. @click="handleEdit(scope.row)">处理</el-button>
  173. <template v-else>
  174. <!-- 1. 签收按钮:无签收人时显示 -->
  175. <el-button v-if="!scope.row.assignee" type="text" size="small"
  176. @click="handleSign(scope.row)">签收</el-button>
  177. <!-- 2. 处理按钮:有签收人时显示 -->
  178. <el-button v-else type="text" size="small" @click="handleProcess(scope.row)">处理</el-button>
  179. <!-- 3. 撤回按钮:需补充逻辑(比如仅未签收可撤回,可结合 signPerson 判断) -->
  180. <!-- <el-button v-if="!scope.row.assignee" size="mini" type="text" size="small" icon="el-icon-refresh-right" @click="handleWithdraw(scope.row)">撤回</el-button>-->
  181. <!-- 4. 详情按钮:一直显示 -->
  182. </template>
  183. <el-button style="color:#1890ff" type="text" size="small"
  184. @click="handleDetail(scope.row)">详情</el-button>
  185. </template>
  186. </el-table-column>
  187. </el-table>
  188. <!-- 分页 -->
  189. <pagination v-show="myTaskTotal > 0" :total="myTaskTotal" :page.sync="queryParams.pageNum"
  190. :limit.sync="queryParams.pageSize" @pagination="getMyTaskList" />
  191. </el-tab-pane>
  192. <el-tab-pane label="已办任务" name="list2">
  193. <!-- 我的单据表格 -->
  194. <!-- 列表一内容 -->
  195. <el-table height="450" ref="dataTable" @row-click="clickRow" class="tableWrapper" v-loading="loading" border
  196. :data="myDoneTaskList">
  197. <!-- <el-table-column type="selection" width="40" align="center" />-->
  198. <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
  199. <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
  200. <el-table-column label="项目名称" align="center" prop="projectName" width="200">
  201. <template slot-scope="scope">
  202. <div :title="scope.row.projectName" class="public-text-blue public-cursor"
  203. @click.stop="handleInvestOppDetail(scope.row)">
  204. {{ scope.row.projectName }}
  205. </div>
  206. </template>
  207. </el-table-column>
  208. <el-table-column label="所属行业" align="center" prop="industry"><template slot-scope="scope">
  209. <dict-tag :options="dict.type.CUSTOMER_TRADE" :value="scope.row.industry" />
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="项目阶段" align="center" prop="projectStage">
  213. <template slot-scope="scope">
  214. <dict-tag :options="dict.type.project_stage" :value="scope.row.projectStage" />
  215. </template>
  216. </el-table-column>
  217. <!-- <el-table-column
  218. label="项目状态"
  219. align="center"
  220. prop="projectState"
  221. width="120"
  222. >
  223. <template slot-scope="scope">
  224. <dict-tag
  225. :options="dict.type.project_state"
  226. :value="scope.row.projectState"
  227. />
  228. </template>
  229. </el-table-column>-->
  230. <!-- projectStatus -->
  231. <el-table-column label="项目机会状态" align="center" prop="projectStatus">
  232. <template slot-scope="scope">
  233. <!-- 定义状态文本映射对象 -->
  234. <el-tag :type="{
  235. 0: 'success',
  236. 1: 'danger',
  237. 2: 'warning'
  238. }[scope.row.projectStatus] || 'info'">
  239. {{ {
  240. 0: '正常',
  241. 1: '终止',
  242. 2: '观望'
  243. }[scope.row.projectStatus] || '未知状态' }}
  244. </el-tag>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="项目负责人" align="center" prop="investHead">
  248. <template slot-scope="scope">
  249. <div :title="scope.row.investHead">
  250. {{ scope.row.investHead }}
  251. </div>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="股权/其他合作商务条款" align="center" prop="provision">
  255. <template slot-scope="scope">
  256. <div :title="scope.row.provision">
  257. {{ scope.row.provision }}
  258. </div>
  259. </template>
  260. </el-table-column>
  261. <!-- delFlag -->
  262. <el-table-column label="状态" align="center" prop="delFlag">
  263. <template slot-scope="scope">
  264. <div :title="scope.row.delFlag === '1' ? '终止' : '正常'">
  265. {{ scope.row.delFlag === "1" ? "终止" : "正常" }}
  266. </div>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="申请人" align="center" prop="startUserName">
  270. <template slot-scope="scope">
  271. <div :title="scope.row.startUserName">
  272. {{ scope.row.startUserName }}
  273. </div>
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="申请日期" align="center" prop="createTime">
  277. <template slot-scope="scope">
  278. <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="当前节点" align="center" prop="taskName">
  282. <template slot-scope="scope">
  283. <div v-if="scope.row.deployId !== null && scope.row.deployId !== undefined && scope.row.deployId !== ''"
  284. :title="scope.row.taskName" class="public-text-blue public-cursor"
  285. @click="handleReadImage(scope.row)">
  286. {{ scope.row.taskName }}
  287. </div>
  288. <div v-else :title="scope.row.taskName">
  289. {{ scope.row.taskName }}
  290. </div>
  291. </template>
  292. </el-table-column>
  293. <el-table-column label="当前处理人" align="center" prop="assigneeName">
  294. <template slot-scope="scope">
  295. <div :title="scope.row.assigneeName">
  296. {{ scope.row.assigneeName }}
  297. </div>
  298. </template>
  299. </el-table-column>
  300. <el-table-column label="流程状态" align="center" prop="status">
  301. <template slot-scope="scope">
  302. <div :title="scope.row.status">
  303. <span v-if="scope.row.status === 0">暂存</span>
  304. <span v-else-if="scope.row.status === 1">已提交</span>
  305. <span v-else-if="scope.row.status === 2">审批中</span>
  306. <span v-else-if="scope.row.status === 3">审批完成</span>
  307. <span v-else-if="scope.row.status === 4">关闭</span>
  308. </div>
  309. </template>
  310. </el-table-column>
  311. <!-- -->
  312. <el-table-column label="操作" align="center" width="70" class-name="small-padding fixed-width">
  313. <template slot-scope="scope">
  314. <el-button style="color:#1890ff" type="text" size="small"
  315. @click="handleDetail(scope.row)">详情</el-button>
  316. </template>
  317. </el-table-column>
  318. </el-table>
  319. <!-- 分页 -->
  320. <pagination v-show="myDoneTaskTotal > 0" :total="myDoneTaskTotal" :page.sync="queryParams.pageNum"
  321. :limit.sync="queryParams.pageSize" @pagination="getMyDoneTaskList" />
  322. </el-tab-pane>
  323. <el-tab-pane label="我的单据" name="list3">
  324. <!-- 我的单据表格 -->
  325. <!-- 列表一内容 -->
  326. <el-table height="450" ref="dataTable" @row-click="clickRow" class="tableWrapper" v-loading="loading" border
  327. :data="myList">
  328. <!-- <el-table-column type="selection" width="40" align="center" />-->
  329. <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
  330. <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
  331. <el-table-column label="项目名称" align="center" prop="projectName" width="200">
  332. <template slot-scope="scope">
  333. <div :title="scope.row.projectName" class="public-text-blue public-cursor"
  334. @click.stop="handleInvestOppDetail(scope.row)">
  335. {{ scope.row.projectName }}
  336. </div>
  337. </template>
  338. </el-table-column>
  339. <el-table-column label="所属行业" align="center" prop="industry"><template slot-scope="scope">
  340. <dict-tag :options="dict.type.CUSTOMER_TRADE" :value="scope.row.industry" />
  341. </template>
  342. </el-table-column>
  343. <el-table-column label="项目阶段" align="center" prop="projectStage">
  344. <template slot-scope="scope">
  345. <dict-tag :options="dict.type.project_stage" :value="scope.row.projectStage" />
  346. </template>
  347. </el-table-column>
  348. <!-- <el-table-column
  349. label="项目状态"
  350. align="center"
  351. prop="projectState"
  352. width="120"
  353. >
  354. <template slot-scope="scope">
  355. <dict-tag
  356. :options="dict.type.project_state"
  357. :value="scope.row.projectState"
  358. />
  359. </template>
  360. </el-table-column>-->
  361. <!-- projectStatus -->
  362. <el-table-column label="项目机会状态" align="center" prop="projectStatus">
  363. <template slot-scope="scope">
  364. <!-- 定义状态文本映射对象 -->
  365. <el-tag :type="{
  366. 0: 'success',
  367. 1: 'danger',
  368. 2: 'warning'
  369. }[scope.row.projectStatus] || 'info'">
  370. {{ {
  371. 0: '正常',
  372. 1: '终止',
  373. 2: '观望'
  374. }[scope.row.projectStatus] || '未知状态' }}
  375. </el-tag>
  376. </template>
  377. </el-table-column>
  378. <el-table-column label="项目负责人" align="center" prop="investHead">
  379. <template slot-scope="scope">
  380. <div :title="scope.row.investHead">
  381. {{ scope.row.investHead }}
  382. </div>
  383. </template>
  384. </el-table-column>
  385. <el-table-column label="股权/其他合作商务条款" align="center" prop="provision">
  386. <template slot-scope="scope">
  387. <div :title="scope.row.provision">
  388. {{ scope.row.provision }}
  389. </div>
  390. </template>
  391. </el-table-column>
  392. <!-- delFlag -->
  393. <el-table-column label="状态" align="center" prop="delFlag">
  394. <template slot-scope="scope">
  395. <div :title="scope.row.delFlag === '1' ? '终止' : '正常'">
  396. {{ scope.row.delFlag === "1" ? "终止" : "正常" }}
  397. </div>
  398. </template>
  399. </el-table-column>
  400. <el-table-column label="申请人" align="center" prop="startUserName">
  401. <template slot-scope="scope">
  402. <div :title="scope.row.startUserName">
  403. {{ scope.row.startUserName }}
  404. </div>
  405. </template>
  406. </el-table-column>
  407. <el-table-column label="申请日期" align="center" prop="createTime">
  408. <template slot-scope="scope">
  409. <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
  410. </template>
  411. </el-table-column>
  412. <el-table-column label="当前节点" align="center" prop="taskName">
  413. <template slot-scope="scope">
  414. <div :title="scope.row.taskName" class="public-text-blue public-cursor"
  415. @click="handleReadImage(scope.row)">
  416. {{ scope.row.taskName }}
  417. </div>
  418. </template>
  419. </el-table-column>
  420. <el-table-column label="当前处理人" align="center" prop="assigneeName">
  421. <template slot-scope="scope">
  422. <div :title="scope.row.assigneeName">
  423. {{ scope.row.assigneeName }}
  424. </div>
  425. </template>
  426. </el-table-column>
  427. <el-table-column label="流程状态" align="center" prop="status">
  428. <template slot-scope="scope">
  429. <div :title="scope.row.status">
  430. <span v-if="scope.row.status === 0">暂存</span>
  431. <span v-else-if="scope.row.status === 1">已提交</span>
  432. <span v-else-if="scope.row.status === 2">审批中</span>
  433. <span v-else-if="scope.row.status === 3">审批完成</span>
  434. <span v-else-if="scope.row.status === 4">关闭</span>
  435. </div>
  436. </template>
  437. </el-table-column>
  438. <el-table-column label="操作" align="center" width="70" class-name="small-padding fixed-width">
  439. <template slot-scope="scope">
  440. <el-button style="color:#1890ff" type="text" size="small"
  441. @click="handleDetail(scope.row)">详情</el-button>
  442. </template>
  443. </el-table-column>
  444. </el-table>
  445. <!-- 分页 -->
  446. <pagination v-show="myTotal > 0" :total="myTotal" :page.sync="queryParams.pageNum"
  447. :limit.sync="queryParams.pageSize" @pagination="getMyList" />
  448. </el-tab-pane>
  449. </el-tabs>
  450. </el-card>
  451. <!-- Flowable 流程图弹窗 -->
  452. <!-- 流程图 -->
  453. <el-dialog :title="readImage.title" :visible.sync="readImage.open" width="70%" append-to-body>
  454. <!-- <el-image :src="readImage.src"></el-image> -->
  455. <flow :flowData="flowData" />
  456. </el-dialog>
  457. </div>
  458. </template>
  459. <script>
  460. import { getMyTaskList, getMyDoneTaskList, getMyList } from "@/api/project/decision/pool";
  461. import { flowXmlAndNode } from "@/api/flowable/definition";
  462. import { listChannel } from "@/api/invest/channel";
  463. import flow from '@/views/flowable/task/todo/detail/flow';
  464. import { getPool } from "@/api/invest/pool";
  465. import { mapGetters } from "vuex";
  466. export default {
  467. dicts: ["project_group", "project_stage", "project_state", "CUSTOMER_TRADE"],
  468. components: { flow },
  469. data() {
  470. return {
  471. // 当前激活的 Tab
  472. activeTab: "list1",
  473. // 遮罩层
  474. loading: false,
  475. // 查询参数
  476. queryParams: {
  477. id: null,
  478. pageNum: 1,
  479. pageSize: 10,
  480. projectName: null,
  481. projectGroup: "",
  482. projectCode: null,
  483. channel: null,
  484. contactDate: null,
  485. projectDate: null,
  486. decisionDate: null,
  487. industry: null,
  488. company: null,
  489. projectContacts: null,
  490. investHead: null,
  491. previousFinancing: null,
  492. financingStage: null,
  493. financingMoney: null,
  494. financingDate: null,
  495. investValuation: null,
  496. investMoney: null,
  497. investType: null,
  498. investPloy: null,
  499. investWorth: null,
  500. projectStage: null,
  501. projectState: null,
  502. orderByColumn: "createTime",
  503. isAsc: "desc",
  504. createTime: null,
  505. },
  506. // 数据列表(分开存储不同Tab的数据)
  507. myTaskList: [], // 待办任务数据
  508. // 待办任务总条数,用于分页
  509. myTaskTotal: 0,
  510. myDoneTaskList: [], // 已办任务数据
  511. // 已办任务总条数,用于分页
  512. myDoneTaskTotal: 0,
  513. myList: [], // 我的单据数据
  514. // 我的单据总条数,用于分页
  515. myTotal: 0,
  516. channelList: [], //渠道
  517. //流程图信息
  518. readImage: {
  519. open: false,
  520. src: "",
  521. },
  522. // xml
  523. flowData: {},
  524. };
  525. },
  526. computed: {
  527. ...mapGetters(["user"]),
  528. },
  529. created() {
  530. // 页面初始化时,加载当前激活Tab的数据
  531. this.initTabData();
  532. },
  533. mounted() {
  534. // 渠道
  535. listChannel({
  536. pageNum: 1,
  537. pageSize: 100,
  538. }).then((response) => {
  539. this.channelList = response.rows;
  540. });
  541. },
  542. methods: {
  543. // Tab切换事件处理
  544. handleTabClick(tab) {
  545. // tab为当前点击的Tab对象,tab.name即标识(list1/list2)
  546. this.activeTab = tab.name;
  547. // 根据Tab标识加载对应数据
  548. this.initTabData();
  549. },
  550. // 初始化当前Tab数据(支持传入Tab名,默认用activeTab)
  551. initTabData() {
  552. switch (this.activeTab) {
  553. case "list1":
  554. // 待办任务:调用待办查询方法
  555. this.getMyTaskList();
  556. break;
  557. case "list2":
  558. // 已办任务:调用已办查询方法
  559. this.getMyDoneTaskList();
  560. break;
  561. case "list3":
  562. // 我的单据:调用单据查询方法
  563. this.getMyList();
  564. break;
  565. default:
  566. break;
  567. }
  568. },
  569. // 1. 查询“我的待办任务”数据
  570. getMyTaskList() {
  571. this.loading = true;
  572. // 调用待办任务接口(示例)
  573. getMyTaskList(this.queryParams).then((response) => {
  574. //console.log( response.rows);
  575. this.myTaskList = response.rows; // 表格数据
  576. this.myTaskTotal = response.total; // 分页总条数
  577. this.loading = false;
  578. }).catch(() => {
  579. this.loading = false;
  580. });
  581. },
  582. // 2. 查询“我的已办任务”数据
  583. getMyDoneTaskList() {
  584. this.loading = true;
  585. // 调用待办任务接口(示例)
  586. getMyDoneTaskList(this.queryParams).then((response) => {
  587. this.myDoneTaskList = response.rows; // 表格数据
  588. this.myDoneTaskTotal = response.total; // 分页总条数
  589. this.loading = false;
  590. }).catch(() => {
  591. this.loading = false;
  592. });
  593. },
  594. // 3. 查询“我的单据”数据
  595. getMyList() {
  596. this.loading = true;
  597. // 调用我的单据接口(示例)
  598. getMyList(this.queryParams).then((response) => {
  599. this.myList = response.rows;
  600. this.myTotal = response.total;
  601. this.loading = false;
  602. }).catch(() => {
  603. this.loading = false;
  604. });
  605. },
  606. /** 搜索按钮操作 */
  607. handleQuery() {
  608. this.queryParams.pageNum = 1;
  609. this.initTabData();
  610. },
  611. /** 重置按钮操作 */
  612. resetQuery() {
  613. this.resetForm("queryForm");
  614. this.queryParams.orderByColumn = "createTime";
  615. this.queryParams.isAsc = "desc";
  616. this.queryParams.pageNum = 1;
  617. this.queryParams.pageSize = 10;
  618. this.handleQuery();
  619. },
  620. /*导出*/
  621. exportQuery() {
  622. switch (this.activeTab) {
  623. case "list1":
  624. // 待办任务:调用待办导出方法
  625. this.handleExportMyTask();
  626. break;
  627. case "list2":
  628. // 已办任务:调用已办导出方法
  629. this.handleExportMyDoneTask();
  630. break;
  631. case "list3":
  632. // 我的单据:调用单据导出方法
  633. this.handleExportMy();
  634. break;
  635. default:
  636. break;
  637. }
  638. },
  639. /** 导出按钮操作 */
  640. handleExportMyTask() {
  641. this.download(
  642. "project/decision/exportMyTask",
  643. {
  644. ...this.queryParams,
  645. },
  646. `MyTask_${new Date().getTime()}.xlsx`
  647. );
  648. },
  649. handleExportMyDoneTask() {
  650. this.download(
  651. "project/decision/exportMyDoneTask",
  652. {
  653. ...this.queryParams,
  654. },
  655. `MyDoneTask_${new Date().getTime()}.xlsx`
  656. );
  657. },
  658. handleExportMy() {
  659. this.download(
  660. "project/decision/exportMy",
  661. {
  662. ...this.queryParams,
  663. },
  664. `My_${new Date().getTime()}.xlsx`
  665. );
  666. },
  667. clickRow(row) {
  668. this.$refs.dataTable.toggleRowSelection(row);
  669. },
  670. /*项目机会详情*/
  671. handleInvestOppDetail(row) {
  672. const projectPoolId = row.projectPoolId;
  673. getPool(projectPoolId).then((response) => {
  674. const pInstId = response.data.procInstId;
  675. this.$router.push({
  676. path: "/myTask/project/investOpp/detail", query: {
  677. id:
  678. projectPoolId, pInstId: pInstId
  679. }
  680. });
  681. });
  682. },
  683. // 跳转到处理页面(暂存节点页面)
  684. handleEdit(row) {
  685. const id = row.id || this.ids;
  686. const poolId = row.projectPoolId;
  687. const pInstId = row.procInstId; ``
  688. const taskId = row.taskId;
  689. this.$router.push({ path: "/myTask/project/decision/edit", query: { id: poolId, pInstId: pInstId, taskId: taskId } });
  690. },
  691. // 签收操作
  692. handleSign(row) {
  693. // 标记签收人、更新状态等逻辑
  694. row.signPerson = '当前用户';
  695. this.$message.success('签收成功');
  696. },
  697. // 跳转到处理页面
  698. handleProcess(row) {
  699. const id = row.id || this.ids;
  700. const poolId = row.projectPoolId;
  701. const pInstId = row.procInstId;
  702. const taskId = row.taskId;
  703. this.$store.commit("SET_PROJECTITEMMESSAGE", row);
  704. this.$router.push({ path: "/myTask/project/decision/audit", query: { id: poolId, pInstId: pInstId, taskId: taskId } });
  705. },
  706. // 撤回操作
  707. handleWithdraw(row) {
  708. // 撤回逻辑(比如清空签收人)
  709. row.signPerson = '';
  710. this.$message.success('已撤回');
  711. },
  712. // 详情操作
  713. /*handleFlowRecord(row) {
  714. // 查看流程详情逻辑
  715. console.log('流程详情:', row);
  716. }*/
  717. /*详情*/
  718. handleDetail(row) {
  719. const id = row.id || this.ids;
  720. const poolId = row.projectPoolId;
  721. const pInstId = row.procInstId;
  722. this.$router.push({ path: "/myTask/project/decision/detail", query: { id: poolId, pInstId: pInstId } });
  723. },
  724. /** 修改按钮操作 */
  725. handleUpdate(row) {
  726. const id = row.id;
  727. this.$router.push({ path: "/invest/pool/add", query: { id: id } });
  728. },
  729. /**终止按钮操作 */
  730. handleDelete(row) {
  731. const ids = row.id || this.ids;
  732. const idsName = row.projectName ? row.projectName : this.idsName;
  733. this.$modal
  734. .confirm('是否终止"' + idsName + '"项目?')
  735. .then(function () {
  736. return delPool(ids);
  737. })
  738. .then(() => {
  739. this.getList();
  740. this.$modal.msgSuccess("已终止");
  741. })
  742. .catch(() => { });
  743. },
  744. /** 流程图查看 */
  745. handleReadImage(row) {
  746. this.readImage.title = "流程图";
  747. this.readImage.open = true;
  748. //console.log(row)
  749. // this.readImage.src = process.env.VUE_APP_BASE_API + "/flowable/definition/readImage/" + deploymentId;
  750. flowXmlAndNode({ procInsId: row.procInstId, deployId: row.deployId }).then(res => {
  751. this.flowData = res.data;
  752. })
  753. },
  754. },
  755. };
  756. </script>
  757. <style lang="scss" scoped>
  758. .tableWrapper {
  759. font-size: 12px;
  760. color: #000;
  761. ::v-deep .el-table__header-wrapper th {
  762. font-size: 12px;
  763. font-weight: bolder;
  764. color: #000;
  765. }
  766. ::v-deep td.el-table__cell:not(:last-child) div {
  767. text-overflow: -o-ellipsis-lastline;
  768. overflow: hidden;
  769. text-overflow: ellipsis;
  770. display: -webkit-box;
  771. -webkit-line-clamp: 1;
  772. line-clamp: 1;
  773. -webkit-box-orient: vertical;
  774. }
  775. }
  776. /**找到表头那一行,然后把里面的复选框隐藏掉**/
  777. .hideHeaderCheckBox::v-deep .el-table__header-wrapper .el-table__header .el-checkbox {
  778. display: none;
  779. }
  780. </style>