90 lines
2.5 KiB
JavaScript
90 lines
2.5 KiB
JavaScript
/*YB5Bv4kuIZ2NvMyM/lDZplAuW/CCSA4NO+54vWpXrh8=*/
|
|
/*
|
|
* @Author: zhangjyp
|
|
* @PageInfo: 出库申请-拉单初始化模板
|
|
* @Date: 2018-04-19 10:32:11
|
|
* @Last Modified by: raoczh
|
|
* @Last Modified time: 2019-08-29 15:08:26
|
|
*/
|
|
import { PAGECODE, PAGEAREA, APPCODE, fileds_orgfilter_Bljh } from '../const';
|
|
import { transferSkipToSrcBillUtil } from '../../../../../scmpub/scmpub/pub/tool/transferSkipToSrcBillUtil';
|
|
|
|
export default function(props) {
|
|
let _this = this;
|
|
props.createUIDom(
|
|
{
|
|
pagecode: PAGECODE.pagecodeBljh, //卡片页面编码
|
|
appcode: APPCODE.appcodeBljh,
|
|
// TODO 2312版本增加此处的代码
|
|
reqDataQueryappcontext: {
|
|
rqUrl: '/platform/appregister/queryappcontext.do',
|
|
rqJson: `{\n \"appcode\": \"400802800\",\n \"pagecode\": \"50080102_Bljhto4455\"\n}`,
|
|
rqCode: 'context'
|
|
}
|
|
},
|
|
callbackFun
|
|
);
|
|
function callbackFun(data) {
|
|
if (data) {
|
|
if (data.template) {
|
|
let meta = data.template;
|
|
meta = modify.call(_this, props, meta);
|
|
props.meta.addMeta(meta);
|
|
_this.setState({ templateid: meta.pageid });
|
|
}
|
|
if (data.button) {
|
|
let button = data.button;
|
|
props.button.setButtons(button);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function modify(props, meta) {
|
|
// 拉单界面增加单据号增加超链接
|
|
meta[PAGEAREA.headBljh].items.map((item, index) => {
|
|
transferSkipToSrcBillUtil.call(this, props, item, {
|
|
billtype: '55A3',
|
|
billcodefield: 'vbillcode',
|
|
pkfield: 'cpickmid'
|
|
});
|
|
});
|
|
|
|
meta[PAGEAREA.searchBljh].items.map((item, index) => {
|
|
item.isShowUnit = true;
|
|
if (fileds_orgfilter_Bljh.includes(item.attrcode)) {
|
|
item.queryCondition = () => {
|
|
let pk_org = props.search.getSearchValByField(PAGEAREA.searchBljh, 'pk_org');
|
|
return {
|
|
pk_org:
|
|
pk_org && pk_org.value
|
|
? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue
|
|
: null
|
|
};
|
|
};
|
|
} else if (item.attrcode == 'pk_org') {
|
|
item.isShowUnit = false;
|
|
item.queryCondition = () => {
|
|
return { GridRefActionExt: 'nccloud.web.scmpub.ref.AppPermissionOrgRefFilter' };
|
|
};
|
|
} else if (item.attrcode == 'ctrantypeid') {
|
|
item.queryCondition = () => {
|
|
return { parentbilltype: 'Bljh' };
|
|
};
|
|
} else {
|
|
item.queryCondition = () => {
|
|
let pk_org = props.search.getSearchValByField(PAGEAREA.searchBljh, 'pk_org');
|
|
return {
|
|
pk_org:
|
|
pk_org && pk_org.value
|
|
? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue
|
|
: null //组织过滤
|
|
};
|
|
};
|
|
}
|
|
});
|
|
|
|
return meta;
|
|
}
|
|
|
|
/*YB5Bv4kuIZ2NvMyM/lDZplAuW/CCSA4NO+54vWpXrh8=*/
|