|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- <template>
- <view id="notice" class="page">
- <!-- 顶部页签 -->
- <l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
- <view v-if="ready && tab == 0">
- <l-input v-model="formData.CreateUserNo" title="学号" disabled></l-input>
- <l-input v-model="formData.CreateUserName" title="姓名" disabled></l-input>
- <!-- <l-select v-model="formData.CreateUserNo" :range="dataSource.ApplyUser" title="学生" disabled></l-select> -->
- <l-select v-model="formData.LeaveType" :range="dataSource.LeaveType" title="请假类型" disabled></l-select>
- <l-input :value="timeFormat(formData.StartTime)" title="开始时间" disabled></l-input>
- <l-input :value="timeFormat(formData.EndTime)" title="结束时间" disabled></l-input>
- <l-input v-model="formData.LeaveDay" title="请假天数" disabled></l-input>
- <l-input v-model="formData.LeaveReason" title="请假事由" disabled></l-input>
- <l-input v-model="formData.CreateTime" title="申请时间" disabled></l-input>
- <l-select v-model="formData.ClassNo" :range="dataSource.ClassNo" title="班级" disabled></l-select>
- <l-select v-model="formData.DeptNo" :range="dataSource.DeptNo" title="系部" disabled></l-select>
- <l-select v-model="formData.MajorNo" :range="dataSource.MajorNo" title="专业" disabled></l-select>
- <l-select v-model="formData.ClassDiredctorNo" :range="dataSource.ClassDiredctorNo" title="班主任" disabled></l-select>
- <l-select v-model="formData.ClassTutorNo" :range="dataSource.ClassTutorNo" title="辅导员" disabled></l-select>
-
-
-
-
-
- <!-- <l-select v-model="formData.FundsApply.IsFixedAssets" :range="dataSource.IsFixedAssets" title="固定资产" disabled></l-select> -->
- <!-- <l-input :value="IsFixedAssetsitem(formData.FundsApply.IsFixedAssets)" title="固定资产" disabled></l-input>
- <l-textarea v-model="formData.FundsApply.Remark" title="备注" readonly/>
- <l-input v-model="formData.FundsApply.SumAmount" title="总金额" disabled></l-input>
- <l-input v-model="formData.FundsApply.UpperAmount" title="人民币大写" disabled></l-input> -->
-
-
- <l-workflow-action
- @audit="audit"
- @action="action"
- :type="type"
- :currentNode="currentNode"
- :currentTask="currentTask"
- />
-
-
-
-
-
- </view>
- <view v-if="ready && tab == 1" class="progress"><l-workflow-timeline :processList="processList" /></view>
- <!-- <view class="padding-sm text-grey notice-info">
- <view class="text-right">本页内容发布于 {{ time }}</view>
- <view class="text-right">{{ date }}</view>
- </view> -->
- </view>
- </template>
-
- <script>
- import moment from 'moment'
- import workflowFormMixins from '@/pages/nworkflow/workflow.js'
-
- export default {
- mixins: [workflowFormMixins],
- data() {
- return {
- tab:0,
- type:'view',
- currentNode:null,
- currentTask:null,
- taskId:'',
- processId:'',
- processInfo:null,
- processList:[],
- formData:{},
- ready: false,
- content: '',
-
- time: '',
- date: '',
- fileList:[],
-
- // 数据源
- dataSource: {
- ApplyDept: [],
- ApplyUser: [],
- IsFixedAssets: [],
- LeaveType: Object.values(this.GET_GLOBAL('dataDictionary').LeaveType).map(t => ({
- value: t.value,
- text: t.text
- })),
- ClassNo:[],
- DeptNo:[],
- MajorNo:[],
- ClassDiredctorNo:[],
- ClassTutorNo:[],
- },
-
- FundsApplyDetail: [],
- FundsApplyDetails: {
- ProjectContent: '',
- Number: '',
- Price: '',
- Amount: ''
- },
-
-
- }
- },
-
- async onLoad({type}) {
- await this.init(type)
- },
-
- methods: {
- async init(type) {
- if(type){this.type = type}
-
-
- await Promise.all([
- this.FETCH_DATASOURCE('classdata').then(result => {
- this.dataSource.ApplyDept = result.data.map(t => ({
- text: t.name,
- value: t.id
- }));
- }),
- this.FETCH_DATASOURCE('StuInfoBasic').then(result => {
- this.dataSource.ApplyUser = result.data.map(t => ({
- text: t.f_realname,
- value: t.f_userid
- }));
- }),
- this.dataSource.IsFixedAssets = Object.values(this.GET_GLOBAL('dataDictionary').YesOrNoInt).map(t => ({
- value: t.value,
- text: t.text
- })),
- this.FETCH_DATASOURCE('bjsj').then(result => {
- this.dataSource.ClassNo = result.data.map(t => ({
- text: t.classname,
- value: t.classno
- }));
- }),
- this.FETCH_DATASOURCE('CdDeptInfo').then(result => {
- this.dataSource.DeptNo = result.data.map(t => ({ text: t.deptname, value: t.deptno }));
- }),
- this.FETCH_DATASOURCE('CdMajorInfo').then(result => {
- this.dataSource.MajorNo = result.data.map(t => ({ text: t.majorname, value: t.majorno }));
- }),
- this.FETCH_DATASOURCE('EmpInfo').then(result => {
- this.dataSource.ClassDiredctorNo = result.data.sort((a,b)=>{return b.classno-a.classno}).map(t => ({ text: t.empname, value: t.empno }));
- }),
- this.FETCH_DATASOURCE('EmpInfo').then(result => {
- this.dataSource.ClassTutorNo = result.data.sort((a,b)=>{return b.classno-a.classno}).map(t => ({ text: t.empname, value: t.empno }));
- }),
-
-
-
-
- ])
-
- this.LOADING('加载中…')
- const noticeItem = this.GET_PARAM()
- this.processList = noticeItem.logList
- this.currentNode = noticeItem.currentNode
- this.currentTask = noticeItem.currentTask
- this.processInfo = noticeItem.processInfo
- this.taskId = this.currentTask.F_TaskId
- this.processId = this.currentTask.F_Id
- this.formValue = noticeItem.formValue
- this.scheme = noticeItem.scheme
- // console.log(this.processList[0].F_ProcessId)
- await this.getFormData(this.processList[0].F_ProcessId)
-
-
- // this.content = this.CONVERT_HTML(noticeItem.f_content)
-
- // this.time = moment(noticeItem.f_time).format('HH : mm')
- // this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日')
- // this.SET_TITLE(noticeItem.f_title)
- // this.HIDE_LOADING()
- },
- // 获取表单数据
- getFormData(ProcessId){
- return this.HTTP_GET("Learun/adms/EducationalAdministration/StuLeaveManagement/shList",{ProcessId},"加载数据时出错").then(async res=>{
- if(res){
- // res.F_SourceName = res.F_SourceName&&this.GET_GLOBAL('department')[res.F_SourceName]? this.GET_GLOBAL('department')[res.F_SourceName].name : res.F_SourceName
- this.formData = res.stuLeaveManagement
- console.log(this.formData)
- this.HIDE_LOADING();
- // let FundsApplyDetailitem = res.FundsApplyDetail
- // if(FundsApplyDetailitem.length>0){
- // for(let i=0;i<FundsApplyDetailitem.length;i++){
- // FundsApplyDetailitem[i].Price = Number(FundsApplyDetailitem[i].Price).toFixed(2)
- // FundsApplyDetailitem[i].Amount = Number(FundsApplyDetailitem[i].Amount).toFixed(2)
- // }
- // }
- // this.FundsApplyDetail = res.FundsApplyDetail
- // let fileList = await this.getFileListById(res.F_NewsImage)
- // if(fileList&&fileList.length){
- // this.fileList = [fileList[0]]
- // }
- this.ready = true
- }
- })
- },
-
- // 点击审批相关按钮
- async audit(action) {
- this.LOADING('加载中…')
- const currentTask = this.processInfo.task.find(t => t.F_NodeId === this.currentNode.id)
- const postData = await this.getPostData(this.formValue, this.scheme)
- const pageParam = {
- type: 'sign',
- processId: currentTask.F_ProcessId,
- taskId: currentTask.F_Id,
- formreq: postData.formreq,
- taskName: this.currentTask.F_Title,
- currentNode:this.currentNode,
- code:this.code||''
- }
- // 不是加签
- if (action.code !== '__sign__') {
- Object.assign(pageParam, action)
- pageParam.type = 'verify'
- pageParam.auditors = JSON.stringify({})
- pageParam.isFromSignAudit = Number(this.currentTask.F_TaskType) === 3
- }
- this.HIDE_LOADING()
- this.NAV_TO('/pages/nworkflow/myflow/sign', pageParam, true)
- },
- // 点击操作按钮(非审批类按钮)
- async action(taskType) {
- switch (taskType) {
- // 点击「催办」/「撤销流程」/「标记已阅」按钮
- case 'urge':
- case 'revoke':
- case 'refer':
- const actionText = { urge: '催办', revoke: '撤销', refer: '已阅' }[taskType]
- const actionUrl = { urge: '/urge', revoke: '/revoke', refer: '/refer' }[taskType]
-
- let actionData = this.processId
- if (taskType === 'refer') {
- actionData = { processId: this.processId, taskId: this.taskId }
- }
-
- if (!(await this.CONFIRM(`${actionText}确认`, `确定要提交${actionText}吗?`, true))) {
- return
- }
- this.LOADING(`提交${actionText}中…`)
- this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => {
- this.HIDE_LOADING()
- if (success) {
- this.EMIT('task-list-change')
- this.TOAST(`成功提交${actionText}`, 'success')
- if (taskType === 'revoke') {
- this.NAV_BACK()
- }
- }
- })
- break
- // 点击「提交草稿」按钮
- case 'draft':
- this.CONFIRM('不支持此操作')
- return
- if (!(await this.CONFIRM('提交确认', '确定要提交草稿吗?', true))) {
- return
- }
- this.LOADING('正在提交…')
- const draftFormValue = this.$refs.form.getFormValue()
- const draftPostData = await this.getPostData(draftFormValue, this.scheme)
- this.HTTP_POST('/newwf/draft', draftPostData, '提交草稿失败').then(success => {
- this.HIDE_LOADING()
- if (success) {
- this.EMIT('task-list-change')
- this.NAV_BACK()
- this.TOAST('草稿已保存', 'success')
- }
- })
- break
- // 点击「发起流程」按钮
- case 'submit':
- this.CONFIRM('不支持此操作')
- return
- const verifyResult = this.$refs.form.verifyValue()
- if (verifyResult.length > 0) {
- this.CONFIRM('表单验证失败', verifyResult.join('\n'))
- return
- }
- if (!(await this.CONFIRM('提交确认', '确定要发起流程吗?', true))) {
- return
- }
- this.LOADING('正在提交…')
- const formValue = this.$refs.form.getFormValue()
- const postData = await this.getPostData(formValue, this.scheme)
- postData.auditors = JSON.stringify({})
-
- if (this.type === 'child') {
- postData.parentProcessId = this.processId
- postData.parentTaskId = this.taskId
- }
- const errorTips = '流程发起失败'
- this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => {
- this.HIDE_LOADING()
- if (success) {
- this.EMIT('task-list-change')
- this.NAV_BACK()
- this.TOAST('流程发起成功', 'success')
- }
- })
- break
- default:
- break
- }
- },
- IsFixedAssetsitem(data){
- if(data == 0){
- return '否'
- }else{
- return '是'
- }
- },
- //方法
- timeFormat(date){
- let newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(date)
- return newDate[0]
- }
- }
- }
- </script>
-
- <style lang="less" scoped>
- .welT {
- font-size: 16px;
- line-height: 26px;
- padding: 0 12px;
- background-color: #ffffff;
- padding-bottom: 12px;
- }
-
- .welT text {
- width: 26px;
- height: 26px;
- line-height: 24px;
- border: 1px solid #efefef;
- border-radius: 4px;
- float: right;
- text-align: center;
- color: #999;
- }
-
- .welBox {
- // margin-top: 10px;
- }
-
- .welCon {
- padding: 10px;
- border: 1px solid #efefef;
- padding-top: 18px;
- border-radius: 4px;
- position: relative;
- // background-color: #ffffff;
- margin-top: 15px;
- }
-
- .welDel {
- border-radius: 50%;
- position: absolute;
- top: 4px;
- left: 0px;
- background: #fff;
- }
-
- .welDel text {
- text-align: center;
- width: 26px;
- height: 26px;
- display: block;
- line-height: 24px;
- border: 1px solid #efefef;
- border-radius: 50%;
- }
-
- .welImgAdd {
- text-align: center;
- line-height: 0;
- }
-
- .passwordDes {
- color: #606266;
- font-size: 14px;
- padding: 8px;
- text-indent: 2em;
- }
- </style>
|