1.在csp页面增加div属性。 <div class="pha-row pha-drug-inc-row">
<div class="pha-col">
<input id="inciSpecGredients" type="checkbox" class="hisui-checkbox"
data-pha='class:"hisui-checkbox",save:true,clear:true'>
</div>
<div class="pha-col">
<div class="pha-drug-inc-chk-label">
<label for="inciSpecGredients">含特殊成分</label>
</div>
</div>
<div class="pha-col">
<input id="inciPregnancy" type="checkbox" class="hisui-checkbox"
data-pha='class:"hisui-checkbox",save:true,clear:true'>
</div>
<div class="pha-col">
<div class="pha-drug-inc-chk-label">
<label for="inciPregnancy">终止妊娠</label>
</div>
</div>
</div>
2,选项cls文件中需要保存的位置,要么编写保存方法 /// Description: 保存库存项
/// Creator: yunhaibao
/// CreateDate: 2019-05-24
/// Input: InciId(Id)
/// JsonData(Json)
/// w ##class(PHA.IN.INCItm.Save).Save("","")
ClassMethod Save(InciId, JsonData, LogonStr = "")
{
s chkRet=..CheckSave(InciId, JsonData, LogonStr)
q:$p(chkRet,"^",1)<0 chkRet
s saveRet=..SaveINCItm(InciId, JsonData)
q:+$p(saveRet,"^",1)<0 saveRet
s inciId=saveRet
s saveRet=..SaveDHCItmAddInfo(inciId, JsonData)
q:+$p(saveRet,"^",1)<0 saveRet
/* 库存项继承药学项 */
s saveRet=##class(PHA.IN.Drug.Save).InheritPhcdToInci(inciId)
q:$p(saveRet,"^",1)<0 saveRet
* 库存项覆写医嘱项 */
s saveRet=##class(PHA.IN.Drug.Save).UpdateArcimFromInci(inciId)
q:$p(saveRet,"^",1)<0 saveRet
q inciId
}
3,在代保存位置中增加要传入后台的值(字符串类型用jsondata,布尔类型Y,N用..%ZBL,指向其他表类型用d执行id) s itmInfoObj.INFOPregnancy=..%ZBL(JsonData.inciPregnancy) // 终止妊娠药品
s itmInfoObj.INFOSpecGredients=..%ZBL(JsonData.inciSpecGredients) // 含特殊成分药品
d itmInfoObj.INFOOriginSetObjectId(JsonData.inciOrigin) // 产地
s itmInfoObj.INFOPurPlanCode=JsonData.inciPurPlanCode // 采购码
4,在表中新建存储的字段值或者新建表 /// 终止妊娠药品
Property INFOPregnancy As %Library.String(DISPLAYLIST = ",Yes,No", MAXLEN = 3, SELECTIVITY = "33.3333%", TRUNCATE = 1, VALUELIST = ",Y,N") [ SqlColumnNumber = 156, SqlFieldName = INFO_Pregnancy ];
/// 含特殊成分药品
Property INFOSpecGredients As %Library.String(DISPLAYLIST = ",Yes,No", MAXLEN = 3, SELECTIVITY = "33.3333%", TRUNCATE = 1, VALUELIST = ",Y,N") [ SqlColumnNumber = 157, SqlFieldName = INFO_SpecGredients ];
5,在js中找到保存后查询位置。在查询方法中 /**
* @description 查询右侧明细
*/
function QueryINCItmDetail() {
INCItmControler();
$.cm(
{
ClassName: 'PHA.IN.INCItm.Query',
MethodName: 'SelectINCItm',
InciId: INCITM_RowId,
ResultSetType: 'Array'
},
6,查询方法写法等同于新增写法 .s json.inciPackUomFac=itmInfoObj.INFOPackUomFactor // 大包装系数
.s json.inciEdible=itmInfoObj.INFOEdibleFlag // 药食同源
.s json.inciPregnancy=itmInfoObj.INFOPregnancy // 终止妊娠药品
.s json.inciSpecGredients=itmInfoObj.INFOSpecGredients // 含特殊成分药品
评论