ApproveComment.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <template>
  2. <div>
  3. <div v-if="processInstanceDescription != undefined">
  4. <div class="page-header">
  5. <h4 style="display: inline-block; margin-right: 2rem;">
  6. {{ $t("lang.approveComment.approveStatus") }}
  7. </h4>
  8. <a-tag color="processing">
  9. <template #icon>
  10. <sync-outlined :spin="true" />
  11. </template>
  12. {{
  13. !processInstanceDescription.suspended
  14. ? $t("lang.approveComment.running")
  15. : $t("lang.approveComment.finished")
  16. }}
  17. </a-tag>
  18. <a-tag color="warning">
  19. <template #icon>
  20. <clock-circle-outlined />
  21. </template>
  22. {{ $t("lang.approveComment.needApprove") }}:
  23. {{
  24. processInstanceDescription.taskDescriptions == undefined
  25. ? "0"
  26. : processInstanceDescription.taskDescriptions.length
  27. }}
  28. </a-tag>
  29. <a-tag color="success">
  30. <template #icon>
  31. <check-circle-outlined />
  32. </template>
  33. {{ $t("lang.approveComment.approved") }}:
  34. {{
  35. processInstanceDescription.historicTaskInstanceDescriptions == undefined
  36. ? "0"
  37. : processInstanceDescription.historicTaskInstanceDescriptions.length
  38. }}
  39. </a-tag>
  40. </div>
  41. <div>
  42. <h2>
  43. {{ (currentTaskInfo == null || currentTaskInfo.description == null) ? '' : currentTaskInfo.description }}
  44. </h2>
  45. <div v-if="showChoiceButton && isActiveTask" class="form">
  46. <PreviousNodeSelectUser
  47. ref="previousNodeSelectUser" :process-instance-id="processInstanceId"
  48. :model-data="modelData" :work-flow="workFlow" :task-id="taskInfoId"
  49. :approve-form-value="approveFormValue"
  50. />
  51. <div class="form-group" style="margin-top: 10px">
  52. <a-flex justify="space-between" align="flex-start" gap="middle">
  53. <a-button type="primary" size="large" class="approve-button" @click="modal3 = true">
  54. {{ (currentTaskInfo.category == 'MandatoryTask') ? $t("lang.approveComment.complete") : $t("lang.approveComment.approve") }}<br />
  55. </a-button>
  56. <a-button size="large" class="approve-button" @click="transfer">
  57. {{ $t("lang.approveComment.transfer") }}
  58. </a-button>
  59. <a-button size="large" class="approve-button" danger @click="reject">
  60. {{ $t("lang.approveComment.reject") }}
  61. </a-button>
  62. <a-button size="large" class="approve-button" @click="withdraw">
  63. {{ $t("lang.approveComment.return") }}
  64. </a-button>
  65. <a-button size="large" class="approve-button" @click="addComment">
  66. {{ $t("lang.approveComment.comment") }}
  67. </a-button>
  68. </a-flex>
  69. </div>
  70. <!-- 表单属性 -->
  71. <ApproveForm
  72. v-if="currentTaskInfo.category != 'MandatoryTask'" ref="approveForm" :process-instance-id="processInstanceId"
  73. :workflow="workFlow" :task-id="taskInfoId"
  74. @value-changed="approveFormValueChanged"
  75. />
  76. <div v-if="currentTaskInfo.category != 'MandatoryTask'" class="form-group">
  77. <label class="control-label">{{ $t("lang.approveComment.opinion") }}</label>
  78. <textarea v-model="comment" class="form-control" rows="3" />
  79. </div>
  80. <ApproveTaskAttachmentEdit v-if="currentTaskInfo.category != 'MandatoryTask'" :task-id="taskInfoId" />
  81. </div>
  82. <ul class="media-list">
  83. <li class="media">
  84. <div class="media-left">
  85. <a>
  86. <AuthImage
  87. id="image202002281140001" :auth-src="Common.getThumbnailImageSrc(
  88. 'com.leanwo.prodog.base.model.User',
  89. processInstanceDescription.startUserImage
  90. )
  91. " class="media-object thumbnail m-image"
  92. />
  93. </a>
  94. </div>
  95. <div class="media-body">
  96. <h4 class="media-heading">
  97. {{ processInstanceDescription.startUserName }}
  98. <small class="badge alert-success">{{
  99. $t("lang.approveComment.submitUser")
  100. }}</small>
  101. </h4>
  102. <h5 class="m-h5">{{ processInstanceDescription.startTime }}</h5>
  103. <p class="comment-text">{{ $t("lang.approveComment.submitApprove") }}</p>
  104. </div>
  105. </li>
  106. <template v-if="processInstanceDescription.historicTaskInstanceDescriptions != undefined">
  107. <li
  108. v-for="historicTaskInstanceDescription in processInstanceDescription.historicTaskInstanceDescriptions"
  109. :key="historicTaskInstanceDescription.id" class="media"
  110. >
  111. <div class="media-left">
  112. <a>
  113. <AuthImage
  114. :auth-src="Common.getThumbnailImageSrc(
  115. 'com.leanwo.prodog.base.model.User',
  116. historicTaskInstanceDescription.assigneeImageUrl
  117. )
  118. " class="media-object thumbnail m-image"
  119. />
  120. </a>
  121. </div>
  122. <div class="media-body">
  123. <h4 class="media-heading">
  124. {{ historicTaskInstanceDescription.assigneeName }}
  125. <small class="badge alert-success">{{
  126. historicTaskInstanceDescription.name
  127. }}</small>
  128. </h4>
  129. <div v-if="historicTaskInstanceDescription.comments != undefined">
  130. <div v-for="commentItem in historicTaskInstanceDescription.comments" :key="commentItem.id">
  131. <h5 class="m-h5">{{ commentItem.time }}</h5>
  132. <p class="comment-text">{{ commentItem.message }}</p>
  133. </div>
  134. </div>
  135. <ApproveTaskAttachmentView
  136. :enable-delete="false"
  137. :attachments="historicTaskInstanceDescription.attachments"
  138. />
  139. </div>
  140. </li>
  141. </template>
  142. <template v-for="activeTask in processInstanceDescription.taskDescriptions" :key="activeTask.id">
  143. <li
  144. v-if="
  145. processInstanceDescription.taskDescriptions != undefined
  146. " class="media"
  147. >
  148. <div class="media-left">
  149. <a>
  150. <AuthImage
  151. :auth-src="Common.getThumbnailImageSrc(
  152. 'com.leanwo.prodog.base.model.User',
  153. activeTask.assigneeImageUrl
  154. )
  155. " class="media-object thumbnail m-image"
  156. />
  157. </a>
  158. </div>
  159. <div class="media-body">
  160. <h4 class="media-heading">
  161. {{ activeTask.assigneeName }}
  162. <small class="badge alert-info">{{ activeTask.name }}</small>
  163. </h4>
  164. <h5 class="m-h5">{{ activeTask.startTime }}</h5>
  165. <p class="comment-text">{{ $t("lang.approveComment.processing") }}</p>
  166. <div v-if="activeTask.comments != undefined">
  167. <div v-for="commentItem in activeTask.comments" :key="commentItem.id">
  168. <h5 class="m-h5">{{ commentItem.time }}</h5>
  169. <p class="comment-text">{{ commentItem.message }}</p>
  170. </div>
  171. </div>
  172. <ApproveTaskAttachmentView
  173. :enable-delete="activeTask.id == taskInfoId"
  174. :attachments="activeTask.attachments"
  175. />
  176. </div>
  177. </li>
  178. </template>
  179. </ul>
  180. </div>
  181. </div>
  182. <a-modal
  183. v-model:open="modal3"
  184. :title="$t('lang.approveComment.notice')"
  185. :cancel-text="$t('lang.approveComment.cancel')"
  186. :ok-text="$t('lang.approveComment.confirm')"
  187. @ok="confirmApprove"
  188. >
  189. {{ $t("lang.approveComment.confirmSubmit") }}
  190. </a-modal>
  191. <a-modal
  192. v-model:open="modal4"
  193. :title="$t('lang.approveComment.notice')"
  194. :cancel-text="$t('lang.approveComment.cancel')"
  195. :ok-text="$t('lang.approveComment.confirm')"
  196. @ok="confirmReject"
  197. >
  198. {{ $t("lang.approveComment.rejectConfirm") }}
  199. </a-modal>
  200. <a-modal v-model:open="modal5" width="80%" :title="$t('lang.approveComment.chooseTransferUser')">
  201. <InfoWindow
  202. ref="info" :info-window-no="infoWindowNo" :where-clause-source="whereClauseSource"
  203. @data-selected="transferSelectedUser"
  204. />
  205. </a-modal>
  206. <a-modal v-model:open="modal6" :title="$t('lang.approveComment.transfer')" @ok="transferSave">
  207. <a-flex gap="small" vertical>
  208. <div>{{ $t("lang.approveComment.transferTo") }}: {{ transferUserName }}</div>
  209. <div>
  210. {{ $t('lang.approveComment.transferReason') }}
  211. </div>
  212. <a-textarea
  213. v-model:value="transferText" :placeholder="$t('lang.approveComment.inputTransferReason')"
  214. :auto-size="{ minRows: 3, maxRows: 10 }"
  215. />
  216. </a-flex>
  217. </a-modal>
  218. <a-modal
  219. v-model:open="modal7" :small="true"
  220. :title="$t('lang.approveComment.notice')" :cancel-text="$t('lang.approveComment.cancel')"
  221. :ok-text="$t('lang.approveComment.confirm')" @ok="confirmReturn"
  222. >
  223. {{ $t("lang.approveComment.returnConfirm") }}
  224. </a-modal>
  225. <Loading v-if="loading" />
  226. </div>
  227. </template>
  228. <script>
  229. import Common from '../common/Common.js';
  230. import WindowService from '../common/WindowService.js';
  231. import CustomerWindowResource from '../resource/dictionary/CustomerWindowResource.js';
  232. import UserStorageResource from '../api/base/UserStorageResource.js';
  233. import UserResource from '../api/base/UserResource.js';
  234. import WorkflowResource from '../api/workflow/WorkflowResource.js';
  235. import PreviousNodeSelectUser from './PreviousNodeSelectUser.vue';
  236. import AuthImage from '../widget/AuthImage.vue';
  237. import ApproveForm from './ApproveForm.vue';
  238. import vSelect from 'vue-select';
  239. import 'vue-select/dist/vue-select.css';
  240. import ApproveTaskAttachmentEdit from './ApproveTaskAttachmentEdit.vue';
  241. import ApproveTaskAttachmentView from './ApproveTaskAttachmentView.vue';
  242. import { CheckCircleOutlined, SyncOutlined, ClockCircleOutlined } from '@ant-design/icons-vue';
  243. import { notification } from 'ant-design-vue';
  244. export default {
  245. components: {
  246. AuthImage,
  247. vSelect,
  248. PreviousNodeSelectUser,
  249. ApproveForm,
  250. ApproveTaskAttachmentEdit,
  251. ApproveTaskAttachmentView,
  252. CheckCircleOutlined,
  253. SyncOutlined,
  254. ClockCircleOutlined,
  255. },
  256. props: {
  257. windowNo: {
  258. type: String,
  259. default: null,
  260. },
  261. processInstanceId: {
  262. type: String,
  263. default: null,
  264. },
  265. taskInfoId: {
  266. type: String,
  267. default: null,
  268. },
  269. showChoiceButton: {
  270. type: Boolean,
  271. default: null,
  272. },
  273. recordId: {
  274. type: Number,
  275. default: null,
  276. },
  277. workFlow: {
  278. type: Object,
  279. default: function () {
  280. return null;
  281. },
  282. },
  283. workflowType: {
  284. type: String,
  285. default: null,
  286. },
  287. modelData: {
  288. type: Object,
  289. default: function () {
  290. return null;
  291. },
  292. },
  293. uuid: {
  294. type: String,
  295. default: null,
  296. },
  297. parentWidget: {
  298. type: String,
  299. default: null,
  300. },
  301. workflowClassName: {
  302. type: String,
  303. default: null,
  304. },
  305. },
  306. emits: ['saveData'],
  307. data: function () {
  308. this.Common = Common;
  309. return {
  310. processInstanceDescription: {},
  311. comment: '',
  312. className: 'WorkFlow',
  313. infoWindowNo: '050408',
  314. className1: 'com.leanwo.prodog.base.model.User',
  315. copyUsers: [],
  316. currentUser: '',
  317. whereClauseSource: {
  318. customWhere: null,
  319. },
  320. selectedUserTaskDto: '',
  321. currentUsers: [],
  322. transferUserId: undefined,
  323. transferUserName: undefined,
  324. transferText: undefined,
  325. userName: undefined,
  326. organizationName: undefined,
  327. userItem: undefined,
  328. isActiveTask: false, // 是否是有效的任务(任务未结束,任务属于登录人员)
  329. approveFormValue: null, // 自定义表单的数据
  330. currentTaskInfo: null, // 当前任务的信息
  331. loading: false,
  332. modal3: false,
  333. modal4: false,
  334. modal5: false,
  335. modal6: false,
  336. modal7: false,
  337. };
  338. },
  339. watch: {
  340. processInstanceId: function (currentValue, oldValue) {
  341. this.refresh();
  342. },
  343. taskInfoId: function (currentValue, oldValue) {
  344. this.checkIsActiveTask();
  345. },
  346. },
  347. mounted: function () {
  348. var _self = this;
  349. this.refresh();
  350. this.checkIsActiveTask();
  351. },
  352. methods: {
  353. /**
  354. * 获取图片路径
  355. * @param {String} imageName 图片名称
  356. * @return {void}
  357. */
  358. getImgSrc: function (imageName) {
  359. var _self = this;
  360. if (imageName == undefined || imageName == '') {
  361. return '/static/assets/client-base-v4/image/noImage.jpg';
  362. }
  363. return Common.getImageSrc(_self.className, imageName);
  364. },
  365. /**
  366. * 转交保存
  367. */
  368. transferSave: function () {
  369. var _self = this;
  370. _self.loading = true;
  371. var transferTask = new Object();
  372. transferTask.workflowType = _self.workFlow.workflowType;
  373. transferTask.taskId = _self.taskInfoId;
  374. transferTask.comment = _self.transferText;
  375. transferTask.transferUserName = _self.transferUserName;
  376. transferTask.transferUserId = _self.transferUserId;
  377. transferTask.className = _self.workflowClassName;
  378. transferTask.recordId = _self.recordId;
  379. console.log(_self.workflowClassName);
  380. $.ajax({
  381. url: Common.getApiURL('WorkflowResource/transfer'),
  382. type: 'post',
  383. beforeSend: function (request) {
  384. Common.addTokenToRequest(request);
  385. },
  386. contentType: 'application/json',
  387. data: JSON.stringify(transferTask),
  388. success: function (data) {
  389. _self.loading = false;
  390. notification.success({
  391. message: '操作成功',
  392. description: '单据转交成功',
  393. });
  394. setTimeout(function () {
  395. window.close();
  396. }, 1000);
  397. },
  398. error: function (XMLHttpRequest, textStatus, errorThrown) {
  399. _self.loading = false;
  400. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  401. },
  402. });
  403. },
  404. /**
  405. * 选择用户后
  406. * @param {Object} modelData 用户信息
  407. * @return {void}
  408. */
  409. transferSelectedUser: function (modelData) {
  410. var _self = this;
  411. this.modal5 = false;
  412. var userId = modelData.id;
  413. _self.loading = true;
  414. $.ajax({
  415. url: Common.getApiURL('userResource/getUser'),
  416. type: 'get',
  417. beforeSend: function (request) {
  418. Common.addTokenToRequest(request);
  419. },
  420. data: {
  421. userId: userId,
  422. },
  423. success: function (data) {
  424. _self.loading = false;
  425. _self.transferUserId = data.id;
  426. _self.transferUserName = data.name;
  427. _self.modal6 = true;
  428. },
  429. error: function (XMLHttpRequest, textStatus, errorThrown) {
  430. _self.loading = false;
  431. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  432. },
  433. });
  434. },
  435. /**
  436. * 转批
  437. * @author GuoZhiBo 20200611
  438. */
  439. transfer: function () {
  440. var _self = this;
  441. _self.initData();
  442. if (_self.windowNo != null && (_self.windowNo == '20220707_162600' || _self.windowNo == '20220703_174047')) {
  443. _self.infoWindowNo = '20220928_175733';
  444. let areaId = _self.modelData.data.area.id;
  445. _self.whereClauseSource.customWhere = ' fm.areaId = ' + areaId;
  446. } else {
  447. _self.infoWindowNo = '050408';
  448. let customerDataDimensions = [{
  449. fieldName: 'client.id',
  450. dataDimensionTypeNo: '202201191757',
  451. defaultDataDimensionTypeValueNo: '4',
  452. }];
  453. _self.whereClauseSource.customerDataDimensions = customerDataDimensions;
  454. }
  455. _self.modal5 = true;
  456. },
  457. /**
  458. * 确认审批通过
  459. */
  460. confirmApprove: function () {
  461. var _self = this;
  462. _self.modal3 = false;
  463. if (_self.parentWidget == 'TabFormEdit') {
  464. this.$emit('saveData', 'APPROVE');
  465. } else {
  466. this.saveData('APPROVE');
  467. }
  468. },
  469. /**
  470. * 确认审批不通过
  471. */
  472. confirmReject: function () {
  473. var _self = this;
  474. _self.modal4 = false;
  475. this.saveData('REJECT');
  476. },
  477. /**
  478. * 初始化数据
  479. * @return {void}
  480. */
  481. initData: function () {
  482. var _self = this;
  483. },
  484. /**
  485. * 生成文件属性
  486. */
  487. generateFileProperty: function (item) {
  488. return {
  489. fileName: item,
  490. };
  491. },
  492. /**
  493. * 表单搜索框数据发生改变
  494. */
  495. valueChanged: function (newFieldValue, item) {
  496. item.value = newFieldValue.id;
  497. },
  498. /**
  499. * 刷新流程信息
  500. */
  501. refresh: function () {
  502. var _self = this;
  503. _self.loading = true;
  504. if (
  505. _self.processInstanceId == undefined ||
  506. _self.processInstanceId.length == 0
  507. ) {
  508. _self.processInstanceDescription = {};
  509. return;
  510. }
  511. $.ajax({
  512. url: Common.getApiURL('WorkflowResource/ProcessInstanceDescription'),
  513. type: 'GET',
  514. dataType: 'json',
  515. data: {
  516. processInstanceId: _self.processInstanceId,
  517. recordId: _self.recordId,
  518. },
  519. beforeSend: function (request) {
  520. Common.addTokenToRequest(request);
  521. },
  522. success: function (data) {
  523. _self.loading = false;
  524. _self.processInstanceDescription = data;
  525. },
  526. error: function (XMLHttpRequest, textStatus, errorThrown) {
  527. _self.loading = false;
  528. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  529. },
  530. });
  531. },
  532. /**
  533. * 拒绝
  534. */
  535. reject: function () {
  536. var _self = this;
  537. if (_self.comment == undefined || _self.comment.length == 0) {
  538. notification.error({
  539. message: '操作失败',
  540. description: '请填写拒绝原因',
  541. });
  542. return;
  543. }
  544. _self.modal4 = true;
  545. },
  546. /**
  547. * 退回审批
  548. */
  549. withdraw: function () {
  550. var _self = this;
  551. if (_self.comment == undefined || _self.comment.length == 0) {
  552. notification.error({
  553. message: '操作失败',
  554. description: '请填写退回原因',
  555. });
  556. return;
  557. }
  558. _self.modal7 = true;
  559. },
  560. /**
  561. * 确认退回
  562. */
  563. confirmReturn: function () {
  564. var _self = this;
  565. _self.modal7 = false;
  566. this.saveData('WITHDRAW');
  567. },
  568. /**
  569. * 添加评论
  570. */
  571. addComment: function () {
  572. var _self = this;
  573. if (_self.comment == undefined || _self.comment.length == 0) {
  574. notification.error({
  575. message: '操作失败',
  576. description: '未填写评论信息,请先填写评论信息。',
  577. });
  578. return;
  579. }
  580. var addCommentRequest = {
  581. taskId: _self.taskInfoId,
  582. comment: _self.comment,
  583. };
  584. _self.loading = true;
  585. $.ajax({
  586. url: Common.getApiURL('WorkflowResource/addComment'),
  587. type: 'post',
  588. beforeSend: function (request) {
  589. Common.addTokenToRequest(request);
  590. },
  591. contentType: 'application/json',
  592. data: JSON.stringify(addCommentRequest),
  593. success: function (data) {
  594. _self.loading = false;
  595. _self.comment = '';
  596. _self.refresh();
  597. },
  598. error: function (XMLHttpRequest, textStatus, errorThrown) {
  599. _self.loading = false;
  600. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  601. },
  602. });
  603. },
  604. /**
  605. * 提交审批结果
  606. */
  607. saveData: function (command, modelData) {
  608. var _self = this;
  609. var chooseTask = new Object();
  610. chooseTask.workflowType = _self.workFlow.workflowType;
  611. chooseTask.taskId = _self.taskInfoId;
  612. chooseTask.command = command;
  613. chooseTask.comment = _self.comment;
  614. chooseTask.processInstanceId = _self.processInstanceId;
  615. chooseTask.windowNo = _self.windowNo;
  616. chooseTask.tabIndex = 0;
  617. chooseTask.recordId = _self.recordId;
  618. chooseTask.modelData = modelData;
  619. chooseTask.className = _self.workflowClassName;
  620. if (command === 'APPROVE') {
  621. try {
  622. if(this.$refs.approveForm != null){
  623. chooseTask.keyValueObjects = this.$refs.approveForm.getData();
  624. }
  625. } catch (exception) {
  626. console.log(exception);
  627. return;
  628. }
  629. try {
  630. if(this.$refs.previousNodeSelectUser != null){
  631. const param = this.$refs.previousNodeSelectUser.getData();
  632. chooseTask.copyUserIds = param.copyUsers;
  633. chooseTask.userSelectDtos = param.userSelectDtos;
  634. }
  635. } catch (exception) {
  636. notification.error({
  637. message: '操作失败',
  638. description: '存在未设置的审批人。' + exception.message,
  639. });
  640. return;
  641. }
  642. }
  643. _self.loading = true;
  644. $.ajax({
  645. url: Common.getApiURL('WorkflowResource/SetChoice'),
  646. type: 'post',
  647. beforeSend: function (request) {
  648. Common.addTokenToRequest(request);
  649. },
  650. contentType: 'application/json',
  651. data: JSON.stringify(chooseTask),
  652. success: function (data) {
  653. _self.loading = false;
  654. notification.success({
  655. message: '操作成功',
  656. description: '已经成功的完成了任务。',
  657. });
  658. setTimeout(function () {
  659. window.location.reload();
  660. WindowService.close();
  661. }, 1000);
  662. },
  663. error: function (XMLHttpRequest, textStatus, errorThrown) {
  664. _self.loading = false;
  665. Common.processException(XMLHttpRequest, textStatus, errorThrown);
  666. },
  667. });
  668. },
  669. /**
  670. * 获取评论的图片
  671. * @param {[type]} imageUrl [description]
  672. * @return {[type]} [description]
  673. */
  674. getCommentImageSrc: function (imageUrl) {
  675. console.log(imageUrl);
  676. var realImageUrl = Common.getImageSrc(
  677. this.className,
  678. 'thumbnail/' + imageUrl,
  679. );
  680. return realImageUrl;
  681. },
  682. /**
  683. * 打开图片附件的功能
  684. * @param {[type]} imageName [description]
  685. * @return {[type]} [description]
  686. */
  687. openImageAttachment: function (imageName) {
  688. if (imageName == undefined) {
  689. return;
  690. }
  691. var fullPath = Common.getImageSrc(this.className, imageName);
  692. window.open(fullPath);
  693. },
  694. /**
  695. * 打开自定义窗口
  696. */
  697. openCustomerWindow: function (customerWindowId) {
  698. var _self = this;
  699. CustomerWindowResource.getById(customerWindowId).then(
  700. successData => {
  701. if (successData.errorCode != 0) {
  702. notification.error({
  703. message: '操作失败',
  704. description: successData.errorMessage,
  705. });
  706. return;
  707. }
  708. var routeDate = {
  709. path: successData.data.routeUrl,
  710. params: {
  711. modelData: _self.modelData,
  712. },
  713. };
  714. // 请勿修改,会影响生单的功能
  715. let key = _self.uuid + '_modelData';
  716. let userStorageDtos = [
  717. {
  718. key: key,
  719. value: JSON.stringify(_self.modelData),
  720. },
  721. ];
  722. // 组装查询条件,然后放到后台数据库当中
  723. _self.saveToUserStorage(userStorageDtos);
  724. // localStorage.setItem(uuid + "_modelDatas", JSON.stringify(this.modelDatas));
  725. routeDate.path = routeDate.path + '/' + _self.uuid;
  726. _self.$emit('saveView');
  727. _self.$router.push(routeDate);
  728. },
  729. errorData => {
  730. Common.processException(errorData);
  731. },
  732. );
  733. },
  734. /**
  735. * 保存到userStorage中
  736. * @author LeiGuoXian
  737. * @date 2020-09-17
  738. */
  739. saveToUserStorage: function (userStorageDtos) {
  740. var _self = this;
  741. // 组装查询条件,然后放到后台数据库当中
  742. UserStorageResource.uploadUserStorage(userStorageDtos).then(
  743. successData => { },
  744. errorData => {
  745. Common.processException(errorData);
  746. },
  747. );
  748. },
  749. /**
  750. * 检查是否是有效的任务
  751. * 1. 任务仍然存在
  752. * 2. 任务属于登录人
  753. */
  754. checkIsActiveTask: function () {
  755. let _self = this;
  756. if (this.taskInfoId == null) {
  757. this.isActiveTask = false;
  758. this.currentTaskInfo = null;
  759. return;
  760. }
  761. WorkflowResource.uniqueTaskInfoByTaskIdUserId(this.taskInfoId).then(
  762. successData => {
  763. if (successData.errorCode == 0 || successData.data == null || successData.data.id == null) {
  764. this.isActiveTask = false;
  765. this.currentTaskInfo = null;
  766. } else {
  767. this.isActiveTask = true;
  768. this.currentTaskInfo = successData.data;
  769. }
  770. },
  771. errorData => {
  772. Common.processException(errorData);
  773. },
  774. );
  775. },
  776. /**
  777. * 自定义表单的数据发生变化
  778. */
  779. approveFormValueChanged: function (newApproveFormValue) {
  780. this.approveFormValue = newApproveFormValue;
  781. },
  782. },
  783. };
  784. </script>
  785. <style scoped>
  786. .m-label {
  787. margin-left: 10px;
  788. }
  789. .m-h5 {
  790. display: inline;
  791. }
  792. .m-image {
  793. width: 64px;
  794. height: 64px;
  795. margin-bottom: 0px;
  796. }
  797. .m-image1 {
  798. display: inline !important;
  799. width: 64px;
  800. height: 64px;
  801. cursor: pointer;
  802. margin-right: 5px;
  803. }
  804. .file-box {
  805. width: 150px;
  806. position: relative;
  807. display: table-cell;
  808. }
  809. .file-remove {
  810. position: absolute;
  811. right: 0px;
  812. color: #43a51e;
  813. cursor: pointer;
  814. }
  815. .img-label {
  816. height: 80px;
  817. line-height: 80px;
  818. padding-top: 0px !important;
  819. }
  820. .img-box {
  821. width: 60px;
  822. height: 80px;
  823. float: left;
  824. text-align: center;
  825. margin-right: 20px;
  826. }
  827. .img-box div img {
  828. width: 60px;
  829. height: 60px;
  830. }
  831. .add-box {
  832. width: 60px;
  833. height: 60px;
  834. float: left;
  835. border-radius: 30px;
  836. border: 1px #999 dashed;
  837. text-align: center;
  838. margin-top: 20px;
  839. }
  840. .add-box:hover {
  841. cursor: pointer;
  842. background-color: #ccc;
  843. }
  844. .add-icon {
  845. width: 60px;
  846. height: 60px;
  847. color: #aaa;
  848. font-size: 40px;
  849. line-height: 60px;
  850. position: relative;
  851. top: -1px;
  852. }
  853. .remove-icon {
  854. color: red;
  855. position: relative;
  856. top: 10px;
  857. right: -30px;
  858. cursor: pointer;
  859. }
  860. .table-box td,
  861. th {
  862. text-align: center;
  863. }
  864. @keyframes go {
  865. 0% {
  866. transform: scale(1);
  867. }
  868. /* 25% {
  869. transform: scale(1.2);
  870. } */
  871. 50% {
  872. transform: scale(1.2);
  873. }
  874. /* 75% {
  875. transform: scale(1.2);
  876. } */
  877. 100% {
  878. transform: scale(1);
  879. }
  880. }
  881. button.forSaleOrder {
  882. animation: go 3s infinite;
  883. text-shadow: 1px 1px 1px black;
  884. }
  885. .comment-text {
  886. margin-bottom: 0px;
  887. }
  888. .approve-button {
  889. width: 100%;
  890. }
  891. </style>