@@ -1269,6 +1269,32 @@ | |||
"style": { | |||
"navigationBarTitleText": "统一认证2.0" | |||
} | |||
}, | |||
// 安全排查流程 | |||
{ | |||
"path": "pages/EducationalAdministration/SafetyCheck/list", | |||
"style": { | |||
"navigationBarTitleText": "安全排查流程" | |||
} | |||
}, | |||
{ | |||
"path": "pages/EducationalAdministration/SafetyCheck/single", | |||
"style": { | |||
"navigationBarTitleText": "安全排查流程" | |||
} | |||
}, | |||
// 信息化办公设备 | |||
{ | |||
"path": "pages/EducationalAdministration/OfficeEquipment/list", | |||
"style": { | |||
"navigationBarTitleText": "信息化办公设备" | |||
} | |||
}, | |||
{ | |||
"path": "pages/EducationalAdministration/OfficeEquipment/single", | |||
"style": { | |||
"navigationBarTitleText": "信息化办公设备" | |||
} | |||
} | |||
], | |||
@@ -0,0 +1,420 @@ | |||
<template> | |||
<view class="page"> | |||
<!-- 主列表页 --> | |||
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> | |||
<!-- 顶部条目/分页信息栏 --> | |||
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner> | |||
<!-- 滚动列表,跨端支持上拉/下拉 --> | |||
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list"> | |||
<l-customlist :tips="loadState" showTips> | |||
<!-- 单条记录 --> | |||
<view class="customlist-item" v-for="(item,index) of list" :key="item.Id"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">姓名:</text> | |||
{{ displayListItem(item, 'Name') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">处室部门:</text> | |||
{{ displayListItem(item, 'Department') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">设备编号:</text> | |||
{{ displayListItem(item, 'Code') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">设备名称:</text> | |||
{{ displayListItem(item, 'DeviceName') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">配置描述:</text> | |||
{{ displayListItem(item, 'Description') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">备注:</text> | |||
{{ displayListItem(item, 'Remark') }} | |||
</view> | |||
<view class="customlist-banner-action"> | |||
<view v-if="item.Status == '0'" @click="action('submit', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
提交 | |||
</view> | |||
<view v-if="item.Status == '0'" @click="action('delete', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="delete" /> | |||
删除 | |||
</view> | |||
<view v-if="item.Status == '0'" @click="action('edit', item.ID)" | |||
class="customlist-banner-action-btn line-blue text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="edit" /> | |||
编辑 | |||
</view> | |||
<view v-if="item.Status == '1'" @click="action('check', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
部门审查 | |||
</view> | |||
<view v-if="item.Status == '2'" @click="action('check', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
分管领导 | |||
</view> | |||
<!-- <view v-if="item.Status == '3'" @click="action('check', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
安全办 | |||
</view> --> | |||
<view @click="action('view', item.ID)" | |||
class="customlist-banner-action-btn line-blue text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="search" /> | |||
查看 | |||
</view> | |||
</view> | |||
</view> | |||
</l-customlist> | |||
</l-scroll-list> | |||
</view> | |||
<!-- 关闭侧边抽屉按钮 --> | |||
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose"> | |||
<l-icon type="pullright" color="blue" /> | |||
</view> | |||
<!-- 侧边栏,用于设置查询条件 --> | |||
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y> | |||
<view v-if="ready" class="padding"> | |||
<l-customlist-sidepage-datefilter v-model="dateRange" @change="searchChange" title="按申请时间查询: " | |||
ref="datefilter" class="margin-bottom" /> | |||
<!-- 重置查询条件按钮 --> | |||
<!-- <view class="padding-tb"> | |||
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> | |||
</view> --> | |||
</view> | |||
</scroll-view> | |||
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-16 15:39 | |||
* 描 述:工作日志 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/Journal/list", "style": { "navigationBarTitleText": "表单列表页" } } | |||
* | |||
* (navigationBarTitleText 字段为本页面的标题文本,可以修改) | |||
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件) | |||
*/ | |||
import moment from 'moment' | |||
import get from 'lodash/get' | |||
import set from 'lodash/set' | |||
import pickBy from 'lodash/pickBy' | |||
import mapValues from 'lodash/mapValues' | |||
export default { | |||
data() { | |||
return { | |||
// 数据项的数据类型、结构 | |||
scheme: { | |||
Name: { | |||
type: 'select' | |||
}, | |||
Department: { | |||
type: 'select' | |||
}, | |||
Code: { | |||
type: 'text' | |||
}, | |||
DeviceName: { | |||
type: 'text' | |||
}, | |||
Description: { | |||
type: 'text' | |||
}, | |||
Remark: { | |||
type: 'text' | |||
} | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: {}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 数据源 | |||
dataSource: { | |||
Status: [{ | |||
text: '草稿', | |||
value: '0' | |||
}, { | |||
text: '部门审查', | |||
value: '1' | |||
}, { | |||
text: '分管领导', | |||
value: '2' | |||
}, { | |||
text: '安全办', | |||
value: '3' | |||
}], | |||
Name: Object.entries(this.GET_GLOBAL('user')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}), | |||
Department: Object.entries(this.GET_GLOBAL('department')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}) | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('EducationalAdministration_SafetyCheck-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
console.log(this.GET_GLOBAL('user')) | |||
this.ON('EducationalAdministration_SafetyCheck-list-change', this.reset) | |||
// 拉取加载列表和数据源 | |||
await Promise.all([ | |||
() => {} | |||
]) | |||
await this.fetchList() | |||
// 初始化查询条件 | |||
this.defaultQueryData = this.COPY(this.queryData) | |||
this.ready = true | |||
}, | |||
// 拉取列表 | |||
async fetchList(isConcat = true) { | |||
if (this.page > this.total) { | |||
return | |||
} | |||
const result = await this.HTTP_GET( | |||
'/Learun/adms/EducationalAdministration/officeEquipment/pagelist', { | |||
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) | |||
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 | |||
pagination: { | |||
rows: 10, | |||
page: this.page, | |||
sord: 'ASC', | |||
sidx:"", | |||
}, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
) | |||
if (!result) { | |||
return | |||
} | |||
this.total = result.total | |||
this.page = result.page + 1 | |||
this.list = isConcat ? this.list.concat(result.rows) : result.rows; | |||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | |||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
// 刷新清空列表 | |||
async refreshList(isConcat = true) { | |||
this.page = 1 | |||
this.total = 2 | |||
this.list = [] | |||
await this.fetchList(isConcat) | |||
}, | |||
// 列表下拉 | |||
pullDown() { | |||
this.refreshList().then(() => { | |||
this.$refs.list.stopPullDown() | |||
}) | |||
}, | |||
// 设置搜索条件 | |||
async searchChange() { | |||
const result = {} | |||
// 时间查询相关参数 | |||
if (this.dateRange) { | |||
result.StartTime = this.dateRange.start | |||
result.EndTime = this.dateRange.end | |||
} | |||
// 将其他查询项添加到查询 JSON 中 | |||
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) | |||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | |||
this.searchData = result | |||
await this.refreshList(false) | |||
}, | |||
// 点击「清空查询条件」按钮 | |||
reset() { | |||
this.queryData = this.COPY(this.defaultQueryData) | |||
this.searchChange() | |||
}, | |||
// 点击「编辑」、「查看」、「添加」、「删除」按钮 | |||
async action(type, id = '') { | |||
switch (type) { | |||
case 'view': | |||
this.NAV_TO(`./single?type=view&id=${id}`) | |||
return | |||
case 'add': | |||
this.NAV_TO('./single?type=create') | |||
return | |||
case 'check': | |||
this.NAV_TO(`./single?type=check&id=${id}`) | |||
return | |||
case 'edit': | |||
this.NAV_TO(`./single?type=edit&id=${id}`) | |||
return | |||
case 'submit': | |||
if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/submit', id, '提交失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('提交成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/delete', id, '删除失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('删除成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
default: | |||
return | |||
} | |||
}, | |||
// 显示列表中的标题项 | |||
displayListItem(item, field) { | |||
const fieldItem = this.scheme[field] | |||
const value = item[field] | |||
switch (fieldItem.type) { | |||
case 'currentInfo': | |||
case 'organize': | |||
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), | |||
`${value}.name`, '') | |||
case 'radio': | |||
case 'select': | |||
const selectItem = this.dataSource[field].find(t => t.value === String(value)) | |||
return get(selectItem, 'text', '') | |||
case 'checkbox': | |||
if (!value || value.split(',').length <= 0) { | |||
return '' | |||
} | |||
const checkboxItems = value.split(',') | |||
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join( | |||
',') | |||
case 'datetime': | |||
if (!value) { | |||
return '' | |||
} | |||
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : | |||
'YYYY-MM-DD HH:mm') | |||
default: | |||
return value === null || value === undefined ? '' : value | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
.customlist-banner-action { | |||
margin-top: 20rpx; | |||
text-align: right; | |||
.customlist-banner-action-btn { | |||
display: inline-block; | |||
padding: 4px 6px; | |||
margin: 0 3px; | |||
border-radius: 3px; | |||
text-align: center; | |||
} | |||
} | |||
</style> |
@@ -0,0 +1,300 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-organize-picker @input="setValue('SafetyCheck.Name', $event)" :value="getValue('SafetyCheck.Name')" | |||
:readonly="!edit" type="user" title="姓名" required readonly /> | |||
<l-organize-picker @input="setValue('SafetyCheck.Department', $event)" | |||
:value="getValue('SafetyCheck.Department')" type="department" :readonly="!edit" title="处室部门" required | |||
readonly /> | |||
<l-input @input="setValue('SafetyCheck.Area', $event)" :value="getValue('SafetyCheck.Area')" | |||
:disabled="!edit" title="责任区域" required /> | |||
<l-date-picker @input="setValue('SafetyCheck.CheckTime', $event)" | |||
:value="getValue('SafetyCheck.CheckTime')" :disabled="!edit" title="排查时间" required /> | |||
<l-textarea @input="setValue('SafetyCheck.Question', $event)" :value="getValue('SafetyCheck.Question')" | |||
:readonly="!edit" title="发现的隐患问题" required /> | |||
<l-textarea @input="setValue('SafetyCheck.idea', $event)" :value="getValue('SafetyCheck.idea')" | |||
:readonly="!edit" title="整改措施及建议等" /> | |||
<l-upload-file @input="setValue('SafetyCheck.Path', $event)" :value="getValue('SafetyCheck.Path')" | |||
tableName="SafetyCheck" fieldName="Path" title="附件" :number="9" :readonly="!edit" /> | |||
<l-textarea @input="setValue('SafetyCheck.Remark', $event)" :value="getValue('SafetyCheck.Remark')" | |||
:readonly="!edit" title="备注" /> | |||
<l-select v-if="mode == 'check'&&['1'].includes(String(Status))" | |||
@input="setValue('SafetyCheck.Status', $event)" :value="getValue('SafetyCheck.Status')" | |||
:range="dataSource.SafetyCheck.Status" title="继续上报" required /> | |||
<l-textarea v-if="Status&&Status!=0" @input="setValue('SafetyCheck.DepartmentRemark', $event)" | |||
:readonly="mode != 'check'||!['1'].includes(String(Status))" | |||
:value="getValue('SafetyCheck.DepartmentRemark')" title="审验提醒" /> | |||
<l-select v-if="mode == 'check'&&['2','3'].includes(String(Status))" | |||
@input="setValue('SafetyCheck.Status', $event)" :value="getValue('SafetyCheck.Status')" | |||
:range="dataSource.SafetyCheck.Status" title="继续上报" required /> | |||
</view> | |||
<view v-if="ready && current.SafetyCheck && mode!='view'" | |||
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> | |||
<l-button v-if="mode == 'check'" @click="action('check')" size="lg" line="orange" class="block margin-top" | |||
block> | |||
审批 | |||
</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 v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block> | |||
删除 | |||
</l-button> --> | |||
</view> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 09:25 | |||
* 描 述:活动安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/BookBorrow/single", "style": { "navigationBarTitleText": "表单详情页" } } | |||
* | |||
* (navigationBarTitleText 字段为本页面的标题文本,可以修改) | |||
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件) | |||
*/ | |||
import get from 'lodash/get' | |||
import set from 'lodash/set' | |||
import moment from 'moment' | |||
import customPageMixins from '@/common/custompage.js' | |||
export default { | |||
mixins: [customPageMixins], | |||
data() { | |||
return { | |||
// 页面相关参数 | |||
id: null, | |||
mode: null, | |||
edit: null, | |||
ready: false, | |||
// 表单数据 | |||
current: {}, | |||
origin: {}, | |||
Status:'', | |||
// 表单项数据结构 | |||
scheme: { | |||
SafetyCheck: { | |||
Name: { | |||
type: 'text' | |||
}, | |||
Department: { | |||
type: 'text' | |||
}, | |||
Area: { | |||
type: 'text', | |||
verify: "NotNull", | |||
title: '责任区域' | |||
}, | |||
CheckTime: { | |||
type: 'datetime', | |||
verify: "NotNull", | |||
title: '排查时间', | |||
dateformat:'0' | |||
}, | |||
Question: { | |||
type: 'text', | |||
verify: "NotNull", | |||
title: '发现的隐患' | |||
}, | |||
idea: { | |||
type: 'text' | |||
}, | |||
Path: { | |||
type: 'upload' | |||
}, | |||
Remark: { | |||
type: 'text' | |||
}, | |||
// CreateUser: { | |||
// type: 'text' | |||
// }, | |||
// CreateTime: { | |||
// type: 'text' | |||
// }, | |||
// ModifyUser: { | |||
// type: 'text' | |||
// }, | |||
// Modifytime: { | |||
// type: 'text' | |||
// }, | |||
Status: { | |||
type: 'select', | |||
}, | |||
DepartmentRemark: { | |||
type: 'text' | |||
}, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
SafetyCheck: { | |||
// Status: [{ | |||
// text: '草稿', | |||
// value: '0' | |||
// }, { | |||
// text: '部门审查', | |||
// value: '1' | |||
// }, { | |||
// text: '分管领导', | |||
// value: '2' | |||
// }, { | |||
// text: '安全办', | |||
// value: '3' | |||
// }], | |||
Status: [{ | |||
text: '继续上报', | |||
value: '1' | |||
}, { | |||
text: '退回', | |||
value: '0' | |||
}, ], | |||
}, | |||
} | |||
} | |||
}, | |||
async onLoad({ | |||
type, | |||
id | |||
}) { | |||
await this.init(type, id) | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init(type, id) { | |||
this.LOADING('加载数据中...') | |||
this.id = id | |||
this.mode = type | |||
this.edit = ['create', 'edit'].includes(this.mode) | |||
// 拉取表单数据,同时拉取所有来自数据源的选单数据 | |||
await Promise.all([ | |||
() => {} | |||
]) | |||
await this.fetchForm() | |||
this.ready = true | |||
this.HIDE_LOADING() | |||
}, | |||
// 加载表单数据 | |||
async fetchForm() { | |||
if (this.mode === 'create') { | |||
this.origin = await this.getDefaultForm() | |||
let userInfo = this.GET_GLOBAL('loginUser'); | |||
this.origin.SafetyCheck.Name = userInfo.userId | |||
this.origin.SafetyCheck.Department = userInfo.departmentId | |||
} else { | |||
const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/SafetyCheck/form', this | |||
.id) | |||
this.Status = result.SafetyCheck.Status | |||
if (this.mode === 'check') { | |||
result.SafetyCheck.Status = 1 | |||
} | |||
this.origin = await this.formatFormData(result) | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | |||
async action(type) { | |||
switch (type) { | |||
case 'edit': | |||
this.edit = true | |||
break | |||
case 'reset': | |||
this.current = this.COPY(this.origin) | |||
this.edit = false | |||
break | |||
case 'save': | |||
case 'check': | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
if (!(await this.CONFIRM('提交确认', '是否确定提交?', true))) { | |||
return | |||
} | |||
this.LOADING('正在提交...') | |||
const postData = await this.getPostData(this.id) | |||
if(type == 'check'){ | |||
let strEntity = JSON.parse(postData.strEntity) | |||
if(strEntity.Status == 1){ | |||
strEntity.Status = this.Status | |||
} | |||
postData.strEntity = JSON.stringify(strEntity) | |||
} | |||
// console.log(postData,JSON.parse(postData.strEntity)) | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/' + (type == 'save' ? | |||
'save' : 'department'), postData, '提交失败') | |||
.then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministration_SafetyCheck-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/delete', this.id, '删除失败') | |||
.then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministration_SafetyCheck-list-change') | |||
this.NAV_BACK() | |||
this.this.TOAST('删除成功', 'success') | |||
}) | |||
break | |||
default: | |||
break | |||
} | |||
}, | |||
// 获取表单值 | |||
getValue(path) { | |||
return get(this.current, path) | |||
}, | |||
// 设置表单值 | |||
setValue(path, val) { | |||
set(this.current, path, val) | |||
}, | |||
} | |||
} | |||
</script> |
@@ -0,0 +1,484 @@ | |||
<template> | |||
<view class="page"> | |||
<!-- 主列表页 --> | |||
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> | |||
<!-- 顶部条目/分页信息栏 --> | |||
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner> | |||
<!-- 滚动列表,跨端支持上拉/下拉 --> | |||
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list"> | |||
<l-customlist :tips="loadState" showTips> | |||
<!-- 单条记录 --> | |||
<view class="customlist-item" v-for="(item,index) of list" :key="item.Id"> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">姓名:</text> | |||
{{ displayListItem(item, 'Name') }} | |||
</view> | |||
<!-- <view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">处室部门:</text> | |||
{{ displayListItem(item, 'Department') }} | |||
</view> --> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">责任区域:</text> | |||
{{ displayListItem(item, 'Area') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">排查时间:</text> | |||
{{ displayListItem(item, 'CheckTime') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">发现的隐患问题:</text> | |||
{{ displayListItem(item, 'Question') }} | |||
</view> | |||
<!-- <view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">整改措施及建议等:</text> | |||
{{ displayListItem(item, 'idea') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">附件:</text> | |||
{{ displayListItem(item, 'Path') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">备注:</text> | |||
{{ displayListItem(item, 'Remark') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">创建用户:</text> | |||
{{ displayListItem(item, 'CreateUser') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">创建时间:</text> | |||
{{ displayListItem(item, 'CreateTime') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">编辑用户:</text> | |||
{{ displayListItem(item, 'ModifyUser') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">编辑时间:</text> | |||
{{ displayListItem(item, 'Modifytime') }} | |||
</view> --> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">状态:</text> | |||
{{ displayListItem(item, 'Status') }} | |||
</view> | |||
<!-- <view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">审验提醒:</text> | |||
{{ displayListItem(item, 'DepartmentRemark') }} | |||
</view> --> | |||
<view class="customlist-banner-action"> | |||
<view v-if="item.Status == '0'" @click="action('submit', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
提交 | |||
</view> | |||
<view v-if="item.Status == '0'" @click="action('delete', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="delete" /> | |||
删除 | |||
</view> | |||
<view v-if="item.Status == '0'" @click="action('edit', item.ID)" | |||
class="customlist-banner-action-btn line-blue text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="edit" /> | |||
编辑 | |||
</view> | |||
<view v-if="item.Status == '1'" @click="action('check', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
部门审查 | |||
</view> | |||
<view v-if="item.Status == '2'" @click="action('check', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
分管领导 | |||
</view> | |||
<!-- <view v-if="item.Status == '3'" @click="action('check', item.ID)" | |||
class="customlist-banner-action-btn line-red text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="top" /> | |||
安全办 | |||
</view> --> | |||
<view @click="action('view', item.ID)" | |||
class="customlist-banner-action-btn line-blue text-sm" | |||
style="border: currentColor 1px solid"> | |||
<l-icon type="search" /> | |||
查看 | |||
</view> | |||
</view> | |||
</view> | |||
</l-customlist> | |||
</l-scroll-list> | |||
</view> | |||
<!-- 关闭侧边抽屉按钮 --> | |||
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose"> | |||
<l-icon type="pullright" color="blue" /> | |||
</view> | |||
<!-- 侧边栏,用于设置查询条件 --> | |||
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y> | |||
<view v-if="ready" class="padding"> | |||
<l-customlist-sidepage-datefilter v-model="dateRange" @change="searchChange" title="按申请时间查询: " | |||
ref="datefilter" class="margin-bottom" /> | |||
<!-- 重置查询条件按钮 --> | |||
<!-- <view class="padding-tb"> | |||
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> | |||
</view> --> | |||
</view> | |||
</scroll-view> | |||
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-16 15:39 | |||
* 描 述:工作日志 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/EducationalAdministration/Journal/list", "style": { "navigationBarTitleText": "表单列表页" } } | |||
* | |||
* (navigationBarTitleText 字段为本页面的标题文本,可以修改) | |||
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件) | |||
*/ | |||
import moment from 'moment' | |||
import get from 'lodash/get' | |||
import set from 'lodash/set' | |||
import pickBy from 'lodash/pickBy' | |||
import mapValues from 'lodash/mapValues' | |||
export default { | |||
data() { | |||
return { | |||
// 数据项的数据类型、结构 | |||
scheme: { | |||
Name: { | |||
type: 'select' | |||
}, | |||
Department: { | |||
type: 'select' | |||
}, | |||
Area: { | |||
type: 'text' | |||
}, | |||
CheckTime: { | |||
type: 'datetime', | |||
dateformat:'0', | |||
}, | |||
Question: { | |||
type: 'text' | |||
}, | |||
idea: { | |||
type: 'text' | |||
}, | |||
Path: { | |||
type: 'text' | |||
}, | |||
Remark: { | |||
type: 'text' | |||
}, | |||
CreateUser: { | |||
type: 'text' | |||
}, | |||
CreateTime: { | |||
type: 'text' | |||
}, | |||
ModifyUser: { | |||
type: 'text' | |||
}, | |||
Modifytime: { | |||
type: 'text' | |||
}, | |||
Status: { | |||
type: 'select' | |||
}, | |||
DepartmentRemark: { | |||
type: 'text' | |||
}, | |||
}, | |||
// 查询条件 | |||
searchData: {}, | |||
defaultQueryData: {}, | |||
queryData: {}, | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 数据源 | |||
dataSource: { | |||
Status: [{ | |||
text: '草稿', | |||
value: '0' | |||
}, { | |||
text: '部门审查', | |||
value: '1' | |||
}, { | |||
text: '分管领导', | |||
value: '2' | |||
}, { | |||
text: '安全办', | |||
value: '3' | |||
}], | |||
Name: Object.entries(this.GET_GLOBAL('user')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}), | |||
Department: Object.entries(this.GET_GLOBAL('department')).map(e => { | |||
return { | |||
value: e[0], | |||
text: e[1].name | |||
} | |||
}) | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
loadState: '向下翻以加载更多', | |||
sideOpen: false, | |||
// 列表与分页信息 | |||
page: 1, | |||
total: 2, | |||
list: [] | |||
} | |||
}, | |||
async onLoad() { | |||
await this.init() | |||
}, | |||
onUnload() { | |||
this.OFF('EducationalAdministration_SafetyCheck-list-change') | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init() { | |||
this.ON('EducationalAdministration_SafetyCheck-list-change', this.reset) | |||
// 拉取加载列表和数据源 | |||
await Promise.all([ | |||
() => {} | |||
]) | |||
await this.fetchList() | |||
// 初始化查询条件 | |||
this.defaultQueryData = this.COPY(this.queryData) | |||
this.ready = true | |||
}, | |||
// 拉取列表 | |||
async fetchList(isConcat = true) { | |||
if (this.page > this.total) { | |||
return | |||
} | |||
const result = await this.HTTP_GET( | |||
'/Learun/adms/EducationalAdministration/SafetyCheck/PageList', { | |||
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) | |||
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序 | |||
pagination: { | |||
rows: 10, | |||
page: this.page, | |||
sord: 'ASC', | |||
sidx:"CheckTime desc", | |||
}, | |||
queryJson: JSON.stringify(this.searchData) | |||
}, | |||
'加载数据时出错' | |||
) | |||
if (!result) { | |||
return | |||
} | |||
this.total = result.total | |||
this.page = result.page + 1 | |||
this.list = isConcat ? this.list.concat(result.rows) : result.rows; | |||
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` | |||
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
// 刷新清空列表 | |||
async refreshList(isConcat = true) { | |||
this.page = 1 | |||
this.total = 2 | |||
this.list = [] | |||
await this.fetchList(isConcat) | |||
}, | |||
// 列表下拉 | |||
pullDown() { | |||
this.refreshList().then(() => { | |||
this.$refs.list.stopPullDown() | |||
}) | |||
}, | |||
// 设置搜索条件 | |||
async searchChange() { | |||
const result = {} | |||
// 时间查询相关参数 | |||
if (this.dateRange) { | |||
result.StartTime = this.dateRange.start | |||
result.EndTime = this.dateRange.end | |||
} | |||
// 将其他查询项添加到查询 JSON 中 | |||
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) | |||
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) | |||
this.searchData = result | |||
await this.refreshList(false) | |||
}, | |||
// 点击「清空查询条件」按钮 | |||
reset() { | |||
this.queryData = this.COPY(this.defaultQueryData) | |||
this.searchChange() | |||
}, | |||
// 点击「编辑」、「查看」、「添加」、「删除」按钮 | |||
async action(type, id = '') { | |||
switch (type) { | |||
case 'view': | |||
this.NAV_TO(`./single?type=view&id=${id}`) | |||
return | |||
case 'add': | |||
this.NAV_TO('./single?type=create') | |||
return | |||
case 'check': | |||
this.NAV_TO(`./single?type=check&id=${id}`) | |||
return | |||
case 'edit': | |||
this.NAV_TO(`./single?type=edit&id=${id}`) | |||
return | |||
case 'submit': | |||
if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/submit', id, '提交失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('提交成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) { | |||
return | |||
} | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/delete', id, '删除失败').then( | |||
success => { | |||
if (!success) { | |||
return | |||
} | |||
this.TOAST('删除成功', 'success') | |||
this.refreshList() | |||
}) | |||
return | |||
default: | |||
return | |||
} | |||
}, | |||
// 显示列表中的标题项 | |||
displayListItem(item, field) { | |||
const fieldItem = this.scheme[field] | |||
const value = item[field] | |||
switch (fieldItem.type) { | |||
case 'currentInfo': | |||
case 'organize': | |||
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), | |||
`${value}.name`, '') | |||
case 'radio': | |||
case 'select': | |||
const selectItem = this.dataSource[field].find(t => t.value === String(value)) | |||
return get(selectItem, 'text', '') | |||
case 'checkbox': | |||
if (!value || value.split(',').length <= 0) { | |||
return '' | |||
} | |||
const checkboxItems = value.split(',') | |||
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join( | |||
',') | |||
case 'datetime': | |||
if (!value) { | |||
return '' | |||
} | |||
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : | |||
'YYYY-MM-DD HH:mm') | |||
default: | |||
return value === null || value === undefined ? '' : value | |||
} | |||
} | |||
} | |||
} | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
.customlist-banner-action { | |||
margin-top: 20rpx; | |||
text-align: right; | |||
.customlist-banner-action-btn { | |||
display: inline-block; | |||
padding: 4px 6px; | |||
margin: 0 3px; | |||
border-radius: 3px; | |||
text-align: center; | |||
} | |||
} | |||
</style> |
@@ -0,0 +1,300 @@ | |||
<template> | |||
<view class="page"> | |||
<view v-if="ready"> | |||
<l-organize-picker @input="setValue('SafetyCheck.Name', $event)" :value="getValue('SafetyCheck.Name')" | |||
:readonly="!edit" type="user" title="姓名" required readonly /> | |||
<l-organize-picker @input="setValue('SafetyCheck.Department', $event)" | |||
:value="getValue('SafetyCheck.Department')" type="department" :readonly="!edit" title="处室部门" required | |||
readonly /> | |||
<l-input @input="setValue('SafetyCheck.Area', $event)" :value="getValue('SafetyCheck.Area')" | |||
:disabled="!edit" title="责任区域" required /> | |||
<l-date-picker @input="setValue('SafetyCheck.CheckTime', $event)" | |||
:value="getValue('SafetyCheck.CheckTime')" :disabled="!edit" title="排查时间" required /> | |||
<l-textarea @input="setValue('SafetyCheck.Question', $event)" :value="getValue('SafetyCheck.Question')" | |||
:readonly="!edit" title="发现的隐患问题" required /> | |||
<l-textarea @input="setValue('SafetyCheck.idea', $event)" :value="getValue('SafetyCheck.idea')" | |||
:readonly="!edit" title="整改措施及建议等" /> | |||
<l-upload-file @input="setValue('SafetyCheck.Path', $event)" :value="getValue('SafetyCheck.Path')" | |||
tableName="SafetyCheck" fieldName="Path" title="附件" :number="9" :readonly="!edit" /> | |||
<l-textarea @input="setValue('SafetyCheck.Remark', $event)" :value="getValue('SafetyCheck.Remark')" | |||
:readonly="!edit" title="备注" /> | |||
<l-select v-if="mode == 'check'&&['1'].includes(String(Status))" | |||
@input="setValue('SafetyCheck.Status', $event)" :value="getValue('SafetyCheck.Status')" | |||
:range="dataSource.SafetyCheck.Status" title="继续上报" required /> | |||
<l-textarea v-if="Status&&Status!=0" @input="setValue('SafetyCheck.DepartmentRemark', $event)" | |||
:readonly="mode != 'check'||!['1'].includes(String(Status))" | |||
:value="getValue('SafetyCheck.DepartmentRemark')" title="审验提醒" /> | |||
<l-select v-if="mode == 'check'&&['2','3'].includes(String(Status))" | |||
@input="setValue('SafetyCheck.Status', $event)" :value="getValue('SafetyCheck.Status')" | |||
:range="dataSource.SafetyCheck.Status" title="继续上报" required /> | |||
</view> | |||
<view v-if="ready && current.SafetyCheck && mode!='view'" | |||
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> | |||
<l-button v-if="mode == 'check'" @click="action('check')" size="lg" line="orange" class="block margin-top" | |||
block> | |||
审批 | |||
</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 v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block> | |||
删除 | |||
</l-button> --> | |||
</view> | |||
</view> | |||
</template> | |||
<script> | |||
/* | |||
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 上海力软信息技术有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-10-20 09:25 | |||
* 描 述:活动安排 | |||
*/ | |||
/** | |||
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用 | |||
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录: | |||
* { "path": "pages/PersonnelManagement/BookBorrow/single", "style": { "navigationBarTitleText": "表单详情页" } } | |||
* | |||
* (navigationBarTitleText 字段为本页面的标题文本,可以修改) | |||
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件) | |||
*/ | |||
import get from 'lodash/get' | |||
import set from 'lodash/set' | |||
import moment from 'moment' | |||
import customPageMixins from '@/common/custompage.js' | |||
export default { | |||
mixins: [customPageMixins], | |||
data() { | |||
return { | |||
// 页面相关参数 | |||
id: null, | |||
mode: null, | |||
edit: null, | |||
ready: false, | |||
// 表单数据 | |||
current: {}, | |||
origin: {}, | |||
Status:'', | |||
// 表单项数据结构 | |||
scheme: { | |||
SafetyCheck: { | |||
Name: { | |||
type: 'text' | |||
}, | |||
Department: { | |||
type: 'text' | |||
}, | |||
Area: { | |||
type: 'text', | |||
verify: "NotNull", | |||
title: '责任区域' | |||
}, | |||
CheckTime: { | |||
type: 'datetime', | |||
verify: "NotNull", | |||
title: '排查时间', | |||
dateformat:'0' | |||
}, | |||
Question: { | |||
type: 'text', | |||
verify: "NotNull", | |||
title: '发现的隐患' | |||
}, | |||
idea: { | |||
type: 'text' | |||
}, | |||
Path: { | |||
type: 'upload' | |||
}, | |||
Remark: { | |||
type: 'text' | |||
}, | |||
// CreateUser: { | |||
// type: 'text' | |||
// }, | |||
// CreateTime: { | |||
// type: 'text' | |||
// }, | |||
// ModifyUser: { | |||
// type: 'text' | |||
// }, | |||
// Modifytime: { | |||
// type: 'text' | |||
// }, | |||
Status: { | |||
type: 'select', | |||
}, | |||
DepartmentRemark: { | |||
type: 'text' | |||
}, | |||
}, | |||
}, | |||
// 数据源 | |||
dataSource: { | |||
SafetyCheck: { | |||
// Status: [{ | |||
// text: '草稿', | |||
// value: '0' | |||
// }, { | |||
// text: '部门审查', | |||
// value: '1' | |||
// }, { | |||
// text: '分管领导', | |||
// value: '2' | |||
// }, { | |||
// text: '安全办', | |||
// value: '3' | |||
// }], | |||
Status: [{ | |||
text: '继续上报', | |||
value: '1' | |||
}, { | |||
text: '退回', | |||
value: '0' | |||
}, ], | |||
}, | |||
} | |||
} | |||
}, | |||
async onLoad({ | |||
type, | |||
id | |||
}) { | |||
await this.init(type, id) | |||
}, | |||
methods: { | |||
// 页面初始化 | |||
async init(type, id) { | |||
this.LOADING('加载数据中...') | |||
this.id = id | |||
this.mode = type | |||
this.edit = ['create', 'edit'].includes(this.mode) | |||
// 拉取表单数据,同时拉取所有来自数据源的选单数据 | |||
await Promise.all([ | |||
() => {} | |||
]) | |||
await this.fetchForm() | |||
this.ready = true | |||
this.HIDE_LOADING() | |||
}, | |||
// 加载表单数据 | |||
async fetchForm() { | |||
if (this.mode === 'create') { | |||
this.origin = await this.getDefaultForm() | |||
let userInfo = this.GET_GLOBAL('loginUser'); | |||
this.origin.SafetyCheck.Name = userInfo.userId | |||
this.origin.SafetyCheck.Department = userInfo.departmentId | |||
} else { | |||
const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/SafetyCheck/form', this | |||
.id) | |||
this.Status = result.SafetyCheck.Status | |||
if (this.mode === 'check') { | |||
result.SafetyCheck.Status = 1 | |||
} | |||
this.origin = await this.formatFormData(result) | |||
} | |||
this.current = this.COPY(this.origin) | |||
}, | |||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | |||
async action(type) { | |||
switch (type) { | |||
case 'edit': | |||
this.edit = true | |||
break | |||
case 'reset': | |||
this.current = this.COPY(this.origin) | |||
this.edit = false | |||
break | |||
case 'save': | |||
case 'check': | |||
const verifyResult = this.verifyForm() | |||
if (verifyResult.length > 0) { | |||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||
return | |||
} | |||
if (!(await this.CONFIRM('提交确认', '是否确定提交?', true))) { | |||
return | |||
} | |||
this.LOADING('正在提交...') | |||
const postData = await this.getPostData(this.id) | |||
if(type == 'check'){ | |||
let strEntity = JSON.parse(postData.strEntity) | |||
if(strEntity.Status == 1){ | |||
strEntity.Status = this.Status | |||
} | |||
postData.strEntity = JSON.stringify(strEntity) | |||
} | |||
// console.log(postData,JSON.parse(postData.strEntity)) | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/' + (type == 'save' ? | |||
'save' : 'department'), postData, '提交失败') | |||
.then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministration_SafetyCheck-list-change') | |||
this.NAV_BACK() | |||
this.TOAST('提交成功') | |||
}) | |||
break | |||
case 'delete': | |||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | |||
return | |||
} | |||
this.LOADING('提交删除中...') | |||
this.HTTP_POST('/Learun/adms/EducationalAdministration/SafetyCheck/delete', this.id, '删除失败') | |||
.then(success => { | |||
this.HIDE_LOADING() | |||
if (!success) { | |||
return | |||
} | |||
this.EMIT('EducationalAdministration_SafetyCheck-list-change') | |||
this.NAV_BACK() | |||
this.this.TOAST('删除成功', 'success') | |||
}) | |||
break | |||
default: | |||
break | |||
} | |||
}, | |||
// 获取表单值 | |||
getValue(path) { | |||
return get(this.current, path) | |||
}, | |||
// 设置表单值 | |||
setValue(path, val) { | |||
set(this.current, path, val) | |||
}, | |||
} | |||
} | |||
</script> |