deal.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view>
  3. <view :style="style">
  4. <scroll-view scroll-y :style="maxHeight">
  5. <contractDetail v-if="contractDetailShow" :businessKey = "businessKey"></contractDetail>
  6. <paymentDetail v-if="paymentDetailShow" :businessKey = "businessKey" :menuId="menuId" :processInstanceId="processInstanceId" ref="payRef"></paymentDetail>
  7. <financeFlowable v-if="financeFlowableShow" :businessKey = "businessKey" ref="financeRef"></financeFlowable>
  8. <shanghaiPaymentDetail v-if="shanghaiPaymentDetailShow" :businessKey = "businessKey" ref="shanghaiPaymentRef"></shanghaiPaymentDetail>
  9. <shanghaiContractDetail v-if="shanghaiContractDetailShow" :businessKey = "businessKey" ref="shanghaiContractRef"></shanghaiContractDetail>
  10. </scroll-view>
  11. </view>
  12. <view class="navigation" v-if="showButtom">
  13. <view class="left">
  14. <view class="item" @click="back()">
  15. <u-icon name="/static/icon/back.png" :size="iconSize"></u-icon>
  16. <view class="text u-line-1">返 回</view>
  17. </view>
  18. <!-- <view class="item">
  19. <u-icon name="/static/icon/zhuanban.png" :size="iconSize"></u-icon>
  20. <view class="text u-line-1">转 办</view>
  21. </view>
  22. <view class="item">
  23. <u-icon name="/static/icon/guaqi.png" :size="iconSize"></u-icon>
  24. <view class="text u-line-1">挂 起</view>
  25. </view>
  26. <view class="item">
  27. <u-icon name="/static/icon/tuihui.png" :size="iconSize"></u-icon>
  28. <view class="text u-line-1">退 回</view>
  29. </view> -->
  30. <view class="item" @click="deleteTaskModalShow()">
  31. <u-icon name="/static/icon/zhongzhi.png" :size="iconSize"></u-icon>
  32. <view class="text u-line-1">终 止</view>
  33. </view>
  34. <view class="item" @click="completeTaskModalShow()">
  35. <u-icon name="/static/icon/banjie.png" :size="iconSize"></u-icon>
  36. <view class="text u-line-1">提 交</view>
  37. </view>
  38. <view class="item" @click="taskDetailOpen()">
  39. <u-icon name="/static/icon/shenpixiangqing.png" :size="iconSize"></u-icon>
  40. <view class="text u-line-1">审批详情</view>
  41. </view>
  42. </view>
  43. </view>
  44. <uni-popup ref="popup" type="dialog">
  45. <uni-popup-dialog mode="input" type="info" title="审批意见" @confirm="completeTask"></uni-popup-dialog>
  46. </uni-popup>
  47. <uni-popup ref="popupDelete" type="dialog">
  48. <uni-popup-dialog mode="input" type="info" title="终止原因" @confirm="deleteTask"></uni-popup-dialog>
  49. </uni-popup>
  50. <uni-popup ref="popupWarn" type="message">
  51. <view style = "margin-top: 40%;margin-left: 10%; width: 80%;text-align: center;">
  52. <uni-popup-message type="warn" :message="warnMessage" :duration="1000"></uni-popup-message>
  53. </view>
  54. </uni-popup>
  55. <u-toast ref="uToast" />
  56. </view>
  57. </template>
  58. <script>
  59. import contractDetail from '@/components/pages/beijing/contract/contractDetail.vue';
  60. import paymentDetail from '@/components/pages/beijing/payment/paymentDetail.vue';
  61. import financeFlowable from '@/components/pages/beijing/finance/financeFlowable.vue';
  62. import shanghaiPaymentDetail from '@/components/pages/shanghai/payment/shanghaiPaymentDetail.vue';
  63. import shanghaiContractDetail from '@/components/pages/shanghai/contract/shanghaiContractDetail.vue';
  64. export default {
  65. components:{contractDetail, paymentDetail, financeFlowable, shanghaiPaymentDetail, shanghaiContractDetail},
  66. data() {
  67. return {
  68. taskId : '',
  69. processInstanceId : '',
  70. menuId : '',
  71. businessKey : '',
  72. style : 'height:'+(uni.getSystemInfoSync().screenHeight - 100)+'px;z-index:1',
  73. contractDetailShow : false,
  74. paymentDetailShow : false,
  75. financeFlowableShow : false,
  76. shanghaiPaymentDetailShow : false,
  77. shanghaiContractDetailShow : false,
  78. formData : null,
  79. warnMessage : '',
  80. maxHeight : 'height:'+ (uni.getSystemInfoSync().screenHeight) +'px',
  81. iconSize : 40,
  82. showButtom : false
  83. }
  84. },
  85. onLoad(option) {
  86. this.processInstanceId = option.processInstanceId;
  87. this.taskId = option.taskId;
  88. this.menuId = option.menuId;
  89. this.businessKey = option.businessKey;
  90. /**--- 北京相关 ---*/
  91. // 合同审批
  92. if (this.menuId == '390001') {
  93. this.contractDetailShow = true;
  94. // 收付款审批
  95. } else if(this.menuId.indexOf('4400001') != -1) {
  96. this.paymentDetailShow = true;
  97. // 入库单审批
  98. } else if (this.menuId == '350003') {
  99. this.financeFlowableShow = true;
  100. }
  101. /**--- 上海相关 ---*/
  102. // 付款审批
  103. else if (this.menuId == '150001') {
  104. this.shanghaiPaymentDetailShow = true;
  105. } else if (this.menuId == '090001') {
  106. this.shanghaiContractDetailShow = true;
  107. }
  108. // 竖屏
  109. if (uni.getSystemInfoSync().screenHeight > uni.getSystemInfoSync().screenWidth) {
  110. this.iconSize = 40;
  111. //#ifdef MP-WEIXIN
  112. this.maxHeight = 'height:'+ (uni.getSystemInfoSync().screenHeight - 100) +'px';
  113. // #endif
  114. //#ifdef H5
  115. this.maxHeight = 'height:'+ (uni.getSystemInfoSync().screenHeight - 50) +'px';
  116. // #endif
  117. } else {
  118. this.iconSize = 15;
  119. this.maxHeight = 'height:'+ (uni.getSystemInfoSync().screenHeight - 35) +'px';
  120. }
  121. this.isMyTask()
  122. },
  123. methods:{
  124. back(){
  125. const eventChannel = this.getOpenerEventChannel()
  126. eventChannel.emit('reloadEvent', {});
  127. uni.navigateBack({});
  128. },
  129. // 提交弹窗
  130. completeTaskModalShow() {
  131. this.getCallBackData();
  132. this.$refs.popup.open()
  133. },
  134. // 任务提交
  135. completeTask(e) {
  136. let self = this;
  137. if (!e) {
  138. this.warnMessage = "请输入审批意见!";
  139. this.$refs.popupWarn.open();
  140. setTimeout(function(){
  141. self.$refs.popup.open()
  142. }, 1000)
  143. return;
  144. }
  145. var fileData = {};
  146. fileData.taskId = this.taskId;
  147. fileData.message = e;
  148. fileData.type = "通过";
  149. if (!!this.formData) {
  150. fileData.formData = JSON.stringify(this.formData);
  151. }
  152. this.flowableRequest({
  153. action: "flow/completeTask",
  154. data : fileData,
  155. success(resData) {
  156. self.$refs.uToast.show({
  157. title: '操作成功!',
  158. type: 'success',
  159. callback(){
  160. self.back();
  161. }
  162. })
  163. }
  164. })
  165. },
  166. // 终止弹窗
  167. deleteTaskModalShow() {
  168. this.getCallBackData();
  169. this.$refs.popupDelete.open();
  170. },
  171. // 流程终止
  172. deleteTask(e) {
  173. var self = this;
  174. if (!e) {
  175. this.warnMessage = "请输入终止原因!";
  176. this.$refs.popupWarn.open();
  177. setTimeout(function(){
  178. self.$refs.popupDelete.open()
  179. }, 1000)
  180. return;
  181. }
  182. var fileData = {};
  183. fileData.processInstanceId = this.processInstanceId;
  184. fileData.reason = e;
  185. if (!!this.formData) {
  186. fileData.formData = JSON.stringify(this.formData);
  187. }
  188. this.flowableRequest({
  189. action: "flow/deleteProcessInstanceById",
  190. data : fileData,
  191. success(resData) {
  192. self.$refs.uToast.show({
  193. title: '操作成功!',
  194. type: 'success',
  195. callback(){
  196. self.back();
  197. }
  198. })
  199. }
  200. })
  201. },
  202. // 审批进度详情
  203. taskDetailOpen(){
  204. uni.navigateTo({
  205. url: '/pages/home/taskDetail?processInstanceId='+this.processInstanceId
  206. });
  207. },
  208. getCallBackData(){
  209. if (this.menuId.indexOf('4400001') != -1) {
  210. this.formData = this.$refs.payRef.getCallBackData();
  211. } else if (this.menuId == '350003') {
  212. this.formData = this.$refs.financeRef.getCallBackData();
  213. } else if (this.menuId == '150001') {
  214. this.formData = this.$refs.shanghaiPaymentRef.getCallBackData();
  215. } else if (this.menuId == '090001') {
  216. this.formData = this.$refs.shanghaiContractRef.getCallBackData();
  217. }
  218. },
  219. isMyTask(){
  220. var self = this;
  221. this.flowableRequest({
  222. action: "flow/isMyTask",
  223. data : {taskId : this.taskId},
  224. success(resData) {
  225. if (resData.data.data != 0) {
  226. self.showButtom = true;
  227. }
  228. }
  229. })
  230. }
  231. },
  232. onResize(res) {
  233. this.maxHeight = 'height:'+res.size.windowHeight+'px';
  234. // 竖屏
  235. if (res.size.windowHeight > res.size.windowWidth) {
  236. this.iconSize = 40;
  237. // 横屏
  238. } else {
  239. this.iconSize = 15;
  240. }
  241. var self = this;
  242. if (this.financeFlowableShow) {
  243. this.financeFlowableShow = false;
  244. setTimeout(function(){
  245. self.financeFlowableShow = true;
  246. }, 300)
  247. } else if(this.contractDetailShow) {
  248. this.contractDetailShow = false;
  249. setTimeout(function(){
  250. self.contractDetailShow = true;
  251. }, 300)
  252. } else if(this.paymentDetailShow) {
  253. this.paymentDetailShow = false;
  254. setTimeout(function(){
  255. self.paymentDetailShow = true;
  256. }, 300)
  257. }
  258. }
  259. };
  260. </script>
  261. <style lang="scss" scoped>
  262. .navigation {
  263. display: flex;
  264. border: solid 2rpx #f2f2f2;
  265. background-color: #ffffff;
  266. padding: 16rpx 0;
  267. width: 100%;
  268. position: fixed;
  269. bottom: -10rpx;
  270. z-index: 2;
  271. .left {
  272. display: flex;
  273. font-size: 9px;
  274. width: 100%;
  275. .item {
  276. margin: auto;
  277. text-align: center;
  278. }
  279. }
  280. }
  281. </style>