Ver código fonte

app2.0附件功能支持草稿编辑

临城职教中职
liangkun 2 anos atrás
pai
commit
584b17e003
6 arquivos alterados com 52 adições e 49 exclusões
  1. +5
    -24
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs
  2. +25
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs
  3. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeIBLL.cs
  4. +3
    -4
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue
  5. +2
    -3
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue
  6. +15
    -16
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js

+ 5
- 24
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FormApi.cs Ver arquivo

@@ -32,35 +32,16 @@ namespace Learun.Application.WebApi.Modules
private Response GetFolderkey(dynamic _) private Response GetFolderkey(dynamic _)
{ {
List<FolderKeyReq> req = this.GetReqData<List<FolderKeyReq>>();// 获取模板请求数据 List<FolderKeyReq> req = this.GetReqData<List<FolderKeyReq>>();// 获取模板请求数据
Dictionary<string, FormSchemeEntity> schemeList = new Dictionary<string, FormSchemeEntity>();
Dictionary<string, object> dic = new Dictionary<string, object>();
Dictionary<string, string> dic = new Dictionary<string, string>();
foreach (var item in req) foreach (var item in req)
{ {
//FormSchemeInfoEntity schemeInfoEntity = formSchemeIBLL.GetSchemeInfoEntity(item.id);
//if (schemeInfoEntity != null)
//{
// FormSchemeEntity schemeEntity = formSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId);
// if (schemeEntity != null)
// {
// if (schemeInfoEntity.F_SchemeId != item.ver)
// {
// schemeList.Add(item.id, schemeEntity);
// }
// }
//}
if (string.IsNullOrEmpty(item.processIdName))
{
var data = formSchemeIBLL.GetInstanceForm(item.schemeInfoId, item.keyValue);
dic.Add(item.schemeInfoId, data);
}
else
if (!string.IsNullOrEmpty(item.processIdName))
{ {
var data = formSchemeIBLL.GetInstanceForm(item.schemeInfoId, item.processIdName, item.keyValue);//
dic.Add(item.schemeInfoId, data);
var data = formSchemeIBLL.GetFolderKey(item.schemeInfoId, item.processIdName, item.keyValue);//
dic = data;
} }
} }

return Success(schemeList);
return Success(dic);
} }
/// <summary> /// <summary>
/// 获取表单模板数据 /// 获取表单模板数据


+ 25
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeBLL.cs Ver arquivo

@@ -552,7 +552,7 @@ namespace Learun.Application.Form
} }
} }


public Dictionary<string, DataTable> GetFolderKey(string schemeInfoId, string processIdName, string keyValue)
public Dictionary<string, string> GetFolderKey(string schemeInfoId, string processIdName, string keyValue)
{ {
Dictionary<string, DataTable> res = new Dictionary<string, DataTable>(); Dictionary<string, DataTable> res = new Dictionary<string, DataTable>();


@@ -594,11 +594,34 @@ namespace Learun.Application.Form
{ {
tableComponts[compont.table].Add(compont); tableComponts[compont.table].Add(compont);
} }
if (compont.type == "guid")
{
tableComponts[compont.table].Add(compont);
}

} }
} }
} }
GetInstanceTableData(TableTree, tableComponts, formSchemeModel.dbId, keyValue, processIdName, null, res); GetInstanceTableData(TableTree, tableComponts, formSchemeModel.dbId, keyValue, processIdName, null, res);
return res;
Dictionary < string,string> uploadfieldkeyvalue=new Dictionary<string, string>();
foreach (var itemCompont in tableComponts)
{
foreach (FormCompontModel formitem in itemCompont.Value)
{
if (formitem.type=="upload")
{
foreach (var resitem in res)
{
if (resitem.Value.Rows.Count>0)
{
if (resitem.Value.Rows[0][formitem.field] != null)
uploadfieldkeyvalue.Add(formitem.id, resitem.Value.Rows[0][formitem.field].ToString());
}
}
}
}
}
return uploadfieldkeyvalue;
} }
catch (Exception ex) catch (Exception ex)
{ {


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Form/Scheme/FormSchemeIBLL.cs Ver arquivo

@@ -137,5 +137,7 @@ namespace Learun.Application.Form
/// <param name="keyValue">数据主键值</param> /// <param name="keyValue">数据主键值</param>
void DeleteInstanceForm(string schemeInfoId, string keyValue); void DeleteInstanceForm(string schemeInfoId, string keyValue);
#endregion #endregion

Dictionary<string, string> GetFolderKey(string itemSchemeInfoId, string itemProcessIdName, string itemKeyValue);
} }
} }

+ 3
- 4
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue Ver arquivo

