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.
 
 
 
 
 
 

220 lines
7.5 KiB

  1. <template>
  2. <view id="notice" class="page">
  3. <!-- 顶部页签 -->
  4. <l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
  5. <view v-if="ready && tab == 0">
  6. <l-input v-model="formData.F_FullHead" title="公告标题" disabled></l-input>
  7. <l-select v-model="formData.IsSend" :range="[{value:'1',text:'是'},{value:'0',text:'否'}]" title="下发官网" disabled></l-select>
  8. <l-input v-model="formData.F_Category" title="公告类别" disabled></l-input>
  9. <l-input v-model="formData.F_ReleaseTime" title="发布时间" disabled></l-input>
  10. <l-input v-model="formData.F_SourceName" title="信息来源" disabled></l-input>
  11. <l-input v-model="formData.F_SourceAddress" title="来源地址" disabled></l-input>
  12. <l-input v-model="formData.F_SendDeptId" title="接收部门" disabled></l-input>
  13. <l-input v-model="formData.F_SendPostId" title="接受岗位" disabled></l-input>
  14. <l-select v-model="formData.F_IsSendFX" :range="[{value:true,text:'是'},{value:false,text:'否'}]" title="下发飞星" disabled></l-select>
  15. <l-upload-file
  16. :value="fileList"
  17. :readonly="true"
  18. title="标题图片"
  19. />
  20. <!-- :number="9" -->
  21. <!-- @input="setValue('MeetingManagement.Files', $event)" -->
  22. <l-input title="公告内容" disabled style="border-bottom: none;"></l-input>
  23. <view class="padding text-lg" style="background-color: #fff;">
  24. <!-- <u-parse v-if="ready" :imageProp="{ domain: apiRoot }" :content="content"></u-parse> -->
  25. <iframe v-if="ready" style="width: 100%;height: 50vh;" :src="CONFIG('webHost')+'/Utility/ListContentView?keyValue='+formData.F_NewsId" frameborder="0"></iframe>
  26. </view>
  27. <l-workflow-action
  28. @audit="audit"
  29. @action="action"
  30. :type="type"
  31. :currentNode="currentNode"
  32. :currentTask="currentTask"
  33. />
  34. </view>
  35. <view v-if="ready && tab == 1" class="progress"><l-workflow-timeline :processList="processList" /></view>
  36. <!-- <view class="padding-sm text-grey notice-info">
  37. <view class="text-right">本页内容发布于 {{ time }}</view>
  38. <view class="text-right">{{ date }}</view>
  39. </view> -->
  40. </view>
  41. </template>
  42. <script>
  43. import moment from 'moment'
  44. import workflowFormMixins from '@/pages/nworkflow/workflow.js'
  45. export default {
  46. mixins: [workflowFormMixins],
  47. data() {
  48. return {
  49. tab:0,
  50. type:'view',
  51. currentNode:null,
  52. currentTask:null,
  53. taskId:'',
  54. processId:'',
  55. processInfo:null,
  56. processList:[],
  57. formData:{},
  58. ready: false,
  59. content: '',
  60. time: '',
  61. date: '',
  62. fileList:[],
  63. }
  64. },
  65. async onLoad({type}) {
  66. await this.init(type)
  67. },
  68. methods: {
  69. async init(type) {
  70. if(type){this.type = type}
  71. this.LOADING('加载中…')
  72. const noticeItem = this.GET_PARAM()
  73. this.processList = noticeItem.logList
  74. this.currentNode = noticeItem.currentNode
  75. this.currentTask = noticeItem.currentTask
  76. this.processInfo = noticeItem.processInfo
  77. this.taskId = this.currentTask.F_TaskId
  78. this.processId = this.currentTask.F_Id
  79. this.formValue = noticeItem.formValue
  80. this.scheme = noticeItem.scheme
  81. await this.getFormData(this.processList[0].F_ProcessId)
  82. this.HIDE_LOADING();
  83. // this.content = this.CONVERT_HTML(noticeItem.f_content)
  84. // this.time = moment(noticeItem.f_time).format('HH : mm')
  85. // this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日')
  86. // this.SET_TITLE(noticeItem.f_title)
  87. // this.HIDE_LOADING()
  88. },
  89. // 获取表单数据
  90. getFormData(ProgressId){
  91. return this.HTTP_GET("learun/news/shList",{ProgressId},"加载数据时出错").then(async res=>{
  92. if(res){
  93. this.formData = res
  94. let fileList = await this.getFileListById(res.F_NewsImage)
  95. if(fileList&&fileList.length){
  96. this.fileList = [fileList[0]]
  97. }
  98. this.content = res.F_NewsContent
  99. this.ready = true
  100. }
  101. })
  102. },
  103. // 点击审批相关按钮
  104. async audit(action) {
  105. this.LOADING('加载中…')
  106. const currentTask = this.processInfo.task.find(t => t.F_NodeId === this.currentNode.id)
  107. const postData = await this.getPostData(this.formValue, this.scheme)
  108. const pageParam = {
  109. type: 'sign',
  110. processId: currentTask.F_ProcessId,
  111. taskId: currentTask.F_Id,
  112. formreq: postData.formreq,
  113. taskName: this.currentTask.F_Title
  114. }
  115. // 不是加签
  116. if (action.code !== '__sign__') {
  117. Object.assign(pageParam, action)
  118. pageParam.type = 'verify'
  119. pageParam.auditors = JSON.stringify({})
  120. pageParam.isFromSignAudit = Number(this.currentTask.F_TaskType) === 3
  121. }
  122. this.HIDE_LOADING()
  123. this.NAV_TO('/pages/nworkflow/myflow/sign', pageParam, true)
  124. },
  125. // 点击操作按钮(非审批类按钮)
  126. async action(taskType) {
  127. switch (taskType) {
  128. // 点击「催办」/「撤销流程」/「标记已阅」按钮
  129. case 'urge':
  130. case 'revoke':
  131. case 'refer':
  132. const actionText = { urge: '催办', revoke: '撤销', refer: '已阅' }[taskType]
  133. const actionUrl = { urge: '/urge', revoke: '/revoke', refer: '/refer' }[taskType]
  134. let actionData = this.processId
  135. if (taskType === 'refer') {
  136. actionData = { processId: this.processId, taskId: this.taskId }
  137. }
  138. if (!(await this.CONFIRM(`${actionText}确认`, `确定要提交${actionText}吗?`, true))) {
  139. return
  140. }
  141. this.LOADING(`提交${actionText}中…`)
  142. this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => {
  143. this.HIDE_LOADING()
  144. if (success) {
  145. this.EMIT('task-list-change')
  146. this.TOAST(`成功提交${actionText}`, 'success')
  147. if (taskType === 'revoke') {
  148. this.NAV_BACK()
  149. }
  150. }
  151. })
  152. break
  153. // 点击「提交草稿」按钮
  154. case 'draft':
  155. this.CONFIRM('不支持此操作')
  156. return
  157. if (!(await this.CONFIRM('提交确认', '确定要提交草稿吗?', true))) {
  158. return
  159. }
  160. this.LOADING('正在提交…')
  161. const draftFormValue = this.$refs.form.getFormValue()
  162. const draftPostData = await this.getPostData(draftFormValue, this.scheme)
  163. this.HTTP_POST('/newwf​/draft', draftPostData, '提交草稿失败').then(success => {
  164. this.HIDE_LOADING()
  165. if (success) {
  166. this.EMIT('task-list-change')
  167. this.NAV_BACK()
  168. this.TOAST('草稿已保存', 'success')
  169. }
  170. })
  171. break
  172. // 点击「发起流程」按钮
  173. case 'submit':
  174. this.CONFIRM('不支持此操作')
  175. return
  176. const verifyResult = this.$refs.form.verifyValue()
  177. if (verifyResult.length > 0) {
  178. this.CONFIRM('表单验证失败', verifyResult.join('\n'))
  179. return
  180. }
  181. if (!(await this.CONFIRM('提交确认', '确定要发起流程吗?', true))) {
  182. return
  183. }
  184. this.LOADING('正在提交…')
  185. const formValue = this.$refs.form.getFormValue()
  186. const postData = await this.getPostData(formValue, this.scheme)
  187. postData.auditors = JSON.stringify({})
  188. if (this.type === 'child') {
  189. postData.parentProcessId = this.processId
  190. postData.parentTaskId = this.taskId
  191. }
  192. const errorTips = '流程发起失败'
  193. this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => {
  194. this.HIDE_LOADING()
  195. if (success) {
  196. this.EMIT('task-list-change')
  197. this.NAV_BACK()
  198. this.TOAST('流程发起成功', 'success')
  199. }
  200. })
  201. break
  202. default:
  203. break
  204. }
  205. },
  206. }
  207. }
  208. </script>