index.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332
  1. /*
  2. * @Author: sunzhijun
  3. * @LastEditors: sunzhijun
  4. * @Date: 2019-03-23 14:43:10
  5. * @LastEditTime: 2019-03-24 20:14:11
  6. */
  7. import React, {Component, PureComponent} from 'react';
  8. import ReactDOM from 'react-dom';
  9. import {high, createPage, base, getUrlParam, toast, promptBox, cacheTools} from 'nc-lightapp-front';
  10. import {hrAjax as ajax, saveValidate, getAppPageConfig} from 'src/hrpub/common/utils/utils';
  11. import handdleCheckedData from '../container/functions/checkDataPermissionAction';
  12. import Header from '../components/Header';
  13. import Pagination from '../components/Pagination';
  14. import SignModal from '../components/SignModal';
  15. import EmptyData from "src/hrpub/common/components/emptyImg";
  16. // import {fixedCol} from "../../../../../hrpub/common/utils/utils";
  17. import {chectFormAction, setFormAttrAndValue} from '../../../../public/functions/checkFormAction';
  18. import setAllpks from '../../../../public/functions/setAllpks';
  19. import IsMac from '../../../../public/functions/isMac';
  20. import './index.less';
  21. const {NCButton, NCSelect, NCCheckbox} = base;
  22. const NCOption = NCSelect.NCOption;
  23. import NCUploader from 'uap/common/components/NCUploader';
  24. import WpsModal from 'src/hrpub/common/components/wpsPreModel';
  25. let tableid = 'dataList';
  26. let cardId = 'dataCard';
  27. const languageId = "sign6011";
  28. const domainName = "hrcm";
  29. class CMSign extends Component {
  30. constructor(props) {
  31. super(props);
  32. if (props.use) {
  33. props.use.form('dataCard', 'dataCard_add', 'postcontCard_add', 'secrerycontCard_add', 'traincontCard_add')
  34. props.use.editTable('dataList', 'psnList', 'postcontList', 'secrerycontList', 'traincontList')
  35. props.use && props.use.search('listquery', 'query')
  36. }
  37. this.config = getAppPageConfig();
  38. this.state = {
  39. json: {},
  40. showMode: 'browse',
  41. showUploader: false, //是否显示附件管理
  42. isDataListPage: true, //是否是列表数据页面
  43. rowsListData: [], //展示区域数据
  44. rowsCardData: [],
  45. pageType: tableid,
  46. pageInfo: {
  47. pageIndex: 1,
  48. pageSize: 10
  49. },
  50. conditions: null,
  51. nodeRefs: {
  52. wpsview: null
  53. }
  54. }
  55. this.saveTableData = this.saveTableData.bind(this);
  56. this.onHideUploader = this.onHideUploader.bind(this);
  57. this.takeEffectEvent = this.takeEffectEvent.bind(this);
  58. this.refreshTableData = this.refreshTableData.bind(this);
  59. }
  60. componentWillMount() {
  61. // window.location.hash = `?page=201908221110`;
  62. let callback = (json, status, inlt) => {
  63. if (status) {
  64. this.lang = json
  65. this.setState({json, inlt}, () => {
  66. this.props.createUIDom(this.config, (data) => {
  67. let oid = data.template.listquery.oid;
  68. let buttons = data.button;
  69. //let dataItems = data.template.dataList.items;
  70. // let callback = (json, status, inlt) => {
  71. // if (status) {
  72. // this.lang = json
  73. // this.setState({json, inlt},()=>{
  74. // this.initMeta(dataItems,this);
  75. // })//存json和inlt到页面state中并刷新页面
  76. // }
  77. // }
  78. // this.props.MultiInit.getMultiLang({moduleId: languageId, domainName: domainName, callback});
  79. // this.props.meta.setMeta(data && data.template ? data.template : {},()=>{});
  80. // this.props.button.setButtons(data && data.button ? data.button : {});
  81. this.initMeta(data.template, buttons, this);
  82. this.setState({
  83. buttons: buttons || [],
  84. context: data.context || {},
  85. telName: data.template.name || '',
  86. oid: oid,
  87. pageid: data.template.pageid
  88. });
  89. this.props.meta.setMeta(data && data.template ? data.template : {}, () => {
  90. });
  91. this.props.button.setButtons(data && buttons ? buttons : {});
  92. });
  93. })//存json和inlt到页面state中并刷新页面
  94. }
  95. }
  96. this.props.MultiInit.getMultiLang({moduleId: languageId, domainName: domainName, callback})
  97. }
  98. componentDidMount() {
  99. this.updateButtonStatus();
  100. // 计算列表的高度
  101. let bodyH = this.refs.getContainerDom.offsetHeight;
  102. let headerH = this.header.getHeaderH();
  103. this.setState({
  104. tableHeight: bodyH - headerH - 44
  105. })
  106. this.props.button.setButtonVisible(['newAdd', 'edit', 'delete', 'takeEffect', 'refresh', 'save1', 'cancel1', 'edit', 'text', 'file', 'query'], false);
  107. }
  108. //初始化meta数据
  109. initMeta(template, buttons, opt) {
  110. let {json} = this.state;
  111. let data = template.dataList.items;
  112. // fixedCol(template['dataList'], ['contractnum', 'pk_majorcorp','pk_psndoc.code','pk_psndoc'],json['hrcm-000039'])
  113. data.unshift({
  114. attrcode: 'index',
  115. itemtype: 'customer',
  116. hyperlinkflag: false,
  117. label: json['hrcm-000039'], // 序号
  118. width: '65px',
  119. textAlign: 'center',
  120. visible: true,
  121. fixed: 'left',
  122. render(text, record, index) {
  123. return (
  124. <span>{index + 1}</span>
  125. )
  126. }
  127. });
  128. // 添加超链接和锁定列
  129. data.forEach((item, key) => { //添加超链接
  130. switch (item.attrcode) {
  131. case 'contractnum':
  132. item.renderStatus = 'browse'
  133. item.fixed = 'left'
  134. item.render = (text, record, index) => {
  135. return (
  136. <span className="list-style" style={{color: '#0073E1', cursor: 'pointer'}}
  137. onClick={this.toCardForm.bind(this, record, index, this.props)}>
  138. {record && record.values['contractnum'] && record.values['contractnum'].value}
  139. </span>
  140. );
  141. };
  142. break;
  143. case 'pk_majorcorp':
  144. item.renderStatus = 'browse'
  145. item.fixed = 'left'
  146. item.render = (text, record, index) => {
  147. return (
  148. <span className="list-style">
  149. {record && record.values['pk_majorcorp'] && record.values['pk_majorcorp'].display}
  150. </span>
  151. );
  152. };
  153. break;
  154. case 'pk_psndoc.code':
  155. item.renderStatus = 'browse'
  156. item.fixed = 'left'
  157. item.render = (text, record, index) => {
  158. return (
  159. <span className="list-style">
  160. {record && record.values['pk_psndoc.code'] && record.values['pk_psndoc.code'].value}
  161. </span>
  162. );
  163. };
  164. break;
  165. case 'pk_psndoc.name':
  166. item.renderStatus = 'browse'
  167. item.fixed = 'left'
  168. item.render = (text, record, index) => {
  169. return (
  170. <span className="list-style">
  171. {record && record.values['pk_psndoc.name'] && record.values['pk_psndoc.name'].value}
  172. </span>
  173. );
  174. };
  175. break;
  176. default:
  177. break;
  178. }
  179. });
  180. //添加附件
  181. data.push({
  182. attrcode: 'attachment',
  183. itemtype: 'customer',
  184. hyperlinkflag: false,
  185. label: json['hrcm-000011'], /* 国际化处理: 附件管理*/
  186. width: '80px',
  187. textAlign: 'center',
  188. visible: true,
  189. fixed: 'right',
  190. render(text, record, index) {
  191. // let billId = record.values.pk_psndoc_sub.value;
  192. // let billNo = record.values.contractnum.value
  193. return (
  194. <span>
  195. <i className="icon iconfont icon-fujianshenpi" onClick={(eve) => opt.attachManage(record)}></i>
  196. </span>
  197. )
  198. }
  199. });
  200. data.push({
  201. attrcode: 'handleArea',
  202. itemtype: 'customer',
  203. hyperlinkflag: false,
  204. label: json['hrcm-000012'], /* 国际化处理: 操作*/
  205. width: '250px',
  206. textAlign: 'center',
  207. visible: true,
  208. fixed: 'right',
  209. render(text, record, index) {
  210. let billId = record.values.pk_psndoc_sub.value;
  211. let billNo = record.values.contractnum.value;
  212. console.log("=======================>",buttons)
  213. return buttons && buttons.map((item, index) => {
  214. if (item.key === 'edit') {
  215. return (
  216. <React.Fragment>
  217. <span style={{color: '#0073E1', cursor: 'pointer', marginRight: '12px'}}
  218. onClick={opt.modifyCheckData.bind(opt, record)}
  219. >
  220. {json['hrcm-000013']}
  221. </span>
  222. </React.Fragment>
  223. )
  224. } else if (item.key === 'delete') {
  225. return (
  226. <React.Fragment>
  227. <span style={{color: '#0073E1', cursor: 'pointer', marginRight: '12px'}}
  228. onClick={opt.deleteBatchesData.bind(opt, record)}
  229. >
  230. {json['hrcm-000014']}
  231. </span>
  232. </React.Fragment>
  233. )
  234. } else if (item.key === 'text') {
  235. return (
  236. <React.Fragment>
  237. <span style={{color: '#0073E1', cursor: 'pointer'}}
  238. onClick={opt.contractText.bind(opt, billId, record)}
  239. >
  240. {json['hrcm-000015']}
  241. </span>
  242. </React.Fragment>
  243. )
  244. } else if (item.key === 'toXyy') {
  245. return (
  246. <React.Fragment>
  247. <span style={{color: '#0073E1', cursor: 'pointer', marginLeft: '12px'}}
  248. onClick={opt.sendContract.bind(opt, billId, record)}
  249. >
  250. 发起合同
  251. </span>
  252. </React.Fragment>
  253. )
  254. }
  255. })
  256. }
  257. });
  258. }
  259. //查询设置组织pkorg
  260. searchOrganizationChange(data) {
  261. let pkorg = data.refpk;
  262. this.setState({
  263. pk_org: pkorg,
  264. storageOrgData: data
  265. }, () => {
  266. this.getStorageData();
  267. // this.fetchTableData();
  268. })
  269. }
  270. //根据获取本地存储的主键信息获取数据
  271. getStorageData() {
  272. let storage = JSON.parse(window.localStorage.getItem('pageQueryParam'));
  273. let storageData = storage && Object.keys(storage);
  274. if (storageData && !!storageData.length) {
  275. let storage_pk = storage && storage.sign && storage.sign.pk_psndoc_subs;
  276. let hrorgobj = storage && storage.sign && storage.sign.hrorgobj;
  277. hrorgobj && this.setState({
  278. pk_org: hrorgobj.refpk,
  279. storage_pk: storage_pk
  280. }, () => {
  281. this.fetchTableData({key: storage_pk, queryType: 1});
  282. this.header.setOrganizationValue(hrorgobj);
  283. })
  284. } else {
  285. this.fetchTableData();
  286. }
  287. }
  288. //存储人力资源组织信息
  289. storageOrgData() {
  290. let {storageOrgData} = this.state;
  291. let orgData = {
  292. sign: {
  293. hrorgobj: storageOrgData
  294. }
  295. }
  296. orgData && window.localStorage.setItem('pageQueryParam', JSON.stringify(orgData));
  297. }
  298. //主键信息格式化
  299. formatPkPsndocSub(key, areaCode, type) {
  300. if (key && key.jobpks) {
  301. if (areaCode != tableid) {
  302. let len = key.jobpks.length;
  303. key = key.jobpks[len - 1];
  304. } else {
  305. key = [];
  306. }
  307. }
  308. if (key && Object.prototype.toString.call(key) === '[Object Object]') {
  309. key = [key];
  310. } else if (Array.isArray(key) && key.length === 0) {
  311. key = []
  312. } else if (key) {
  313. key = [key];
  314. } else {
  315. key = []
  316. }
  317. if (type == 1 && areaCode == tableid) {
  318. key = []
  319. }
  320. return key;
  321. }
  322. //数据初始化
  323. fetchTableData({key, type, isRefresh, conditions, queryType = 0, isEdit} = {}) {
  324. let {pk_org, isDataListPage, pageInfo, json, oid} = this.state;
  325. let areaCode = isDataListPage ? tableid : cardId;
  326. let pkPsndocSub = this.formatPkPsndocSub(key, areaCode, type);
  327. let pkPsndocSubArr = []
  328. pkPsndocSub.forEach((items) => {
  329. if (Array.isArray(items)) {
  330. pkPsndocSubArr.push(...items)
  331. } else {
  332. pkPsndocSubArr = pkPsndocSub
  333. }
  334. })
  335. if (!!pk_org) {
  336. ajax({
  337. url: '/nccloud/hrcm/common/QueryDataAction.do',
  338. data: {
  339. pk_org: pk_org,
  340. areaCode: areaCode,
  341. queryType: queryType,
  342. showSealDataFlag: true,
  343. orgFilter: true,
  344. isNodeCodeFilter: true,
  345. pkPsndocSub: pkPsndocSubArr, //卡片状态刷新数据
  346. pageInfo: pageInfo,
  347. appCode: this.config.appcode,
  348. ...conditions
  349. },
  350. success: res => {
  351. if (res.success && res.data) {
  352. let data = res.data;
  353. let rowsData, allpks;
  354. if (isDataListPage) {
  355. allpks = data.dataList && data.dataList.allpks || [];
  356. rowsData = data && data.dataList.rows;
  357. // if(!!rowsData){
  358. this.props.button.setButtonVisible(['newAdd', 'delete', 'refresh', 'takeEffect', 'query'], true);
  359. this.props.button.setButtonVisible(['save1', 'cancel1', 'text', 'file', 'edit'], false);
  360. this.props.button.setButtonDisabled(['edit', 'delete', 'refresh', 'takeEffect', 'file'], false);
  361. // }
  362. this.props.button.setButtonDisabled(['newAdd'], false);
  363. this.props.editTable.setTableData(tableid, {rows: rowsData || []});
  364. //设置翻页数据
  365. this.setState({
  366. pageInfo: res.data.dataList.pageInfo,
  367. isVisiblePagination: true //控制翻页显示隐藏
  368. })
  369. cacheTools.set('allpks', allpks);
  370. } else {
  371. rowsData = res.data && res.data.dataCard.rows[0];
  372. if (!!rowsData.values.ifprop.value || rowsData.values.ifprop.value === 'Y') {
  373. rowsData.values.ifprop.display = json['hrcm-000018'];
  374. rowsData.values.ifprop.value = true;
  375. } else {
  376. rowsData.values.ifprop.display = json['hrcm-000019'];
  377. rowsData.values.ifprop.value = false;
  378. }
  379. if (!!rowsData) {
  380. let formData = {
  381. rows: new Array(rowsData)
  382. };
  383. this.props.form.setAllFormValue({[cardId]: formData});
  384. }
  385. if (!!key.jobpks || Array.isArray(key)) { //数组是新增过来的数据
  386. allpks = cacheTools.get('allpks');
  387. if (!!key.jobpks) {
  388. key = key.jobpks;
  389. }
  390. let newAllpks = allpks.concat(key);
  391. let len = key.length;
  392. newAllpks = Array.from(new Set(newAllpks));
  393. cacheTools.set('allpks', newAllpks);
  394. this.header.setCardPagination(key[len - 1]);
  395. } else if (!!key) { //字符串是删除生效时的数据
  396. this.header.setCardPagination(key);
  397. }
  398. this.hidePagination();
  399. }
  400. if(isEdit){
  401. rowsData = res.data && res.data.dataCard.rows[0];
  402. if (rowsData && rowsData.values.ifprop.value === 'Y' || rowsData && rowsData.values.ifprop.value === true) {
  403. this.props.form.setFormItemsValue(cardId, {'ifprop': {display: json['hrcm-000018'], value: true, scale: "-1"}})
  404. } else {
  405. this.props.form.setFormItemsValue(cardId, {'ifprop': {display: json['hrcm-000019'], value: false, scale: "-1"}});
  406. // form.setFormItemsDisabled(cardId, { 'promonth': true, 'prop_unit': true, 'probegindate': true, 'probenddate': true });
  407. }
  408. this.editCardData(rowsData);
  409. }
  410. } else {
  411. // this.props.button.setButtonVisible(['newAdd','delete','takeEffect', 'refresh'],true);
  412. // this.props.button.setButtonVisible(['save1','cancel1','text','file'],false);
  413. this.props.button.setButtonVisible({
  414. save1: false,
  415. cancel1: false,
  416. text: false,
  417. file: false,
  418. newAdd: true,
  419. delete: true,
  420. takeEffect: true,
  421. refresh: true
  422. })
  423. this.props.button.setButtonDisabled({
  424. edit: true,
  425. delete: true,
  426. takeEffect: true,
  427. refresh: true,
  428. newAdd: false
  429. })
  430. // this.props.button.setButtonDisabled(['edit','delete','takeEffect','refresh'],true);
  431. // this.props.button.setButtonDisabled(['newAdd'],false);
  432. this.props.editTable.setTableData(tableid, {rows: []});
  433. this.props.form.EmptyAllFormValue(cardId);
  434. this.hidePagination();
  435. if (isDataListPage) {
  436. this.props.button.setButtonDisabled(['refresh'], false);
  437. this.props.button.setButtonVisible(['query'], true);
  438. } else {
  439. this.props.button.setButtonDisabled(['refresh'], true);
  440. this.props.button.setButtonVisible(['query'], false);
  441. }
  442. }
  443. if (!!isRefresh) {
  444. toast({color: 'success', content: json['hrcm-000016']});
  445. }
  446. this.deleteStorage();
  447. }
  448. })
  449. } else {
  450. // this.props.button.setButtonDisabled(['newAdd','edit','delete','takeEffect','file'],true);
  451. this.props.button.setButtonVisible(['newAdd', 'edit', 'delete', 'takeEffect', 'refresh', 'query'], false);
  452. this.hidePagination();
  453. }
  454. }
  455. //删除localStorage
  456. deleteStorage() {
  457. let pageQueryParamObj = JSON.parse(localStorage.getItem('pageQueryParam'));
  458. if (!!pageQueryParamObj) {
  459. delete pageQueryParamObj.sign;
  460. localStorage.setItem('pageQueryParam', JSON.stringify(pageQueryParamObj));
  461. }
  462. }
  463. //列表
  464. getTableListData() {
  465. let {pk_org, json} = this.state;
  466. let tableHeight = this.state.tableHeight;
  467. if (!!pk_org) {
  468. return (
  469. <div className="nc-singleTable-table-area nc-bill-table-area flex-container" style={{height: tableHeight- 40}}>
  470. {this.props.editTable.createEditTable(tableid, {
  471. cancelCustomRightMenu: true,
  472. //showIndex: true, //显示序列号
  473. showCheck: true, //显示复选框
  474. onRowDoubleClick: this.toCardForm.bind(this), //编辑表格数据
  475. sort: {
  476. mode: 'single', backSource: false, sortFun: (v, rows) => {
  477. setAllpks(rows, 'pk_psndoc_sub')
  478. }
  479. },
  480. adaptionHeight: true,
  481. // onSelected: this.getSelectedData.bind(this), //获取选中的数据
  482. // height: tableHeight - 72 //设置高度
  483. })}
  484. </div>
  485. )
  486. } else {
  487. return (
  488. <EmptyData text={json['hrcm-000017']}></EmptyData>
  489. )
  490. }
  491. }
  492. //隐藏列表翻页
  493. hidePagination() {
  494. this.setState({
  495. isVisiblePagination: false //控制翻页显示隐藏
  496. })
  497. }
  498. //保存
  499. saveTableData(step) {
  500. let formData = this.props.form.getAllFormValue(cardId).rows;
  501. let stepNum = step ? step : '0';
  502. let {json, pageid} = this.state;
  503. saveValidate(this.props, pageid, cardId, null, 'form').then(() => {
  504. if (this.props.form.isCheckNow(cardId)) {
  505. ajax({
  506. url: '/nccloud/hrcm/make/UpdateSaveDataAction.do',
  507. data: {
  508. baseParam: {
  509. step: stepNum
  510. },
  511. formData: {
  512. model: {
  513. rows: formData
  514. }
  515. }
  516. },
  517. success: res => {
  518. if (res.success && res.data) {
  519. let data = res.data;
  520. let content = {
  521. content: data.msg
  522. }
  523. if (data.step == '1') {
  524. let fn = {
  525. sureFn: this.saveTableData.bind(this)
  526. }
  527. this.promptBoxModal(content, fn, '1');
  528. } else if (data.step == '3') {
  529. let fn = {
  530. sureFn: this.isTakeEffectEvent.bind(this)
  531. }
  532. content.sureName = json['hrcm-000018'];
  533. content.cancelName = json['hrcm-000019'];
  534. this.refreshTableData();
  535. this.updateShowMode('browse');
  536. this.promptBoxModal(content, fn, '3');
  537. } else {
  538. this.refreshTableData();
  539. }
  540. }
  541. }
  542. })
  543. }
  544. });
  545. }
  546. //操作卡片翻页
  547. handleCardPagination(pks) {
  548. this.fetchTableData({key: pks});
  549. }
  550. //确认弹窗
  551. promptBoxModal(context, fn = {}, args) { //context 内容;fn 执行的方法;args 传递的参数
  552. let {sureFn, cancelFn} = fn;
  553. let {json} = this.state;
  554. promptBox({
  555. color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输
  556. title: json['hrcm-000003'], // 提示标题, 默认不同类别下分别为:"已成功"/"帮助信息"/"请注意"/"出错啦",非必输/* 国际化处理: 确认删除*/
  557. content: context.content, // 提示内容,非必输/* 国际化处理: 您确定要删除所选数据么?*/
  558. noFooter: false, // 是否显示底部按钮(确定、取消),默认显示(false),非必输
  559. noCancelBtn: false, // 是否显示取消按钮,,默认显示(false),非必输
  560. beSureBtnName: context.sureName ? context.sureName : json['hrcm-000006'], // 确定按钮名称, 默认为"确定",非必输/* 国际化处理: 确定*/
  561. cancelBtnName: context.cancelName ? context.cancelName : json['hrcm-000007'], // 取消按钮名称, 默认为"取消",非必输/* 国际化处理: 取消*/
  562. hasCloseBtn: true, //显示“X”按钮,默认不显示,不显示是false,显示是true
  563. // beSureBtnClick: ()=>{ this.resetTableData() }, // 确定按钮点击调用函数,非必输
  564. beSureBtnClick: () => {
  565. sureFn && sureFn(args)
  566. }, // 确定按钮点击调用函数,非必输
  567. cancelBtnClick: () => {
  568. cancelFn && cancelFn(args)
  569. }, // 取消按钮点击调用函数,非必输
  570. // closeBtnClick:functionClose, //关闭按钮点击调用函数,非必输
  571. closeByClickBackDrop: false,//点击遮罩关闭提示框,默认是true点击关闭,阻止关闭是false
  572. })
  573. }
  574. //刷新
  575. refreshTableData(isRefresh) {
  576. this.setState({
  577. isDataListPage: !this.state.isDataListPage ? false : true,
  578. storage_pk: []
  579. }, () => {
  580. if (this.state.isDataListPage) {
  581. this.fetchTableData({isRefresh: isRefresh});
  582. } else {
  583. let pk_psndoc_sub = this.props.form.getAllFormValue(cardId).rows[0].values.pk_psndoc_sub.value;
  584. this.fetchTableData({key: pk_psndoc_sub, isRefresh: isRefresh});
  585. }
  586. })
  587. }
  588. //获取某一处修改的数据索引
  589. searchIndex(arr, id) {
  590. for (let i = 0; i < arr.length; i++) {
  591. if (arr[i].rowid == id) {
  592. return i;
  593. }
  594. }
  595. }
  596. // 按钮是否显示,按钮是否可用
  597. updateButtonStatus() {
  598. var showMode = this.state.showMode
  599. this.props.button.setButtonsVisible({
  600. newAdd: showMode === 'browse',
  601. edit: showMode === 'browse',
  602. delete: showMode === 'browse',
  603. text: showMode === 'browse',
  604. refresh: showMode === 'browse',
  605. takeEffect: showMode === 'browse',
  606. file: showMode === 'browse',
  607. save1: showMode === 'edit',
  608. cancel1: showMode === 'edit'
  609. })
  610. }
  611. // 更新界面状态
  612. updateShowMode(showMode) {
  613. // var oldMode = this.state.showMode;
  614. let {json} = this.state;
  615. this.setState({
  616. showMode: showMode
  617. }, () => {
  618. this.updateButtonStatus()
  619. })
  620. if ('edit' === showMode) {
  621. this.props.form.setFormStatus(cardId, 'edit');
  622. } else {
  623. // this.props.editTable.cancelEdit(tableid);
  624. this.props.form.cancel(cardId);
  625. this.header.setCardPaginationVisibleFn(true);
  626. let formData = this.props.form.getAllFormValue(cardId);
  627. if (formData && formData.rows[0].values.ifprop && formData.rows[0].values.ifprop.value === 'Y' || formData.rows[0].values.ifprop && formData.rows[0].values.ifprop.value === true) {
  628. this.props.form.setFormItemsValue(cardId, {
  629. 'ifprop': {
  630. display: json['hrcm-000018'],
  631. value: true,
  632. scale: "-1"
  633. }
  634. })
  635. } else {
  636. this.props.form.setFormItemsValue(cardId, {
  637. 'ifprop': {
  638. display: json['hrcm-000019'],
  639. value: false,
  640. scale: "-1"
  641. }
  642. })
  643. }
  644. // this.props.form.setFormStatus(cardId,'browse');
  645. }
  646. }
  647. //返回
  648. handleBackClick() {
  649. let {storage_pk} = this.state;
  650. this.setState({
  651. isDataListPage: true
  652. }, () => {
  653. this.props.button.setButtonVisible(['newAdd', 'delete', 'refresh', 'takeEffect', 'query'], true);
  654. this.props.button.setButtonVisible(['save1', 'cancel1', 'text', 'file', 'edit'], false);
  655. this.fetchTableData({key: storage_pk});
  656. })
  657. }
  658. //进入卡片态调用接口
  659. // getCardData(pk, type) {
  660. // const { form, button } = this.props;
  661. // let { pk_org, json } = this.state;
  662. // ajax({
  663. // url: '/nccloud/hrcm/common/QueryDataCardAction.do',
  664. // data: {
  665. // pk_psndoc_sub: pk,
  666. // areaCode: cardId,
  667. // pk_org: pk_org
  668. // },
  669. // success: (res) => {
  670. // let data = res.data;
  671. // if (data && data.data) {
  672. // let formData = data.data.dataCard;
  673. // form.setAllFormValue({ [cardId]: formData });
  674. // button.setButtonVisible(['file', 'edit', 'text'], true);
  675. // // setFormAttrAndValue(data.attrMap, data.valueMap, this.props, cardId, [cardId]);
  676. // if (type === 'edit') {
  677. // this.editCardData(formData);
  678. // }
  679. // if (formData && formData.rows[0].values.ifprop.value === 'Y' || formData && formData.rows[0].values.ifprop.value === true) {
  680. // form.setFormItemsValue(cardId, { 'ifprop': { display: json['hrcm-000018'], value: "Y", scale: "-1" } })
  681. // } else {
  682. // form.setFormItemsValue(cardId, { 'ifprop': { display: json['hrcm-000019'], value: "N", scale: "-1" } });
  683. // form.setFormItemsDisabled(cardId, { 'promonth': true, 'prop_unit': true, 'probegindate': true, 'probenddate': true });
  684. // }
  685. // }
  686. // }
  687. // })
  688. // }
  689. //进入CardForm
  690. toCardForm(records) {
  691. this.setState({
  692. isDataListPage: false,
  693. isVisiblePagination: false //控制翻页显示隐藏
  694. }, () => {
  695. let pk_psndoc_sub = records.values.pk_psndoc_sub.value;
  696. // this.getCardData(pk_psndoc_sub);
  697. this.editTableFn(records);
  698. // this.getCardFormData(pk_psndoc_sub);
  699. this.header.showHeadLeftFn(true, pk_psndoc_sub);
  700. this.header.getCardFormId(cardId);
  701. })
  702. }
  703. //进入CardForm展示数据
  704. editTableFn(records) {
  705. let props = this.props;
  706. let {json} = this.state;
  707. let pk_psndoc_sub = records.values.pk_psndoc_sub.value;
  708. // this.getCardFormData(pk_psndoc_sub);
  709. /*let rowsData;
  710. if(records){
  711. rowsData = records;
  712. }else{
  713. rowsData = this.props.editTable.getCheckedRows(tableid)[0].data;
  714. }
  715. let formData = {
  716. rows: new Array(rowsData)
  717. };
  718. this.props.form.setAllFormValue({[cardId]: formData});*/
  719. this.fetchTableData({
  720. key: pk_psndoc_sub,
  721. isRefresh: false
  722. })
  723. this.props.button.setButtonVisible(['file', 'edit', 'text'], true);
  724. this.props.button.setButtonVisible(['query'], false);
  725. /*if(formData && formData.rows[0].values.ifprop.value === true){
  726. this.props.form.setFormItemsValue(cardId,{'ifprop':{display: json['hrcm-000018'], value: true, scale: "-1"}})
  727. }else{
  728. this.props.form.setFormItemsValue(cardId,{'ifprop':{display: json['hrcm-000019'], value: false, scale: "-1"}})
  729. }*/
  730. // chectFormAction('cont_unit', cardId, props, [cardId]);
  731. }
  732. // 修改数据校验事件
  733. modifyCheckData(v) {
  734. let {isDataListPage} = this.state;
  735. let pk_psndoc_sub;
  736. if (isDataListPage) {
  737. pk_psndoc_sub = v.values.pk_psndoc_sub.value;
  738. } else {
  739. let formCardData = this.props.form.getAllFormValue(cardId);
  740. pk_psndoc_sub = formCardData && formCardData.rows[0].values.pk_psndoc_sub.value;
  741. }
  742. handdleCheckedData(pk_psndoc_sub, 'edit', 'contract', () => {
  743. if (isDataListPage) {
  744. this.modifyListData(v);
  745. } else {
  746. this.editCardData();
  747. }
  748. });
  749. }
  750. //修改列表数据
  751. modifyListData(v) {
  752. let {form} = this.props;
  753. let {json} = this.state;
  754. let formData = v;
  755. this.setState({
  756. isDataListPage: false,
  757. isVisiblePagination: false
  758. }, () => {
  759. /*formData = {
  760. rows: new Array(formData)
  761. };*/
  762. let pk_psndoc_sub = formData.values.pk_psndoc_sub.value;
  763. this.fetchTableData({
  764. key: pk_psndoc_sub,
  765. isRefresh: false,
  766. isEdit: true
  767. })
  768. this.header.showHeadLeftFn(true);
  769. //this.props.form.setAllFormValue({[cardId]: formData});
  770. /*if (formData && formData.rows[0].values.ifprop.value === 'Y' || formData && formData.rows[0].values.ifprop.value === true) {
  771. form.setFormItemsValue(cardId, {'ifprop': {display: json['hrcm-000018'], value: true, scale: "-1"}})
  772. } else {
  773. form.setFormItemsValue(cardId, {'ifprop': {display: json['hrcm-000019'], value: false, scale: "-1"}});
  774. // form.setFormItemsDisabled(cardId, { 'promonth': true, 'prop_unit': true, 'probegindate': true, 'probenddate': true });
  775. }
  776. this.editCardData(formData);*/
  777. // let pk_psndoc_sub = v.values.pk_psndoc_sub.value;
  778. // this.getCardData(pk_psndoc_sub, 'edit');
  779. });
  780. // this.props.editTable.getCheckedRows(tableid);
  781. }
  782. //编辑卡片时数据
  783. editCardData() {
  784. let {json, pk_org} = this.state;
  785. let extendParam = {
  786. pk_org: pk_org
  787. }
  788. // this.props.form.setFormItemAutoFocus(cardId, 'contractnum');
  789. this.props.form.setFormStatus(cardId, 'edit');
  790. this.props.button.setButtonVisible(['newAdd', 'edit', 'delete', 'text', 'refresh', 'takeEffect', 'file', 'query'], false);
  791. this.props.button.setButtonVisible(['save1', 'cancel1'], true);
  792. this.header.setCardPaginationVisibleFn(false);
  793. this.header.getCardFormId(cardId);
  794. chectFormAction('', cardId, this.props, [cardId], this.config.appcode, extendParam);
  795. }
  796. //卡片日期设置
  797. handleEditFormDate(props, moduleId, key, value) {
  798. chectFormAction(key, moduleId, props, [cardId]);
  799. }
  800. //form编辑前事件
  801. handleEditBefore(props, moduleId, key, value, data) {
  802. if (key == 'pk_conttext') {
  803. let that = this;
  804. let meta = that.props.meta.getMeta();
  805. let pk_org = this.state.pk_org;
  806. meta[moduleId].items.find(item => item.attrcode === key).queryCondition = function () {
  807. return {
  808. "pk_org": pk_org,
  809. "GridRefActionExt": "nccloud.web.hrcm.make.sqlbuilder.ContModelGridSqlBuilder"
  810. }
  811. };
  812. that.props.meta.setMeta(meta);
  813. }
  814. return true;
  815. }
  816. // 点击生效事件
  817. isTakeEffectEvent(step) {
  818. let pks = this.getPkPsndocSub();
  819. !!pks && handdleCheckedData(pks, 'effect', 'contract', () => {
  820. this.takeEffectEvent(step);
  821. });
  822. }
  823. //获取主键
  824. getPkPsndocSub() {
  825. let {isDataListPage, json} = this.state;
  826. let isCard = isDataListPage ? false : true;
  827. let pks = [];
  828. if (isCard) {
  829. pks = this.props.form.getAllFormValue(cardId).rows[0].values.pk_psndoc_sub.value;
  830. } else {
  831. let checkedData = this.props.editTable.getCheckedRows(tableid);
  832. if (!checkedData.length) {
  833. toast({color: 'warning', content: json['hrcm-000020']});
  834. return;
  835. }
  836. checkedData.map((v) => {
  837. pks.push(v.data.values.pk_psndoc_sub.value);
  838. })
  839. }
  840. return pks;
  841. }
  842. //是否生效
  843. takeEffectEvent(step, info) {
  844. let pageType = '';
  845. let formData = [];
  846. let stepNum = step ? step : '0';
  847. let {isDataListPage, json, storage_pk} = this.state;
  848. let isCard = isDataListPage ? false : true;
  849. let pks = this.getPkPsndocSub();
  850. if (!isCard) {
  851. pageType = 'list';
  852. } else {
  853. pageType = 'card';
  854. }
  855. ajax({
  856. url: '/nccloud/hrcm/make/MakeEffectiveAction.do',
  857. data: {
  858. baseParam: {
  859. step: stepNum,
  860. pageType: pageType,
  861. info2: info
  862. },
  863. selectCtrtpks: pks
  864. },
  865. success: res => {
  866. if (res.success && res.data) {
  867. let data = res.data;
  868. let info = res.data.info || null;
  869. if (data.step == '99') {
  870. if (isCard) {
  871. let allpks = cacheTools.get('allpks') || [];
  872. let index = 0;
  873. let len = allpks.length;
  874. len && allpks.forEach((v, i) => {
  875. if (v == pks) {
  876. allpks.splice(i, 1);
  877. if (i < len - 1) {
  878. index = i;
  879. } else if (i == len - 1) {
  880. index = i - 1;
  881. }
  882. }
  883. })
  884. cacheTools.set('allpks', allpks);
  885. this.fetchTableData({key: allpks[index]});
  886. } else {
  887. this.fetchTableData({key: storage_pk});
  888. }
  889. } else {
  890. let fn = {
  891. sureFn: this.takeEffectEvent
  892. }
  893. let content = {
  894. content: data.msg,
  895. sureName: json['hrcm-000018'],
  896. cancelName: json['hrcm-000019']
  897. }
  898. this.promptBoxModal(content, fn, data.step, info);
  899. }
  900. }
  901. }
  902. })
  903. }
  904. // 关闭附件
  905. onHideUploader() {
  906. this.setState({
  907. showUploader: false
  908. })
  909. };
  910. //批量删除
  911. deleteBatchesData(v) {
  912. let pks;
  913. if (!!v) {
  914. pks = v && v.values.pk_psndoc_sub.value;
  915. } else {
  916. pks = this.getPkPsndocSub();
  917. }
  918. !!pks && handdleCheckedData(pks, 'delete', 'contract', () => {
  919. this.delPrompt(pks)
  920. });
  921. }
  922. // 删除确认弹窗
  923. delPrompt(delDataPks) {
  924. let fn = {
  925. sureFn: () => {
  926. this.deleteData(delDataPks)
  927. }
  928. }
  929. let content = {
  930. content: this.state.json['hrcm-000021']
  931. }
  932. this.promptBoxModal(content, fn);
  933. }
  934. //行删除事件
  935. // deleteRowData(v){
  936. // let pks = v && v.values.pk_psndoc_sub.value;
  937. // handdleCheckedData(pks, 'delete', 'contract', ()=>{
  938. // this.delPrompt(pks);
  939. // });
  940. // }
  941. // //是否删除行上数据
  942. // isDeleteRowData(delDataPks){
  943. // let { json } = this.state;
  944. // let fn = {
  945. // sureFn: ()=>{ this.deleteData(delDataPks) }
  946. // }
  947. // let content = {
  948. // content: json['hrcm-000021']
  949. // }
  950. // this.promptBoxModal(content,fn);
  951. // }
  952. //删除数据
  953. deleteData(PKsData) {
  954. let {storage_pk, isDataListPage, pk_org} = this.state;
  955. let isCard = isDataListPage ? false : true;
  956. ajax({
  957. url: '/nccloud/hrcm/make/MakeDeleteAction.do',
  958. data: {
  959. pk_org: pk_org,
  960. modename: 'hi_psndoc_ctrt', //此处暂时写死
  961. isCard: isCard,
  962. allpks: PKsData
  963. },
  964. success: res => {
  965. if (res.success && res.data) {
  966. if (isCard) {
  967. let allpks = cacheTools.get('allpks') || [];
  968. let index = 0;
  969. let len = allpks.length;
  970. len && allpks.forEach((v, i) => {
  971. if (v == PKsData) {
  972. allpks.splice(i, 1);
  973. if (i < len - 1) {
  974. index = i;
  975. } else if (i == len - 1) {
  976. index = i - 1;
  977. }
  978. }
  979. })
  980. cacheTools.set('allpks', allpks);
  981. if (allpks.length === 0) {
  982. this.header.handleBackBtn(() => {
  983. this.setState({
  984. isDataListPage: true
  985. }, () => {
  986. this.props.button.setButtonVisible(['newAdd', 'delete', 'refresh', 'takeEffect', 'query'], true);
  987. this.props.button.setButtonVisible(['save1', 'cancel1', 'text', 'file', 'edit'], false);
  988. this.fetchTableData({key: allpks[index]});
  989. })
  990. })
  991. } else {
  992. this.fetchTableData({key: allpks[index]});
  993. }
  994. } else {
  995. this.fetchTableData({key: storage_pk});
  996. }
  997. }
  998. }
  999. })
  1000. }
  1001. sendContract(v, record) {
  1002. let pks = v
  1003. ajax({
  1004. url: '/nccloud/axj/hr/ContractSignAction.do',
  1005. data: {
  1006. billId: pks
  1007. },
  1008. success: res => {
  1009. console.log(res)
  1010. if (res.success && !!res.data) {
  1011. toast({color: 'success', content: "合同发送成功!"});
  1012. } else {
  1013. toast({color: 'warning', content: res.error.message});
  1014. }
  1015. }
  1016. })
  1017. }
  1018. //合同文本
  1019. contractText(v, record) {
  1020. let pks = v;
  1021. let json = this.state.json;
  1022. if (IsMac(json['hrcm-000040'])) {
  1023. return false
  1024. }
  1025. ajax({
  1026. url: '/nccloud/hrcm/templet/ContractTextViewAction.do',
  1027. data: {
  1028. pk_org: this.state.pk_org,
  1029. pk_psndoc_subs: pks,
  1030. },
  1031. success: res => {
  1032. if (res.success && !!res.data) {
  1033. // let protocol = window.location.protocol;
  1034. // let host = window.location.host;
  1035. // let openUrl = "uclient://start/" + protocol + "//" + host + res.data;
  1036. // // let winOpen = window.open('','_self');
  1037. // top.location.href = openUrl;
  1038. if (this.state.isDataListPage) {
  1039. this.state.nodeRefs.wpsview.openView([{data: record}], 'ct')
  1040. } else {
  1041. /*获取表单所有数据*/
  1042. let formData = this.props.form.getAllFormValue(cardId).rows;
  1043. this.state.nodeRefs.wpsview.openView(formData, 'ct')
  1044. }
  1045. } else {
  1046. toast({color: 'warning', content: res.error.message});
  1047. }
  1048. }
  1049. })
  1050. }
  1051. //操作翻页方法
  1052. changePagination(pageInfo) {
  1053. const {conditions} = this.state
  1054. this.setState({
  1055. pageInfo
  1056. }, () => {
  1057. this.fetchTableData({conditions});
  1058. })
  1059. }
  1060. //改变每页展示数据量
  1061. pageSizeSelect(pageInfo) {
  1062. const {conditions} = this.state
  1063. this.setState({
  1064. pageInfo
  1065. }, () => {
  1066. this.fetchTableData({conditions});
  1067. })
  1068. }
  1069. //取消编辑态
  1070. cancelEditStatus() {
  1071. let {json} = this.state;
  1072. let fn1 = {
  1073. sureFn: this.updateShowMode.bind(this)
  1074. }
  1075. let content = {
  1076. content: json['hrcm-000022']
  1077. }
  1078. this.promptBoxModal(content, fn1, 'browse');
  1079. }
  1080. //附件管理
  1081. attachManage(record) {
  1082. let billId, billNo;
  1083. if (!!record) {
  1084. billId = record.values.pk_psndoc_sub.value;
  1085. billNo = record.values.contractnum.value
  1086. } else {
  1087. let cardData = this.props.form.getAllFormValue(cardId).rows[0].values;
  1088. billId = cardData.pk_psndoc_sub.value;
  1089. billNo = cardData.contractnum.value;
  1090. }
  1091. handdleCheckedData(billId, 'attachment', 'contract', () => {
  1092. this.setState({
  1093. showUploader: true,
  1094. billId: billId,
  1095. billNo: billNo
  1096. })
  1097. });
  1098. }
  1099. //打开查询
  1100. listQuery() {
  1101. let {pk_org} = this.state;
  1102. this.props.search.openAdvSearch('listquery', true, () => {
  1103. let meta = this.props.meta.getMeta();
  1104. let items = meta.listquery.items;
  1105. items.length > 0 && items.map((item, index) => {
  1106. if (item.attrcode === 'pk_psnjob.pk_dept') {
  1107. item.queryCondition = {
  1108. pk_hrorg: pk_org
  1109. }
  1110. } else if (item.attrcode === 'pk_conttext') {
  1111. item.queryCondition = {
  1112. pk_org: pk_org,
  1113. GridRefActionExt: 'nccloud.web.hrcm.make.sqlbuilder.ContModelGridSqlBuilder'
  1114. }
  1115. }
  1116. })
  1117. this.props.meta.setMeta(meta);
  1118. });
  1119. }
  1120. // 查询数据
  1121. searchData = () => {
  1122. // let conditions = props.search.getAllSearchData('query').conditions || [];
  1123. let getConditions = this.props.search.getQueryInfo('listquery', true);
  1124. let conditions = getConditions;
  1125. this.fetchTableData({conditions: conditions});
  1126. this.setState({
  1127. conditions
  1128. })
  1129. }
  1130. // 统一处理按钮事件
  1131. onBtnOperation(props, btncode) {
  1132. switch (btncode) {
  1133. case 'newAdd':
  1134. this.signNode.showNewIncreased(true)
  1135. break;
  1136. case 'edit':
  1137. this.modifyCheckData();
  1138. break;
  1139. case 'delete':
  1140. this.deleteBatchesData();
  1141. break;
  1142. case 'text':
  1143. let cardData = this.props.form.getAllFormValue(cardId);
  1144. let pk_psndoc_sub = cardData.rows[0].values.pk_psndoc_sub.value;
  1145. this.contractText(pk_psndoc_sub);
  1146. break;
  1147. case 'toXyy':
  1148. let selectRows = this.props.editTable.getCheckedRows(tableid);
  1149. let pk_psndoc_sub1 = selectRows && selectRows.length && selectRows[0].data.values.pk_psndoc_sub.value;
  1150. pk_psndoc_sub1 ? this.sendContract(pk_psndoc_sub1) : toast({color: 'warning', content: "请选择一条需求发起的合同!"});;
  1151. break;
  1152. case 'refresh':
  1153. this.refreshTableData(true);
  1154. break;
  1155. case 'save1':
  1156. this.saveTableData();
  1157. break;
  1158. case 'cancel1':
  1159. this.cancelEditStatus();
  1160. break;
  1161. case 'takeEffect':
  1162. this.isTakeEffectEvent();
  1163. break;
  1164. case 'file':
  1165. this.attachManage();
  1166. break;
  1167. case 'query':
  1168. this.listQuery();
  1169. break;
  1170. default:
  1171. break;
  1172. }
  1173. }
  1174. render() {
  1175. let {button, editTable, cardPagination, search, form} = this.props;
  1176. const {createCardPagination} = cardPagination;
  1177. let {createButtonApp} = button;
  1178. let {createEditTable} = editTable;
  1179. let {NCCreateSearch} = search;
  1180. let {createForm} = form;
  1181. let {
  1182. pageInfo,
  1183. isVisiblePagination,
  1184. isDataListPage,
  1185. rowData,
  1186. pk_org,
  1187. showUploader,
  1188. billId,
  1189. billNo,
  1190. json,
  1191. oid,
  1192. nodeRefs
  1193. } = this.state;
  1194. return (
  1195. <div className="nc-single-table nc-bill-card" ref="getContainerDom">
  1196. <Header
  1197. {...this.props}
  1198. ref={node => {
  1199. this.header = node
  1200. }}
  1201. onBtnOperation={this.onBtnOperation.bind(this)}
  1202. handleBackClick={this.handleBackClick.bind(this)}
  1203. searchOrganizationChange={this.searchOrganizationChange.bind(this)}
  1204. handleCardPagination={this.handleCardPagination.bind(this)}
  1205. cancelEditStatus={this.cancelEditStatus.bind(this)}
  1206. >
  1207. </Header>
  1208. <div className="content">
  1209. {/* 生成表格 */}
  1210. {isDataListPage ? this.getTableListData() :
  1211. <div className="header-cardPagination-area">
  1212. {createForm(cardId, {
  1213. useFixedHeader: true,
  1214. onAfterEvent: this.handleEditFormDate.bind(this),
  1215. onBeforeEvent: this.handleEditBefore.bind(this)
  1216. // onBeforeEvent: this.handleEditFormDateBefore.bind(this)
  1217. })}
  1218. </div>
  1219. }
  1220. {/* 操作翻页 */}
  1221. <Pagination
  1222. {...this.props}
  1223. pageInfo={pageInfo}
  1224. isVisiblePagination={isVisiblePagination}
  1225. changePagination={this.changePagination.bind(this)}
  1226. pageSizeSelect={this.pageSizeSelect.bind(this)}
  1227. />
  1228. </div>
  1229. <div style={{display: "none"}}>
  1230. {
  1231. NCCreateSearch('listquery', {
  1232. clickSearchBtn: () => {
  1233. this.searchData()
  1234. },
  1235. onlyShowAdvArea: false,
  1236. showAdvSearchPlanBtn: true,
  1237. saveSearchPlan: true,
  1238. oid: oid,
  1239. onlyShowSuperBtn: true
  1240. })
  1241. }
  1242. </div>
  1243. {/* 调用新增组件 */}
  1244. <SignModal
  1245. {...this.props}
  1246. pkOrg={pk_org} //组织编码必传
  1247. ref={node => {
  1248. this.signNode = node
  1249. }}
  1250. appCode={this.config.appcode}
  1251. nodeType={'sign'}
  1252. fetchTableData={this.fetchTableData.bind(this)}
  1253. storageOrgData={this.storageOrgData.bind(this)}
  1254. />
  1255. {/* 附件管理 */}
  1256. {showUploader && <NCUploader
  1257. uploadTitle={this.state.json["cm6011-000062"] /*多语: 附件管理*/}
  1258. billId={billId}
  1259. billNo={billNo}
  1260. placement={'top'}
  1261. // getGroupList = {this.getGroupList}
  1262. onHide={this.onHideUploader} // 关闭功能
  1263. // beforeUpload={this.beforeUpload}
  1264. />
  1265. }
  1266. <WpsModal
  1267. {...this.props}
  1268. onRef={ref => nodeRefs.wpsview = ref}
  1269. appcode={getAppPageConfig().appcode}
  1270. pk_org={this.state.storageOrgData}
  1271. />
  1272. </div>
  1273. );
  1274. }
  1275. }
  1276. export default CMSign;