25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

223 lines
7.7 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. res.F_SourceName = res.F_SourceName&&this.GET_GLOBAL('department')[res.F_SourceName]? this.GET_GLOBAL('department')[res.F_SourceName].name : res.F_SourceName
  94. this.formData = res
  95. let fileList = await this.getFileListById(res.F_NewsImage)
  96. if(fileList&&fileList.length){
  97. this.fileList = [fileList[0]]
  98. }
  99. this.content = res.F_NewsContent
  100. this.ready = true
  101. }
  102. })
  103. },
  104. // 点击审批相关按钮
  105. async audit(action) {
  106. this.LOADING('加载中…')
  107. const currentTask = this.processInfo.task.find(t => t.F_NodeId === this.currentNode.id)
  108. const postData = await this.getPostData(this.formValue, this.scheme)
  109. const pageParam = {
  110. type: 'sign',
  111. processId: currentTask.F_ProcessId,
  112. taskId: currentTask.F_Id,
  113. formreq: postData.formreq,
  114. taskName: this.currentTask.F_Title,
  115. currentNode:this.currentNode,
  116. code:this.code||''
  117. }
  118. // 不是加签
  119. if (action.code !== '__sign__') {
  120. Object.assign(pageParam, action)
  121. pageParam.type = 'verify'
  122. pageParam.auditors = JSON.stringify({})
  123. pageParam.isFromSignAudit = Number(this.currentTask.F_TaskType) === 3
  124. }
  125. this.HIDE_LOADING()
  126. this.NAV_TO('/pages/nworkflow/myflow/sign', pageParam, true)
  127. },
  128. // 点击操作按钮(非审批类按钮)
  129. async action(taskType) {
  130. switch (taskType) {
  131. // 点击「催办」/「撤销流程」/「标记已阅」按钮
  132. case 'urge':
  133. case 'revoke':
  134. case 'refer':
  135. const actionText = { urge: '催办', revoke: '撤销', refer: '已阅' }[taskType]
  136. const actionUrl = { urge: '/urge', revoke: '/revoke', refer: '/refer' }[taskType]
  137. let actionData = this.processId
  138. if (taskType === 'refer') {
  139. actionData = { processId: this.processId, taskId: this.taskId }
  140. }
  141. if (!(await this.CONFIRM(`${actionText}确认`, `确定要提交${actionText}吗?`, true))) {
  142. return
  143. }
  144. this.LOADING(`提交${actionText}中…`)
  145. this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => {
  146. this.HIDE_LOADING()
  147. if (success) {
  148. this.EMIT('task-list-change')
  149. this.TOAST(`成功提交${actionText}`, 'success')
  150. if (taskType === 'revoke') {
  151. this.NAV_BACK()
  152. }
  153. }
  154. })
  155. break
  156. // 点击「提交草稿」按钮
  157. case 'draft':
  158. this.CONFIRM('不支持此操作')
  159. return
  160. if (!(await this.CONFIRM('提交确认', '确定要提交草稿吗?', true))) {
  161. return
  162. }
  163. this.LOADING('正在提交…')
  164. const draftFormValue = this.$refs.form.getFormValue()
  165. const draftPostData = await this.getPostData(draftFormValue, this.scheme)
  166. this.HTTP_POST('/newwf​/draft', draftPostData, '提交草稿失败').then(success => {
  167. this.HIDE_LOADING()
  168. if (success) {
  169. this.EMIT('task-list-change')
  170. this.NAV_BACK()
  171. this.TOAST('草稿已保存', 'success')
  172. }
  173. })
  174. break
  175. // 点击「发起流程」按钮
  176. case 'submit':
  177. this.CONFIRM('不支持此操作')
  178. return
  179. const verifyResult = this.$refs.form.verifyValue()
  180. if (verifyResult.length > 0) {
  181. this.CONFIRM('表单验证失败', verifyResult.join('\n'))
  182. return
  183. }
  184. if (!(await this.CONFIRM('提交确认', '确定要发起流程吗?', true))) {
  185. return
  186. }
  187. this.LOADING('正在提交…')
  188. const formValue = this.$refs.form.getFormValue()
  189. const postData = await this.getPostData(formValue, this.scheme)
  190. postData.auditors = JSON.stringify({})
  191. if (this.type === 'child') {
  192. postData.parentProcessId = this.processId
  193. postData.parentTaskId = this.taskId
  194. }
  195. const errorTips = '流程发起失败'
  196. this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => {
  197. this.HIDE_LOADING()
  198. if (success) {
  199. this.EMIT('task-list-change')
  200. this.NAV_BACK()
  201. this.TOAST('流程发起成功', 'success')
  202. }
  203. })
  204. break
  205. default:
  206. break
  207. }
  208. },
  209. }
  210. }
  211. </script>