@@ -95,7 +95,6 @@ export default {
// t.formId 使用表单,根据这个 formId 来获取 scheme 等信息 // t.formId 使用表单,根据这个 formId 来获取 scheme 等信息
// t.appurl 使用移动页面,直接跳转到本地的页面;表单结构等均写死在页面里 // t.appurl 使用移动页面,直接跳转到本地的页面;表单结构等均写死在页面里
const { wfForms } = this.currentNode const { wfForms } = this.currentNode

// 处理没有有效表单的情况,停止加载 // 处理没有有效表单的情况,停止加载
if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) { if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) {
this.HIDE_LOADING() this.HIDE_LOADING()
@@ -197,7 +196,7 @@ export default {
return return
} }
this.LOADING(`提交${actionText}中…`) this.LOADING(`提交${actionText}中…`)
this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => {
this.HTTP_POST(`/learun/adms/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => {
this.HIDE_LOADING() this.HIDE_LOADING()
if (success) { if (success) {
this.EMIT('task-list-change') this.EMIT('task-list-change')
@@ -216,7 +215,7 @@ export default {
this.LOADING('正在提交…') this.LOADING('正在提交…')
const draftFormValue = this.$refs.form.getFormValue() const draftFormValue = this.$refs.form.getFormValue()
const draftPostData = await this.getPostData(draftFormValue, this.scheme) const draftPostData = await this.getPostData(draftFormValue, this.scheme)
this.HTTP_POST('/newwf/draft', draftPostData, '提交草稿失败').then(success => {
this.HTTP_POST('/learun/adms/newwf/draft', draftPostData, '提交草稿失败').then(success => {
this.HIDE_LOADING() this.HIDE_LOADING()
if (success) { if (success) {
this.EMIT('task-list-change') this.EMIT('task-list-change')
@@ -245,7 +244,7 @@ export default {
postData.parentTaskId = this.taskId postData.parentTaskId = this.taskId
} }
const errorTips = '流程发起失败' const errorTips = '流程发起失败'
this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => {
this.HTTP_POST('/learun/adms/newwf/createchildflow', postData, errorTips).then(success => {
this.HIDE_LOADING() this.HIDE_LOADING()
if (success) { if (success) {
this.EMIT('task-list-change') this.EMIT('task-list-change')


+ 2
- 3
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue Ver arquivo

@@ -112,8 +112,8 @@ export default {
const formData = await this.fetchFormData(currentNode, processId) const formData = await this.fetchFormData(currentNode, processId)
const schemeData = await this.fetchSchemeData(currentNode); const schemeData = await this.fetchSchemeData(currentNode);
await this.fetchFolderkeyData(currentNode, processId);
const fetchFolderkeyData=await this.fetchFolderkeyData(currentNode, processId);
uni.setStorageSync('guids',JSON.stringify(fetchFolderkeyData));
const { formValue, scheme, rel } = await this.getCustomForm({ const { formValue, scheme, rel } = await this.getCustomForm({
schemeData, schemeData,
processId, processId,
@@ -128,7 +128,6 @@ export default {
this.formValue = formValue this.formValue = formValue
this.code = code this.code = code
this.processId = processId this.processId = processId
console.log(formData,'==',schemeData)
this.ready = true this.ready = true
this.HIDE_LOADING() this.HIDE_LOADING()


+ 15
- 16
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/workflow.js Ver arquivo

@@ -135,7 +135,7 @@ export default {
// 有表单值的情况,从表单值中获取数据 // 有表单值的情况,从表单值中获取数据
const val = [] const val = []
for (const valueItem of get(formData, `${schemeItem.F_SchemeInfoId}.${t.table}`, for (const valueItem of get(formData, `${schemeItem.F_SchemeInfoId}.${t.table}`,
[])) {
[])) {
const tableItemValue = {} const tableItemValue = {}
for (const fieldItem of t.fieldsData.filter(t => t.field)) { for (const fieldItem of t.fieldsData.filter(t => t.field)) {
const formDataValue = get(valueItem, fieldItem.field.toLowerCase()) const formDataValue = get(valueItem, fieldItem.field.toLowerCase())
@@ -243,13 +243,13 @@ export default {
rel rel
} }
}, },
newguid(){
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
newguid() {
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
/** /**
* 获取最终需要 POST 的数据 * 获取最终需要 POST 的数据
* 参数:formValue, scheme * 参数:formValue, scheme
@@ -265,20 +265,18 @@ export default {
// 不是表格的情况 // 不是表格的情况
const path = item.__valuePath__ const path = item.__valuePath__
const val = get(formValue, path) const val = get(formValue, path)
if(item.type=='upload'){
if (item.type == 'upload') {
// 先生成一个guid // 先生成一个guid
var guid =this.newguid();
var guid = this.newguid();
// 取出当前列对应的labelId // 取出当前列对应的labelId
var labeId = item.id var labeId = item.id
// 从缓存取出当前审批流程所有的guid // 从缓存取出当前审批流程所有的guid
var guids = JSON.parse(uni.getStorageSync('guids')) var guids = JSON.parse(uni.getStorageSync('guids'))
if(guids){
if (guids) {
guid = guids[labeId] guid = guids[labeId]
} }
} }
// debugger
const result = await this.convertToPostData(item, val, originFormValue, scheme, guid) const result = await this.convertToPostData(item, val, originFormValue, scheme, guid)
set(formValue, path, result) set(formValue, path, result)


@@ -399,7 +397,7 @@ export default {
const { const {
wfForms wfForms
} = currentNode } = currentNode
const reqData = wfForms const reqData = wfForms
.filter(t => t.formId) .filter(t => t.formId)
.map(t => ({ .map(t => ({
@@ -409,7 +407,8 @@ export default {
processIdName: t.field, processIdName: t.field,
keyValue keyValue
})) }))
const schemeData = await this.HTTP_GET('learun/adms/form/folderkey', reqData)
const folderkeyData = await this.HTTP_GET('learun/adms/form/folderkey', reqData)
return folderkeyData || {}
}, },
} }
} }

Carregando…
Cancelar
Salvar