@@ -6,7 +6,7 @@ | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">使用管理人<font face="宋体">*</font></div> | |||
<div id="Name" isvalid="yes" checkexpession="NotNull"></div> | |||
<input id="No" hidden="hidden"/> | |||
<input id="JZGNo" hidden="hidden"/> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="OfficeEquipment"> | |||
<div class="lr-form-item-title">部门<font face="宋体">*</font></div> | |||
@@ -47,7 +47,7 @@ var bootstrap = function ($, learun) { | |||
select: function (item) { | |||
////赋值 | |||
$("#Name").val(item.f_realname); | |||
$("#No").val(item.f_encode); | |||
$("#JZGNo").val(item.f_encode); | |||
$("#Department").lrselectSet(item.f_departmentid); | |||
} | |||
}); | |||
@@ -60,11 +60,16 @@ var bootstrap = function ($, learun) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
//console.log(data[id]) | |||
//if (id == 'OfficeEquipment' && data[id]) { | |||
// data[id].Name = "任山"; | |||
//} | |||
//$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
@@ -72,10 +77,9 @@ var bootstrap = function ($, learun) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = {}; | |||
var strEntity = $('body').lrGetFormData(); | |||
strEntity.Name = strEntity.No; | |||
postData.strEntity = JSON.stringify(strEntity); | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
@@ -16,7 +16,7 @@ var bootstrap = function ($, learun) { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#Name').lrDataSourceSelect({ code: 'TeacherInfo',value: 'f_encode',text: 'f_realname' }); | |||
$('#Name').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_realname',text: 'f_realname' }); | |||
$('#Department').lrDataSourceSelect({ code: 'classdata',value: 'id',text: 'name' }); | |||
$('#Status').lrDataItemSelect({ code: 'AssState' }); | |||
$('#Types').lrDataItemSelect({ code: 'AssType' }); | |||
@@ -100,7 +100,7 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/GetPageList', | |||
headData: [ | |||
{ | |||
label: "使用管理人", name: "Name", width: 100, align: "left", | |||
label: "使用管理人", name: "JZGNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', | |||
@@ -16,7 +16,7 @@ var bootstrap = function ($, learun) { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#Name').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_encode', text: 'f_realname' }); | |||
$('#Name').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_realname', text: 'f_realname' }); | |||
$('#Department').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#Status').lrDataItemSelect({ code: 'AssState' }); | |||
$('#Types').lrDataItemSelect({ code: 'AssType' }); | |||
@@ -100,7 +100,7 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/EducationalAdministration/OfficeEquipment/GetPageList', | |||
headData: [ | |||
{ | |||
label: "使用管理人", name: "Name", width: 100, align: "left", | |||
label: "使用管理人", name: "JZGNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', | |||
@@ -35,6 +35,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[Column("NAME")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 姓名 | |||
/// </summary> | |||
[Column("JZGNO")] | |||
public string JZGNo { get; set; } | |||
/// <summary> | |||
/// 所属部门 | |||
/// </summary> | |||
[Column("DEPARTMENT")] | |||
@@ -12,30 +12,60 @@ | |||
<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') }} | |||
<text class="customlist-item-field-title">使用管理人:</text> | |||
{{ displayListItem(item, 'JZGNo') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">处室部门:</text> | |||
<text class="customlist-item-field-title">部门:</text> | |||
{{ displayListItem(item, 'Department') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">设备编号:</text> | |||
<text class="customlist-item-field-title">资产编号:</text> | |||
{{ displayListItem(item, 'Code') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">设备名称:</text> | |||
<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') }} | |||
<text class="customlist-item-field-title">资产类别:</text> | |||
{{ displayListItem(item, 'Types') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">品牌:</text> | |||
{{ displayListItem(item, 'Brand') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">型号:</text> | |||
{{ displayListItem(item, 'Model') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">参数:</text> | |||
{{ displayListItem(item, 'Argument') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">单位:</text> | |||
{{ displayListItem(item, 'Unit') }} | |||
</view> | |||
<view class="customlist-item-field"> | |||
<text class="customlist-item-field-title">数量:</text> | |||
{{ displayListItem(item, 'Nuantity') }} | |||
</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, 'Remark') }} | |||
@@ -75,16 +105,16 @@ | |||
<!-- 侧边栏,用于设置查询条件 --> | |||
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y> | |||
<view v-if="ready" class="padding"> | |||
<!-- <l-select @input="queryData.Name=$event" :value="queryData.Name" :range="dataSource.Name" title="姓名" | |||
@change="searchChange" /> | |||
<l-select @input="queryData.Department=$event" :value="queryData.Department" | |||
:range="dataSource.Department" title="部门" @change="searchChange" /> --> | |||
<l-organize-picker @input="queryData.Name_=$event" @change="searchChange" | |||
:value="queryData.Name_" type="user" title="姓名" /> | |||
<l-organize-picker @input="queryData.Name_=$event" @change="searchChange" :value="queryData.Name_" | |||
type="user" title="使用管理人" /> | |||
<l-organize-picker @input="queryData.Department=$event" @change="searchChange" | |||
:value="queryData.Department" type="department" title="部门" /> | |||
<l-input v-model="queryData.Code" @change="searchChange" title="设备编号" placeholder="请输入" /> | |||
<l-input v-model="queryData.DeviceName" @change="searchChange" title="设备名称" placeholder="请输入" /> | |||
<l-input v-model="queryData.Code" @change="searchChange" title="资产编号" placeholder="请输入" /> | |||
<l-input v-model="queryData.DeviceName" @change="searchChange" title="资产名称" placeholder="请输入" /> | |||
<l-input v-model="queryData.Brand" @change="searchChange" title="品牌" placeholder="请输入" /> | |||
<l-input v-model="queryData.Model" @change="searchChange" title="型号" placeholder="请输入" /> | |||
<l-select v-model="queryData.Types" :range="dataSource.Types" @change="searchChange" title="资产类别" placeholder="请选择" /> | |||
<l-select v-model="queryData.Status" :range="dataSource.Status" @change="searchChange" title="使用状态" placeholder="请选择" /> | |||
<!-- 重置查询条件按钮 --> | |||
<view class="padding-tb"> | |||
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> | |||
@@ -127,7 +157,7 @@ | |||
return { | |||
// 数据项的数据类型、结构 | |||
scheme: { | |||
Name: { | |||
JZGNo: { | |||
type: 'select' | |||
}, | |||
Department: { | |||
@@ -139,12 +169,30 @@ | |||
DeviceName: { | |||
type: 'text' | |||
}, | |||
Description: { | |||
Remark: { | |||
type: 'text' | |||
}, | |||
Remark: { | |||
Types: { | |||
type: 'select',dataSource: '1', dataSourceId: 'AssType' | |||
}, | |||
Brand: { | |||
type: 'text' | |||
}, | |||
Model: { | |||
type: 'text' | |||
}, | |||
Argument: { | |||
type: 'text' | |||
}, | |||
Unit: { | |||
type: 'select',dataSource: '1', dataSourceId: 'sldw', | |||
}, | |||
Nuantity: { | |||
type: 'text' | |||
} | |||
}, | |||
Status: { | |||
type: 'select',dataSource: '1', dataSourceId: 'AssState' | |||
}, | |||
}, | |||
// 查询条件 | |||
@@ -154,12 +202,24 @@ | |||
// 时间查询参数 | |||
dateRange: null, | |||
// 数据源 | |||
// 数据源 | |||
dataSource: { | |||
Name: [], | |||
Department: [] | |||
JZGNo: [], | |||
Department: [], | |||
Types: Object.values(this.GET_GLOBAL('dataDictionary').AssType).map(t => ({ | |||
value: t.value, | |||
text: t.text | |||
})), | |||
Status: Object.values(this.GET_GLOBAL('dataDictionary').AssState).map(t => ({ | |||
value: t.value, | |||
text: t.text | |||
})), | |||
Unit: Object.values(this.GET_GLOBAL('dataDictionary').sldw).map(t => ({ | |||
value: t.value, | |||
text: t.text | |||
})), | |||
}, | |||
// 页面相关参数 | |||
ready: false, | |||
tips: '加载中...', | |||
@@ -187,7 +247,7 @@ | |||
// 拉取加载列表和数据源 | |||
await Promise.all([ | |||
this.FETCH_DATASOURCE('teacheruserdata').then(result => { | |||
this.dataSource.Name = result.data.map(t => ({ | |||
this.dataSource.JZGNo = result.data.map(t => ({ | |||
text: t.f_realname, | |||
value: t.f_encode, | |||
f_encode: t.f_encode, | |||
@@ -234,7 +294,6 @@ | |||
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 ? '已加载所有项目' : '向下翻以加载更多' | |||
}, | |||
@@ -264,21 +323,21 @@ | |||
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 | |||
// 姓名格式化 | |||
if(this.searchData.Name_){ | |||
let arr = this.dataSource.Name | |||
if (this.searchData.Name_) { | |||
let arr = this.dataSource.JZGNo | |||
let obj = arr.find(e => e.f_userid == this.queryData.Name_) | |||
this.searchData.Name = obj ? obj.f_encode : '' | |||
this.searchData.JZGNo = obj ? obj.text : '' | |||
} | |||
await this.refreshList(false) | |||
}, | |||
@@ -4,18 +4,32 @@ | |||
<!-- <l-select @input="setValue('OfficeEquipment.Name', $event)" :value="getValue('OfficeEquipment.Name')" | |||
:range="dataSource.OfficeEquipment.Name" title="姓名" required /> --> | |||
<l-organize-picker @input="setValue('OfficeEquipment.Name', $event)" | |||
:value="getValue('OfficeEquipment.Name')" type="user" title="姓名" required :readonly="!edit"/> | |||
:value="getValue('OfficeEquipment.Name')" type="user" title="使用管理人" required :readonly="!edit" /> | |||
<l-organize-picker @input="setValue('OfficeEquipment.Department', $event)" | |||
:value="getValue('OfficeEquipment.Department')" type="department" title="部门" required :readonly="!edit"/> | |||
:value="getValue('OfficeEquipment.Department')" type="department" title="部门" required | |||
:readonly="!edit" /> | |||
<!-- <l-select @input="setValue('OfficeEquipment.Department', $event)" | |||
:value="getValue('OfficeEquipment.Department')" :range="dataSource.OfficeEquipment.Department" | |||
title="部门" required /> --> | |||
<l-input @input="setValue('OfficeEquipment.Code', $event)" :value="getValue('OfficeEquipment.Code')" | |||
:disabled="!edit" title="设备编号" required /> | |||
<l-input @input="setValue('OfficeEquipment.DeviceName', $event)" | |||
:value="getValue('OfficeEquipment.DeviceName')" :disabled="!edit" title="设备名称" required /> | |||
<l-input @input="setValue('OfficeEquipment.Description', $event)" | |||
:value="getValue('OfficeEquipment.Description')" :disabled="!edit" title="配置描述" required /> | |||
:value="getValue('OfficeEquipment.DeviceName')" :disabled="!edit" title="资产名称" required /> | |||
<l-input @input="setValue('OfficeEquipment.Code', $event)" :value="getValue('OfficeEquipment.Code')" | |||
:disabled="!edit" title="资产编号" required /> | |||
<l-organize-picker @input="setValue('OfficeEquipment.Types', $event)" | |||
:value="getValue('OfficeEquipment.Types')" type="Types" title="资产类别" required | |||
:readonly="!edit" /> | |||
<l-input @input="setValue('OfficeEquipment.Brand', $event)" | |||
:value="getValue('OfficeEquipment.Brand')" title="品牌" required /> | |||
<l-input @input="setValue('OfficeEquipment.Model', $event)" | |||
:value="getValue('OfficeEquipment.Model')" title="型号" required /> | |||
<l-input @input="setValue('OfficeEquipment.Argument', $event)" | |||
:value="getValue('OfficeEquipment.Argument')" title="参数" required /> | |||
<l-input @input="setValue('OfficeEquipment.Unit', $event)" | |||
:value="getValue('OfficeEquipment.Unit')" title="单位" required /> | |||
<l-input @input="setValue('OfficeEquipment.Nuantity', $event)" | |||
:value="getValue('OfficeEquipment.Nuantity')" title="数量" required /> | |||
<l-select @input="setValue('OfficeEquipment.Status', $event)" | |||
:value="getValue('OfficeEquipment.Status')" title="使用状态" /> | |||
<l-textarea @input="setValue('OfficeEquipment.Remark', $event)" :value="getValue('OfficeEquipment.Remark')" | |||
:readonly="!edit" title="备注" /> | |||
</view> | |||
@@ -72,7 +86,7 @@ | |||
OfficeEquipment: { | |||
Name: { | |||
type: 'select', | |||
title: '姓名', | |||
title: '使用管理人', | |||
verify: "NotNull" | |||
}, | |||
Department: { | |||
@@ -82,22 +96,48 @@ | |||
}, | |||
Code: { | |||
type: 'text', | |||
title: '设备编号', | |||
title: '资产编号', | |||
verify: "NotNull" | |||
}, | |||
DeviceName: { | |||
type: 'text', | |||
title: '设备名称', | |||
title: '资产名称', | |||
verify: "NotNull" | |||
}, | |||
Types: { | |||
type: 'select', | |||
title: '资产类别', | |||
verify: "NotNull" | |||
}, | |||
Description: { | |||
Brand: { | |||
type: 'text', | |||
title: '品牌', | |||
}, | |||
Model: { | |||
type: 'text', | |||
title: '型号', | |||
}, | |||
Argument: { | |||
type: 'text', | |||
title: '配置描述', | |||
title: '参数', | |||
}, | |||
Unit: { | |||
type: 'select', | |||
title: '单位', | |||
verify: "NotNull" | |||
}, | |||
Nuantity: { | |||
type: 'text', | |||
title: '数量', | |||
verify: "NotNull" | |||
}, | |||
Remark: { | |||
type: 'text', | |||
title: '备注' | |||
}, | |||
Status: { | |||
type: 'select', | |||
title: '使用状态', | |||
} | |||
}, | |||
}, | |||
@@ -162,7 +202,7 @@ | |||
const result = await this.HTTP_GET('/Learun/adms/EducationalAdministration/officeEquipment/form', | |||
this.id) | |||
this.origin = await this.formatFormData(result) | |||
let arr = this.dataSource.OfficeEquipment.Name | |||
let obj = arr.find(e => e.f_encode == this.origin.OfficeEquipment.Name) | |||
this.origin.OfficeEquipment.Name = obj ? obj.f_userid : this.origin.OfficeEquipment.Name | |||