74 lines
2.4 KiB
JavaScript
74 lines
2.4 KiB
JavaScript
/*pmFWCFu5nhKkBzYmrkBakWl62ApRqd1KWolltSFOyTw=*/
|
|
import { getMultiLang } from 'nc-lightapp-front';
|
|
import { setContext } from 'ssccommon/utils/contextUtils';
|
|
import viewBill from '../common/viewBill'
|
|
import presetVar from '../presetVar'
|
|
|
|
export default function (props) {
|
|
let that = this;
|
|
/**
|
|
* 取得模板
|
|
*/
|
|
let createUIDomPromise = new Promise((resolve, reject) => {
|
|
props.createUIDom(
|
|
{},
|
|
(data) => {
|
|
setContext(this.props, data.context);
|
|
resolve(data);
|
|
}
|
|
)
|
|
})
|
|
|
|
/**
|
|
* 取得多语
|
|
*/
|
|
this.getMultiLangPromise = new Promise((resolve, reject) => {
|
|
getMultiLang({
|
|
moduleId: presetVar.mutiLangCode,
|
|
domainName: presetVar.domainName,
|
|
currentLocale: presetVar.currentLocale,
|
|
callback: (json) => {
|
|
resolve(json);
|
|
}
|
|
});
|
|
})
|
|
Promise.all([createUIDomPromise, this.getMultiLangPromise]).then((resultList) => {
|
|
let data = resultList[0];
|
|
let json = resultList[1];
|
|
|
|
this.multiLangJson = json;
|
|
|
|
let button = data.button;
|
|
let meta = data.template;
|
|
|
|
// 设置页面标题
|
|
this.setState({ pageTitle: this.props.getSearchParam('n') });
|
|
|
|
let pageStatus = this.props.getUrlParam('status');
|
|
let pkBill = this.props.getUrlParam('id');
|
|
// 设置按钮模板
|
|
props.button.setButtons(button);
|
|
|
|
// 设置模版
|
|
props.meta.setMeta(meta);
|
|
viewBill.call(this, (data) => {
|
|
// 设置表单状态
|
|
this.props.form.setFormStatus(presetVar.formAreaId, presetVar.status.edit);
|
|
// 设置表格状态
|
|
this.props.cardTable.setStatus(presetVar.bodyAreaId, presetVar.status.edit);
|
|
|
|
const saga_status = data.head.head.rows[0].values.saga_status;
|
|
const saga_gtxid = data.head.head.rows[0].values.saga_gtxid;
|
|
if (saga_status && saga_status.value === "1") {
|
|
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
|
|
isError: true
|
|
})
|
|
this.props.socket.showToast({
|
|
gtxid: saga_gtxid && saga_gtxid.value || "",
|
|
billpk: pkBill
|
|
});
|
|
}
|
|
});
|
|
})
|
|
}
|
|
/*pmFWCFu5nhKkBzYmrkBakWl62ApRqd1KWolltSFOyTw=*/ |