Pārlūkot izejas kodu

app 采购审批流程页面

娄底高职分支
yxq pirms 1 gada
vecāks
revīzija
9e4683bc0a
11 mainītis faili ar 2471 papildinājumiem un 9 dzēšanām
  1. +48
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  2. +261
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Edu/singleFlow.vue
  3. +261
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Info/singleFlow.vue
  4. +261
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Logistic/singleFlow.vue
  5. +261
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Other/singleFlow.vue
  6. +1
    -9
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Print/singleFlow.vue
  7. +262
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Service/singleFlow.vue
  8. +269
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Student/singleFlow.vue
  9. +254
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Travel/singleFlow.vue
  10. +269
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Work/singleFlow.vue
  11. +324
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsapplyManagement/Purchase_Edu_Apply/singleFlow.vue

+ 48
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json Parādīt failu

@@ -1069,6 +1069,12 @@
"navigationBarTitleText": "办公采购申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Work/singleFlow",
"style": {
"navigationBarTitleText": "办公采购"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Logistic/list",
"style": {
@@ -1081,6 +1087,12 @@
"navigationBarTitleText": "后勤采购申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Logistic/singleFlow",
"style": {
"navigationBarTitleText": "后勤采购"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Info/list",
"style": {
@@ -1093,6 +1105,12 @@
"navigationBarTitleText": "信息采购申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Info/singleFlow",
"style": {
"navigationBarTitleText": "信息采购"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Student/list",
"style": {
@@ -1105,6 +1123,12 @@
"navigationBarTitleText": "学生采购申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Student/singleFlow",
"style": {
"navigationBarTitleText": "学生采购"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Other/list",
"style": {
@@ -1117,6 +1141,12 @@
"navigationBarTitleText": "其他采购申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Other/singleFlow",
"style": {
"navigationBarTitleText": "其他采购"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Edu/list",
"style": {
@@ -1129,6 +1159,12 @@
"navigationBarTitleText": "教务采购申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Edu/singleFlow",
"style": {
"navigationBarTitleText": "教务采购"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Print/list",
"style": {
@@ -1159,6 +1195,12 @@
"navigationBarTitleText": "出差申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Travel/singleFlow",
"style": {
"navigationBarTitleText": "出差"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Service/list",
"style": {
@@ -1171,6 +1213,12 @@
"navigationBarTitleText": "劳务报修申请"
}
},
{
"path": "pages/LogisticsManagement/Purchase_Service/singleFlow",
"style": {
"navigationBarTitleText": "劳务报修申请"
}
},
{
"path": "pages/LogisticsapplyManagement/Purchase_Edu_Apply/list",
"style": {


+ 261
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Edu/singleFlow.vue Parādīt failu

@@ -0,0 +1,261 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Edu.DepartmentId"
:range="dataSource.Purchase_Edu.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Edu.CreatorId"
:readonly="true"
type="user"
title="申请人"
/>
<l-textarea
:value="formData.Purchase_Edu.Remark"
:readonly="true"
title="备注"
/>
<l-upload-file
:value="fileList"
:readonly="true"
title="附件"
/>
<l-input
:value="formData.Purchase_Edu.TotalAmount"
disabled
title="采购总价"
/>
<l-customform-table
:value="formData.Purchase_Edu_Details"
:item="Purchase_Edu_Details"
:edit="false"
/>
<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: {
Purchase_Edu: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
},
Purchase_Edu_Details:{ type: 'girdtable', title: '采购列表', __defaultItem__:{}, fieldsData:[
{ field:'Name', type:'input', name:'采购物品名称' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Quantity', type:'input', name:'采购数量' },
{ field:'Unit', type:'input', name:'单位' },
{ field:'UseTo', type:'input', name:'用途' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Edu.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchaseedu/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
let fileList = await this.getFileListById(res.Purchase_Edu.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 261
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Info/singleFlow.vue Parādīt failu

@@ -0,0 +1,261 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Info.DepartmentId"
:range="dataSource.Purchase_Info.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Info.CreatorId"
:readonly="true"
type="user"
title="申请人"
/>
<l-textarea
:value="formData.Purchase_Info.Remark"
:readonly="true"
title="备注"
/>
<l-upload-file
:value="fileList"
:readonly="true"
title="附件"
/>
<l-input
:value="formData.Purchase_Info.TotalAmount"
disabled
title="采购总价"
/>
<l-customform-table
:value="formData.Purchase_Info_Details"
:item="Purchase_Info_Details"
:edit="false"
/>
<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: {
Purchase_Info: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
},
Purchase_Info_Details:{ type: 'girdtable', title: '采购列表', __defaultItem__:{}, fieldsData:[
{ field:'Name', type:'input', name:'采购物品名称' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Quantity', type:'input', name:'采购数量' },
{ field:'Unit', type:'input', name:'单位' },
{ field:'UseTo', type:'input', name:'用途' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Info.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchaseinfo/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
let fileList = await this.getFileListById(res.Purchase_Info.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 261
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Logistic/singleFlow.vue Parādīt failu

@@ -0,0 +1,261 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Logistic.DepartmentId"
:range="dataSource.Purchase_Logistic.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Logistic.CreatorId"
:readonly="true"
type="user"
title="申请人"
/>
<l-textarea
:value="formData.Purchase_Logistic.Remark"
:readonly="true"
title="备注"
/>
<l-upload-file
:value="fileList"
:readonly="true"
title="附件"
/>
<l-input
:value="formData.Purchase_Logistic.TotalAmount"
disabled
title="采购总价"
/>
<l-customform-table
:value="formData.Purchase_Logistic_Details"
:item="Purchase_Logistic_Details"
:edit="false"
/>
<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: {
Purchase_Logistic: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
},
Purchase_Logistic_Details:{ type: 'girdtable', title: '采购列表', __defaultItem__:{}, fieldsData:[
{ field:'Name', type:'input', name:'采购物品名称' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Quantity', type:'input', name:'采购数量' },
{ field:'Unit', type:'input', name:'单位' },
{ field:'UseTo', type:'input', name:'用途' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Logistic.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchaselogistic/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
let fileList = await this.getFileListById(res.Purchase_Logistic.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 261
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Other/singleFlow.vue Parādīt failu

@@ -0,0 +1,261 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Other.DepartmentId"
:range="dataSource.Purchase_Other.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Other.CreatorId"
:readonly="true"
type="user"
title="申请人"
/>
<l-textarea
:value="formData.Purchase_Other.Remark"
:readonly="true"
title="备注"
/>
<l-upload-file
:value="fileList"
:readonly="true"
title="附件"
/>
<l-input
:value="formData.Purchase_Other.TotalAmount"
disabled
title="采购总价"
/>
<l-customform-table
:value="formData.Purchase_Other_Details"
:item="Purchase_Other_Details"
:edit="false"
/>
<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: {
Purchase_Other: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
},
Purchase_Other_Details:{ type: 'girdtable', title: '采购列表', __defaultItem__:{}, fieldsData:[
{ field:'Name', type:'input', name:'采购物品名称' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Quantity', type:'input', name:'采购数量' },
{ field:'Unit', type:'input', name:'单位' },
{ field:'UseTo', type:'input', name:'用途' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Other.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchaseother/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
let fileList = await this.getFileListById(res.Purchase_Other.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 1
- 9
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Print/singleFlow.vue Parādīt failu

@@ -20,14 +20,6 @@
:readonly="true"
title="备注"
/>
<!-- <l-upload-file
:value="fileList"
tableName="Purchase_Print"
fieldName="FilePath"
title="附件"
:number="9"
:readonly="true"
/> -->
<l-upload-file
:value="fileList"
:readonly="true"
@@ -127,7 +119,7 @@ export default {
value: t.id
}));
}),
() => {}
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();


+ 262
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Service/singleFlow.vue Parādīt failu

@@ -0,0 +1,262 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Service.DepartmentId"
:range="dataSource.Purchase_Service.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Service.CreatorId"
type="user"
title="申请人"
readonly
/>
<l-textarea
:value="formData.Purchase_Service.Remark"
readonly
title="备注"
/>
<l-upload-file
:value="fileList"
readonly
title="附件"
/>
<l-input
:value="formData.Purchase_Service.TotalAmount"
disabled
title="总价"
/>
<l-customform-table
:value="formData.Purchase_Service.Purchase_Service_Details"
:item="Purchase_Service_Details"
:edit="false"
/>
<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: {
Purchase_Service: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
} ,
Purchase_Service_Details:{ type: 'girdtable', title: '劳务维修详情', __defaultItem__:{}, fieldsData:[
{ field:'ServiceContent', type:'input', name:'维修内容' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Peoplecount', type:'input', name:'人数' },
{ field:'Days', type:'input', name:'天数' },
{ field:'Standar', type:'input', name:'标准' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Service.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchaseservice/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
let fileList = await this.getFileListById(res.Purchase_Service.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 269
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Student/singleFlow.vue Parādīt failu

@@ -0,0 +1,269 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Student.DepartmentId"
:range="dataSource.Purchase_Student.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Student.CreatorId"
:readonly="true"
type="user"
title="申请人"
/>
<l-textarea
:value="formData.Purchase_Student.Remark"
:readonly="true"
title="备注"
/>
<!-- <l-upload-file
:value="fileList"
tableName="Purchase_Student"
fieldName="FilePath"
title="附件"
:number="9"
:readonly="true"
/> -->
<l-upload-file
:value="fileList"
:readonly="true"
title="附件"
/>
<l-input
:value="formData.Purchase_Student.TotalAmount"
disabled
title="采购总价"
/>
<l-customform-table
:value="formData.Purchase_Student_Details"
:item="Purchase_Student_Details"
:edit="false"
/>
<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: {
Purchase_Student: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
},
Purchase_Student_Details:{ type: 'girdtable', title: '采购列表', __defaultItem__:{}, fieldsData:[
{ field:'Name', type:'input', name:'采购物品名称' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Quantity', type:'input', name:'采购数量' },
{ field:'Unit', type:'input', name:'单位' },
{ field:'UseTo', type:'input', name:'用途' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Student.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchasestudent/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
let fileList = await this.getFileListById(res.Purchase_Student.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 254
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Travel/singleFlow.vue Parādīt failu

@@ -0,0 +1,254 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-organize-picker
:value="formData.Purchase_Travel.CreatorId"
type="user"
title="申请人"
readonly
/>
<l-textarea
:value="formData.Purchase_Travel.Follows"
readonly
title="随行人员"
/>
<l-date-picker
:value="formData.Purchase_Travel.Starttime"
disabled
title="开始时间"
/>
<l-date-picker
:value="formData.Purchase_Travel.Endtime"
disabled
title="结束时间"
/>
<l-textarea
:value="formData.Purchase_Travel.Reason"
readonly
title="出差原因"
/>
<l-upload-file
:value="fileList"
readonly
title="附件"
/>
<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: {
Purchase_Travel: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
}
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Travel.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchasetravel/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
let fileList = await this.getFileListById(res.Purchase_Travel.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 269
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/Purchase_Work/singleFlow.vue Parādīt failu

@@ -0,0 +1,269 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Work.DepartmentId"
:range="dataSource.Purchase_Work.DepartmentId"
title="申请部门"
disabled
/>
<l-organize-picker
:value="formData.Purchase_Work.CreatorId"
:readonly="true"
type="user"
title="申请人"
/>
<l-textarea
:value="formData.Purchase_Work.Remark"
:readonly="true"
title="备注"
/>
<!-- <l-upload-file
:value="fileList"
tableName="Purchase_Work"
fieldName="FilePath"
title="附件"
:number="9"
:readonly="true"
/> -->
<l-upload-file
:value="fileList"
:readonly="true"
title="附件"
/>
<l-input
:value="formData.Purchase_Work.TotalAmount"
disabled
title="采购总价"
/>
<l-customform-table
:value="formData.Purchase_Work_Details"
:item="Purchase_Work_Details"
:edit="false"
/>
<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: {
Purchase_Work: {
DepartmentId:[],
Status: [{text:'已提交',value:'1'},{text:'未提交',value:'2'}],
CheckStatus:[{text:'审核中',value:'1'},{text:'审核通过',value:'2'},{text:'',value:'草稿'}]
},
},
Purchase_Work_Details:{ type: 'girdtable', title: '采购列表', __defaultItem__:{}, fieldsData:[
{ field:'Name', type:'input', name:'采购物品名称' },
{ field:'Price', type:'input', name:'价格' },
{ field:'Quantity', type:'input', name:'采购数量' },
{ field:'Unit', type:'input', name:'单位' },
{ field:'UseTo', type:'input', name:'用途' },
]},
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Work.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchasework/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
let fileList = await this.getFileListById(res.Purchase_Work.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
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
}
},
}
}
</script>

+ 324
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsapplyManagement/Purchase_Edu_Apply/singleFlow.vue Parādīt failu

@@ -0,0 +1,324 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-select
:value="formData.Purchase_Edu.DepartmentId" :disabled="!edit"
:range="dataSource.Purchase_Edu.DepartmentId" title="填报部门" required disabled />
<l-organize-picker
:value="formData.Purchase_Edu.Creator" :readonly="!edit" type="user" title="填报人" required readonly />
<l-datetime-picker
:value="formData.Purchase_Edu.Createtime"
disabled
title="填报时间"
/>
<l-input :value="formData.Purchase_Edu.Payee" title="收款人" required :disabled="!edit"/>
<l-input :value="formData.Purchase_Edu.Attachcount" title="附件张数" :disabled="!edit"/>
<l-upload-file :value="formData.Purchase_Edu.FilePath"
tableName="Purchase_Edu" fieldName="FilePath" title="附件" :number="9" :readonly="!edit" />
<l-input :value="formData.Purchase_Edu.Totalamount" title="申请报账金额" required :disabled="!edit"/>
<l-input :value="formData.Purchase_Edu.Approvalamount"
:disabled="!edit" title="核准金额" />
<view style="background-color: #fff;">
<view style="line-height: 40px;font-size: 14px;padding-left: 12px;">
报账明细:
</view>
<next-table ref="table" :show-header="true" :columns="column" :stripe="true" :fit="false" :border="true" :data="data"
:highlight="true" @currentChange="currentChange">
</next-table>
<l-customform-table
:value="currentRowDetail" :item="Purchase_Edu_Details"
:edit="false" />
</view>
<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:[],
Purchase_Edu_Details: {
type: 'girdtable',
title: '采购列表',
__defaultItem__: {},
fieldsData: [{
field: 'Name',
type: 'input',
name: '采购物品名称'
},
{
field: 'Price',
type: 'input',
name: '价格'
},
{
field: 'Quantity',
type: 'input',
name: '采购数量'
},
{
field: 'Unit',
type: 'input',
name: '单位'
},
{
field: 'UseTo',
type: 'input',
name: '用途'
},
]
},
// 数据源
dataSource: {
Purchase_Edu: {
DepartmentId: [],
Status: [{
text: '已提交',
value: '1'
}, {
text: '未提交',
value: '2'
}],
CheckStatus: [{
text: '审核中',
value: '1'
}, {
text: '审核通过',
value: '2'
}, {
text: '',
value: '草稿'
}]
},
},
// 采购数据
column:[
// { type:'selection', fixed:true,width:60 },
// { name: 'CreatorName', label: '申请人',width:80,emptyString:'--' },
{ name: 'TotalAmount', label: '金额',fixed:false,width:86,emptyString:'--' },
// { name: 'DepartmentName', label: '部门',fixed:false,width:200,emptyString:'--' },
{ name: 'Remark', label: '备注',fixed:false,width:126,emptyString:'--' },
{ name: 'CreateTime', label: '申请时间',width:80,emptyString:'--' },
// { name: 'SubmitTime', label: '提交时间',fixed:false,width:146,emptyString:'--' },
// { name: 'CheckTime', label: '审核时间',fixed:false,width:146,emptyString:'--' },
],
data:[],
list: [],
currentRow:null,
currentRowDetail:[],
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
async init(type) {
if(type){this.type = type}
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
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('classdata').then(data => {
this.dataSource.Purchase_Edu.DepartmentId = data.data.map(t => ({
text: t.name,
value: t.id
}));
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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/purchaseeduapply/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
this.data = res.Purchase_Edu_Details
let fileList = await this.getFileListById(res.Purchase_Edu.FilePath)
if(fileList&&fileList.length){
this.fileList = [fileList[0]]
}
// this.content = res.F_NewsContent
this.ready = true
}
})
},
// 点击某一行
async currentChange(row){
this.currentRow = row
this.currentRowDetail = []
const result = await this.HTTP_GET('learun/adms/purchaseeduapply/formdetail',row.purchaseid)
if(!result)return
this.currentRowDetail = result
},
// 点击审批相关按钮
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
}
},
}
}
</script>

Notiek ielāde…
Atcelt
Saglabāt