@@ -44,9 +44,9 @@ | |||
<div class="lr-form-item-title">联系电话<font face="宋体">*</font></div> | |||
<input id="LinkPhone" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly" /> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item" data-table="MeetingManagement"> | |||
<div class="col-xs-12 lr-form-item" data-table="MeetingManagement"> | |||
<div class="lr-form-item-title">扫码签到</div> | |||
<div id="qrCode"></div> | |||
</div>*@ | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/MeetingManagement/FormView.js") |
@@ -63,7 +63,7 @@ var bootstrap = function ($, learun) { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
//扫码签到 | |||
//makeCode(data[id].Id); | |||
makeCode(data[id].Id); | |||
} | |||
}); | |||
} | |||
@@ -26,6 +26,7 @@ namespace Learun.Application.WebApi | |||
Get["/form"] = GetForm; | |||
Post["/delete"] = DeleteForm; | |||
Post["/save"] = SaveForm; | |||
Post["/read"] = NewsRead; | |||
} | |||
#region 获取数据 | |||
@@ -80,7 +81,16 @@ namespace Learun.Application.WebApi | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 查阅收件箱 | |||
/// <summary> | |||
/// <returns></returns> | |||
public Response NewsRead(dynamic _) | |||
{ | |||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||
sYS_ReceiveMessageIBLL.Read(parameter.keyValue); | |||
return Success("查阅成功!"); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -28,6 +28,8 @@ namespace Learun.Application.WebApi | |||
Get["/form"] = GetForm; | |||
Post["/delete"] = DeleteForm; | |||
Post["/save"] = SaveForm; | |||
Post["/read"] = NewsRead; | |||
} | |||
#region 获取数据 | |||
@@ -69,6 +71,7 @@ namespace Learun.Application.WebApi | |||
{ | |||
string keyValue = this.GetReqData(); | |||
var Sys_ReceiveFileData = sys_ReceiveFileIBLL.GetSys_ReceiveFileEntity(keyValue); | |||
Sys_ReceiveFileData.FilePath = Sys_ReceiveFileData.Url; | |||
if (Sys_ReceiveFileData != null) | |||
{ | |||
var result = annexesFileIBLL.GetEntityByFolderId(Sys_ReceiveFileData.Url)?.F_FilePath; | |||
@@ -112,6 +115,17 @@ namespace Learun.Application.WebApi | |||
sys_ReceiveFileIBLL.SaveEntity(this.userInfo, parameter.keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 查阅公文 | |||
/// <summary> | |||
/// <returns></returns> | |||
public Response NewsRead(dynamic _) | |||
{ | |||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||
sys_ReceiveFileIBLL.ReadEntity(parameter.keyValue); | |||
return Success("查阅成功!"); | |||
} | |||
#endregion | |||
#region 私有类 | |||
@@ -110,6 +110,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
[NotMapped] | |||
public string FilePath { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -166,6 +166,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
try | |||
{ | |||
var result = this.BaseRepository().FindEntity<SYS_ReceiveMessageEntity>(keyValue); | |||
result.FilePath = result.URL; | |||
result.URL = this.BaseRepository().FindEntity<AnnexesFileEntity>(a => a.F_FolderId == result.URL)?.F_FilePath; | |||
if (!string.IsNullOrEmpty(result.URL)) | |||
{ | |||
@@ -149,6 +149,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[Column("SLASTDATE")] | |||
public DateTime? SLastDate { get; set; } | |||
/// <summary> | |||
/// 路径 | |||
/// </summary> | |||
[NotMapped] | |||
public string FilePath { get; set; } | |||
#endregion | |||
} | |||
@@ -237,6 +237,32 @@ export default { | |||
return await this.HTTP_GET('learun/adms/annexes/wxlist', folderId) | |||
}, | |||
// 根据文件夹id获取图片列表 | |||
async getFileListById(folderId){ | |||
if(!folderId){ | |||
return [] | |||
} | |||
let wxlist = await this.FETCH_FILEList(folderId),fileList = [] | |||
for (const wxfile of wxlist) { | |||
const fileInfo = await this.FETCH_FILEINFO(wxfile.F_Id) | |||
if (!fileInfo) { | |||
continue | |||
} | |||
const fileType = fileInfo.F_FileType | |||
const fileSize = fileInfo.F_FileSize | |||
const path = this.API + '/learun/adms/annexes/wxdown?' + this.URL_QUERY(wxfile.F_Id, true) | |||
fileList.push({ | |||
path, | |||
type: fileType, | |||
uid:wxfile.F_Id, | |||
folderId:wxfile.F_FolderId, | |||
size: fileSize | |||
}) | |||
} | |||
return fileList | |||
}, | |||
// 封装的 GET 请求,集成了验证信息 | |||
// 返回请求结果或 null | |||
@@ -2,7 +2,7 @@ | |||
<view class="cu-form-group"> | |||
<view class="grid col-4 grid-square flex-sub"> | |||
<view v-for="(item, index) in imgList" @tap="viewImg(item)" :key="index" class="bg-img"> | |||
<image v-if="showfile()&&isImage(item.type)" :src="CONFIG('webHost') + item.url" mode="aspectFill"> | |||
<image v-if="showfile()&&item&&(typeof item == "string"||isImage(item.type))" :src="item.url?CONFIG('webHost') + item.url:item" mode="aspectFill"> | |||
</image> | |||
<l-icon v-if="showfile()&&!isImage(item.type)" type="text" /> | |||
<text class="file-name">{{item.name}}</text> | |||
@@ -33,7 +33,7 @@ | |||
<l-customlist-action @view="action('view', item.MESSAGEID)" /> | |||
<l-customlist-action @view="action('view', item.MESSAGEID)" :showDelete="false" @delete="action('delete', item.MESSAGEID)" :showEdit="false" @edit="action('edit', item.MESSAGEID)" /> | |||
</view> | |||
</l-customlist> | |||
</l-scroll-list> | |||
@@ -70,7 +70,7 @@ | |||
</view> | |||
</scroll-view> | |||
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> | |||
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> | |||
</view> | |||
</template> | |||
@@ -107,7 +107,7 @@ export default { | |||
SENDER: { type: 'text' }, | |||
TITLE: { type: 'text' }, | |||
READFLAG: { type: 'select', dataSource: '0' }, | |||
SENDTIME: { type: 'datetime', dateformat: '0' }, | |||
SENDTIME: { type: 'datetime', dateformat: '1' }, | |||
URL: { type: 'upload' }, | |||
CONTENTS: { type: 'textarea' }, | |||
}, | |||
@@ -174,7 +174,7 @@ export default { | |||
{ | |||
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) | |||
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 | |||
pagination: { rows: 10, page: this.page, sidx: 'MESSAGEID', sord: 'DESC' }, | |||
pagination: { rows: 10, page: this.page, sidx: 'SENDTIME', sord: 'DESC' }, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
@@ -235,6 +235,7 @@ export default { | |||
async action(type, id = '') { | |||
switch (type) { | |||
case 'view': | |||
this.HTTP_POST(`learun/adms/EducationalAdministration/SYS_ReceiveMessage/read`,{keyValue:id}) | |||
this.NAV_TO(`./single?type=view&id=${id}`) | |||
return | |||
@@ -13,13 +13,13 @@ | |||
:disabled="!edit" | |||
title="主题" | |||
/> | |||
<l-select | |||
<!-- <l-select | |||
@input="setValue('SYS_ReceiveMessage.READFLAG', $event)" | |||
:value="getValue('SYS_ReceiveMessage.READFLAG')" | |||
:disabled="!edit" | |||
:range="dataSource.SYS_ReceiveMessage.READFLAG" | |||
title="状态" | |||
/> | |||
/> --> | |||
<l-date-picker | |||
@input="setValue('SYS_ReceiveMessage.SENDTIME', $event)" | |||
:value="getValue('SYS_ReceiveMessage.SENDTIME')" | |||
@@ -27,21 +27,26 @@ | |||
title="收件时间" | |||
/> | |||
<l-upload-file | |||
@input="setValue('SYS_ReceiveMessage.URL', $event)" | |||
:value="getValue('SYS_ReceiveMessage.URL')" | |||
v-if="ready" | |||
:value="fileList" | |||
@input="(e)=>{fileList = e}" | |||
:readonly="!edit" | |||
:number="9" | |||
title="附件上传" | |||
/> | |||
<l-textarea | |||
<!-- <l-textarea | |||
@input="setValue('SYS_ReceiveMessage.CONTENTS', $event)" | |||
:value="getValue('SYS_ReceiveMessage.CONTENTS')" | |||
:readonly="!edit" | |||
title="邮件内容" | |||
/> | |||
/> --> | |||
<view class="bg-white" style="padding: 15px;color: #333333;font-size: 15px;">邮件内容</view> | |||
<view class="bg-white" style="padding: 15px;padding-top: 0px;"> | |||
<u-parse v-if="ready" :imageProp="{ domain: apiRoot }" :content="getValue('SYS_ReceiveMessage.CONTENTS')" noData="暂无内容"></u-parse> | |||
</view> | |||
</view> | |||
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;"> | |||
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||
<!-- <l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||
提交保存 | |||
</l-button> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block> | |||
@@ -49,10 +54,10 @@ | |||
</l-button> | |||
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block> | |||
取消编辑 | |||
</l-button> | |||
</l-button> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block> | |||
删除 | |||
</l-button> | |||
</l-button> --> | |||
</view> | |||
</view> | |||
</template> | |||
@@ -95,13 +100,15 @@ export default { | |||
// 表单数据 | |||
current: {}, | |||
origin: {}, | |||
fileList:[], | |||
// 表单项数据结构 | |||
scheme: { | |||
SYS_ReceiveMessage: { | |||
SENDER: { type: 'text', title: '发件人' }, | |||
TITLE: { type: 'text', title: '主题' }, | |||
READFLAG: { type: 'select', title: '状态', dataSource: '0' }, | |||
// READFLAG: { type: 'select', title: '状态', dataSource: '0' }, | |||
SENDTIME: { type: 'datetime', title: '收件时间', dateformat: '0' }, | |||
URL: { type: 'upload', title: '附件上传' }, | |||
CONTENTS: { type: 'textarea', title: '邮件内容' }, | |||
@@ -149,8 +156,17 @@ export default { | |||
if (this.mode === 'create') { | |||
this.origin = await this.getDefaultForm() | |||
} else { | |||
const result = await this.HTTP_GET('learun/adms/EducationalAdministration/SYS_ReceiveMessage/form', this.id) | |||
this.origin = await this.formatFormData(result) | |||
const result = await this.HTTP_GET('learun/adms/EducationalAdministration/SYS_ReceiveMessage/form', this.id) | |||
if(result){ | |||
let fileList = await this.getFileListById(result.SYS_ReceiveMessage.FilePath) | |||
console.log(fileList) | |||
this.fileList = fileList | |||
this.origin = await this.formatFormData(result) | |||
console.log(this.origin) | |||
}else{ | |||
return | |||
} | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
@@ -168,11 +184,14 @@ export default { | |||
break | |||
case 'save': | |||
console.log(this.fileList) | |||
// return | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
} | |||
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | |||
return | |||
@@ -42,7 +42,7 @@ | |||
</view> | |||
<l-customlist-action :showEdit="false" @edit="action('edit', item.RFileId)" showDelete @delete="action('delete', item.RFileId)" @view="action('view', item.RFileId)" /> | |||
<l-customlist-action :showEdit="false" @edit="action('edit', item.RFileId)" :showDelete="false" @delete="action('delete', item.RFileId)" @view="action('view', item.RFileId)" /> | |||
</view> | |||
</l-customlist> | |||
</l-scroll-list> | |||
@@ -65,12 +65,12 @@ | |||
class="margin-bottom" | |||
/> | |||
<l-input | |||
<!-- <l-input | |||
v-model="queryData.Sender" | |||
@change="searchChange" | |||
title ="发送人" | |||
placeholder="按发送人查询" | |||
/> | |||
/> --> | |||
<l-input | |||
v-model="queryData.Title" | |||
@change="searchChange" | |||
@@ -124,7 +124,7 @@ export default { | |||
SendTime: { type: 'datetime', dateformat: '0' }, | |||
SendType: { type: 'select', itemCode: 'FileSendType', dataSource: '0' }, | |||
ReadFlag: { type: 'select', dataSource: '0' }, | |||
ReadTime: { type: 'datetime', dateformat: '0' }, | |||
ReadTime: { type: 'datetime', dateformat: '1' }, | |||
}, | |||
// 查询条件 | |||
@@ -251,6 +251,7 @@ this.searchData.ReceiverId=this.GET_GLOBAL('loginUser').userId; | |||
async action(type, id = '') { | |||
switch (type) { | |||
case 'view': | |||
this.HTTP_POST(`learun/adms/EducationalAdministration/Sys_ReceiveFile/read`,{keyValue:id}) | |||
this.NAV_TO(`./single?type=view&id=${id}`) | |||
return | |||
@@ -33,6 +33,20 @@ | |||
:range="dataSource.Sys_ReceiveFile.SendType" | |||
title="接收对象" | |||
/> | |||
<!-- <l-upload-file | |||
@input="setValue('Sys_ReceiveFile.RUrl', $event)" | |||
:value="getValue('Sys_ReceiveFile.RUrl')" | |||
:readonly="!edit" | |||
:number="9" | |||
title="附件上传" | |||
/> --> | |||
<l-upload-file | |||
v-if="ready" | |||
:value="fileList" | |||
:readonly="!edit" | |||
:number="9" | |||
title="附件上传" | |||
/> | |||
<!-- <l-textarea | |||
@input="setValue('Sys_ReceiveFile.Contents', $event)" | |||
:value="getValue('Sys_ReceiveFile.Contents')" | |||
@@ -47,7 +61,7 @@ | |||
</view> | |||
</view> | |||
<view v-if="ready" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;"> | |||
<!-- <l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||
<!-- <l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||
提交保存 | |||
</l-button> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block> | |||
@@ -55,10 +69,10 @@ | |||
</l-button> | |||
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block> | |||
取消编辑 | |||
</l-button> --> | |||
</l-button> | |||
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block> | |||
删除 | |||
</l-button> | |||
</l-button> --> | |||
</view> | |||
</view | |||
> | |||
@@ -95,6 +109,7 @@ export default { | |||
edit: null, | |||
ready: false, // 表单数据 | |||
current: {}, | |||
fileList:[], | |||
origin: {}, // 表单项数据结构 | |||
scheme: { | |||
Sys_ReceiveFile: { | |||
@@ -145,6 +160,7 @@ export default { | |||
"learun/adms/EducationalAdministration/Sys_ReceiveFile/form", | |||
this.id | |||
); | |||
this.fileList = await this.getFileListById(result.Sys_ReceiveFile.FilePath) | |||
this.origin = await this.formatFormData(result); | |||
} | |||
this.current = this.COPY(this.origin); | |||