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.
 
 
 
 
 
 

353 lines
10 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.FundsApply.ApplyUser" title="填报人" disabled></l-input> -->
  7. <l-select v-model="formData.FundsApply.ApplyUser" :range="dataSource.ApplyUser" title="填报人" disabled></l-select>
  8. <l-select v-model="formData.FundsApply.ApplyDept" :range="dataSource.ApplyDept" title="申报部门" disabled></l-select>
  9. <l-input v-model="formData.FundsApply.ApplyTime" title="时间" disabled></l-input>
  10. <!-- <l-select v-model="formData.FundsApply.IsFixedAssets" :range="dataSource.IsFixedAssets" title="固定资产" disabled></l-select> -->
  11. <l-input :value="IsFixedAssetsitem(formData.FundsApply.IsFixedAssets)" title="固定资产" disabled></l-input>
  12. <l-textarea v-model="formData.FundsApply.Remark" title="备注" readonly/>
  13. <l-input v-model="formData.FundsApply.SumAmount" title="总金额" disabled></l-input>
  14. <l-input v-model="formData.FundsApply.UpperAmount" title="人民币大写" disabled></l-input>
  15. <view class="welT" style="padding-top: 10px;">
  16. 明细
  17. </view>
  18. <view class="welBox" id="StuInfoFreshEmergePeople" v-show="FundsApplyDetail.length != 0">
  19. <view class="welCon" v-for="(item, i) in FundsApplyDetail" :key='i'>
  20. <l-input v-model="item.ProjectContent" title="项目内容" placeholder="请填写" disabled right />
  21. <l-input v-model="item.Number" type="number" @change="SumAmountChange(item)" title="数量" disabled placeholder="请填写" right />
  22. <l-input v-model="item.Price" type="number" @change="SumAmountChange(item)" title="单价(元)" disabled placeholder="请填写" right />
  23. <l-input v-model="item.Amount" title="金额(元)" disabled placeholder="请填写" right />
  24. </view>
  25. </view>
  26. <l-workflow-action
  27. @audit="audit"
  28. @action="action"
  29. :type="type"
  30. :currentNode="currentNode"
  31. :currentTask="currentTask"
  32. />
  33. </view>
  34. <view v-if="ready && tab == 1" class="progress"><l-workflow-timeline :processList="processList" /></view>
  35. <!-- <view class="padding-sm text-grey notice-info">
  36. <view class="text-right">本页内容发布于 {{ time }}</view>
  37. <view class="text-right">{{ date }}</view>
  38. </view> -->
  39. </view>
  40. </template>
  41. <script>
  42. import moment from 'moment'
  43. import workflowFormMixins from '@/pages/nworkflow/workflow.js'
  44. export default {
  45. mixins: [workflowFormMixins],
  46. data() {
  47. return {
  48. tab:0,
  49. type:'view',
  50. currentNode:null,
  51. currentTask:null,
  52. taskId:'',
  53. processId:'',
  54. processInfo:null,
  55. processList:[],
  56. formData:{},
  57. ready: false,
  58. content: '',
  59. time: '',
  60. date: '',
  61. fileList:[],
  62. // 数据源
  63. dataSource: {
  64. ApplyDept: [],
  65. ApplyUser: [],
  66. IsFixedAssets: []
  67. },
  68. FundsApplyDetail: [],
  69. FundsApplyDetails: {
  70. ProjectContent: '',
  71. Number: '',
  72. Price: '',
  73. Amount: ''
  74. },
  75. }
  76. },
  77. async onLoad({type}) {
  78. await this.init(type)
  79. },
  80. methods: {
  81. async init(type) {
  82. if(type){this.type = type}
  83. await Promise.all([
  84. this.FETCH_DATASOURCE('classdata').then(result => {
  85. this.dataSource.ApplyDept = result.data.map(t => ({
  86. text: t.name,
  87. value: t.id
  88. }));
  89. }),
  90. this.FETCH_DATASOURCE('teacheruserdata').then(result => {
  91. this.dataSource.ApplyUser = result.data.map(t => ({
  92. text: t.f_realname,
  93. value: t.f_userid
  94. }));
  95. }),
  96. this.dataSource.IsFixedAssets = Object.values(this.GET_GLOBAL('dataDictionary').YesOrNoInt).map(t => ({
  97. value: t.value,
  98. text: t.text
  99. }))
  100. ])
  101. console.log(this.dataSource.IsFixedAssets)
  102. this.LOADING('加载中…')
  103. const noticeItem = this.GET_PARAM()
  104. this.processList = noticeItem.logList
  105. this.currentNode = noticeItem.currentNode
  106. this.currentTask = noticeItem.currentTask
  107. this.processInfo = noticeItem.processInfo
  108. this.taskId = this.currentTask.F_TaskId
  109. this.processId = this.currentTask.F_Id
  110. this.formValue = noticeItem.formValue
  111. this.scheme = noticeItem.scheme
  112. console.log(this.processList[0].F_ProcessId)
  113. await this.getFormData(this.processList[0].F_ProcessId)
  114. this.HIDE_LOADING();
  115. // this.content = this.CONVERT_HTML(noticeItem.f_content)
  116. // this.time = moment(noticeItem.f_time).format('HH : mm')
  117. // this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日')
  118. // this.SET_TITLE(noticeItem.f_title)
  119. // this.HIDE_LOADING()
  120. },
  121. // 获取表单数据
  122. getFormData(ProcessId){
  123. return this.HTTP_GET("learun/adms/FundsApply/shList",{ProcessId},"加载数据时出错").then(async res=>{
  124. if(res){
  125. // res.F_SourceName = res.F_SourceName&&this.GET_GLOBAL('department')[res.F_SourceName]? this.GET_GLOBAL('department')[res.F_SourceName].name : res.F_SourceName
  126. this.formData = res
  127. let FundsApplyDetailitem = res.FundsApplyDetail
  128. if(FundsApplyDetailitem.length>0){
  129. for(let i=0;i<FundsApplyDetailitem.length;i++){
  130. FundsApplyDetailitem[i].Price = Number(FundsApplyDetailitem[i].Price).toFixed(2)
  131. FundsApplyDetailitem[i].Amount = Number(FundsApplyDetailitem[i].Amount).toFixed(2)
  132. }
  133. }
  134. this.FundsApplyDetail = res.FundsApplyDetail
  135. let fileList = await this.getFileListById(res.F_NewsImage)
  136. if(fileList&&fileList.length){
  137. this.fileList = [fileList[0]]
  138. }
  139. this.content = res.F_NewsContent
  140. this.ready = true
  141. }
  142. })
  143. },
  144. // 点击审批相关按钮
  145. async audit(action) {
  146. this.LOADING('加载中…')
  147. const currentTask = this.processInfo.task.find(t => t.F_NodeId === this.currentNode.id)
  148. const postData = await this.getPostData(this.formValue, this.scheme)
  149. const pageParam = {
  150. type: 'sign',
  151. processId: currentTask.F_ProcessId,
  152. taskId: currentTask.F_Id,
  153. formreq: postData.formreq,
  154. taskName: this.currentTask.F_Title,
  155. currentNode:this.currentNode,
  156. code:this.code||''
  157. }
  158. // 不是加签
  159. if (action.code !== '__sign__') {
  160. Object.assign(pageParam, action)
  161. pageParam.type = 'verify'
  162. pageParam.auditors = JSON.stringify({})
  163. pageParam.isFromSignAudit = Number(this.currentTask.F_TaskType) === 3
  164. }
  165. this.HIDE_LOADING()
  166. this.NAV_TO('/pages/nworkflow/myflow/sign', pageParam, true)
  167. },
  168. // 点击操作按钮(非审批类按钮)
  169. async action(taskType) {
  170. switch (taskType) {
  171. // 点击「催办」/「撤销流程」/「标记已阅」按钮
  172. case 'urge':
  173. case 'revoke':
  174. case 'refer':
  175. const actionText = { urge: '催办', revoke: '撤销', refer: '已阅' }[taskType]
  176. const actionUrl = { urge: '/urge', revoke: '/revoke', refer: '/refer' }[taskType]
  177. let actionData = this.processId
  178. if (taskType === 'refer') {
  179. actionData = { processId: this.processId, taskId: this.taskId }
  180. }
  181. if (!(await this.CONFIRM(`${actionText}确认`, `确定要提交${actionText}吗?`, true))) {
  182. return
  183. }
  184. this.LOADING(`提交${actionText}中…`)
  185. this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => {
  186. this.HIDE_LOADING()
  187. if (success) {
  188. this.EMIT('task-list-change')
  189. this.TOAST(`成功提交${actionText}`, 'success')
  190. if (taskType === 'revoke') {
  191. this.NAV_BACK()
  192. }
  193. }
  194. })
  195. break
  196. // 点击「提交草稿」按钮
  197. case 'draft':
  198. this.CONFIRM('不支持此操作')
  199. return
  200. if (!(await this.CONFIRM('提交确认', '确定要提交草稿吗?', true))) {
  201. return
  202. }
  203. this.LOADING('正在提交…')
  204. const draftFormValue = this.$refs.form.getFormValue()
  205. const draftPostData = await this.getPostData(draftFormValue, this.scheme)
  206. this.HTTP_POST('/newwf​/draft', draftPostData, '提交草稿失败').then(success => {
  207. this.HIDE_LOADING()
  208. if (success) {
  209. this.EMIT('task-list-change')
  210. this.NAV_BACK()
  211. this.TOAST('草稿已保存', 'success')
  212. }
  213. })
  214. break
  215. // 点击「发起流程」按钮
  216. case 'submit':
  217. this.CONFIRM('不支持此操作')
  218. return
  219. const verifyResult = this.$refs.form.verifyValue()
  220. if (verifyResult.length > 0) {
  221. this.CONFIRM('表单验证失败', verifyResult.join('\n'))
  222. return
  223. }
  224. if (!(await this.CONFIRM('提交确认', '确定要发起流程吗?', true))) {
  225. return
  226. }
  227. this.LOADING('正在提交…')
  228. const formValue = this.$refs.form.getFormValue()
  229. const postData = await this.getPostData(formValue, this.scheme)
  230. postData.auditors = JSON.stringify({})
  231. if (this.type === 'child') {
  232. postData.parentProcessId = this.processId
  233. postData.parentTaskId = this.taskId
  234. }
  235. const errorTips = '流程发起失败'
  236. this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => {
  237. this.HIDE_LOADING()
  238. if (success) {
  239. this.EMIT('task-list-change')
  240. this.NAV_BACK()
  241. this.TOAST('流程发起成功', 'success')
  242. }
  243. })
  244. break
  245. default:
  246. break
  247. }
  248. },
  249. IsFixedAssetsitem(data){
  250. if(data == 0){
  251. return '否'
  252. }else{
  253. return '是'
  254. }
  255. }
  256. }
  257. }
  258. </script>
  259. <style lang="less" scoped>
  260. .welT {
  261. font-size: 16px;
  262. line-height: 26px;
  263. padding: 0 12px;
  264. background-color: #ffffff;
  265. padding-bottom: 12px;
  266. }
  267. .welT text {
  268. width: 26px;
  269. height: 26px;
  270. line-height: 24px;
  271. border: 1px solid #efefef;
  272. border-radius: 4px;
  273. float: right;
  274. text-align: center;
  275. color: #999;
  276. }
  277. .welBox {
  278. // margin-top: 10px;
  279. }
  280. .welCon {
  281. padding: 10px;
  282. border: 1px solid #efefef;
  283. padding-top: 18px;
  284. border-radius: 4px;
  285. position: relative;
  286. // background-color: #ffffff;
  287. margin-top: 15px;
  288. }
  289. .welDel {
  290. border-radius: 50%;
  291. position: absolute;
  292. top: 4px;
  293. left: 0px;
  294. background: #fff;
  295. }
  296. .welDel text {
  297. text-align: center;
  298. width: 26px;
  299. height: 26px;
  300. display: block;
  301. line-height: 24px;
  302. border: 1px solid #efefef;
  303. border-radius: 50%;
  304. }
  305. .welImgAdd {
  306. text-align: center;
  307. line-height: 0;
  308. }
  309. .passwordDes {
  310. color: #606266;
  311. font-size: 14px;
  312. padding: 8px;
  313. text-indent: 2em;
  314. }
  315. </style>