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.
 
 
 
 
 
 

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