Commit e74a8432 by liuyang

2024-06-06 优化设备名称下拉显示

parent f42ec271
...@@ -371,7 +371,7 @@ ...@@ -371,7 +371,7 @@
<select id="queryDeviceCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryDeviceCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT distinct SELECT distinct
DEVICE_CODE as "deviceCode", <!-- 设备编码 --> DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
DEVICE_NAME as "deviceName", <!-- 设备名称 --> CONCAT(DEVICE_NAME,'-',DEVICE_CODE,'-',DEVICE_MODEL) as "deviceName", <!-- 设备名称 -->
DEVICE_TYPE as "deviceType", <!-- 设备类型 --> DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
COMPANY_CODE as "companyCode", COMPANY_CODE as "companyCode",
DEVICE_STATUS as "deviceStatus" DEVICE_STATUS as "deviceStatus"
......
...@@ -45,15 +45,14 @@ ...@@ -45,15 +45,14 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="210" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="true" maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -64,13 +63,13 @@ ...@@ -64,13 +63,13 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="planDate" cname="计划日期" width="100" enable="true" readonly="false" align="center" editType="date" <EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="planCode" cname="计划单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="planType" cname="计划类型" <EF:EFComboColumn ename="planType" cname="计划类型"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true" maxLength="16" width="120" readonly="false" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hggp.hgsb.planType" /> <EF:EFCodeOption codeName="hggp.hgsb.planType" />
</EF:EFComboColumn> </EF:EFComboColumn>
...@@ -88,10 +87,10 @@ ...@@ -88,10 +87,10 @@
<EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" enable="false" required="true" defaultValue="0"> <EF:EFComboColumn ename="planStatus" cname="审批状态" width="80" align="center" enable="false" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/> <EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false" <EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/> enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false" dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/> enable="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -58,8 +58,8 @@ $(function () { ...@@ -58,8 +58,8 @@ $(function () {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) { for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) { if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField'] dataItem['deviceName'] = deviceCodeBox[i]['textField'].split("-")[0]
return deviceCodeBox[i]['textField']; return deviceCodeBox[i]['textField'].split("-")[0];
} }
} }
return dataItem["deviceCode"] return dataItem["deviceCode"]
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFComboColumn ename="groupCode" cname="设备区域" readonly="true" <EF:EFComboColumn ename="groupCode" cname="设备区域" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
...@@ -46,23 +46,23 @@ ...@@ -46,23 +46,23 @@
<EF:EFComboColumn ename="deviceType" cname="设备类型" readonly="true" <EF:EFComboColumn ename="deviceType" cname="设备类型" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="80" required="true" maxLength="16" width="100" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" /> <EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="deviceCode" cname="设备名称" readonly="true" <EF:EFComboColumn ename="deviceCode" cname="设备名称" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" width="120" required="true" maxLength="16" width="220" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" align="center" required="true"/> <EF:EFColumn ename="checkItem" cname="检查项" width="150" enable="true" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" type="textarea" width="160" align="center"/> <EF:EFColumn ename="checkDescrip" cname="检查描述" type="textarea" width="200" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false" <EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/> enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false" dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/> enable="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -82,8 +82,8 @@ $(function () { ...@@ -82,8 +82,8 @@ $(function () {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) { for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) { if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField'] dataItem['deviceName'] = deviceCodeBox[i]['textField'].split("-")[0];
return deviceCodeBox[i]['textField']; return deviceCodeBox[i]['textField'].split("-")[0];
} }
} }
return dataItem["deviceCode"] return dataItem["deviceCode"]
......
...@@ -33,28 +33,27 @@ ...@@ -33,28 +33,27 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="true" maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="applyDate" cname="申请日期" width="120" enable="true" readonly="false" align="center" editType="date" <EF:EFColumn ename="applyDate" cname="申请日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="applyCode" cname="申请单号" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="applyCode" cname="申请单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称" <EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="true" maxLength="16" readonly="false" width="220" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" readonly="false" align="center" required="true"/> <EF:EFColumn ename="checkItem" cname="检查项" width="120" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" type="textarea" width="160" align="center"/> <EF:EFColumn ename="checkDescrip" cname="检查描述" type="textarea" width="160" align="center"/>
<EF:EFComboColumn ename="applyUserId" cname="申请人" defaultValue="${loginName}" <EF:EFComboColumn ename="applyUserId" cname="申请人" defaultValue="${loginName}"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
...@@ -67,9 +66,9 @@ ...@@ -67,9 +66,9 @@
<EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/> <EF:EFCodeOption codeName="hggp.hgsb.approveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<%--<EF:EFColumn ename="docId" cname="维修图片" width="100" enable="false" readonly="true" align="center"/>--%> <%--<EF:EFColumn ename="docId" cname="维修图片" width="100" enable="false" readonly="true" align="center"/>--%>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false" enable="false"/> <EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false" dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/> enable="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%> <%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true" maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -49,8 +49,8 @@ $(function () { ...@@ -49,8 +49,8 @@ $(function () {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) { for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) { if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField'] dataItem['deviceName'] = deviceCodeBox[i]['textField'].split("-")[0]
return deviceCodeBox[i]['textField']; return deviceCodeBox[i]['textField'].split("-")[0];
} }
} }
return dataItem["deviceCode"] return dataItem["deviceCode"]
......
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true" maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="company_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -43,8 +43,8 @@ $(function () { ...@@ -43,8 +43,8 @@ $(function () {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) { for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) { if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField'] dataItem['deviceName'] = deviceCodeBox[i]['textField'].split("-")[0]
return deviceCodeBox[i]['textField']; return deviceCodeBox[i]['textField'].split("-")[0];
} }
} }
return dataItem["deviceCode"] return dataItem["deviceCode"]
......
$(function () { $(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
...@@ -19,6 +19,17 @@ $(function () { ...@@ -19,6 +19,17 @@ $(function () {
}, },
columns: [ columns: [
{ {
field: "deviceCode",
template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField'].split("-")[0]
return deviceCodeBox[i]['textField'].split("-")[0];
}
}
return dataItem["deviceCode"]
}
}, {
field: "remainderDays", field: "remainderDays",
template: function (item) { template: function (item) {
let template = ''; let template = '';
......
$(function () { $(function () {
var deviceCodeBox = __eiInfo.getBlock("deviceCodeBox_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
/* 页面查询框的尺寸设置 */ /* 页面查询框的尺寸设置 */
...@@ -106,6 +106,17 @@ $(function () { ...@@ -106,6 +106,17 @@ $(function () {
}, },
columns: [ columns: [
{ {
field: "deviceCode",
template: function (dataItem) {
for (let i = 0; i < deviceCodeBox.length; i++) {
if (deviceCodeBox[i]['valueField'] === dataItem['deviceCode']) {
dataItem['deviceName'] = deviceCodeBox[i]['textField'].split("-")[0]
return deviceCodeBox[i]['textField'].split("-")[0];
}
}
return dataItem["deviceCode"]
}
}, {
field: "remainderDays", field: "remainderDays",
template: function (item) { template: function (item) {
let template = ''; let template = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment