diff --git a/src/ssctp b/src/ssctp deleted file mode 160000 index 511d9d5..0000000 --- a/src/ssctp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 511d9d5102ffd8c554fb851c6ca133e91bf11a5f diff --git a/src/ssctpaaa/dooroad/affixInterfaceSetting/config/BatchAdd.js b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/BatchAdd.js new file mode 100644 index 0000000..aa19116 --- /dev/null +++ b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/BatchAdd.js @@ -0,0 +1,114 @@ +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton } = base; + +export default class BatchAddModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + onEnter = () => { + this.props.form.setFormStatus('ssctp_accessory_form', 'edit') + this.props.form.EmptyAllFormValue('ssctp_accessory_form') + } + + onButtonClick = (props, key) => { + const { + onHide, + } = props + if (key === 'batch_save') { // 保存 拆行 + this.batchSave() + } else if (key === 'batch_cancel') { // 取消 + onHide('cancel') + } + } + + batchSave = () => { + const { + form: { getAllFormValue, isCheckNow, }, + headSaveHandle, onHide, + } = this.props + if (!isCheckNow('ssctp_accessory_form')) return // 必输校验 + + const values = getAllFormValue('ssctp_accessory_form').rows[0].values + const formVals = this.copyFormVals(values) + const { + pk_org, pk_transtype, + } = values + + const pk_orgArray = pk_org.value.split(','), + pk_transtypeArray = pk_transtype.value.split(','), + pk_orgDisplayArray = pk_org.display.split(','), + pk_transtypeDisplayArray = pk_transtype.display.split(',') + let index = -1 + while(++index < pk_orgArray.length) { + const pk_orgVal = pk_orgArray[index], pk_orgDisplay = pk_orgDisplayArray[index] + let _index = -1 + while(++_index < pk_transtypeArray.length) { + const pk_transtypeVal = pk_transtypeArray[_index], pk_transtypeDisplay = pk_transtypeDisplayArray[_index] + + formVals.pk_org.value = pk_orgVal + formVals.pk_org.display = pk_orgDisplay + formVals.pk_transtype.value = pk_transtypeVal + formVals.pk_transtype.display = pk_transtypeDisplay + + this.props.editTable.addRow('ssctp_accessory_list', 0, false, formVals) + } + } + + onHide('save') + headSaveHandle() + } + + // 拷贝行数据 + copyFormVals = (data) => { + const values = {} + for (let attr in data) { + values[attr] = { + value: data[attr].value, + display: data[attr].display, + } + } + return values + } + + render() { + const { + props: { + show, + multiLang, + onHide, + form: { createForm, }, + }, + state: {}, + onEnter, + onButtonClick, + } = this + + return ( + onHide('cancel')} + onEnter={onEnter} + size='lg' + > + + {multiLang['701010DOOROAD-020']} + + + {createForm('ssctp_accessory_form', { + isNoStandard: true, + })} + + + onButtonClick(this.props, 'batch_save')}>{multiLang['701010DOOROAD-006']} + onButtonClick(this.props, 'batch_cancel')}>{multiLang['701010DOOROAD-007']} + + + ) + } +} +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/affixInterfaceSetting/config/events/async.js b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/events/async.js new file mode 100644 index 0000000..7a884ac --- /dev/null +++ b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/events/async.js @@ -0,0 +1,79 @@ +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ +import { requestPromise, /* setStatePromise ,*/ } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @desc 查询 + * @method asyncQry + */ +async function asyncQry() { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRAccessoryShowQueryAction.do`, + data: {}, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 保存 + * @method asyncSave + */ +async function asyncSave(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRAccessoryShowSaveAction.do`, + data, + hasErrCallBack: true, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 删除 + * @method asyncDel + */ +async function asyncDel(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRAccessoryShowDelAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 编辑后事件查询 + * @method asyncOtherSelect + */ +async function asyncOtherSelect(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtherSelectOtsAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export { + asyncQry, + asyncSave, + asyncDel, + asyncOtherSelect, +} +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/affixInterfaceSetting/config/events/initTemplate.js b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/events/initTemplate.js new file mode 100644 index 0000000..65d0b92 --- /dev/null +++ b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/events/initTemplate.js @@ -0,0 +1,60 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { + getMultiLang, +} from 'nc-lightapp-front'; + +export default function ({ + createUIDom, meta: { setMeta }, + button: { setButtons, createOprationButton, setButtonDisabled,}, +}) { + const that = this + createUIDom({}, function({ template, button }) { + getMultiLang({moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: multiLang => { + // 列表参照过滤 + template.ssctp_accessory_list.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // 批量新增参照过滤 + template.ssctp_accessory_form.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // // 添加操作列 + // template.ssctp_accessory_list.items.push({ + // label: multiLang['701010DOOROAD-013'], + // attrcode: "opr", + // itemtype: "customer", + // visible: true, + // width: "100px", + // fixed: "right", + // render: (node, values, idx) => { + // return createOprationButton(['param'], { + // area: 'list_btnArea', + // onButtonClick: (props, key) => { + // that.showParamModal(values, idx) + // } + // }); + // } + // }) + + setMeta(template); + setButtons(button); + that.setState({multiLang}); + + that.changePageStatu('browse') + setButtonDisabled({Delete_head: true}) + that.listQry() + + }}) + }); +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/affixInterfaceSetting/config/index.js b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/index.js new file mode 100644 index 0000000..ca01b8d --- /dev/null +++ b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/index.js @@ -0,0 +1,286 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import { createPage, promptBox, toast, } from "nc-lightapp-front"; +import initTemplate from "./events/initTemplate.js"; +import BillListStyle from 'ssccommon/components/bill-list'; +import AffixInterfaceSettingModal from './modal.js' +import { + asyncSave, + asyncQry, + asyncDel, + asyncOtherSelect, +} from './events/async.js' +import BatchAddModal from './BatchAdd.js' + +class AffixInterfaceSetting extends Component { + constructor(props) { + super(props); + this.state = { + showModal: false, // 弹窗显示 + multiLang: {}, // 多语 + showBatchAddModal: false, // 批量添加 + pageStatus: 'browse', // 页面状态 + }; + + initTemplate.call(this, props); + } + + componentDidMount() { + // 浏览器原生提示 + window.onbeforeunload = () => { + if (this.state.pageStatus === 'edit') return '' + } + } + + // 改变页面状态 + changePageStatu = status => { + this.props.button.setButtonVisible({ + Add_head: true, + Edit_head: status === 'browse', + Delete_head: true, + Save_head: status === 'edit', + Cancel_head: status === 'edit', + BatchAdd: status === 'browse', + }) + this.props.editTable.setStatus('ssctp_accessory_list', status) + this.setState({pageStatus: status}) + this.props.button.setMainButton('Add_head', status === 'browse') + } + + // 头部按钮组事件 + headerBtnEventDistribute = () => ({ + Add_head: () => this.headAddHandle(), + Edit_head: () => this.headEditHandle(), + Delete_head: () => this.headDelHandle(), + Save_head: () => this.headSaveHandle(), + Cancel_head: () => this.headCancelHandle(), + BatchAdd: () => this.setState({showBatchAddModal: true}) + }) + + // 增加 + headAddHandle = () => { + const rows = this.props.editTable.getAllData('ssctp_accessory_list').rows + this.props.editTable.addRow('ssctp_accessory_list', rows.length, true, {}) + this.changePageStatu('edit') + } + + // 修改 + headEditHandle = () => { + this.changePageStatu('edit') + } + + // 取消提示 + headCancelHandle = () => { + // 浏览态 + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-007'], + content: this.state.multiLang['701010DOOROAD-019'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureCancel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } + + // 确定取消 + sureCancel = () => { + // 重新查询列表 + this.listQry() + // 浏览态 + this.changePageStatu('browse') + } + + // 隐藏弹窗 + onHide = () => { + this.setState({showModal: false}) + } + + // 显示弹窗 + showParamModal = (row, index) => { + this.setState({showModal: true}) + } + + // 删除提示 + headDelHandle = () => { + if (this.state.pageStatus === 'browse') { + const checkedRows = this.props.editTable.getCheckedRows('ssctp_accessory_list') + if (!checkedRows.length) return + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-003'], + content: this.state.multiLang['701010DOOROAD-018'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureDel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } else { + const checkedIndex = this.props.editTable.getCheckedRows('ssctp_accessory_list').map(row => row.index) + if (!checkedIndex.length) return + this.props.editTable.deleteTableRowsByIndex('ssctp_accessory_list', checkedIndex) + } + } + + // 列表查询 + listQry = async (isRefresh = false) => { + const response = await asyncQry() + const {success, data} = response + if (!success) return + this.props.editTable.setTableData('ssctp_accessory_list', data ? data.ssctp_accessory_list : {rows: []}) + if (isRefresh) { + toast({title: this.state.multiLang['701010DOOROAD-022'], duration: 5}) + } + } + + // 保存 + headSaveHandle = async () => { + const { + editTable: { filterEmptyRows, checkRequired, getAllData, setTableData}, + } = this.props + filterEmptyRows('ssctp_accessory_list', ['showtype']) + const tableData = getAllData('ssctp_accessory_list') + if (!checkRequired('ssctp_accessory_list', tableData.rows)) return + const response = await asyncSave({ssctp_accessory_list: tableData}) + if (!response) return + const {success, data} = response + if (!success) return + setTableData('ssctp_accessory_list', data ? data.ssctp_accessory_list : {rows: []}) + this.changePageStatu('browse') + toast({ title: this.state.multiLang['701010DOOROAD-016'], duration: 5}) + } + + // 确定删除 + sureDel = async () => { + const { + deleteTableRowsByIndex, getCheckedRows, getAllData, setTableData, + } = this.props.editTable + + const toDelIdxs = getCheckedRows('ssctp_accessory_list').map(row => row.index) + deleteTableRowsByIndex('ssctp_accessory_list', toDelIdxs) + + const response = await asyncDel({ssctp_accessory_list: getAllData('ssctp_accessory_list')}) + const {success, data} = response + if (!success || !data) return + + setTableData('ssctp_accessory_list', data.ssctp_accessory_list) + toast({ title: this.state.multiLang['701010DOOROAD-017'], duration: 5}) + } + + // 列表编辑后事件 + onAfterEvent = async (props, areaId, key, currentValue, changedrows, index, row, ...others) => { + if (key === 'pk_transtype') { + const transtype_code = currentValue.refcode || '' + props.editTable.setValByKeyAndIndex(areaId, index, 'transtype_code', {value: transtype_code, display: transtype_code}) + } + + // if (key !== 'pk_ots') { + // return true + // } + // const { + // editTable: { setValByKeyAndIndex, }, + // } = props + // if (!currentValue.refpk) { + // setValByKeyAndIndex(areaId, index, 'url', {value: '', display: ''}) + // return true + // } + // const response = await asyncOtherSelect({pk_ots: currentValue.refpk}) + // const {success, data} = response + // if (!success || !data) return true + // setValByKeyAndIndex(areaId, index, 'url', {value: `${data.ip}:${data.port}`, display: `${data.ip}:${data.port}`}) + } + + // 列表选中变更事件 + selectedChange = (props, areaId, newVal, oldVal) => { + this.props.button.setButtonDisabled({Delete_head: !newVal}) + } + + // 刷新 + refreshButtonEvent = () => { + this.listQry(true) + } + + render() { + const { + state: { + multiLang, + showBatchAddModal, + pageStatus, + }, + props: { + getSearchParam, + editTable: { createEditTable, }, + }, + headerBtnEventDistribute, + onHide, + onAfterEvent, + selectedChange, + changePageStatu, + refreshButtonEvent, + headSaveHandle, + } = this + + return ( + + + + {/* 头部按钮组 */} + + + + + {/* 列表 */} + {createEditTable( + 'ssctp_accessory_list', + { + showIndex: true, + showCheck: true, + isAddRow: true, + onAfterEvent, + selectedChange, + adaptionHeight: true, + }, + )} + + + + + { + this.setState({showBatchAddModal: false}) + if (action === 'save') { + changePageStatu('edit') + } else { + changePageStatu('browse') + } + }} + setPageEdit={() => changePageStatu('edit')} + headSaveHandle={headSaveHandle} + {...this.state} + {...this.props} + /> + + + ); + } +} + +AffixInterfaceSetting = createPage({ mutiLangCode: '7010' })(AffixInterfaceSetting); +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/affixInterfaceSetting/config/modal.js b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/modal.js new file mode 100644 index 0000000..d54afc6 --- /dev/null +++ b/src/ssctpaaa/dooroad/affixInterfaceSetting/config/modal.js @@ -0,0 +1,51 @@ +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton,} = base; + +export default class AffixInterfaceSettingModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + render() { + const { + props: { + showModal, + multiLang, + editTable: { createEditTable, }, + button: { createButtonApp, }, + onHide, + }, + state: {}, + } = this + + return ( + + + {multiLang['701010DOOROAD-010']} + + + {createEditTable('param', { + showIndex: true, + showCheck: true, + isAddRow: true, + })} + + + {createButtonApp({ + area: 'form_btnArea', + onButtonClick: (props, key) => {}, + })} + + + ) + } +} +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/businessSysRegis/config/events/async.js b/src/ssctpaaa/dooroad/businessSysRegis/config/events/async.js new file mode 100644 index 0000000..0c5df06 --- /dev/null +++ b/src/ssctpaaa/dooroad/businessSysRegis/config/events/async.js @@ -0,0 +1,78 @@ +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ +import { requestPromise, /* setStatePromise ,*/ } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @desc 查询 + * @method asyncQry + */ +async function asyncQry() { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtsQueryAction.do`, + data: {}, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 新增 + * @method asyncAdd + */ +async function asyncAdd(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtsAddAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 删除 + * @method asyncDel + */ +async function asyncDel(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtsDelAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 保存 + * @method asyncSave + */ +async function asyncSave(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtsSaveAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export { + asyncQry, + asyncAdd, + asyncDel, + asyncSave, +} +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/businessSysRegis/config/events/initTemplate.js b/src/ssctpaaa/dooroad/businessSysRegis/config/events/initTemplate.js new file mode 100644 index 0000000..49d50e2 --- /dev/null +++ b/src/ssctpaaa/dooroad/businessSysRegis/config/events/initTemplate.js @@ -0,0 +1,48 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { + getMultiLang, +} from 'nc-lightapp-front'; + +export default function ({ + createUIDom, meta: { setMeta }, + button: { setButtons, createOprationButton, setPopContent, }, +}) { + const that = this + createUIDom({}, function({ template, button }) { + getMultiLang({moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: multiLang => { + + // 添加操作列 + template.ssctp_ots_list.items.push({ + label: multiLang['701010DOOROAD-013'], + attrcode: "opr", + itemtype: "customer", + visible: true, + width: "120px", + fixed: "right", + render: (node, values, idx) => { + return createOprationButton(['Edit', 'Delete'], { + area: 'list_btnArea', + onButtonClick: (props, key) => { + if ( key === 'Edit') { + that.setRowEditable(values) + } else if (key === 'Delete') { + that.delRow(values, idx) + } + } + }); + } + }) + + setMeta(template); + setButtons(button); + that.setState({multiLang}) + + setPopContent('Delete', multiLang['701010DOOROAD-014']) + + // 初始化查询 + that.listQry() + + }}) + }); +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/businessSysRegis/config/index.js b/src/ssctpaaa/dooroad/businessSysRegis/config/index.js new file mode 100644 index 0000000..6e1f65b --- /dev/null +++ b/src/ssctpaaa/dooroad/businessSysRegis/config/index.js @@ -0,0 +1,171 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import { createPage, toast, } from "nc-lightapp-front"; +import initTemplate from "./events/initTemplate.js"; +import BillListStyle from 'ssccommon/components/bill-list'; +import BusinessSysRegisModal from './modal.js' +import { + asyncQry, + asyncSave, + asyncAdd, + asyncDel, +} from './events/async.js' + +class BusinessSysRegis extends Component { + constructor(props) { + super(props); + this.state = { + showModal: false, // 显示弹窗 + multiLang: {}, // 多语 + modalStatu: 'add', // 弹窗状态 增加/修改 + }; + + initTemplate.call(this, props); + } + + componentDidMount() { + // 浏览器原生提示 + window.onbeforeunload = () => { + if (this.state.showModal) return '' + } + } + + // 头部按钮组事件 + headerBtnEventDistribute = () => ({ + Add: () => this.setState({showModal: true, modalStatu: 'add'}), + }) + + // 弹窗隐藏 + onHide = () => { + this.props.form.EmptyAllFormValue('ssctp_ots_form') + this.setState({showModal: false}) + } + + // 保存 + modalSave = async () => { + const { + props: { + form: { getAllFormValue, isCheckNow, }, + table: { setAllTableData, }, + }, + state: { modalStatu, multiLang,}, + } = this + + if (!isCheckNow('ssctp_ots_form')) return // 表单校验 + + if (modalStatu === 'add') { + const response = await asyncAdd({ + ssctp_ots_form: getAllFormValue('ssctp_ots_form'), + }) + const {success, data} = response + if (!success || !data) return + setAllTableData('ssctp_ots_list', data.ssctp_ots_list) + this.setState({showModal: false}) + toast({ title: multiLang['701010DOOROAD-016'], duration: 5}) + } else { + const response = await asyncSave({ + ssctp_ots_form: getAllFormValue('ssctp_ots_form'), + }) + const {success, data} = response + if (!success || !data) return + setAllTableData('ssctp_ots_list', data.ssctp_ots_list) + this.setState({showModal: false}) + toast({ title: multiLang['701010DOOROAD-016'], duration: 5}) + } + } + + // 列表查询 + listQry = async (isRefresh = false) => { + const response = await asyncQry() + const {success, data} = response + if (!success) return + this.props.table.setAllTableData('ssctp_ots_list', data ? data.ssctp_ots_list : {rows: []}) + if (isRefresh) { + toast({title: this.state.multiLang['701010DOOROAD-022'], duration: 5}) + } + } + + // 修改 + setRowEditable = values => { + this.setState({showModal: true, modalStatu: 'edit'}) + this.props.form.setFormItemsDisabled('ssctp_ots_form', { 'code': true }); + this.props.form.setAllFormValue({ssctp_ots_form: {rows: [{values}]}}) + } + + // 删除 + delRow = async (record, idx) => { + const values = {} + for (let attr in record) { + if (attr !== 'numberindex' && attr !== 'key' && typeof record[attr] === 'object') { + values[attr] = { value: record[attr].value } + } + } + const response = await asyncDel({ssctp_ots_list: {areaType: 'form', rows: [{values}]}}) + const {success, data} = response + if (!success) return + this.props.table.setAllTableData('ssctp_ots_list', data ? data.ssctp_ots_list : {rows: []}) + toast({ title: this.state.multiLang['701010DOOROAD-017'], duration: 5}) + } + + // 刷新 + refreshButtonEvent = () => { + this.listQry(true) + } + + render() { + const { + state: { + multiLang, + }, + props: { + getSearchParam, + table: { createSimpleTable, }, + }, + headerBtnEventDistribute, + onHide, + modalSave, + refreshButtonEvent, + } = this + + return ( + + + + {/* 头部按钮组 */} + + + + + {/* 列表 */} + {createSimpleTable( + 'ssctp_ots_list', + { + showIndex: true, + }, + )} + + + + + + ); + } +} + +BusinessSysRegis = createPage({ mutiLangCode: '7010' })(BusinessSysRegis); +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/businessSysRegis/config/modal.js b/src/ssctpaaa/dooroad/businessSysRegis/config/modal.js new file mode 100644 index 0000000..9a2bff0 --- /dev/null +++ b/src/ssctpaaa/dooroad/businessSysRegis/config/modal.js @@ -0,0 +1,70 @@ +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton,} = base; + +export default class BusinessSysRegisModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + // 弹窗打开时 + onEnter = () => { + const { + form: {setFormStatus,}, + } = this.props + setFormStatus('ssctp_ots_form', 'edit') + } + + render() { + const { + props: { + showModal, + onHide, + modalSave, + multiLang, + modalStatu, + form: { createForm, }, + button: { createButtonApp, }, + }, + state: {}, + onEnter, + } = this + + return ( + + + + { + modalStatu === 'add' ? + multiLang['701010DOOROAD-004'] : + multiLang['701010DOOROAD-005'] + } + + + + {createForm('ssctp_ots_form', {})} + + + {createButtonApp({ + area: 'form_btnArea', + onButtonClick: (props, key) => { + if (key === 'Save') { + modalSave() + } else if (key === 'Cancel') { + onHide() + } + }, + })} + + + ) + } +} +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/certificateOpenMode/config/BatchAdd.js b/src/ssctpaaa/dooroad/certificateOpenMode/config/BatchAdd.js new file mode 100644 index 0000000..cd304e4 --- /dev/null +++ b/src/ssctpaaa/dooroad/certificateOpenMode/config/BatchAdd.js @@ -0,0 +1,114 @@ +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton } = base; + +export default class BatchAddModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + onEnter = () => { + this.props.form.setFormStatus('ssctp_voucheropen_form', 'edit') + this.props.form.EmptyAllFormValue('ssctp_voucheropen_form') + } + + onButtonClick = (props, key) => { + const { + onHide, + } = props + if (key === 'batch_save') { // 保存 拆行 + this.batchSave() + } else if (key === 'batch_cancel') { // 取消 + onHide('cancel') + } + } + + batchSave = () => { + const { + form: { getAllFormValue, isCheckNow, }, + saveBtnClick, onHide, + } = this.props + if (!isCheckNow('ssctp_voucheropen_form')) return // 必输校验 + + const values = getAllFormValue('ssctp_voucheropen_form').rows[0].values + const formVals = this.copyFormVals(values) + const { + pk_org, pk_transtype, + } = values + + const pk_orgArray = pk_org.value.split(','), + pk_transtypeArray = pk_transtype.value.split(','), + pk_orgDisplayArray = pk_org.display.split(','), + pk_transtypeDisplayArray = pk_transtype.display.split(',') + let index = -1 + while(++index < pk_orgArray.length) { + const pk_orgVal = pk_orgArray[index], pk_orgDisplay = pk_orgDisplayArray[index] + let _index = -1 + while(++_index < pk_transtypeArray.length) { + const pk_transtypeVal = pk_transtypeArray[_index], pk_transtypeDisplay = pk_transtypeDisplayArray[_index] + + formVals.pk_org.value = pk_orgVal + formVals.pk_org.display = pk_orgDisplay + formVals.pk_transtype.value = pk_transtypeVal + formVals.pk_transtype.display = pk_transtypeDisplay + + this.props.editTable.addRow('ssctp_voucheropen_list', 0, false, formVals) + } + } + + onHide('save') + saveBtnClick() + } + + // 拷贝行数据 + copyFormVals = (data) => { + const values = {} + for (let attr in data) { + values[attr] = { + value: data[attr].value, + display: data[attr].display, + } + } + return values + } + + render() { + const { + props: { + show, + multiLang, + onHide, + form: { createForm, }, + }, + state: {}, + onEnter, + onButtonClick, + } = this + + return ( + onHide('cancel')} + onEnter={onEnter} + size='lg' + > + + {multiLang['701010DOOROAD-020']} + + + {createForm('ssctp_voucheropen_form', { + isNoStandard: true, + })} + + + onButtonClick(this.props, 'batch_save')}>{multiLang['701010DOOROAD-006']} + onButtonClick(this.props, 'batch_cancel')}>{multiLang['701010DOOROAD-007']} + + + ) + } +} +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/certificateOpenMode/config/events/async.js b/src/ssctpaaa/dooroad/certificateOpenMode/config/events/async.js new file mode 100644 index 0000000..918a1a7 --- /dev/null +++ b/src/ssctpaaa/dooroad/certificateOpenMode/config/events/async.js @@ -0,0 +1,79 @@ +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ +import { requestPromise, /* setStatePromise ,*/ } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @desc 查询 + * @method asyncQry + */ +async function asyncQry() { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRVoucherOpenQueryAction.do`, + data: {}, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 删除 + * @method asyncDel + */ +async function asyncDel(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRVoucherOpenDelAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 保存 + * @method asyncSave + */ +async function asyncSave(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRVoucherOpenSaveAction.do`, + data, + hasErrCallBack: true, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 编辑后事件查询 + * @method asyncOtherSelect + */ +async function asyncOtherSelect(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtherSelectOtsAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export { + asyncQry, + asyncDel, + asyncSave, + asyncOtherSelect, +} +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/certificateOpenMode/config/events/initTemplate.js b/src/ssctpaaa/dooroad/certificateOpenMode/config/events/initTemplate.js new file mode 100644 index 0000000..31e5fd5 --- /dev/null +++ b/src/ssctpaaa/dooroad/certificateOpenMode/config/events/initTemplate.js @@ -0,0 +1,61 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { + getMultiLang, +} from 'nc-lightapp-front'; + +export default function ({ + createUIDom, meta: { setMeta }, + button: { setButtons, createOprationButton, setButtonDisabled,}, +}) { + const that = this + createUIDom({}, function({ template, button }) { + getMultiLang({moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: multiLang => { + + // 列表参照过滤 + template.ssctp_voucheropen_list.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // 批量新增参照过滤 + template.ssctp_voucheropen_form.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // // 添加操作列 + // template.ssctp_voucheropen_list.items.push({ + // label: multiLang['701010DOOROAD-013'], + // attrcode: "opr", + // itemtype: "customer", + // visible: true, + // width: "100px", + // fixed: "right", + // render: (node, values, idx) => { + // return createOprationButton(['Param'], { + // area: 'list_btnArea', + // onButtonClick: (props, key) => { + // that.showParamModal(values, idx) + // } + // }); + // } + // }) + + setMeta(template); + setButtons(button); + that.setState({multiLang}) + + that.changePageStatu('browse') + setButtonDisabled({Delete: true}) + that.listQry() + + }}) + }); +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/certificateOpenMode/config/index.js b/src/ssctpaaa/dooroad/certificateOpenMode/config/index.js new file mode 100644 index 0000000..5c819e6 --- /dev/null +++ b/src/ssctpaaa/dooroad/certificateOpenMode/config/index.js @@ -0,0 +1,269 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import { createPage, promptBox, toast, } from "nc-lightapp-front"; +import initTemplate from "./events/initTemplate.js"; +import BillListStyle from 'ssccommon/components/bill-list'; +import VoucherOpenModal from './modal.js' +import { + asyncQry, + asyncDel, + asyncSave, + asyncOtherSelect, +} from './events/async.js'; +import BatchAddModal from './BatchAdd.js' + +class VoucherOpenMode extends Component { + constructor(props) { + super(props); + this.state = { + showModal: false, // 显示弹窗 + multiLang: {}, // 多语 + showBatchAddModal: false, // 批量添加 + pageStatus: 'browse', // 页面状态 + }; + + initTemplate.call(this, props); + } + + componentDidMount() { + // 浏览器原生提示 + window.onbeforeunload = () => { + if (this.state.pageStatus === 'edit') return '' + } + } + + // 改变页面状态 + changePageStatu = status => { + this.props.button.setButtonVisible({ + Add: true, + Edit: status === 'browse', + Delete: true, + Save: status === 'edit', + Cancel: status === 'edit', + BatchAdd: status === 'browse', + }) + this.props.editTable.setStatus('ssctp_voucheropen_list', status) + this.setState({pageStatus: status}) + this.props.button.setMainButton('Add', status === 'browse') + } + + // 头部按钮组事件 + headerBtnEventDistribute = () => ({ + Add: () => this.addBtnClick(), + Edit: () => this.editBtnClick(), + Delete: () => this.deleteBtnClick(), + Save: () => this.saveBtnClick(), + Cancel: () => this.cancelBtnClick(), + BatchAdd: () => this.setState({showBatchAddModal: true}), + }) + + // 显示弹窗 + showParamModal = (row, index) => { + this.setState({showModal: true}) + } + + // 隐藏弹窗 + onHide = () => { + this.setState({showModal: false}) + } + + // 新增 + addBtnClick = () => { + const rows = this.props.editTable.getAllData('ssctp_voucheropen_list').rows + this.props.editTable.addRow('ssctp_voucheropen_list', rows.length, true, {}) + this.changePageStatu('edit') + } + + // 修改 + editBtnClick = () => { + this.changePageStatu('edit') + } + + // 取消 + cancelBtnClick = () => { + this.listQry() + this.changePageStatu('browse') + } + + // 列表选中变更事件 + selectedChange = (props, areaId, newVal, oldVal) => { + this.props.button.setButtonDisabled({Delete: !newVal}) + } + + // 列表查询 + listQry = async (isRefresh = false) => { + const response = await asyncQry() + const {success, data} = response + if (!success) return + this.props.editTable.setTableData('ssctp_voucheropen_list', data ? data.ssctp_voucheropen_list : {rows: []}) + if (isRefresh) { + toast({title: this.state.multiLang['701010DOOROAD-022'], duration: 5}) + } + } + + // 保存 + saveBtnClick = async () => { + const { + editTable: { filterEmptyRows, checkRequired, getAllData, setTableData}, + } = this.props + filterEmptyRows('ssctp_voucheropen_list', []) + const tableData = getAllData('ssctp_voucheropen_list') + if (!checkRequired('ssctp_voucheropen_list', tableData.rows)) return + const response = await asyncSave({ssctp_voucheropen_list: tableData}) + if (!response) return + const {success, data} = response + if (!success) return + setTableData('ssctp_voucheropen_list', data ? data.ssctp_voucheropen_list : {}) + this.changePageStatu('browse') + toast({ title: this.state.multiLang['701010DOOROAD-016'], duration: 5}) + } + + // 删除提示 + deleteBtnClick = () => { + if (this.state.pageStatus === 'browse') { + const checkedRows = this.props.editTable.getCheckedRows('ssctp_voucheropen_list') + if (!checkedRows.length) return + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-003'], + content: this.state.multiLang['701010DOOROAD-018'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureDel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } else { + const checkedIndex = this.props.editTable.getCheckedRows('ssctp_voucheropen_list').map(row => row.index) + if (!checkedIndex.length) return + this.props.editTable.deleteTableRowsByIndex('ssctp_voucheropen_list', checkedIndex) + } + } + + // 确定删除 + sureDel = async () => { + const { + deleteTableRowsByIndex, getCheckedRows, getAllData, setTableData, + } = this.props.editTable + + const toDelIdxs = getCheckedRows('ssctp_voucheropen_list').map(row => row.index) + deleteTableRowsByIndex('ssctp_voucheropen_list', toDelIdxs) + + const response = await asyncDel({ssctp_voucheropen_list: getAllData('ssctp_voucheropen_list')}) + const {success, data} = response + if (!success || !data) return + + setTableData('ssctp_voucheropen_list', data.ssctp_voucheropen_list) + toast({ title: this.state.multiLang['701010DOOROAD-017'], duration: 5}) + } + + // 列表编辑后事件 + onAfterEvent = async (props, areaId, key, currentValue, changedrows, index, row, ...others) => { + if (key === 'pk_transtype') { + const transtype_code = currentValue.refcode || '' + props.editTable.setValByKeyAndIndex(areaId, index, 'transtype_code', {value: transtype_code, display: transtype_code}) + } + + // if (key !== 'pk_ots') { + // return true + // } + // const { + // editTable: { setValByKeyAndIndex, }, + // } = props + // if (!currentValue.refpk) { + // setValByKeyAndIndex(areaId, index, 'url', {value: '', display: ''}) + // return true + // } + // const response = await asyncOtherSelect({pk_ots: currentValue.refpk}) + // const {success, data} = response + // if (!success || !data) return true + // setValByKeyAndIndex(areaId, index, 'url', {value: `${data.ip}:${data.port}`, display: `${data.ip}:${data.port}`}) + } + + // 刷新 + refreshButtonEvent = () => { + this.listQry(true) + } + + render() { + const { + state: { + multiLang, + showBatchAddModal, + pageStatus, + }, + props: { + getSearchParam, + editTable: { createEditTable, }, + }, + headerBtnEventDistribute, + onHide, + onAfterEvent, + selectedChange, + changePageStatu, + refreshButtonEvent, + saveBtnClick, + } = this + + return ( + + + + {/* 头部按钮组 */} + + + + + {/* 列表 */} + {createEditTable( + 'ssctp_voucheropen_list', + { + showIndex: true, + showCheck: true, + isAddRow: true, + onAfterEvent, + selectedChange, + adaptionHeight: true, + }, + )} + + + + + { + this.setState({showBatchAddModal: false}) + if (action === 'save') { + changePageStatu('edit') + } else { + changePageStatu('browse') + } + }} + setPageEdit={() => changePageStatu('edit')} + saveBtnClick={saveBtnClick} + {...this.state} + {...this.props} + /> + + + ); + } +} + +VoucherOpenMode = createPage({ mutiLangCode: '7010' })(VoucherOpenMode); +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/certificateOpenMode/config/modal.js b/src/ssctpaaa/dooroad/certificateOpenMode/config/modal.js new file mode 100644 index 0000000..5f1b671 --- /dev/null +++ b/src/ssctpaaa/dooroad/certificateOpenMode/config/modal.js @@ -0,0 +1,51 @@ +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton,} = base; + +export default class VoucherOpenModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + render() { + const { + props: { + showModal, + multiLang, + onHide, + editTable: { createEditTable, }, + button: { createButtonApp, }, + }, + state: {}, + } = this + + return ( + + + {multiLang['701010DOOROAD-010']} + + + {createEditTable('ssctp_voucheropen_list', { + showIndex: true, + showCheck: true, + isAddRow: true, + })} + + + {createButtonApp({ + area: 'form_btnArea', + onButtonClick: (props, key) => {}, + })} + + + ) + } +} +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/docOpen/config/BatchAdd.js b/src/ssctpaaa/dooroad/docOpen/config/BatchAdd.js new file mode 100644 index 0000000..ecd996b --- /dev/null +++ b/src/ssctpaaa/dooroad/docOpen/config/BatchAdd.js @@ -0,0 +1,121 @@ +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton } = base; + +export default class BatchAddModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + onEnter = () => { + this.props.form.setFormStatus('ssctp_detailopen_form', 'edit') + this.props.form.EmptyAllFormValue('ssctp_detailopen_form') + } + + onButtonClick = (props, key) => { + const { + onHide, + } = props + if (key === 'batch_save') { // 保存 拆行 + this.batchSave() + } else if (key === 'batch_cancel') { // 取消 + onHide('cancel') + } + } + + batchSave = () => { + const { + form: { getAllFormValue, isCheckNow, }, + saveBtnClick, onHide, + } = this.props + if (!isCheckNow('ssctp_detailopen_form')) return // 必输校验 + + const values = getAllFormValue('ssctp_detailopen_form').rows[0].values + const formVals = this.copyFormVals(values) + const { + pk_org, pk_transtype, + } = values + + const pk_orgArray = pk_org.value.split(','), + pk_transtypeArray = pk_transtype.value.split(','), + pk_orgDisplayArray = pk_org.display.split(','), + pk_transtypeDisplayArray = pk_transtype.display.split(',') + let index = -1 + while(++index < pk_orgArray.length) { + const pk_orgVal = pk_orgArray[index], pk_orgDisplay = pk_orgDisplayArray[index] + let _index = -1 + while(++_index < pk_transtypeArray.length) { + const pk_transtypeVal = pk_transtypeArray[_index], pk_transtypeDisplay = pk_transtypeDisplayArray[_index] + + formVals.pk_org.value = pk_orgVal + formVals.pk_org.display = pk_orgDisplay + formVals.pk_transtype.value = pk_transtypeVal + formVals.pk_transtype.display = pk_transtypeDisplay + + this.props.editTable.addRow('ssctp_detailopen', 0, false, formVals) + } + } + + onHide('save') + saveBtnClick() + } + + // 拷贝行数据 + copyFormVals = (data) => { + const values = {} + for (let attr in data) { + values[attr] = { + value: data[attr].value, + display: data[attr].display, + } + } + return values + } + + render() { + const { + props: { + showModal, + multiLang, + onHide, + form: { createForm, }, + }, + state: {}, + onEnter, + onButtonClick, + } = this + + return ( + onHide('cancel')} + onEnter={onEnter} + size='lg' + > + + {multiLang['701010DOOROAD-020']} + + + {createForm('ssctp_detailopen_form', { + isNoStandard: true, + })} + + + onButtonClick(this.props, 'batch_save')} + >{multiLang['701010DOOROAD-006']} + onButtonClick(this.props, 'batch_cancel')} + >{multiLang['701010DOOROAD-007']} + + + ) + } +} +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/docOpen/config/events/async.js b/src/ssctpaaa/dooroad/docOpen/config/events/async.js new file mode 100644 index 0000000..25e8d82 --- /dev/null +++ b/src/ssctpaaa/dooroad/docOpen/config/events/async.js @@ -0,0 +1,79 @@ +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ +import { requestPromise, /* setStatePromise ,*/ } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @desc 查询 + * @method asyncQry + */ +async function asyncQry() { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROpenQueryAction.do`, + data: {}, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 保存 + * @method asyncSave + */ +async function asyncSave(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROpenSaveAction.do`, + data, + hasErrCallBack: true, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 删除 + * @method asyncDel + */ +async function asyncDel(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROpenDelAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 编辑后事件查询 + * @method asyncOtherSelect + */ +async function asyncOtherSelect(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtherSelectOtsAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export { + asyncQry, + asyncSave, + asyncDel, + asyncOtherSelect, +} +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/docOpen/config/events/initTemplate.js b/src/ssctpaaa/dooroad/docOpen/config/events/initTemplate.js new file mode 100644 index 0000000..8322d52 --- /dev/null +++ b/src/ssctpaaa/dooroad/docOpen/config/events/initTemplate.js @@ -0,0 +1,40 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { + getMultiLang, +} from 'nc-lightapp-front'; + +export default function ({ + createUIDom, meta: { setMeta }, + button: { setButtons, setButtonDisabled, }, +}) { + const that = this + createUIDom({}, function({ template, button }) { + getMultiLang({moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: multiLang => { + // 列表参照过滤 + template.ssctp_detailopen.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // 批量新增参照过滤 + template.ssctp_detailopen_form.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + setMeta(template); + setButtons(button); + that.setState({multiLang}) + that.changePageStatus('browse') + that.tableDataQry() + setButtonDisabled({Delete: true}) + }}) + }); +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/docOpen/config/index.js b/src/ssctpaaa/dooroad/docOpen/config/index.js new file mode 100644 index 0000000..ff9cc96 --- /dev/null +++ b/src/ssctpaaa/dooroad/docOpen/config/index.js @@ -0,0 +1,251 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import { createPage, promptBox, toast, } from "nc-lightapp-front"; +import initTemplate from "./events/initTemplate.js"; +import BillListStyle from 'ssccommon/components/bill-list'; +import { + asyncQry, asyncSave, asyncDel, asyncOtherSelect, +} from './events/async.js' +import BatchAddModal from './BatchAdd.js' + +class DocOpen extends Component { + constructor(props) { + super(props); + this.state = { + multiLang: {}, // 多语 + showBatchAddModal: false, // 批量添加 + pageStatus: 'browse', // 页面状态 + }; + + initTemplate.call(this, props); + } + + // 头部按钮组事件 + headerBtnEventDistribute = () => ({ + Add: () => this.addBtnClick(), + Edit: () => this.editBtnClick(), + Delete: () => this.deleteBtnClick(), + Save: () => this.saveBtnClick(), + Cancel: () => this.cancelBtnClick(), + BatchAdd: () => this.setState({showBatchAddModal: true}), + }) + + // 改变页面状态 浏览/编辑 + changePageStatus = statu => { + const { + editTable: { setStatus, }, + button: { setButtonVisible, setMainButton, }, + } = this.props + setStatus('ssctp_detailopen', statu) + setButtonVisible({ + Add: true, + BatchAdd: statu === 'browse', + Edit: statu === 'browse', + Delete: true, + Save: statu === 'edit', + Cancel: statu === 'edit', + }) + this.setState({pageStatus: statu}) + setMainButton('Add', statu === 'browse') + } + + componentDidMount() { + // 浏览器原生提示 + window.onbeforeunload = () => { + if (this.state.pageStatus === 'edit') return '' + } + } + + // 列表数据查询 + tableDataQry = async (isRefresh = false) => { + const response = await asyncQry() + const {success, data} = response + if (!success) return + this.props.editTable.setTableData('ssctp_detailopen', data ? data.ssctp_detailopen : {rows: []}) + if (isRefresh) { + toast({title: this.state.multiLang['701010DOOROAD-022'], duration: 5}) + } + } + + // 刷新 + refreshButtonEvent = () => { + this.tableDataQry(true) + } + + //增加 + addBtnClick = () => { + const rows = this.props.editTable.getAllData('ssctp_detailopen').rows + this.props.editTable.addRow('ssctp_detailopen', rows.length, true, {}) + this.changePageStatus('edit') + } + + // 修改 + editBtnClick = () => { + this.changePageStatus('edit') + } + + // 删除提示 + deleteBtnClick = () => { + if (this.state.pageStatus === 'browse') { + const checkedRows = this.props.editTable.getCheckedRows('ssctp_detailopen') + if (!checkedRows.length) return + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-003'], + content: this.state.multiLang['701010DOOROAD-018'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureDel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } else { + const checkedIndex = this.props.editTable.getCheckedRows('ssctp_detailopen').map(row => row.index) + if (!checkedIndex.length) return + this.props.editTable.deleteTableRowsByIndex('ssctp_detailopen', checkedIndex) + } + } + + //确认删除 + sureDel = async () => { + const { + deleteTableRowsByIndex, getCheckedRows, getAllData, setTableData, + } = this.props.editTable + + const toDelIdxs = getCheckedRows('ssctp_detailopen').map(row => row.index) + deleteTableRowsByIndex('ssctp_detailopen', toDelIdxs) + + const response = await asyncDel({ssctp_detailopen: getAllData('ssctp_detailopen')}) + const {success, data} = response + if (!success || !data) return + + setTableData('ssctp_detailopen', data.ssctp_detailopen) + toast({ title: this.state.multiLang['701010DOOROAD-017'], duration: 5}) + } + + // 保存 + saveBtnClick = async () => { + const { + editTable: { filterEmptyRows, checkRequired, getAllData, setTableData}, + } = this.props + filterEmptyRows('ssctp_detailopen', []) + const tableData = getAllData('ssctp_detailopen') + if (!checkRequired('ssctp_detailopen', tableData.rows)) return + const response = await asyncSave({ssctp_detailopen: tableData}) + if (!response) return + const {success, data} = response + if (!success) return + setTableData('ssctp_detailopen', data ? data.ssctp_detailopen : {rows: []}) + this.changePageStatus('browse') + toast({ title: this.state.multiLang['701010DOOROAD-016'], duration: 5}) + } + + // 取消 + cancelBtnClick = () => { + this.changePageStatus('browse') + this.tableDataQry() + } + + // 列表编辑后事件 + onAfterEvent = async (props, areaId, key, currentValue, changedrows, index, row, ...others) => { + if (key === 'pk_transtype') { + const transtype_code = currentValue.refcode || '' + props.editTable.setValByKeyAndIndex(areaId, index, 'transtype_code', {value: transtype_code, display: transtype_code}) + } + + // if (key !== 'pk_ots') { + // return true + // } + // const { + // editTable: { setValByKeyAndIndex, }, + // } = props + // if (!currentValue.refpk) { + // setValByKeyAndIndex(areaId, index, 'url', {value: '', display: ''}) + // return true + // } + // const response = await asyncOtherSelect({pk_ots: currentValue.refpk}) + // const {success, data} = response + // if (!success || !data) return true + // setValByKeyAndIndex(areaId, index, 'url', {value: `${data.ip}:${data.port}`, display: `${data.ip}:${data.port}`}) + } + + // 列表选中变更事件 + selectedChange = (props, areaId, newVal, oldVal) => { + this.props.button.setButtonDisabled({Delete: !newVal}) + } + + render() { + const { + state: { + multiLang, + showBatchAddModal, + pageStatus, + }, + props: { + getSearchParam, + editTable: { createEditTable, }, + }, + headerBtnEventDistribute, + onAfterEvent, + selectedChange, + changePageStatus, + refreshButtonEvent, + saveBtnClick, + } = this + + return ( + + + + {/* 头部按钮组 */} + + + + + {/* 列表 */} + {createEditTable( + 'ssctp_detailopen', + { + showIndex: true, + showCheck: true, + onAfterEvent, + adaptionHeight: true, + isAddRow: true, + selectedChange, + }, + )} + + + { + this.setState({showBatchAddModal: false}) + if (action !== 'save') { + this.changePageStatus('browse') + } else { + this.changePageStatus('edit') + } + }} + setPageEdit={() => changePageStatus('edit')} + saveBtnClick={saveBtnClick} + {...this.state} + {...this.props} + /> + + + ); + } +} + +DocOpen = createPage({ mutiLangCode: '7010' })(DocOpen); +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/eventRegis/config/BatchAdd.js b/src/ssctpaaa/dooroad/eventRegis/config/BatchAdd.js new file mode 100644 index 0000000..c763765 --- /dev/null +++ b/src/ssctpaaa/dooroad/eventRegis/config/BatchAdd.js @@ -0,0 +1,121 @@ +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton } = base; + +export default class BatchAddModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + onEnter = () => { + this.props.form.setFormStatus('ssctp_eventlistener_form', 'edit') + this.props.form.EmptyAllFormValue('ssctp_eventlistener_form') + } + + onButtonClick = (props, key) => { + const { + onHide, + } = props + if (key === 'batch_save') { // 保存 拆行 + this.batchSave() + } else if (key === 'batch_cancel') { // 取消 + onHide('cancel') + } + } + + batchSave = () => { + const { + form: { getAllFormValue, isCheckNow, }, + saveBtnClick, onHide, + } = this.props + if (!isCheckNow('ssctp_eventlistener_form')) return // 必输校验 + + const values = getAllFormValue('ssctp_eventlistener_form').rows[0].values + const formVals = this.copyFormVals(values) + const { + pk_org, pk_transtype, + } = values + + const pk_orgArray = pk_org.value.split(','), + pk_transtypeArray = pk_transtype.value.split(','), + pk_orgDisplayArray = pk_org.display.split(','), + pk_transtypeDisplayArray = pk_transtype.display.split(',') + let index = -1 + while(++index < pk_orgArray.length) { + const pk_orgVal = pk_orgArray[index], pk_orgDisplay = pk_orgDisplayArray[index] + let _index = -1 + while(++_index < pk_transtypeArray.length) { + const pk_transtypeVal = pk_transtypeArray[_index], pk_transtypeDisplay = pk_transtypeDisplayArray[_index] + + formVals.pk_org.value = pk_orgVal + formVals.pk_org.display = pk_orgDisplay + formVals.pk_transtype.value = pk_transtypeVal + formVals.pk_transtype.display = pk_transtypeDisplay + + this.props.editTable.addRow('ssctp_eventlistener_list', 0, false, formVals) + } + } + + onHide('save') + saveBtnClick() + } + + // 拷贝行数据 + copyFormVals = (data) => { + const values = {} + for (let attr in data) { + values[attr] = { + value: data[attr].value, + display: data[attr].display, + } + } + return values + } + + render() { + const { + props: { + show, + multiLang, + onHide, + form: { createForm, }, + }, + state: {}, + onEnter, + onButtonClick, + } = this + + return ( + onHide('cancel')} + onEnter={onEnter} + size='lg' + > + + {multiLang['701010DOOROAD-020']} + + + {createForm('ssctp_eventlistener_form', { + isNoStandard: true, + })} + + + onButtonClick(this.props, 'batch_save')} + >{multiLang['701010DOOROAD-006']} + onButtonClick(this.props, 'batch_cancel')} + >{multiLang['701010DOOROAD-007']} + + + ) + } +} +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/eventRegis/config/events/async.js b/src/ssctpaaa/dooroad/eventRegis/config/events/async.js new file mode 100644 index 0000000..e382284 --- /dev/null +++ b/src/ssctpaaa/dooroad/eventRegis/config/events/async.js @@ -0,0 +1,79 @@ +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ +import { requestPromise, /* setStatePromise ,*/ } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @desc 查询 + * @method asyncQry + */ +async function asyncQry() { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DREventListenerQueryAction.do`, + data: {}, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 删除 + * @method asyncDel + */ +async function asyncDel(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DREventListenerDelAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 保存 + * @method asyncSave + */ +async function asyncSave(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DREventListenerSaveAction.do`, + data, + hasErrCallBack: true, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 编辑后事件查询 + * @method asyncOtherSelect + */ +async function asyncOtherSelect(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtherSelectOtsAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export { + asyncQry, + asyncDel, + asyncSave, + asyncOtherSelect, +} +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/eventRegis/config/events/initTemplate.js b/src/ssctpaaa/dooroad/eventRegis/config/events/initTemplate.js new file mode 100644 index 0000000..d9124df --- /dev/null +++ b/src/ssctpaaa/dooroad/eventRegis/config/events/initTemplate.js @@ -0,0 +1,60 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { + getMultiLang, +} from 'nc-lightapp-front'; + +export default function ({ + createUIDom, meta: { setMeta }, + button: { setButtons, createOprationButton, setButtonDisabled,}, +}) { + const that = this + createUIDom({}, function({ template, button }) { + getMultiLang({moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: multiLang => { + // 列表参照过滤 + template.ssctp_eventlistener_list.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // 批量新增参照过滤 + template.ssctp_eventlistener_form.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // // 添加操作列 + // template.ssctp_eventlistener_list.items.push({ + // label: multiLang['701010DOOROAD-013'], + // attrcode: "opr", + // itemtype: "customer", + // visible: true, + // width: "100px", + // fixed: "right", + // render: (node, values, idx) => { + // return createOprationButton(['Param'], { + // area: 'list_btnArea', + // onButtonClick: (props, key) => { + // that.showParamModal(values, idx) + // } + // }); + // } + // }) + + setMeta(template); + setButtons(button); + that.setState({multiLang}) + + that.changePageStatu('browse') + setButtonDisabled({Delete: true}) + that.listQry() + + }}) + }); +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/eventRegis/config/index.js b/src/ssctpaaa/dooroad/eventRegis/config/index.js new file mode 100644 index 0000000..12737ab --- /dev/null +++ b/src/ssctpaaa/dooroad/eventRegis/config/index.js @@ -0,0 +1,269 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import { createPage, promptBox, toast, } from "nc-lightapp-front"; +import initTemplate from "./events/initTemplate.js"; +import BillListStyle from 'ssccommon/components/bill-list'; +import EventRegisModal from './modal.js' +import { + asyncQry, + asyncDel, + asyncSave, + asyncOtherSelect, +} from './events/async.js'; +import BatchAddModal from './BatchAdd.js' + +class EventRegis extends Component { + constructor(props) { + super(props); + this.state = { + showModal: false, // 显示弹窗 + multiLang: {}, // 多语 + showBatchAddModal: false, // 批量添加 + pageStatus: 'browse', // 页面状态 + }; + + initTemplate.call(this, props); + } + + componentDidMount() { + // 浏览器原生提示 + window.onbeforeunload = () => { + if (this.state.pageStatus === 'edit') return '' + } + } + + // 头部按钮组事件 + headerBtnEventDistribute = () => ({ + Add: () => this.addBtnClick(), + Edit: () => this.editBtnClick(), + Delete: () => this.deleteBtnClick(), + Save: () => this.saveBtnClick(), + Cancel: () => this.cancelBtnClick(), + BatchAdd: () => this.setState({showBatchAddModal: true}), + }) + + // 改变页面状态 + changePageStatu = status => { + this.props.button.setButtonVisible({ + Add: true, + Edit: status === 'browse', + Delete: true, + Save: status === 'edit', + Cancel: status === 'edit', + BatchAdd: status === 'browse', + }) + this.props.editTable.setStatus('ssctp_eventlistener_list', status) + this.setState({pageStatus: status}) + this.props.button.setMainButton('Add', status === 'browse') + } + + // 列表查询 + listQry = async (isRefresh = false) => { + const response = await asyncQry() + const {success, data} = response + if (!success) return + this.props.editTable.setTableData('ssctp_eventlistener_list', data ? data.ssctp_eventlistener_list : {rows: []}) + if (isRefresh) { + toast({title: this.state.multiLang['701010DOOROAD-022'], duration: 5}) + } + } + + // 显示弹窗 + showParamModal = (row, index) => { + this.setState({showModal: true}) + } + + // 隐藏弹窗 + onHide = () => { + this.setState({showModal: false}) + } + + // 新增 + addBtnClick = () => { + const rows = this.props.editTable.getAllData('ssctp_eventlistener_list').rows + this.props.editTable.addRow('ssctp_eventlistener_list', rows.length, true, {}) + this.changePageStatu('edit') + } + + // 修改 + editBtnClick = () => { + this.changePageStatu('edit') + } + + // 取消 + cancelBtnClick = () => { + this.listQry() + this.changePageStatu('browse') + } + + // 保存 + saveBtnClick = async () => { + const { + editTable: { filterEmptyRows, checkRequired, getAllData, setTableData}, + } = this.props + filterEmptyRows('ssctp_eventlistener_list', []) + const tableData = getAllData('ssctp_eventlistener_list') + if (!checkRequired('ssctp_eventlistener_list', tableData.rows)) return + const response = await asyncSave({ssctp_eventlistener_list: tableData}) + if (!response) return + const {success, data} = response + if (!success) return + setTableData('ssctp_eventlistener_list', data ? data.ssctp_eventlistener_list : {}) + this.changePageStatu('browse') + toast({ title: this.state.multiLang['701010DOOROAD-016'], duration: 5}) + } + + // 删除提示 + deleteBtnClick = () => { + if (this.state.pageStatus === 'browse') { + const checkedRows = this.props.editTable.getCheckedRows('ssctp_eventlistener_list') + if (!checkedRows.length) return + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-003'], + content: this.state.multiLang['701010DOOROAD-018'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureDel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } else { + const checkedIndex = this.props.editTable.getCheckedRows('ssctp_eventlistener_list').map(row => row.index) + if (!checkedIndex.length) return + this.props.editTable.deleteTableRowsByIndex('ssctp_eventlistener_list', checkedIndex) + } + } + + // 确定删除 + sureDel = async () => { + const { + deleteTableRowsByIndex, getCheckedRows, getAllData, setTableData, + } = this.props.editTable + + const toDelIdxs = getCheckedRows('ssctp_eventlistener_list').map(row => row.index) + deleteTableRowsByIndex('ssctp_eventlistener_list', toDelIdxs) + + const response = await asyncDel({ssctp_eventlistener_list: getAllData('ssctp_eventlistener_list')}) + const {success, data} = response + if (!success || !data) return + + setTableData('ssctp_eventlistener_list', data.ssctp_eventlistener_list) + toast({ title: this.state.multiLang['701010DOOROAD-017'], duration: 5}) + } + + // 列表编辑后事件 + onAfterEvent = async (props, areaId, key, currentValue, changedrows, index, row, ...others) => { + if (key === 'pk_transtype') { + const transtype_code = currentValue.refcode || '' + props.editTable.setValByKeyAndIndex(areaId, index, 'transtype_code', {value: transtype_code, display: transtype_code}) + } + + // if (key !== 'pk_ots') { + // return true + // } + // const { + // editTable: { setValByKeyAndIndex, }, + // } = props + // if (!currentValue.refpk) { + // setValByKeyAndIndex(areaId, index, 'url', {value: '', display: ''}) + // return true + // } + // const response = await asyncOtherSelect({pk_ots: currentValue.refpk}) + // const {success, data} = response + // if (!success || !data) return true + // setValByKeyAndIndex(areaId, index, 'url', {value: `${data.ip}:${data.port}`, display: `${data.ip}:${data.port}`}) + } + + // 列表选中变更事件 + selectedChange = (props, areaId, newVal, oldVal) => { + this.props.button.setButtonDisabled({Delete: !newVal}) + } + + // 刷新 + refreshButtonEvent = () => { + this.listQry(true) + } + + render() { + const { + state: { + multiLang, + showBatchAddModal, + pageStatus, + }, + props: { + getSearchParam, + editTable: { createEditTable, }, + }, + headerBtnEventDistribute, + onHide, + onAfterEvent, + selectedChange, + changePageStatu, + refreshButtonEvent, + saveBtnClick, + } = this + + return ( + + + + {/* 头部按钮组 */} + + + + + {/* 列表 */} + {createEditTable( + 'ssctp_eventlistener_list', + { + showIndex: true, + showCheck: true, + isAddRow: true, + onAfterEvent, + selectedChange, + adaptionHeight: true, + }, + )} + + + + + { + this.setState({showBatchAddModal: false}) + if (action === 'save') { + changePageStatu('edit') + } else { + changePageStatu('browse') + } + }} + setPageEdit={() => changePageStatu('edit')} + saveBtnClick={saveBtnClick} + {...this.state} + {...this.props} + /> + + + ); + } +} + +EventRegis = createPage({ mutiLangCode: '7010' })(EventRegis); +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/eventRegis/config/modal.js b/src/ssctpaaa/dooroad/eventRegis/config/modal.js new file mode 100644 index 0000000..bd5aed4 --- /dev/null +++ b/src/ssctpaaa/dooroad/eventRegis/config/modal.js @@ -0,0 +1,51 @@ +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton,} = base; + +export default class EventRegisModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + render() { + const { + props: { + showModal, + multiLang, + onHide, + editTable: { createEditTable, }, + button: { createButtonApp, }, + }, + state: {}, + } = this + + return ( + + + {multiLang['701010DOOROAD-010']} + + + {createEditTable('ssctp_eventlistener_list', { + showIndex: true, + showCheck: true, + isAddRow: true, + })} + + + {createButtonApp({ + area: 'form_btnArea', + onButtonClick: (props, key) => {}, + })} + + + ) + } +} +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/imageInterfaceSetting/config/BatchAdd.js b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/BatchAdd.js new file mode 100644 index 0000000..a12bf6c --- /dev/null +++ b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/BatchAdd.js @@ -0,0 +1,121 @@ +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton } = base; + +export default class BatchAddModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + onEnter = () => { + this.props.form.setFormStatus('ssctp_imagshow_form', 'edit') + this.props.form.EmptyAllFormValue('ssctp_imagshow_form') + } + + onButtonClick = (props, key) => { + const { + onHide, + } = props + if (key === 'batch_save') { // 保存 拆行 + this.batchSave() + } else if (key === 'batch_cancel') { // 取消 + onHide('cancel') + } + } + + batchSave = () => { + const { + form: { getAllFormValue, isCheckNow, }, + headSaveHandle, onHide, + } = this.props + if (!isCheckNow('ssctp_imagshow_form')) return // 必输校验 + + const values = getAllFormValue('ssctp_imagshow_form').rows[0].values + const formVals = this.copyFormVals(values) + const { + pk_org, pk_transtype, + } = values + + const pk_orgArray = pk_org.value.split(','), + pk_transtypeArray = pk_transtype.value.split(','), + pk_orgDisplayArray = pk_org.display.split(','), + pk_transtypeDisplayArray = pk_transtype.display.split(',') + let index = -1 + while(++index < pk_orgArray.length) { + const pk_orgVal = pk_orgArray[index], pk_orgDisplay = pk_orgDisplayArray[index] + let _index = -1 + while(++_index < pk_transtypeArray.length) { + const pk_transtypeVal = pk_transtypeArray[_index], pk_transtypeDisplay = pk_transtypeDisplayArray[_index] + + formVals.pk_org.value = pk_orgVal + formVals.pk_org.display = pk_orgDisplay + formVals.pk_transtype.value = pk_transtypeVal + formVals.pk_transtype.display = pk_transtypeDisplay + + this.props.editTable.addRow('ssctp_imagshow_list', 0, false, formVals) + } + } + + onHide('save') + headSaveHandle() + } + + // 拷贝行数据 + copyFormVals = (data) => { + const values = {} + for (let attr in data) { + values[attr] = { + value: data[attr].value, + display: data[attr].display, + } + } + return values + } + + render() { + const { + props: { + show, + multiLang, + onHide, + form: { createForm, }, + }, + state: {}, + onEnter, + onButtonClick, + } = this + + return ( + onHide('cancel')} + onEnter={onEnter} + size='lg' + > + + {multiLang['701010DOOROAD-020']} + + + {createForm('ssctp_imagshow_form', { + isNoStandard: true, + })} + + + onButtonClick(this.props, 'batch_save')} + >{multiLang['701010DOOROAD-006']} + onButtonClick(this.props, 'batch_cancel')} + >{multiLang['701010DOOROAD-007']} + + + ) + } +} +/*+YfJSE2wVV4tdUzmsv455q3iGlXZUI2mv/4od/TyZds=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/imageInterfaceSetting/config/events/async.js b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/events/async.js new file mode 100644 index 0000000..4038f2c --- /dev/null +++ b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/events/async.js @@ -0,0 +1,79 @@ +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ +import { requestPromise, /* setStatePromise ,*/ } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @desc 查询 + * @method asyncQry + */ +async function asyncQry() { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRImageShowQueryAction.do`, + data: {}, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 保存 + * @method asyncSave + */ +async function asyncSave(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRImageShowSaveAction.do`, + data, + hasErrCallBack: true, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 删除 + * @method asyncDel + */ +async function asyncDel(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRImageShowDelAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +/** + * @desc 编辑后事件查询 + * @method asyncOtherSelect + */ +async function asyncOtherSelect(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DROtherSelectOtsAction.do`, + data, + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export { + asyncQry, + asyncSave, + asyncDel, + asyncOtherSelect, +} +/*3mS3VmANLuMaTtASFDOxHvWNecZeEeby5t7o9BNao9s=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/imageInterfaceSetting/config/events/initTemplate.js b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/events/initTemplate.js new file mode 100644 index 0000000..d2892f3 --- /dev/null +++ b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/events/initTemplate.js @@ -0,0 +1,60 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { + getMultiLang, +} from 'nc-lightapp-front'; + +export default function ({ + createUIDom, meta: { setMeta }, + button: { setButtons, createOprationButton, setButtonDisabled,}, +}) { + const that = this + createUIDom({}, function({ template, button }) { + getMultiLang({moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: multiLang => { + // 列表参照过滤 + template.ssctp_imagshow_list.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // 批量新增参照过滤 + template.ssctp_imagshow_form.items.forEach((item, idx, items) => { + if (item.attrcode === 'pk_transtype') { + item.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeForDRRefBuilder', + }) + } + }) + + // // 添加操作列 + // template.ssctp_imagshow_list.items.push({ + // label: multiLang['701010DOOROAD-013'], + // attrcode: "opr", + // itemtype: "customer", + // visible: true, + // width: "100px", + // fixed: "right", + // render: (record, values, idx) => { + // return createOprationButton(['param'], { + // area: 'list_btnArea', + // onButtonClick: (props, key) => { + // that.showParamModal(values, idx) + // } + // }); + // } + // }) + + setMeta(template); + setButtons(button); + that.setState({multiLang}); + + that.changePageStatu('browse') + setButtonDisabled({Delete_head: true}) + that.listQry() + + }}) + }); +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/imageInterfaceSetting/config/index.js b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/index.js new file mode 100644 index 0000000..26f08a6 --- /dev/null +++ b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/index.js @@ -0,0 +1,286 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import { createPage, promptBox, toast, } from "nc-lightapp-front"; +import initTemplate from "./events/initTemplate.js"; +import BillListStyle from 'ssccommon/components/bill-list'; +import ImageInterfaceSettingModal from './modal.js' +import { + asyncSave, + asyncQry, + asyncDel, + asyncOtherSelect, +} from './events/async.js' +import BatchAddModal from './BatchAdd.js' + +class ImageInterfaceSetting extends Component { + constructor(props) { + super(props); + this.state = { + showModal: false, + multiLang: {}, + showBatchAddModal: false, // 批量添加 + pageStatus: 'browse', // 页面状态 + }; + + initTemplate.call(this, props); + } + + componentDidMount() { + // 浏览器原生提示 + window.onbeforeunload = () => { + if (this.state.pageStatus === 'edit') return '' + } + } + + // 改变页面状态 + changePageStatu = status => { + this.props.button.setButtonVisible({ + Add_head: true, + Edit_head: status === 'browse', + Delete_head: true, + Save_head: status === 'edit', + Cancel_head: status === 'edit', + BatchAdd: status === 'browse', + }) + this.props.editTable.setStatus('ssctp_imagshow_list', status) + this.setState({pageStatus: status}) + this.props.button.setMainButton('Add_head', status === 'browse') + } + + // 头部按钮组事件 + headerBtnEventDistribute = () => ({ + Add_head: () => this.headAddHandle(), + Edit_head: () => this.headEditHandle(), + Delete_head: () => this.headDelHandle(), + Save_head: () => this.headSaveHandle(), + Cancel_head: () => this.headCancelHandle(), + BatchAdd: () => this.setState({showBatchAddModal: true}), + }) + + // 增加 + headAddHandle = () => { + const rows = this.props.editTable.getAllData('ssctp_imagshow_list').rows + this.props.editTable.addRow('ssctp_imagshow_list', rows.length, true, {}) + this.changePageStatu('edit') + } + + // 修改 + headEditHandle = () => { + this.changePageStatu('edit') + } + + // 取消提示 + headCancelHandle = () => { + // 浏览态 + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-007'], + content: this.state.multiLang['701010DOOROAD-019'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureCancel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } + + // 确认取消 + sureCancel = () => { + // 重新查询列表 + this.listQry() + // 浏览态 + this.changePageStatu('browse') + } + + // 列表查询 + listQry = async (isRefresh = false) => { + const response = await asyncQry() + const {success, data} = response + if (!success) return + this.props.editTable.setTableData('ssctp_imagshow_list', data ? data.ssctp_imagshow_list : {rows: []}) + if (isRefresh) { + toast({title: this.state.multiLang['701010DOOROAD-022'], duration: 5}) + } + } + + // 隐藏弹窗 + onHide = () => { + this.setState({showModal: false}) + } + + // 保存 + headSaveHandle = async () => { + const { + editTable: { filterEmptyRows, checkRequired, getAllData, setTableData}, + } = this.props + filterEmptyRows('ssctp_imagshow_list', ['showtype']) + const tableData = getAllData('ssctp_imagshow_list') + if (!checkRequired('ssctp_imagshow_list', tableData.rows)) return + const response = await asyncSave({ssctp_imagshow_list: tableData}) + if (!response) return + const {success, data} = response + if (!success) return + setTableData('ssctp_imagshow_list', data ? data.ssctp_imagshow_list : {rows: []}) + this.changePageStatu('browse') + toast({ title: this.state.multiLang['701010DOOROAD-016'], duration: 5}) + } + + // 删除提示 + headDelHandle = () => { + if (this.state.pageStatus === 'browse') { + const checkedRows = this.props.editTable.getCheckedRows('ssctp_imagshow_list') + if (!checkedRows.length) return + return promptBox({ + color: 'warning', + title: this.state.multiLang['701010DOOROAD-003'], + content: this.state.multiLang['701010DOOROAD-018'], + noFooter: false, + noCancelBtn: false, + beSureBtnClick: this.sureDel, + cancelBtnClick: () => {}, + closeByClickBackDrop: true, + }) + } else { + const checkedIndex = this.props.editTable.getCheckedRows('ssctp_imagshow_list').map(row => row.index) + if (!checkedIndex.length) return + this.props.editTable.deleteTableRowsByIndex('ssctp_imagshow_list', checkedIndex) + } + } + + // 确认删除 + sureDel = async () => { + const { + deleteTableRowsByIndex, getCheckedRows, getAllData, setTableData, + } = this.props.editTable + + const toDelIdxs = getCheckedRows('ssctp_imagshow_list').map(row => row.index) + deleteTableRowsByIndex('ssctp_imagshow_list', toDelIdxs) + + const response = await asyncDel({ssctp_imagshow_list: getAllData('ssctp_imagshow_list')}) + const {success, data} = response + if (!success || !data) return + + setTableData('ssctp_imagshow_list', data.ssctp_imagshow_list) + toast({ title: this.state.multiLang['701010DOOROAD-017'], duration: 5}) + } + + // 显示弹窗 + showParamModal = (row, index) => { + this.setState({showModal: true}) + } + + // 列表编辑后事件 + onAfterEvent = async (props, areaId, key, currentValue, changedrows, index, row, ...others) => { + if (key === 'pk_transtype') { + const transtype_code = currentValue.refcode || '' + props.editTable.setValByKeyAndIndex(areaId, index, 'transtype_code', {value: transtype_code, display: transtype_code}) + } + + // if (key !== 'pk_ots') { + // return true + // } + // const { + // editTable: { setValByKeyAndIndex, }, + // } = props + // if (!currentValue.refpk) { + // setValByKeyAndIndex(areaId, index, 'url', {value: '', display: ''}) + // return true + // } + // const response = await asyncOtherSelect({pk_ots: currentValue.refpk}) + // const {success, data} = response + // if (!success || !data) return true + // setValByKeyAndIndex(areaId, index, 'url', {value: `${data.ip}:${data.port}`, display: `${data.ip}:${data.port}`}) + } + + // 列表选中变更事件 + selectedChange = (props, areaId, newVal, oldVal) => { + this.props.button.setButtonDisabled({Delete_head: !newVal}) + } + + // 刷新 + refreshButtonEvent = () => { + this.listQry(true) + } + + render() { + const { + state: { + multiLang, + showBatchAddModal, + pageStatus, + }, + props: { + getSearchParam, + editTable: { createEditTable, }, + }, + headerBtnEventDistribute, + onHide, + onAfterEvent, + selectedChange, + changePageStatu, + refreshButtonEvent, + headSaveHandle, + } = this + + return ( + + + + {/* 头部按钮组 */} + + + + + {/* 列表 */} + {createEditTable( + 'ssctp_imagshow_list', + { + showIndex: true, + showCheck: true, + isAddRow: true, + onAfterEvent, + selectedChange, + adaptionHeight: true, + }, + )} + + + + + { + this.setState({showBatchAddModal: false}) + if (action === 'save') { + changePageStatu('edit') + } else { + changePageStatu('browse') + } + }} + setPageEdit={() => changePageStatu('edit')} + headSaveHandle={headSaveHandle} + {...this.state} + {...this.props} + /> + + + ); + } +} + +ImageInterfaceSetting = createPage({ mutiLangCode: '7010' })(ImageInterfaceSetting); +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/imageInterfaceSetting/config/modal.js b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/modal.js new file mode 100644 index 0000000..361b8b8 --- /dev/null +++ b/src/ssctpaaa/dooroad/imageInterfaceSetting/config/modal.js @@ -0,0 +1,51 @@ +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ +import React, { Component, } from 'react'; +import { base, } from 'nc-lightapp-front'; +const { NCModal, NCButton,} = base; + +export default class ImageInterfaceSettingModal extends Component { + constructor(props) { + super(props) + this.state = {} + } + + render() { + const { + props: { + showModal, + multiLang, + editTable: { createEditTable, }, + button: { createButtonApp, }, + onHide, + }, + state: {}, + } = this + + return ( + + + {multiLang['701010DOOROAD-010']} + + + {createEditTable('param', { + showIndex: true, + showCheck: true, + isAddRow: true, + })} + + + {createButtonApp({ + area: 'form_btnArea', + onButtonClick: (props, key) => {}, + })} + + + ) + } +} +/*8o+P8J7kLOMsCOkr3TeeGIRKKnnuiYLht9+O74e2aAU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/LinkVoucher.js b/src/ssctpaaa/dooroad/linkvoucher/config/LinkVoucher.js new file mode 100644 index 0000000..171db4c --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/LinkVoucher.js @@ -0,0 +1,76 @@ +/*JM8uPPGENTbQMhsgGLERSe1ppcxQaSSiLZDws+vJ2z0=*/ +import React, { Component } from 'react'; +import { createPage, base } from 'nc-lightapp-front'; +import presetVar from './presetVar'; +import requestApi from './requestApi'; +import pubMessage from 'ssccommon/utils/pubMessage'; +import initTemplate from './initTemplate'; +import { buttonEvent, afterEvent } from './events'; +import { ProfileStyle, ProfileHead, ProfileBody, BodyRight, HeadCenterCustom, ButtonGroup } from 'ssccommon/components/profile'; +import { EditTable } from 'ssccommon/components/table'; +const { NCCheckbox, NCModal, NCButton, NCFormControl } = base; +import './index.less'; + + +const pageButton = presetVar.pageButton +class LinkVoucher extends Component { + constructor(props) { + super(props); + this.state = { + queryDataJSX: [] + } + initTemplate.call(this, props); + } + + componentWillMount() { + } + + componentDidMount() { + + } + + + render() { + const { table, form } = this.props; + const { createSimpleTable } = table; + const { createForm } = form; + let multiLang = this.props.MutiInit.getIntl(presetVar.multiLangCode); + multiLang || (multiLang = { get: () => null }); + return ( + + {/*页面头*/} + + {/* { return buttonEvent.apply(this, params) } + } + /> */} + + {/*页面体*/} + +
+ { + this.state.queryDataJSX.length ? + this.state.queryDataJSX + : +
+ {this.state.isNondata && multiLang.get("7011-0002")} +
+ } + +
+
+
+ ) + } +} + +LinkVoucher = createPage({ + mutiLangCode: presetVar.multiLangCode +})(LinkVoucher); +export default LinkVoucher; +/*JM8uPPGENTbQMhsgGLERSe1ppcxQaSSiLZDws+vJ2z0=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/events/afterEvent.js b/src/ssctpaaa/dooroad/linkvoucher/config/events/afterEvent.js new file mode 100644 index 0000000..2b6347b --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/events/afterEvent.js @@ -0,0 +1,55 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +import { base } from "nc-lightapp-front"; +import presetVar from '../presetVar'; +import requestApi from "../requestApi"; +let { NCMessage } = base; +export default async function afterEvent(...params) { + let props = params[0]; + let areaId = params[1]; + let fieldId = params[2]; + let changedrows = params[4]; + let index = params[5] + let rowRecord = params[6]; + let values = rowRecord.values; + let multiLang = props.MutiInit.getIntl(presetVar.multiLangCode); + switch (areaId) { + case presetVar.listArea: + + this.props.handleRelationItems({ + type: 'table', //编辑的是表单值为'form', 编辑的是表格值为'table' + areaCode: areaId, //编辑区域的编码 + key: fieldId, //编辑字段英文名称 + value: { value: values[fieldId].value }, //编辑字段的新值 + changedrows, // 若编辑的是表格,需要传该参数(编辑字段的旧值),表单不传 + index, //当前是第几行 : 从 0 开始,编辑表格时,需要传该参数,表单不传 + callback: () => { + switch (fieldId) { + case "isuse": + /* let result = await requestApi.enable({ + pk_sscunit: values.pk_sscunit.value, + pk_class: values.pk_class.value, + isuse: values.isuse.value ? 'Y' : 'N' + }); + this.props.editTable.setValByKeyAndRowId(areaId, rowRecord.rowid, "ts", { + value: result.data[presetVar.listArea].rows[0].values.ts.value, + }); + this.props.editTable.setValByKeyAndRowId(areaId, rowRecord.rowid, fieldId, { + value: values.isuse.value + }); + //以下必须重新设置表格数据,否则在table变化状态时,数据会被还原。 + let tableData = this.props.editTable.getAllData(areaId); + props.editTable.setTableData(areaId, tableData); + this.pubMessage.operateSuccess(); */ + break; + default: + break; + } + }, //请求成功的回调(业务组自己的编辑后事件), + //formMetaCode: 'card_head' //若编辑的是分组表单,为当前编辑的表单分组的区域编码 + }) + break; + default: + break; + } +} +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/events/buttonEvent.js b/src/ssctpaaa/dooroad/linkvoucher/config/events/buttonEvent.js new file mode 100644 index 0000000..744cb1d --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/events/buttonEvent.js @@ -0,0 +1,91 @@ +/*oSJmPrU3sG4z5K4LEKqHwMU4cwVci4NkRlcfds1rDzQ=*/ +import { toast } from 'nc-lightapp-front'; +import presetVar from '../presetVar'; +import requestApi from '../requestApi'; + +const { + Save, Delete, Add, Edit, Cancel +} = presetVar.pageButton; +/** + * 按钮事件 + */ +function buttonEvent() { + let props = this.props; + let multiLang = this.props.MutiInit.getIntl(presetVar.multiLangCode); + return { + // 保存 + [Save]: { + url: '/nccloud/sscbd/sscbase/ProblemClassSaveAction.do', + beforeClick: () => { + // 保存前删除空行 + props.editTable.filterEmptyRows(presetVar.listArea, []); + return { + extReqParams: { + userjson: JSON.stringify({pk_sscunit: this.state.SSCCenter.refpk}) + } + }; + }, + afterClick: (ncProps, data) => { + // 浏览态新增按钮为主按钮,设置新增按钮为主按钮 + props.button.setMainButton(Add, true); + //设置按钮行为为弹窗 + //7002-AUDIT-0006:确认要删除吗? + props.button.setPopContent(Delete, multiLang && multiLang.get('7002-AUDIT-0006')) /* 设置操作列上删除按钮的弹窗提示 */ + this.setState({ + isEdit: false + }) + } + }, + // 删除 + [Delete]: async (record) => { + if (this.props.editTable.getStatus(presetVar.listArea) == "browse") { + let result = await requestApi.deleteRow( + [record.values.pk_class.value] + ); + this.props.editTable.deleteTableRowsByRowId(presetVar.listArea, record.rowid, true) + result.success && this.pubMessage.deleteSuccess(); + } else { + this.props.editTable.deleteTableRowsByRowId(presetVar.listArea, record.rowid, false) + } + + }, + // 增行 + [Add]: { + afterClick: (ncProps) => { + // 编辑态保存按钮为主按钮,取消新增按钮的主按钮状态 + props.button.setMainButton(Add, false); + //设置按钮行为为弹窗 + props.button.setPopContent(Delete) /* 设置操作列上删除按钮的弹窗提示 */ + this.setState({ + isEdit: true + }) + } + }, + // 编辑 + [Edit]: { + afterClick: (ncProps) => { + // 编辑态保存按钮为主按钮,取消新增按钮的主按钮状态 + props.button.setMainButton(Add, false); + //设置按钮行为为弹窗 + props.button.setPopContent(Delete) /* 设置操作列上删除按钮的弹窗提示 */ + this.setState({ + isEdit: true + }) + } + }, + // 取消 + [Cancel]: { + afterClick: (ncProps) => { + // 浏览态新增按钮为主按钮,设置新增按钮为主按钮 + props.button.setMainButton(Add, true); + //设置按钮行为为弹窗 + props.button.setPopContent(Delete, multiLang && multiLang.get('7002-AUDIT-0006')) /* 设置操作列上删除按钮的弹窗提示 */ + this.setState({ + isEdit: false + }) + } + } + } +} +export default buttonEvent +/*oSJmPrU3sG4z5K4LEKqHwMU4cwVci4NkRlcfds1rDzQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/events/index.js b/src/ssctpaaa/dooroad/linkvoucher/config/events/index.js new file mode 100644 index 0000000..c1d817a --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/events/index.js @@ -0,0 +1,5 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonEvent from './buttonEvent'; +import afterEvent from './afterEvent'; +export {buttonEvent, afterEvent}; +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/index.js b/src/ssctpaaa/dooroad/linkvoucher/config/index.js new file mode 100644 index 0000000..d406713 --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/index.js @@ -0,0 +1,8 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React from 'react'; +import ReactDOM from 'react-dom'; +import LinkVoucher from './LinkVoucher'; +ReactDOM.render( + , document.querySelector('#app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/index.less b/src/ssctpaaa/dooroad/linkvoucher/config/index.less new file mode 100644 index 0000000..0011249 --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/index.less @@ -0,0 +1,31 @@ +.voucher-list { + background: #fff; + padding: 5px 10px; +} + +.voucher-item { + background: #fff; + margin-bottom: 10px; + border: 1px solid #ccc; + border-radius: 4px; +} + +.nc-single-table { + background: #FFF; +} + +.voucher-bottom { + display: flex; + justify-content: flex-end; + padding-right: 30px; + background: #f6f6f6; + line-height: 30px; + .voucher-bottom-item { + font-size: 13px; + margin-left: 30px; + font-weight: 400; + span { + color: #ff6607; + } + } +} \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/initTemplate.js b/src/ssctpaaa/dooroad/linkvoucher/config/initTemplate.js new file mode 100644 index 0000000..c04214a --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/initTemplate.js @@ -0,0 +1,114 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import 'ssccommon/components/globalPresetVar'; +import presetVar from './presetVar'; +import requestApi from './requestApi'; + +export default async function (props) { + + let createUIDomPromise = new Promise((resolve, _) => { + props.createUIDom( + {}, + (tplData) => { + resolve(tplData); + } + ) + }) + + /* let queryPromise = requestApi.query({ + billid: '1001A9100000000022L7', + pk_group: '0001A91000000000034H', + pk_org: '0001A910000000000FJ5', + transtypecode: 's2641_transtype' + }) */ + + let queryPromise = requestApi.query({ + billid: props.getUrlParam('billid'), + pk_group: props.getUrlParam('pk_group'), + pk_org: props.getUrlParam('pk_org'), + transtypecode: props.getUrlParam('transtypecode') + }) + + let result = await Promise.all([createUIDomPromise, queryPromise]); + + let tplData = result[0]; + let queryData = result[1].data.datas || []; + + let { template: meta, button } = tplData; + //queryData[1] = queryData[0]; + + //渲染模板处理 + metaHandle.call(this, meta, queryData) + //props.button.setButtons(button); + //设置渲染模板 + this.props.meta.setMeta(meta); + + //设置数据 + queryData.forEach((item, index) => { + this.props.form.setAllFormValue({ [`${presetVar.headArea}_${index}`] : item.head.head}); + this.props.table.setAllTableData(`${presetVar.bodyArea}_${index}`, item.body.body); + + }) + +} + +function metaHandle(meta, queryData) { + const { table, form } = this.props; + const { createSimpleTable } = table; + const { createForm } = form; + let queryDataJSX = []; + + let headMeta = meta[presetVar.headArea]; + + let totalcreditTxt = ''; //借方合计 + let totaldebitTxt = ''; //贷方合计 + headMeta.items.forEach((item) => { + if (item.attrcode == 'totalcredit') { + totalcreditTxt = item.label; + } + if (item.attrcode == 'totaldebit') { + totaldebitTxt = item.label; + } + }) + + queryData.forEach((item, index) => { + let newHead = `${presetVar.headArea}_${index}` + let newBody = `${presetVar.bodyArea}_${index}`; + + item.head.head.areacode = newHead; + item.body.body.areacode = newBody; + + meta[newHead] = {...meta[presetVar.headArea], code: newHead}; + meta[newBody] = {...meta[presetVar.bodyArea], code: newBody}; + + + let headData = item.head.head.rows[0].values; + + queryDataJSX.push( +
+ {createForm(newHead, { + isNoStandard: true + })} + {createSimpleTable(newBody, { + showIndex: true, + height: 200 + })} +
+ {/* 借方合计 */} +
{totalcreditTxt}:{headData.totalcredit.value}
+ {/* 贷方合计 */} +
{totaldebitTxt}:{headData.totaldebit.value}
+
+
+ ) + }) + let isNondata = false; + if (queryDataJSX.length == 0) { + isNondata = true; + } + this.setState({ + queryDataJSX, + isNondata + }) + +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/presetVar.js b/src/ssctpaaa/dooroad/linkvoucher/config/presetVar.js new file mode 100644 index 0000000..4d69f39 --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/presetVar.js @@ -0,0 +1,21 @@ +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ +/**页面全局变量 */ +let presetVar = { + headArea: 'head', + bodyArea: 'body', + headBtnArea: 'page_header', + pageButton: { + Save: 'Save', + Delete: 'Delete', + Add: 'Add', + Edit: 'Edit', + Cancel: 'Cancel', + DelLine: 'DelLine', + SetLine: 'Set', + EditLine: 'EditLine' + }, + multiLangCode: '7011' +}; + +export default presetVar; +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ \ No newline at end of file diff --git a/src/ssctpaaa/dooroad/linkvoucher/config/requestApi.js b/src/ssctpaaa/dooroad/linkvoucher/config/requestApi.js new file mode 100644 index 0000000..3d53ff7 --- /dev/null +++ b/src/ssctpaaa/dooroad/linkvoucher/config/requestApi.js @@ -0,0 +1,27 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { requestPromise } from 'ssccommon/utils/asyncFunctions.js'; + +import { + toast, +} from 'nc-lightapp-front'; + +/** + * @method query 查询 + * @return {Object} 出参报文 + */ +async function query(data) { + try { + const result = await requestPromise({ + url: `/nccloud/ssctp/dooroad/DRLinkVoucherAction.do`, + data + }); + return result + } catch (e) { + toast({ title: e.message, duration: 5, color: 'danger', }) + } +} + +export default { + query +} +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/approvalMonitoring.js b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/approvalMonitoring.js new file mode 100644 index 0000000..e04b47f --- /dev/null +++ b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/approvalMonitoring.js @@ -0,0 +1,215 @@ +/*dblajF+af+yID9H3pBHGr5XRfqOgoG/Gpge0pHK6TR4=*/ +import { Component } from "react"; +import { createPage, getMultiLang, createPageIcon, base, ajax } from "nc-lightapp-front"; +const {NCButton, NCModal, NCFormControl, NCDiv} = base +import "./index.less"; +import initTemplate from "./events/initTemplate.js"; +import { + logicalSearchList, + logicalSearchAreaAfterEvent, + logicalManualReturn, + logicalOpenBill, +} from './events/logicalEvents.js' +import BillListStyle from 'ssccommon/components/bill-list'; +import PubMessage from 'ssccommon/utils/pubMessage'; + +class ApprovalMonitoring extends Component { + constructor(props) { + super(props); + this.state = { + multiLang: {}, // 多语 + showCheckModal: false, // 退回人工处理modal + modalVal: '', //退回人工处理原因 + disabled: true, //退回人工处理按钮禁用 + }; + //toast消息公共组件 + this.pubMessage = new PubMessage(); + //初始化 + initTemplate.call(this, props); + } + + componentDidMount() { + getMultiLang({ + moduleId: 7010, + domainName: 'ssctp', + currentLocale: 'zh-CN', + callback: (multiLang) => { + this.setState({multiLang}) + } + }) + } + + // 查询区查询操作回调 + clickSearchBtn = (props, conditions) => { + this.conditions = conditions; + logicalSearchList.call(this, conditions) + } + + // 查询区编辑后事件 + onAfterEvent = (attrcode, values, area) => logicalSearchAreaAfterEvent.call(this, attrcode, values, area) + + // 查询区组件挂载完成回调 + renderCompleteEvent = () => {} + + // table翻页 + handlePageInfoChange = (props, tableInfo, allpks, index) => logicalSearchList.call(this, null, allpks) + + // 退回人工处理 + manualReturn = () => logicalManualReturn.call(this) + + // 退回人工处理按钮点击 + headerBtnClick = () => { + // 校验 列表选中 + // const checkedRows = this.props.table.getCheckedRows('approvalMonitoringList') + // if (checkedRows.length === 0) return toast({ + // color: 'warning', + // title: this.state.multiLang['701004SPJK_008'], + // duration: 3 + // }) + //需要判断saga + const { saga_status, pk_currenttask } = this.selectedRow; + + if(saga_status && saga_status.value === "1") { + //前端saga事务错误,去后端再次验证 + ajax({ + url: '/nccloud/ssctp/sscbd/SSCSagaCheckAction.do', + data: { + pk_currenttask: pk_currenttask.value + }, + success: () => this.setState({showCheckModal: true}) + }); + } else { + this.setState({showCheckModal: true}) + } + + + } + + selectedChange = () => { + const { + table: {getCheckedRows,}, + } = this.props + + const disabled = !(getCheckedRows('approvalMonitoringList').length > 0) + this.setState({disabled}) + } + + onRowDoubleClick = (record, idx, props, ...others) => logicalOpenBill.call(this, record) + + socketMesg = (props, mesg) => { + if(!mesg.error) { + //更新列表数据 + logicalSearchList.call(this, this.conditions) + } + } + + render() { + const { + state: { multiLang, showCheckModal, modalVal, disabled, }, + props: { + search: { NCCreateSearch }, + table: { createSimpleTable }, + socket + }, + clickSearchBtn, + onAfterEvent, + renderCompleteEvent, + handlePageInfoChange, + manualReturn, + headerBtnClick, + selectedChange, + onRowDoubleClick, + } = this + + const { createBillHeadInfo } = this.props.BillHeadInfo; + return [ + socket.connectMesg({ + tableAreaCode: "approvalMonitoringList", + billpkname: "pk_approvemonitor", + billtype: "", + onMessage: this.socketMesg + // 本地前端调试,请传ip和端口 + // 打包到测试环境之前 去掉 + // serverLocation: "172.16.86.11:8883" + }), + + {/* 头部 */} + + {/* btn-group */} + {/* + 701004SPJK_004 退回人工处理 + */} + {/* */} + {/* {multiLang['701004SPJK_004']} */} + {/* */} + + {/* 查询区 */} + + {NCCreateSearch("approvalMonitoringSearchArea", { + hideSearchCondition: false, + hideBtnArea: false, + showAdvBtn: false, + clickSearchBtn, + onAfterEvent, + showClearBtn: true, + renderCompleteEvent + })} + + {/* 列表区 */} + + {createSimpleTable("approvalMonitoringList", { + showIndex: true, + // showCheck: true, + pkname: "pk_approvemonitor", + handlePageInfoChange, + selectedChange, + onRowDoubleClick, + })} + + + {/* 退回人工处理Modal */} + this.setState({showCheckModal: false, modalVal: ''})} + backdrop={'static'} + > + + {multiLang['701004SPJK_004']} + + + this.setState({modalVal})} + placeholder={multiLang['701004SPJK_004']} + /> + + + {/* 701004SPJK_005 确认 */} + {multiLang['701004SPJK_005']} + {/* 701004SPJK_006 取消 */} + {this.setState({showCheckModal: false, modalVal: ''})}} + >{multiLang['701004SPJK_006']} + + + + + ]; + } +} + +ApprovalMonitoring = createPage({ mutiLangCode: '7010' })(ApprovalMonitoring); +export default ApprovalMonitoring; + +/*dblajF+af+yID9H3pBHGr5XRfqOgoG/Gpge0pHK6TR4=*/ \ No newline at end of file diff --git a/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/events/initTemplate.js b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/events/initTemplate.js new file mode 100644 index 0000000..45b6ad0 --- /dev/null +++ b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/events/initTemplate.js @@ -0,0 +1,92 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { logicalOpenBill } from './logicalEvents' + +export default function ({ + createUIDom, meta: { setMeta }, table: { setTableRender }, search: { getSearchValByField }, button: { createErrorButton, createOprationButton, setButtons} +}) { + const _this = this + createUIDom({ + pagecode: '701004SPJK_L', + appcode: '701004SPJK' + }, function ({ template, button }) { + template.approvalMonitoringList.pagination = true + + let idx = -1, len = template.approvalMonitoringList.items.length + while (++idx < len) { + let item = template.approvalMonitoringList.items[idx] + if (item.attrcode.indexOf('.') > -1) item.attrcode = item.attrcode.split('.')[1] + } + + // 查询区参照过滤 + template.approvalMonitoringSearchArea.items.map( + (one, index) => { + if (one.attrcode.indexOf('billtype') > -1) { // 单据类型 + one.refcode = `/uap/refer/riart/billtype/index.js` + one.queryCondition = () => ({ + GridRefActionExt: 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.BilltypeRefSqlBuilder' + }) + } else if (one.attrcode.indexOf('pk_org') > -1) { // 报账单位 + one.queryCondition = () => ({ + TreeRefActionExt: 'nccloud.web.ssctp.report.sqlbuilder.OrgRefBuilder', + pk_sscunit: _this.props.search.getSearchValByField('approvalMonitoringSearchArea', 'pk_currenttask.pk_sscunit').value.firstvalue, + isMutiGroup: 'Y', + }) + } else if (one.attrcode.indexOf('pk_sscunit') > -1) { // 共享中心 + one.queryCondition = () => ({ + isNeedPerm: 'N' // 是否受当前登录用户的集团数据权限控制 + }) + } + } + ); + + //增加按钮退出人工处理 + setButtons(button); + let event = { + label: _this.state.multiLang['701001RWCL-0060'], + itemtype: 'customer', + className: 'opr', + attrcode: 'opr', + visible: true, + width: '125px', + fixed: 'right', + render: (text, record, index) => { + return createErrorButton({ + record: record, + sucessCallBack: () => { + return createOprationButton(['ManualReturn'], { + area: "approvalMonitoringList", + buttonLimit: 3, + onButtonClick: (props, btnKey) => { + _this.selectedRow = record; + _this.selectedIdx = index; + _this.headerBtnClick() + } + }) + } + }) + } + }; + template.approvalMonitoringList.items.push(event); + + setMeta(template); + // 单据号列自定义 + setTableRender('approvalMonitoringList', "billno", (text, record, index) => { + return ( + logicalOpenBill.call(_this, record)} + >{record.billno.value} + ) + }) + + setTableRender('approvalMonitoringList', "resultsflag", (text, record, index) => { + return ( + record.resultsflag.value === 'Y' ? + : + + ) + }) + }); +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/events/logicalEvents.js b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/events/logicalEvents.js new file mode 100644 index 0000000..2414fcf --- /dev/null +++ b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/events/logicalEvents.js @@ -0,0 +1,196 @@ +/*0YgIFuXJoC2x+5JNXKiUO11ZXLxRDpeZUyfdJGHH3Ew=*/ +/* eslint-disable no-console */ + +import { + requestPromise, + setStatePromise +} from 'ssccommon/utils/asyncFunctions.js'; + +import { toast } from "nc-lightapp-front"; +import sscOpenTo from 'ssccommon/utils/sscOpenTo'; + + +/** + * @method logicalSearchList 查询区查询按钮点击回调 + * @param {Array} conditions 查询区所有字段值 + * @return {Undefined} 无返回值 + */ +async function logicalSearchList(querycondition, allpks = false) { + try { + + const result = await requestPromise({ + url: `/nccloud/ssctp/sscapv/ApproveMonitorQryAction.do`, + data: allpks ? { pks: allpks } : { + querycondition, + pagecode: `701004SPJK_L`, + queryAreaCode: `approvalMonitoringSearchArea`, + querytype: `tree`, + oid: `1001ZG100000000010NY` + }, + }); + + const { data } = result + if (allpks) { // 翻页 + this.props.table.setAllTableData('approvalMonitoringList', { + rows: data ? data.data.rows : [] + }) + } else { // 查询区查询 + this.props.table.setAllTableData('approvalMonitoringList', { + rows: data ? data.data.rows : [], + pageInfo: { + pageIndex: 0, + pageSize: 10, + totalPage: data ? Math.ceil(data.pks.length / 10) : 0, + total: data ? data.pks.length : 0 + }, + allpks: data ? data.pks : [] + }) + this.pubMessage.querySuccess((data ? data.pks : []).length); + } + + this.setState({ disabled: true }) + + } catch (e) { + console.error(e) + } +} + +/** + * @method logicalSearchAreaAfterEvent 查询区编辑后事件 + * @param {String} attrcode 当前操作项对应键值 + * @param {String || Object} values 当前操作项对应字段值 + * @param {String} area 查询区区域id + * @return {Undefined} 无返回值 + */ +async function logicalSearchAreaAfterEvent(attrcode, values, area) { + console.log('logicalSearchAreaAfterEvent: ', attrcode, values, area); +} + +/** + * @method logicalManualReturn 退回人工处理 + * @return {Undefined} 无返回值 + */ +async function logicalManualReturn() { + const { state: { modalVal, multiLang }, props: { + table: { getCheckedRows, updateDataByIndexs, selectAllRows, }, + } } = this + // 校验 退回原因 + if (!modalVal) return toast({ + color: 'warning', + title: multiLang['701004SPJK_007'], + duration: 3 + }) + + const checkedRows = [this.selectedRow];//getCheckedRows('approvalMonitoringList') + // 入参 + const filterRows = checkedRows.filter(e => { + return !(e.resultsflag.value === 'N' && e.expuntreated.value === 'N') && !e.workinggroupname.value + }) + + const pks = filterRows.map(e => e.pk_currenttask.value), + billtypecodes = filterRows.map(e => e.billtypecode.value), + busiids = filterRows.map(e => e.busiid.value), + transtypecodes = filterRows.map(e => e.transtypecode.value), + monitorPks = filterRows.map(e => e.pk_approvemonitor.value) + + const payload = { + reason: modalVal, + pks, + billtypecodes, + busiids, + transtypecodes, + monitorPks, + } + // 所选单据已转过人工处理,不能再进进行人工处理。 + if (pks.length === 0) return toast({ + color: 'warning', + title: multiLang['701004SPJK_012'], + duration: 3 + }) + // 退回处理 + try { + const modules = this.selectedRow.module.value || ""; + const result = await requestPromise({ + url: `/nccloud/${modules}/ssctp/sscapv/TransToManualAction.do`, + data: payload, + }); + + if (!result) return + + const { + data: { + message, color, rows, + }, + } = result + + toast({ + color, + title: message, + duration: 3 + }) + + await setStatePromise.call(this, { showCheckModal: false, modalVal: '' }) // 重置弹出框 + + // 刷新列表 + const newRows = [{ + index: this.selectedIdx, data: rows[0], + }] + + updateDataByIndexs('approvalMonitoringList', newRows) + selectAllRows('approvalMonitoringList', false) + + } catch (e) { + toast({ + color: 'warning', + title: multiLang['701004SPJK_010'], + content: e.data, + duration: 3 + }) + } +} + +/** + * @method logicalOpenBill 单据编码点击打开单据 + * @param {Object} record 当前行数据 + * @return {Undefined} 无返回值 + */ +async function logicalOpenBill(record) { + const { billtypecode, transtypecode, busiid, pk_group } = record + // 打开单据 + try { + + const result = await requestPromise({ + url: `/nccloud/sscrp/rpbill/BrowseBillAction.do`, + data: { + billtypeCode: billtypecode.value, + transtypeCode: transtypecode.value, + billid: busiid.value, + pk_group: pk_group.value + }, + }); + const { data: { data, url, system } } = result + sscOpenTo(this.props, system, [ + url, + { + ...data, + scene: 'bzcx' + }, null, + { + pk_group: record.pk_group.value + } + ]) + + + } catch (e) { + console.error(e) + } +} + +export { + logicalSearchList, + logicalSearchAreaAfterEvent, + logicalManualReturn, + logicalOpenBill, +}; + +/*0YgIFuXJoC2x+5JNXKiUO11ZXLxRDpeZUyfdJGHH3Ew=*/ \ No newline at end of file diff --git a/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/index.js b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/index.js new file mode 100644 index 0000000..4677cd6 --- /dev/null +++ b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/index.js @@ -0,0 +1,8 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import ApprovalMonitoring from './approvalMonitoring.js'; + +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/index.less b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/index.less new file mode 100644 index 0000000..a2d61a3 --- /dev/null +++ b/src/ssctpaaa/intelligentApproval/approvalMonitoring/config/index.less @@ -0,0 +1,35 @@ +#approval-monitoring { + .fuzzyquery { + min-width: 200px; + } + + .billnoa { + cursor: pointer; + } + + .resultsflag-success, + .resultsflag-failure { + width: 8px; + height: 8px; + } + + .resultsflag-failure { + color: #e14c46; + } + + .resultsflag-success { + color: #7dac42; + } + + .u-table-fixed-right { + .opr { + .single-line-and-ellipsis { + text-overflow: initial; + } + } + } + .error-flag { + max-width: 28px !important; + } + +} diff --git a/src/ssctpaaa/public/common/requestApi.js b/src/ssctpaaa/public/common/requestApi.js new file mode 100644 index 0000000..8900619 --- /dev/null +++ b/src/ssctpaaa/public/common/requestApi.js @@ -0,0 +1,48 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax } from 'nc-lightapp-front' + +let requestApiOverwrite = { + queryLastPeriodAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/ssccheck/querylastperiodaction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + //联查条件处理 + linkQueryConditionAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/ssccheck/LinkQueryConditionAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 查看单据 + openBill: opt => { + ajax({ + url: '/nccloud/ssctp/sscbd/LinkBillAction.do', + data: opt.data, + success: data => { + opt.success(data); + } + }); + }, + + // 查看单据 + queryBill: opt => { + ajax({ + url: '/nccloud/ssctp/ssccheck/LinkBillQueryAction.do', + data: opt.data, + success: data => { + opt.success(data); + } + }); + } +} + +export default requestApiOverwrite +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/public/common/ssctpBaseEvents.js b/src/ssctpaaa/public/common/ssctpBaseEvents.js new file mode 100644 index 0000000..c04d884 --- /dev/null +++ b/src/ssctpaaa/public/common/ssctpBaseEvents.js @@ -0,0 +1,147 @@ +/*R/0Z33+J35EX9fEUkfZBCtGpOqeYqOfn+XegCK8k930=*/ +import {ajax, viewModel} from 'nc-lightapp-front' +import requestApi from './requestApi' +let { setGlobalStorage, getGlobalStorage, removeGlobalStorage } = viewModel; +class pubMessage { + constructor(props) { + this.props = props; + } + //参照过滤 + disposeSearch (meta, props) { + let items = meta['light_report'].items + items.forEach((item) => { + + if (item.attrcode == 'pk_org') { + item.queryCondition = () => { + let orgRefBuilder = 'nccloud.web.ssctp.report.sqlbuilder.OrgRefBuilder'; + let data = props.search.getSearchValByField('light_report', 'pk_sscunit').value.firstvalue; + return { pk_sscunit: data,isMutiGroup:'Y', TreeRefActionExt:orgRefBuilder}; + }; + }else if (item.attrcode == 'pk_dept') { + item.queryCondition = () => { + let data = props.search.getSearchValByField('light_report', 'pk_org').value.firstvalue; + return { pk_org: data}; + }; + }else if (item.attrcode == 'pk_transtype') { + item.queryCondition = () => { + let transtypeRefBuilder = 'nccloud.web.ssctp.report.sqlbuilder.TranstypeRefBuilder'; + let data = props.search.getSearchValByField('light_report', 'pk_busiunit').value.firstvalue; + return { pk_busiunit: data, GridRefActionExt:transtypeRefBuilder}; + }; + }else if (item.attrcode == 'pk_busiunit') { + //业务范围参照 + item.queryCondition = () => { + let busiunitRefBuilder = 'nccloud.web.ssctp.report.sqlbuilder.BusiunitRefBuilder'; + let pk_sscunit = props.search.getSearchValByField('light_report', 'pk_sscunit').value.firstvalue; + let pk_org = props.search.getSearchValByField('light_report', 'pk_org').value.firstvalue; + return { pk_sscunit: pk_sscunit,pk_org: pk_org, GridRefActionExt:busiunitRefBuilder}; + }; + } + + }) + return meta; // 处理后的过滤参照返回给查询区模板 + } + + /** + * + * @param items: 查询区查询数据,如需拓展查询区参数,请返回与items相同格式的查询数据 + */ + expandSearchVal (items) { + //目前添加了查询条件后台查询不到 + // let obj = { + // field: 'reportType', + // datatype: '204', + // display: '报表类型', + // isIncludeSub: false, + // oprtype: '=', + // value: {firstvalue: 'fullprocess',secondvalue:''} + // } + // items.conditions.push(obj) + return items + } + + setDefaultVal(searchId, props) { + // props.search.setSearchValByField('light_report', 'reporttype', {firstvalue: 'fullprocess',secondvalue:''}); + } + + /** + * props: props + * searchId: 查询区需要的searchId参数 + * field: 编辑后的key + * val: 编辑后的value + */ + onAfterEvent (props, searchId, field, val) { + if("cur_period" == field){ + var cur_period = props.search.getSearchValByField(searchId, 'cur_period' ); + requestApi.queryPrePeriodAction({ + data: { + cur_period: cur_period.value + }, + success: (data) => { + props.search.setSearchValByField('light_report', 'pre_period', data.data); + } + }) + } else if ("pk_sscunit" == field) { + props.search.setSearchValByField('light_report', 'pk_org', ""); + props.search.setSearchValByField('light_report', 'pk_busiunit', ""); + props.search.setSearchValByField('light_report', 'pk_transtype', ""); + } + // else if("pk_busiunit" == field){ + // if(val && val.length>1){ + // //业务范围多选时,交易类型不可选择 + // props.search.setSearchValByField('light_report', 'pk_transtype', []); + // props.search.setDisabledByField('light_report','pk_transtype',true); + // }else{ + // props.search.setDisabledByField('light_report','pk_transtype',false); + // } + // } + } + + + /** + * isRange: 查询后数据区域内点击单元格按钮可操作。如需要像升降序按钮那样,则设置 disabled={isRange}属性 + * data: 表格数据 + * coords: 选中的单元格 + */ + CreateNewSearchArea (isRange, data, coords) { + // button区域业务端自定义的新增按钮 + //return 新增按钮 + } + + /** + * transSaveObject: 业务端处理的transSaveObject参数 + * obj: 点击联查下拉的item信息 + * data: 联查需要的参数 + * props: 平台props + * url: 平台openTo第一个参数 + * urlParams: 平台openTo第二个参数 + * sessonKey: sessionStorage的key + */ + setConnectionSearch(transSaveObject, obj, data, props, url, urlParams, sessonKey) { + setGlobalStorage('sessionStorage', sessonKey, transSaveObject); //处理好的transSaveObject放到浏览器内存中,必须,跳转报表页面会用到 + if (obj.key == '001'){ + let pkCode = urlParams.reportId; + let defaultCallBack = (res) => { + if (res.success) { + props.openTo(res.data.url, { + ...res.data, + status: 'browse' + }); + } + }; + ajax({ + url: '/nccloud/erm/expdetail/LinkBillAction.do', + data: { + data, + pkCode + }, + success: defaultCallBack + }) + } + if(obj.key == '002'||obj.key == '003'||obj.key == '004'){ + props.openTo(url, urlParams); + } + } +} +export default pubMessage +/*R/0Z33+J35EX9fEUkfZBCtGpOqeYqOfn+XegCK8k930=*/ \ No newline at end of file diff --git a/src/ssctpaaa/public/common/ssctpProblemBaseEvents.js b/src/ssctpaaa/public/common/ssctpProblemBaseEvents.js new file mode 100644 index 0000000..fea0469 --- /dev/null +++ b/src/ssctpaaa/public/common/ssctpProblemBaseEvents.js @@ -0,0 +1,119 @@ +/*FZzVZZvhIN2fe6RNx+F1buKXSummElYTYZye9SRpouzjIjxuGqCRKrrPEtQ2MGMC*/ +import { ajax, viewModel } from 'nc-lightapp-front' +import requestApi from './requestApi' +let { setGlobalStorage, getGlobalStorage, removeGlobalStorage } = viewModel; + + +class pubMessage { + constructor(props) { + this.props = props; + } + //参照过滤 + disposeSearch(meta, props) { + let items = meta['light_report'].items + items.forEach((item) => { + if (item.attrcode == 'pk_org') { + item.queryCondition = () => { + let orgRefBuilder = 'nccloud.web.ssctp.report.sqlbuilder.OrgRefBuilder'; + let data = props.search.getSearchValByField('light_report', 'pk_sscunit').value.firstvalue; + return { pk_sscunit: data,isMutiGroup:'Y', TreeRefActionExt:orgRefBuilder}; + }; + } else if(item.attrcode == 'problemMatterId'){ + item.queryCondition = () => { + let data = props.search.getSearchValByField('light_report', 'pk_sscunit').value.firstvalue; + return {pk_sscunit : data,all:'Y'}; + } + } + + }) + return meta; // 处理后的过滤参照返回给查询区模板 + } + + /** + * + * @param items: 查询区查询数据,如需拓展查询区参数,请返回与items相同格式的查询数据 + */ + expandSearchVal(items) { + //目前添加了查询条件后台查询不到 + // let obj = { + // field: 'reportType', + // datatype: '204', + // display: '报表类型', + // isIncludeSub: false, + // oprtype: '=', + // value: {firstvalue: 'fullprocess',secondvalue:''} + // } + // items.conditions.push(obj) + return items + } + + setDefaultVal(searchId, props) { + // props.search.setSearchValByField('light_report', 'reporttype', {firstvalue: 'fullprocess',secondvalue:''}); + } + + /** + * props: props + * searchId: 查询区需要的searchId参数 + * field: 编辑后的key + * val: 编辑后的value + */ + onAfterEvent(props, searchId, field, val) { + if ("current_date" == field) { + var current_date = props.search.getSearchValByField(searchId, 'current_date'); + if (current_date.value.firstvalue !== "" && current_date.value.secondvalue !== "") { + requestApi.queryLastPeriodAction({ + data: { + current_date: current_date.value + }, + success: (data) => { + props.search.setSearchValByField('light_report', 'last_date', data.data); + } + }) + } + } + + if("pk_sscunit" == field){ + props.search.setSearchValByField('light_report', 'problemMatterId', ''); + props.search.setSearchValByField('light_report', 'pk_org', ''); + } + } + + + /** + * isRange: 查询后数据区域内点击单元格按钮可操作。如需要像升降序按钮那样,则设置 disabled={isRange}属性 + * data: 表格数据 + * coords: 选中的单元格 + */ + CreateNewSearchArea(isRange, data, coords) { + // button区域业务端自定义的新增按钮 + //return 新增按钮 + } + + /** + * transSaveObject: 业务端处理的transSaveObject参数 + * obj: 点击联查下拉的item信息 + * data: 联查需要的参数 + * props: 平台props + * url: 平台openTo第一个参数 + * urlParams: 平台openTo第二个参数 + * sessonKey: sessionStorage的key + */ + setConnectionSearch(transSaveObject, obj, data, props, url, urlParams, sessonKey) { + let pkcode = data.appcode; + let field = data.fldName; + //data.transSaveObject =''; + setGlobalStorage('sessionStorage', sessonKey, transSaveObject); //处理好的transSaveObject放到浏览器内存中,必须,跳转报表页面会用到 + requestApi.linkQueryConditionAction({ + data: { + data, + pkcode, + field + }, + success: (data) => { + this.linkQuery.show(data.data); + } + }) + } +} +export default pubMessage +/*FZzVZZvhIN2fe6RNx+F1buKXSummElYTYZye9SRpouzjIjxuGqCRKrrPEtQ2MGMC*/ \ No newline at end of file diff --git a/src/ssctpaaa/public/components/README.md b/src/ssctpaaa/public/components/README.md new file mode 100644 index 0000000..8becb18 --- /dev/null +++ b/src/ssctpaaa/public/components/README.md @@ -0,0 +1 @@ +SSC_SSCCLOUD_Front init \ No newline at end of file diff --git a/src/ssctpaaa/public/image/billnoOpr/isappointed1.png b/src/ssctpaaa/public/image/billnoOpr/isappointed1.png new file mode 100644 index 0000000..6dfb995 Binary files /dev/null and b/src/ssctpaaa/public/image/billnoOpr/isappointed1.png differ diff --git a/src/ssctpaaa/public/image/billnoOpr/isleaderreject1.png b/src/ssctpaaa/public/image/billnoOpr/isleaderreject1.png new file mode 100644 index 0000000..e8d0b9e Binary files /dev/null and b/src/ssctpaaa/public/image/billnoOpr/isleaderreject1.png differ diff --git a/src/ssctpaaa/public/image/billnoOpr/ismereject1.png b/src/ssctpaaa/public/image/billnoOpr/ismereject1.png new file mode 100644 index 0000000..149cb38 Binary files /dev/null and b/src/ssctpaaa/public/image/billnoOpr/ismereject1.png differ diff --git a/src/ssctpaaa/public/image/billnoOpr/isunapprove1.png b/src/ssctpaaa/public/image/billnoOpr/isunapprove1.png new file mode 100644 index 0000000..6706d7d Binary files /dev/null and b/src/ssctpaaa/public/image/billnoOpr/isunapprove1.png differ diff --git a/src/ssctpaaa/public/image/billnoOpr/outerhandon.png b/src/ssctpaaa/public/image/billnoOpr/outerhandon.png new file mode 100644 index 0000000..d3618ae Binary files /dev/null and b/src/ssctpaaa/public/image/billnoOpr/outerhandon.png differ diff --git a/src/ssctpaaa/public/image/billnoOpr/urgent1.png b/src/ssctpaaa/public/image/billnoOpr/urgent1.png new file mode 100644 index 0000000..0465a77 Binary files /dev/null and b/src/ssctpaaa/public/image/billnoOpr/urgent1.png differ diff --git a/src/ssctpaaa/public/image/blacktheme.png b/src/ssctpaaa/public/image/blacktheme.png new file mode 100644 index 0000000..1267499 Binary files /dev/null and b/src/ssctpaaa/public/image/blacktheme.png differ diff --git a/src/ssctpaaa/public/image/blacktheme1.png b/src/ssctpaaa/public/image/blacktheme1.png new file mode 100644 index 0000000..bb73ee2 Binary files /dev/null and b/src/ssctpaaa/public/image/blacktheme1.png differ diff --git a/src/ssctpaaa/public/image/exceed.png b/src/ssctpaaa/public/image/exceed.png new file mode 100644 index 0000000..8a1f156 Binary files /dev/null and b/src/ssctpaaa/public/image/exceed.png differ diff --git a/src/ssctpaaa/public/image/gxicon1.png b/src/ssctpaaa/public/image/gxicon1.png new file mode 100644 index 0000000..faf941d Binary files /dev/null and b/src/ssctpaaa/public/image/gxicon1.png differ diff --git a/src/ssctpaaa/public/image/gxicon2.png b/src/ssctpaaa/public/image/gxicon2.png new file mode 100644 index 0000000..d5b0889 Binary files /dev/null and b/src/ssctpaaa/public/image/gxicon2.png differ diff --git a/src/ssctpaaa/public/image/gxicon3.png b/src/ssctpaaa/public/image/gxicon3.png new file mode 100644 index 0000000..be132e9 Binary files /dev/null and b/src/ssctpaaa/public/image/gxicon3.png differ diff --git a/src/ssctpaaa/public/image/gxicon4.png b/src/ssctpaaa/public/image/gxicon4.png new file mode 100644 index 0000000..85138da Binary files /dev/null and b/src/ssctpaaa/public/image/gxicon4.png differ diff --git a/src/ssctpaaa/public/image/gxicon5.png b/src/ssctpaaa/public/image/gxicon5.png new file mode 100644 index 0000000..c7d37e6 Binary files /dev/null and b/src/ssctpaaa/public/image/gxicon5.png differ diff --git a/src/ssctpaaa/public/image/hangup1.png b/src/ssctpaaa/public/image/hangup1.png new file mode 100644 index 0000000..113cb33 Binary files /dev/null and b/src/ssctpaaa/public/image/hangup1.png differ diff --git a/src/ssctpaaa/public/image/isappointed1.png b/src/ssctpaaa/public/image/isappointed1.png new file mode 100644 index 0000000..4dc1847 Binary files /dev/null and b/src/ssctpaaa/public/image/isappointed1.png differ diff --git a/src/ssctpaaa/public/image/isleaderreject1.png b/src/ssctpaaa/public/image/isleaderreject1.png new file mode 100644 index 0000000..8b858af Binary files /dev/null and b/src/ssctpaaa/public/image/isleaderreject1.png differ diff --git a/src/ssctpaaa/public/image/ismereject1.png b/src/ssctpaaa/public/image/ismereject1.png new file mode 100644 index 0000000..240fb80 Binary files /dev/null and b/src/ssctpaaa/public/image/ismereject1.png differ diff --git a/src/ssctpaaa/public/image/isunapprove1.png b/src/ssctpaaa/public/image/isunapprove1.png new file mode 100644 index 0000000..44c911d Binary files /dev/null and b/src/ssctpaaa/public/image/isunapprove1.png differ diff --git a/src/ssctpaaa/public/image/level1_1.png b/src/ssctpaaa/public/image/level1_1.png new file mode 100644 index 0000000..fd1312d Binary files /dev/null and b/src/ssctpaaa/public/image/level1_1.png differ diff --git a/src/ssctpaaa/public/image/level1_2.png b/src/ssctpaaa/public/image/level1_2.png new file mode 100644 index 0000000..006c2b5 Binary files /dev/null and b/src/ssctpaaa/public/image/level1_2.png differ diff --git a/src/ssctpaaa/public/image/level2_1.png b/src/ssctpaaa/public/image/level2_1.png new file mode 100644 index 0000000..412a0f7 Binary files /dev/null and b/src/ssctpaaa/public/image/level2_1.png differ diff --git a/src/ssctpaaa/public/image/level2_2.png b/src/ssctpaaa/public/image/level2_2.png new file mode 100644 index 0000000..ab1e906 Binary files /dev/null and b/src/ssctpaaa/public/image/level2_2.png differ diff --git a/src/ssctpaaa/public/image/level3_1.png b/src/ssctpaaa/public/image/level3_1.png new file mode 100644 index 0000000..106206d Binary files /dev/null and b/src/ssctpaaa/public/image/level3_1.png differ diff --git a/src/ssctpaaa/public/image/level3_2.png b/src/ssctpaaa/public/image/level3_2.png new file mode 100644 index 0000000..d44f7d9 Binary files /dev/null and b/src/ssctpaaa/public/image/level3_2.png differ diff --git a/src/ssctpaaa/public/image/level4_1.png b/src/ssctpaaa/public/image/level4_1.png new file mode 100644 index 0000000..41d25f9 Binary files /dev/null and b/src/ssctpaaa/public/image/level4_1.png differ diff --git a/src/ssctpaaa/public/image/level4_2.png b/src/ssctpaaa/public/image/level4_2.png new file mode 100644 index 0000000..e90faa3 Binary files /dev/null and b/src/ssctpaaa/public/image/level4_2.png differ diff --git a/src/ssctpaaa/public/image/level5_1.png b/src/ssctpaaa/public/image/level5_1.png new file mode 100644 index 0000000..285adcd Binary files /dev/null and b/src/ssctpaaa/public/image/level5_1.png differ diff --git a/src/ssctpaaa/public/image/level5_2.png b/src/ssctpaaa/public/image/level5_2.png new file mode 100644 index 0000000..737b2fb Binary files /dev/null and b/src/ssctpaaa/public/image/level5_2.png differ diff --git a/src/ssctpaaa/public/image/nccicon/business-dd.svg b/src/ssctpaaa/public/image/nccicon/business-dd.svg new file mode 100644 index 0000000..28360d2 --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/business-dd.svg @@ -0,0 +1,25 @@ + + + + +作业调度 +Created with Sketch. + + + + + + + + + diff --git a/src/ssctpaaa/public/image/nccicon/business-zy.svg b/src/ssctpaaa/public/image/nccicon/business-zy.svg new file mode 100644 index 0000000..78082a2 --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/business-zy.svg @@ -0,0 +1,24 @@ + + + + +我的作业 +Created with Sketch. + + + + + + diff --git a/src/ssctpaaa/public/image/nccicon/industry-dd.svg b/src/ssctpaaa/public/image/nccicon/industry-dd.svg new file mode 100644 index 0000000..28360d2 --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/industry-dd.svg @@ -0,0 +1,25 @@ + + + + +作业调度 +Created with Sketch. + + + + + + + + + diff --git a/src/ssctpaaa/public/image/nccicon/industry-zy.svg b/src/ssctpaaa/public/image/nccicon/industry-zy.svg new file mode 100644 index 0000000..78082a2 --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/industry-zy.svg @@ -0,0 +1,24 @@ + + + + +我的作业 +Created with Sketch. + + + + + + diff --git a/src/ssctpaaa/public/image/nccicon/simple-dd.svg b/src/ssctpaaa/public/image/nccicon/simple-dd.svg new file mode 100644 index 0000000..3807acd --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/simple-dd.svg @@ -0,0 +1,33 @@ + + + + +简约-作业调度 +Created with Sketch. + + + + + + + + + + diff --git a/src/ssctpaaa/public/image/nccicon/simple-zy.svg b/src/ssctpaaa/public/image/nccicon/simple-zy.svg new file mode 100644 index 0000000..d74c5dd --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/simple-zy.svg @@ -0,0 +1,37 @@ + + + + +简约-我的作业备份 +Created with Sketch. + + + + + + + + + + + + + diff --git a/src/ssctpaaa/public/image/nccicon/youth-dd.svg b/src/ssctpaaa/public/image/nccicon/youth-dd.svg new file mode 100644 index 0000000..ea80b41 --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/youth-dd.svg @@ -0,0 +1 @@ +青春-作业调度 \ No newline at end of file diff --git a/src/ssctpaaa/public/image/nccicon/youth-zy.svg b/src/ssctpaaa/public/image/nccicon/youth-zy.svg new file mode 100644 index 0000000..257f609 --- /dev/null +++ b/src/ssctpaaa/public/image/nccicon/youth-zy.svg @@ -0,0 +1 @@ +青春-我的作业 \ No newline at end of file diff --git a/src/ssctpaaa/public/image/no-data.png b/src/ssctpaaa/public/image/no-data.png new file mode 100644 index 0000000..8412331 Binary files /dev/null and b/src/ssctpaaa/public/image/no-data.png differ diff --git a/src/ssctpaaa/public/image/pre.png b/src/ssctpaaa/public/image/pre.png new file mode 100644 index 0000000..02b6650 Binary files /dev/null and b/src/ssctpaaa/public/image/pre.png differ diff --git a/src/ssctpaaa/public/image/tpbg.png b/src/ssctpaaa/public/image/tpbg.png new file mode 100644 index 0000000..542b147 Binary files /dev/null and b/src/ssctpaaa/public/image/tpbg.png differ diff --git a/src/ssctpaaa/public/image/tpbg1.png b/src/ssctpaaa/public/image/tpbg1.png new file mode 100644 index 0000000..3a983eb Binary files /dev/null and b/src/ssctpaaa/public/image/tpbg1.png differ diff --git a/src/ssctpaaa/public/image/urgent1.png b/src/ssctpaaa/public/image/urgent1.png new file mode 100644 index 0000000..a0029ab Binary files /dev/null and b/src/ssctpaaa/public/image/urgent1.png differ diff --git a/src/ssctpaaa/public/image/ywicon1.png b/src/ssctpaaa/public/image/ywicon1.png new file mode 100644 index 0000000..0ea88ef Binary files /dev/null and b/src/ssctpaaa/public/image/ywicon1.png differ diff --git a/src/ssctpaaa/public/image/ywicon2.png b/src/ssctpaaa/public/image/ywicon2.png new file mode 100644 index 0000000..deafab6 Binary files /dev/null and b/src/ssctpaaa/public/image/ywicon2.png differ diff --git a/src/ssctpaaa/public/image/ywicon3.png b/src/ssctpaaa/public/image/ywicon3.png new file mode 100644 index 0000000..bb399d3 Binary files /dev/null and b/src/ssctpaaa/public/image/ywicon3.png differ diff --git a/src/ssctpaaa/public/image/ywicon4.png b/src/ssctpaaa/public/image/ywicon4.png new file mode 100644 index 0000000..d8b71d8 Binary files /dev/null and b/src/ssctpaaa/public/image/ywicon4.png differ diff --git a/src/ssctpaaa/public/lang/standard/simpchn/7010.json b/src/ssctpaaa/public/lang/standard/simpchn/7010.json new file mode 100644 index 0000000..cbe3721 --- /dev/null +++ b/src/ssctpaaa/public/lang/standard/simpchn/7010.json @@ -0,0 +1,333 @@ +{ + "7010-0001": "确定", + "7010-0002": "删除", + "7010-0003": "保存", + "7010-0004": "取消", + + "7010-0005": "超期", + "7010-0006": "即将超期", + "7010-0007": "出纳驳回:金额数值已经超出了公司限额,请 修改金额数值。", + "7010-0008": "单据编号", + "7010-0009": "小时", + "7010-0010": "分钟", + "7010-0011": "是", + "7010-0012": "否", + "7010-0013": "处理成功", + "7010-0014": "启用成功", + "7010-0015": "停用成功", + + "701001RWCL-0001": "定向提取", + "701001RWCL-0002": "审批情况", + "701001RWCL-0003": "批准", + "701001RWCL-0004": "取消审核", + "701001RWCL-0005": "驳回", + "701001RWCL-0006": "挂起", + "701001RWCL-0007": "申请调整", + "701001RWCL-0008": "操作记录", + "701001RWCL-0009": "返回", + "701001RWCL-0010": "我的作业", + "701001RWCL-0011": "待处理", + "701001RWCL-0012": "已驳回", + "701001RWCL-0013": "已挂起", + "701001RWCL-0014": "待调整", + "701001RWCL-0015": "已处理", + "701001RWCL-0016": "任务提取", + "701001RWCL-0017": "取消调整", + "701001RWCL-0018": "取消挂起", + "701001RWCL-0019": "浏览器不支持iframe标签", + "701001RWCL-0020": "定向提取", + "701001RWCL-0021": "待提取", + "701001RWCL-0022": "提取任务", + "701001RWCL-0023": "提取成功", + "701001RWCL-0024": "当前没有待提取任务!", + "701001RWCL-0025": "我的作业", + "701001RWCL-0026": "已提取", + "701001RWCL-0027": "优先级管理", + "701001RWCL-0028": "作业调度", + "701001RWCL-0029": "本周作业情况", + "701001RWCL-0030": "平均处理时间", + "701001RWCL-0031": "组内排名", + "701001RWCL-0032": "今日作业量", + "701001RWCL-0033": "在手作业量", + "701001RWCL-0034": "返回任务列表", + "701001RWCL-0035": "空", + "701001RWCL-0036": "信用等级:", + "701001RWCL-0037": "信用批准", + "701001RWCL-0038": "修改", + "701001RWCL-0039": "确定要删除吗?", + "701001RWCL-0040": "对应组织:", + "701001RWCL-0041": "备注:", + "701001RWCL-0042": "删除成功", + "701001RWCL-0043": "启用成功", + "701001RWCL-0044": "停用成功", + "701001RWCL-0045": "共享中心管理", + "701001RWCL-0046": "新增", + + "701001RWCL-0047": "提示信息", + "701001RWCL-0048": "温馨提示", + "701001RWCL-0049": "是否继续?", + "701001RWCL-0050": "共享环节", + "701001RWCL-0051": "作业组", + "701001RWCL-0052": "请选择人员", + "701001RWCL-0053": "请输入分配原因", + "701001RWCL-0054": "人员列表", + "701001RWCL-0055": "强制分配", + "701001RWCL-0056": "紧急", + "701001RWCL-0057": "本人驳回", + "701001RWCL-0058": "上级驳回", + "701001RWCL-0059": "业务单元", + "701001RWCL-0060": "操作", + "701001RWCL-0061": "包含", + "701001RWCL-0062": "滑动加载更多", + "701001RWCL-0063": "优先级设置", + "701001RWCL-0064": "置顶成功", + "701001RWCL-0065": "置顶失败", + "701001RWCL-0066": "修改成功", + "701001RWCL-0067": "修改失败", + "701001RWCL-0068": "设置委托关系", + "701001RWCL-0069": "请搜索业务单元", + "701001RWCL-0070": "显示停用", + "701001RWCL-0071": "新增共享委托关系", + "701001RWCL-0072": "以下业务单元已委托给当前共享服务中心,不可重复委托", + "701001RWCL-0073": "确定要重置任务吗?", + "701001RWCL-0074": "此操作会丢失本次修改,请确定?", + "701001RWCL-0075": "重置完成,已重置", + "701001RWCL-0076": "条任务", + "701001RWCL-0077": "重置任务", + "701001RWCL-0078": "集团(所有)", + "701001RWCL-0079": "第", + "701001RWCL-0080": "行作业组不能为空", + "701001RWCL-0081": "规则适用作业组", + "701001RWCL-0082": "确认要删除该信息吗?", + "701001RWCL-0083": "您有未保存的数据,请保存后重试", + "701001RWCL-0084": "请至少选择一条数据", + "701001RWCL-0085": "批量删除", + "701001RWCL-0086": "确认删除选中数据吗?", + "701001RWCL-0087": "新增提取规则", + "701001RWCL-0088": "修改提取规则", + "701001RWCL-0089": "请至少选择一行数据", + "701001RWCL-0090": "提示", + "701001RWCL-0091": "确定删除所选数据?", + "701001RWCL-0092": "无", + "701001RWCL-0093": "周", + "701001RWCL-0094": "月", + "701001RWCL-0095": "年", + "701001RWCL-0096": "公共字段", + "701001RWCL-0097": "表和字段", + "701001RWCL-0098": "元数据属性", + "701001RWCL-0099": "确定要停用该共享中心吗?", + "701001RWCL-0100": "确定要启用该共享中心吗?", + "701001RWCL-0101": "已存在下级作业组规则,不允许修改规则", + "701001RWCL-0102": "单位范围", + "701001RWCL-0103": "交易类型", + "701001RWCL-0104": "单据类型", + "701001RWCL-0105": "确定要停用该作业组规则吗?", + "701001RWCL-0106": "确定要启用该作业组规则吗?", + "701001RWCL-0107": "将上级任务规则带到本作业组?", + "701001RWCL-0108": "将上级任务规则带到本作业组?", + "701001RWCL-0109": "搜索名称", + "701001RWCL-0110": "规则名称", + "701001RWCL-0111": "【查看全部】", + "701001RWCL-0112": "更多范围", + "701001RWCL-0113": "包含下级单位", + "701001RWCL-0114": "配置作业组工作", + "701001RWCL-0115": "保存新增", + "701001RWCL-0116": "新增作业组规则", + "701001RWCL-0117": "表格无可操作数据,不允许保存", + "701001RWCL-0118": "保存成功", + "701001RWCL-0119": "组长", + "701001RWCL-0120": "组员", + "701001RWCL-0121": "人", + "701001RWCL-0122": "全选", + "701001RWCL-0123": "目标作业组下已存在用户:", + "701001RWCL-0124": "、", + "701001RWCL-0125": "请继续选择组员", + "701001RWCL-0126": "请继续选择组长", + "701001RWCL-0127": "已选中,请勿重复选择", + "701001RWCL-0128": "请搜索用户名称", + "701001RWCL-0129": "配置作业组用户", + "701001RWCL-0130": "已选", + "701001RWCL-0131": "清空", + "701001RWCL-0132": "复制到", + "701001RWCL-0133": "移动到", + "701001RWCL-0134": "请输入申请调整原因", + "701001RWCL-0135": "请注意", + "701001RWCL-0136": "请选择至少一个信用指标", + "701001RWCL-0137": "请输入信用审批建议", + "701001RWCL-0138": "请查询", + "701001RWCL-0139": "信用审批", + "701001RWCL-0140": "信用评价", + "701001RWCL-0141": "请输入挂起原因", + "701001RWCL-0142": "请选择驳回流程", + "701001RWCL-0143": "请输入驳回原因", + "701001RWCL-0144": "驳回成功", + "701001RWCL-0145": "驳回至", + "701001RWCL-0146": "重走流程", + "701001RWCL-0147": "不重走流程", + "701001RWCL-0148": "请输入取消调整原因", + "701001RWCL-0149": "请输入取消挂起原因", + "701001RWCL-0150": "单", + "701001RWCL-0151": "本周排名", + "701001RWCL-0152": "本周处理", + "701001RWCL-0153": "本周驳回", + "701001RWCL-0154": "本月排名", + "701001RWCL-0155": "本月处理", + "701001RWCL-0156": "本月驳回", + "701001RWCL-0157": "本年排名", + "701001RWCL-0158": "本年处理", + "701001RWCL-0159": "本年驳回", + "701001RWCL-0160": "作业处理量", + "701001RWCL-0161": "总处理量", + "701001RWCL-0162": "重置完成", + "701001RWCL-0163": "已重置", + "701001RWCL-0164": "已处理", + "701001RWCL-0165": "提取规则", + "701001RWCL-0166": "公共字段数据", + "701001RWCL-0167": "共享中心编码不能超过10位", + "701001RWCL-0168": "确定要删除所选数据吗?", + "701001RWCL-0169": "取消审批", + "701001RWCL-0170": "确定要取消吗?", + + "701001RWCL-0171": "设置智能审批规则", + "701001RWCL-0172": "立即执行", + "701001RWCL-0173": "新增智能审批规则", + "701001RWCL-0174": "规则编码", + "701001RWCL-0175": "规则名称", + "701001RWCL-0176": "审批条件", + "701001RWCL-0177": "单据类型", + "701001RWCL-0178": "交易类型", + "701001RWCL-0179": "单位范围", + "701001RWCL-0180": "包含下级单位", + "701001RWCL-0181": "设置智能审批规则", + "701001RWCL-0182": "超期状态", + + "701001RWCL-0183": "当前作业组未配置优先级", + "701001RWCL-0184": "外部挂起", + "701001RWCL-0185": "创建共享中心", + "701001RWCL-0186": "设置任务优先级", + "701001RWCL-0187": "确定要删除所选数据吗?", + "701001RWCL-0188": "配置提取规则", + + "701001RWCL-0189": "确定要启用吗?", + "701001RWCL-0190": "确定要停用吗?", + "701001RWCL-0191": "报账本币金额", + "701001RWCL-0192": "报账人信用", + "701001RWCL-0193": "标准作业时间(小时)", + "701001RWCL-0194": "提前预警时间(小时)", + "701001RWCL-0195": "业务单元+集团", + "701001RWCL-0196": "接单", + "701001RWCL-0197": "请选择共享中心", + "701001RWCL-0198": "审核要点必须全部通过", + "701001RWCL-0199": "是", + "701001RWCL-0200": "否", + "701001RWCL-0201": "序号", + + "701001RWCL-0202": "联查凭证", + "701001RWCL-0203": "出纳驳回", + + "701001RWCL-0204": "接单中", + "701001RWCL-0205": "停止接单", + "701001RWCL-0206": "开始接单", + "701001RWCL-0207": "有新的作业任务", + + + "refer-0001": "编码", + "refer-0002": "名称", + + "refer-sscworkgroupuser-0001": "作业人员", + "refer-sscnode-0001": "共享环节", + "refer-sscworkgroup-0001": "作业组", + "refer-sscunit-0001": "共享中心", + "refer-sscsmuser-0001": "用户", + "refer-sscsmuser-0002": "用户编码", + "refer-sscsmuser-0003": "用户名称", + "refer-sscsmuser-0004": "人员姓名", + "refer-sscsmuser-0005": "人员部门", + "refer-sscsmuser-0006": "人员单位", + "refer-creditrule-0001": "信用指标", + "refer-dooroad-0001": "业务系统", + + "refer-sscuser-0001": "共享服务中心", + "refer-sscuser-0002": "编码", + "refer-sscuser-0003": "名称", + + "701003RWCX-0169": "作业查询", + "701003RWCX-0170": "模糊搜索", + "701003RWCX-0171": "滑动加载更多", + "701003RWCX-0172": "作业查询", + + "701004RWCL-0173": "请保存您的信息修改。", + + "701004SPJK_001": "智能审批监控", + "701004SPJK_004": "退回人工处理", + "701004SPJK_005": "确定", + "701004SPJK_006": "取消", + "701004SPJK_007": "请输入退回人工处理原因!", + "701004SPJK_008": "未选中单据!", + "701004SPJK_009": "没有查询到单据。", + "701004SPJK_010": "退回人工处理失败!", + "701004SPJK_011": "成功退回人工处理", + "701004SPJK_012": "所选单据已转过人工处理,不能再进行人工处理。", + "701004SPJK_013": "条", + + "701004SPGZ_001": "确定要启用该审批规则吗?", + "701004SPGZ_002": "确定要停用该审批规则吗?", + "701004SPGZ_003": "已停用的审批规则不能执行", + "701004SPGZ_004": "请选择共享中心", + + "700108PDGZ-001": "规则编码", + "700108PDGZ-002": "规则名称", + "700108PDGZ-003": "按工作日历派单", + "700108PDGZ-004": "工作日历", + "700108PDGZ-005": "任务分配规则", + "700108PDGZ-006": "管理层级", + "700108PDGZ-007": "作业组范围", + "700108PDGZ-008": "确定启用派单规则?", + "700108PDGZ-009": "确定停用派单规则?", + "700108PDGZ-010": "修改", + "700108PDGZ-011": "确定要删除吗?", + "700108PDGZ-012": "删除", + "700108PDGZ-013": "【查看全部】", + "700108PDGZ-014": "配置派单规则", + "700108PDGZ-015": "新增派单规则", + "700108PDGZ-016": "派单阈值", + + + "refer-busitype-0001": "业务范围", + "refer-busitype-0002": "业务名称", + + "7010Filter-All": "全部", + + "700109RYZT-TITLE": "作业人员状态", + + "7010-PROBLEM-01": "无问题明细", + + "7010-PROBLEM-02": "隐藏问题明细", + + "7010-PROBLEM-03": "显示问题明细", + + "7010-PROBLEM-04": "操作", + + "701010DOOROAD-001": "注册业务系统", + "701010DOOROAD-002": "修改", + "701010DOOROAD-003": "删除", + "701010DOOROAD-004": "新增业务系统", + "701010DOOROAD-005": "修改业务系统", + "701010DOOROAD-006": "保存", + "701010DOOROAD-007": "取消", + "701010DOOROAD-008": "设置单据打开方式", + "701010DOOROAD-009": "设置影像接口", + "701010DOOROAD-010": "接口参数", + "701010DOOROAD-011": "设置附件接口", + "701010DOOROAD-012": "事件注册", + "701010DOOROAD-013": "操作", + "701010DOOROAD-014": "确定要删除吗?", + "701010DOOROAD-015": "注册业务事件", + "701010DOOROAD-016": "保存成功!", + "701010DOOROAD-017": "删除成功!", + "701010DOOROAD-018": "确定要删除吗?", + "701010DOOROAD-019": "确定要取消吗?", + "701010DOOROAD-020": "批量新增", + "701010DOOROAD-021": "设置凭证打开方式", + "701010DOOROAD-022": "刷新成功!" +} \ No newline at end of file diff --git a/src/ssctpaaa/public/lang/standard/simpchn/7011.json b/src/ssctpaaa/public/lang/standard/simpchn/7011.json new file mode 100644 index 0000000..5a659a5 --- /dev/null +++ b/src/ssctpaaa/public/lang/standard/simpchn/7011.json @@ -0,0 +1,4 @@ +{ + "7011-0001": "联查凭证", + "7011-0002": "暂无凭证数据!" +} \ No newline at end of file diff --git a/src/ssctpaaa/public/music/ssctp_newbill.mp3 b/src/ssctpaaa/public/music/ssctp_newbill.mp3 new file mode 100644 index 0000000..0922de0 Binary files /dev/null and b/src/ssctpaaa/public/music/ssctp_newbill.mp3 differ diff --git a/src/ssctpaaa/refer/sscbd/CreditRuleTreeRef/index.js b/src/ssctpaaa/refer/sscbd/CreditRuleTreeRef/index.js new file mode 100644 index 0000000..cce5c78 --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/CreditRuleTreeRef/index.js @@ -0,0 +1,88 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function(e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssctp/refer/credit/CreditRuleTreeRef/index"] = r(require("nc-lightapp-front")) : e["ssctp/refer/credit/CreditRuleTreeRef/index"] = r(e["nc-lightapp-front"]) +} (window, +function(e) { + return function(e) { + var r = {}; + function t(n) { + if (r[n]) return r[n].exports; + var o = r[n] = { + i: n, + l: !1, + exports: {} + }; + return e[n].call(o.exports, o, o.exports, t), + o.l = !0, + o.exports + } + return t.m = e, + t.c = r, + t.d = function(e, r, n) { + t.o(e, r) || Object.defineProperty(e, r, { + configurable: !1, + enumerable: !0, + get: n + }) + }, + t.r = function(e) { + Object.defineProperty(e, "__esModule", { + value: !0 + }) + }, + t.n = function(e) { + var r = e && e.__esModule ? + function() { + return e. + default + }: + function() { + return e + }; + return t.d(r, "a", r), + r + }, + t.o = function(e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, + t.p = "../../../../", + t(t.s = 629) + } ({ + 0 : function(r, t) { + r.exports = e + }, + 256 : function(e, r, t) { + "use strict"; + Object.defineProperty(r, "__esModule", { + value: !0 + }), + r. + default = function() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(n, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "tree", + refName: "refer-creditrule-0001", + placeholder: "refer-creditrule-0001", + refCode: "ssctp.refer.credit.CreditRuleTreeRef", + queryTreeUrl: "/nccloud/ssctp/credit/creditRuleAction.do", + treeConfig: { + name: ["refer-0001", "refer-0002"], + code: ["refcode", "refname"] + }, + isMultiSelectedEnabled: !1 + }, + e)) + }; + var n = t(0).high.Refer + }, + 629 : function(e, r, t) { + e.exports = t(256) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCBusiTypeGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCBusiTypeGridRef/index.js new file mode 100644 index 0000000..74fdb9d --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCBusiTypeGridRef/index.js @@ -0,0 +1,56 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function (e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssctp/refer/sscbd/SSCBusiTypeGridRef/index"] = r(require("nc-lightapp-front")) : e["ssctp/refer/sscbd/SSCBusiTypeGridRef/index"] = r(e["nc-lightapp-front"]) +}(window, function (e) { + return function (e) { + var r = {}; + + function o(t) { + if (r[t]) return r[t].exports; + var n = r[t] = {i: t, l: !1, exports: {}}; + return e[t].call(n.exports, n, n.exports, o), n.l = !0, n.exports + } + + return o.m = e, o.c = r, o.d = function (e, r, t) { + o.o(e, r) || Object.defineProperty(e, r, {configurable: !1, enumerable: !0, get: t}) + }, o.r = function (e) { + Object.defineProperty(e, "__esModule", {value: !0}) + }, o.n = function (e) { + var r = e && e.__esModule ? function () { + return e.default + } : function () { + return e + }; + return o.d(r, "a", r), r + }, o.o = function (e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, o.p = "../../../../", o(o.s = 635) + }({ + 0: function (r, o) { + r.exports = e + }, 261: function (e, r, o) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), r.default = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(t, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "grid", + refName: "refer-busitype-0001", + placeholder: "refer-busitype-0001", + refCode: "sscpfa.pfareport.SSCBusiTypeGridRef", + queryGridUrl: "/nccloud/ssctp/sscbd/SSCBusiTypeGridRef.do", + columnConfig: [{name: ["refer-busitype-0002"], code: ["refname"]}], + isMultiSelectedEnabled: !1 + }, e)) + }; + var t = o(0).high.Refer + }, 635: function (e, r, o) { + e.exports = o(261) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCNodeGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCNodeGridRef/index.js new file mode 100644 index 0000000..b532cfe --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCNodeGridRef/index.js @@ -0,0 +1,56 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function (e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssccloud/refer/sscbd/SSCUnitGridRef/index"] = r(require("nc-lightapp-front")) : e["ssccloud/refer/sscbd/SSCUnitGridRef/index"] = r(e["nc-lightapp-front"]) +}(window, function (e) { + return function (e) { + var r = {}; + + function o(t) { + if (r[t]) return r[t].exports; + var n = r[t] = {i: t, l: !1, exports: {}}; + return e[t].call(n.exports, n, n.exports, o), n.l = !0, n.exports + } + + return o.m = e, o.c = r, o.d = function (e, r, t) { + o.o(e, r) || Object.defineProperty(e, r, {configurable: !1, enumerable: !0, get: t}) + }, o.r = function (e) { + Object.defineProperty(e, "__esModule", {value: !0}) + }, o.n = function (e) { + var r = e && e.__esModule ? function () { + return e.default + } : function () { + return e + }; + return o.d(r, "a", r), r + }, o.o = function (e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, o.p = "../../../../", o(o.s = 635) + }({ + 0: function (r, o) { + r.exports = e + }, 261: function (e, r, o) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), r.default = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(t, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "grid", + refName: "refer-sscnode-0001", + placeholder: "refer-sscnode-0001", + refCode: "ssctp.refer.sscbd.SSCNodeGridRef", + queryGridUrl: "/nccloud/sscbd/allotrulepost/SSCNodeGridRef.do", + columnConfig: [{name: ["refer-0001", "refer-0002"], code: ["refcode", "refname"]}], + isMultiSelectedEnabled: !1 + }, e)) + }; + var t = o(0).high.Refer + }, 635: function (e, r, o) { + e.exports = o(261) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCOtsGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCOtsGridRef/index.js new file mode 100644 index 0000000..423fe77 --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCOtsGridRef/index.js @@ -0,0 +1,56 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function (e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssctp/refer/sscbd/SSCOtsGridRef/index"] = r(require("nc-lightapp-front")) : e["ssctp/refer/sscbd/SSCOtsGridRef/index"] = r(e["nc-lightapp-front"]) +}(window, function (e) { + return function (e) { + var r = {}; + + function o(t) { + if (r[t]) return r[t].exports; + var n = r[t] = {i: t, l: !1, exports: {}}; + return e[t].call(n.exports, n, n.exports, o), n.l = !0, n.exports + } + + return o.m = e, o.c = r, o.d = function (e, r, t) { + o.o(e, r) || Object.defineProperty(e, r, {configurable: !1, enumerable: !0, get: t}) + }, o.r = function (e) { + Object.defineProperty(e, "__esModule", {value: !0}) + }, o.n = function (e) { + var r = e && e.__esModule ? function () { + return e.default + } : function () { + return e + }; + return o.d(r, "a", r), r + }, o.o = function (e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, o.p = "../../../../", o(o.s = 635) + }({ + 0: function (r, o) { + r.exports = e + }, 261: function (e, r, o) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), r.default = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(t, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "grid", + refName: "refer-dooroad-0001", + placeholder: "refer-dooroad-0001", + refCode: "ssctp.refer.sscbd.SSCOtsGridRef", + queryGridUrl: "/nccloud/ssctp/dooroad/SSCOtsGridRef.do", + columnConfig: [{name: ["refer-0001", "refer-0002"], code: ["refcode", "refname"]}], + isMultiSelectedEnabled: !1 + }, e)) + }; + var t = o(0).high.Refer + }, 635: function (e, r, o) { + e.exports = o(261) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCParticipantGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCParticipantGridRef/index.js new file mode 100644 index 0000000..2086006 --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCParticipantGridRef/index.js @@ -0,0 +1,57 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function (e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssctp/refer/sscbd/SSCParticipantGridRef/index"] = r(require("nc-lightapp-front")) : e["ssctp/refer/sscbd/SSCParticipantGridRef/index"] = r(e["nc-lightapp-front"]) +}(window, function (e) { + return function (e) { + var r = {}; + + function o(t) { + if (r[t]) return r[t].exports; + var n = r[t] = {i: t, l: !1, exports: {}}; + return e[t].call(n.exports, n, n.exports, o), n.l = !0, n.exports + } + + return o.m = e, o.c = r, o.d = function (e, r, t) { + o.o(e, r) || Object.defineProperty(e, r, {configurable: !1, enumerable: !0, get: t}) + }, o.r = function (e) { + Object.defineProperty(e, "__esModule", {value: !0}) + }, o.n = function (e) { + var r = e && e.__esModule ? function () { + return e.default + } : function () { + return e + }; + return o.d(r, "a", r), r + }, o.o = function (e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, o.p = "../../../../", o(o.s = 635) + }({ + 0: function (r, o) { + r.exports = e + }, 261: function (e, r, o) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), r.default = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(t, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "grid", + refName: "refer-sscuser-0001", + placeholder: "refer-sscuser-0001", + refCode: "ssctp.refer.sscbd.SSCParticipantGridRef", + queryGridUrl: "/nccloud/ssctp/sscbd/SSCParticipantGridRef.do", + columnConfig: [{name: ["refer-sscuser-0002", "refer-sscuser-0003"], code: ["refcode", "refname"]}], + isMultiSelectedEnabled: !1, + isShowTableSearch:false + }, e)) + }; + var t = o(0).high.Refer + }, 635: function (e, r, o) { + e.exports = o(261) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCSMUserGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCSMUserGridRef/index.js new file mode 100644 index 0000000..a20d9cc --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCSMUserGridRef/index.js @@ -0,0 +1,57 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function (e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssctp/refer/sscbd/SSCSMUserGridRef/index"] = r(require("nc-lightapp-front")) : e["ssctp/refer/sscbd/SSCSMUserGridRef/index"] = r(e["nc-lightapp-front"]) +}(window, function (e) { + return function (e) { + var r = {}; + + function o(t) { + if (r[t]) return r[t].exports; + var n = r[t] = {i: t, l: !1, exports: {}}; + return e[t].call(n.exports, n, n.exports, o), n.l = !0, n.exports + } + + return o.m = e, o.c = r, o.d = function (e, r, t) { + o.o(e, r) || Object.defineProperty(e, r, {configurable: !1, enumerable: !0, get: t}) + }, o.r = function (e) { + Object.defineProperty(e, "__esModule", {value: !0}) + }, o.n = function (e) { + var r = e && e.__esModule ? function () { + return e.default + } : function () { + return e + }; + return o.d(r, "a", r), r + }, o.o = function (e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, o.p = "../../../../", o(o.s = 635) + }({ + 0: function (r, o) { + r.exports = e + }, 261: function (e, r, o) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), r.default = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(t, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "grid", + refName: "refer-sscsmuser-0001", + placeholder: "refer-sscsmuser-0001", + refCode: "ssctp.refer.sscbd.SSCSMUserGridRef", + queryGridUrl: "/nccloud/sscbd/workinggroupuser/SSCSMUserGridRef.do", + columnConfig: [{name: ["refer-sscsmuser-0002", "refer-sscsmuser-0003", "refer-sscsmuser-0004", "refer-sscsmuser-0005", "refer-sscsmuser-0006"], + code: ["refcode", "refname", "name","deptname","orgname"]}], + isMultiSelectedEnabled: 1 + }, e)) + }; + var t = o(0).high.Refer + }, 635: function (e, r, o) { + e.exports = o(261) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCUnitGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCUnitGridRef/index.js new file mode 100644 index 0000000..d6ce9f2 --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCUnitGridRef/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("nc-lightapp-front")):"function"==typeof define&&define.amd?define(["nc-lightapp-front"],r):"object"==typeof exports?exports["ssccloud/refer/sscbd/SSCUnitGridRef/index"]=r(require("nc-lightapp-front")):e["ssccloud/refer/sscbd/SSCUnitGridRef/index"]=r(e["nc-lightapp-front"])}(window,function(e){return function(e){var r={};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=r,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},o.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="../../../../",o(o.s=635)}({0:function(r,o){r.exports=e},261:function(e,r,o){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return React.createElement(t,Object.assign({multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' +},refType:"grid",refName:"refer-sscunit-0001",placeholder:"refer-sscunit-0001",refCode:"ssccloud.refer.sscbd.SSCUnitGridRef",queryGridUrl:"/nccloud/ssctp/sscbd/SSCUnitGridRef.do",columnConfig:[{name:["refer-0001","refer-0002"],code:["refcode","refname"]}],isMultiSelectedEnabled:!1},e))};var t=o(0).high.Refer},635:function(e,r,o){e.exports=o(261)}})}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCWorkGroupGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCWorkGroupGridRef/index.js new file mode 100644 index 0000000..af34073 --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCWorkGroupGridRef/index.js @@ -0,0 +1,88 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function(e, t) { + "object" == typeof exports && "object" == typeof module ? module.exports = t(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], t) : "object" == typeof exports ? exports["ssctp/refer/sscbd/SSCWorkGroupGridRef/index"] = t(require("nc-lightapp-front")) : e["ssctp/refer/sscbd/SSCWorkGroupGridRef/index"] = t(e["nc-lightapp-front"]) +} (window, +function(e) { + return function(e) { + var t = {}; + function r(n) { + if (t[n]) return t[n].exports; + var o = t[n] = { + i: n, + l: !1, + exports: {} + }; + return e[n].call(o.exports, o, o.exports, r), + o.l = !0, + o.exports + } + return r.m = e, + r.c = t, + r.d = function(e, t, n) { + r.o(e, t) || Object.defineProperty(e, t, { + configurable: !1, + enumerable: !0, + get: n + }) + }, + r.r = function(e) { + Object.defineProperty(e, "__esModule", { + value: !0 + }) + }, + r.n = function(e) { + var t = e && e.__esModule ? + function() { + return e. + default + }: + function() { + return e + }; + return r.d(t, "a", t), + t + }, + r.o = function(e, t) { + return Object.prototype.hasOwnProperty.call(e, t) + }, + r.p = "../../../../", + r(r.s = 592) + } ({ + 0 : function(t, r) { + t.exports = e + }, + 592 : function(e, t, r) { + e.exports = r(78) + }, + 78 : function(e, t, r) { + "use strict"; + Object.defineProperty(t, "__esModule", { + value: !0 + }), + t. + default = function() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(n, Object.assign({ + rootNode: { + refname: "refer-sscworkgroup-0001", + refpk: "root" + }, + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "tree", + refName: "refer-sscworkgroup-0001", + refCode: "ssccloud.refer.sscbd.SSCWorkGroupGridRef", + placeholder: "refer-sscworkgroup-0001", + queryTreeUrl: "/nccloud/ssctp/sscbd/SSCWorkGroupGridRef.do", + isMultiSelectedEnabled: !1 + }, + e)) + }; + var n = r(0).high.Refer + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/refer/sscbd/SSCWorkGroupUserTreeGridRef/index.js b/src/ssctpaaa/refer/sscbd/SSCWorkGroupUserTreeGridRef/index.js new file mode 100644 index 0000000..effaa97 --- /dev/null +++ b/src/ssctpaaa/refer/sscbd/SSCWorkGroupUserTreeGridRef/index.js @@ -0,0 +1,56 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +!function (e, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r(require("nc-lightapp-front")) : "function" == typeof define && define.amd ? define(["nc-lightapp-front"], r) : "object" == typeof exports ? exports["ssccloud/refer/sscbd/SSCUnitGridRef/index"] = r(require("nc-lightapp-front")) : e["ssccloud/refer/sscbd/SSCUnitGridRef/index"] = r(e["nc-lightapp-front"]) +}(window, function (e) { + return function (e) { + var r = {}; + + function o(t) { + if (r[t]) return r[t].exports; + var n = r[t] = {i: t, l: !1, exports: {}}; + return e[t].call(n.exports, n, n.exports, o), n.l = !0, n.exports + } + + return o.m = e, o.c = r, o.d = function (e, r, t) { + o.o(e, r) || Object.defineProperty(e, r, {configurable: !1, enumerable: !0, get: t}) + }, o.r = function (e) { + Object.defineProperty(e, "__esModule", {value: !0}) + }, o.n = function (e) { + var r = e && e.__esModule ? function () { + return e.default + } : function () { + return e + }; + return o.d(r, "a", r), r + }, o.o = function (e, r) { + return Object.prototype.hasOwnProperty.call(e, r) + }, o.p = "../../../../", o(o.s = 635) + }({ + 0: function (r, o) { + r.exports = e + }, 261: function (e, r, o) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), r.default = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + return React.createElement(t, Object.assign({ + multiLang: { + moduleId: '7010', + domainName: 'ssctp', + currentLocale: 'simpchn' + }, + refType: "grid", + refName: 'refer-sscworkgroupuser-0001', + placeholder: 'refer-sscworkgroupuser-0001', + refCode: "ssctp.refer.sscbd.SSCUnitGridRef", + queryGridUrl: "/nccloud/sscbd/workinggroupuser/SSCWorkGroupUserGridRef.do", + columnConfig: [{name: ["refer-0001", "refer-0002"], code: ["refcode", "refname"]}], + isMultiSelectedEnabled: !1 + }, e)) + }; + var t = o(0).high.Refer + }, 635: function (e, r, o) { + e.exports = o(261) + } + }) +}); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/intelligentapprove/config/config.json b/src/ssctpaaa/report/intelligentapprove/config/config.json new file mode 100644 index 0000000..086d14b --- /dev/null +++ b/src/ssctpaaa/report/intelligentapprove/config/config.json @@ -0,0 +1 @@ +{"report":true} \ No newline at end of file diff --git a/src/ssctpaaa/report/intelligentapprove/config/events.js b/src/ssctpaaa/report/intelligentapprove/config/events.js new file mode 100644 index 0000000..e583b66 --- /dev/null +++ b/src/ssctpaaa/report/intelligentapprove/config/events.js @@ -0,0 +1,24 @@ +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ +import SscpfaBaseEvents from '../../../public/common/ssctpBaseEvents' +class Events extends SscpfaBaseEvents { + constructor(props) { + super(props) + } + + expandSearchVal (items) { + //目前添加了查询条件后台查询不到 + let obj = { + field: 'reporttype', + datatype: '204', + display: '报表类型', + isIncludeSub: false, + oprtype: '=', + value: {firstvalue: 'intelligentapprove',secondvalue:''} + } + items.conditions.push(obj) + return items + } + +} +export default Events; +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/intelligentapprove/config/index.js b/src/ssctpaaa/report/intelligentapprove/config/index.js new file mode 100644 index 0000000..f01b3ad --- /dev/null +++ b/src/ssctpaaa/report/intelligentapprove/config/index.js @@ -0,0 +1,47 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react' +import ReactDOM from 'react-dom' +import { SimpleReport } from 'nc-report' +import { createPage, getMultiLang } from 'nc-lightapp-front' +import Events from './events' + +export default class Test extends Component { + constructor(props) { + super(props) + this.state = { + json: {} + } + this.events = new Events(); + } + + componentWillMount() { + let callback = (json) => { + this.setState({ json }) + } + getMultiLang({ moduleId: 7010, currentLocale: 'zh-CN', domainName: 'ssctp', callback }) + } + + render() { + return ( +
+ +
+ ); + } +} + +Test = createPage({ + mutiLangCode: '7010' +})(Test) +ReactDOM.render(, document.getElementById('app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/intelligentapprovedetail/config/config.json b/src/ssctpaaa/report/intelligentapprovedetail/config/config.json new file mode 100644 index 0000000..086d14b --- /dev/null +++ b/src/ssctpaaa/report/intelligentapprovedetail/config/config.json @@ -0,0 +1 @@ +{"report":true} \ No newline at end of file diff --git a/src/ssctpaaa/report/intelligentapprovedetail/config/events.js b/src/ssctpaaa/report/intelligentapprovedetail/config/events.js new file mode 100644 index 0000000..655c688 --- /dev/null +++ b/src/ssctpaaa/report/intelligentapprovedetail/config/events.js @@ -0,0 +1,49 @@ +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ +import SscpfaBaseEvents from '../../../public/common/ssctpBaseEvents' +import requestApi from '../../../public/common/requestApi' +import { viewModel } from 'nc-lightapp-front'; +import sscOpenTo from 'ssccommon/utils/sscOpenTo'; +let { setGlobalStorage, getGlobalStorage, removeGlobalStorage } = viewModel; +class Events extends SscpfaBaseEvents { + constructor(props) { + super(props) + } + + expandSearchVal (items) { + //目前添加了查询条件后台查询不到 + let obj = { + field: 'reporttype', + datatype: '204', + display: '报表类型', + isIncludeSub: false, + oprtype: '=', + value: {firstvalue: 'intelligentapprovedetail',secondvalue:''} + } + items.conditions.push(obj) + return items + } + + setConnectionSearch(transSaveObject, obj, data, props, url, urlParams, sessonKey) { + let pkCode = urlParams.reportId; + //data.transSaveObject =''; + setGlobalStorage('sessionStorage', sessonKey, transSaveObject); //处理好的transSaveObject放到浏览器内存中,必须,跳转报表页面会用到 + requestApi.openBill({ + data: { + data, + pkCode + }, + success: (data) => { + sscOpenTo(props, data.data.system, [ + data.data.url, + { + ...data.data.data, + scene: "bzcx" + } + ]) + } + }) + } + +} +export default Events; +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/intelligentapprovedetail/config/index.js b/src/ssctpaaa/report/intelligentapprovedetail/config/index.js new file mode 100644 index 0000000..f01b3ad --- /dev/null +++ b/src/ssctpaaa/report/intelligentapprovedetail/config/index.js @@ -0,0 +1,47 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react' +import ReactDOM from 'react-dom' +import { SimpleReport } from 'nc-report' +import { createPage, getMultiLang } from 'nc-lightapp-front' +import Events from './events' + +export default class Test extends Component { + constructor(props) { + super(props) + this.state = { + json: {} + } + this.events = new Events(); + } + + componentWillMount() { + let callback = (json) => { + this.setState({ json }) + } + getMultiLang({ moduleId: 7010, currentLocale: 'zh-CN', domainName: 'ssctp', callback }) + } + + render() { + return ( +
+ +
+ ); + } +} + +Test = createPage({ + mutiLangCode: '7010' +})(Test) +ReactDOM.render(, document.getElementById('app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/problemmattermutidim/config/config.json b/src/ssctpaaa/report/problemmattermutidim/config/config.json new file mode 100644 index 0000000..086d14b --- /dev/null +++ b/src/ssctpaaa/report/problemmattermutidim/config/config.json @@ -0,0 +1 @@ +{"report":true} \ No newline at end of file diff --git a/src/ssctpaaa/report/problemmattermutidim/config/events.js b/src/ssctpaaa/report/problemmattermutidim/config/events.js new file mode 100644 index 0000000..afc9787 --- /dev/null +++ b/src/ssctpaaa/report/problemmattermutidim/config/events.js @@ -0,0 +1,22 @@ +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ +import SsctpProblemBaseEvents from '../../../public/common/ssctpProblemBaseEvents' +class Events extends SsctpProblemBaseEvents { + constructor(props) { + super(props) + } + expandSearchVal (items) { + //目前添加了查询条件后台查询不到 + let obj = { + field: 'reporttype', + datatype: '204', + display: '报表类型', + isIncludeSub: false, + oprtype: '=', + value: {firstvalue: 'problemmattermutidim',secondvalue:''} + } + items.conditions.push(obj) + return items + } +} +export default Events; +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/problemmattermutidim/config/index.js b/src/ssctpaaa/report/problemmattermutidim/config/index.js new file mode 100644 index 0000000..dcfe658 --- /dev/null +++ b/src/ssctpaaa/report/problemmattermutidim/config/index.js @@ -0,0 +1,50 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react' +import ReactDOM from 'react-dom' +import { SimpleReport } from 'nc-report' +import { createPage, getMultiLang } from 'nc-lightapp-front' +import Events from './events' +import LinkQuery from '../../../sscuser/widgets/linkquery/index' + +export default class Test extends Component { + constructor(props) { + super(props) + this.state = { + json: {} + } + this.linkQuery = new LinkQuery('701005SXDW', '701015SXDW_L'); + this.events = new Events(); + } + + componentWillMount() { + let callback = (json) => { + this.setState({ json }) + } + getMultiLang({ moduleId: 7010, currentLocale: 'zh-CN', domainName: 'ssctp', callback }) + } + + render() { + return ( +
+ + {this.linkQuery.createComponent()} +
+ ); + } +} + +Test = createPage({ + mutiLangCode: '7010' +})(Test) +ReactDOM.render(, document.getElementById('app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/problemmattersum/config/config.json b/src/ssctpaaa/report/problemmattersum/config/config.json new file mode 100644 index 0000000..086d14b --- /dev/null +++ b/src/ssctpaaa/report/problemmattersum/config/config.json @@ -0,0 +1 @@ +{"report":true} \ No newline at end of file diff --git a/src/ssctpaaa/report/problemmattersum/config/events.js b/src/ssctpaaa/report/problemmattersum/config/events.js new file mode 100644 index 0000000..fa1ceac --- /dev/null +++ b/src/ssctpaaa/report/problemmattersum/config/events.js @@ -0,0 +1,22 @@ +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ +import SsctpProblemBaseEvents from '../../../public/common/ssctpProblemBaseEvents' +class Events extends SsctpProblemBaseEvents { + constructor(props) { + super(props) + } + expandSearchVal (items) { + //目前添加了查询条件后台查询不到 + let obj = { + field: 'reporttype', + datatype: '204', + display: '报表类型', + isIncludeSub: false, + oprtype: '=', + value: {firstvalue: 'problemmattersum',secondvalue:''} + } + items.conditions.push(obj) + return items + } +} +export default Events; +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/problemmattersum/config/index.js b/src/ssctpaaa/report/problemmattersum/config/index.js new file mode 100644 index 0000000..e4b2b0e --- /dev/null +++ b/src/ssctpaaa/report/problemmattersum/config/index.js @@ -0,0 +1,51 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react' +import ReactDOM from 'react-dom' +import { SimpleReport } from 'nc-report' +import { createPage, getMultiLang } from 'nc-lightapp-front' +import Events from './events' + +import LinkQuery from '../../../sscuser/widgets/linkquery/index' + +export default class Test extends Component { + constructor(props) { + super(props) + this.state = { + json: {} + } + this.linkQuery = new LinkQuery('701005SXHZ', '701005SXHZ_L'); + this.events = new Events(); + } + + componentWillMount() { + let callback = (json) => { + this.setState({ json }) + } + getMultiLang({ moduleId: 7010, currentLocale: 'zh-CN', domainName: 'ssctp', callback }) + } + + render() { + return ( +
+ + {this.linkQuery.createComponent()} +
+ ); + } +} + +Test = createPage({ + mutiLangCode: '7010' +})(Test) +ReactDOM.render(, document.getElementById('app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/problemunitsum/config/config.json b/src/ssctpaaa/report/problemunitsum/config/config.json new file mode 100644 index 0000000..086d14b --- /dev/null +++ b/src/ssctpaaa/report/problemunitsum/config/config.json @@ -0,0 +1 @@ +{"report":true} \ No newline at end of file diff --git a/src/ssctpaaa/report/problemunitsum/config/events.js b/src/ssctpaaa/report/problemunitsum/config/events.js new file mode 100644 index 0000000..41e427c --- /dev/null +++ b/src/ssctpaaa/report/problemunitsum/config/events.js @@ -0,0 +1,22 @@ +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ +import SsctpProblemBaseEvents from '../../../public/common/ssctpProblemBaseEvents' +class Events extends SsctpProblemBaseEvents { + constructor(props) { + super(props) + } + expandSearchVal (items) { + //目前添加了查询条件后台查询不到 + let obj = { + field: 'reporttype', + datatype: '204', + display: '报表类型', + isIncludeSub: false, + oprtype: '=', + value: {firstvalue: 'problemunitsum',secondvalue:''} + } + items.conditions.push(obj) + return items + } +} +export default Events; +/*B5kwYj9wKUytnMx8WinCT9pzwe09WW8c2AJ6DsQzKpM=*/ \ No newline at end of file diff --git a/src/ssctpaaa/report/problemunitsum/config/index.js b/src/ssctpaaa/report/problemunitsum/config/index.js new file mode 100644 index 0000000..44ed807 --- /dev/null +++ b/src/ssctpaaa/report/problemunitsum/config/index.js @@ -0,0 +1,51 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react' +import ReactDOM from 'react-dom' +import { SimpleReport } from 'nc-report' +import { createPage, getMultiLang } from 'nc-lightapp-front' +import Events from './events' +import LinkQuery from '../../../sscuser/widgets/linkquery/index' + +export default class Test extends Component { + constructor(props) { + super(props) + this.state = { + json: {} + } + this.linkQuery = new LinkQuery('701005DWHZ', '701005DWHZ_L'); + this.events = new Events(); + + } + + componentWillMount() { + let callback = (json) => { + this.setState({ json }) + } + getMultiLang({ moduleId: 7010, currentLocale: 'zh-CN', domainName: 'ssctp', callback }) + } + + render() { + return ( +
+ + {this.linkQuery.createComponent()} +
+ ); + } +} + +Test = createPage({ + mutiLangCode: '7010' +})(Test) +ReactDOM.render(, document.getElementById('app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/onduty/list/index.js b/src/ssctpaaa/sscchargeman/onduty/list/index.js new file mode 100644 index 0000000..161353b --- /dev/null +++ b/src/ssctpaaa/sscchargeman/onduty/list/index.js @@ -0,0 +1,8 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React from 'react'; +import ReactDOM from 'react-dom'; +import Onduty from './onduty'; +ReactDOM.render( + , document.querySelector('#app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/onduty/list/initTemplate.js b/src/ssctpaaa/sscchargeman/onduty/list/initTemplate.js new file mode 100644 index 0000000..6785961 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/onduty/list/initTemplate.js @@ -0,0 +1,19 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import presetVar from "./presetVar"; +import {getData} from "./requestApi" + +export default function (props) { + props.createUIDom({}, async (data) => { + props.meta.setMeta(data.template); + let ref = await getData(); + if(ref && ref.data && ref.data.dutystate){ + props.table.setAllTableData(presetVar.listArea, ref.data.dutystate); + this.allData = ref.data.dutystate; + }else{ + props.table.setAllTableData(presetVar.listArea, {rows: []}); + this.allData = {rows: []}; + } + }); +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/onduty/list/onduty.js b/src/ssctpaaa/sscchargeman/onduty/list/onduty.js new file mode 100644 index 0000000..221e33c --- /dev/null +++ b/src/ssctpaaa/sscchargeman/onduty/list/onduty.js @@ -0,0 +1,131 @@ +/*7T/9OyY2hk5KxSbfjELOhoYPTGBVEXvJDS+MZSXPK4A=*/ +import { Component } from "react"; +import { createPage, base, toast } from "nc-lightapp-front"; +const { NCFormControl} = base; +import initTemplate from "./initTemplate"; +import presetVar from "./presetVar"; +import { + ProfileStyle, + ProfileHead, + ProfileBody, + HeadCenterCustom +} from 'ssccommon/components/profile'; +import {getData} from './requestApi.js' + +class Onduty extends Component { + constructor(props) { + super(props); + this.state={ + // 过滤条件 + searchValue: '' + } + // 过滤条件 + this.searchValue; + // 过滤正在执行(防抖) + this.doingSearchUser = false; + // 所有查询结果数据 + this.allData; + // 页面初始化 + initTemplate.call(this, props); + } + + searchClick(props, searchVal, type) { + let pageInfo = this.props.table.getTablePageInfo(presetVar.tableAreaId); + pageInfo.pageIndex = 1; + pageInfo.pageSize = 9999; + let searchInfo = props.search.getQueryInfo(presetVar.searchArea); + let data = { + querycondition: searchVal, + queryAreaCode: presetVar.searchArea,  //查询区编码 + oid: (searchInfo || {}).oid,  //查询模板id + querytype: 'tree', + pageInfo: pageInfo + }; + requestApi.query({ + data: data, + success: (data) => { + this.props.editTable.setTableData(presetVar.listArea, data.data[presetVar.listArea]); + } + }) + } + + searchUser(searchValue){ + this.setState({ searchValue }); + this.searchValue = searchValue; + if(this.doingSearchUser==false){ + // 0.5秒后执行 + setTimeout(() => { + let newData + // 过滤条件为空时全部显示 + if(this.searchValue==''){ + newData = this.allData.rows; + }else{ + newData = this.allData.rows.filter((one)=>{ + if(((one.values.user || {}).value || '').indexOf(this.searchValue)>-1){ + return one; + } + }); + } + this.props.table.setAllTableData(presetVar.listArea, {rows: newData}); + this.doingSearchUser = false; + }, 500); + this.doingSearchUser = true; + } + } + + refreshButtonEvent = async () => { + let multiLang = this.props.MutiInit.getIntl(7010); + if (this.state.searchValue) { + this.searchUser(this.state.searchValue) + toast({ title: multiLang && multiLang.get('701010DOOROAD-022'), duration: 5 }) + } else { + let ref = await getData(); + if(ref && ref.data && ref.data.dutystate){ + this.props.table.setAllTableData(presetVar.listArea, ref.data.dutystate); + this.allData = ref.data.dutystate; + }else{ + this.props.table.setAllTableData(presetVar.listArea, {rows: []}); + this.allData = {rows: []}; + } + toast({ title: multiLang && multiLang.get('701010DOOROAD-022'), duration: 5 }) + } + } + + render() { + const { createSimpleTable } = this.props.table; + let multiLang = this.props.MutiInit.getIntl(7010); + return ( + + + + {this.searchUser.call(this, ...params)}} + type="search" + /> + + + + {createSimpleTable(presetVar.listArea)} + + + + ); + } +} +Onduty = createPage({ + mutiLangCode: "7010" +})(Onduty); +export default Onduty; + +/*7T/9OyY2hk5KxSbfjELOhoYPTGBVEXvJDS+MZSXPK4A=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/onduty/list/presetVar.js b/src/ssctpaaa/sscchargeman/onduty/list/presetVar.js new file mode 100644 index 0000000..d7148f0 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/onduty/list/presetVar.js @@ -0,0 +1,9 @@ +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ +/**页面全局变量 */ +let presetVar = { + listArea: 'dutystate', + dataSource: 'onduty' +}; + +export default presetVar; +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/onduty/list/requestApi.js b/src/ssctpaaa/sscchargeman/onduty/list/requestApi.js new file mode 100644 index 0000000..b3571e5 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/onduty/list/requestApi.js @@ -0,0 +1,15 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { requestPromise } from 'ssccommon/utils/asyncFunctions.js'; + +/** + * @method 获取报告 + */ +async function getData(data) { + const result = await requestPromise({ + url: `/nccloud/ssctp/intellidispatch/QueryAllUserStateAction.do`, + data, + }); + return result +} +export {getData} +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/components/distributeUserList.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/components/distributeUserList.js new file mode 100644 index 0000000..d39775c --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/components/distributeUserList.js @@ -0,0 +1,100 @@ +/*yk4t7DP0e63Jty9nogg5PkG65NSwYppMKCMIv/pnhiA=*/ +import React, { Component } from 'react'; +import { connect } from 'react-redux'; +import { base, ajax } from 'nc-lightapp-front'; +const { NCCheckbox, NCModal, NCButton, NCTextArea, NCMessage } = base; +import { query } from '../events/index' + +import SSCWorkGroupUserTreeGridRef from '../../../../refer/sscbd/SSCWorkGroupUserTreeGridRef' + +class DistributeUserList extends Component { + constructor(props) { + super(); + this.selectedUser = {}; + this.reason = ''; + this.state = { + refname: null + } + } + + save = () => { + let multiLang = this.props.MutiInit.getIntl(7010); + if (this.selectedUser.refpk == null) { + NCMessage.create({ content: multiLang && multiLang.get('701001RWCL-0052'), color: 'warning', position: 'bottomRight' }); + return; + } + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageDistributeAction.do', + data: { + pks: this.props.data.pk_currenttask.value, + pk_user: this.selectedUser.refpk, + ts: this.props.data.ts.value, + type: this.props.distributeType, + reason: this.reason + }, + success: () => { + this.selectedUser = {}; + this.state.refname = {}; + this.reason = ''; + this.props.that.setState({ showModalDistribute: false }); + query.queryData.call(this.props.that); + } + }); + } + + cancel = () => { + this.selectedUser = {}; + this.state.refname = {}; + this.reason = ''; + this.props.that.setState({ showModalDistribute: false }); + } + + selectUser = (e) => { + this.setState({ refname: e }) + this.selectedUser = e; + } + + render() { + let { data } = this.props; + let multiLang = this.props.MutiInit.getIntl(7010); + return ( +
+ { this.cancel() }}> + + {multiLang && multiLang.get('701001RWCL-0054')} + + +
+
+ {SSCWorkGroupUserTreeGridRef({ + fieldid:'SSCWorkGroupUserTreeGridRef', + onChange: this.selectUser, + queryCondition: { + group: (data.pk_sscgroup || {}).value + }, + value: this.state.refname + })} +
+
+ { this.reason = val }} + /> +
+
+
+ + {multiLang && multiLang.get('7010-0001')} + {multiLang && multiLang.get('7010-0004')} + +
+
+ ) + } +} + +export default DistributeUserList; +/*yk4t7DP0e63Jty9nogg5PkG65NSwYppMKCMIv/pnhiA=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/components/operateNote.less b/src/ssctpaaa/sscchargeman/sscchargeman/list/components/operateNote.less new file mode 100644 index 0000000..1479299 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/components/operateNote.less @@ -0,0 +1,22 @@ +.query-operation { + .u-modal-body { + padding-left: 0!important; + padding-right: 0!important; + padding-top: 0 !important; + } + +} + +.query-operation { + .viewer-close { + position: absolute; + font-size: 16px; + font-weight: bold; + padding-left: 19px; + text-align: left; + top: 18px; + right: 15px; + cursor: pointer; + color: #000; + } +} \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/components/queryOperation.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/components/queryOperation.js new file mode 100644 index 0000000..37cc88e --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/components/queryOperation.js @@ -0,0 +1,53 @@ +/*u2xfwBt7KMw8X0oGTED+fZx457/y9/Ge4fJlPLz7YRU=*/ +import React, {Component} from 'react' +import {base} from 'nc-lightapp-front' +const {NCModal,NCButton} = base +import currentVar from '../presetVar'; +import './operateNote.less' + +class OperationNote extends Component { + constructor(props) { + super(props) + } + + close = () => { + this.props.close() + } + + render() { + + let {data, showModal, table} = this.props + const {createSimpleTable} = table + let multiLang = this.props.MutiInit.getIntl(7010); + return ( +
+ + + {/*"701001RWCL-0008": "操作记录"*/} + {multiLang && multiLang.get('701001RWCL-0008')} + {/*X*/} + + + {createSimpleTable( + currentVar.operationArea, + { + showIndex: true, + height: 200, + } + )} + + +
+ ) + } +} + +export default OperationNote +/*u2xfwBt7KMw8X0oGTED+fZx457/y9/Ge4fJlPLz7YRU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/events/fixedTemplet.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/fixedTemplet.js new file mode 100644 index 0000000..d831df2 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/fixedTemplet.js @@ -0,0 +1,413 @@ +/*QqOYif2dFZXT39A6hY82WQIEANXc0ECdakPiQJg68d0=*/ +import currentVar from '../presetVar'; +export default { + /* button:[ + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.ForceDistribute, + "title": "强制分配", + "area": currentVar.listbtnarea.notake, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.Urgent, + "title": "紧急", + "area": currentVar.listbtnarea.notake, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.NotUrgent, + "title": "不紧急", + "area": currentVar.listbtnarea.notake, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.Distribute, + "title": "分配", + "area": currentVar.listbtnarea.adjust, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.Fetchback, + "title": "取回", + "area": currentVar.listbtnarea.adjust, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.Giveback, + "title": "退回", + "area": currentVar.listbtnarea.adjust, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.Redistribute, + "title": "重新分配", + "area": currentVar.listbtnarea.taken, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.ForceFetchback, + "title": "强制取回", + "area": currentVar.listbtnarea.taken, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.QueryOperation, + "title": "操作记录", + "area": currentVar.listbtnarea.notake, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.QueryOperation2, + "title": "操作记录", + "area": currentVar.listbtnarea.adjust, + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": currentVar.listButtons.QueryOperation3, + "title": "操作记录", + "area": currentVar.listbtnarea.taken, + "children": [] + } + ] + + addModel:{ + moduletype: 'form', + items: [ + { + "itemtype": "label", + "label": "委托关系主键", + "maxlength": "20", + "disabled": true, + "attrcode": "pk_ssclientage" + }, + { + "itemtype": "label", + "label": "共享服务中心主键", + "maxlength": "20", + "disabled": true, + "attrcode": "pk_sscunit" + }, + { + "itemtype": "input", + "visible": true, + "label": "业务单元编码", + "maxlength": "20", + "disabled": true, + "attrcode": "pk_org.code" + }, + { + "itemtype": "refer", + "visible": true, + "label": "业务单元", + "maxlength": "20", + "refcode": "uapbd/refer/org/BusinessUnitTreeRef/index.js", + "required": true, + "attrcode": "pk_org" + }, + { + "itemtype": "input", + "visible": true, + "label": "所属集团", + "maxlength": "20", + "disabled": true, + "attrcode": "pk_org.pk_group.name" + }, + { + "itemtype": "checkbox", + "visible": true, + "label": "费用管理", + "maxlength": "1", + "attrcode": "busiunittype1", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "visible": true, + "label": "应收管理", + "maxlength": "1", + "attrcode": "busiunittype2", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "visible": false, + "label": "应付管理", + "maxlength": "1", + "attrcode": "busiunittype3", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + }, + }, + { + "itemtype": "checkbox", + "visible": false, + "label": "固定资产", + "maxlength": "1", + "attrcode": "busiunittype4", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "visible": false, + "label": "总账", + "maxlength": "1", + "attrcode": "busiunittype7", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "visible": false, + "label": "现金管理", + "maxlength": "1", + "attrcode": "busiunittype5", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "存货核算", + "maxlength": "1", + "attrcode": "busiunittype8", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "自由表单", + "maxlength": "1", + "attrcode": "busiunittype6", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "visible": true, + "label": "到账通知", + "maxlength": "1", + "attrcode": "busiunittype9", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "visible": true, + "label": "共享合同", + "maxlength": "1", + "attrcode": "busiunittype10", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类11", + "maxlength": "1", + "attrcode": "busiunittype11", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类12", + "maxlength": "1", + "attrcode": "busiunittype12", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类13", + "maxlength": "1", + "attrcode": "busiunittype13", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类14", + "maxlength": "1", + "attrcode": "busiunittype14", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类15", + "maxlength": "1", + "attrcode": "busiunittype15", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类16", + "maxlength": "1", + "attrcode": "busiunittype16", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类17", + "maxlength": "1", + "attrcode": "busiunittype17", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类18", + "maxlength": "1", + "attrcode": "busiunittype18", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类19", + "maxlength": "1", + "attrcode": "busiunittype19", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "业务分类20", + "maxlength": "1", + "attrcode": "busiunittype20", + "initialvalue": {//控件默认值 + "value": false, + "display": "" + } + }, + { + "itemtype": "checkbox", + "label": "启用状态", + "maxlength": "1", + "attrcode": "enablestate", + }, + { + "itemtype": "label", + "label": "创建人", + "maxlength": "20", + "disabled": true, + "attrcode": "creator" + }, + { + "itemtype": "label", + "label": "创建时间", + "maxlength": "19", + "disabled": true, + "attrcode": "creationtime" + }, + { + "itemtype": "label", + "label": "最后修改人", + "maxlength": "20", + "disabled": true, + "attrcode": "modifier" + }, + { + "itemtype": "label", + "label": "最后修改时间", + "maxlength": "19", + "disabled": true, + "attrcode": "modifiedtime" + }, + { + "itemtype": "label", + "label": "共享服务类型名称", + "maxlength": "200", + "disabled": true, + "attrcode": "ssctypename", + "initialvalue": {//控件默认值 + "value": "财务共享服务", + "display": "财务共享服务" + } + }, + { + "itemtype": "label", + "label": "时间戳", + "maxlength": "19", + "disabled": true, + "attrcode": "ts" + } + ], + status: 'edit', + }, + distributeUserModel:{ + moduletype: 'form', + items: [ + { + "itemtype": "label", + "label": "委托关系主键", + "maxlength": "20", + "disabled": true, + "attrcode": "pk_ssclientage" + } + ] + } */ +} +/*QqOYif2dFZXT39A6hY82WQIEANXc0ECdakPiQJg68d0=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/events/getListButton.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/getListButton.js new file mode 100644 index 0000000..7de7785 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/getListButton.js @@ -0,0 +1,78 @@ +/*ZthXDZFuIaSaPe8Fo2hTHo/JwPk6LQkPXzn4Vh1205I=*/ +import {listButtonClick} from './index' +import currentVar from '../presetVar'; + +let getListButtonRender = function(props, sagasButtonVisible){ + let btns = []; + let l_render; + let multiLang = props.MutiInit.getIntl(7010); + switch(this.queryKey.takestatus){ + case 'notake': + l_render = (text, record, index) =>{ + if(record.urgent != null && record.urgent.value == true){ + return props.button.createOprationButton([currentVar.listButtons.ForceDistribute, currentVar.listButtons.NotUrgent,currentVar.listButtons.QueryOperation], { + area: currentVar.listbtnarea.notake, + buttonLimit: 3, + onButtonClick: (props, btnKey) => { + listButtonClick.listButtonClick.call(this,btnKey, record, index); + } + }); + }else{ + return props.button.createOprationButton([currentVar.listButtons.ForceDistribute,currentVar.listButtons.Urgent,currentVar.listButtons.QueryOperation], { + area: currentVar.listbtnarea.notake, + buttonLimit: 3, + onButtonClick: (props, btnKey) => { + listButtonClick.listButtonClick.call(this, btnKey, record, index); + } + }); + } + } + break; + case 'adjust': + btns = [currentVar.listButtons.Distribute, currentVar.listButtons.Fetchback, currentVar.listButtons.Giveback,currentVar.listButtons.QueryOperation2]; + l_render = (text, record, index) =>{ + return props.button.createOprationButton(btns, { + area: currentVar.listbtnarea.adjust, + buttonLimit: 3, + onButtonClick: (props, btnKey) => { + listButtonClick.listButtonClick.call(this, btnKey, record, index); + } + }); + } + break; + case 'taken': + btns = [currentVar.listButtons.Redistribute, currentVar.listButtons.ForceFetchback,currentVar.listButtons.QueryOperation3]; + l_render = (text, record, index) =>{ + return props.button.createOprationButton(btns, { + area: currentVar.listbtnarea.taken, + buttonLimit: 3, + onButtonClick: (props, btnKey) => { + listButtonClick.listButtonClick.call(this, btnKey, record, index); + } + }); + } + break; + } + let event = { + label: multiLang && multiLang.get('701001RWCL-0060'), + itemtype: 'customer', + attrcode: 'opr', + visible: true, + width: '220px', + fixed: 'right', + className: "opr", + render: (text, record, index) => { + return sagasButtonVisible ? props.button.createErrorButton({ + record: record, + sucessCallBack: () => { + //状态切换成功后,显示业务 + return l_render(text, record, index ); + } + }) : l_render(text, record, index ); + + } + }; + return event; +} +export default {getListButtonRender} +/*ZthXDZFuIaSaPe8Fo2hTHo/JwPk6LQkPXzn4Vh1205I=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/events/index.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/index.js new file mode 100644 index 0000000..5d0e8b7 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/index.js @@ -0,0 +1,9 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import initTemplate from './initTemplate'; +import listButtonClick from './listButtonClick'; +import fixedTemplet from './fixedTemplet' +import query from './query' +import getListButton from './getListButton' +export {initTemplate, listButtonClick, query, fixedTemplet, getListButton}; + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/events/initTemPlate.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/initTemPlate.js new file mode 100644 index 0000000..a179080 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/initTemPlate.js @@ -0,0 +1,149 @@ +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ +import {getMultiLang, ajax} from 'nc-lightapp-front'; +import currentVar from '../presetVar'; +import {listButtonClick, fixedTemplet, getListButton, query} from './index'; +import { tableAndCardListScrollLoad } from 'ssccommon/utils/scrollLoad'; + +import exceedImg from '../../../../public/image/exceed.png'; +import preImg from '../../../../public/image/pre.png'; + +export default function (props) { + const that = this + props.createUIDom( + { + pagecode: '701002RWGL_list', + appcode: '701002RWGL' + }, + (data) => { + getMultiLang({moduleId: 7010, domainName: 'ssctp',currentLocale: 'zh-CN', callback: (json) => { + props.button.setButtons(data.button); + data.template[window.presetVar.list].pagination = false; + data.template[window.presetVar.list].items.push(getListButton.getListButtonRender.call(that, props, true)); + + let _idx = -1 + while(++_idx < data.template[window.presetVar.list].items.length) { + let item = data.template[window.presetVar.list].items[_idx] + if( item.attrcode=='pk_sscuser'){ + if(that.queryKey.takestatus=='notake'){ + item.visible=false; + } else { + item.visible=true; + } + } + } + + data.template[window.presetVar.list].items.map((item)=>{ + if(item.attrcode==='billno' + || item.attrcode==='pk_tradetype' + || item.attrcode==='pk_currtype' + || item.attrcode==='remark' + || item.attrcode==='amount' + || item.attrcode==='pk_sscuser' + || item.attrcode==='billdate' + || item.attrcode==='billmaker'){ + + item.isSort = true; + }else{ + + item.isSort = false; + } + }) + + props.meta.setMeta(data.template, () => { + //滚动加载 + tableAndCardListScrollLoad(() => { + if ( + Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number) + && this.canChangPageFlag + ) { + this.canChangPageFlag = false; + setTimeout(() => { query.queryData.call(this, true) }, 300); + } + }) + }) + + props.table.setTableRender(window.presetVar.list, "billno", (text, record, index)=>{ + let ret = [ + ( + { + listButtonClick.listButtonClick.call(that, currentVar.listButtons.OpenBill, record, index); + }}>{record.billno.value} + ) + ] + if(record.urgent && record.urgent.value == true) { + ret.push({json['701001RWCL-0056']})//紧急 + } + if(record.ismereject && record.ismereject.value == true){ + ret.push({json['701001RWCL-0057']})//本人驳回 + } + if(record.isleaderreject && record.isleaderreject.value == true){ + ret.push({json['701001RWCL-0058']})//上级驳回 + } + if(record.isappointed && record.isappointed.value == true) { + ret.push({json['701001RWCL-0055']})//强制分配 + } + if(record.isunapprove && record.isunapprove.value == true){ + ret.push( {json['701001RWCL-0169']})//取消审批 + } + if (record.iscmpreject && record.iscmpreject.value == true) { + ret.push( {json['701001RWCL-0203']})// 出纳驳回 + } + return ret + }) + + function setExceedstatusTableRender() { + props.table.setTableRender(window.presetVar.list, "exceedstatus", (text, record, index)=>{ + const {exceedstatus} = record + let txt = '', src = '' + if (exceedstatus) { // exceed:超期 + if(exceedstatus.value === 'exceed'){ + txt = `${JSON.parse(exceedstatus.display).hour}${json['7010-0009']}${JSON.parse(exceedstatus.display).minute}${json['7010-0010']}` + src = exceedImg + }else if(exceedstatus.value === 'pre'){ // pre:即将超期 + txt = `${JSON.parse(exceedstatus.display).hour}${json['7010-0009']}${JSON.parse(exceedstatus.display).minute}${json['7010-0010']}` + src = preImg + } + } + return (src && txt) ? + ([ + , + {txt} + ]) : null + }) + } + + // 待提取(notake)/待调整(adjust)/已提取(taken) + if (that.queryKey.takestatus === 'taken') { + //超时预警 + setExceedstatusTableRender() + props.table.showColByKey(window.presetVar.list, 'endtime') + props.table.showColByKey(window.presetVar.list, 'warningtime') + props.table.showColByKey(window.presetVar.list, 'exceedstatus') + } else if (that.queryKey.takestatus === 'notake') { + props.table.hideColByKey(window.presetVar.list, 'endtime') + props.table.hideColByKey(window.presetVar.list, 'warningtime') + props.table.hideColByKey(window.presetVar.list, 'exceedstatus') + } else if (that.queryKey.takestatus === 'adjust') { + props.table.hideColByKey(window.presetVar.list, 'endtime') + props.table.hideColByKey(window.presetVar.list, 'warningtime') + props.table.showColByKey(window.presetVar.list, 'exceedstatus') + //超时预警 + setExceedstatusTableRender() + } + + that.searchAreaConfig = { + searchadjust: data.template.searchadjust.items, + searchnotake: data.template.searchnotake.items, + searchtaken: data.template.searchtaken.items + } + + + + // 查询默认条件数据 + query.queryData.call(that); + }}) + } + ) +} + +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/events/listButtonClick.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/listButtonClick.js new file mode 100644 index 0000000..2aff4c4 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/listButtonClick.js @@ -0,0 +1,189 @@ +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ +import requestApi from '../requestApi' +import currentVar from '../presetVar' +import {query} from './index'; +import sscOpenTo from 'ssccommon/utils/sscOpenTo'; + +let listButtonClick = function(btnKey, data, index, actionFrom){ + switch(btnKey){ + // 打开单据 + case currentVar.listButtons.OpenBill: + openBill.call(this, data, index, actionFrom); + break; + // 分配 + case currentVar.listButtons.Distribute: + showDistributeUserList.call(this, data, index, actionFrom, currentVar.acctionFlags.Distribute); + break; + // 强制分配 + case currentVar.listButtons.ForceDistribute: + showDistributeUserList.call(this, data, index, actionFrom, currentVar.acctionFlags.ForceDistribute); + break; + // 重新分配 + case currentVar.listButtons.Redistribute: + showDistributeUserList.call(this, data, index, actionFrom, currentVar.acctionFlags.Redistribute); + break; + // 紧急 + case currentVar.listButtons.Urgent: + setUrgent.call(this, data, index, actionFrom, currentVar.acctionFlags.Urgent); + break; + // 不紧急 + case currentVar.listButtons.NotUrgent: + setUrgent.call(this, data, index, actionFrom, currentVar.acctionFlags.NotUrgent); + break; + // 取回 + case currentVar.listButtons.Fetchback: + takeBack.call(this, data, index, actionFrom, currentVar.acctionFlags.Fetchback); + break; + // 强制取回 + case currentVar.listButtons.ForceFetchback: + takeBack.call(this, data, index, actionFrom, currentVar.acctionFlags.ForceFetchback); + break; + // 收回 + case currentVar.listButtons.Giveback: + giveBack.call(this, data, index, actionFrom); + break; + // 操作记录 + case currentVar.listButtons.QueryOperation: + case currentVar.listButtons.QueryOperation2: + case currentVar.listButtons.QueryOperation3: + handleQueryOperation.call(this, data, index, actionFrom) + break; + + } +} + +let openBill = function(data, index, actionFrom){ + let listData = data; + if(actionFrom == "detail"){ + listData = this.data.listRows[index].values; + } + requestApi.openBill({ + data: { + billtypeCode: listData.billtypecode.value, + transtypeCode: listData.transtypecode.value, + billid: listData.busiid.value, + pk_group:listData.pk_group.value + }, + success: (data) => { + sscOpenTo(this.props, data.data.system,[ + data.data.url, + { + ...data.data.data, + scene: 'zycx' + },null, + { + pk_group: listData.pk_group.value + } + ]) + } + }) +} + +let setUrgent = function(data, index, actionFrom, urgent){ + let listData = data; + if(actionFrom == "detail"){ + listData = this.data.listRows[index].values; + } + requestApi.setUrgent({ + data: {pk_task: listData.pk_currenttask.value, urgent: urgent, ts: listData.ts.value}, + success: (data) => { + // window.open(data.data.url); + this.data.listRows[index].values.urgent = {value : urgent == 'Y' ? true : false}; + this.data.listRows[index].values.ts = {value : data.data.ts}; + // 设置列表数据 + this.props.table.setAllTableData(window.presetVar.list, { + areacode: window.presetVar.list, + rows: this.data.listRows + }); + // 更新缩略数据 + this.detailRef.refurbishDetail(); + } + }) +} + +let showDistributeUserList = function(data, index, actionFrom, type){ + let listData = data; + if(actionFrom == "detail"){ + listData = this.data.listRows[index].values; + } + //需要验证saga事务状态 + + if(listData.saga_status && listData.saga_status.value === "1") { + requestApi.checkSaga({ + data: { + pk_currenttask: listData.pk_currenttask.value + }, + success: (data) => { + this.setState({ + showModalDistribute: true, + operationData: listData, + distributeType: type + }); + } + }) + } else { + + this.setState({ + showModalDistribute: true, + operationData: listData, + distributeType: type + }); + } + +} + +let takeBack = function(data, index, actionFrom, type){ + let listData = data; + if(actionFrom == "detail"){ + listData = this.data.listRows[index].values; + } + requestApi.takeBack({ + data: { + pks: listData.pk_currenttask.value, + ts: listData.ts.value, + type: type + }, + success: (data) => { + query.queryData.call(this); + } + }) +} + +let giveBack = function(data, index, actionFrom){ + let listData = data; + if(actionFrom == "detail"){ + listData = this.data.listRows[index].values; + } + requestApi.giveBack({ + data: {pks: listData.pk_currenttask.value,ts: listData.ts.value}, + success: (data) => { + query.queryData.call(this); + } + }) +} + +const handleQueryOperation = function (data, index, actionFrom) { + let listData = data + if(actionFrom == "detail"){ + listData = this.data.listRows[index].values + } + this.setState({showOperationNote: true}) + requestApi.taskQueryOperationAction({ + data: { + busiid: listData.busiid.value + }, + success: (data) => { + if(data.success && data.data.ssctaskhistory) { + this.props.table.setAllTableData( + currentVar.operationArea, + data.data.ssctaskhistory + ) + } + } + }) +} + +export default {listButtonClick, openBill, setUrgent, takeBack, giveBack} + + +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/events/query.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/query.js new file mode 100644 index 0000000..2f3a32e --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/events/query.js @@ -0,0 +1,164 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from '../requestApi' +import currentVar from '../presetVar'; +import {initTemplate} from './index' + + +/**查询条件选择变更 */ +let handleConditionChange = function(attrcode, value){ + // 更新查询条件 + this.queryKey[attrcode]=value; + // 查询数据 + queryData.call(this); +} + +/**查询数据 */ +let queryData = function(isAddPage, afterSortCb){ + // 复制列表数据 + let copyData = function(data){ + let newData = {}; + newData.values = {}; + for(let child in data.values){ + newData.values[child] = { + display: data.values[child].display, + value: data.values[child].value, + scale: data.values[child].scale + } + } + return newData; + } + if(isAddPage){ + // 更新查询条件 + this.queryKey.pageinfo.number++; + }else{ + this.queryKey.pageinfo.number = 1; + } + requestApi.query({ + data: this.queryKey, + success: (data) => { + let listRows = []; + if(isAddPage){ + this.data.listRows.map((one)=>{ + listRows.push(copyData(one)); + }) + }else{ + this.detailRef.clearAllDetailData(); + } + data.data[window.presetVar.list].rows.map((one)=>{ + listRows.push(copyData(one)); + }) + this.data.listRows = listRows; + // 设置列表数据 + this.props.table.setAllTableData(window.presetVar.list, { + areacode: window.presetVar.list, + rows: listRows + }, false); + //列排序后回调函数 + afterSortCb && afterSortCb(); + // 设置缩略数据 + this.detailRef.addDetailData(data.data[window.presetVar.card], this.data.listRows); + let newState = {}; + newState = this.state + // 更新数量 + if(data.data.adjust != null){ + newState.showNumbers.adjust=data.data.adjust; + } + if(data.data.notake != null){ + newState.showNumbers.notake=data.data.notake; + } + // 更新查询条件区域 + let conditions = null + switch(this.queryKey.takestatus) { + case 'notake': + conditions = this.searchAreaConfig.searchnotake + break + case 'taken': + conditions = this.searchAreaConfig.searchtaken + break + case 'adjust': + conditions = this.searchAreaConfig.searchadjust + break + default: + conditions = this.searchAreaConfig.searchnotake + break + } + let idx = -1 + conditions.forEach((ele, index) => { + if (ele.attrcode === 'pk_tradetype') { + idx = index + } + }) + if (idx != -1) { + conditions[idx] = data.data.searchArea.items[0] + } + newState.searcharea.conditions = conditions + // 更新页信息 + this.queryKey.pageinfo = data.data[window.presetVar.list].pageinfo; + if(Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number)){ + newState.pageControll = 'notend'; + }else if(Number(this.queryKey.pageinfo.totalPages) == Number(this.queryKey.pageinfo.number)){ + newState.pageControll = 'end'; + }else{ + newState.pageControll = 'none'; + } + this.setState(newState, () => this.props.table.updateTableHeight()); + setTimeout(()=>{this.canChangPageFlag=true;},100); + } + }) +} + +/**模糊查询输入内容变化 */ +let onFuzzyChange = function(data){ + this.fuzzyKey = data; + let newQueryKey = {}; + let multiLang = this.props.MutiInit.getIntl(7010); + for(let child in this.queryKey){ + newQueryKey[child] = this.queryKey[child]; + } + newQueryKey.fuzzyQueryKey = data; + setTimeout((that, data)=>{ + if(data == that.fuzzyKey){ + requestApi.queryFuzzyKey({ + data: newQueryKey, + success: (data) => { + for(let childName in data.data){ + data.data[childName].value = data.data[childName].value+"="+that.fuzzyKey; + data.data[childName].key = data.data[childName].key+(multiLang && multiLang.get('701001RWCL-0061'))+that.fuzzyKey;//包含 + } + that.setState({fuzzyquerychild:data.data}); + } + }); + } + },500, this, data); +} +/**模糊查询选择 */ +let onFuzzySelected = function(data){ + this.setState({fuzzyquerychild:[]}) + // 更新查询条件 + this.queryKey.fuzzyQueryKey=data; + // 查询数据 + queryData.call(this); +} + +/**已完成/未完成 页签切换 */ +let selectTabChange = function(selectKey){ + switch(selectKey){ + case currentVar.tabArea.notake: + this.setState({twoColNums: 3, detailButtonArea: currentVar.listbtnarea.notake}); + break; + case currentVar.tabArea.adjust: + this.setState({twoColNums: 3, detailButtonArea: currentVar.listbtnarea.adjust}); + break; + case currentVar.tabArea.taken: + this.setState({twoColNums: 4, detailButtonArea: currentVar.listbtnarea.taken}); + break; + } + // 更新查询条件 + this.queryKey.takestatus=selectKey; + this.setState({currentKey: selectKey}) + // 初始化页面 + initTemplate.call(this, this.props) +} + +export default {handleConditionChange, queryData, onFuzzyChange, onFuzzySelected, selectTabChange} +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/index.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/index.js new file mode 100644 index 0000000..0b6014e --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react'; +import ReactDOM from 'react-dom'; +import SscChargemanList from './sscChargemanList'; +ReactDOM.render( + , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/index.less b/src/ssctpaaa/sscchargeman/sscchargeman/list/index.less new file mode 100644 index 0000000..c721dd6 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/index.less @@ -0,0 +1,114 @@ +#distributeUserList{ + .distributeuserlist-user{ + height: 50px; + width: 200px; + } +} +#sscChargemanList{ + // background: #fff; + .container { + height: 100%; + display: flex; + flex-direction: column; + } + .nc-bill-table-area { + flex: 1; + } + #WorkbenchDetail { + position: absolute; + width: 100%; + top: 0; + bottom: 0; + overflow: auto; + } + .title { + float: left; + line-height: 60px; + font-size: 18px; + margin-right:20px; + } + .header { + line-height: 60px; + } + + .content { + clear: both; + // background: #fff; + } + + .change-page{ + background-color: white; + text-align: center; + } + + .body-btn-area{ + cursor: pointer; + color: #007ACE; + } + .list-show{ + display: block; + position: relative; + height: 100%; + // border: 1px solid #E6E6E6; + } + .list-hide{ + display: none; + } + .billnoa{ + // text-decoration: underline; + cursor: pointer; + margin-right: 8px; + } + + .bill-status-tag { + padding: 0 3px; + text-align: center; + border-radius: 2px; + font-size: 12px; + display: inline-block; + margin-right: 4px; + } + //紧急 + .urgent-tag { + background: #FFEEE5; + border: 1px solid #FF893A; + color: #FF893A + } + //驳回类 + .ismereject-tag,.isleaderreject-tag,.iscmpreject-tag { + background: #FFEBEE; + border: 1px solid #F44336; + color: #F44336 + } + //强制分配 + .isappointed-tag { + background: #FFF8E1; + border: 1px solid #FF9800; + color: #FF9800 + } + //取消审批 + .isunapprove-tag { + background: #F0F2F4; + border: 1px solid #708091; + color: #708091 + } + .scroll-add-more { + text-align: center; + font-size: 13px; + color: #555; + line-height: 30px; + // background: #fff; + user-select: none; + } + + .u-table-fixed-right { + .opr { + .single-line-and-ellipsis { + text-overflow: initial; + } + } + } + .error-flag { + max-width: 28px !important; + } +} diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/presetVar.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/presetVar.js new file mode 100644 index 0000000..efe16c0 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/presetVar.js @@ -0,0 +1,84 @@ +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ +import 'ssccommon/components/globalPresetVar'; + +/**页面全局变量 */ +let currentVar = { + /**页面ID */ + pageId: 'tasklist', + /**列表区域ID */ + list: 'tasklist', + /**缩略区域ID */ + card: 'taskcard', + /**操作记录区域ID */ + operationArea: 'ssctaskhistory', + /**页签区域 */ + tabArea:{ + /**待提取 */ + notake: 'notake', + /**待分配 */ + adjust: 'adjust', + /**已提取 */ + taken: 'taken', + }, + /**列表按钮区域 */ + listbtnarea: { + /**待提取区域按钮 */ + notake: 'notakeButton', + /**待分配区域按钮 */ + adjust: 'adjustButton', + /**已提取区域按钮 */ + taken: 'takenButton', + }, + /**列表按钮 */ + listButtons: { + /**打开单据 */ + OpenBill: 'OpenBill', + /**分配 */ + Distribute: 'Distribute', + /**强制分配 */ + ForceDistribute: 'ForceDistribute', + /**重新分配 */ + Redistribute: 'Redistribute', + /**紧急 */ + Urgent: 'Urgent', + /**不紧急 */ + NotUrgent: 'NotUrgent', + /**取回 */ + Fetchback: 'Fetchback', + /**强制取回 */ + ForceFetchback: 'ForceFetchback', + /**收回 */ + Giveback: 'Giveback', + /** 操作记录*/ + QueryOperation: 'QueryOperation', + QueryOperation2: 'QueryOperation2', + QueryOperation3: 'QueryOperation3' + }, + acctionFlags: { + /**分配 */ + Distribute: 'distribute', + /**强制分配 */ + ForceDistribute: 'forcedistribute', + /**重新分配 */ + Redistribute: 'redistribute', + /**紧急 */ + Urgent: 'Y', + /**不紧急 */ + NotUrgent: 'N', + /**取回 */ + Fetchback: 'fetchback', + /**强制取回 */ + ForceFetchback: 'forcefetchback' + }, + /**页面展示形态 */ + showType: { + list: 'list', + card: 'card' + } +} +window.presetVar = { + ...window.presetVar, + ...currentVar +}; +export default currentVar +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/requestApi.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/requestApi.js new file mode 100644 index 0000000..48ef6c0 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/requestApi.js @@ -0,0 +1,83 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax } from 'nc-lightapp-front'; + +let requestDomain = ''; + +let requestApiOverwrite = { + //单据模板接口 + tpl: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskTemQryAction.do', + data: opt.data, + success: opt.success + }); + }, + // 查询接口 + query: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageQueryAction.do', + data: opt.data, + success: opt.success + }); + }, + // 查询接口 + queryFuzzyKey: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskBlurQueryAction.do', + data: opt.data, + success: opt.success + }); + }, + // 查看单据 + openBill: (opt) => { + ajax({ + url: '/nccloud/sscrp/rpbill/BrowseBillAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }); + }, + // 设值紧急状态 + setUrgent: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskUrgentAction.do', + data: opt.data, + success: opt.success + }); + }, + takeBack: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageFetchBackAction.do', + data: opt.data, + success: opt.success + }); + }, + giveBack: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageGiveBackAction.do', + data: opt.data, + success: opt.success + }); + }, + // 作业任务联查操作记录 + taskQueryOperationAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleQueryOperationAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + checkSaga: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCSagaCheckAction.do', + data: opt.data, + success: opt.success + }); + } +} + +export default requestApiOverwrite; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscchargeman/list/sscChargemanList.js b/src/ssctpaaa/sscchargeman/sscchargeman/list/sscChargemanList.js new file mode 100644 index 0000000..7d4c061 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscchargeman/list/sscChargemanList.js @@ -0,0 +1,374 @@ +/*5sNY6VU0CqGNTUet29elDpvqM1BXmM8/EUP3nAO1wDY=*/ +import React, {Component} from 'react'; +import {createPage, base, ajax, toast} from 'nc-lightapp-front'; +const {NCAffix, NCDiv} = base; +import {initTemplate, afterEvent, listButtonClick,query} from './events'; +import currentVar from './presetVar'; +import WorkbenchTab from 'ssccommon/components/workbench-tab' +import WorkbenchSearcharea from 'ssccommon/components/workbench-searcharea' +import WorkbenchDetail from 'ssccommon/components/workbench-detail' +import DistributeUserList from './components/distributeUserList' +import OperationNote from './components/queryOperation' + +import './index.less'; + +class SscChargemanList extends Component { + constructor(props) { + super(props); + this.state = { + twoColNums: 3, //搜索区域,搜索项布局控制 + showType: currentVar.showType.list, //展示形态: 列表、卡片 + showNumbers:{}, //tab标签上的数字 + searcharea:{ //搜索条件 + conditions:[] + }, + pageControll: 'none', //翻页状态 + fuzzyquerychild: [], //模糊搜索数据记录 + showModalDistribute: false, //分配人员弹窗控制 + operationData: {}, //分配人员数据 + distributeType: '', //分配人员类型 + detailButtonArea: currentVar.listbtnarea.notake, //待提取区域按钮 + defaultKey: 'notake', //tab默认选中页签 + currentKey: 'notake', //tab当前页签 + showOperationNote: false, //操作记录弹窗控制 + }; + // 查询条件 + this.queryKey={ + // 待提取(notake)/待调整(adjust)/已提取(taken) + takestatus: currentVar.tabArea.notake, + fuzzyQueryKey: [], + // 页信息 + pageinfo:{ + number: 1, + size: 30, + totalElements: 0, + totalPages: 0 + } + } + // 缓存查询结果数据 + this.data={ + listRows:[], + cardRows:[] + } + + // 延时控制标记 + // 翻页 + this.canChangPageFlag = true; + // 模糊查询 + this.fuzzyKey = ''; + + this.detailRef = {}; + + this.searchAreaConfig = {} + } + componentDidMount() { + } + componentWillMount() { + // debugger + const key = this.props.getUrlParam("process") ? this.props.getUrlParam("process").toLowerCase() : 'notake' + this.setState( + {defaultKey: key, currentKey: key}, + () => { + this.queryKey.takestatus = key + initTemplate.call(this, this.props) + } + ) + } + + // 列表/缩略切换 + showTypeClick(type){ + this.setState({showType: type}); + } + + // 去往优先级管理 + backToChargemanmanage = (key) => { + switch (key) { + case 'back': + this.props.linkTo( + '/ssctp/sscchargeman/sscprioritymanage/list/', + { + pagecode: '700106RWGLYXJ_List', + appcode: '701002RWGL' + } + ) + break + default: + break + } + } + + queryDataCallback = (data) => { + let copyData = function(data) { + let newData = {} + newData.values = {} + for(let child in data.values){ + newData.values[child] = { + display: data.values[child].display, + value: data.values[child].value, + scale: data.values[child].scale + } + } + return newData + } + + let listRows = [] + this.detailRef.clearAllDetailData() + + data[window.presetVar.list].rows.map((one)=>{ + listRows.push(copyData(one)) + }) + this.data.listRows = listRows + // 设置列表数据 + this.props.table.setAllTableData(window.presetVar.list, { + areacode: window.presetVar.list, + rows: listRows + }) + // 设置缩略数据 + this.detailRef.addDetailData(data[window.presetVar.card], this.data.listRows); + let newState = {} + newState = this.state + // 更新数量 + if(data.adjust != null){ + newState.showNumbers.adjust=data.adjust; + } + if(data.notake != null){ + newState.showNumbers.notake=data.notake; + } + // 更新查询条件区域 + let conditions = null + switch(this.queryKey.takestatus) { + case 'notake': + conditions = this.searchAreaConfig.searchnotake + break + case 'taken': + conditions = this.searchAreaConfig.searchtaken + break + case 'adjust': + conditions = this.searchAreaConfig.searchadjust + break + default: + conditions = this.searchAreaConfig.searchnotake + break + } + let idx = -1 + conditions.forEach((ele, index) => { + if (ele.attrcode === 'pk_tradetype') { + idx = index + } + }) + if (idx != -1) { + conditions[idx] = data.searchArea.items[0] + } + newState.searcharea.conditions = conditions + // 更新页信息 + this.queryKey.pageinfo = data[window.presetVar.list].pageinfo + if(Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number)){ + newState.pageControll = 'notend' + }else if(Number(this.queryKey.pageinfo.totalPages) == Number(this.queryKey.pageinfo.number)){ + newState.pageControll = 'end' + }else{ + newState.pageControll = 'none' + } + this.setState(newState, () => this.props.table.updateTableHeight()) + setTimeout(()=>{this.canChangPageFlag=true},100); + } + + // 处理排序后的模板变化 + handleTempletAfterSort (sortParam){ + let sortObj = {}; + sortParam.forEach(item => { + sortObj[item.field] = item; + }); + let meta = this.props.meta.getMeta() + meta[window.presetVar.list].items.forEach(item => { + //保存返回的column状态,没有则终止order状态 + if(sortObj[item.attrcode]){ + item.order = sortObj[item.attrcode].order; + item.orderNum = sortObj[item.attrcode].orderNum; + }else { + item.order = "flatscend"; + item.orderNum = ""; + } + }) + this.props.meta.setMeta(meta); + } + + render() { + const { table, socket } = this.props + const {createSimpleTable} = table + const tablePkName = "pk_task"; + + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + let isShow = (type) =>{ + if(this.state.showType == currentVar.showType.list && type == currentVar.showType.list){ + return 'list-show'; + }else if(this.state.showType == currentVar.showType.card && type == currentVar.showType.card){ + return 'list-show'; + }else{ + return 'list-hide'; + } + } + let addMoreOnOff = this.data.listRows.length > 0 && Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number) + let getDetailBtns = (data, index) =>{ + switch(this.queryKey.takestatus){ + case currentVar.tabArea.notake: + if(this.data.listRows[index].values.urgent != null && this.data.listRows[index].values.urgent.value == true){ + return [currentVar.listButtons.ForceDistribute, currentVar.listButtons.NotUrgent, currentVar.listButtons.QueryOperation]; + }else{ + return [currentVar.listButtons.ForceDistribute,currentVar.listButtons.Urgent, currentVar.listButtons.QueryOperation]; + } + case currentVar.tabArea.adjust: + return [currentVar.listButtons.Distribute, currentVar.listButtons.Fetchback, currentVar.listButtons.Giveback, currentVar.listButtons.QueryOperation2]; + case currentVar.tabArea.taken: + return [currentVar.listButtons.Redistribute, currentVar.listButtons.ForceFetchback, currentVar.listButtons.QueryOperation3]; + } + } + return ( +
+ { + socket.connectMesg({ + tableAreaCode: window.presetVar.list, + billpkname: "busiid",//需要传单据的主键,不然不能显示单据追溯 + billtypeFromList: "billtypecode", + billtype: "", + // 本地前端调试,请传ip和端口 + // 打包到测试环境之前 去掉 + // serverLocation: "172.16.86.11:8883" + }) + } + + + + + +
+ {/*
*/} + +
+ +
+
+ {/*
*/} + +
+ { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageQueryAction.do', + data: opt.data, + success: (data) => { + opt.success(data.data) + } + }) + }} + queryKey={this.queryKey} + queryDataCallback={this.queryDataCallback} + /> +
+ +
+
+ {/* 表格 */} + {createSimpleTable(window.presetVar.list, { + showIndex:true, + pkname: tablePkName, + sort:{ + mode:'single', + backSource:true, + sortFun:(sortParam)=> { + if(sortParam[0].order=='flatscend'){ + this.queryKey.orderByInfo = []; + }else { + this.queryKey.orderByInfo = sortParam; + } + query.queryData.call(this, false, () => { + this.handleTempletAfterSort(sortParam); + }); + } + }, + // otherAreaHeight: 84, + adaptionHeight: true, + })} + {/*
{multiLang && multiLang.get('701001RWCL-0062')}
{/*"701001RWCL-0062": "滑动加载更多"*/} +
+
+ {/* 卡片列表 */} + { this.detailRef = ref; }} + props={this.props} + doAction={listButtonClick.listButtonClick.bind(this)} + getBtns={(data, index)=>getDetailBtns(data, index)} + sagasButtonVisible={true} + /> + {/*
{multiLang && multiLang.get('701001RWCL-0062')}
*/} +
+
+ +
+ {/* 分配人员弹出框 */} + + {/* 操作记录弹出框 */} + { + this.setState({showOperationNote: false}) + this.props.table.setAllTableData(currentVar.operationArea, {rows: []}) + }} + /> +
+ ) + } +} +SscChargemanList = createPage({ + mutiLangCode: '7010' +})(SscChargemanList); +export default SscChargemanList; +/*5sNY6VU0CqGNTUet29elDpvqM1BXmM8/EUP3nAO1wDY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/components/distributeUserList.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/components/distributeUserList.js new file mode 100644 index 0000000..96d5d95 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/components/distributeUserList.js @@ -0,0 +1,99 @@ +/*yk4t7DP0e63Jty9nogg5PkG65NSwYppMKCMIv/pnhiA=*/ +import React, {Component} from 'react'; +import {base, ajax, toast} from 'nc-lightapp-front'; +const {NCCheckbox,NCModal,NCButton, NCTextArea} = base; +import {query} from '../events/index' + +import SSCWorkGroupUserTreeGridRef from '../../../../refer/sscbd/SSCWorkGroupUserTreeGridRef' + +class DistributeUserList extends Component { + constructor(props) { + super(); + this.selectedUser={}; + this.reason=''; + this.state = {refname: null} + } + + save = () =>{ + let multiLang = this.props.MutiInit.getIntl(7010); + if(this.selectedUser.refpk == null){ + toast({ + title: multiLang && multiLang.get('701001RWCL-0052'), + color: 'warning', + }) + return; + } + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageDistributeAction.do', + data: { + pks: this.props.data.pk_task.value, + pk_user: this.selectedUser.refpk, + ts: this.props.data.ts.value, + type: this.props.distributeType, + reason: this.reason + }, + success: ()=>{ + this.selectedUser={}; + this.reason=''; + this.props.that.setState({showModalDistribute: false}); + query.queryData.call(this.props.that); + } + }); + } + + cancel = () => { + this.selectedUser={}; + this.reason=''; + this.props.that.setState({showModalDistribute: false}); + } + + selectUser = (e) => { + this.setState({refname: e}) + this.selectedUser = e; + } + + render() { + let {data} = this.props; + let multiLang = this.props.that.props.MutiInit.getIntl(7010); + return ( +
+ + + {multiLang && multiLang.get('701001RWCL-0054')} + + +
+
+ {SSCWorkGroupUserTreeGridRef({ + fieldid:'SSCWorkGroupUserTreeGridRef', + onChange: this.selectUser, + queryCondition: { + group: (data.pk_sscgroup || {}).value + }, + value: this.state.refname + })} +
+
+ {this.reason=val}} + /> +
+
+
+ + {multiLang && multiLang.get('7010-0001')} + {multiLang && multiLang.get('7010-0004')} + +
+
+ ) + } +} + +export default DistributeUserList; +/*yk4t7DP0e63Jty9nogg5PkG65NSwYppMKCMIv/pnhiA=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/buttonClick.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/buttonClick.js new file mode 100644 index 0000000..b2c9609 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/buttonClick.js @@ -0,0 +1,43 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from '../requestApi' +import sscOpenTo from 'ssccommon/utils/sscOpenTo'; + + +export default function buttonClick(key, index) { + switch (key) { + case 'GoBack': + this.props.linkTo( + '/ssctp/sscchargeman/sscchargeman/list/', + { + pagecode: '701002RWGL_list', + appcode: '701002RWGL' + } + ) + break + case 'openBill': + const that = this + let listData = this.data.listRows[index].values + requestApi.openBill({ + data: { + billtypeCode: listData.billtypecode.value, + transtypeCode: listData.transtypecode.value, + billid: listData.busiid.value + }, + success: (data) => { + sscOpenTo(that.props, data.data.system, [ + data.data.url, + { + ...data.data.data + },null, + { + pk_group: listData.pk_group.value + } + ]) + } + }) + break + default: + break + } +} +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/fixedTemplate.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/fixedTemplate.js new file mode 100644 index 0000000..50a182e --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/fixedTemplate.js @@ -0,0 +1,32 @@ +/*7hOekIf8hUsv8p/Si0HVBtJo9qHX0rmchb8gnkywXYE=*/ +const buttons = [ + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "forcedistribute", + "title": "强制分配", + "area": "tasklist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "TopPlacement", + "title": "本级置顶", + "area": "tasklist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "sort", + "title": "优先级排序", + "area": "tasklist", + "children": [] + } +] + +export default { + buttons +} +/*7hOekIf8hUsv8p/Si0HVBtJo9qHX0rmchb8gnkywXYE=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/getListBtn.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/getListBtn.js new file mode 100644 index 0000000..d1fe431 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/getListBtn.js @@ -0,0 +1,92 @@ +/*qhVudgKW6ht1y9z2TuPcG5AIM+Or16J7zDlAFufMfx0=*/ +import {listButtonClick} from './index' + +export default function getListButtonRender(props){ + const that = this + const { + idx, + prioritys + } = this.state.showPriority + let multiLang = props.MutiInit.getIntl(7010) + return { + label: multiLang && multiLang.get('701001RWCL-0060'),//操作 + itemtype: 'customer', + attrcode: 'opr', + visible: true, + fixed: 'right', + width: '200px', + render: (text, record, index) =>{ + return ( +
+ { + [ + props.button.createOprationButton( + ['forcedistribute'], + { + area: window.presetVar.list, + itemtype: 'customer', + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ), + props.button.createOprationButton( + ['TopPlacement'], + { + area: window.presetVar.list, + itemtype: 'customer', + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ), + ( + { + listButtonClick(props, 'sort', text, record, index, that) + that.setState({sortRecord: record}) + }} + > + {/*"701001RWCL-0063": "优先级设置*/} + {multiLang && multiLang.get('701001RWCL-0063')} + {/* { + index == idx + && + ( +
+ { + prioritys.map(ele => ( + { + e = e || window.event + e.stopPropagation() + e.cancelBubble = true + listButtonClick(props, 'RankingUpdatePriority', text, record, index, that, ele.value) + }} + className={ + ele.display === record.priority.display + ? + 'active' + : + '' + } + >{ele.display} + )) + } +
+ ) + } */} +
+ ) + ] + } + +
+ ) + } + } +} +/*qhVudgKW6ht1y9z2TuPcG5AIM+Or16J7zDlAFufMfx0=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/index.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/index.js new file mode 100644 index 0000000..18badc9 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick' +import initTemplate from './initTemplate' +import listButtonClick from './listButtonClick' +export { buttonClick, initTemplate, listButtonClick} + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/initTemPlate.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/initTemPlate.js new file mode 100644 index 0000000..cbf8bfd --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/initTemPlate.js @@ -0,0 +1,76 @@ +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ +import requestApi from '../requestApi' +import getListButtonRender from './getListBtn' +import fixedTemplate from './fixedTemplate' +import {buttonClick} from './index' + +export default function (props) { + window.presetVar = { + ...window.presetVar, + list: 'tasklist' + } + + const _this = this + props.createUIDom( + { + pagecode: '700106RWGLYXJ_List', + appcode: '701002RWGL' + }, + function (data) { + for (let item of data.template.tasklist.items) { + item.isSort = false + } + + props.button.setButtons(data.button) + data.template[window.presetVar.list].pagination = false + data.template[window.presetVar.list].items.push( + getListButtonRender.call(_this, props) + ) + props.meta.setMeta(data.template) + + // 单据编码列自定义render + props.table.setTableRender(window.presetVar.list, "billno", (text, record, index)=>{ + return( + {record.billno.value} + ) + }) + // 查询作业组 + requestApi.qryManagePriority({ + data: {}, + success: (data) => { + if(!data.success) return + const grouplist = data.data.grouplist.map(ele => ( + { + attrcode: ele.value, + label: ele.display + } + )) + + _this.queryKey.pk_sscgroup = + _this.queryKey.pk_sscgroup + || + ( + grouplist.length > 0 + ? + grouplist[0].attrcode + : + '' + ) + + _this.setState({ + grouplist, + pk_sscgroup: _this.queryKey.pk_sscgroup + }) + + // 查询列表数据 + _this.queryData() + } + }) + } + ) +} + +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/listButtonClick.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/listButtonClick.js new file mode 100644 index 0000000..dffa542 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/events/listButtonClick.js @@ -0,0 +1,107 @@ +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ +import requestApi from '../requestApi' +import {initTemplate} from './index' +import {toast} from 'nc-lightapp-front' + +export default function listButtonClick(props, btnKey, text, record, index, that, priorityValue, ev,) { + let multiLang = props.MutiInit.getIntl(7010); + switch(btnKey){ + case 'forcedistribute': //强制分配 + let listData = record; + + that.setState({ + showModalDistribute: true, + operationData: listData, + distributeType: "forcedistribute" + }) + break + + case 'TopPlacement': // 本级置顶 + requestApi.rankingSetTop({ + data: { + pk_ssctask: record.pk_task.value + }, + success: (data) => { + if (data.success && data.data) { + initTemplate.call(that, that.props); + //置顶成功 + toast({ + title: multiLang && multiLang.get('701001RWCL-0064'), + }) + } else { + //置顶失败 + toast({ + title: multiLang && multiLang.get('701001RWCL-0065'), + color: 'warning', + }) + } + } + }) + break + case 'sort': + ev = ev || window.event + that.sortTips.current.style.left = ev.clientX + 'px' + that.sortTips.current.style.top = ev.clientY + 'px' + requestApi.queryPriority({ + data: { + pk_workinggroup: record.pk_sscgroup.value + }, + success: (data) => { + if (data.data && data.data.priority) { + const { + data: { + priority + } + } = data + that.setState({ + showPriority: { + idx: index, + prioritys: priority + } + }) + initTemplate.call(that, that.props) + } else { + toast({ + title: multiLang && multiLang.get('701001RWCL-0183'), + }) + } + } + }) + break + case 'RankingUpdatePriority': + requestApi.rankingUpdatePriority({ + data: { + pk_ssctask: record.pk_task.value, + pk_priority: priorityValue + }, + success: (success) => { + if (success) { + //修改成功 + toast({ + title: multiLang && multiLang.get('701001RWCL-0066') + }) + } else { + //修改失败 + toast({ + title: multiLang && multiLang.get('701001RWCL-0067'), + color: 'warning', + }) + } + that.setState({ + showPriority: { + idx: -1, + prioritys: [] + } + }) + initTemplate.call(that, that.props) + } + }) + break + default: + break + } +} + + + +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/index.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/index.js new file mode 100644 index 0000000..b760688 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/index.js @@ -0,0 +1,6 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react' +import ReactDOM from 'react-dom' +import SscUserList from './sscPriorityManage' +ReactDOM.render(, document.querySelector('#app')) +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/index.less b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/index.less new file mode 100644 index 0000000..9c6881e --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/index.less @@ -0,0 +1,211 @@ +#sscPriorityManage{ + .title { + float: left; + line-height: 60px; + font-size: 18px; + margin-right:20px; + } + .header { + line-height: 60px; + } + + .content { + clear: both; + background: #fff; + } + + .change-page{ + background-color: white; + text-align: center; + } + + .body-btn-area{ + cursor: pointer; + color: #007ACE; + } + .billnoa{ + cursor: pointer; + overflow: hidden; + text-decoration: none; + } + .workbench-tab{ + margin-top: 0; + } + .lightapp-component-simpleTable .single-line-and-ellipsis { + overflow: inherit !important; + } + .opration-wrapper { + padding-right: 0; + .row-edit-option { + margin-right: 12px; + } + } +} + +.update-priority-btn { + margin-left: 6px; + cursor: pointer; + user-select: none; +} + +.update-priority-separator { + margin-left: 6px; + color: #D9D9D9; + display: inline-block; + height: 13px; + overflow: hidden; +} + +.main-table { + position: relative; + + .row-edit-option, + .sort-btn { + color: #0084FF; + } + + .row-edit-option { + margin-right: 15px; + } + + .sort-btn { + cursor: pointer; + position: relative; + } +} + +#target-blank { + z-index: 998; + position: fixed; + left: 0; + top: 0; +} + +.rank-update-priority { + position: fixed; + top: 0; + // left: 37px; + min-width: 75px; + background: rgba(255,255,255,1); + box-shadow: 0px 3px 12px 0px rgba(74,81,93,0.25); + border-radius: 4px; + border: 1px solid rgba(219,222,229,1); + color: #011427; + padding: 8px 0; + z-index: 999; + + span { + height: 25px; + line-height: 25px; + text-indent: 9px; + transition: .2s; + text-indent: 10px; + display: block; + width: 100%; + cursor: pointer; + + &:hover { + background-color: #f4f6fc; + } + } + + .active { + color: red; + } +} + +.opr-actions { + position: relative; + display: flex; + align-items: center; + + i.status-action { + position: absolute; + display: block; + right: -7px; + top: 0; + height: 100%; + width: 3px; + background-color: #fff; + margin-right: 0 !important; + cursor: default!important; + box-sizing: content-box !important; + transition: .3s; + } + + i.active { + background-color: red; + } +} + +.fixed-priority { + position: fixed; + right: 3px; + top: 189px; + min-width: 30px; + background: rgba(255,255,255,1); + box-shadow: 0px 3px 12px 0px rgba(74,81,93,0.25); + border-radius: 3px; + border: 1px solid rgba(219,222,229,1); + color: #011427; + z-index: 997; + font-size: 13px; + + a { + height: 25px; + line-height: 25px; + text-indent: 9px; + transition: .2s; + text-indent: 10px; + width: 100%; + color: #333; + cursor: pointer; + transition: .5s; + display: none; + padding-right: 10px; + + &:hover { + background-color: #f4f6fc; + } + } + + .active { + color: red; + } + + .toggle-handle { + display: block; + width: 30px; + height: 30px; + border-radius: 3px; + text-align: center; + line-height: 30px; + } + + &:hover { + .toggle-handle { + display: none; + } + a { + display: block; + } + padding-right: 10px; + padding: 8px 0; + min-width: 65px; + } +} + +.replace-work-bench-tab { + height: 46px; + display: flex; + align-items: center; + background-color: #fff; + justify-content: flex-end; + margin-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + + button { + margin-right: 20px; + } +} \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/requestApi.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/requestApi.js new file mode 100644 index 0000000..32eed17 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/requestApi.js @@ -0,0 +1,84 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax } from 'nc-lightapp-front' + +let requestApiOverwrite = { + // 模板查询 + tpl: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManagePriorityTemAction.do', + data: opt.data, + success: opt.success + }) + }, + // 列表查询 + query: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManagePriorityQueryAction.do', + data: opt.data, + success: opt.success + }) + }, + // 模糊查询 + queryFuzzyKey: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskBlurQueryAction.do', + data: opt.data, + success: data => { + opt.success(data) + } + }) + }, + // 优先级查询 + queryPriority: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCPriorityQryForTaskManageAction.do', + data: opt.data, + success: data => { + opt.success(data) + } + }) + }, + // 任务列表优先级修改 + rankingUpdatePriority: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/RankingUpdatePriorityAction.do', + data: opt.data, + success: data => { + if (data.success) opt.success(data.data) + } + }) + }, + // 优先级置顶 + rankingSetTop: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/RankingSetTopAction.do', + data: opt.data, + success: data => { + opt.success(data) + } + }) + }, + // 查看单据 + openBill: (opt) => { + ajax({ + url: '/nccloud/sscrp/rpbill/BrowseBillAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业组查询 + qryManagePriority: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManagePriorityTemAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + } +} + +export default requestApiOverwrite +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/sscprioritymanage/list/sscPriorityManage.js b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/sscPriorityManage.js new file mode 100644 index 0000000..4b83a6f --- /dev/null +++ b/src/ssctpaaa/sscchargeman/sscprioritymanage/list/sscPriorityManage.js @@ -0,0 +1,349 @@ +/*fD+5N30vpAA14EiZW64VY7fC/UxEPbeGMVqPl92ljYU=*/ +import React, {Component} from 'react' +import {createPage, base} from 'nc-lightapp-front' +const {NCButton, NCAffix, NCDiv} = base +import {buttonClick, initTemplate, listButtonClick,} from './events' +import requestApi from './requestApi' +import './index.less' +import WorkbenchTab from 'ssccommon/components/workbench-tab' +import DistributeUserList from './components/distributeUserList' +import WorkbenchSearcharea from 'ssccommon/components/workbench-searcharea' + +class sscPriorityManage extends Component { + constructor(props) { + super(props) + this.state = { + showNumbers:{}, + searcharea:{ + conditions:[] + }, + pageControll: 'none', + fuzzyquerychild: [], + showPriority: { + idx: -1, + prioritys: [] + }, + showModalDistribute: false, + distributeType: '', + operationData: {}, + grouplist: [], + pk_sscgroup: '', + prioritysConfig: [], + currentpriorityName: '', + currentKey: '', + sortRecord: {}, + } + // 查询条件 + this.queryKey={ + pk_sscgroup: '', + pk_priority: '', + fuzzyQueryKey: [], + // 页信息 + pageinfo:{ + number: 1, + size: 999999, + totalElements: 0, + totalPages: 0 + } + } + // 缓存查询结果数据 + this.data={ + listRows:[] + } + // 延时控制标记 // 翻页 + this.canChangPageFlag = true + // 模糊查询 + this.fuzzyKey = '' + + this.sortTips = React.createRef(); + // 页面初始化 + initTemplate.call(this, props) + } + // 查询数据(参数:是否是翻页动作) + queryData(isAddPage = false){ + if(isAddPage){ + this.queryKey.pageinfo.number++ + }else{ + this.queryKey.pageinfo.number = 1 + } + requestApi.query({ + data: this.queryKey, + success: (data) => { + const {data: {tasklist}} = data + let listRows = [] + if(isAddPage){ + this.data.listRows.map((one)=>{ + listRows.push(this.copyData(one)) + }) + } + tasklist.rows.map((one)=>{ + listRows.push(this.copyData(one)) + }) + // listRows.sort((x, y) => x.values.ordernum.display - y.values.ordernum.display) + this.data.listRows = listRows + // 设置列表数据 + this.props.table.setAllTableData(window.presetVar.list, { + areacode: window.presetVar.list, + rows: listRows + }) + let newState = {} + newState = this.state + for (let attr in data.data) { + if (typeof data.data[attr] === 'number') { + newState.showNumbers[attr] = data.data[attr] + } + } + // 更新页信息 + this.queryKey.pageinfo = tasklist.pageinfo + if(this.queryKey.pageinfo.totalPages > this.queryKey.pageinfo.number){ + newState.pageControll = 'notend' + }else if(this.queryKey.pageinfo.totalPages == this.queryKey.pageinfo.number){ + newState.pageControll = 'end' + }else{ + newState.pageControll = 'none' + } + newState.searcharea = { + conditions: JSON.parse(data.data.searchArea).items + } + this.setState(newState) + setTimeout(()=>{this.canChangPageFlag=true;},100) + } + }) + } + // 复制列表数据 + copyData(data){ + let newData = {} + newData.values = {} + for(let child in data.values){ + newData.values[child] = { + display: data.values[child].display, + value: data.values[child].value, + scale: data.values[child].scale + } + } + return newData + } + // 已完成/未完成 页签切换 + selectTabChange(selectKey){ + this.queryKey.pk_sscgroup = selectKey + this.setState({currentKey: selectKey}) + initTemplate.call(this, this.props) + } + // 查询条件选择变更 + handleConditionChange(attrcode, value){ + // 更新查询条件 + this.queryKey[attrcode]=value + // 查询数据 + this.queryData() + } + // 模糊查询输入内容变化 + onFuzzyChange(data){ + this.fuzzyKey = data + let newQueryKey = {} + let multiLang = this.props.MutiInit.getIntl(7010) + for(let child in this.queryKey){ + newQueryKey[child] = this.queryKey[child] + } + newQueryKey.fuzzyQueryKey = data + const that = this + setTimeout((that, data)=>{ + if(data == that.fuzzyKey){ + requestApi.queryFuzzyKey({ + data: newQueryKey, + success: (data) => { + for(let childName in data.data){ + data.data[childName].value = data.data[childName].value+"="+that.fuzzyKey; + let aname = multiLang && multiLang.get('701001RWCL-0061')+that.fuzzyKey;//包含 + data.data[childName].key = data.data[childName].key+aname; //包含 + } + that.setState({fuzzyquerychild:data.data}) + } + }) + } + },500, this, data) + } + // 模糊查询选择 + onFuzzySelected(data){ + this.setState({fuzzyquerychild:[]}) + // 更新查询条件 + this.queryKey.fuzzyQueryKey = data + // 查询数据 + this.queryData() + } + hidePriority = (e) => { + e = e || window.event + e.stopPropagation() + e.cancelBubble = true + this.setState({ + showPriority: { + idx: -1, + prioritys: [] + } + }) + initTemplate.call(this, this.props) + } + setCurrentActivePrioritys = currentpriorityName => { + this.setState({currentpriorityName}) + } + + render() { + const {button, table} = this.props + const {createSimpleTable} = table + + const { showPriority: {idx, prioritys,}, prioritysConfig, currentpriorityName, sortRecord,} = this.state + + const targetBlankStyle = { + height: idx == -1 + ? + '0' + : + Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) + 'px', + width: Math.max(document.body.scrollWidth, document.documentElement.scrollWidth) + 'px' + } + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + return ( +
+ {/* + '701001RWCL-0027' 作业调度优先级管理 + */} + + + + +
+ +
+ { + this.state.grouplist.length > 0 + ? + ( + + ) + : + ( +
+ { + buttonClick.call(this, 'GoBack', -1) + }} + // "701001RWCL-0034": "返回任务列表" + >{multiLang && multiLang.get('701001RWCL-0034')} +
+ ) + } +
+
+ +
+ { + this.onFuzzyChange.call(this, data) + }} + onFuzzySelected={this.onFuzzySelected.bind(this)} + disabledTypeChange={true} + queryKey={this.queryKey} + /> +
+ +
+
+ {createSimpleTable(window.presetVar.list, { + showIndex:true + })} +
+
+ + {/* 点击关闭修改优先级下拉框 */} +
+ + {/* 优先级设置 */} +
-1 ? 'block' : 'none'}}> + { + prioritys.map(ele => ( + { + e = e || window.event + e.stopPropagation() + e.cancelBubble = true + listButtonClick(this.props, 'RankingUpdatePriority', null, sortRecord, -1, this, ele.value) + }} + className={ + ele.display === sortRecord.priority.display + ? + 'active' + : + '' + } + >{ele.display} + )) + } +
+ + {/* 分配人员弹出框 */} + + {/* 类型定位标 */} + {/* { + prioritysConfig.length > 0 + ? +
+ + + + { + prioritysConfig.map((ele, idx) => ( + { this.setCurrentActivePrioritys(ele.display) }} + >{ele.display} + )) + } +
+ : + null + } */} +
+
+ ) + } +} +sscPriorityManage = createPage({ + mutiLangCode: '7010' +})(sscPriorityManage) +export default sscPriorityManage +/*fD+5N30vpAA14EiZW64VY7fC/UxEPbeGMVqPl92ljYU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/jrcll/config.json b/src/ssctpaaa/sscchargeman/widgets/jrcll/config.json new file mode 100644 index 0000000..9efb30f --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/jrcll/config.json @@ -0,0 +1,4 @@ +{ + "template": "widget.html", + "hash": false +} \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/jrcll/index.js b/src/ssctpaaa/sscchargeman/widgets/jrcll/index.js new file mode 100644 index 0000000..4747ac7 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/jrcll/index.js @@ -0,0 +1,205 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from "react"; +import "./index.less"; +import echarts from "echarts"; +import { ajax, base, createPage, getMultiLang } from "nc-lightapp-front"; +import randomId from "../../../../sscrp/public/common/utils/GenNonDuplicateID"; + +const { NCSelect } = base; +const NCOption = NCSelect.NCOption; +let option = {}; +let myChart; +function initoption (that) { + option = { + color: ["#97D099"], + tooltip: { + trigger: "axis" + }, + grid: { + left: "15px", + right: "15px", + top: "25px", + bottom: "15px", + containLabel: true + }, + dataZoom: { + start: 0, + end: 100, + width: "12", + right: "15", + showDataShadow: false, + show: false, + yAxisIndex: [0] + }, + xAxis: { + type: "value", + minInterval : 1, + boundaryGap: [0, 0.01], + axisLine: { + lineStyle: { + color: '#888888' + } + }, + splitLine: { + lineStyle: { + color: '#888888' + } + }, + }, + yAxis: { + type: "category", + axisLabel: { + interval: 0 + }, + data: [], + axisLine: { + lineStyle: { + color: '#888888' + }, + splitLine: { + lineStyle: { + color: '#888888' + } + }, + } + }, + series: [ + { + type: "bar", + name: that.state.json["701001RWCL-0032"],//今日作业量 + data: [], + label: { + normal: { + show: true, + position: 'right', + color:'#555555' + } + }, + barMaxWidth: '20' + } + ] + } +}; + +function deal(groupid) { + myChart.clear(); + if (!groupid || "" == groupid) { + myChart.setOption(option, true) + return; + } + ajax({ + url: "/nccloud/ssctp/sscbd/SSCTaskManageBarChartAction.do", + sysAppcode: '701012JRCL', + data: { flag: "handled", groupid: groupid }, + loading: false, + success: res => { + if (res.data) { + if (res.data.x) { + option.yAxis.data = res.data.x; + } else { + option.yAxis.data = []; + } + if (res.data.y) { + option.series[0].data = res.data.y; + } else { + option.series[0].data = []; + } + let allsize = res.data.allsize; + let showsize = 10; + if (allsize > showsize) { + option.grid.right = "32px"; + option.dataZoom.show = true; + option.dataZoom.textStyle = false; + option.dataZoom.start = ((allsize - showsize) * 100) / allsize; + option.dataZoom.end = 100; + } else { + option.grid.right = "15px"; + option.dataZoom.show = false; + option.dataZoom.start = 0; + option.dataZoom.end = 100; + } + } + myChart.setOption(option, true) + } + }); +} + +class Test4 extends Component { + constructor(props) { + super(props); + this.state = { + activeKey: "", + groups: [], + json: {} + }; + this.echartsId = randomId(36) + } + componentWillMount() { + let callback = (json) => { + this.setState({json}) + } + getMultiLang({moduleId: 7010, currentLocale: 'zh-CN',domainName: 'ssctp',callback}) + } + componentDidMount() { + initoption(this) + myChart = echarts.init(document.getElementById(this.echartsId)); + ajax({ + url: "/nccloud/ssctp/sscbd/SSCTaskManageBarChartAction.do", + sysAppcode: '701012JRCL', + data: {}, + loading: false, + async: false, + success: res => { + if (res.data && res.data.groups && res.data.groups[0]) { + this.setState({ + groups: res.data.groups, + activeKey: res.data.groups[0].groupid + },()=>{ + deal(res.data.groups[0].groupid); + }); + }else{ + deal(""); + } + } + }); + } + selectTabChange(selectKey) { + this.setState({ activeKey: selectKey }); + deal(selectKey); + } + + render() { + return ( +
+
+ {/*"701001RWCL-0032": "今日作业量"*/} + {this.state.json["701001RWCL-0032"]} +
+
+ {this.state.activeKey ? ( + document.body} + > + {this.state.groups.map(one => ( + {one.groupname} + ))} + + ) : null} +
+
+
+ ); + } +} + +Test4 = createPage({ + // mutiLangCode: "7010" + +})(Test4); +export default Test4 +// ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/jrcll/index.less b/src/ssctpaaa/sscchargeman/widgets/jrcll/index.less new file mode 100644 index 0000000..60eeead --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/jrcll/index.less @@ -0,0 +1,23 @@ +@import '~widgetsless'; + +#test_jrcll{ + .jrcll { + width: 455px; + height: 332px; + top: -13px; + } + //.title{ + // //float: left; + // //padding: 10px 10px 0 10px; + // //font-size: 16px; + // font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, sans-serif; + // //color: #111111; + //} + #jrcll-select { + position: absolute; + left: 415px; + top: 10px; + width: 100px; + z-index: 999999; + } +} diff --git a/src/ssctpaaa/sscchargeman/widgets/ywgl/config.json b/src/ssctpaaa/sscchargeman/widgets/ywgl/config.json new file mode 100644 index 0000000..9efb30f --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/ywgl/config.json @@ -0,0 +1,4 @@ +{ + "template": "widget.html", + "hash": false +} \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/ywgl/index.js b/src/ssctpaaa/sscchargeman/widgets/ywgl/index.js new file mode 100644 index 0000000..4bed05b --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/ywgl/index.js @@ -0,0 +1,223 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react' +import './index.less' +import {ajax, base, createPage, getMultiLang} from 'nc-lightapp-front' + +const {NCSelect} = base +const NCOption = NCSelect.NCOption +import { + nccGetTheme, +} from 'ssccommon/utils/asyncFunctions.js'; + +import defaultIcon from '../../../public/image/ywicon4.png' +import youth from '../../../public/image/nccicon/youth-dd.svg' +import simple from '../../../public/image/nccicon/simple-dd.svg' +import industry from '../../../public/image/nccicon/industry-dd.svg' +import business from '../../../public/image/nccicon/business-dd.svg' + +function deal(groupid) { + if (!groupid || '' == groupid) { + document.getElementById('adjust').innerHTML = ("--"); + document.getElementById('notake').innerHTML = ("--"); + return; + } + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageYwglWidgetAction.do', + sysAppcode: '701002ZYGL', + data: {"groupid": groupid}, + loading: false, + success: (res) => { + document.getElementById('adjust').innerHTML = (res.data.adjust); + document.getElementById('notake').innerHTML = (res.data.notake); + } + }); +} + +class Test1 extends Component { + constructor(props) { + super(props); + this.state = { + activeKey: '', + groups: [], + json: {}, + backgroundImg: '', //主题背景图控制 + iconType: '', // 小部件风格 + } + } + + componentWillMount() { + let callback = (json) => { + this.setState({json}) + } + getMultiLang({moduleId: 7010, currentLocale: 'zh-CN', domainName: 'ssctp', callback}) + } + + componentDidMount() { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskManageYwglWidgetAction.do', + sysAppcode: '701002ZYGL', + data: {}, + loading: false, + async: false, + success: (res) => { + if (res.data && res.data.groups && res.data.groups[0]) { + this.setState({groups: res.data.groups, activeKey: res.data.groups[0].groupid}); + deal(res.data.groups[0].groupid); + } + } + }); + this.getTheme() + this.setNCCIcon() + } + + setNCCIcon = () => { + const iconType = localStorage.getItem('nccIcon') || window.top.nccIcon + this.setState({iconType}) + } + + // 获取主题 + getTheme = async () => { + const isBlackTheme = await nccGetTheme() === 'black'; + // 暗黑主题搜索输入框样式控制 + const backgroundImg = isBlackTheme + ? + "/nccloud/resources/ssctp/public/image/blacktheme1.png" + : + "/nccloud/resources/ssctp/public/image/tpbg1.png" + this.setState({backgroundImg}) + } + + selectTabChange(selectKey) { + this.setState({activeKey: selectKey}); + deal(selectKey); + } + + open = (event, para) => { + event.stopPropagation() + if (para) { + this.props.openTo( + '/ssctp/sscchargeman/sscchargeman/list/index.html', + { + pagecode: '701002RWGL_list', + appcode: '701002RWGL', + // "701001RWCL-0028": "作业调度" + name: this.state.json['701001RWCL-0028'], + process: para + } + ) + } else { + this.props.openTo( + '/ssctp/sscchargeman/sscchargeman/list/index.html', + { + pagecode: '701002RWGL_list', + appcode: '701002RWGL', + // "701001RWCL-0028": "作业调度" + name: this.state.json['701001RWCL-0028'] + } + ) + } + } + + render() { + const { + iconType, + } = this.state + + let iconSrc = defaultIcon, rwglIconStyle = {} + + if (iconType === 'youth') { // 青春 + iconSrc = youth + rwglIconStyle = { width: '48px', marginTop: '12px' } + } else if (iconType === 'simple') { // 简约 + iconSrc = simple + rwglIconStyle = { marginTop: '6px', width: '62px' } + } else if (iconType === 'industry') { // 工业 + iconSrc = industry + rwglIconStyle = { width: '52px', marginTop: '12px' } + } else if (iconType === 'business') { // 商务 + iconSrc = business + rwglIconStyle = { width: '52px', marginTop: '12px' } + } else { + rwglIconStyle = { width: '62px', marginTop: '4px' } + } + + return ( +
+
+
{ + this.open(e) + }}> + {/*"701001RWCL-0028": "作业调度"*/} + {this.state.json['701001RWCL-0028']} +
+
+ { + this.state.activeKey + ? + ( + document.body} + > + { + this.state.groups.map(one => ( + + {one.groupname} + + )) + } + + + ) + : + null + } +
+ +
{ + this.open(e, null) + }}> +
+ { + this.open(e) + }} + style={rwglIconStyle} + /> +
{ + this.open(e) + }}> + {/*"701001RWCL-0021": "待提取"*/} +
--
+
{this.state.json['701001RWCL-0021']}
+
+
{ + this.open(e, 'ADJUST') + }}> + {/*"701001RWCL-0014": "待调整"*/} +
--
+
{this.state.json['701001RWCL-0014']}
+
+
+
+
+
+ ); + } +} + +Test1 = createPage({ + // mutiLangCode: '7010' + +})(Test1) +export default Test1 +// ReactDOM.render(, document.querySelector('#app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/ywgl/index.less b/src/ssctpaaa/sscchargeman/widgets/ywgl/index.less new file mode 100644 index 0000000..63d05c8 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/ywgl/index.less @@ -0,0 +1,60 @@ +@import '~widgetsless'; + +#job-scheduling { + height: 175px; + .rwgl-con { + margin-top: 23px; + } + #rwgl-select { + position: absolute; + left: 230px; + top: 10px; + width: 100px; + } + #rwgl-icon { + margin: 0 46px 0 36px; + } + .manage { + margin-top: 3px; + width: 70px; + height: 78px; + float: left; + .content-one.title-one { + text-align: center; + } + .content-one { + font-size: 38px; + white-space: nowrap; + } + .word { + font-size: 14px; + color: #777777; + } + .notakeNum { + width: 40px; + text-align: center; + //padding-left: 10px; + color: #111111; + margin-bottom: 10px; + } + .adjustNum { + width: 40px; + text-align: center; + //padding-left: 10px; + color: #111111; + margin-bottom: 10px; + } + &:hover div { + color: #0073E1; + } + } +} + +// 清除浮动 +.clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/zsrwl/config.json b/src/ssctpaaa/sscchargeman/widgets/zsrwl/config.json new file mode 100644 index 0000000..9efb30f --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/zsrwl/config.json @@ -0,0 +1,4 @@ +{ + "template": "widget.html", + "hash": false +} \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/zsrwl/index.js b/src/ssctpaaa/sscchargeman/widgets/zsrwl/index.js new file mode 100644 index 0000000..c34ac67 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/zsrwl/index.js @@ -0,0 +1,198 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from "react"; +import "./index.less"; +import echarts from "echarts"; +import { ajax, base, createPage, getMultiLang } from "nc-lightapp-front"; +import randomId from "../../../../sscrp/public/common/utils/GenNonDuplicateID"; + +const { NCSelect } = base; +const NCOption = NCSelect.NCOption; +let option = {} +let myChart; +function initoption (that) { + option = { + color: ["#5CA2FF"], + tooltip: { + trigger: "axis" + }, + grid: { + left: "15px", + right: "15px", + top: "25px", + bottom: "15px", + containLabel: true + }, + dataZoom: { + start: 0, + end: 100, + bottom: "12", + height: "12", + showDataShadow: false, + show: false + }, + xAxis: { + type: "category", + axisLabel: { + interval: 0 + }, + data: [], + axisLine: { + lineStyle: { + color: '#888888' + } + }, + splitLine: { + lineStyle: { + color: '#888888' + } + }, + }, + yAxis: { + type: "value", + minInterval : 1, + boundaryGap: [0, 0.01], + axisLine: { + lineStyle: { + color: '#888888' + } + }, + splitLine: { + lineStyle: { + color: '#888888' + } + }, + }, + series: [ + { + data: [], + name: that.state.json["701001RWCL-0033"],//在手作业量 + type: "bar", + barMaxWidth: '20' + } + ] + } +}; + +function deal(groupid) { + // let myChart = echarts.init(document.getElementById("test1")); + myChart.clear() + + if (!groupid || "" == groupid) { + myChart.setOption(option, true) + return; + } + ajax({ + url: "/nccloud/ssctp/sscbd/SSCTaskManageBarChartAction.do", + sysAppcode: '701012RWZS', + data: { flag: "onhand", groupid: groupid }, + loading: false, + success: res => { + if (res.data) { + if (res.data.x) { + option.xAxis.data = res.data.x; + } else { + option.xAxis.data = []; + } + if (res.data.y) { + option.series[0].data = res.data.y; + } else { + option.series[0].data = []; + } + let allsize = res.data.allsize; + let showsize = 5; + if (allsize > showsize) { + option.grid.bottom = "27px"; + option.dataZoom.show = true; + option.dataZoom.textStyle = false; + option.dataZoom.start = 0; + option.dataZoom.end = (showsize * 100) / allsize; + } else { + option.grid.bottom = "15px"; + option.dataZoom.show = false; + option.dataZoom.start = 0; + option.dataZoom.end = 100; + } + } + myChart.setOption(option, true) + } + }); +} + +class Test3 extends Component { + constructor(props) { + super(props); + this.state = { + activeKey: "", + groups: [], + json: {} + }; + this.echartsId = randomId(36) + } + componentWillMount() { + let callback = (json) => { + this.setState({json}) + } + getMultiLang({moduleId: 7010, currentLocale: 'zh-CN',domainName: 'ssctp',callback}) + } + + componentDidMount() { + initoption(this) + myChart = echarts.init(document.getElementById(this.echartsId)); + ajax({ + url: "/nccloud/ssctp/sscbd/SSCTaskManageBarChartAction.do", + sysAppcode: '701012RWZS', + data: {}, + loading: false, + success: res => { + if (res.data && res.data.groups && res.data.groups[0]) { + this.setState({ + groups: res.data.groups, + activeKey: res.data.groups[0].groupid + },()=>{ + deal(res.data.groups[0].groupid); + }); + }else{ + deal(""); + } + } + }); + } + selectTabChange(selectKey) { + this.setState({ activeKey: selectKey }); + deal(selectKey); + } + render() { + return ( +
+
+ {/*"701001RWCL-0033": "在手作业量"*/} + {this.state.json["701001RWCL-0033"]} +
+
+ {this.state.activeKey ? ( + document.body} + > + {this.state.groups.map(one => ( + {one.groupname} + ))} + + ) : null} +
+
+
+ ); + } +} + +Test3 = createPage({ + // mutiLangCode: "7010" + +})(Test3); +export default Test3 +// ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscchargeman/widgets/zsrwl/index.less b/src/ssctpaaa/sscchargeman/widgets/zsrwl/index.less new file mode 100644 index 0000000..05fda12 --- /dev/null +++ b/src/ssctpaaa/sscchargeman/widgets/zsrwl/index.less @@ -0,0 +1,23 @@ +@import '~widgetsless'; + +#test_zsrwl{ + .canvas { + width: 546px!important; + height: 332px; + top: -13px; + } + //.title{ + // //float: left; + // //padding: 10px 10px 0 10px; + // //font-size: 16px; + // font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, sans-serif; + // //color: #111111; + //} + #zsrwl-select { + position: absolute; + left: 415px; + top: 10px; + width: 100px; + z-index: 999999; + } +} diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/events/index.js b/src/ssctpaaa/sscsearch/sscsearch/list/events/index.js new file mode 100644 index 0000000..d6c806f --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/events/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import initTemplate from "./initTemplate"; +import listButtonClick from "./listButtonClick"; +import query from "./query"; +export { initTemplate, listButtonClick, query }; + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/events/initTemplate.js b/src/ssctpaaa/sscsearch/sscsearch/list/events/initTemplate.js new file mode 100644 index 0000000..6aedba4 --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/events/initTemplate.js @@ -0,0 +1,107 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import presetVar from "../presetVar"; +import { listButtonClick } from "./index"; +import { getMultiLang } from 'nc-lightapp-front'; +import exceedImg from '../../../../public/image/exceed.png'; +import preImg from '../../../../public/image/pre.png'; +import { query } from "./index.js"; +import { tableAndCardListScrollLoad } from 'ssccommon/utils/scrollLoad'; + + +export default function (props) { + const that = this; + props.createUIDom({}, function (data) { + getMultiLang({ + moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: (json) => { + let meta = data.template; + // 设置查询条件oid + that.queryKey.oid = meta[presetVar.searchArea].oid; + + meta[presetVar.searchArea].items.map(one => { + if (one.attrcode == "pk_tradetype") { + one.fieldValued = 'refcode'; + } + if (one.attrcode == "pk_org") { + one.isRunWithChildren = false; + one.isShowDisabledData = true; + } + dealRefShow(one); + }); + + props.meta.setMeta(meta, () => { + //滚动加载数据方法 + tableAndCardListScrollLoad(() => { + if ( + Number(that.queryKey.pageinfo.totalPages) > Number(that.queryKey.pageinfo.number) + && that.canChangPageFlag + ) { + that.canChangPageFlag = false; + setTimeout(() => { + query.queryData.call(that, true); + }, 300); + } + }) + }); + + //参照编辑前事件注册 + meta.searchArea.items.find((item) => item.attrcode === "pk_org").queryCondition = function () { + let orgRefBuilder = 'nccloud.web.ssctp.report.sqlbuilder.OrgRefBuilder'; + let data = props.search.getSearchValByField('searchArea', 'pk_sscunit').value.firstvalue; + return { pk_sscunit: data, isMutiGroup: 'Y', TreeRefActionExt: orgRefBuilder }; + }; + + props.table.setTableRender( + presetVar.list, + "billno", + (text, record, index) => { + let ret = [ + { + listButtonClick.call(that, "OpenBill", record, index); + }} + > + {record.billno.value} + + ]; + if (record.iscmpreject && record.iscmpreject.value == 'Y') { + ret.push( {json['701001RWCL-0203']})// 出纳驳回 + } + return ret; + } + ); + + //超时预警 + props.table.setTableRender(presetVar.list, "exceedstatus", (text, record, index) => { + const { exceedstatus } = record + let txt = '', src = '' + if (exceedstatus) { // exceed:超期 + if (exceedstatus.value === 'exceed') { + txt = `${JSON.parse(exceedstatus.display).hour}${json['7010-0009']}${JSON.parse(exceedstatus.display).minute}${json['7010-0010']}` + src = exceedImg + } else if (exceedstatus.value === 'pre') { // pre:即将超期 + txt = `${JSON.parse(exceedstatus.display).hour}${json['7010-0009']}${JSON.parse(exceedstatus.display).minute}${json['7010-0010']}` + src = preImg + } + } + return ([ + , + {txt} + ]) + }) + + } + }) + }); + const dealRefShow = function (data) { + if (data.itemtype == "refer") { + if (data.fieldDisplayed == "code") { + data.fieldDisplayed = "refcode"; + } else if (data.fieldDisplayed == "name") { + data.fieldDisplayed = "refname"; + } + } + }; +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/events/listButtonClick.js b/src/ssctpaaa/sscsearch/sscsearch/list/events/listButtonClick.js new file mode 100644 index 0000000..6ef5397 --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/events/listButtonClick.js @@ -0,0 +1,37 @@ +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ +import requestApi from "../requestApi"; +import sscOpenTo from 'ssccommon/utils/sscOpenTo'; +export default function listButtonClick(actionId, data, index, actionFrom) { + // console.log('listButtonClick:' + actionId); + let listData = data; + if (actionFrom == "detail") { + listData = this.data.listRows[index].values; + } + switch (actionId) { + case "OpenBill": + requestApi.openBill({ + data: { + billtypeCode: listData.billtypecode.value, + transtypeCode: listData.transtypecode.value, + billid: listData.busiid.value, + pk_group: listData.pk_group.value + }, + success: data => { + sscOpenTo(this.props, data.data.system, [ + data.data.url, { + ...data.data.data, + scene: "bzcx" + },null, + { + pk_group: listData.pk_group.value + } + ]) + } + }); + break; + default: + break; + } +} + +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/events/query.js b/src/ssctpaaa/sscsearch/sscsearch/list/events/query.js new file mode 100644 index 0000000..83de3fb --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/events/query.js @@ -0,0 +1,60 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from "../requestApi"; +import presetVar from "../presetVar"; + +let queryData = function(isAddPage) { + if (isAddPage) { + // 更新查询条件 + this.queryKey.pageinfo.number++; + } else { + this.queryKey.pageinfo.number = 1; + } + this.queryKey.pageStatus = this.state.pageStatus; + if (this.queryKey.querycondition == false) { + return; + } + requestApi.query({ + data: this.queryKey, + success: data => { + let listRows = []; + if (isAddPage) { + this.data.listRows.map(one => { + listRows.push(this.copyData(one)); + }); + } else { + this.refs.detail.clearAllDetailData(); + this.pubMessage.querySuccess((((data.data || {})[presetVar.list] || {}).pageinfo || {}).totalElements); + } + data.data[presetVar.list].rows.map(one => { + listRows.push(this.copyData(one)); + }); + this.data.listRows = listRows; + this.props.table.setAllTableData(presetVar.list, { + areacode: presetVar.list, + rows: listRows + }); + // 设置缩略数据 + this.refs.detail.addDetailData(data.data[presetVar.card]); + let newState = {}; + newState = this.state; + // 更新页信息 + this.queryKey.pageinfo = data.data[presetVar.list].pageinfo; + if (Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number)) { + newState.pageControll = "notend"; + } else if ( + Number(this.queryKey.pageinfo.totalPages) == Number(this.queryKey.pageinfo.number) + ) { + newState.pageControll = "end"; + } else { + newState.pageControll = "none"; + } + this.setState(newState); + setTimeout(() => { + this.canChangPageFlag = true; + }, 100); + } + }); +}; +export default { queryData }; + +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/index.js b/src/ssctpaaa/sscsearch/sscsearch/list/index.js new file mode 100644 index 0000000..bede893 --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from "react"; +import ReactDOM from "react-dom"; +import SscSearch from "./sscSearch"; +ReactDOM.render(, document.querySelector("#app")); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/index.less b/src/ssctpaaa/sscsearch/sscsearch/list/index.less new file mode 100644 index 0000000..67d7023 --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/index.less @@ -0,0 +1,282 @@ +#ssctasklist { + display: flex; + flex-direction: column; + .nc-singleTable-table-area { + flex: 1; + .show { + height: 100%; + } + } + .title { + float: left; + font-size: 18px; + margin-right: 20px; + font-weight: bold; + } + .header { + line-height: 60px; + } + + .content { + clear: both; + background: #fff; + position: relative; + } + + .change-page { + background-color: white; + text-align: center; + } + + .body-btn-area { + cursor: pointer; + color: #007ace; + } + .show { + display: block; + border-radius: 3px; + position: relative; + } + .hide { + display: none; + } + .billnoa { + cursor: pointer; + } + + .cashier-reject-tip { + font-size: 12px; + color: rgba(255,255,255,1); + background-color: #E14C46; + border-radius: 2px; + margin-left: 3px; + padding: 0 2px; + height: 16px; + line-height: 16px; + } + + .create-search { + .lightapp-component-search { + .search-component-rowArea { + padding: 0 !important; + } + } + + .search-component-btnDiv span { + cursor: pointer; + } + + } + + .business-transfer--create-search { + border-bottom: none; + } + + .title-block { + padding: 0 20px; + background: #f6f6f6; + height: 46px; + border-bottom: 1px solid #d0d0d0; + font-size: 19px; + color: #111111; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + h3 { + display: inline-block; + margin: 0; + font-size: 16px; + color: #111; + height: 54px; + line-height: 54px; + } + + span.testEnvBtnWrap { + float: right; + margin-right: 16px; + } + + i.uf { + font-weight: bold; + font-size: 18px; + margin-right: 10px; + cursor: pointer; + line-height: 54px; + } + + button { + margin-top: 13px; + float: right; + margin-right: -3px; + } + + span.title { + font-size: 16px; + color: #111; + height: 46px; + line-height: 46px; + } + + .u-form-control-wrapper { + width: 200px; + min-width: 200px; + margin-top: 8px; + } + + .menu-type-icon { + float: right; + margin-top: 12px; + } + } + + .clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + + .controler-box { + height: 40px; + + .content { + background-color: #f3f3f3; + height: 100%; + } + } + + .controler-box-fixed { + display: flex; + align-items: center; + height: 40px; + position: fixed; + left: 0; + bottom: 0; + padding-left: 30px; + padding-right: 26px; + width: 100%; + z-index: 199; + + .content { + background-color: #f3f3f3; + height: 100%; + width: 100%; + } + } + + .left-area { + float: left; + height: 100%; + + button { + margin-top: 5px; + margin-left: 10px; + float: left; + } + + span:nth-child(2), + span:nth-child(3) { + margin-left: 30px; + line-height: 40px; + height: 40px; + float: left; + } + + .searchChild { + width: 100%; + } + + span.icon-refer { + height: 30px !important; + line-height: 30px !important; + } + + .u-form-control { + width: 220px !important; + + input.u-form-control { + border-right: 1px solid #bdbdbd; + } + } + } + + .left-area > div { + float: left; + margin-left: 30px; + margin-top: 6px; + } + + .right-area { + position: absolute; + right: 10px; + top: 2px; + + button { + margin-top: 4px; + } + } + + .selected-remove-one { + text-decoration: underline; + cursor: pointer; + } + + + .menu-type-icon { + cursor: pointer; + width: 28px; + text-align: center; + line-height: 28px; + border-radius: 3px; + font-size: 16px; + display: block; + position: absolute; + right: 20px; + border: 1px solid #d0d0d0; + color: #111; + box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.05); + &:hover { + border-color: #e14c46; + color: #e14c46; + } + } + .bill-status-wrap { + white-space: nowrap; + display: flex; + align-items: center; + + .complete-status, + .not-complete-status { + width: 4px; + height: 4px; + border-radius: 50%; + user-select: none; + margin-right: 5px; + box-sizing: content-box; + } + + .complete-status { + background-color: #4caf50; + border: 2px solid #c4edc5; + } + + .not-complete-status { + background-color: #ff6d18; + border: 2px solid #ffdec5; + } + } + } + + .scroll-add-more { + text-align: center; + font-size: 13px; + color: #555; + line-height: 30px; + user-select: none; + background: #fff; + } + + + #WorkbenchDetail { + bottom: 0; + } diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/presetVar.js b/src/ssctpaaa/sscsearch/sscsearch/list/presetVar.js new file mode 100644 index 0000000..bb68eda --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/presetVar.js @@ -0,0 +1,13 @@ +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ +/**页面全局变量 */ +let currentVar = { + + pageId: "sscsearch", + list: "ssctasklist", + card: "ssctaskcard", + searchArea: "searchArea" +}; + +export default currentVar; + +/*NfbwZuhGuJXM+2qP8b1Tl7HfgjESboSZgS3QnS7gjOs=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/requestApi.js b/src/ssctpaaa/sscsearch/sscsearch/list/requestApi.js new file mode 100644 index 0000000..1727f9b --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/requestApi.js @@ -0,0 +1,37 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { ajax } from "nc-lightapp-front"; + +let requestDomain = ""; + +let requestApiOverwrite = { + // 查询接口 + query: opt => { + ajax({ + url: "/nccloud/ssctp/sscbd/SSCTaskSearchAction.do", + data: opt.data, + success: opt.success + }); + }, + // 查询接口 + queryFuzzyKey: opt => { + ajax({ + url: "/nccloud/ssctp/sscbd/SSCTaskSearchBlurQueryAction.do", + data: opt.data, + success: opt.success + }); + }, + // 查看单据 + openBill: opt => { + ajax({ + url: "/nccloud/sscrp/rpbill/BrowseBillAction.do", + data: opt.data, + success: data => { + opt.success(data); + } + }); + } +}; + +export default requestApiOverwrite; + +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsearch/sscsearch/list/sscSearch.js b/src/ssctpaaa/sscsearch/sscsearch/list/sscSearch.js new file mode 100644 index 0000000..5940140 --- /dev/null +++ b/src/ssctpaaa/sscsearch/sscsearch/list/sscSearch.js @@ -0,0 +1,290 @@ +/*QpJgyDAZxXnWG91XmXvE12IWxbRf7NDRjjmCn7nmLTg=*/ +import { Component } from "react"; +import { createPage, base, createPageIcon } from "nc-lightapp-front"; +const { NCSelect, NCAffix } = base; +import WorkbenchDetail from "ssccommon/components/workbench-detail"; +import pubMessage from 'ssccommon/utils/pubMessage'; +import { initTemplate, listButtonClick, query } from "./events/index"; +import presetVar from "./presetVar"; +import requestApi from "./requestApi"; +import "./index.less"; +import { + ProfileStyle, + ProfileHead, + ProfileBody, + ButtonGroup, + HeadCenterCustom, + ProfileSearch +} from 'ssccommon/components/profile'; +import sscOpenTo from 'ssccommon/utils/sscOpenTo'; +import searchDateCtl from 'ssccommon/utils/searchDateCtl'; +import FuzzyQueryFilter from 'ssccommon/components/fuzzy-query-filter'; + + + +class SscSearch extends Component { + constructor(props) { + super(props); + this.state = { + showType: "list", + fuzzyquerychild: [], + menuShowType: { + type: "icon-Group", + title: "缩略显示" + // "105602BZCX-0008":"缩略显示" + //title:multiLang && multiLang.get('105602BZCX-0008') + } + }; + this.pubMessage = new pubMessage(props); + // 查询条件 + this.queryKey = { + fuzzyQueryKey: [], + // 页信息 + pageinfo: { + number: 1, + size: 30, + totalElements: 0, + totalPages: 0 + }, + querycondition: {}, + querytype: 'tree' + }; + // 缓存查询结果数据 + this.data = { + listRows: [], + cardRows: [] + }; + // 延时控制标记 + // 翻页 + this.canChangPageFlag = true; + // 模糊查询 + this.fuzzyKey = ""; + // 页面初始化 + initTemplate.call(this, props); + } + menuClick = () => { + // "105602BZCX-0008":"缩略显示", + // "105602BZCX-0009":"列表显示" + let multiLang = this.props.MutiInit.getIntl(7010); + if (this.state.menuShowType.type == "icon-shituqiehuan") { + this.setState({ + menuShowType: { + type: "icon-Group", + //title: multiLang && multiLang.get("105602BZCX-0008") + title: "缩略显示" + }, + showType: "list" + }); + } else { + this.setState({ + menuShowType: { + type: "icon-shituqiehuan", + //title: multiLang && multiLang.get("105602BZCX-0009") + title: "列表显示" + }, + showType: "card" + }); + } + }; + // 模糊查询输入内容变化 + onFuzzyChange(data) { + this.fuzzyKey = data; + let newQueryKey = {}; + let multiLang = this.props.MutiInit.getIntl(7010); + for (let child in this.queryKey) { + newQueryKey[child] = this.queryKey[child]; + } + newQueryKey.fuzzyQueryKey = data; + setTimeout( + (that, data) => { + if (data == that.fuzzyKey) { + requestApi.queryFuzzyKey({ + data: newQueryKey, + success: data => { + for (let childName in data.data) { + data.data[childName].value = + data.data[childName].value + "=" + that.fuzzyKey; + //701001RWCL-0061:包含 + data.data[childName].key = + data.data[childName].key + (multiLang && multiLang.get("701001RWCL-0061")) + that.fuzzyKey; + } + that.setState({ fuzzyquerychild: data.data }); + } + }); + } + }, + 500, + this, + data + ); + } + // 模糊查询选择 + onFuzzySelected(data) { + this.setState({ fuzzyquerychild: [] }); + // 更新查询条件 + this.queryKey.fuzzyQueryKey = data; + // 查询数据 + query.queryData.call(this); + } + searchClick(props, data, type) { + this.queryKey.querycondition = data; + + query.queryData.call(this); + this.fuzzyQueryFilter.queryFilterData(); + + } + // 复制列表数据 + copyData(data) { + let newData = {}; + newData.values = {}; + for (let child in data.values) { + newData.values[child] = { + display: data.values[child].display, + value: data.values[child].value, + scale: data.values[child].scale + }; + } + return newData; + } + // 双击列表行切换到卡片态浏览 + onRowDoubleClick = (values, idx, props, events) => { + requestApi.openBill({ + data: { + billtypeCode: values.billtypecode.value, + transtypeCode: values.transtypecode.value, + billid: values.busiid.value + }, + success: data => { + sscOpenTo(this.props, data.data.system, [ + data.data.url, { + ...data.data.data, + scene: "bzcx" + },null, + { + pk_group: values.pk_group.value + } + ]) + + } + }); + }; + + render() { + const { table, search, button } = this.props; + const { createSimpleTable } = table; + let { NCCreateSearch } = search; + let multiLang = this.props.MutiInit.getIntl(7010); + const { onRowDoubleClick } = this + + let isShow = type => { + if (this.state.showType == "list" && type == "list") { + return "show"; + } else if (this.state.showType == "card" && type == "card") { + return "show"; + } else { + return "hide"; + } + }; + + let addMoreOnOff = this.data.listRows.length > 0 && Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number) + + return ( + + + + {/* 不需要高级模糊查询功能 */} + {/* */} + + + + + + {NCCreateSearch(presetVar.searchArea, { + clickSearchBtn: this.searchClick.bind(this), + defaultConditionsNum: 1, + showAdvBtn: false, + // searchBtnName: multiLang && multiLang.get('105602BZCX-0024') + onAfterEvent: (...params) => { + if (params[5] == 'onchange') { + this.fuzzyQueryFilter.clearFilterData(); + } + } + })} + + + {this.fuzzyQueryFilter = obj}} + /> + +
+ {createSimpleTable(presetVar.list, { + showIndex: true, + lazyload: false, + onRowDoubleClick + })} + {/* "701003RWCX-0171":"滑动加载更多" */} +
{multiLang && multiLang.get('701003RWCX-0171')}
+
+
+ { + if (this.queryKey.isComplate == "true") { + return ["Print", "Copy"]; + } else { + return ["Print", "Copy", "RemindingApproval"]; + } + }} + /> +
{multiLang && multiLang.get('701003RWCX-0171')}
+
+ +
+
+ ); + } +} +SscSearch = createPage({ + mutiLangCode: "7010" +})(SscSearch); +export default SscSearch; + +/*QpJgyDAZxXnWG91XmXvE12IWxbRf7NDRjjmCn7nmLTg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/approvalrules.js b/src/ssctpaaa/sscsetting/approvalrules/config/approvalrules.js new file mode 100644 index 0000000..c5cc84b --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/approvalrules.js @@ -0,0 +1,163 @@ +/*ZlF39L4bqQsUkz4M2BtavViXrTL4LNjOlpHwsL82cYQ=*/ +import React, { Component } from "react"; +import { createPage, base, createPageIcon } from "nc-lightapp-front"; +import { initTemplate, buttonClick, afterEvent, query } from "./events"; +import Drawformlist from "./drawFormList" +import { Nav } from "ssccommon/components/global-nav"; +import "./index.less"; +import './index.css' +import SSCCenterRef from "../../../refer/sscbd/SSCUnitGridRef"; +import { + ProfileStyle, + ProfileHead, + ProfileBody, + ButtonGroup, + HeadCenterCustom, + ProfileSearch, + NonstandardButtonGroup +} from 'ssccommon/components/profile'; + +const { NCModal, NCButton, NCCheckbox, NCDiv } = base; + +class ApprovalRules extends Component { + constructor(props) { + super(props); + this.props = props; + this.formModalId = "formModal"; // 新增/编辑modal关闭 + this.formId = "approvalrules_card"; // 新增表单组件模板id + this.billtypeTableId = "billtypelist"; // 单据类型表格模板 + this.credit = '';//是否启用信用 + this.pk = []; //选中规则的pk + this.pk1 = ''; + this.creditState = '';//是否启用信用 + this.state = { + data: [], + SSCCenter: '', + showDisabled: false, // 显示停用 + enablestate: [],//管理每条规则的启用停用共享中心的状态 + checked: [], + implementDisabled: true,//立即执行按钮状态 + addDisabled: true //新增按钮状态 + }; + initTemplate.call(this, props); + } + + // 页面加载 + componentDidMount() { + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + setTimeout(() => { + pk_sscunit && query.onSSCCenterChange.call(this, JSON.parse(pk_sscunit)); + }, 300); + } + + render() { + let { + form: { createForm } + } = this.props; + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + return ( +
+
+ ); + } +} + +let ApprovalRulesDom = createPage({ + mutiLangCode: '7010' +})(ApprovalRules); +export default ApprovalRulesDom; + +/*ZlF39L4bqQsUkz4M2BtavViXrTL4LNjOlpHwsL82cYQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/drawFormList.js b/src/ssctpaaa/sscsetting/approvalrules/config/drawFormList.js new file mode 100644 index 0000000..a2fa31e --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/drawFormList.js @@ -0,0 +1,390 @@ +/*XhWoruwxb5VE9PaqcFXglwML/zDq6k9SWGdwYRnnpZw=*/ +import React, {Component} from "react"; +import gxicon1 from "../../../public/image/gxicon1.png"; +import gxicon2 from "../../../public/image/gxicon2.png"; +import gxicon3 from "../../../public/image/gxicon3.png"; +import gxicon4 from "../../../public/image/gxicon4.png"; +import gxicon5 from "../../../public/image/gxicon5.png"; +import requestApi from "./requestApi"; +import query from "./events/query"; +import {createPage, base, createPageIcon, toast, getTheme} from "nc-lightapp-front"; + +const {NCPopconfirm, NCTableSwitch, NCCheckbox, NCModal, NCFormControl, NCDiv} = base; + +class Drawformlist extends Component { + constructor(props) { + super(props); + this.props = props; + this.parent = props.parent; + this.formId = "approvalrules_card"; // 新增表单组件模板id + this.billtypeTableId = "billtypelist"; // 单据类型表格模板 + this.tranctionTableId = "tradetypelist"; // 交易类型表格模板 + this.groupTableId = "orglist"; // 单位范围表格模板 + this.detailModalId = "detailModal"; // 详情modal + this.state = { + data: [], + showFormModal: false, // 新增/编辑表单模态显示 + editFormPk: "", // 当前编辑的form的pk + enablestate: true, + showDetailModal: false, // 详细表格显示 [单位范围,交易类型,单据类型] + modalType: {}, // 控制显示全部模态内容显示 控制显示 [单位范围,交易类型,单据类型] + checked: false, + isBlackTheme: null + } + getTheme().then((theme) => { + this.setState({ + isBlackTheme: theme == 'black' + }) + }) + } + + // 删除表单 + delForm = pk => { + let newData = this.props.data.filter(item => { + return pk === item.values.pk_approverule.value; + }); + let sscunitForm = {pk: pk}; + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + // 请求删除 + requestApi.delFormData({ + data: sscunitForm, + success: res => { + for (let i = 0; i < this.props.data.length; i++) { + switch (this.props.data[i].values.pk_approverule.value) { + case pk: + this.props.data.splice(i, 1); + this.setState({data: this.state.data}); + break; + } + } + // "701001RWCL-0042": "删除成功" + toast({title: multiLang && multiLang.get('701001RWCL-0042')}) + + } + }); + }; + // 修改表单 + editForm = (pk, amount, credit) => { + this.parent.setState({showFormModal: true, editFormPk: pk}); + let editFormItem = this.props.data.filter(item => { + return pk == item.values.pk_approverule.value; + }); + editFormItem = JSON.parse(JSON.stringify(editFormItem)); + this.parent.props.form.setAllFormValue({[this.formId]: {rows: editFormItem}}); + this.parent.props.form.setFormItemsValue(this.formId, { + 'amount': {value: amount, display: ''}, + 'credit': {display: '', value: credit} + }); + }; + //启用停用审批规则 + onChange = (pk) => { + // 请求启用/停止 + let newData = this.props.data.filter(item => { + return pk === item.values.pk_approverule.value; + }); + if (newData[0].values.enablestate.value != "1") { + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + requestApi.enableSSCUnit({ + data: { + pk: newData[0].values.pk_approverule.value, + enablestate: !this.parent.state.showDisabled, + sscunit: this.parent.state.SSCCenter.refpk + }, + success: res => { + this.parent.setState({ + data: res ? res[this.formId].rows : [], + }); + // "701001RWCL-0043": "启用成功" + toast({title: multiLang && multiLang.get('701001RWCL-0043')}) + } + }); + } + else { + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + requestApi.disableSSCUnit({ + data: { + pk: newData[0].values.pk_approverule.value, + enablestate: !this.parent.state.showDisabled, + sscunit: this.parent.state.SSCCenter.refpk + }, + success: res => { + this.parent.setState({ + data: res ? res[this.formId].rows : [], + }); + // "701001RWCL-0044": "停用成功" + toast({title: multiLang && multiLang.get('701001RWCL-0044')}) + } + }); + } + }; + //checkbox勾选事件 + changeCheck = (pk, e) => { + if (e) { + this.parent.pk.push(pk); + this.parent.pk1 = pk; + } else { + this.parent.pk1 = ''; + this.parent.pk.find((item, index) => { + if (item == pk) { + this.parent.pk.splice(index, 1) + } + }) + } + if (this.parent.pk.length > 0) { + this.props.implementDisabled(false) + } else { + this.props.implementDisabled(true) + } + } + // 渲染模态详情 + drawDetailModelContent = () => { + let {createEditTable} = this.parent.props.editTable; + switch (this.state.modalType.value) { + case this.tranctionTableId: + return createEditTable(this.tranctionTableId, { + showIndex: true + }); + case this.billtypeTableId: + return createEditTable(this.billtypeTableId, { + showIndex: true + }); + case this.groupTableId: + return createEditTable(this.groupTableId, { + showIndex: true + }); + } + }; + + // 关闭指定modal + closeModal(key) { + switch (key) { + case this.detailModalId: + this.setState({showDetailModal: false}); + break; + } + } + + render() { + let formList = []; + let imgList = [gxicon1, gxicon2, gxicon3, gxicon4, gxicon5]; + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + let detailModalContent = this.drawDetailModelContent(); + this.parent.state.data.map((item, index) => { + let billTypeArr = item.values.pk_billtype.display.split(","); + let displayArr = billTypeArr.slice(0, 3); // 单据类型默认显示3个 + let billTypeStr = displayArr.join(" ; "); + + let tranStr = ""; + if (item.values.pk_tradetype.display == "") { + tranStr = ""; + } else { + let tranctionArr = item.values.pk_tradetype.display.split(","); + let displayTranArr = tranctionArr.slice(0, 3); // 交易类型默认显示3个 + tranStr = displayTranArr.join(" ; "); + } + let groupArr = item.values.pk_org.display.split(","); + let displayGroupArr = groupArr.slice(0, 3); // 单位范围默认显示3个 + let groupStr = displayGroupArr.join(" ; "); + + //处理审批条件 + let formula = item.values.formula.value; + let str = formula.split(";"); + let amount = ''; + let credit = ''; + if (str[0].indexOf('amount') >= 0 && str.length != 3) { + //只有金额 + amount = str[0].substring(8, str[0].length); + } else if (str[0].indexOf('credit') >= 0 && str.length != 3) { + //只有信用 + credit = str[0].substring(8, str[0].length); + } else if (str[0].indexOf('amount') >= 0 && str.length == 3) { + //信用金额都有 + amount = str[0].substring(8, str[0].length); + credit = str[1].substring(8, str[1].length); + } + + const showDelBtn = item.values.enablestate.value !== '1', btnAreaClass = showDelBtn ? 'head-btn head-btn-del' : 'head-btn' + + formList.push( + +
+
+ + + {/*"701001RWCL-0174": "规则编码"*/} + {/*"701001RWCL-0175": "规则名称",*/} + + {index + 1}. + {multiLang && multiLang.get('701001RWCL-0174') + ':' + item.values.code.value} + + {multiLang && multiLang.get('701001RWCL-0175') + ':' + item.values.name.value} + + + + {/*"701004SPGZ_001": "确定启用审批规则",*/} + {/*"701004SPGZ_002": "确定停用审批规则"*/} + { + this.onChange(item.values.pk_approverule.value); + }} + > + + + + + + { + this.editForm(item.values.pk_approverule.value, amount, credit); + }} + >{/*"701001RWCL-0038": "修改"*/} + {multiLang && multiLang.get('701001RWCL-0038')} + + + {/*"701001RWCL-0039": "确认删除?"*/} + { + this.delForm(item.values.pk_approverule.value); + }} + > + {/*"7010-0002": "删除",*/} + {!showDelBtn ? '' : multiLang && multiLang.get('7010-0002')} + + + +
+
+
+ +
+ {/*"701001RWCL-0176": "审批条件",*/} + {multiLang && multiLang.get('701001RWCL-0176') + ':'} + + {/*{formula ? "报账单金额"+ amount+"且" + "报账人信用" + credit: ""}*/} + {amount ? (multiLang && multiLang.get('701001RWCL-0191') + "<=" + amount) : ""} + {/*{amount && credit ? "且 " : ""}*/} + {/*"701001RWCL-0191": "报账本币金额?",*/} + {/*"701001RWCL-0192": "报账人信用?",*/} + {this.parent.creditState && credit ? ( multiLang && multiLang.get('701001RWCL-0192') + ">=" + credit) : ""} + +
+ {/*"701001RWCL-0111":"【查看全部】"*/} +
+
+ {multiLang && multiLang.get('701001RWCL-0177')}: + {billTypeStr} + + {billTypeStr ? multiLang && multiLang.get('701001RWCL-0111') : ''} + +
+
+ {multiLang && multiLang.get('701001RWCL-0178') + ':'} + + {tranStr} + + {tranStr == "" ? ( + "" + ) : ( + + {tranStr ? multiLang && multiLang.get('701001RWCL-0111') : ''} + + )} +
+ + +
+
+ {/*"701001RWCL-0179": "单位范围",*/} + {/*"701001RWCL-0180": "包含下级单位",*/} +
+ {multiLang && multiLang.get('701001RWCL-0179') + ':'} + {groupStr} + {groupStr == "" ? ("") : ( + + {groupStr ? multiLang && multiLang.get('701001RWCL-0111') : ''} + + )} +
+
+ + {multiLang && multiLang.get('701001RWCL-0180') + ':'} + + + {item.values.iscontainslower && item.values.iscontainslower.value ? "是" : "否"} + +
+ +
+
+
+ ); + }); + return ( + + {formList} + {/*显示全部modal*/} + { + this.closeModal(this.detailModalId) + }} + backdrop={false} + > + + {this.state.detailModalTitle} + + + {detailModalContent} + + + + ); + } +} + +export default Drawformlist; +/*XhWoruwxb5VE9PaqcFXglwML/zDq6k9SWGdwYRnnpZw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/approvalrules/config/events/afterEvent.js new file mode 100644 index 0000000..8626f15 --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/events/afterEvent.js @@ -0,0 +1,13 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ + +export default function afterEvent(props, moduleId, key,changedrows, value,index,data) { + + switch(key) { + case 'pk_billtype' : + props.form.setFormItemsValue(this.formId, { + pk_tradetype: {} + }); + break; + } +}; +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/approvalrules/config/events/buttonClick.js new file mode 100644 index 0000000..e50edce --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/events/buttonClick.js @@ -0,0 +1,176 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from "../requestApi"; +import { toast,getTheme } from "nc-lightapp-front"; + +// 是否暗黑主题 +let isBlackTheme = null; +getTheme().then((theme) => { + isBlackTheme = theme == 'black'; +}) + +/** + * 新增按钮点击 + */ +let addButtonClick = function() { + // this.pk=""; + this.props.form.EmptyAllFormValue([this.formId]); + this.setState({ showFormModal: true, editFormPk: "" }, () => { + //新增弹框特殊样式 + // document.getElementsByClassName('name')[1].className += (" iconfont icon-jiantouyou"); + document.getElementsByClassName('name')[1].style.color = isBlackTheme ? '#b0b0b0' : '#111'; + // document.getElementsByClassName('name')[2].className += (" iconfont icon-jiantouyou"); + document.getElementsByClassName('name')[2].style.color = isBlackTheme ? '#b0b0b0' : '#111'; + }); +}; +/** + * 保存按钮点击 + */ +let saveFormButtonClick = function() { + let formData = this.props.form.getAllFormValue(this.formId); + let multiLang = this.props.MutiInit.getIntl(7010); + if(!this.props.form.isCheckNow(this.formId)){ + return; + } + let approvalrulesForm = { form: formData }; + console.log(approvalrulesForm.form.rows[0].values) + if (this.state.SSCCenter.refpk) { + approvalrulesForm.form.rows[0].values.pk_sscunit = this.state.SSCCenter.refpk + //根据是否有pk判断是新增保存或修改保存 + if (approvalrulesForm.form.rows[0].values.pk_approverule.value) { + if (approvalrulesForm.form.rows[0].values.amount.value == "") { + approvalrulesForm.form.rows[0].values.amount.value = null; + }if (approvalrulesForm.form.rows[0].values.credit.value == "") { + approvalrulesForm.form.rows[0].values.credit.value = null; + } + let updateData = approvalrulesForm.form.rows[0].values + if(updateData['enablestate'].value==1){ + updateData['enablestate'] = true; + }else { + updateData['enablestate'] = false; + } + requestApi.updateFormData({ + data: updateData, + success: res => { + this.setState({ + data: res ? res[this.formId].rows : [], + showFormModal: false + }); + } + }) + }else{ + if (approvalrulesForm.form.rows[0].values.amount.value == "") { + approvalrulesForm.form.rows[0].values.amount.value = null; + }if (approvalrulesForm.form.rows[0].values.credit.value == "") { + approvalrulesForm.form.rows[0].values.credit.value = null; + } + let saveData = approvalrulesForm.form.rows[0].values + saveData['enablestate'] = !this.state.showDisabled;// 新增规则默认启用 + requestApi.saveFormData({ + data: saveData, + success: res => { + this.setState({ + data: res ? res[this.formId].rows : [], + showFormModal: false + }); + // "701001RWCL-0118": "保存成功", + toast({ content: multiLang && multiLang.get('701001RWCL-0118'), color: 'success' }); + //找到新增项,页面滚动到对应位置 + res[this.formId].rows.find( (item,index) => { + if (item.values.code.value == approvalrulesForm.form.rows[0].values.code.value) { + // $('html,body').animate({scrollTop:$(".ssc-form:eq("+index+")").offset().top}, 800); + document.getElementsByClassName('ssc-form')[index].scrollIntoView(true) + } + }) + } + }); + } + }else{ + // "701004SPGZ_004": "请选择共享中心" + toast({ + duration: 2, // 消失时间,默认是3秒; 值为 infinity 时不消失,非必输 + color: 'danger', // 提示类别,默认是 "success",非必输 + content: multiLang && multiLang.get('701004SPGZ_004') // 提示内容,非必输 + }) + } + console.log(this.state.SSCCenter) + console.log(approvalrulesForm.form.rows[0].values) +}; +/** + * 取消按钮点击 + */ +let cancelFormButtonClick = function() { + this.setState({ showFormModal: false }); + this.props.form.EmptyAllFormValue([this.formId]); +}; +/** + * 立即执行按钮点击 + */ +let immediateExecution = function () { + let data = {"sscunit": this.state.SSCCenter.refpk, "rule": this.pk}; + let multiLang = this.props.MutiInit.getIntl(7010); + if (this.pk.length != 0 ) { + this.state.data.find( (item) => { + let ref = this.pk.find( (key) => { + if (item.values.pk_approverule.value == key) { + // "701004SPGZ_003": "已停用的审批规则不能执行", + if (item.values.enablestate.value == 2) { + toast({ + duration: 2, + color: 'danger', + content: multiLang && multiLang.get('701004SPGZ_003'), + }) + return false; + } + return true + } + }); + if ( ref && item.values.pk_approverule.value == this.pk1) { + //处理审批条件 + let formula = item.values.formula.value; + let str = formula.split(";"); + let amount = ''; + let credit = '' + if (str[0].indexOf('amount') >= 0 && str.length != 3) { + //只有金额 + amount = str[0].substring(8, str[0].length); + }else if (str[0].indexOf('credit') >= 0 && str.length != 3) { + //只有信用 + credit = str[0].substring(8, str[0].length); + }else if(str[0].indexOf('amount') >= 0 && str.length == 3) { + //信用金额都有 + amount = str[0].substring(8, str[0].length); + credit = str[1].substring(8, str[1].length); + } + if (!amount && !this.creditState) { + toast({ + duration: 2, // 消失时间,默认是3秒; 值为 infinity 时不消失,非必输 + color: 'danger', // 提示类别,默认是 "success",非必输 + content: '请修改规则,审批条件不能为空' // 提示内容,非必输 + }) + }else{ + requestApi.immediateExecution({ + data: data, + success: res => { + toast({ + duration: 2, // 消失时间,默认是3秒; 值为 infinity 时不消失,非必输 + color: 'success', // 提示类别,默认是 "success",非必输 + content: '执行成功' // 提示内容,非必输 + }) + } + }) + } + } + }) + }else{ + toast({ + duration: 2, // 消失时间,默认是3秒; 值为 infinity 时不消失,非必输 + color: 'danger', // 提示类别,默认是 "success",非必输 + content: '请选择一条规则来执行' // 提示内容,非必输 + }) + } + +} + +export default { addButtonClick, saveFormButtonClick, cancelFormButtonClick, immediateExecution }; + +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/events/index.js b/src/ssctpaaa/sscsetting/approvalrules/config/events/index.js new file mode 100644 index 0000000..a636aa6 --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/events/index.js @@ -0,0 +1,14 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick'; +import afterEvent from './afterEvent'; +import initTemplate from './initTemplate'; + +import query from './query' + +export { initTemplate,buttonClick, afterEvent,query}; + + + + + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/events/initTemplate.js b/src/ssctpaaa/sscsetting/approvalrules/config/events/initTemplate.js new file mode 100644 index 0000000..7d1d09e --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/events/initTemplate.js @@ -0,0 +1,103 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import {getMultiLang} from 'nc-lightapp-front'; +import requestApi from "../requestApi"; + +export default function (props) { + const _this = this + props.createUIDom( + {}, + function (data) { + //获取多语 + getMultiLang({ + moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: (json) => { + let meta = data.template; + console.log(meta) + let BilltypeRefSqlBuilder = 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.BilltypeRefSqlBuilder'; + let TranstypeRefSqlBuilder = 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeRefSqlBuilder'; + let BusinessUnitRefSqlBuilder = 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.BusinessUnitRefSqlBuilder' + //根据单据类型过滤交易类型 + meta.approvalrules_card2.items.find((item) => { + if (item.attrcode == 'pk_billtype') { + item.refcode = '/uap/refer/riart/billtype/index.js' + item.queryCondition = function () { + return {GridRefActionExt: BilltypeRefSqlBuilder}; + } + } + if (item.attrcode === "pk_tradetype") { + item.queryCondition = function () { + let billtype = props.form.getFormItemsValue('approvalrules_card', 'pk_billtype'); + let data = billtype == null ? "" : billtype.value; + return {billtype: data, GridRefActionExt: TranstypeRefSqlBuilder}; + } + } + if (item.attrcode === "pk_org") { + item.refcode = "uapbd/refer/org/BusinessUnitTreeRef/index.js"; + item.isShowUnit = true; + item.isRunWithChildren = false; + item.unitProps = { + placeholder: json['701001RWCL-0078'],//701001RWCL-0078: + refName: json['701001RWCL-0078'], + refType: "tree", + refCode: "uapbd.org.GroupDefaultTreeRef", + queryTreeUrl: "/nccloud/uapbd/ref/GroupDefaultTreeRef.do", + rootNode: {refname: json['701001RWCL-0078'], refpk: "root"}, + } + item.queryCondition = function () { + let sscunit = _this.state.SSCCenter; + let data = sscunit.refpk == null ? "" : sscunit.refpk; + return {sscunit: data, TreeRefActionExt: BusinessUnitRefSqlBuilder}; + } + } + }) + meta.orglist.items.find((item) => { + if (item.attrcode == 'pk_org.code') { + item.attrcode = 'code' + } else if (item.attrcode == 'pk_org.name') { + item.attrcode = 'name' + } + }) + meta.tradetypelist.items.find((item) => { + if (item.attrcode == 'pk_tradetype.pk_billtypecode') { + item.attrcode = 'pk_billtypecode' + } else if (item.attrcode == 'pk_tradetype.billtypename') { + item.attrcode = 'billtypename' + } + }) + meta.billtypelist.items.find((item) => { + if (item.attrcode == 'pk_billtype.pk_billtypecode') { + item.attrcode = 'pk_billtypecode' + } else if (item.attrcode == 'pk_billtype.billtypename') { + item.attrcode = 'billtypename' + } + }) + //是否启用信用 + requestApi.query({ + data: {}, + success: data => { + _this.creditState = data; + if (!data) { + meta.approvalrules_card1.items.find((item) => { + if (item.attrcode == 'credit') { + item.visible = false + } + }) + props.form.setFormItemsRequired('approvalrules_card', {amount: true}); + } else { + meta.approvalrules_card1.items.find((item) => { + if (item.attrcode == 'credit') { + item.visible = true + } + }) + props.form.setFormItemsRequired('approvalrules_card', {amount: false}); + } + } + }); + // 设置表格编辑态 + meta["approvalrules_card"].status = 'edit'; + props.meta.setMeta(meta); + } + }) + }) +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/events/query.js b/src/ssctpaaa/sscsetting/approvalrules/config/events/query.js new file mode 100644 index 0000000..71869b5 --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/events/query.js @@ -0,0 +1,123 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from '../requestApi' + + +/** + * @Description:显示停用勾选 + * @param: + */ +let showDisabledChange = function(e) { + this.setState({ showDisabled: e }); + console.log(this.state.showDisabled) + if (this.state.SSCCenter.refpk) { + if (e) { + requestApi.ApproveRuleQry({ + data: { sscunit: this.state.SSCCenter.refpk, enablestate: this.state.showDisabled}, + success: res => { + this.setState({ + data: res ? res[this.formId].rows : [], + }); + } + }); + }else{ + requestApi.ApproveRuleQry({ + data: { sscunit: this.state.SSCCenter.refpk, enablestate: this.state.showDisabled}, + success: res => { + this.setState({ + data: res ? res[this.formId].rows : [], + }); + } + }); + } + } + +} + +/** + * @Description:查询单位明细范围 + * @param: + */ +let queryGroupDetails = function(item) { + let multiLang = this.parent.props.MutiInit.getIntl(7010); + let detailModalTitle = multiLang && multiLang.get('701001RWCL-0102'); + requestApi.queryGroupDetailTableData({ + data: { group: item.values.pk_org.value }, + success: (res) => { + //701001RWCL-0102:单位范围 + this.setState({detailModalTitle: detailModalTitle, showDetailModal: true, searchValue: '', modalType: { display: detailModalTitle, value: this.groupTableId } }); + this.parent.props.editTable.setTableData(this.groupTableId, res[this.groupTableId]); + } + }) + +} +/** + * @Description:查询交易类型/单据类型明细 + */ + +let queryBillTypeDetails = function(item, key) { + let multiLang = this.parent.props.MutiInit.getIntl(7010); + let detailModalTitle = null; + switch (key) { + case this.tranctionTableId: + detailModalTitle = multiLang && multiLang.get('701001RWCL-0103') //交易类型 + requestApi.queryDetailTableData({ + data: { billtype: item.values.pk_tradetype.value, type: this.tranctionTableId }, + success: (res) => { + //multiLang && multiLang.get('701001RWCL-0103'):交易类型 + this.setState({detailModalTitle: detailModalTitle, showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0103'), value: this.tranctionTableId } }); + this.parent.props.editTable.setTableData(key, res[this.tranctionTableId]); + } + }) + break; + case this.billtypeTableId: + detailModalTitle = multiLang && multiLang.get('701001RWCL-0104') //单据类型 + requestApi.queryDetailTableData({ + data: { billtype: item.values.pk_billtype.value, type: this.billtypeTableId }, + success: (res) => { + //multiLang && multiLang.get('701001RWCL-0104'):单据类型 + this.setState({detailModalTitle: detailModalTitle, showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0104'), value: this.billtypeTableId } }); + this.parent.props.editTable.setTableData(key, res[this.billtypeTableId]); + } + }) + break; + } +} +/** + * @Description:查询详细信息 + * @param: + */ +let queryDetailTable = function(searchValue) { + let filterKey = []; + // 单据类型/交易类型查询 billtypename 单位范围查询name + this.state.modalType.value == this.groupTableId ? filterKey.push('name') :filterKey.push('billtypename') + this.props.editTable.setFiltrateTableData(this.state.modalType.value, filterKey, searchValue, false) +} + +/** + * 获取共享中心 + * + * */ +let onSSCCenterChange = function(ssc) { + if (ssc.hasOwnProperty('refpk')) { + // 选中操作 + this.setState({ + SSCCenter: ssc + }); + this.setState({addDisabled: false}); + requestApi.ApproveRuleQry({ + data: { sscunit: ssc.refpk, enablestate: !this.state.showDisabled}, + success: (data) => { + console.log(data) + this.setState({ + data: data ? data[this.formId].rows : [] + }); + } + }) + } else { + this.setState({ SSCCenter: {},data: [], addDisabled: true }); + } + // 保存共享中心 + this.props.setUrlParam({pk_sscunit: ssc.hasOwnProperty('refpk') ? JSON.stringify(ssc) : ''}); +} +export default { onSSCCenterChange, showDisabledChange, queryGroupDetails, queryBillTypeDetails, queryDetailTable } +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/index.css b/src/ssctpaaa/sscsetting/approvalrules/config/index.css new file mode 100644 index 0000000..f4abcff --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/index.css @@ -0,0 +1,8 @@ +#approvalrules .itemText { + min-width: 170px; + max-width: calc(50% - 48px); +} + +#approvalrules .head-label { + width: calc(100% - 194px); +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/index.js b/src/ssctpaaa/sscsetting/approvalrules/config/index.js new file mode 100644 index 0000000..36bfdc5 --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React from 'react'; +import ReactDOM from 'react-dom'; +import ApprovalRulesDom from './approvalrules'; +ReactDOM.render( + , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/index.less b/src/ssctpaaa/sscsetting/approvalrules/config/index.less new file mode 100644 index 0000000..e14207d --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/index.less @@ -0,0 +1,184 @@ +@import "~base"; +#approvalrules { + .title-search-detail { + margin-right: 25px; + } +} + +.container { + .itemText { + float: left; + margin-right: 10px; + } + .img { + position: absolute; + width: 30px; + height: 30px; + left: -45px; + margin: 5px 7px 0 0; + } + .billTypeName { + display: inline-block; + width: 495px; + } + .unitscope { + display: inline-block; + width: 495px; + } +} + +.content-wrap { + min-height: calc(100% - 12px); + background: rgba(255, 255, 255, 1); + box-shadow: 0px 1px 1px 0px rgba(74, 81, 93, 0.1); + border-radius: 3px; + .ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 3px; + margin-top: 10px; + } +} + +.content-wrap .rule-list-wrap { + padding-top: 20px; +} + +.content-wrap .ssc-form { + margin-bottom: 10px; + margin-left: 40px; + margin-right: 240px; + width: auto; + min-height: 150px; + background: rgba(255, 255, 255, 1); + //box-shadow:0px 1px 2px 0px rgba(200,200,200,0.5); + border-radius: 4px; + border: 1px solid rgba(206, 206, 206, 0.75); + .head-grow { + height: 40px; + font-size: 17px; + font-family: PingFangSC-Medium; + color: rgba(17, 17, 17, 1); + line-height: 40px; + background-color: #f3f3f3; + margin-bottom: 10px; + display: flex; + + img { + position: inherit; + width: 30px; + height: 30px; + margin: 5px 15px 5px 50px; + float: left; + } + + .head-label { + white-space: nowrap; + flex-grow: 1; + } + .head-label span { + font-size: 14px; + } + .head-btn { + min-width: 138px; + flex-grow: 0; + margin-right: 8px; + .btn { + margin-left: 22px; + font-size: 14px; + font-family: PingFangHK-Regular; + color: #007ACE; + line-height: 21px; + cursor: pointer; + outline: none; + } + } + .head-btn-del span.btn:nth-child(3) { + margin-right: 22px; + } + span.customer-label[aria-describedby="delConfirmId"] { + color: #007ACE; + } + } + .grow { + margin-bottom: 11px; + width: 100%; + height: auto; + font-size: 13px; + font-family: MicrosoftYaHei; + line-height: 21px; + position: relative; + padding: 0 53px; + .column-1-1 { + width: 100% + } + .grow-label-name { + //float:left; + width: 120px; + margin-right: 2px; + display: inline-block; + height: 21px; + text-align: right; + color: rgba(85, 85, 85, 1); + } + .label-value-all { + cursor: pointer + } + } +} + +.ssc_edit_modal_form { + margin-right: 30px; +} + +.u-switch { + display: inline-block !important; +} + +.checkBox { + position: absolute; + top: 2px; + left: 73px; +} + +//针对新增弹框特殊设计的样式 +#rule { + .nc-scrollElement-wrap { + margin-bottom: 25px; + } + .icon-shouqi { + display: none; + } + .form-item { + margin-top: 30px; + } + .operator { + .name { + //color: rgba(17,17,17,1); + font-weight: 500; + font-size: 13px; + margin-left: 8px; + outline: none; + } + a { + display: none; + } + } + .line-wrap:hover { + background-color: rgba(0, 0, 0, 0); + } + .line { + height: 1px; + padding-top: 2px; + margin-top: 5px; + color: #D9D9D9; + } + .u-modal-combine-body{ + padding-left: 30px; + } +} + + + + diff --git a/src/ssctpaaa/sscsetting/approvalrules/config/requestApi.js b/src/ssctpaaa/sscsetting/approvalrules/config/requestApi.js new file mode 100644 index 0000000..a8dd041 --- /dev/null +++ b/src/ssctpaaa/sscsetting/approvalrules/config/requestApi.js @@ -0,0 +1,133 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax} from 'nc-lightapp-front'; + +let requestApi = { + + //单据模板接口 + tpl: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitTempletAction.do', + data: opt.data, + success: opt.success + }); + }, + + //信用是否启用查询接口 + query:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscapv/CreditStateAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + //根据共享中心查询 + ApproveRuleQry: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleQryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 保存表单 + saveFormData:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleInsertAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 修改规则 + updateFormData:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleUpdateAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + //立即执行 + immediateExecution:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleExecuteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + // 删除表单 + delFormData:(opt)=>{ + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleDeleteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + //停用 + disableSSCUnit:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleEnableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + //启用 + enableSSCUnit:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleEnableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + // 查询单位范围详细 + queryGroupDetailTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/OrgsQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + // 查询交易类型/单据类型详细 + queryDetailTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/BillTypeQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + +} +export default requestApi; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/clientage.js b/src/ssctpaaa/sscsetting/clientage/config/clientage.js new file mode 100644 index 0000000..d6e4323 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/clientage.js @@ -0,0 +1,241 @@ +/*UX2P8D6t8UhaTOrNPtG3flR1qutASx5OXJsch8cM6qg=*/ +import React, { Component } from 'react'; +import { createPage, base } from 'nc-lightapp-front'; +import { buttonClick, initTemplate, afterEvent,selectedChangeEvent, query } from './events'; +import dataModelChange from './events/dataModelChange'; +import { Nav } from 'ssccommon/components/global-nav' +import { ProfileStyle, ProfileHead, ProfileBody, BodyRight, HeadCenterCustom, ButtonGroup } from 'ssccommon/components/profile'; +import { EditTable } from 'ssccommon/components/table'; +import SSCCenterRef from '../../../refer/sscbd/SSCUnitGridRef' +import './index.less'; +const { NCCheckbox, NCModal, NCButton, NCFormControl } = base; + +class ClientageGrid extends Component { + constructor(props) { + super(props); + this.initTableData = []; // 表格数据,用于查询使用 + this.state = { + showModal:false, // 表单Model显示/隐藏 + searchValue:'', // 业务单元查询 + showDisabled: false, // 显示停用 + isEdit: false, // 编辑态/浏览态 + SSCCenter:{}, // 共享中心item + show: false, // 提示框状态 + height: '', // 提示框位置 + content: null //提示框内容 + } + this.content = null; + this.index = null; + this.json = {}; + this.enablestate = ''; // 启用状态 + this.showPopTimer = null + initTemplate.call(this, props); + } + + componentWillMount() { +        window.onbeforeunload = () => { +            let status = this.props.editTable.getStatus(window.presetVar.listArea); +            if (status === 'edit') { +                return ''; +            } +        } +    } + + // componentDidMount() {} + + onRowHover = (index) => { + let CommissionedArr = []; + let NotEntrustedArr = []; + let Commissioned = null; // 已委托 + let NotEntrusted = null; // 未委托 + for (let key in index.record.values) { + if (index.record.values.enablestate.value) { + this.enablestate = '已启用' + }else{ + this.enablestate = '已停用' + } + + if (index.record.values[key].value === true) { + if (this.json[key]) { + CommissionedArr.push(this.json[key]) + } + }else if (index.record.values[key].value === false) { + if (this.json[key]) { + NotEntrustedArr.push(this.json[key]) + } + } + } + Commissioned = CommissionedArr.map( (item,index) => { + if(index==CommissionedArr.length-1){ + return ( + {item} + ) + }else { + return ( + {item}、 + ) + } + }) + NotEntrusted = NotEntrustedArr.map( (item,index) => { + if(index==NotEntrustedArr.length-1){ + return ( + {item} + ) + }else { + return ( + {item}、 + ) + } + }) + + //获取鼠标位置 + let e = window.event; + this.setState({ + height: e.clientY + }) + let content = ( +
+
已委托关系:{Commissioned}
+
未委托关系:{NotEntrusted}
+
{'启用状态:' + this.enablestate}
+
+ ); + this.setState({content}) + + if (this.index === index.index) { + this.index = -1 + if(this.showPopTimer) clearTimeout(this.showPopTimer) + this.setState({show: false}) + }else{ + if(this.showPopTimer) clearTimeout(this.showPopTimer) + this.setState({show: false}) + this.index = index.index + this.showPopTimer = setTimeout(() => this.setState({show: true}), 800) + } + } + + render() { + let { form } = this.props; + let { createForm } = form; + let multiLang = this.props.MutiInit.getIntl(7010); + let { show } = this.state; + + const popStyle = { + transform: show ? 'scale(1)' : 'scale(0)' + } + return ( +
+
+ ) + } +} + +let ClientageDom = createPage({ + mutiLangCode: '7010' +})(ClientageGrid); +export default ClientageDom; +/*UX2P8D6t8UhaTOrNPtG3flR1qutASx5OXJsch8cM6qg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/clientage/config/events/afterEvent.js new file mode 100644 index 0000000..9980bf2 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/afterEvent.js @@ -0,0 +1,117 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +import { base } from "nc-lightapp-front"; +import requestApi from "../requestApi"; +let { NCMessage } = base; +export default function afterEvent(props, moduleId, key, changedrows, value, datas, data) { + let multiLang = props.MutiInit.getIntl(7010); + switch (moduleId) { + case window.presetVar.listArea: + switch (key) { + case "enablestate": + let tableData = props.editTable.getAllData(moduleId); + // 此处转换启用前端switch(true,false)和后端枚举不一致,暂时这么写 + tableData.rows = tableData.rows.filter(item => { + if (item.rowid === data.rowid) { + if (value) { + item.values.enablestate.value = 1; + } else { + item.values.enablestate.value = 2; + } + return [item]; + } + }); + // 此处转换启用前端switch(true,false)和后端枚举不一致,暂时这么写 + if (changedrows) { + // 启用 + requestApi.enable({ + data: { + head: tableData + }, + success: res => { + NCMessage.create({ content: multiLang && multiLang.get('701001RWCL-0043'), color: "success", position: "topRight" });//启用成功 + props.editTable.setValByKeyAndRowId(moduleId, data.rowid, "ts", { + value: res.sscwtgx.rows[0].values.ts.value, + }); + props.editTable.setValByKeyAndRowId(moduleId, data.rowid, "enablestate", { value: true }); + let tableData = this.props.editTable.getAllData(window.presetVar.listArea); + props.editTable.setTableData(window.presetVar.listArea, tableData); + this.setState({ tableData: tableData }); + } + }); + } else { + // 停用 + requestApi.disabled({ + data: { + head: tableData + }, + success: res => { + NCMessage.create({ content: multiLang && multiLang.get('701001RWCL-0044'), color: "success", position: "topRight" });//停用成功 + props.editTable.setValByKeyAndRowId(moduleId, data.rowid, "ts", { + value: res.sscwtgx.rows[0].values.ts.value, + }); + props.editTable.setValByKeyAndRowId(moduleId, data.rowid, "enablestate", { value: false }); + let nowData = this.props.editTable.getAllData(window.presetVar.listArea); + props.editTable.setTableData(window.presetVar.listArea, nowData); + this.setState({ tableData: tableData }); + } + }); + } + break; + case "pk_org": + let rowid = data.rowid; + // 联动业务单元编码 + props.editTable.setValByKeyAndRowId(moduleId, rowid, "pk_org.code", { + value: changedrows.hasOwnProperty('refcode') ?changedrows.refcode:'', + display: changedrows.hasOwnProperty('refcode') ? changedrows.refcode :'' + }); + // 联动业务单元所属集团 + props.editTable.setValByKeyAndRowId(moduleId, rowid, "pk_org.pk_group.name", { + value: changedrows.hasOwnProperty('values') ? changedrows.values.gname.value :'', + display:changedrows.hasOwnProperty('values') ? changedrows.values.gname.value :'' + }); + break; + default: + break; + } + break; + case window.presetVar.sscwtgx_form: + switch (key) { + case "pk_org": + let refcodeArr = []; + let gnameArr = []; + if (datas.length > 0) { + datas.map(item => { + refcodeArr.push(item.refcode); + if (item.values != undefined) { + if (item.values.gname != undefined) { + gnameArr.push(item.values.gname.value); + } + } + }); + // 业务单元联动业务单元编码 + props.form.setFormItemsValue(window.presetVar.sscwtgx_form, { + "pk_org.code": { value: "", display: refcodeArr.join(",") } + }); + // 业务单元联动业务单元所属集团 + props.form.setFormItemsValue(window.presetVar.sscwtgx_form, { + "pk_org.pk_group.name": { value: "", display: gnameArr.join(",") } + }); + }else { + // 业务单元联动业务单元编码 + props.form.setFormItemsValue(window.presetVar.sscwtgx_form, { + "pk_org.code": { value: "", display: "" } + }); + // 业务单元联动业务单元所属集团 + props.form.setFormItemsValue(window.presetVar.sscwtgx_form, { + "pk_org.pk_group.name": { value: "", display: "" } + }); + } + break; + default: + break; + } + default: + break; + } +} +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/clientage/config/events/buttonClick.js new file mode 100644 index 0000000..abf510f --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/buttonClick.js @@ -0,0 +1,232 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import { base, toast } from 'nc-lightapp-front'; +import requestApi from '../requestApi' +import { setTableExtendCol } from 'ssccommon/components/profile' +import dataModelChange from './dataModelChange' +import tableExtendButtonClick from './tableExtendButtonClick'; +import { promptBox } from "nc-lightapp-front" + +const { NCMessage } = base; + +/** + * @Author:gaoymf + * @Description:编辑按钮处理后事件 + * @Date: 16:12 2018/5/11 + * @param: + */ +let afterEdit = function() { + this.setState({ isEdit: true }); + this.props.button.setButtonVisible(['Reset', 'Add','Edit'], false); + this.props.button.setButtonVisible(['BatchDelete'], true); + //设置表格的扩展按钮列 + setTableExtendCol(this.props, this.props.meta.getMeta(), [{ + areaId: window.presetVar.listArea, + btnAreaId: window.presetVar.listBtnArea, + buttonVisible: (record, index) => { + return ['Delete'] + }, + onButtonClick: tableExtendButtonClick.bind(this) + }]); +} + + +/** + * @Author:gaoymf + * @Description:保存按钮处理后事件 + * @Date: 16:12 2018/5/11 + * @param: + */ +let afterSave = (that, data) => { + that.setState({ isEdit: false }); + that.props.button.setButtonVisible(['Reset', 'Add','Edit'], true); + that.props.button.setButtonVisible(['BatchDelete'], false); + that.props.meta.getMeta()[window.presetVar.listArea].items.pop(); + // 后台数据为空,返回值没有data.data + if (data.data == undefined) { + that.props.editTable.setTableData(window.presetVar.listArea, { rows: [] }); + } else { + let newData = dataModelChange.voToJson(data.data); + that.props.editTable.setTableData(window.presetVar.listArea, newData[window.presetVar.listArea]); + } + +} +/** + * @Author:yushuaif + * @Date: 2020/01/15 + * @param: + */ +let beforeSave = (props) => { + // 校验同一共享服务中心不能委托相同的业务单元 + let tableRows = props.editTable.getAllRows(window.presetVar.listArea); + let isExistOrg = [], pkOrgs = [], multiLang = props.MutiInit.getIntl(7010); + tableRows.forEach(row => { + if (pkOrgs.indexOf(row.values.pk_org.value) === -1) { + pkOrgs.push(row.values.pk_org.value) + } else { + isExistOrg.push(row.values.pk_org.display) + } + }) + if (isExistOrg.length) { + let content = multiLang && multiLang.get('701001RWCL-0072') + ':\n' + isExistOrg.forEach((txt, idx) => { + if (idx === isExistOrg.length - 1) { + content += txt + '。' + } else { + content += txt + ';\n' + } + }) + toast({ content, color: 'danger' })//同一共享服务中心下不能委托相同的业务单元 + return false + } + return 'exec' +} +/** + * 取消按钮处理后事件 + * @param {*} that + */ +let afterCancel = function() { + this.setState({ isEdit: false }); + this.props.button.setButtonVisible(['Reset', 'Add','Edit'], true); + this.props.button.setButtonVisible(['BatchDelete'], false); + this.props.meta.getMeta()[window.presetVar.listArea].items.pop(); +} +/** + * 批量删除按钮处理后事件 + * @param {*} that + */ +let batchDelete = function() { + let data = this.props.editTable.getCheckedRows(window.presetVar.listArea); + let arr = data.map(item => item.index); + this.props.editTable.deleteTableRowsByIndex(window.presetVar.listArea, arr); +} + + +/** + * @Author:gaoymf + * @Description:新增按钮点击 + * @Date: 16:12 2018/5/11 + * @param: + */ +let addClick = function() { + this.setState({ showModal: true }); + // 清空表单内容 + this.props.form.EmptyAllFormValue(window.presetVar.sscwtgx_form); + // 新增表单共享中心pk赋值 + this.props.form.setFormItemsValue(window.presetVar.sscwtgx_form, { 'pk_sscunit': { value: this.state.SSCCenter.refpk, display: null } }); +} +/** + * @Author:gaoymf + * @Description:表单保存 + * @Date: 16:12 2018/5/13 + * @param: + */ +let addFormSave = function() { + let flag = true; + // 关闭modal + flag = this.props.form.isCheckNow(window.presetVar.sscwtgx_form); + let multiLang = this.props.MutiInit.getIntl(7010); + if (flag) { + // 获得form数据 + let data = this.props.form.getAllFormValue(window.presetVar.sscwtgx_form); + // 校验同一共享服务中心不能委托相同的业务单元 + let tableRows = this.props.editTable.getAllRows(window.presetVar.listArea); + let isExistOrg = []; + tableRows.map((row) => { + data.rows[0].values.pk_org.value.indexOf(row.values.pk_org.value) > -1 && isExistOrg.push(row.values.pk_org.display); + }) + if (isExistOrg.length > 0) { + let content = multiLang && multiLang.get('701001RWCL-0072') + ':\n' + isExistOrg.forEach((txt, idx) => { + if (idx === isExistOrg.length - 1) { + content += txt + '。' + } else { + content += txt + ';\n' + } + }) + toast({ content, color: 'danger' })//同一共享服务中心下不能委托相同的业务单元 + } else { + // 设置新增状态 + data.rows[0].values.enablestate.value = 2; + requestApi.add({ + data: data, + success: (res) => { + let newres = dataModelChange.voToJson(res); + + let nowTableData = this.props.editTable.getAllData(window.presetVar.listArea); + let nowRows = nowTableData.rows.concat(newres.sscwtgx.rows); + nowTableData.rows = nowRows; + + this.props.editTable.setTableData(window.presetVar.listArea, nowTableData); + this.setState({ showModal: false }); + this.props.form.EmptyAllFormValue([window.presetVar.sscwtgx_form]); + } + }) + } + } +} + +/** + * @Author:gaoymf + * @Description:表单取消 + * @Date: 16:12 2018/5/13 + * @param: + */ +let addFormCancel = function() { + this.setState({ showModal: false }); + this.props.form.EmptyAllFormValue([window.presetVar.sscwtgx_form]); +} + + +/** + * @Author:gaoymf + * @Description:重置任务 + * @Date: 16:12 2018/5/14 + * @param: + */ +let resetTask = function() { + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + fieldid: 'reset', + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0077'),//"重置任务" + content: multiLang && multiLang.get('701001RWCL-0073'),//该操作会重置任务,请确定? + beSureBtnClick: ()=>{ + requestApi.resetTask({ + data: { + pk_sscunit : this.state.SSCCenter.refpk + }, + success: (res) => { + //701001RWCL-0075:重置完成,已重置,701001RWCL-0076:条任务 + //NCMessage.create({ content: (multiLang && multiLang.get('701001RWCL-0075'))+res.resetnum+(multiLang && multiLang.get('701001RWCL-0076')), color: 'success', position: 'bottomRight' }); + toast({ content: (multiLang && multiLang.get('701001RWCL-0075'))+res.resetnum+(multiLang && multiLang.get('701001RWCL-0076')), color:"success"}); + }, + error: (res) => { + console.log(res.message); + } + }) + } + }) +} + +/** + * @Author:gaoymf + * @Description:导航条点击 + * @Date: 16:12 2018/9/15 + * @param: + */ + +let handleTruncation = function(){ + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'), //"提示信息" + content: multiLang && multiLang.get('701001RWCL-0074'),//此操作会丢失本次修改,请确定? + beSureBtnClick: ()=>{ + this.refs.nav.linkByClickedIdx(); + } + }) +} + + +export default { afterEdit, beforeSave, afterSave, afterCancel, batchDelete, addClick, addFormSave, addFormCancel, resetTask,handleTruncation } +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/dataModelChange.js b/src/ssctpaaa/sscsetting/clientage/config/events/dataModelChange.js new file mode 100644 index 0000000..ad0996d --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/dataModelChange.js @@ -0,0 +1,25 @@ +/*Ri21IHu7A9hiIXn8PEqtajpiLnIiLte2KGIwfkD1+GA=*/ +let jsonToVo = (data) =>{ + data[window.presetVar.listArea].rows.map((one)=>{ + if(one.values.enablestate.value == true){ + one.values.enablestate.value=2; + }else{ + one.values.enablestate.value=3; + } + }) + return data; +} + +let voToJson = (data) =>{ + data[window.presetVar.listArea].rows.map((one)=>{ + if(one.values.enablestate.value == 2){ + one.values.enablestate={value:true}; + }else{ + one.values.enablestate={value:false}; + } + }) + return data; +} + +export default {jsonToVo, voToJson} +/*Ri21IHu7A9hiIXn8PEqtajpiLnIiLte2KGIwfkD1+GA=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/fixedTemplet.js b/src/ssctpaaa/sscsetting/clientage/config/events/fixedTemplet.js new file mode 100644 index 0000000..09f1b84 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/fixedTemplet.js @@ -0,0 +1,83 @@ +/*QqOYif2dFZXT39A6hY82WQIEANXc0ECdakPiQJg68d0=*/ +export default { + button:[ + /* { + "area": 'btnArea', + "children":[ + { + "area":"listhead", + "children":[], + "id": "0001A41000000006J5B1", + "isenable":true, + "iskeyfunc":null, + "key":"Add", + "order":"0", + "parentCode":"head_group", + "title": "新增", + "type": "button_main" + }, + { + "area":"listhead", + "children":[], + "id": "0001A41000000006J5B2", + "isenable":true, + "iskeyfunc":null, + "key":"Edit", + "order":"1", + "parentCode":"head_group", + "title": "修改", + "type": "button_secondary" + }, + ], + "id": "1001ZG10000000000X4G", + "isenable":true, + "iskeyfunc":null, + "key":"head_group", + "order":"0", + "parentCode":null, + "title": "head_group", + "type": "buttongroup" + }, + { + "id": "0001A41000000006J5B1", + "type": "button_secondary", + "key": "Reset", + "title": "重置任务", + "area": 'btnArea', + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "Save", + "title": "保存", + "area": 'btnArea', + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_secondary", + "key": "Cancel", + "title": "取消", + "area": 'btnArea', + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_secondary", + "key": "BatchDelete", + "title": "删除", + "area": 'btnArea', + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "Delete", + "title": "删除", + "area": 'listbtnarea', + "children": [] + }*/ + ], +} +/*QqOYif2dFZXT39A6hY82WQIEANXc0ECdakPiQJg68d0=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/index.js b/src/ssctpaaa/sscsetting/clientage/config/events/index.js new file mode 100644 index 0000000..1dae864 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/index.js @@ -0,0 +1,9 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import afterEvent from './afterEvent'; +import selectedChangeEvent from './selectedChangeEvent'; +import buttonClick from './buttonClick'; +import initTemplate from './initTemplate'; +import query from './query'; +import tableExtendButtonClick from './tableExtendButtonClick'; +export { afterEvent,selectedChangeEvent, buttonClick, initTemplate, tableExtendButtonClick, query }; +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/initTemplate.js b/src/ssctpaaa/sscsetting/clientage/config/events/initTemplate.js new file mode 100644 index 0000000..5bdb501 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/initTemplate.js @@ -0,0 +1,84 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import 'ssccommon/components/globalPresetVar'; +import {getMultiLang} from 'nc-lightapp-front' +import {query} from './index.js' + +export default function(props) { + const that = this + //变量设置规范 + window.presetVar = { + ...window.presetVar, + pageId: '700102WTGX_L', + sscwtgx_form:'sscwtgx_form', + listArea: 'sscwtgx', + btnArea: 'btnArea', + listBtnArea: 'listbtnarea' + }; + props.createUIDom({ + // pagecode: this.state.showModal == true ? window.presetVar.wtgx_form:window.presetVar.pageId, //页面id + // appid: ' ' //注册按钮的id + }, + (data)=>{ + getMultiLang({moduleId: 7010, domainName: 'ssctp',currentLocale: 'zh-CN', callback: (json) => { + //createUIDom第一次加载是异步加载,以后F5刷新会走缓存 + // window.setTimeout(() => { + let meta = data.template; + let obj = {}; + meta['sscwtgx'].items.find( (item) => { + if (item.visible && item.attrcode != "enablestate") { + obj[item.attrcode] = item.label + } + if (item.attrcode == "enablestate") { + item.onPopconfirmCont = json['701001RWCL-0189'] + item.offPopconfirmCont = json['701001RWCL-0190'] + } + }); + this.json = obj; + //设置新增form编辑态 + meta[window.presetVar.sscwtgx_form].status = 'edit'; + //设置区域模板 + props.meta.setMeta(meta); + //设置按钮模板 + props.button.setButtons(data.button); + meta.sscwtgx_form.items.find((item)=>{ + if(item.attrcode === "pk_org"){ + item.isShowUnit = true; + item.isMultiSelectedEnabled = true; + item.unitProps = { + placeholder: json['701001RWCL-0078'],//701001RWCL-0078:集团(所有) + refName: json['701001RWCL-0078'], + refType: "tree", + refCode: "uapbd.org.GroupDefaultTreeRef", + queryTreeUrl: "/nccloud/uapbd/ref/GroupDefaultTreeRef.do", + rootNode: { refname: json['701001RWCL-0078'], refpk: "root" }, + } + // item.defaultUnitValue={ refname: '123',refpk: '345'} + } + }) + //设置按钮行为为弹窗 + // props.button.setPopContent('Delete','确认要删除该信息吗?') /* 设置操作列上删除按钮的弹窗提示 */ + //设置按钮的初始可见性 + props.button.setButtonVisible(['Add', 'Edit', 'Reset'], true); + // props.button.setButtonVisible(['head_group', 'Reset'], true); + props.button.setButtonVisible(['Save', 'Cancel', 'BatchDelete'], false); + //设置按钮的禁用 + // props.button.setButtonDisabled(['Add', 'Edit', 'Reset'], true); + props.button.setButtonDisabled(['Add', 'Edit', 'Reset'], true); + + // 表格上鼠标移出事件 + Array.from(document.querySelectorAll('.u-table-fixed')).forEach((scrollTarget) => { + scrollTarget.addEventListener('mouseleave', ev => { + // ev = ev || window.event; + if (that.showPopTimer) clearTimeout(that.showPopTimer) + that.setState({show: false}) + that.index = -1 + }) + }) + + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + if(pk_sscunit) query.onSSCCenterChange.call(that, JSON.parse(pk_sscunit)); + }}) + } + ) +} +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/query.js b/src/ssctpaaa/sscsetting/clientage/config/events/query.js new file mode 100644 index 0000000..00574dd --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/query.js @@ -0,0 +1,86 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from "../requestApi"; +import dataModelChange from "./dataModelChange"; +// 查询项对应的pk +function getSearchPkClientage(searchValue){ + let pk_ssclientage = ''; + if(searchValue!==''){ + let pkArr = []; + let tableRows = this.initTableData.rows; + // let tableRows = this.props.editTable.getAllRows(window.presetVar.listArea); + tableRows.filter((row) => { + if (row.values.pk_org.display.indexOf(searchValue) > -1) { + pkArr.push(row.values.pk_ssclientage.value); + } + }) + if(pkArr.length>0){ + pk_ssclientage = pkArr.join(","); + }else { + return '00000000'; + } + } + return pk_ssclientage; +} + + +//共享中心改变事件 +let onSSCCenterChange = function(e) { + this.setState({ SSCCenter: e,searchValue: '',showDisabled:false }, () => { + if (e.hasOwnProperty('refpk')) { + let req = { pk: e.refpk, showDisabled: this.state.showDisabled,searchCondition :"" }; + queryTableData.call(this, req); + } else { + this.props.editTable.setTableData(window.presetVar.listArea, { rows: [] }); + this.props.button.setButtonDisabled(['Add', 'Edit', 'Reset'], true); + } + // 保存共享中心 + this.props.setUrlParam({pk_sscunit: e.hasOwnProperty('refpk') ? JSON.stringify(e) : ''}); + }); +}; +/** + * 显示停用复选框勾选事件 + * @param {*} e + */ +let showDisabledChange = function(e) { + this.setState({ showDisabled: e }); + // 更改状态 + if(this.state.SSCCenter.hasOwnProperty('refpk')){ + //选中共享中心 执行查询 + let pk_ssclientages = getSearchPkClientage.call(this,this.state.searchValue); + let req = { pk: this.state.SSCCenter.refpk, showDisabled: e,searchCondition: pk_ssclientages}; + queryTableData.call(this, req); + } +}; + +/** + * 查询业务单元内容改变事件 + * @param {*} searchValue + */ +let searchTime = null; +let searchAreaChange = function(searchValue) { + this.setState({ searchValue: searchValue }); + + clearTimeout(searchTime); + searchTime = setTimeout(()=>{ + this.props.editTable.setFiltrateTableData(window.presetVar.listArea, ['pk_org', 'pk_org.code'], searchValue, false) + }, 500); +}; + +// 查询表数据 req:请求参数 +let queryTableData = function(req) { + requestApi.queryTableData({ + data: req, + success: res => { + if (res) { + let resNew = dataModelChange.voToJson(res); + this.props.editTable.setTableData(window.presetVar.listArea, resNew[window.presetVar.listArea]); + this.initTableData = resNew[window.presetVar.listArea]; + } else { + this.props.editTable.setTableData(window.presetVar.listArea, { rows: [] }); + } + this.props.button.setButtonDisabled(['Add', 'Edit', 'Reset'], false); + } + }); +}; +export default { onSSCCenterChange, showDisabledChange, searchAreaChange, queryTableData }; +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/selectedChangeEvent.js b/src/ssctpaaa/sscsetting/clientage/config/events/selectedChangeEvent.js new file mode 100644 index 0000000..c3ce536 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/selectedChangeEvent.js @@ -0,0 +1,10 @@ +/*5iXQH/CJwU21aKg9goGu6iyetoLmrB7d3boG2lM1QCw=*/ +export default function selectedChangeEvent(props, moduleId, newVal, oldVal) { + console.log('selectedChangeEvent',props,moduleId,newVal,oldVal); + if(newVal>0){ + props.button.setButtonDisabled(['BatchDelete'], false); + }else { + props.button.setButtonDisabled(['BatchDelete'], true); + } +} +/*5iXQH/CJwU21aKg9goGu6iyetoLmrB7d3boG2lM1QCw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/events/tableExtendButtonClick.js b/src/ssctpaaa/sscsetting/clientage/config/events/tableExtendButtonClick.js new file mode 100644 index 0000000..151ac93 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/events/tableExtendButtonClick.js @@ -0,0 +1,23 @@ +/*ftMVHn90Wklge8LW19nRRZY+V69Lomh4Egnv/oC6QaLjFUOsrhPJCK7CcVE6BSh9*/ +/** + * 表格扩展按钮click事件 + */ +function tableExtendButtonClick() { + return { + ['Delete']: (record, index) => { + this.props.editTable.delRow(window.presetVar.listArea, index); + //退出对应行的tips提示 + if (this.showPopTimer) clearTimeout(this.showPopTimer) + this.setState({ + show: false + }) + this.index = -1 + + const disabled = !(this.props.editTable.getCheckedRows(window.presetVar.listArea).length > 0) + this.props.button.setButtonDisabled({BatchDelete: disabled}) + } + } +} + +export default tableExtendButtonClick; +/*ftMVHn90Wklge8LW19nRRZY+V69Lomh4Egnv/oC6QaLjFUOsrhPJCK7CcVE6BSh9*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/index.js b/src/ssctpaaa/sscsetting/clientage/config/index.js new file mode 100644 index 0000000..0782ca8 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/index.js @@ -0,0 +1,6 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import ClientageDom from './clientage'; +ReactDOM.render( , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/index.less b/src/ssctpaaa/sscsetting/clientage/config/index.less new file mode 100644 index 0000000..140ee37 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/index.less @@ -0,0 +1,58 @@ +.showOff { + // margin-top: 7px; + font-size: 13px; + // font-family: "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "SimSun", "sans-serif"; + color: #333; + margin-left: 6px; +} + +.nc-singleTable-header-area { + border-bottom: 0px solid #edecec !important; +} + +.ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 3px; + margin-top: 10px; +} + +#clientage { + .u-checkbox-label:before { + top: 0; + } + .nc-single-table { + height: 91%; + } + h2.title-search-detail { + margin-right: 20px !important; + font-size: 16px; + font-weight: bold; + color: #111111; + } + + #pop { + padding: 9px 14px; + background: #fff; + border: 1px solid #ccc; + border-radius: 6px; + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + z-index: 100; + transform: scale(0); + transition: .2s; + .popItem { + margin: 10px; + } + } +} + +.ssc_edit_modal_form { + margin-right: 30px; +} + +.combine { + .u-modal-body { + padding-bottom: 88px !important; + } +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/clientage/config/requestApi.js b/src/ssctpaaa/sscsetting/clientage/config/requestApi.js new file mode 100644 index 0000000..c767da5 --- /dev/null +++ b/src/ssctpaaa/sscsetting/clientage/config/requestApi.js @@ -0,0 +1,119 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { ajax } from 'nc-lightapp-front'; + +let requestApiOverwrite = { + // 表模板初始化查询 + tpl: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageTempletAction.do', + data: opt.data, + success: opt.success + }); + }, + // 树节点对应业务节点查询 + queryTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageQueryRelationAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 新增 + add: (opt) => { + opt.data = { + head: opt.data + } + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageAddRelationAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 保存 + save: (opt) => { + opt.data = { + head: opt.data + } + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageSaveRelationAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 保存 + saveForm: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageSaveRelationAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 删除 + del: (opt) => { + opt.data = { + head: opt.data + }; + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageDelRelationAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }); + }, + // 启用 + enable: (opt) => { + // opt.data = { + // head: opt.data + // } + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageEnableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + // 停用 + disabled: (opt) => { + // opt.data = { + // head: opt.data + // } + ajax({ + url: '/nccloud/ssctp/sscbd/ClientageDisableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }); + }, + // 重置任务 + resetTask: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskResetNoApproveTaskAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + } +} + +export default requestApiOverwrite; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/dispatchrules.js b/src/ssctpaaa/sscsetting/dispatchrules/config/dispatchrules.js new file mode 100644 index 0000000..48a0c94 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/dispatchrules.js @@ -0,0 +1,154 @@ +/*Xa1LAZ6Zd2wpAYFNLMjJrugggzKuA+iaoGGpNW+y87o=*/ +import React, { Component } from "react"; +import { createPage, base, createPageIcon } from "nc-lightapp-front"; +import { initTemplate, buttonClick, afterEvent, query } from "./events"; +import Drawformlist from "./drawFormList" +import { Nav } from "ssccommon/components/global-nav"; +import "./index.less"; +import './index.css' +import SSCCenterRef from "../../../refer/sscbd/SSCUnitGridRef"; +import { + ProfileStyle, + ProfileHead, + ProfileBody, + ButtonGroup, + HeadCenterCustom, + ProfileSearch, + NonstandardButtonGroup +} from 'ssccommon/components/profile'; + +const { NCModal, NCButton, NCCheckbox, NCDiv } = base; + +class Dispatchrules extends Component { + constructor(props) { + super(props); + this.props = props; + this.formModalId = "formModal"; // 新增/编辑modal关闭 + this.formId = "dispatchrule_form"; // 新增表单组件模板id + this.billtypeTableId = "billtypelist"; // 单据类型表格模板 + this.credit = '';//是否启用信用 + this.pk = []; //选中规则的pk + this.pk1 = ''; + this.creditState = '';//是否启用信用 + this.state = { + data: [], + SSCCenter: {}, + showDisabled: false, // 显示停用 + enablestate: [],//管理每条规则的启用停用共享中心的状态 + checked: [], + implementDisabled: true,//立即执行按钮状态 + addDisabled: true, //新增按钮状态 + editFormValues: {}, + showFormModal: false, // 新增/编辑表单模态显示 + }; + initTemplate.call(this, props); + } + + // 页面加载 + componentDidMount() { + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + setTimeout(() => { + pk_sscunit && query.onSSCCenterChange.call(this, JSON.parse(pk_sscunit)); + }, 300); + } + + render() { + let { + form: { createForm } + } = this.props; + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + return ( +
+
+ ); + } +} + +Dispatchrules = createPage({ + mutiLangCode: '7010' +})(Dispatchrules); +export default Dispatchrules; + +/*Xa1LAZ6Zd2wpAYFNLMjJrugggzKuA+iaoGGpNW+y87o=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/drawFormList.js b/src/ssctpaaa/sscsetting/dispatchrules/config/drawFormList.js new file mode 100644 index 0000000..a078081 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/drawFormList.js @@ -0,0 +1,316 @@ +/*XhWoruwxb5VE9PaqcFXglwML/zDq6k9SWGdwYRnnpZw=*/ +import React, { Component } from "react"; +import gxicon1 from "../../../public/image/gxicon1.png"; +import gxicon2 from "../../../public/image/gxicon2.png"; +import gxicon3 from "../../../public/image/gxicon3.png"; +import gxicon4 from "../../../public/image/gxicon4.png"; +import gxicon5 from "../../../public/image/gxicon5.png"; +import requestApi from "./requestApi"; +import {initConfig} from './events/afterEvent' +import { createPage, base, createPageIcon, toast, getTheme } from "nc-lightapp-front"; + +const { NCPopconfirm, NCTableSwitch, NCCheckbox, NCModal, NCFormControl, NCDiv } = base; + +class Drawformlist extends Component { + constructor(props) { + super(props); + this.props = props; + this.parent = props.parent; + this.formId = "dispatchrule_form"; // 新增表单组件模板id + this.billtypeTableId = "billtypelist"; // 单据类型表格模板 + this.tranctionTableId = "tradetypelist"; // 交易类型表格模板 + this.groupTableId = "orglist"; // 单位范围表格模板 + this.detailModalId = "detailModal"; // 详情modal + this.state = { + data: [], + editFormPk: "", // 当前编辑的form的pk + enablestate: true, + showDetailModal: false, // 详细表格显示 [单位范围,交易类型,单据类型] + modalType: {}, // 控制显示全部模态内容显示 控制显示 [单位范围,交易类型,单据类型] + checked: false, + isBlackTheme: null + } + getTheme().then((theme) => { + this.setState({ + isBlackTheme: theme == 'black' + }) + }) + } + + // 删除表单 + delForm = (values) => { + let data = { + pk_intellidispatchrule: values.pk_intellidispatchrule.value, + ts: values.ts.value, + } + requestApi.delFormData({ + data: data, + success: res => { + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + this.deleteByRow(values.pk_intellidispatchrule.value); + // "701001RWCL-0042": "删除成功" + toast({ title: multiLang && multiLang.get('701001RWCL-0042') }) + + } + }); + }; + // 修改表单 + editForm = (values) => { + this.parent.setState({ showFormModal: true}); + let newValues = JSON.parse(JSON.stringify(values)); + this.parent.props.form.setAllFormValue({ [this.formId]: { rows: [{values: newValues}]}}); + initConfig.call(this.parent, this.parent.props); + }; + + + updateByRow = (data) => { + let values = data && data.dispatchrule_form && data.dispatchrule_form.rows && data.dispatchrule_form.rows[0] && data.dispatchrule_form.rows[0].values; + let pageData = this.parent.state.data; + if(pageData && values){ + pageData.find((item, index) => { + let valuesOne = item.dispatchrule_form.rows[0].values; + if(valuesOne.pk_intellidispatchrule.value == values.pk_intellidispatchrule.value){ + item.dispatchrule_form.rows[0].values = values; + this.parent.setState({data: pageData}); + return; + } + }); + } + } + + deleteByRow=(pk_intellidispatchrule)=>{ + let pageData = this.parent.state.data; + pageData.find((item, index) => { + if (item) { + let valuesOne = item.dispatchrule_form.rows[0].values; + if(valuesOne.pk_intellidispatchrule.value == pk_intellidispatchrule){ + pageData.splice(index, 1); + this.parent.setState({data: pageData}); + return; + } + } + }); + } + + //启用停用审批规则 + onChange = (values) => { + // 请求启用/停止 + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + requestApi.enableSSCUnit({ + data: { + pk_intellidispatchrule: values.pk_intellidispatchrule.value, + ts: values.ts.value + }, + success: res => { + this.updateByRow(res); + if (values.enablestate.value === '3') { + toast({ title: multiLang && multiLang.get('7010-0014') }) + } else { + toast({ title: multiLang && multiLang.get('7010-0015') }) + } + } + }); + }; + // 渲染模态详情 + drawDetailModelContent = () => { + let { createEditTable } = this.parent.props.editTable; + switch (this.state.modalType.value) { + case this.tranctionTableId: + return createEditTable(this.tranctionTableId, { + showIndex: true + }); + case this.billtypeTableId: + return createEditTable(this.billtypeTableId, { + showIndex: true + }); + case this.groupTableId: + return createEditTable(this.groupTableId, { + showIndex: true + }); + } + }; + + // 关闭指定modal + closeModal(key) { + switch (key) { + case this.detailModalId: + this.setState({ showDetailModal: false }); + break; + } + } + + render() { + let formList = []; + let imgList = [gxicon1, gxicon2, gxicon3, gxicon4, gxicon5]; + let multiLang = this.parent.props.MutiInit.getIntl(7010); //this.moduleId + let detailModalContent = this.drawDetailModelContent(); + this.parent.state.data && this.parent.state.data.map((item, index) => { + item = item.dispatchrule_form.rows[0]; + // 处理作业组 + let showWorkgroup = item.values.pk_managelevel.value == '10' ? true : false; + let workgroupArrStr = ''; + if (showWorkgroup) { + let workgroupArr = item.values.workgroup && (item.values.workgroup.display ? item.values.workgroup.display.split(",") : (item.values.workgroup.value ? item.values.workgroup.value.split(",") : '')); + // let displayArr = workgroupArr.slice(0, 3); // 默认显示3个 + workgroupArrStr = workgroupArr && workgroupArr.join(" ; "); + } + formList.push( + +
+
+ + + {/*"700108PDGZ-001": "规则编码"*/} + {/*"700108PDGZ-002": "规则名称",*/} + + {index + 1}. + {multiLang && multiLang.get('700108PDGZ-001') + ':' + item.values.code.value} + + {(multiLang && multiLang.get('700108PDGZ-002')) + ':' + (item.values.name.display ? item.values.name.display : item.values.name.value)} + + + + {/*"700108PDGZ-008": "确定启用派单规则",*/} + {/*"700108PDGZ-009": "确定停用派单规则"*/} + { + this.onChange(item.values); + }} + > + + + + + + { + this.editForm(item.values); + }} + >{/*"700108PDGZ-010": "修改"*/} + {multiLang && multiLang.get('700108PDGZ-010')} + + + {/*"700108PDGZ-011": "确认删除?"*/} + { + this.delForm(item.values); + }} + > + {/*"700108PDGZ-012": "删除",*/} + {item.values.enablestate.value === '1' ? '' : multiLang && multiLang.get('700108PDGZ-012')} + + + +
+
+ {/*"700108PDGZ-003": "按工作日历派单",*/} + {/*"7010-0011": "是",*/} + {/*"7010-0012": "否",*/} +
+ + {multiLang && multiLang.get('700108PDGZ-003') + ':'} + + + {item.values.enablecalendar && item.values.enablecalendar.value ? (multiLang && multiLang.get('7010-0011')) : (multiLang && multiLang.get('7010-0012'))} + +
+ {/*"700108PDGZ-004": "工作日历",*/} +
+ {multiLang && multiLang.get('700108PDGZ-004') + ':'} + {item.values.pk_workcalendar && (item.values.pk_workcalendar.display ? item.values.pk_workcalendar.display : item.values.pk_workcalendar.value)} +
+ {/*"700108PDGZ-005": "任务分配规则",*/} +
+ {multiLang && multiLang.get('700108PDGZ-005') + ':'} + {item.values.dispatchtype && (item.values.dispatchtype.display ? item.values.dispatchtype.display : item.values.dispatchtype.value)} +
+
+
+ {/*"700108PDGZ-006": "管理层级",*/} +
+ {multiLang && multiLang.get('700108PDGZ-006') + ':'} + {item.values.pk_managelevel && (item.values.pk_managelevel.display ? item.values.pk_managelevel.display : item.values.pk_managelevel.value)} +
+ {/*"700108PDGZ-007": "作业组范围",*/} + {/*"700108PDGZ-013": "【查看全部】",*/} + {showWorkgroup ? +
+ {multiLang && multiLang.get('700108PDGZ-007')}: + {workgroupArrStr} + {/* + {workgroupArrStr ? multiLang && multiLang.get('700108PDGZ-007') : ''} + */} +
+ : null} +
+
+ {/*"700108PDGZ-006": "派单阈值",*/} +
+ + {multiLang && multiLang.get('700108PDGZ-016') + ':'} + + + { + item.values.limitnumber + && item.values.limitnumber.value + } + +
+
+
+
+ ); + }); + return ( + + {formList} + {/*显示全部modal*/} + { + this.closeModal(this.detailModalId) + }} + backdrop={false} + > + + {this.state.detailModalTitle} + + + {detailModalContent} + + + + ); + } +} + +export default Drawformlist; +/*XhWoruwxb5VE9PaqcFXglwML/zDq6k9SWGdwYRnnpZw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/dispatchrules/config/events/afterEvent.js new file mode 100644 index 0000000..3983954 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/events/afterEvent.js @@ -0,0 +1,42 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ + +export default function afterEvent(props, moduleId, key, changedrows, value, index, data) { + + switch (key) { + case 'pk_managelevel': // 管理层级 + if (changedrows.value == '10') { + // 作业组 + props.form.setFormItemsDisabled(this.formId, { workgroup: false }); + props.form.setFormItemsRequired(this.formId, { workgroup: true }); + } else { + props.form.setFormItemsDisabled(this.formId, { workgroup: true }); + props.form.setFormItemsValue(this.formId, { workgroup: {value: '', display: ''} }); + props.form.setFormItemsRequired(this.formId, { workgroup: false }); + } + break; + case 'enablecalendar': // 是否按工作日历 + if (changedrows.value) { + // 作业组 + props.form.setFormItemsDisabled(this.formId, { pk_workcalendar: false }); + props.form.setFormItemsRequired(this.formId, { pk_workcalendar: true }); + } else { + props.form.setFormItemsDisabled(this.formId, { pk_workcalendar: true }); + props.form.setFormItemsValue(this.formId, { pk_workcalendar: {value: '', display: ''} }); + props.form.setFormItemsRequired(this.formId, { pk_workcalendar: false }); + } + break; + } +}; +/** + * 初始化页面状态 + * @param {*} props + */ +export function initConfig(props) { + // 管理层级 + let pk_managelevel = props.form.getFormItemsValue(this.formId, 'pk_managelevel'); + // 是否按工作日历 + let enablecalendar = props.form.getFormItemsValue(this.formId, 'enablecalendar'); + afterEvent.call(this, props, this.formId, 'pk_managelevel', pk_managelevel); + afterEvent.call(this, props, this.formId, 'enablecalendar', enablecalendar); +} +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/dispatchrules/config/events/buttonClick.js new file mode 100644 index 0000000..4577bbe --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/events/buttonClick.js @@ -0,0 +1,107 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from "../requestApi"; +import { toast, getTheme } from "nc-lightapp-front"; + +import {initConfig} from './afterEvent' + +// 是否暗黑主题 +let isBlackTheme = null; +getTheme().then((theme) => { + isBlackTheme = theme == 'black'; +}) + +/** + * 新增按钮点击 + */ +let addButtonClick = function () { + // this.pk=""; + this.props.form.EmptyAllFormValue([this.formId]); + this.setState({ showFormModal: true, editFormPk: "" }, () => { + initConfig.call(this, this.props); + }); +}; +/** + * 保存按钮点击 + */ +let saveFormButtonClick = function () { + let formData = this.props.form.getAllFormValue(this.formId); + let multiLang = this.props.MutiInit.getIntl(7010); + if (!this.props.form.isCheckNow(this.formId)) { + return; + } + let approvalrulesForm = { head: formData }; + if (this.state.SSCCenter.refpk) { + // 更新共享中心 + approvalrulesForm.head.rows[0].values.pk_sscunit = { value: this.state.SSCCenter.refpk }; + // 更新前后端不一致内容 + approvalrulesForm.head.rows[0].values.dispatchlimit.value ? approvalrulesForm.head.rows[0].values.dispatchlimit.value = 'Y' : approvalrulesForm.head.rows[0].values.dispatchlimit.value = 'N'; + approvalrulesForm.head.rows[0].values.enablecalendar.value ? approvalrulesForm.head.rows[0].values.enablecalendar.value = 'Y' : approvalrulesForm.head.rows[0].values.enablecalendar.value = 'N'; + approvalrulesForm.head.rows[0].values.enablestate.value = '2'; + + //根据是否有pk判断是新增保存或修改保存 + if (approvalrulesForm.head.rows[0].values.pk_intellidispatchrule.value) { + let pk = approvalrulesForm.head.rows[0].values.pk_intellidispatchrule.value; + requestApi.updateFormData({ + data: approvalrulesForm, + success: res => { + updateByRow.call(this,res, pk); + } + }) + } else { + requestApi.saveFormData({ + data: approvalrulesForm, + success: res => { + updateByRow.call(this,res); + } + }) + } + } else { + // "701004SPGZ_004": "请选择共享中心" + toast({ + duration: 2, // 消失时间,默认是3秒; 值为 infinity 时不消失,非必输 + color: 'danger', // 提示类别,默认是 "success",非必输 + content: multiLang && multiLang.get('701004SPGZ_004') // 提示内容,非必输 + }) + } +}; +/** + * 取消按钮点击 + */ +let cancelFormButtonClick = function () { + this.setState({ showFormModal: false }); + this.props.form.EmptyAllFormValue([this.formId]); +}; + +let updateByRow = function (data, pk) { + let values = data && data.dispatchrule_form && data.dispatchrule_form.rows && data.dispatchrule_form.rows[0] && data.dispatchrule_form.rows[0].values; + let pageData = this.state.data; + if (values) { + if (!pageData) pageData = [] + let find = pageData.find((item, index) => { + let valuesOne = item.dispatchrule_form.rows[0].values; + if ((pk && pk == valuesOne.pk_intellidispatchrule.value) || valuesOne.pk_intellidispatchrule.value == values.pk_intellidispatchrule.value) { + item.dispatchrule_form.rows[0].values = values; + return true; + } + }); + if(!find){ + pageData.push({ + dispatchrule_form: { + rows:[ + { + values:values + } + + ] + } + }); + } + this.setState({ data: pageData, }); + initConfig.call(this, this.props); + } + this.setState({showFormModal: false}) +} + +export default { addButtonClick, saveFormButtonClick, cancelFormButtonClick }; + +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/events/index.js b/src/ssctpaaa/sscsetting/dispatchrules/config/events/index.js new file mode 100644 index 0000000..a636aa6 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/events/index.js @@ -0,0 +1,14 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick'; +import afterEvent from './afterEvent'; +import initTemplate from './initTemplate'; + +import query from './query' + +export { initTemplate,buttonClick, afterEvent,query}; + + + + + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/events/initTemplate.js b/src/ssctpaaa/sscsetting/dispatchrules/config/events/initTemplate.js new file mode 100644 index 0000000..83ecebb --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/events/initTemplate.js @@ -0,0 +1,39 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { getMultiLang } from 'nc-lightapp-front'; +import requestApi from "../requestApi"; + +export default function (props) { + const _this = this + props.createUIDom( + {}, + (data) => { + //获取多语 + getMultiLang({ + moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: (json) => { + let meta = data.template; + //根据单据类型过滤交易类型 + meta.dispatchrule_form.items.find((item) => { + // 作业组 + if (item.attrcode == 'workgroup') { + item.onlyLeafCanSelect = true + item.queryCondition = () => { + return { pk_sscunit: this.state.SSCCenter.refpk }; + } + } + // 工作日历 + if (item.attrcode == 'pk_workcalendar') { + item.queryCondition = () => { + let workCanlendarRefBuilder = 'nccloud.web.ssctp.report.sqlbuilder.WorkCalendarRefBuilder'; + return { pk_sscunit: this.state.SSCCenter.refpk, GridRefActionExt: workCanlendarRefBuilder }; + } + } + }) + // 设置表格编辑态 + meta["dispatchrule_form"].status = 'add'; + props.meta.setMeta(meta); + } + }) + }) +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/events/query.js b/src/ssctpaaa/sscsetting/dispatchrules/config/events/query.js new file mode 100644 index 0000000..64903a9 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/events/query.js @@ -0,0 +1,122 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from '../requestApi' + + +/** + * @Description:显示停用勾选 + * @param: + */ +let showDisabledChange = function(e) { + this.setState({ showDisabled: e }); + if (this.state.SSCCenter.refpk) { + if (e) { + requestApi.ApproveRuleQry({ + data: { pk_sscunit: this.state.SSCCenter.refpk, enablestate: e ? '3': '2'}, + success: res => { + this.setState({ + data: res + }); + } + }); + }else{ + requestApi.ApproveRuleQry({ + data: { pk_sscunit: this.state.SSCCenter.refpk, enablestate: e ? '3': '2'}, + success: res => { + this.setState({ + data: res + }); + } + }); + } + } + +} + +/** + * @Description:查询单位明细范围 + * @param: + */ +let queryGroupDetails = function(item) { + let multiLang = this.parent.props.MutiInit.getIntl(7010); + let detailModalTitle = multiLang && multiLang.get('701001RWCL-0102'); + requestApi.queryGroupDetailTableData({ + data: { group: item.values.pk_org.value }, + success: (res) => { + //701001RWCL-0102:单位范围 + this.setState({detailModalTitle: detailModalTitle, showDetailModal: true, searchValue: '', modalType: { display: detailModalTitle, value: this.groupTableId } }); + this.parent.props.editTable.setTableData(this.groupTableId, res[this.groupTableId]); + } + }) + +} +/** + * @Description:查询交易类型/单据类型明细 + */ + +let queryBillTypeDetails = function(item, key) { + let multiLang = this.parent.props.MutiInit.getIntl(7010); + let detailModalTitle = null; + switch (key) { + case this.tranctionTableId: + detailModalTitle = multiLang && multiLang.get('701001RWCL-0103') //交易类型 + requestApi.queryDetailTableData({ + data: { billtype: item.values.pk_billtype.value, type: this.tranctionTableId }, + success: (res) => { + //multiLang && multiLang.get('701001RWCL-0103'):交易类型 + this.setState({detailModalTitle: detailModalTitle, showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0103'), value: this.tranctionTableId } }); + this.parent.props.editTable.setTableData(key, res[this.tranctionTableId]); + } + }) + break; + case this.billtypeTableId: + detailModalTitle = multiLang && multiLang.get('701001RWCL-0104') //单据类型 + requestApi.queryDetailTableData({ + data: { billtype: item.values.pk_billtype.value, type: this.billtypeTableId }, + success: (res) => { + //multiLang && multiLang.get('701001RWCL-0104'):单据类型 + this.setState({detailModalTitle: detailModalTitle, showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0104'), value: this.billtypeTableId } }); + this.parent.props.editTable.setTableData(key, res[this.billtypeTableId]); + } + }) + break; + } +} +/** + * @Description:查询详细信息 + * @param: + */ +let queryDetailTable = function(searchValue) { + let filterKey = []; + // 单据类型/交易类型查询 billtypename 单位范围查询name + this.state.modalType.value == this.groupTableId ? filterKey.push('name') :filterKey.push('billtypename') + this.props.editTable.setFiltrateTableData(this.state.modalType.value, filterKey, searchValue, false) +} + +/** + * 获取共享中心 + * + * */ +let onSSCCenterChange = function(ssc) { + if (ssc.hasOwnProperty('refpk')) { + // 选中操作 + this.setState({ + SSCCenter: ssc + }); + this.setState({addDisabled: false}); + requestApi.ApproveRuleQry({ + data: { pk_sscunit: ssc.refpk, enablestate: this.state.showDisabled ? '3': '2'}, + success: (data) => { + console.log(data) + this.setState({ + data: data + }); + } + }) + } else { + this.setState({ SSCCenter: {},data: [], addDisabled: true }); + } + // 保存共享中心 + this.props.setUrlParam({pk_sscunit: ssc.hasOwnProperty('refpk') ? JSON.stringify(ssc) : ''}); +} +export default { onSSCCenterChange, showDisabledChange, queryGroupDetails, queryBillTypeDetails, queryDetailTable } +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/index.css b/src/ssctpaaa/sscsetting/dispatchrules/config/index.css new file mode 100644 index 0000000..557f6b5 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/index.css @@ -0,0 +1,8 @@ +#dispatchrules .itemText { + min-width: 170px; + max-width: calc(50% - 48px); +} + +#dispatchrules .head-label { + width: calc(100% - 194px); +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/index.js b/src/ssctpaaa/sscsetting/dispatchrules/config/index.js new file mode 100644 index 0000000..df49f3a --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React from 'react'; +import ReactDOM from 'react-dom'; +import Dispatchrules from './dispatchrules'; +ReactDOM.render( + , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/index.less b/src/ssctpaaa/sscsetting/dispatchrules/config/index.less new file mode 100644 index 0000000..91fb6b8 --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/index.less @@ -0,0 +1,189 @@ +@import "~base"; +#dispatchrules { + .title-search-detail { + margin-right: 25px; + } +} + +.container { + .itemText { + display: inline-block; + margin-right: 10px; + text-overflow: ellipsis; + overflow: hidden; + // min-width: 170px; + // max-width: calc(50% - 48px); + } + .img { + position: absolute; + width: 30px; + height: 30px; + left: -45px; + margin: 5px 7px 0 0; + } + .billTypeName { + display: inline-block; + width: 600px; + } + .unitscope { + display: inline-block; + width: 300px; + } +} + +.content-wrap { + min-height: calc(100% - 12px); + background: rgba(255, 255, 255, 1); + box-shadow: 0px 1px 1px 0px rgba(74, 81, 93, 0.1); + border-radius: 3px; + .ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 3px; + margin-top: 10px; + } +} + +.content-wrap .rule-list-wrap { + padding-top: 20px; +} + +.content-wrap .ssc-form { + margin-bottom: 10px; + margin-left: 40px; + margin-right: 240px; + width: auto; + min-height: 150px; + background: rgba(255, 255, 255, 1); + //box-shadow:0px 1px 2px 0px rgba(200,200,200,0.5); + border-radius: 4px; + border: 1px solid rgba(206, 206, 206, 0.75); + + .head-grow { + width: 100%; + height: 40px; + font-size: 17px; + font-family: PingFangSC-Medium; + color: rgba(17, 17, 17, 1); + line-height: 40px; + background-color: #f3f3f3; + margin-bottom: 10px; + display: flex; + align-items: center; + + img { + position: inherit; + left: 0; + margin: 0 15px 5px 50px; + } + + .head-label { + white-space: nowrap; + height: 40px; + // width: calc(100% - 194px); + } + .head-label span { + font-size: 14px; + } + .head-btn { + padding-right: 30px; + white-space: nowrap; + + .btn { + margin-left: 22px; + font-size: 14px; + font-family: PingFangHK-Regular; + color: #007ACE; + line-height: 21px; + cursor: pointer; + outline: none; + } + } + span.customer-label[aria-describedby="delConfirmId"] { + color: #007ACE; + } + } + + .grow { + margin-bottom: 11px; + width: 100%; + height: auto; + font-size: 13px; + font-family: MicrosoftYaHei; + line-height: 21px; + position: relative; + padding: 0 53px; + .column-1-1 { + width: 100% + } + .grow-label-name { + //float:left; + width: 120px; + margin-right: 2px; + display: inline-block; + height: 21px; + text-align: right; + color: rgba(85, 85, 85, 1); + } + .label-value-all { + cursor: pointer + } + } +} + +.ssc_edit_modal_form { + margin-right: 30px; +} + +.u-switch { + display: inline-block !important; +} + +.checkBox { + position: absolute; + top: 2px; + left: 20px; + +} + +//针对新增弹框特殊设计的样式 +#rule { + .nc-scrollElement-wrap { + margin-bottom: 25px; + } + .icon-shouqi { + display: none; + } + .form-item { + margin-top: 30px; + } + .operator { + .name { + //color: rgba(17,17,17,1); + font-weight: 500; + font-size: 13px; + margin-left: 8px; + outline: none; + } + a { + display: none; + } + } + .line-wrap:hover { + background-color: rgba(0, 0, 0, 0); + } + .line { + height: 1px; + padding-top: 2px; + margin-top: 5px; + color: #D9D9D9; + } + .u-modal-combine-body{ + padding-left: 30px; + } +} + + + + diff --git a/src/ssctpaaa/sscsetting/dispatchrules/config/requestApi.js b/src/ssctpaaa/sscsetting/dispatchrules/config/requestApi.js new file mode 100644 index 0000000..9c5737e --- /dev/null +++ b/src/ssctpaaa/sscsetting/dispatchrules/config/requestApi.js @@ -0,0 +1,133 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax} from 'nc-lightapp-front'; + +let requestApi = { + + //单据模板接口 + tpl: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitTempletAction.do', + data: opt.data, + success: opt.success + }); + }, + + //信用是否启用查询接口 + query:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscapv/CreditStateAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + //根据共享中心查询 + ApproveRuleQry: (opt) => { + ajax({ + url: '/nccloud/ssctp/dispatchrule/DispatchRuleQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 保存表单 + saveFormData:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/dispatchrule/DispatchRuleAddAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 修改规则 + updateFormData:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/dispatchrule/DispatchRuleUpdateAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + //立即执行 + immediateExecution:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/sscapv/SSCApproveRuleExecuteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + // 删除表单 + delFormData:(opt)=>{ + ajax({ + url: '/nccloud/ssctp/dispatchrule/DispatchRuleDeleteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + //停用 + disableSSCUnit:(opt) => { + ajax({ + url: '/nccloud/ssctp/dispatchrule/DispatchRuleEnableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + //启用 + enableSSCUnit:(opt) => { + ajax({ + url: '/nccloud/ssctp/dispatchrule/DispatchRuleEnableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + // 查询单位范围详细 + queryGroupDetailTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/OrgsQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + // 查询交易类型/单据类型详细 + queryDetailTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/BillTypeQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + +} +export default requestApi; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/afterEvent.js new file mode 100644 index 0000000..468f8ae --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/afterEvent.js @@ -0,0 +1,7 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +export default function (props, id, key, value, data, index) { + if (key === 'isdefault') { + props.editTable.setColValueByData(id, key, { value: false }, index) + } +} +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/buttonClick.js new file mode 100644 index 0000000..926b8ab --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/buttonClick.js @@ -0,0 +1,74 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from '../requestApi' +let pageProps = null; +function pageBtnsCtrl(active) { + switch (active) { + case 'save' : + case 'cancel' : + pageProps.button.setButtonsVisible({ + saveButton: false, + cancelButton: false, + editButton: true, + addButton: true, + delButton: true + }); + break; + default: + pageProps.button.setButtonsVisible({ + saveButton: true, + cancelButton: true, + editButton: false, + addButton: false, + delButton: false + }); + break; + + } +} + +export default function buttonClick(props, id) { + pageProps = props; + switch (id) { + case 'editButton': + props.editTable.setStatus(window.bodyCode, 'edit'); + pageBtnsCtrl(null); + break; + case 'addButton': + pageBtnsCtrl(null); + props.editTable.addRow(window.bodyCode); + break; + case 'delButton': + let rows = props.table.getCheckedRows(window.bodyCode); + if (rows.length) { + props.editTable.delRow(window.bodyCode, rows[0].index); + let reqData = props.editTable.getAllData(window.bodyCode); + requestApi.save({ + data: reqData, + success: (data) => { + data && this.props.editTable.setTableData(window.bodyCode, data[window.bodyCode]); + } + }); + } + break; + case 'saveButton': + let reqData = props.editTable.getAllData(window.bodyCode); + requestApi.save({ + data: reqData, + success: (data) => { + pageBtnsCtrl('save'); + props.editTable.setStatus(window.bodyCode, 'browse'); + data && this.props.editTable.setTableData(window.bodyCode, data[window.bodyCode]); + } + }); + break; + case 'cancelButton': + props.editTable.setStatus(window.bodyCode, 'browse'); + pageBtnsCtrl('cancel'); + break; + default: + break; + } +} + + +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/events/index.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/index.js new file mode 100644 index 0000000..b114fac --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/index.js @@ -0,0 +1,8 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick'; +import initTemplate from './initTemplate'; +import afterEvent from './afterEvent'; +import tableModelConfirm from './tableModelConfirm'; +export { buttonClick, initTemplate, afterEvent, tableModelConfirm}; + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/events/initTemPlate.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/initTemPlate.js new file mode 100644 index 0000000..d76c800 --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/initTemPlate.js @@ -0,0 +1,56 @@ +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ +import {ajax, base } from 'nc-lightapp-front'; +import requestApi from '../requestApi' +let { NCPopconfirm} = base; + +export default function (props) { + + let multiLang = props.MutiInit.getIntl(7010); + requestApi.tpl({ + data: { + "pagecode": "ssccloudunit" + }, + success: (data) => { + let meta = data.data; + console.log(1, meta); + debugger + meta.ssccloudunit.items.find((item) => item.attrcode === "pk_org").queryCondition = function () { + + return { + "pk_group": "0001Z31000000000112T" + } + }; + + // 添加表格操作列 + let event = { + label: multiLang && multiLang.get('701001RWCL-0060'),//操作 + itemtype: "customer", + attrcode: 'opr', + disabled: true, + visible: true, + render(text, record, index) { + return ( + //701001RWCL-0039:确认删除? + { + debugger; + props.editTable.delRow(window.bodyCode, index); + requestApi.del({ + data: record, + success: (res) => { + } + }) + }}> + {/*"7010-0002": "删除"*/} + {multiLang && multiLang.get('7010-0002')} + + ) + } + }; + meta[window.bodyCode].items.push(event); + + props.meta.setMeta(meta); + } + }); +} + +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/events/tableModelConfirm.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/tableModelConfirm.js new file mode 100644 index 0000000..c6b3402 --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/events/tableModelConfirm.js @@ -0,0 +1,24 @@ +/*1A0En7HRfbANBn9tgTXsyCKacgEZJF1sySZ4tBChcV8=*/ +import requestApi from '../requestApi' + +export default function (props, data, action) { + switch (action) { + case 'add' : + props.table.addRow(window.bodyCode, data[window.bodyCode]); + let reqData = { + head: data[window.bodyCode] + } + console.log(111, data); + requestApi.add({ + data: reqData, + success: (data) => { + console.log(333, data) + } + }); + break; + case 'edit' : + + break; + } +} +/*1A0En7HRfbANBn9tgTXsyCKacgEZJF1sySZ4tBChcV8=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/index.css b/src/ssctpaaa/sscsetting/ssccloudunit/config/index.css new file mode 100644 index 0000000..52c90b9 --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/index.css @@ -0,0 +1,16 @@ +.container { + padding: 10px; +} +.title { + float: left; + line-height: 60px; + font-size: 18px; + margin-right: 20px; +} +.header { + line-height: 60px; +} +.content { + clear: both; + background: #fff; +} diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/index.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/index.js new file mode 100644 index 0000000..483e1af --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/index.js @@ -0,0 +1,96 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react'; +import ReactDOM from 'react-dom'; +import {createPage, ajax, base} from 'nc-lightapp-front'; +import {buttonClick, initTemplate, afterEvent, tableModelConfirm} from './events'; + +import requestApi from './requestApi' +import './index.less'; + +const {NCDiv} = base; +window.bodyCode = 'ssccloudunit'; + +class SSCCloudUnit extends Component { + + componentDidMount() { + + requestApi.query({ + data: { + "orgflag":"org", + "pk_org":"0001Z310000000001145" + }, + success: (data) => { + //数据加载后处理,要把启用状态适配成开关状态 + data[window.bodyCode].rows.forEach((row) => { + if(row.values.enablestate.value === 3){ + row.values.enablestate = {value:false}; + }else{ + row.values.enablestate = {value:true}; + } + }); + this.props.editTable.setTableData(window.bodyCode, data[window.bodyCode]); + } + }); + this.props.button.setButtonsVisible({ + saveButton: false, + cancelButton: false + }) + } + + + render() { + const {editTable, table, button} = this.props; + const {createEditTable} = editTable; + const {createButton} = button; + let multiLang = this.props.MutiInit.getIntl(7010); + return ( +
+ + +
{multiLang && multiLang.get('701001RWCL-0045')}
+
+ +
+ {createButton('addButton', { + name: multiLang && multiLang.get('701001RWCL-0046'),//新增 + onButtonClick: buttonClick.bind(this), + buttonColor: 'main-button' + })} + {createButton('editButton', { + name: multiLang && multiLang.get('701001RWCL-0038'),//修改 + onButtonClick: buttonClick.bind(this), + buttonColor: 'main-button' + })} +{/* {createButton('delButton', { + name: '删除', + onButtonClick: buttonClick.bind(this), + buttonColor: 'main-button' + })} */} + {createButton('saveButton', { + name: multiLang && multiLang.get('7010-0003'),//保存 + onButtonClick: buttonClick.bind(this), + buttonColor: 'main-button' + })} + {createButton('cancelButton', { + name: multiLang && multiLang.get('7010-0004'),//取消 + onButtonClick: buttonClick.bind(this) + })} +
+
+
+ {createEditTable(window.bodyCode, { + onAfterEvent: afterEvent + })} +
+
+ ) + } +} + +SSCCloudUnit = createPage({ + initTemplate: initTemplate, + mutiLangCode: '7010' +})(SSCCloudUnit); + +ReactDOM.render(, document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/index.less b/src/ssctpaaa/sscsetting/ssccloudunit/config/index.less new file mode 100644 index 0000000..c97d4d9 --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/index.less @@ -0,0 +1,17 @@ +.container { + padding: 10px; +} +.title { + float: left; + line-height: 60px; + font-size: 18px; + margin-right:20px; +} +.header { + line-height: 60px; +} + +.content { + clear: both; + background: #fff; +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/ssccloudunit/config/requestApi.js b/src/ssctpaaa/sscsetting/ssccloudunit/config/requestApi.js new file mode 100644 index 0000000..9d9583f --- /dev/null +++ b/src/ssctpaaa/sscsetting/ssccloudunit/config/requestApi.js @@ -0,0 +1,46 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ + +import {ajax } from 'nc-lightapp-front'; + +let requestDomain = ''; + +let requestApiOverwrite = { + //单据模板接口 + tpl: (opt) => { + ajax({ + url: opt.url || `${requestDomain}/nccloud/ssctp/sscbd/SSCUnitTempletAction.do`, + data: opt.data, + success: opt.success + }); + }, + query:(opt) => { + ajax({ + url: `${requestDomain}/nccloud/ssctp/sscbd/SSCUnitQueryAction.do`, + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + save: (opt) => { + opt.data.rows.forEach((row) => { + delete row.values.ts; + }); + opt.data = { + head: opt.data + } + ajax({ + url: `${requestDomain}/nccloud/ssctp/sscbd/SSCUnitAddAction.do`, + data: opt.data, + success: (data) => { + if (data.success) { + data = data.data; + opt.success(data); + } + } + }) + } +} +export default requestApiOverwrite; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/sscladerule/config/events/afterEvent.js new file mode 100644 index 0000000..994d116 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/events/afterEvent.js @@ -0,0 +1,54 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +export default function (props, moduleId, key, value, data, index) { + switch(key){ + case 'ladetype': + props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + { + thresholdvalue: value.value === '10' ? false : true + } + ) + props.form.setFormItemsRequired( window.presetVar.addFormCode,{'thresholdvalue': value.value === '10' ? true : false}); + if (value.value !== '10') { + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'thresholdvalue':{value:null,display:null}} + ) + } + break; + case 'pk_managelevel': + props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + { + details: value.value === '10' ? false : true + } + ) + props.form.setFormItemsRequired( window.presetVar.addFormCode,{'details': value.value === '10' ? true : false}); + if (value.value !== '10') { + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'details':{value:null,display:null}} + ) + } + break; + case 'refpk': + props.editTable.setValByKeyAndRowId(moduleId,data[0].rowid,'refpk.code',{value:value.refcode,display:value.refcode}); + if(moduleId==window.presetVar.ladeRuleBodyTable&&value.length>0){ + let newIndex = index; + for(let i=0;i { + const rows = checkedRows.map(row => row.data) + + let index = -1 + while (++index < rows.length) delete rows[index].values.details + let param = { + head: { + areaType: 'table', + areaCode: 'head', + rows + } + } + requestApi.batchDeleteRule({ + param, + success: (res) => { + if(res && res.ladeRuleHeadTable){ + that.props.editTable.setTableData( + window.presetVar.l_list, + res.ladeRuleHeadTable + ) + }else{ + that.props.editTable.setTableData( + window.presetVar.l_list, + {rows: []} + ) + } + } + }) +} + +// 表格操作 +const rowBtnClick = (props, btnKey, text, record, index, _this) => { + switch (btnKey) { + case 'DeleteBtn': + //delete text.values.details + delete record.values.details + let param = { + head: { + areaType: 'table', + areaCode: 'head', + rows: [ + record + ] + } + } + requestApi.batchDeleteRule({ + param, + success: (res) => { + props.editTable.setTableData(window.presetVar.ladeRuleBodyTable, { rows: [] }) + props.button.setButtonsVisible({'Add2': false}) + requestApi.queryLadeRule({ + data: {'pk_sscunit': record.values.pk_sscunit.value}, + success: (res) => { + if(res){ + props.editTable.setTableData( + window.presetVar.l_list, + res[window.presetVar.l_list] + ) + // _this.setState({ + // specBtn: null + // }) + }else{ + props.editTable.setTableData( + window.presetVar.l_list, + { rows: [] } + ) + // _this.setState({ + // specBtn: ( + // { + // window.leftModalStatus = 'add' + // _this.setState({showModal:true}) + // _this.props.form.setFormItemsDisabled( + // window.presetVar.addFormCode, + // {'thresholdvalue': true, 'details': true} + // ) + // } + // } + // >+添加 + // ) + // }) + } + } + }) + } + }) + break; + case 'DeleteBtn2': + if(props.editTable.getStatus(window.presetVar.ladeRuleBodyTable)=="edit"){ + props.editTable.deleteTableRowsByIndex(window.presetVar.ladeRuleBodyTable, index); + return; + } + const data = _this.state.currentRow.values + delete data.details + const paramData = { + head: {head: { + areaType: 'form', + areacode: 'head', + rows: [{ + status: '1', + values: data + }] + }}, + body: {body: { + areaType: 'table', + areacode: 'body', + rows: [] + }} + } + let details = props.editTable.getAllRows(window.presetVar.ladeRuleBodyTable,true) + details.splice(index, 1) + let idx = -1 + while(++idx < details.length) { + paramData.body.body.rows.push({ + status: '2', + rowId: idx, + values: {refpk: { + value: details[idx].values.refpk.value + }} + }) + } + requestApi.saveLadeRule({ + data: paramData, + success: (res) => { + _this.setState({ + currentRow: res.head.ladeRuleHeadTable.rows[0] + }) + let headData = props.editTable.getAllRows(window.presetVar.l_list,true) + headData[_this.state.currentLeftRowIdx] = res.head.ladeRuleHeadTable.rows[0] + props.editTable.setTableData( + window.presetVar.ladeRuleBodyTable, + res.body?res.body.ladeRuleBodyTable:{rows: []} + ) + const setData = res.head.ladeRuleHeadTable + setData.rows = headData + props.editTable.setTableData( + window.presetVar.l_list, + setData + ) + } + }) + + break; + case 'EditBtn': + window.leftModalStatus = 'edit' + _this.setState({showModal: true}) + const {values} = props.editTable.getAllRows(window.presetVar.l_list,true)[index] + _this.setState({currentRow: props.editTable.getAllRows(window.presetVar.l_list,true)[index]}) + for (let key in values) { + if (key === 'ladetype') { + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {[key]:{ + value:values[key].value || '', + display:values[key].display || '' + }} + ) + if (values[key].value === '10') { + props.form.setFormItemsRequired( window.presetVar.addFormCode,{'thresholdvalue': true}); + props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + {'thresholdvalue': false} + ) + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'thresholdvalue':{ + value: values.thresholdvalue.value, + display: null + }} + ) + } else { + props.form.setFormItemsRequired( window.presetVar.addFormCode,{'thresholdvalue': false}); + setTimeout(() => { + props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + {'thresholdvalue': true} + ) + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'thresholdvalue':{value:null,display:null}} + ) + },0) + } + } else if (key === 'pk_managelevel') { + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {[key]:{ + value:values[key].value || '', + display:values[key].display || '' + }} + ) + if (values[key].value === '10') { + props.form.setFormItemsRequired(window.presetVar.addFormCode,{'details': true}); + props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + {'details': false} + ) + let details = '', display = '' + requestApi.queryLadeRuleBody({ + data: {pk_laderule: values.pk_laderule.value}, + success: (res) => { + let ladeRuleBodyTable = null; + let { + body + } = res + if(body)ladeRuleBodyTable = body.ladeRuleBodyTable; + if(ladeRuleBodyTable && ladeRuleBodyTable.rows){ + let idx = -1 + while (++idx < ladeRuleBodyTable.rows.length) { + if(idx != 0 && details != ''){ + details += "," + display += "," + } + if(ladeRuleBodyTable.rows[idx].values.refpk){ + details += ladeRuleBodyTable.rows[idx].values.refpk.value + display += ladeRuleBodyTable.rows[idx].values.refpk.display + } + } + } + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'details':{ + value: details, + display + }} + ) + } + }) + } else { + props.form.setFormItemsRequired(window.presetVar.addFormCode,{'details': false}); + props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + {'details': true} + ) + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'details':{value:null,display:null}} + ) + } + } else if (key !== 'details') { + props.form.setFormItemsValue( + window.presetVar.addFormCode, + {[key]:{ + value:values[key].value || '', + display:values[key].display || '' + }} + ) + } + } + break; + default: + break; + } +} + +// 新增表单保存事件 +const addFormSave = (that) =>{ + // 获得form数据 + let data = that.props.form.getAllFormValue(window.presetVar.addFormCode) + // let needCheck = ['code','name','ladetype','eachextracttasks','pk_managelevel']; + // let name4NeedCheck = ['编码','名称','提取规则','每次提取数量','管理层级']; + const {rows} = data + if(!that.props.form.isCheckNow(window.presetVar.addFormCode)){ + return; + } + // 表单验证 + // for(let i=0;i { + query.queryTableData( + that, + {'pk_sscunit': that.state.sscCenterPk} + ) + that.props.form.EmptyAllFormValue([window.presetVar.addFormCode]) + that.setState({showModal:false}) + } + }) +} + +// 新增表单取消事件 +const addFormCancel = (that) => { + that.setState({showModal:false}) + that.props.form.EmptyAllFormValue([window.presetVar.addFormCode]) +} + +// 新增作业组 +const addRuleBody = (that) => { + that.props.editTable.setStatus(window.presetVar.ladeRuleBodyTable, 'edit'); + that.props.editTable.addRow(window.presetVar.ladeRuleBodyTable) // 添加一行 + //that.props.editTable.hideColByKey(window.presetVar.ladeRuleBodyTable,"opr") // 隐藏操作列 + let bodyAllRows = that.props.editTable.getAllRows(window.presetVar.ladeRuleBodyTable,true) + // if(bodyAllRows.length>0){ + // for(let i = 0; i { + let headData = that.state.currentRow; + let multiLang = that.props.MutiInit.getIntl(7010); + that.props.editTable.filterEmptyRows(window.presetVar.ladeRuleBodyTable, []); + let bodyData = that.props.editTable.getAllData(window.presetVar.ladeRuleBodyTable); + const reqData = {} + headData.status = "1" + delete headData.values.details + let bodyRows = [] + for(let i = 0; i < bodyData.rows.length; i++){ + if(bodyData.rows[i].status=="3")continue; + if(bodyData.rows[i].values.refpk.value==null||bodyData.rows[i].values.refpk.value==""){ + //701001RWCL-0079:第 ; 701001RWCL-0080:行作业组不能为空 + toast({content : multiLang && multiLang.get('701001RWCL-0079')+(i+1)+multiLang && multiLang.get('701001RWCL-0080'),color : 'danger'}) + return + } + bodyRows.push({ + rowId: i, + status: '2', + values: { + refpk: { + value: bodyData.rows[i].values.refpk.value + } + } + }) + } + reqData.head = { + head : { + "areaType": "form", + "areacode": "head", + "rows": [headData] + } + + } + reqData.body = { + body : { + "areaType": "table", + "areacode": "body", + "rows": bodyRows + } + } + requestApi.saveLadeRule({ + data: reqData, + success: (data) => { + that.props.button.setButtonsVisible({ + 'Add2': true, + 'SaveDetails': false, + 'CancelDetails': false, + 'Add': true, + 'DelSpec': true + }) + that.props.editTable.setStatus(window.presetVar.ladeRuleBodyTable, 'browse') + that.props.editTable.showColByKey(window.presetVar.ladeRuleBodyTable,"opr") + if(data.body){ + that.props.editTable.setTableData( + window.presetVar.ladeRuleBodyTable, + data.body.ladeRuleBodyTable + ) + }else{ + that.props.editTable.setTableData( + window.presetVar.ladeRuleBodyTable, + { rows: [] } + ) + } + // + that.setState({ + currentRow: data.head.ladeRuleHeadTable.rows[0], + sscCenterDisabled: false + }) + let headData = that.props.editTable.getAllRows(window.presetVar.l_list,true) + headData[that.state.currentLeftRowIdx] = data.head.ladeRuleHeadTable.rows[0] + const setData = data.head.ladeRuleHeadTable + setData.rows = headData + that.props.editTable.setTableData( + window.presetVar.l_list, + setData + ) + + that.props.editTable.showColByKey(window.presetVar.l_list, 'opr'); + that.props.button.setPopContent('DeleteBtn2', multiLang && multiLang.get('701001RWCL-0168'))//确定要删除所选数据吗? + } + }) +} + +// 取消新增作业组 +const cancelDetails = (that) => { + that.props.button.setButtonsVisible({ + 'Add2': true, + 'SaveDetails': false, + 'CancelDetails': false, + 'Add': true, + 'DelSpec': true + }) + that.props.editTable.cancelEdit(window.presetVar.ladeRuleBodyTable) + that.props.editTable.setStatus(window.presetVar.ladeRuleBodyTable, 'browse') + that.props.editTable.showColByKey(window.presetVar.ladeRuleBodyTable,"opr") + + that.props.editTable.showColByKey(window.presetVar.l_list, 'opr'); + that.setState({ + sscCenterDisabled: false + }) + that.props.button.setPopContent('DeleteBtn2', multiLang && multiLang.get('701001RWCL-0039')) +} +function selectedChange(props, moduleId, newVal, oldVal) { + console.log('selectedChangeEvent',props,moduleId,newVal,oldVal); + if(newVal>0){ + props.button.setButtonDisabled(['DelSpec'], false); + }else { + props.button.setButtonDisabled(['DelSpec'], true); + } + } + +export default { + batchDelete, + rowBtnClick, + addFormSave, + addFormCancel, + addRuleBody, + saveDetails, + cancelDetails, + selectedChange +} +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/events/fixedTpl.js b/src/ssctpaaa/sscsetting/sscladerule/config/events/fixedTpl.js new file mode 100644 index 0000000..c043d0c --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/events/fixedTpl.js @@ -0,0 +1,224 @@ +/*WHFr/fQhJDqCAnV+SHM45eYgHLYMJeF3IWiiKKe8zbo=*/ +export default { + btns: [ + /*{ + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "EditBtn", + "title": "修改", + "area": "ladeRuleHeadTable", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "DeleteBtn", + "title": "删除", + "area": "ladeRuleHeadTable", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "DeleteBtn2", + "title": "删除", + "area": "ladeRuleBodyTable", + "children": [] + }, + // { + // "id": "0001A41000000006J5B1", + // "type": "button_main", + // "key": "Add", + // "title": "新增", + // "area": "l_top_btns", + // "parentCode":"head_group", + // "children": [] + // }, + // { + // "id": "0001A41000000006J5B1", + // "type": "button_secondary", + // "key": "DelSpec", + // "title": "删除", + // "area": "l_top_btns", + // "parentCode":"head_group", + // "children": [] + // }, + { + "type": "buttongroup", + "key": "head_group", + "area": "l_top_btns", + "isenable": true, + "order": "7", + "parentCode": null, + "children": [{ + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "Add", + "title": "新增", + "area": "l_top_btns", + "parentCode":"head_group", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_secondary", + "key": "DelSpec", + "title": "删除", + "area": "l_top_btns", + "parentCode":"head_group", + "children": [] + }] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "Add2", + "title": "新增", + "area": "r_top_btns", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "SaveDetails", + "title": "保存", + "area": "r_top_btns", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_secondary", + "key": "CancelDetails", + "title": "取消", + "area": "r_top_btns", + "children": [] + }*/ + ] + /* + headAddForm: { + pagination: false, + code: "headAddForm", + moduletype: "form", + name: "提取规则新增", + status: 'edit', + items: [ + { + "itemtype": "input", + "visible": true, + "label": "编码", + "attrcode": "code", + "maxlength": "50", + "required": true, + "disabled": false + }, + { + "itemtype": "input", + "visible": true, + "label": "名称", + "attrcode": "name", + "maxlength": "50", + "required": true, + "disabled": false, + "col": "6" + + }, + { + "itemtype": "radio", + "visible": true, + "label": "提取方式", + "attrcode": "ladetype", + "maxlength": "50", + "required": true, + "disabled": false, + "options": [{ + "display": "不限制提取", + "value": "0" + }, + { + "display": "阀值提取", + "value": "10" + }, + { + "display": "处理完毕后提取", + "value": "20" + } + ] + }, + { + "itemtype": "number", + "visible": true, + "label": "每次提取数量", + "attrcode": "eachextracttasks", + "required": true, + "disabled": false, + "scale":"0" + }, + { + "itemtype": "number", + "visible": true, + "label": "在手任务阀值", + "attrcode": "thresholdvalue", + "disabled": true, + "scale":"0" + }, + { + "itemtype": "radio", + "visible": true, + "label": "管理层级", + "attrcode": "pk_managelevel", + "maxlength": "20", + "required": true, + "disabled": false, + "options": [{ + "display": "共享中心", + "value": "0" + }, + { + "display": "作业组", + "value": "10" + } + ] + }, + { + "itemtype": "refer", + "visible": true, + "label": "规则适用作业组", + "disabled": true, + "attrcode": "details", + "isMultiSelectedEnabled": true, + "refcode": "/ssctp/refer/sscbd/SSCWorkGroupGridRef/index.js" + }, + { + "itemtype": "refer", + "label": "组织", + "attrcode": "pk_sscunit", + "visible": false + }, + { + "itemtype": "number", + "label": "序号", + "attrcode": "seqno", + "visible": false + }, + { + "itemtype": "datepicker", + "label": "时间戳", + "attrcode": "ts", + "maxlength": "19" + }, + { + "itemtype": "input", + "label": "主键", + "attrcode": "pk_laderule", + "maxlength": "20" + }, + { + "itemtype": "refer", + "label": "集团", + "attrcode": "pk_group", + "maxlength": "20" + } + ] + } */ +} +/*WHFr/fQhJDqCAnV+SHM45eYgHLYMJeF3IWiiKKe8zbo=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/events/index.js b/src/ssctpaaa/sscsetting/sscladerule/config/events/index.js new file mode 100644 index 0000000..3dfe7c3 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/events/index.js @@ -0,0 +1,9 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick' +import initTemplate from './initTemplate' +import afterEvent from './afterEvent' +import query from './query' + +export {buttonClick, initTemplate, afterEvent, query} + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/events/initTemPlate.js b/src/ssctpaaa/sscsetting/sscladerule/config/events/initTemPlate.js new file mode 100644 index 0000000..6f2d2da --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/events/initTemPlate.js @@ -0,0 +1,120 @@ +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ +import {getMultiLang} from 'nc-lightapp-front'; +import buttonClick from './buttonClick' + +export default function(props) { + window.presetVar = { + ...window.presetVar, + pageId: '700101_laderule', + l_list: 'ladeRuleHeadTable', + ladeRuleBodyTable: 'ladeRuleBodyTable', + addFormCode: 'headAddForm' + } + const _this = this; + + //请求模板 + let createUIDomPromise = new Promise((resolve, reject) => { + props.createUIDom({}, (data) => { + resolve(data); + }) + }); + + //请求多语 + let getMultiLangPromise = new Promise((resolve, reject) => { + getMultiLang({ + moduleId: 7010, domainName: 'ssctp',currentLocale: 'zh-CN', + callback: (json) => { + resolve(json); + } + }) + }); + Promise.all([createUIDomPromise, getMultiLangPromise]).then((resultList) => { + let data = resultList[0]; + let json = resultList[1]; + + if (data) { + let { + ladeRuleHeadTable, // 任务提取规则 + ladeRuleBodyTable // 任务提取规则明细 + } = data.template + //设置表格的扩展按钮列 + let l_event = { + label: json['701001RWCL-0060'],//操作 + attrcode: 'opr', + itemtype: 'customer', + visible: true, + render: (text, record, index) => { + return props.button.createOprationButton(["EditBtn", "DeleteBtn"], { + area: window.presetVar.l_list, + onButtonClick: (props, btnKey, e) => { + buttonClick.rowBtnClick(props, btnKey, text, record, index, _this); + } + }); + } + } + let r_event = { + label: json['701001RWCL-0060'],//操作 + attrcode: 'opr', + itemtype: 'customer', + visible: true, + render: (text, record, index) => { + return props.button.createOprationButton(["DeleteBtn2"], { + area: window.presetVar.ladeRuleBodyTable, + onButtonClick: (props, btnKey) => { + buttonClick.rowBtnClick(props, btnKey, text, record, index, _this) + } + }); + } + } + + props.button.setButtons(data.button) + props.button.setPopContent('DeleteBtn', json['701001RWCL-0039']) + props.button.setPopContent('DeleteBtn2', json['701001RWCL-0039']) + + props.button.setButtonsVisible({ + 'Add': true, + 'DelSpec': true, + 'Add2': false, + 'SaveDetails': false, + 'CancelDetails': false + }) + + if(!props.getUrlParam('pk_sscunit')) props.button.setButtonDisabled(['Add', 'DelSpec'], true); + + ladeRuleHeadTable.items.push(l_event) + ladeRuleBodyTable.items.push(r_event) + + // ladeRuleHeadTable.items.forEach(ele => { + // ele.width = '120px' + // }) + // ladeRuleBodyTable.items.forEach(ele => { + // ele.width = '100px' + // }) + ladeRuleBodyTable.items[ladeRuleBodyTable.items.length - 1].width = '50px'; + + data.template[window.presetVar.ladeRuleBodyTable].items.find((item) => item.attrcode === "refpk").queryCondition = function() { + let pk_sscunit = _this.state.sscCenterPk + return { + "pk_sscunit": pk_sscunit + } + }; + data.template[window.presetVar.addFormCode].items.find((item) => item.attrcode === "details").queryCondition = function() { + let pk_sscunit = _this.state.sscCenterPk + return { + "pk_sscunit": pk_sscunit + } + }; + + data.template[window.presetVar.addFormCode].items.map((item) => { + if (item.attrcode === 'details') { + item.isRunWithChildren =false; + } + }); + + data.template[window.presetVar.addFormCode].status = 'edit'; + props.meta.setMeta(data.template); + + } + }) +} +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/events/query.js b/src/ssctpaaa/sscsetting/sscladerule/config/events/query.js new file mode 100644 index 0000000..17ac710 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/events/query.js @@ -0,0 +1,77 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from '../requestApi' +import {base} from 'nc-lightapp-front' +const {NCButton} = base + +//共享中心改变事件 +let onSSCCenterChange =(that, e)=>{ + that.setState({sscCenterPk:e.refpk, SSCCenter: e}) + if (e.refpk){ + // that.props.button.setButtonVisible(["Add","DelSpec"], true); + that.props.button.setButtonDisabled(['Add'], false); + let req = {'pk_sscunit':e.refpk} + queryTableData(that, req) + }else{ + // that.props.button.setButtonVisible(["Add","DelSpec"], false) + that.props.button.setButtonDisabled(['Add', 'DelSpec'], true); + that.props.editTable.setTableData(window.presetVar.l_list, { rows: [] }) + } + that.props.editTable.setTableData( + window.presetVar.ladeRuleBodyTable, + { rows: [] } + ) + // 保存共享中心 + that.props.setUrlParam({pk_sscunit: e.hasOwnProperty('refpk') ? JSON.stringify(e) : ''}); +} + +// 查询提取规则 +let queryTableData = (that, req) =>{ + // 重置规则适用作业组 + that.props.editTable.setTableData(window.presetVar.ladeRuleBodyTable, { rows: [] }) + that.props.button.setButtonsVisible({'Add2': false}) + requestApi.queryLadeRule({ + data: req, + success: (res) => { + if(res){ + that.props.editTable.setTableData( + window.presetVar.l_list, + res[window.presetVar.l_list] + ) + }else{ + that.props.editTable.setTableData( + window.presetVar.l_list, + { rows: [] } + ) + } + } + }) +} + +//查询规则适用作业组 +let queryDetails = (that, req) =>{ + requestApi.queryLadeRuleBody({ + data: req, + success: (res) => { + let body = res==null?null:res.body; + that.props.button.setButtonsVisible({'Add2': true}) + if (body) { + if(body.ladeRuleBodyTable){ + that.props.editTable.setTableData( + window.presetVar.ladeRuleBodyTable, + body.ladeRuleBodyTable + ) + }else{ + that.props.editTable.setTableData( + window.presetVar.l_list, + { rows: [] } + ) + } + }else{ + that.props.editTable.setTableData('ladeRuleBodyTable', { rows: [] }) + } + } + }) +} + +export default {onSSCCenterChange, queryTableData, queryDetails} +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/index.js b/src/ssctpaaa/sscsetting/sscladerule/config/index.js new file mode 100644 index 0000000..34c057d --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/index.js @@ -0,0 +1,291 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react' +import {createPage, base, toast} from 'nc-lightapp-front' +const {NCModal,NCButton} = base +import {buttonClick, initTemplate, afterEvent, query} from './events' +import {Nav} from 'ssccommon/components/global-nav' +import {EditTable} from 'ssccommon/components/table' +import SSCCenterRef from '../../../refer/sscbd/SSCUnitGridRef' +import './index.less' +import { + ProfileStyle, + ProfileHead, + ProfileBody, + HeadCenterCustom, + ButtonGroup +} from 'ssccommon/components/profile' +//左侧复选框选中的行 +let checkedColumns = [] + +class SSCLadeRule extends Component { + constructor(props) { + super(props); + this.state = { + SSCCenter: '', //共享中心 + sscCenterPk: '', //共享中心pk + showModal: false, + currentRow: null, + currentLeftRowIdx: -1, + // specBtn: null + sscCenterDisabled: false, //禁用共享中心参照 + } + this.leftTableFocusRowIndex = null; //左侧表格焦点行索引 + initTemplate.call(this, props) + } + + // 页面加载 + componentDidMount() { + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + setTimeout(() => { + pk_sscunit && query.onSSCCenterChange.call(this, this, JSON.parse(pk_sscunit)); + }, 300); + } + + // 左侧列表行点击,查询右侧表格数据 + onLeftRowClick = (opt, areaId, column, index) => { + let multiLang = this.props.MutiInit.getIntl(7010); + if(this.props.editTable.getStatus(window.presetVar.ladeRuleBodyTable)=="edit"){ + toast({content : multiLang && multiLang.get('701001RWCL-0083'),color : 'warning'});//701001RWCL-0083:您有未保存的数据,请保存后重试 + this.props.editTable.focusRowByIndex(window.presetVar.l_list, this.leftTableFocusRowIndex); + return; + } + this.leftTableFocusRowIndex = index; + let {values: { + pk_laderule: {value}, + pk_managelevel + }} = column + this.setState({currentRow: column, currentLeftRowIdx: index}) + if (pk_managelevel.value === '10') { + query.queryDetails(this, {pk_laderule: value}) + } else { + this.props.button.setButtonsVisible({'Add2': false}) + this.props.editTable.setTableData('ladeRuleBodyTable', { rows: [] }) + } + } + + // 批量删除 + batchDelete = () => { + let multiLang = this.props.MutiInit.getIntl(7010); + const checkedRows = this.props.editTable.getCheckedRows(window.presetVar.l_list) + if (checkedRows.length > 0) { + buttonClick.batchDelete(this, checkedRows) + return + } + toast({content : multiLang && multiLang.get('701001RWCL-0084'),color : 'warning'})//701001RWCL-0084:请至少选择一条数据 + } + + //左侧选择列单个选择框回调 暂存选中数据 + onSelected = (opt, areaId, column, index, onoff) => { + if (onoff) { + checkedColumns.push({ + index, + data: column + }) + } else { + let idx = -1 + while (++idx < checkedColumns.length) { + if (checkedColumns[idx].index == index) { + checkedColumns.splice(idx, 1) + return + } + } + } + + + } + + // 全选cb + onSelectedAll = (props, areaId, onoff, idx) => { + checkedColumns = [] + if (onoff) { + let data = this.props.editTable.getAllRows(window.presetVar.l_list,true) + let idx = -1 + while (++idx < data.length) { + checkedColumns.push({ + idx, + data: data[idx] + }) + } + } + } + + //新增 + openModal = () => { + window.leftModalStatus = 'add' + this.setState({showModal:true}) + this.initAddFromData() + } + + initAddFromData = ()=>{ + this.props.form.setFormItemsDisabled( + window.presetVar.addFormCode, + {'thresholdvalue': true, 'details': true} + ) + this.props.form.setFormItemsRequired( + window.presetVar.addFormCode, + {'details': false} + ) + this.props.form.setFormItemsValue( + window.presetVar.addFormCode, + {'ladetype':{value:'0'},'pk_managelevel':{value:'0'}} + ) + } + + // showSpecBtn(nextProps, nextState) { + // setTimeout(() => { + // const headData = this.props.editTable.getAllData(window.presetVar.l_list) + // if (this.state.sscCenterPk==null||this.state.sscCenterPk==''||headData.rows && headData.rows.length) { + // // this.setState({ + // // specBtn: null + // // }) + // } else { + // // this.setState({ + // // specBtn: ( + // // +添加 + // // ) + // // }) + // } + // }, 500) + // return true + // } + + render() { + + let {form: {createForm}} = this.props + let multiLang = this.props.MutiInit.getIntl(7010); + const btnModalConfig = { + ['DelSpec'] : { + title: multiLang && multiLang.get('7010-0002'),//删除 + content: multiLang && multiLang.get('701001RWCL-0187'),//确定要删除所选数据吗? + } + } + + return ( +
+
+ ) + } +} +// 初始化节点 +const SSCLaderUle = createPage({ + mutiLangCode: '7010' +})(SSCLadeRule) +// 注册节点 +ReactDOM.render(, document.querySelector('#app')) +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/index.less b/src/ssctpaaa/sscsetting/sscladerule/config/index.less new file mode 100644 index 0000000..942b5ac --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/index.less @@ -0,0 +1,124 @@ +.inner-container { + .left-container { + width: 70%; + float: left; + border-right: 2px solid rgba(230,233,233,1); + position: relative; + + .spec-btn { + position: absolute; + left: 49.3%; + top: 53.5%; + transform: translate(-50%,-50%); + margin-top: 100px; + z-index: 1; + background:#e14c46; + color: #fff; + } + } + + .right-container { + width: 30%; + float: right; + .bottom-bgc-for-single-table{ + right: 0; + left: 0; + } + } + .nc-singleTable-header-area{ + border-bottom: none; + } +} + +.clearfix::after { + content: "."; + clear: both; + display: block; + overflow: hidden; + font-size: 0; + height: 0; +} + +.clearfix { + zoom: 1; +} + +.nc-single-table { +h2.header-title-search-area { + height:22px; + font-size:16px; + color:rgba(71,77,84,1); + line-height:22px; + margin: 0 21px; + width: 200px; +} + +div.header-title-search-area { + margin-right: 21px; +} + +span.showOff { + display: flex; + align-items: center; + .u-checkbox-label { + height:21px; + font-size:13px!important; + color:rgba(110,110,119,1)!important; + line-height:21px; + } +} +} + +.u-modal-dialog .u-modal-content .u-modal-body { + div.u-row>span { + zoom: 1; + .formLabel { + width: 120px; + } + .radio-wrapper { + .u-radio-group { + width: 300px; + } + .u-radio { + display: inline-block; + width: 130px; + } + .u-radio-group:nth-of-type(1) { + height: 100px; + } + } + } + + div.u-row>span::after { + content: "."; + clear: both; + display: block; + overflow: hidden; + font-size: 0; + height: 0; + } +} + +.ssccenter{ + width:200px; + margin-left: 14px; +} + +.ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 3px; + margin-top: 10px; +} + +#sscladerule { + h2.title-search-detail { + margin-right: 20px !important; + font-weight: bold; + } +} + +.ssc_edit_modal_form{ + margin-right: 30px; + } \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscladerule/config/requestApi.js b/src/ssctpaaa/sscsetting/sscladerule/config/requestApi.js new file mode 100644 index 0000000..b439d6d --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscladerule/config/requestApi.js @@ -0,0 +1,51 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax } from 'nc-lightapp-front'; + +let requestDomain = ''; + +let requestApiOverwrite = { + queryLadeRule:(opt) => { + ajax({ + url: `${requestDomain}/nccloud/ssctp/sscbd/LadeRuleQryAction.do`, + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + queryLadeRuleBody:(opt) => { + ajax({ + url: `${requestDomain}/nccloud/ssctp/sscbd/LadeRuleBodyQryAction.do`, + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + batchDeleteRule:(opt) => { + ajax({ + url: `${requestDomain}/nccloud/ssctp/sscbd/LadeRuleBatchDeleteAction.do`, + data: opt.param, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + saveLadeRule:(opt) => { + ajax({ + url: `${requestDomain}/nccloud/ssctp/sscbd/LadeRuleSaveAction.do`, + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + } +} + +export default requestApiOverwrite; + +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/TreeTable.js b/src/ssctpaaa/sscsetting/sscpriority/config/TreeTable.js new file mode 100644 index 0000000..7112354 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/TreeTable.js @@ -0,0 +1,265 @@ +/*RXJkFhQCaWpSqyKm3tEedfjWYJ6Noi/eXv1/i1yJzgQ=*/ +import React, { Component } from "react"; +import { createPage, base, high } from "nc-lightapp-front"; +import requestApi from "./requestApi"; +import { buttonClick, initTemplate, afterEvent } from "./events"; +import { ProfileStyle, ProfileHead, ProfileBody, BodyLeft, BodyRight, HeadCenterCustom, ButtonGroup } from "ssccommon/components/profile"; +import { SyncTree } from "ssccommon/components/tree"; +import { EditTable } from "ssccommon/components/table"; +import { Nav } from "ssccommon/components/global-nav"; +import SSCCenter from "../../../refer/sscbd/SSCUnitGridRef"; +import "./index.less"; + +const { NCModal,NCButton } = base; +const { FormulaEditor } = high; + +function PublicField({ setName, setExplain, name }) { + let rowList = []; + name.map(item => { + rowList.push( +
  • { + setExplain(""); + }} + onDoubleClick={() => { + setName("" + item.code + ""); + }} + > + {item.code}  {item.name} +
  • + ); + }); + return
      {rowList}
    ; +} +class TreeTable extends Component { + constructor(props) { + super(); + this.formulaInputValue = ""; // 公式内容 + this.state = { + isHeadEdit: false, + showAddModal: false, // 新增modal + isShowSearch: true, // 控制树查询区显示 + isDisableSearch: false, // 控制树查询区禁用/可用 + SSCCenter: {}, // 共享服务中心 + isAdjustOrder:false, // 判断是否是调序状态,控制操作列显示内容 + showFormula:false, // 判断是否显示公式编辑器 + publicFieldData: "", // 公共字段 + showConfirmModal:false, // 跳转确认框 + isEdit:false // 是否是编辑态 + }; + initTemplate.call(this, props); + } + + // 页面加载 + componentDidMount() { + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + setTimeout(() => { + pk_sscunit && this.onSSCCenterChange.call(this, JSON.parse(pk_sscunit)); + }, 300); + } + + //共享中心改变事件 + onSSCCenterChange = e => { + this.setState({ SSCCenter: e }); + let { syncTree } = this.props; + let { setSyncTreeData } = syncTree; + if (e.hasOwnProperty('refpk')) { + // 选中共享中心 + this.setState({isShowSearch:true}); // 显示树型的查询区 + let req = { pk_sscunit: e.refpk,enablestate:'2' }; // 2:查询启用的作业组 3:查询停用 不传Or传'':查询所有 + this.queryTreeData(req); // 查询左侧树 + this.props.editTable.setTableData(window.presetVar.head.tableId, { rows: [] }); + } else { + // 清空共享中心 + this.setState({isShowSearch:false}); // 隐藏树型的查询区 + setSyncTreeData(window.presetVar.head.treeId, []); // 树数据清空 + this.props.button.setButtonDisabled(['Add', 'Edit', 'Delete'], true); // 按钮禁用 + this.props.editTable.setTableData(window.presetVar.head.tableId, { rows: [] }); // 表格内数据清空 + } + // 保存共享中心 + this.props.setUrlParam({pk_sscunit: e.hasOwnProperty('refpk') ? JSON.stringify(e) : ''}); + }; + + // 查询树节点数据 + queryTreeData(req) { + let { syncTree } = this.props; + let multiLang = this.props.MutiInit.getIntl(7010); + let { setSyncTreeData } = syncTree; + this.setSyncTreeData = setSyncTreeData; //设置树根节点数据方法 + requestApi.queryTreeData({ + data: req, + success: res => { + res.nodes.push({ + refpk: "0001ZG100000SSCGROUP", + refcode: "ROOT", + refname: multiLang && multiLang.get('701001RWCL-0051'),//"作业组" + }); + let newTree = syncTree.createTreeData(res.nodes); //创建树 组件需要的数据结构 + this.setSyncTreeData(window.presetVar.head.treeId, newTree); + } + }); + } + + openFormula() { + let multiLang = this.props.MutiInit.getIntl(7010); + requestApi.queryPublicFields({ + data: "", + success: res => { + console.log(multiLang && multiLang.get('701001RWCL-0166')/*"公共字段数据"*/, res); + this.setState({ publicFieldData: res, showFormula: true }); + } + }); + } + + handleTruncation = ()=>{ + this.setState({showConfirmModal:true}); + } + + render() { + let { form, modal } = this.props; + let { createForm } = form; + let { createModal } = modal; + let multiLang = this.props.MutiInit.getIntl(7010); + buttonClick.addBtnEventConfig.click = buttonClick.addBtnEventConfig.click.bind(this); + buttonClick.editBtnEventConfig.click = buttonClick.editBtnEventConfig.click.bind(this); + buttonClick.saveBtnEventConfig.click = buttonClick.saveBtnEventConfig.click.bind(this); + buttonClick.cancelBtnEventConfig.click = buttonClick.cancelBtnEventConfig.click.bind(this); + buttonClick.deleteBtnEventConfig.click = buttonClick.deleteBtnEventConfig.click.bind(this); + buttonClick.saveModalBtnEventConfig.click = buttonClick.saveModalBtnEventConfig.click.bind(this); + buttonClick.cancelModalBtnEventConfig.click = buttonClick.cancelModalBtnEventConfig.click.bind(this); + return ( +
    +
    + ); + } +} + +TreeTable = createPage({ + mutiLangCode: '7010' +})(TreeTable); +export default TreeTable; + +/*RXJkFhQCaWpSqyKm3tEedfjWYJ6Noi/eXv1/i1yJzgQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/sscpriority/config/events/afterEvent.js new file mode 100644 index 0000000..ade7887 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/events/afterEvent.js @@ -0,0 +1,28 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +export default function afterEvent(props, moduleId, key, value, changedrows) { + console.log("afterEvent", props, moduleId, key, value, 22, changedrows); + switch (moduleId) { + case window.presetVar.head.modalId: + switch (key) { + case "upgraderule": + if (value.value == "none") { + // 晋级模式:无 + props.form.setFormItemsDisabled(moduleId, { 'upgraderulenum': true }); // 禁用晋级时间字段 + props.form.setFormItemsValue(moduleId,{'upgraderulenum':{value:'',display:''}}) // 初始化晋级时间字段 + props.form.setFormItemsRequired(moduleId,{'upgraderulenum':false}); // 必输晋级时间字段 + } else { + // 晋级模式:有 + props.form.setFormItemsDisabled(moduleId, { 'upgraderulenum': false }); // 可用晋级时间字段 + props.form.setFormItemsRequired(moduleId,{'upgraderulenum':true}); // 必输晋级时间字段 + } + break; + default: + break; + } + break; + default: + break; + } +} + +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/sscpriority/config/events/buttonClick.js new file mode 100644 index 0000000..02c9204 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/events/buttonClick.js @@ -0,0 +1,256 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import { toast } from "nc-lightapp-front"; +import { promptBox } from "nc-lightapp-front" +import requestApi from "../requestApi"; + +//编辑 +let editBtnEventConfig = { + click(props){ + props.button.setButtonsVisible({Add: false,Edit: false,Delete: false,Save: true,Cancel: true}); + props.button.setButtonDisabled(['Save'], false); + this.setState({isAdjustOrder:true,isDisableSearch:true,isEdit:true}); + props.syncTree.setNodeDisable('WorkGroupTree', true); + } +}; + +//保存 +let saveBtnEventConfig = { + click(props){ + // props.button.setButtonsVisible({Add: true,Edit: true,Delete: true,Save: false,Cancel: false}); + let data = props.editTable.getAllData(window.presetVar.head.tableId); + let req = { + 'SSCPriority':data, + 'userjson' : this.state.workGroupPk + } + let that = this; + requestApi.saveTableData({ + data : req, + success: (res) => { + if(res==null){ + + }else { + that.props.editTable.setTableData( + window.presetVar.head.tableId, + res[window.presetVar.head.tableId] + ); + } + props.button.setButtonsVisible({Add: true,Edit: true,Delete: true,Save: false,Cancel: false}); + that.setState({isAdjustOrder:false,isDisableSearch:false,isEdit:false}); + props.syncTree.setNodeDisable('WorkGroupTree', false); + } + }) + } +}; + +//取消 +let cancelBtnEventConfig = { + click(props){ + props.button.setButtonsVisible({Add: true,Edit: true,Delete: true,Save: false,Cancel: false}); + props.editTable.cancelEdit(window.presetVar.head.tableId); + this.setState({isAdjustOrder:false,isDisableSearch:false,isEdit:false}); + props.syncTree.setNodeDisable('WorkGroupTree', false); + } +}; + + +//增加 +let addBtnEventConfig = { + click(props) { + this.setState({ showAddModal: true, isHeadEdit: false }); + // 新增表单赋默认值 + props.form.setFormItemsValue(window.presetVar.head.modalId, { + pk_sscunit: { value: this.state.SSCCenter.refpk, display: null } + }); + props.form.setFormItemsValue(window.presetVar.head.modalId, { + pk_workinggroup: { value: this.state.workGroupPk, display: null } + }); + // 公式编辑器默认值 + this.formulaInputValue = ''; + } +}; + +//删除 +let deleteBtnEventConfig = { + click(props) { + let checkedData = props.editTable.getCheckedRows( + window.presetVar.head.tableId + ); + let delRows = []; + let reqData = {}; + let multiLang = this.props.MutiInit.getIntl(7010); + if (checkedData.length == 0) { + toast({ content: multiLang && multiLang.get('701001RWCL-0089'), color: "warning" });//701001RWCL-0089:请至少选择一行数据 + return; + } + + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('7010-0002'), //删除 + content: multiLang && multiLang.get('701001RWCL-0168'), //"701001RWCL-0168": "确定要删除所选数据吗?" + beSureBtnClick: () => { + for (let i = 0; i < checkedData.length; i++) { + delRows.push(checkedData[i].data); + delRows[i].status = "3"; + } + reqData = { + head: { + areaType: "table", + areacode: "head", + rows: delRows + } + }; + reqData.userjson = this.state.workGroupPk; + requestApi.saveFormData({ + data: reqData, + success: data => { + if (data) { + props.editTable.setTableData( + window.presetVar.head.tableId, + data[window.presetVar.head.tableId] + ); + } else { + props.editTable.setTableData(window.presetVar.head.tableId, { + rows: [] + }); + } + toast({ color: "success", content: multiLang && multiLang.get('701001RWCL-0042') });//701001RWCL-0042:删除成功 + } + }); + }, // 确定按钮点击调用函数,非必输 + }) + } +}; + +let saveModalBtnEventConfig = { + click(props) { + if(!this.props.form.isCheckNow(window.presetVar.head.modalId)){ + return; + } + let data = this.props.form.getAllFormValue(window.presetVar.head.modalId); + data.rows[0].values.formula.value = (this.formulaInputId || {}).value || data.rows[0].values.formula.value; + this.props.form.setFormItemsValue(window.presetVar.head.modalId,{'formula':{value:(this.formulaInputId || {}).value || data.rows[0].values.formula.value,display:null}}); + let reqData = {}; + if(!this.props.form.isCheckNow(window.presetVar.head.modalId)){ + return; + } + // let needChecks = ['code','name','upgraderule','upgraderulenum']; + // let name4NeedChecks = ['编码','名称','晋级模式','晋级时间']; + // let ee = this.props.form.isCheckNow(window.presetVar.head.modalId); + // if(this.formulaInputId.value==""||this.formulaInputId.value.trim()==""){ + // toast({ content: "优先级条件不能为空", color: "danger" }); + // return; + // } + // for(let i=0;i { + this.props.form.EmptyAllFormValue(window.presetVar.head.modalId); + if (data) { + this.setState({ showAddModal: false }); + this.props.editTable.setTableData( + window.presetVar.head.tableId, + data[window.presetVar.head.tableId] + ); + } else { + this.props.editTable.setTableData(window.presetVar.head.tableId, { + rows: [] + }); + } + } + }); + } +}; + +let cancelModalBtnEventConfig = { + click(props) { + this.props.form.EmptyAllFormValue(window.presetVar.head.modalId); + this.setState({ showAddModal: false }); + } +}; + +/** + * 树节点选择事件 + */ +function treeSelectEvent(key, item) { + //设置表格数据 + let req = { pk_workinggroup: item.refpk}; + if(item.refpk=='0001ZG100000SSCGROUP'){ + // 按钮禁用 + this.props.button.setButtonDisabled(['Add', 'Edit', 'Delete'], true); + // 表格清空 + this.props.editTable.setTableData(window.presetVar.head.tableId, {rows: []}); + return; + } + this.setState({ workGroupPk: item.refpk }); + requestApi.getTableData({ + data: req, + success: data => { + // 树节点点击后按钮可用 + this.props.button.setButtonDisabled(['Add', 'Edit'], false); + if (data) { + this.props.editTable.setTableData(window.presetVar.head.tableId,data[window.presetVar.head.tableId]); + } else { + this.props.editTable.setTableData(window.presetVar.head.tableId, {rows: []}); + } + } + }); +} + +function selectedChange(props, moduleId, newVal, oldVal) { + console.log('selectedChangeEvent',props,moduleId,newVal,oldVal); + if(newVal>0){ + props.button.setButtonDisabled(['Delete'], false); + }else { + props.button.setButtonDisabled(['Delete'], true); + } +} + + +/** + * @Author:gaoymf + * @Description:导航条点击 + * @Date: 16:12 2018/9/15 + * @param: + */ +let handleTruncation = function(){ + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'), //"提示信息" + content: multiLang && multiLang.get('701001RWCL-0074'),//此操作会丢失本次修改,请确定? + beSureBtnClick: ()=>{ + this.refs.nav.linkByClickedIdx(); + } + }) +} + + + +export default { cancelBtnEventConfig, editBtnEventConfig, saveBtnEventConfig, deleteBtnEventConfig, addBtnEventConfig, treeSelectEvent, saveModalBtnEventConfig, cancelModalBtnEventConfig,selectedChange,handleTruncation}; + +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/events/fixedTemplet.js b/src/ssctpaaa/sscsetting/sscpriority/config/events/fixedTemplet.js new file mode 100644 index 0000000..5c12885 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/events/fixedTemplet.js @@ -0,0 +1,184 @@ +/*QqOYif2dFZXT39A6hY82WQIEANXc0ECdakPiQJg68d0=*/ +export default { + /* addModal: { + code: "SSCPriority", + moduletype: "form", + items: [ + { + itemtype: "input", + label: "主键", + attrcode: "pk_priority", + maxlength: "20" + }, + { + itemtype: "refer", + label: "集团", + attrcode: "pk_group", + maxlength: "20" + }, + { + itemtype: "refer", + label: "所属组织", + attrcode: "pk_org", + maxlength: "20" + }, + { + itemtype: "input", + visible: true, + label: "编码", + attrcode: "code", + maxlength: "100", + required: true + }, + { + itemtype: "input", + visible: true, + label: "名称", + attrcode: "name", + maxlength: "200", + required: true + }, + { + itemtype: "input", + visible: true, + label: "优先级条件", + attrcode: "formula", + required: true + }, + { + itemtype: "input", + visible: false, + label: "优先级条件显示名称", + attrcode: "formulashow", + required: true + }, + { + itemtype: "select", + visible: true, + label: "晋级模式", + attrcode: "upgraderule", + maxlength: "50", + required: true, + options: [ + { + display: "无", + value: "none" + }, + { + display: "分钟", + value: "minute" + }, + { + display: "小时", + value: "hour" + }, + { + display: "天", + value: "day" + }, + { + display: "周", + value: "week" + } + ] + }, + { + itemtype: "number", + visible: true, + label: "晋级时间", + attrcode: "upgraderulenum" + }, + { + itemtype: "number", + visible: false, + label: "优先级顺序", + attrcode: "ordernum", + "scale":"0" + }, + { + attrcode: "creator", + maxlength: "20", + label: "创建人", + itemtype: "refer" + }, + { + attrcode: "creationtime", + maxlength: "19", + label: "创建时间", + itemtype: "datepicker" + }, + { + attrcode: "modifier", + maxlength: "20", + label: "最后修改人", + itemtype: "refer" + }, + { + attrcode: "modifiedtime", + maxlength: "19", + label: "最后修改时间", + itemtype: "datepicker" + }, + { + itemtype: "datepicker", + label: "时间戳", + attrcode: "ts", + maxlength: "19" + } + ], + name: "优先级设置", + pagination: false + },*/ + extendButtons:[ + { + "id": "0001ZG10000000000X7E", + "type": "button_main", + "key": "Edit_list", + "title": "修改", + "area": 'listbtnarea', + "children": [] + }, + { + "id": "0001ZG10000000000X7K", + "type": "button_main", + "key": "Delete_list", + "title": "删除", + "area": 'listbtnarea', + "children": [] + }, + { + "id": "0001ZG10000000000X7U", + "type": "button_main", + "key": "Up", + "title": "上移", + "area": 'listbtnarea', + "children": [] + }, + { + "id": "0001ZG10000000000X7D", + "type": "button_main", + "key": "Down", + "title": "下移", + "area": 'listbtnarea', + "children": [] + }, + { + "id": "0001ZG10000000000X7T", + "type": "button_main", + "key": "SettingTop", + "title": "置顶", + "area": 'listbtnarea', + "children": [] + }, + { + "id": "0001ZG10000000000X7G", + "type": "button_main", + "key": "SettingBottom", + "title": "置底", + "area": 'listbtnarea', + "children": [] + } +] +}; + +/*QqOYif2dFZXT39A6hY82WQIEANXc0ECdakPiQJg68d0=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/events/index.js b/src/ssctpaaa/sscsetting/sscpriority/config/events/index.js new file mode 100644 index 0000000..66ab623 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/events/index.js @@ -0,0 +1,9 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ + +import initTemplate from './initTemplate'; +import buttonClick from './buttonClick'; +import afterEvent from './afterEvent'; + +export { buttonClick,initTemplate,afterEvent}; + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/events/initTemplate.js b/src/ssctpaaa/sscsetting/sscpriority/config/events/initTemplate.js new file mode 100644 index 0000000..2d20b06 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/events/initTemplate.js @@ -0,0 +1,102 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import "ssccommon/components/globalPresetVar"; +import { setTableExtendCol } from "ssccommon/components/profile"; +import tableExtendButtonClick from './tableExtendButtonClick'; +import {getMultiLang} from 'nc-lightapp-front'; + +//变量设置规范,如需要 +window.presetVar = { + ...window.presetVar, + head: { + treeId: "WorkGroupTree", + tableId: "SSCPriority", + tableExtendBtnArea:"listbtnarea", + modalId: "mainModal" + } +}; + +export default function(props) { + let _this = this; + + let createUIDomPromise = new Promise((resolve, reject) => { + props.createUIDom( + { + // pagecode: "700106SYXJ_list_001", //页面id + // appid: "0001ZG10000000000TBY", //注册按钮的id + // appcode: "700106SYXJ" + }, + (data) => { + resolve(data); + } + ) + }) + + let getMultiLangPromise = new Promise((resolve, reject) => { + getMultiLang({ + moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: (json) => { + resolve(json); + } + }) + }) + + Promise.all([createUIDomPromise, getMultiLangPromise]).then((resultList) => { + let data = resultList[0]; + let json = resultList[1]; + let meta = data.template; + let buttons = data.button; + // 静态模板? + meta[window.presetVar.head.modalId] = data.template['SSCPriority_form']; + // 设置form编辑态 + meta[window.presetVar.head.modalId].status = 'edit'; + //let buttons = button.concat(fixTemplate.extendButtons); + props.meta.setMeta(meta); + props.button.setButtons(buttons); + //设置按钮行为为弹窗 + props.button.setPopContent('Delete_list', json['701001RWCL-0039']) /* 确定要删除吗? */ + // 设置默认显示的按钮 + props.button.setButtonsVisible({ Add: true, Edit: true, Delete: true, Save: false, Cancel: false }); + // 默认禁用 + props.button.setButtonDisabled(['Add', 'Edit', 'Delete'], true); + // 设置操作按钮的事件 + setTableExtendCol(props, meta, [{ + width: '180px', + areaId: window.presetVar.head.tableId, + btnAreaId: window.presetVar.head.tableExtendBtnArea, + buttonVisible: (record, index) => { + if (_this.state.isAdjustOrder) { + return ['SettingTop', 'Up', 'Down', 'SettingBottom'] + } else { + return ['Edit_list', 'Delete_list'] + } + + }, + buttonLimit: 4, + onButtonClick: tableExtendButtonClick.bind(_this) + }]); + }) + + props.renderItem( + "form", + window.presetVar.head.modalId, + "formula", +
    + { + this.formulaInputId = ref; + }} + className="formula-input nc-theme-from-input-bgc nc-theme-form-input-c nc-theme-form-input-bc" + /> + { + this.openFormula(); + }} + style={{ cursor: "pointer" }} + /> +
    + ); +} + + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/events/tableExtendButtonClick.js b/src/ssctpaaa/sscsetting/sscpriority/config/events/tableExtendButtonClick.js new file mode 100644 index 0000000..ec73286 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/events/tableExtendButtonClick.js @@ -0,0 +1,91 @@ +/*ftMVHn90Wklge8LW19nRRZY+V69Lomh4Egnv/oC6QaLjFUOsrhPJCK7CcVE6BSh9*/ +import requestApi from "../requestApi"; +/** + * 表格扩展按钮click事件 + */ +function tableExtendButtonClick() { + return { + ['Delete_list'] : (record, index) => { + let headData = this.props.editTable.getAllRowsRemoveKeys(window.presetVar.head.tableId,["opr"]); + let pk_priority = headData[index].values.pk_priority.value; + if (pk_priority != "") { + let reqData = {}; + reqData.head = { + areaType: "form", + areacode: "head", + rows: [headData[index]] + }; + reqData.head.rows[0].status = "3"; + reqData.userjson = headData[index].values.pk_workinggroup.value; + requestApi.saveFormData({ + data: reqData, + success: data => { + if (data) { + this.props.editTable.setTableData(window.presetVar.head.tableId,data[window.presetVar.head.tableId]); + } else { + this.props.editTable.setTableData(window.presetVar.head.tableId,{ rows: [] }); + } + } + }); + } + }, + ['Edit_list'] : (record, index) => { + this.setState({ showAddModal: true, isHeadEdit: true }); + this.props.form.setFormStatus(window.presetVar.head.modalId, "edit"); + let headValues = this.props.editTable.getAllRowsRemoveKeys(window.presetVar.head.tableId,["opr", "numberindex"])[index].values; + this.formulaInputValue = headValues.formula.value !=undefined ?headValues.formula.value :''; + let formValues = { + rows:[{values:headValues}] + } + this.props.form.setAllFormValue({ [window.presetVar.head.modalId]: formValues }); + if(headValues.upgraderule.value=='none'){ + this.props.form.setFormItemsDisabled(window.presetVar.head.modalId, { 'upgraderulenum': true }); + this.props.form.setFormItemsRequired(window.presetVar.head.modalId,{'upgraderulenum':false}); // 必输晋级时间字段 + }else { + this.props.form.setFormItemsDisabled(window.presetVar.head.modalId, { 'upgraderulenum': false }); + this.props.form.setFormItemsRequired(window.presetVar.head.modalId,{'upgraderulenum':true}); // 必输晋级时间字段 + } + }, + ['Up'] : (record, index) => { + if(index!=0){ + this.props.editTable.setValByKeyAndIndex(window.presetVar.head.tableId, index-1, 'ordernum', {value: record.values.ordernum.value, display:record.values.ordernum.value}); + this.props.editTable.setValByKeyAndIndex(window.presetVar.head.tableId, index, 'ordernum', {value: parseInt(record.values.ordernum.value)-1, display:parseInt(record.values.ordernum.value)-1}); + this.props.editTable.moveRow(window.presetVar.head.tableId,index, index-1); + this.props.editTable.setRowStatus(window.presetVar.head.tableId, [index,index-1], '1'); + } + }, + ['Down'] : (record, index) => { + let totalIndex = this.props.editTable.getNumberOfRows(window.presetVar.head.tableId); + if(index!=totalIndex-1){ + this.props.editTable.setValByKeyAndIndex(window.presetVar.head.tableId, index+1, 'ordernum', {value: record.values.ordernum.value, display:record.values.ordernum.value}); + this.props.editTable.setValByKeyAndIndex(window.presetVar.head.tableId, index, 'ordernum', {value: parseInt(record.values.ordernum.value)+1, display:parseInt(record.values.ordernum.value)+1}); + this.props.editTable.moveRow(window.presetVar.head.tableId,index, index+1); + this.props.editTable.setRowStatus(window.presetVar.head.tableId, [index,index+1], '1'); + } + }, + ['SettingTop'] : (record, index) => { + this.props.editTable.setRowPosition(window.presetVar.head.tableId,index,'up'); + let tableData = this.props.editTable.getAllData(window.presetVar.head.tableId); + let changeIndex = [] + tableData.rows.map((row,idx)=>{ + this.props.editTable.setValByKeyAndIndex(window.presetVar.head.tableId, idx, 'ordernum', {value:idx+1, display:idx+1}); + changeIndex.push(idx); + }) + this.props.editTable.setRowStatus(window.presetVar.head.tableId, changeIndex, '1'); + }, + ['SettingBottom'] : (record, index) => { + this.props.editTable.setRowPosition(window.presetVar.head.tableId,index,'down'); + let tableData = this.props.editTable.getAllData(window.presetVar.head.tableId); + let changeIndex = [] + tableData.rows.map((row,idx)=>{ + this.props.editTable.setValByKeyAndIndex(window.presetVar.head.tableId, idx, 'ordernum', {value:idx+1, display:idx+1}); + changeIndex.push(idx); + }) + this.props.editTable.setRowStatus(window.presetVar.head.tableId, changeIndex, '1'); + }, + } +} + + +export default tableExtendButtonClick; +/*ftMVHn90Wklge8LW19nRRZY+V69Lomh4Egnv/oC6QaLjFUOsrhPJCK7CcVE6BSh9*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/index.js b/src/ssctpaaa/sscsetting/sscpriority/config/index.js new file mode 100644 index 0000000..b19d4a7 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/index.js @@ -0,0 +1,8 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react'; +import ReactDOM from 'react-dom'; +import TreeTable from './TreeTable'; + +ReactDOM.render( + , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/index.less b/src/ssctpaaa/sscsetting/sscpriority/config/index.less new file mode 100644 index 0000000..f8ef041 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/index.less @@ -0,0 +1,89 @@ +.formula-div { + width: 100%; + height: 30px; + position: relative; + .formula-input { + border: 1px solid #DBDBDB; + outline:none; + color: #292e35; + padding: 0 8px; + border-radius: 4px; + font-size: 13px; + width: 100%; + height: 100%; + position: relative; + display: inline-block; + background-color: #fff; + background-image: none; + letter-spacing: normal; + word-spacing: normal; + text-transform: none; + text-indent: 0px; + text-shadow: none; + text-rendering: auto; + text-align: start; + } + .icon-refer{ + position: absolute; + right: 1px; + top: 1px; + z-index: 0; + &::after { + font-family: 'iconfont'; + content: '\E62A'; + color: #999; + font-size: 16px; + width: 18px; + height: 26px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + } + } + } +.ssccenter{ + width:200px; + margin-left: 14px; +} +.tree-table{ + height: calc(~"100% - 114px") +} + +#sscpriority { + .right-area { + padding: 0px 0px; + } + .header{ + height: 46px; + .title{ + font-weight: bold; + } + } + .header-middle { + margin-left: 30px !important; + } + .dragWidthCom_left { + height: auto; + } +} + +.ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 3px; + margin-top: 9px; +} + +.ssc_edit_modal_form{ + margin-right: 30px; +} + +.u-table-content .u-table-thead tr{ + border-top:0px !important; +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscpriority/config/requestApi.js b/src/ssctpaaa/sscsetting/sscpriority/config/requestApi.js new file mode 100644 index 0000000..ee55f21 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscpriority/config/requestApi.js @@ -0,0 +1,75 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import requestApi from "ssccommon/components/requestApi"; +import { ajax } from 'nc-lightapp-front'; + + + +let requestDomain = ''; +let requestApiOverwrite = { + ...requestApi, + + query: (opt) => { + ajax({ + url: opt.url || `${requestDomain}/nccloud/erm/erbudgetmg/FysqViewBillAction.do`, + data: opt.data, + success: (data) => { + opt.success(data); + } + }) + }, + // 查询树节点 + queryTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/QueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + getTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCPriorityQryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + saveTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCPrioritySaveAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + saveFormData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCPrioritySaveAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + queryPublicFields: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/QueryPublicFieldAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + } + +} + +export default requestApiOverwrite; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/sscunit/config/events/afterEvent.js new file mode 100644 index 0000000..6806848 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/events/afterEvent.js @@ -0,0 +1,17 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +/** + * 组件编辑后事件 + * @param {} props + * @param {*} moduleId + * @param {*} key + * @param {*} value + */ +export default function afterEvent(props,moduleId,key,value) { + switch(moduleId) { + case 'body1' : + break; + case 'main' : + break; + } +}; +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/sscunit/config/events/buttonClick.js new file mode 100644 index 0000000..fe62476 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/events/buttonClick.js @@ -0,0 +1,51 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from "../requestApi"; + +/** + * 新增按钮点击 + */ +let addButtonClick = function () { + //清空表单 + this.props.form.EmptyAllFormValue([this.formId]); + this.setState({ showFormModal: true }); +}; + +/** + * 保存按钮点击 + */ +let saveFormButtonClick = function () { + let formData = this.props.form.getAllFormValue(this.formId); + //表单验证 + if (!this.props.form.isCheckNow(this.formId)) { + return; + } + //兼容接口数据 + if (formData.rows[0].values.enablestate.value === true || formData.rows[0].values.enablestate.value === "2") { + formData.rows[0].values.enablestate.value = "2"; + } else { + formData.rows[0].values.enablestate.value = "3"; + } + let sscunitForm = { form: formData }; + requestApi.saveFormData({ + data: sscunitForm, + success: res => { + this.setState({ + data: res ? res[this.formId].rows : [], + multiLangName: res ? JSON.parse(decodeURIComponent(res.userjson)) : [], + showFormModal: false + }); + } + }); +}; + +/** + * 取消按钮点击 + */ +let cancelFormButtonClick = function () { + this.setState({ showFormModal: false }); + this.props.form.EmptyAllFormValue([this.formId]); +}; + +export default { addButtonClick, saveFormButtonClick, cancelFormButtonClick }; + +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/events/index.js b/src/ssctpaaa/sscsetting/sscunit/config/events/index.js new file mode 100644 index 0000000..e242bf4 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/events/index.js @@ -0,0 +1,12 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick'; +import afterEvent from './afterEvent'; +import initTemplate from './initTemplate'; + +export { initTemplate,buttonClick, afterEvent}; + + + + + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/events/initTemplate.js b/src/ssctpaaa/sscsetting/sscunit/config/events/initTemplate.js new file mode 100644 index 0000000..34e7255 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/events/initTemplate.js @@ -0,0 +1,21 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +/** + * 数据初始化 + * @param {} props + */ +export default function (props) { + + props.createUIDom( //请求模板 + { + pagecode: '700101GXZX_C',//页面编码 + appcode: '700101GXZX'//小应用编码 + }, + function (data) { + let meta = data.template; + // 设置表格编辑态 + meta["sscunit_card"].status = 'edit'; + props.meta.setMeta(meta); //渲染模板 + }); +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/index.js b/src/ssctpaaa/sscsetting/sscunit/config/index.js new file mode 100644 index 0000000..b2e703e --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React from 'react'; +import ReactDOM from 'react-dom'; +import SSCUnit from './sscunit'; +ReactDOM.render( + , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/index.less b/src/ssctpaaa/sscsetting/sscunit/config/index.less new file mode 100644 index 0000000..ba8d5aa --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/index.less @@ -0,0 +1,161 @@ +@import "~base"; + +.content-wrap { + // box-shadow:0px 1px 1px 0px rgba(74,81,93,0.1); + border-radius:3px; + height: 100%; + min-height: 585px; + + div.nc-singleTable-header-area { + border-top-left-radius: 3px !important; + border-top-right-radius: 3px !important; + } +} + +.content-wrap .form-content { + background: #fff; + padding-bottom: 10px; + padding-top: 20px; + margin-bottom: 8px; +} +.content-wrap .form-content .ssc-form { + box-shadow: 0 1px 2px 0 rgba(200, 200, 200, 0.5); + margin-bottom: 10px; + margin-left: 40px; + margin-right: 240px; + width:auto; + min-height:150px; + background:rgba(255,255,255,1); + border-radius:3px; + border:1px solid rgba(206,206,206,0.75); + .head-grow { + margin: 20px 0px 11px; + width: 100%; + height: 24px; + font-size:17px; + font-family:PingFangSC-Medium; + color:rgba(17,17,17,1); + line-height:24px; + position: relative; + .head-label { + white-space: nowrap; + position: absolute; + left: 94px; + } + .head-label span { + font-size: 15px; + font-weight: bold; + } + .head-btn { + position: absolute; + right: 30px; + .btn { + margin-left: 22px; + font-size:14px; + font-family:PingFangHK-Regular; + color:#007ACE; + line-height:21px; + cursor: pointer; + outline: none; + } + } + span.customer-label[aria-describedby="delConfirmId"] { + color: #007ACE; + } + } + .grow { + margin-bottom: 11px; + padding-left:94px; + width:100%; + height:auto; + font-size:13px; + font-family:MicrosoftYaHei; + line-height:21px; + .column-1-1{ + width: 100% + } + .grow-label-name { + float:left; + width: 120px; + margin-right: 15px; + height:21px; + text-align:right; + color:rgba(85,85,85,1); + } + .grow-label-value { + display: block; + overflow: hidden; + zoom: 1; + color: #111111; + word-wrap: break-word; + word-break: break-all; + } + } +} + +.avatar-box { + position: absolute; + width: 25px; + height: 25px; + background:rgba(255,179,84,1); + border-radius: 50%; + left: -45px; +} + +.img{ + position: absolute; + width: 40px; + height:40px; + left: -35px; +} + +.itemText{ + display: inline-block; + width: 120px; + text-align: right; + margin-right: 15px; + color:rgba(85,85,85,1); +} + +.u-button{ + min-width: 60px!important; +} + +.ssc_edit_modal_form{ + margin-right: 30px; +} + +.content-wrap .form-content .ssc-form .grow .grow-label-value{ + margin-right:30px; +} + +.page-title-Icon { + margin: 0 8px 0 20px; +} + +.u-switch { + display: inline-block !important; +} + +.junior { + .u-modal-body { + height: 206px !important; + } +} +.nc-singleTable-header-area{ + border-radius: 0!important; +} + +.nc-single-table { + display: flex; + flex-direction: column; +} +.nc-singleTable-table-area { + flex: 1; + display: flex; + flex-direction: column; +} + +.content-wrap .form-content { + flex: 1; +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/requestApi.js b/src/ssctpaaa/sscsetting/sscunit/config/requestApi.js new file mode 100644 index 0000000..c63ebea --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/requestApi.js @@ -0,0 +1,79 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import {ajax} from 'nc-lightapp-front'; +/** + * 后台接口 + */ +let requestApi = { + + //单据模板接口 + tpl: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitTempletAction.do', + data: opt.data, + success: opt.success + }); + }, + + //查询共享中心 + query:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + // 保存表单 + saveFormData:(opt) =>{ + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitAddAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + // 删除表单 + delFormData:(opt)=>{ + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitDeleteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + + //停用 + disableSSCUnit:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitStopAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + + //启用 + enableSSCUnit:(opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUnitStartAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + } + +} +export default requestApi; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/sscunit/config/sscunit.js b/src/ssctpaaa/sscsetting/sscunit/config/sscunit.js new file mode 100644 index 0000000..e1223e8 --- /dev/null +++ b/src/ssctpaaa/sscsetting/sscunit/config/sscunit.js @@ -0,0 +1,304 @@ +/*RonKowrvrGNVYvIZbpH2UWcmWrCJOZn5Kkgd45/8LgM=*/ +import React, { Component } from "react"; +import { createPage, base, createPageIcon, toast } from "nc-lightapp-front"; +import { initTemplate, buttonClick } from "./events"; +import requestApi from "./requestApi"; +import { Nav } from "ssccommon/components/global-nav"; +import "./index.less"; +import gxicon1 from '../../../public/image/gxicon1.png'; +import gxicon2 from '../../../public/image/gxicon2.png'; +import gxicon3 from '../../../public/image/gxicon3.png'; +import gxicon4 from '../../../public/image/gxicon4.png'; +import gxicon5 from '../../../public/image/gxicon5.png'; +import { + ProfileStyle, + ProfileHead, + ProfileBody, + ButtonGroup, + HeadCenterCustom, + ProfileSearch, + NonstandardButtonGroup +} from 'ssccommon/components/profile'; +import PubMessage from 'ssccommon/utils/pubMessage'; + +const { NCModal, NCButton, NCPopconfirm, NCTableSwitch, NCDiv } = base; + +import { + nccGetTheme, +} from 'ssccommon/utils/asyncFunctions.js'; + +/** + * 创建共享中心 + */ +class SSCUnit extends Component { + constructor(props) { + super(props); + this.props = props; + this.formModalId = "formModal"; // 新增/编辑modal关闭 + this.formId = "sscunit_card"; // 新增表单组件模板id + this.pubMessage = new PubMessage(); //公共toast提示 + this.state = { + showFormModal: false, // 新增/编辑表单模态显示 + data: [], //共享中心数据列表 + isBlackTheme: false, + }; + //初始化 + initTemplate.call(this, props); + } + + componentDidMount() { + this._getTheme() + + requestApi.query({ + data: {}, + success: data => { + this.setState({ data: data ? data[this.formId].rows : [], multiLangName: data ? JSON.parse(decodeURIComponent(data.userjson)) : [] }); + } + }); + } + + _getTheme = async () => { + const theme = await nccGetTheme() + const isBlackTheme = theme === 'black' + this.setState({isBlackTheme}) + } + + //列表区域jsx + drawFormList = () => { + let formList = []; + let imgList = [gxicon1, gxicon2, gxicon3, gxicon4, gxicon5]; + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + const sscFormStyle = this.state.isBlackTheme ? {boxShadow: 'none'} : {} + this.state.data.map((item, index) => { + let values = item.values; + //拼接自动化测试标记 + let itemFieldId = []; + values.pk_org && itemFieldId.push(values.pk_org.display); + values.code && itemFieldId.push(values.code.value); + formList.push( + +
    +
    + + + {/*  */} + {/*saddsadasdasdasdasdasdasdasdasd*/} + {item.values.code.value + ":"} + {this.state.multiLangName[index]} + + + + {/*701001RWCL-0099:确定停用共享中心?,701001RWCL-00100:确定启用共享中心?*/} + { + this.onChange(item.values.pk_unit.value); + }} + > + + + + + + { + this.editForm(item.values.pk_unit.value); + }} + tabindex={0} + >{/*"701001RWCL-0038": "修改"*/} + {multiLang && multiLang.get('701001RWCL-0038')} + + + {/*"701001RWCL-0039": "确认删除?"*/} + { + this.delForm(item.values.pk_unit.value); + }} + > + {/*"7010-0002": "删除",*/} + {multiLang && multiLang.get('7010-0002')} + + + +
    +
    +
    + {/*"701001RWCL-0040": "对应组织"*/} + {multiLang && multiLang.get('701001RWCL-0040')} + + {item.values.pk_org.display} + +
    +
    +
    +
    + {/*"701001RWCL-0041": "备注"*/} + {multiLang && multiLang.get('701001RWCL-0041')} + + {item.values.remark ? item.values.remark.value : ""} + +
    +
    +
    +
    + ); + }); + return formList; + }; + + // 删除表单 + delForm = pk => { + let newData = this.state.data.filter(item => { + return pk === item.values.pk_unit.value; + }); + let findIdx = -1, index = -1 + while (++index < this.state.data.length) { + if (pk === this.state.data[index].values.pk_unit.value) { + findIdx = index + break + } + } + let sscunitForm = { form: { areaType: "form", rows: newData } }; + // 请求删除 + requestApi.delFormData({ + data: sscunitForm, + success: res => { + const {multiLangName} = this.state + multiLangName.splice(findIdx, 1) + this.setState({ data: res ? res[this.formId].rows : [], multiLangName }); + this.pubMessage.deleteSuccess(); + } + }); + }; + // 修改表单 + editForm = pk => { + this.setState({ showFormModal: true }); + let editFormItem = this.state.data.filter(item => { + return pk == item.values.pk_unit.value; + }); + editFormItem = JSON.parse(JSON.stringify(editFormItem)); + this.props.form.setAllFormValue({ [this.formId]: { rows: editFormItem } }); + }; + + //请求启用/停止 + onChange = (pk) => { + let newData = this.state.data.filter(item => { + return pk === item.values.pk_unit.value; + }); + if (newData[0].values.enablestate.value != "2") { + let sscunitForm = { form: { areaType: "form", rows: newData } }; + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + requestApi.enableSSCUnit({ + data: sscunitForm, + success: res => { + this.setState({ data: res ? res[this.formId].rows : [] }); + // "701001RWCL-0043": "启用成功" + toast({ title: multiLang && multiLang.get('701001RWCL-0043')}) + } + }); + } else { + newData[0].values.enablestate.value = "2"; + let sscunitForm = { form: { areaType: "form", rows: newData } }; + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + requestApi.disableSSCUnit({ + data: sscunitForm, + success: res => { + this.setState({ data: res ? res[this.formId].rows : [] }); + + // "701001RWCL-0044": "停用成功" + toast({ title: multiLang && multiLang.get('701001RWCL-0044')}) + + } + }); + } + }; + + render() { + let { + form: { createForm } + } = this.props; + let formLists = this.drawFormList(); + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + return ( +
    +
    + ); + } +} + +let SSCUnitDom = createPage({ + mutiLangCode: '7010' +})(SSCUnit); +export default SSCUnitDom; + +/*RonKowrvrGNVYvIZbpH2UWcmWrCJOZn5Kkgd45/8LgM=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/widgets/spgz/config.json b/src/ssctpaaa/sscsetting/widgets/spgz/config.json new file mode 100644 index 0000000..64682f9 --- /dev/null +++ b/src/ssctpaaa/sscsetting/widgets/spgz/config.json @@ -0,0 +1,4 @@ +{ + "template": "widget.html", + "hash": false +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/widgets/spgz/index.js b/src/ssctpaaa/sscsetting/widgets/spgz/index.js new file mode 100644 index 0000000..0b903f1 --- /dev/null +++ b/src/ssctpaaa/sscsetting/widgets/spgz/index.js @@ -0,0 +1,125 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import './index.less'; +import {ajax, createPage,getMultiLang} from 'nc-lightapp-front' + +class Spgz extends Component { + constructor(props) { + super(props); + this.state = { + json: {} + } + } + componentWillMount() { + let callback = (json) => { + this.setState({json}) + } + getMultiLang({moduleId: 7010, currentLocale: 'zh-CN',domainName: 'ssctp',callback}) + } + componentDidMount() { + // ajax({ + // url: '/nccloud/erm/expdetail/LoanBalanceWidgetAction.do', + // data: {}, + // loading: false, + // success: (res) => { + // let data = res.data; + // let { tocommit, todo } = this.state; + // let callback= (json) => { + // if(data.bbye != null){ + // if(data.bbye.split(".").length == 1){ + // tocommit = (data.bbye+'.00'); + // }else if(data.bbye.split(".").length == 2){ + // // if(data.bbye.split(".").length == 1){ + // // document.getElementById('tocommit').innerHTML+=(data.bbye+'0'); + // // } + // let bbye = data.bbye.split(".") + // let decimalPart = bbye[1].length == 1 ? (bbye[1] + '0') : bbye[1].substr(0,2) + // let totalPart = `${bbye[0]}.${decimalPart}` + // tocommit = totalPart + // }else{ + // tocommit = (data.bbye); + // } + // todo = data.name; + // }else{ + // // "201112GRYE-0001": "人民币", + // todo = json['201112GRYE-0001']; + // } + // this.setState({ + // tocommit, todo + // }) + // } + // // getMultiLang({moduleId: 2011, location: '/src/erm/public/lang/standard/zh-CN/2011-zh-CN.json',currentLocale: 'zh-CN',callback}) + // getMultiLang({moduleId: 2011, domainName: 'erm',currentLocale: 'zh-CN',callback}) + // } + // }); + } + open = (event, para = null) => { + event.stopPropagation() + // if(para){ + // // window.parent.openNew({code:'105602BZPT',name:'报账平台'}, {tab: para}); + // this.props.openTo( + // '/ssctp/sscsetting/approvalrules/config/index.html', + // { + // // pagecode: '201112GRYE_Q', + // // appcode: '201112LBYE', + // // "701001RWCL-0181": "设置智能审批规则", + // name: this.state.json['701001RWCL-0181'], + // tab: para + // } + // ) + // }else{ + // // window.parent.openNew({code:'105602BZPT',name:'报账平台'}, null); + // this.props.openTo( + // '/erm/expdetail/broloanbalance/config/index.html', + // { + // pagecode: '201112GRYE_Q', + // appcode: '201112LBYE', + // // "201112GRYE-0002": "借款余额", + // name: this.state.json['201112GRYE-0002'] + // } + // ) + // } + this.props.openTo( + '/ssctp/sscsetting/approvalrules/config/index.html', + { + // pagecode: '201112GRYE_Q', + // appcode: '201112LBYE', + // "701001RWCL-0181": "设置智能审批规则", + name: this.state.json['701001RWCL-0181'], + tab: para + } + ) + } + render() { + // const { tocommit, todo } = this.state; + return ( + // "701001RWCL-0181": "设置智能审批规则", +
    {this.open(e, null);console.log(111111111)}}> +
    {this.state.json['701001RWCL-0181']}
    + {/*
    小部件
    */} +
    + +
    ssssssssssssssss
    + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/**/} + {/*
    {tocommit}
    {todo}
    */} +
    +
    + ); + } +} + +Spgz = createPage({ + mutiLangCode: '7010' +})(Spgz) +export default Spgz +// ReactDOM.render(, document.querySelector('#app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/widgets/spgz/index.less b/src/ssctpaaa/sscsetting/widgets/spgz/index.less new file mode 100644 index 0000000..688780e --- /dev/null +++ b/src/ssctpaaa/sscsetting/widgets/spgz/index.less @@ -0,0 +1,42 @@ +@import '~widgetsless'; + +#Spgz { + padding: 0 !important; + user-select: none; + + //.title { + // //font-size: 16px; + // font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, sans-serif; + // //color: #111111; + // //padding-top: 11px; + // //text-indent: 10px; + // //height: 32px; + //} + + .app-ye { + margin-top: 34px; + img{ + margin-left: 39%; + } + .app-ye-table { + width: 100%; + + .one { + #tocommit { + text-align: center; + line-height: 30px; + height: 30px; + font-size: 25px; + color: #F87321; + margin-bottom: 3px; + } + + #todo { + font-size: 15px; + color: #888888; + line-height: 19px; + } + } + } + } +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/events/afterEvent.js b/src/ssctpaaa/sscsetting/workinggroup/config/events/afterEvent.js new file mode 100644 index 0000000..9c859aa --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/events/afterEvent.js @@ -0,0 +1,53 @@ +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ +import requestApi from "../requestApi"; +/** + * form组件编辑后事件 + */ +export default function afterEvent(props, moduleId, key,changedrows, value,index,data) { + + switch(key) {//key为表单字段的attrcode + case 'billtype' : + let billtype = props.form.getFormItemsValue(this.formId,'billtype'); + let tranction = props.form.getFormItemsValue(this.formId,'tranction'); + requestApi.UpdateBilltype({ + data: { + billtype: billtype.value, + tranction: tranction.value + }, + success: res => { + let resvalue = {value:{},display:{}}; + resvalue.value = res.value; + resvalue.display = res.display; + props.form.setFormItemsValue(moduleId, { + tranction: resvalue + }); + } + }); + // props.form.setFormItemsValue(this.formId, { + // tranction: {} + // }); + break; + case 'standardtime' : + if(props.form.getFormItemsValue(this.formId,"standardtime").value>0){ + props.form.setFormItemsDisabled(this.formId,{'advancetime':false}) + }else { + // props.form.setFormItemsValue(this.formId,{"standardtime":{value:null,display:null}}); + props.form.setFormItemsDisabled(this.formId,{'advancetime':true}) + props.form.setFormItemsValue(this.formId,{"advancetime":{value:null,display:null}}); + } + break; + case 'advancetime' : + // if(parseInt(props.form.getFormItemsValue(this.formId,"advancetime").value)<=0){ + // props.form.setFormItemsValue(this.formId,{"advancetime":{value:null,display:null}}); + // } + // if(parseInt(props.form.getFormItemsValue(this.formId,"advancetime").value)>parseInt(props.form.getFormItemsValue(this.formId,"standardtime").value)){ + // toast({ + // color: "danger", + // content: "提前预警时间(小时)不能大于标准作业时间(小时)" + // }); + // // props.form.setFormItemsValue(this.formId,{"advancetime":{value:null,display:null}}); + // } + break; + } +}; +/*DncIqBreQz6WZRX+v7OzgYck/N8QqnGjlSwXHOEruow=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/events/formEveManager.js b/src/ssctpaaa/sscsetting/workinggroup/config/events/formEveManager.js new file mode 100644 index 0000000..07c740d --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/events/formEveManager.js @@ -0,0 +1,422 @@ +/*b9zSIuW+hz2B5CYjaIEfjKTxd7CCQI80KlePTTuMlxA=*/ +import { promptBox, toast } from "nc-lightapp-front"; +import requestApi from "./../requestApi"; + +/** + * @Author:gaoymf + * @Description:保存/更新按钮点击 + * @Date: 16:13 2018/6/11 + * @param: + */ +let saveFormButtonClick = function() { + let formListData = this.props.form.getAllFormValue(this.formId); + let multiLang = this.props.MutiInit.getIntl(7010); + formListData.rows[0].values.formula.value = this.formulaInputId == undefined? "": this.formulaInputId.value; + delete formListData.rows[0].status; + let editData = this.state.formListData.filter(formData => { + return ( + formData.values.pk_allotrule.value === + formListData.rows[0].values.pk_allotrule.value + ); + }); + + if (this.props.form.isCheckNow(this.formId)) { + if(parseInt(this.props.form.getFormItemsValue(this.formId,"standardtime").value)<=0){ + toast({ + color: "warning", + content: "标准作业时间(小时)必须大于0!" + }); + return + } + + if(parseInt(this.props.form.getFormItemsValue(this.formId,"advancetime").value)<=0){ + toast({ + color: "warning", + content: "提前预警时间(小时)必须大于0!" + }); + return + } + if(parseInt(this.props.form.getFormItemsValue(this.formId,"advancetime").value)>parseInt(this.props.form.getFormItemsValue(this.formId,"standardtime").value)){ + toast({ + color: "danger", + content: "提前预警时间(小时)不能大于标准作业时间(小时)" + }); + return + } + // 发送请求保存 + if ( + formListData.rows[0].values.pk_allotrule.value !== undefined && + formListData.rows[0].values.pk_allotrule.value !== null + ) { + //console.log("修改规则-保存", formListData.rows[0]); + // 模板中没有childrenVO 单独处理childrenVO,childrenVO做为后端ts校验用 + formListData.rows[0].values.childrenVO = editData[0].values.childrenVO; + formListData.rows[0].values.parentVO = editData[0].values.parentVO; + requestApi.updateFormData({ + data: formListData.rows[0], + success: res => { + toast({ + color: "success", + content: multiLang && multiLang.get('701001RWCL-0118') + }); + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let req = { + pk_workinggroup: selectNode.refpk, + enablestate: this.state.showDisabled + }; + queryFormListData.call(this, req); + this.closeModal(this.formModalId); + } + }); + } else { + // 特殊处理 ts数据 + delete formListData.rows[0].values.childrenVO; + delete formListData.rows[0].values.parentVO, + // console.log("新增规则-保存", formListData.rows[0]); + requestApi.saveFormData({ + data: formListData.rows[0], + success: res => { + toast({ + color: "success", + content: multiLang && multiLang.get('701001RWCL-0118') + }); + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let req = { + pk_workinggroup: selectNode.refpk, + enablestate: this.state.showDisabled + }; + queryFormListData.call(this, req); + this.closeModal(this.formModalId); + } + }); + } + } +}; + +/** + * @Author:gaoymf + * @Description:取消按钮点击 + * @Date: 16:15 2018/6/11 + * @param: + */ +let cancelFormButtonClick = function() { + this.props.form.EmptyAllFormValue(this.formId); + this.formulaInputValue = ""; + this.closeModal(this.formModalId); +}; + +/** + * @Author:gaoymf + * @Description:任务重置 + * @Date: 15:59 2018/6/12 + * @param: + */ +let resetButtonClick = function() { + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + color: "warning", // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0077'), //"重置任务" + content: multiLang && multiLang.get('701001RWCL-0073'),//该操作会重置任务,请确定? + beSureBtnClick: () => { + requestApi.resetTask({ + data: { + pk_sscunit: this.state.SSCCenter.refpk + }, + success: res => { + toast({title: multiLang && multiLang.get('701001RWCL-0162'), content: (multiLang && multiLang.get('701001RWCL-0163'))+res.resetnum+(multiLang && multiLang.get('701001RWCL-0076'))});//701001RWCL-0162:重置完成,701001RWCL-0163:已重置,701001RWCL-0076:条任务 + } + }); + } + }); +}; + +/** + * @Author:gaoymf + * @Description:新增 + * @Date: 14:59 2018/6/12 + * @param: + */ +let addFormButtonClick = function() { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let multiLang = this.props.MutiInit.getIntl(7010); + if (selectNode.isleaf) { + // 末级节点可以直接修改 + // 清空表单 + this.props.form.EmptyAllFormValue(this.formId); + // 初始化共享中心pk + this.props.form.setFormItemsValue(this.formId, { + pk_sscunit: { value: this.state.SSCCenter.refpk, display: "" } + }); + // 初始化工作组的pk + this.props.form.setFormItemsValue(this.formId, { + pk_workinggroup: { value: selectNode.refpk, display: "" } + }); + // 判断选中节点是父节点还是子节点 父节点共享环节非必填 子节点共享环节必填 + if (selectNode.isleaf) { + // 末级作业组的作业组规则共享环节是必填 + this.props.form.setFormItemsRequired(this.formId, { pk_sscnode: true }); + } else { + // 非末级作业组的作业组规则共享环节非必填 + this.props.form.setFormItemsRequired(this.formId, { pk_sscnode: false }); + } + // 初始化公式字段 + this.formulaInputValue = ""; + this.setState({ showFormModal: true }); + } else { + // 父级节点校验 + requestApi.checkParentHandleEnable({ + data: { pk_workinggroup: selectNode.refpk }, + success: res => { + if (!res) { + // 如果下级作业组有规则就不在允许修改规则 + //701001RWCL-0101:已存在下级作业组规则,不允许修改规则 + toast({ + color: "danger", + content: multiLang && multiLang.get('701001RWCL-0101') + }); + } else { + // 清空表单 + this.props.form.EmptyAllFormValue(this.formId); + // 初始化共享中心pk + this.props.form.setFormItemsValue(this.formId, { + pk_sscunit: { value: this.state.SSCCenter.refpk, display: "" } + }); + // 初始化工作组的pk + this.props.form.setFormItemsValue(this.formId, { + pk_workinggroup: { value: selectNode.refpk, display: "" } + }); + // 判断选中节点是父节点还是子节点 父节点共享环节非必填 子节点共享环节必填 + if (selectNode.isleaf) { + // 末级作业组的作业组规则共享环节是必填 + this.props.form.setFormItemsRequired(this.formId, { + pk_sscnode: true + }); + } else { + // 非末级作业组的作业组规则共享环节非必填 + this.props.form.setFormItemsRequired(this.formId, { + pk_sscnode: false + }); + } + // 初始化公式字段 + this.formulaInputValue = ""; + this.setState({ showFormModal: true }); + } + } + }); + } +}; +/** + * @Author:gaoymf + * @Description:保存上级 + * @Date: 18:58 2018/6/12 + * @param: + */ +let saveParentRulesClick = function() { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + requestApi.copyParentRule({ + data: selectNode, + success: res => { + //console.log("同步上级作业组规则返回", res); + this.setState({ formListData: res }); + } + }); +}; + +/** + * @Author:gaoymf + * @Description:删除点击 + * @Date: 18:58 2018/6/12 + * @param: + */ +let delFormButtonClick = function(pk) { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let multiLang = this.props.MutiInit.getIntl(7010); + if (selectNode.isleaf) { + var newData = this.state.formListData.filter(item => { + return pk == item.values.pk_allotrule.value; + }); + requestApi.delFormData({ + data: newData[0], + success: res => { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let req = { + pk_workinggroup: selectNode.refpk, + enablestate: this.state.showDisabled + }; + queryFormListData.call(this, req); + toast({ + title: multiLang && multiLang.get('701001RWCL-0042') + }); + } + }); + } else { + // 父级节点校验 + requestApi.checkParentHandleEnable({ + data: { pk_workinggroup: selectNode.refpk }, + success: res => { + if (!res) { + // 如果下级作业组有规则就不在允许修改规则 + //701001RWCL-0101:已存在下级作业组规则,不允许修改规则 + toast({ + color: "danger", + content: multiLang && multiLang.get('701001RWCL-0101') + }); + } else { + var newData = this.state.formListData.filter(item => { + return pk == item.values.pk_allotrule.value; + }); + requestApi.delFormData({ + data: newData[0], + success: res => { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let req = { + pk_workinggroup: selectNode.refpk, + enablestate: this.state.showDisabled + }; + queryFormListData.call(this, req); + toast({ + title: multiLang && multiLang.get('701001RWCL-0042') + }); + } + }); + } + } + }); + } +}; + +/** + * @Author:gaoymf + * @Description:修改点击 + * @Date: 19:00 2018/6/12 + * @param: + */ +let editFormButtonClick = function(pk) { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let multiLang = this.props.MutiInit.getIntl(7010); + if (selectNode.isleaf) { + this.setState({ showFormModal: true }); + let editFormItem = this.state.formListData.filter(item => { + return pk == item.values.pk_allotrule.value; + }); + // 公式编辑器单独复制 + this.formulaInputValue = editFormItem[0].values.formula.value; + this.props.form.setAllFormValue({ + [this.formId]: { rows: JSON.parse(JSON.stringify(editFormItem)) } + }); + this.props.form.setFormItemsValue(this.formId,{'formula':{'value':this.formulaInputValue,'display':this.formulaInputValue}}); + if(editFormItem[0].values.standardtime && editFormItem[0].values.standardtime.value){ + // 标准作业时间有值 + this.props.form.setFormItemsDisabled(this.formId,{'advancetime':false}) + }else { + // 标准作业时间没值 + this.props.form.setFormItemsDisabled(this.formId,{'advancetime':true}) + } + } else { + // 父级节点校验 + requestApi.checkParentHandleEnable({ + data: { pk_workinggroup: selectNode.refpk }, + success: res => { + if (!res) { + // 如果下级作业组有规则就不在允许修改规则 + //701001RWCL-0101:已存在下级作业组规则,不允许修改规则 + toast({ + color: "danger", + content: multiLang && multiLang.get('701001RWCL-0101') + }); + } else { + this.setState({ showFormModal: true }); + let editFormItem = this.state.formListData.filter(item => { + return pk == item.values.pk_allotrule.value; + }); + // 公式编辑器单独复制 + this.formulaInputValue = editFormItem[0].values.formula.value; + this.props.form.setAllFormValue({ + [this.formId]: { rows: JSON.parse(JSON.stringify(editFormItem)) } + }); + this.props.form.setFormItemsValue(this.formId,{'formula':{'value':this.formulaInputValue,'display':this.formulaInputValue}}); + } + } + }); + } +}; + +// 查询表单列表 +function queryFormListData(req) { + requestApi.queryFormListData({ + data: req, + success: res => { + // console.log("规则查询返回", res); + if (res.length == 0) { + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + let request = { pk_workinggroup: selectNode.pid, enablestate: false }; + requestApi.queryParentFormListData({ + data: request, + success: res => { + if (res.length > 0) { + // 当前节点规则为空&&上级工作组有规则出现Pop提示拉取上级规则 + this.setState({ isShowPop: true }); + } + } + }); + } + this.setState({ + formListData: res, + isShowPop: false, + disabledBtn: false + }); + } + }); +} + +/** + * @Author:yushuaif + * @Description:NCTableSwitch Change + * @Date: 15:00 2018/6/14 + * @param {pk} String + * @param {e} Boolean 开关新状态 + * @return {} Undefined + */ +let tableSwitchChange = function(pk, e) { + // 请求启用/停止 + let data = this.state.formListData.filter(item => { + return item.values.pk_allotrule.value == pk; + }); + data[0].values.enablestate.value = e; + let req = data[0]; + let multiLang = this.props.MutiInit.getIntl(7010); + // 启用/停用 + requestApi.changeEnableState({ + data: req, + success: res => { + let qReq = { + pk_workinggroup: this.props.syncTree.getSelectNode(this.treeId).refpk, + enablestate: this.state.showDisabled + }; + queryFormListData.call(this, qReq); + if (e) { + toast({ + title: multiLang && multiLang.get('701001RWCL-0043') + }); + } else { + toast({ + title: multiLang && multiLang.get('701001RWCL-0044') + }); + } + } + }); +}; + +export default { + addFormButtonClick, + saveFormButtonClick, + cancelFormButtonClick, + saveParentRulesClick, + delFormButtonClick, + editFormButtonClick, + queryFormListData, + resetButtonClick, + tableSwitchChange +}; + +/*b9zSIuW+hz2B5CYjaIEfjKTxd7CCQI80KlePTTuMlxA=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/events/index.js b/src/ssctpaaa/sscsetting/workinggroup/config/events/index.js new file mode 100644 index 0000000..e32cd3d --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/events/index.js @@ -0,0 +1,9 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import initTemplate from './initTemplate'; +import formEveManager from './formEveManager'; +import treeEveManager from './treeEveManager'; +import query from './query'; +import afterEvent from './afterEvent'; + +export { initTemplate, formEveManager, treeEveManager, query, afterEvent }; +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/events/initTemplate.js b/src/ssctpaaa/sscsetting/workinggroup/config/events/initTemplate.js new file mode 100644 index 0000000..06934e1 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/events/initTemplate.js @@ -0,0 +1,105 @@ +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ +import { getMultiLang } from 'nc-lightapp-front'; + +export default function (props) { + + const _this = this; + //获取模板 + props.createUIDom({}, + (data) => { + //获取多语 + getMultiLang({ + moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: (json) => { + data.template.tranctionlist.items.map((item) => { + if (item.attrcode == 'pk_billtypecode') { + item.itemtype = 'label' + } + }) + //模板数据处理 + data.template.listForm.items.map((item) => { + if (item.attrcode == 'pk_sscnode') { + // item.refcode = '/ssctp/refer/sscbd/SSCNodeGridRef/index.js' + } else if (item.attrcode == 'billtype') { + item.refcode = '/uap/refer/riart/billtype/index.js' + } else if (item.attrcode == 'tranction') { + // item.refcode = '/uap/refer/riart/transtype/index.js' + } else if (item.attrcode == 'group') { + item.refcode = 'uapbd/refer/org/BusinessUnitTreeRef/index.js' + item.isShowUnit = true; + item.isRunWithChildren = false; + item.unitProps = { + placeholder: json['701001RWCL-0078'],//701001RWCL-0078: + refName: json['701001RWCL-0078'], + refType: "tree", + refCode: "uapbd.org.GroupDefaultTreeRef", + queryTreeUrl: "/nccloud/uapbd/ref/GroupDefaultTreeRef.do", + rootNode: { refname: json['701001RWCL-0078'], refpk: "root" }, + } + } + }) + + let BilltypeRefSqlBuilder = 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.BilltypeRefSqlBuilder'; + let TranstypeRefSqlBuilder = 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.TranstypeRefSqlBuilder'; + let BusinessUnitRefSqlBuilder = 'nccloud.web.ssctp.sscbd.ref.sqlbuilder.BusinessUnitRefSqlBuilder' + + data.template.listForm.items.find((item) => { + + if (item.attrcode === "billtype") { + item.queryCondition = function () { + return { GridRefActionExt: BilltypeRefSqlBuilder }; + } + } else if (item.attrcode === "tranction") { + item.queryCondition = function () { + let billtype = props.form.getFormItemsValue('listForm', 'billtype'); + let data = billtype == null ? "" : billtype.value; + return { billtype: data, GridRefActionExt: TranstypeRefSqlBuilder }; + } + } else if (item.attrcode === "group") { + item.queryCondition = function () { + let sscunit = _this.state.SSCCenter; + let data = sscunit.refpk == null ? "" : sscunit.refpk; + return { sscunit: data, TreeRefActionExt: BusinessUnitRefSqlBuilder }; + } + } + + }); + data.template['listForm'].status = 'edit'; + data.template['treeForm'].status = 'edit'; + props.meta.setMeta(data.template); + // props.meta.setMeta(meta); + + let FormulaComponent = (props) => { + return ( +
    + { + this.formulaInputId = ref; + }} + className="formula-input nc-theme-from-input-bgc nc-theme-form-input-bc nc-theme-form-input-c" + /> + { + this.openFormula(); + }} + style={{ cursor: "pointer" }} + /> +
    + ) + } + + props.renderItem( + "form", + "listForm", + "formula", + + ) + + } + }) + }) +} + +/*pmFWCFu5nhKkBzYmrkBaka23LzwyeVw+yP0Qu3SWeVg=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/events/query.js b/src/ssctpaaa/sscsetting/workinggroup/config/events/query.js new file mode 100644 index 0000000..d12593b --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/events/query.js @@ -0,0 +1,106 @@ +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ +import requestApi from '../requestApi' +import formEveManager from './formEveManager' +import treeEveManager from './treeEveManager' + +/** + * @Author:gaoymf + * @Description:共享服务中心改变 + * @Date: 19:12 2018/6/12 + * @param: + */ +let onSSCCenterChange = function(ssc) { + if (ssc.hasOwnProperty('refpk')) { + // 选中操作 + this.setState({ SSCCenter: ssc, showTreeSearch: true, disabledBtn: true ,formListData: [], showEmptyAreaTip: false}); + let req = { "pk_sscunit": ssc.refpk }; + treeEveManager.queryTreeData.call(this, req); // 查询左侧树 + this.props.syncTree.cancelSelectedNode(this.treeId); + } else { + // 清空共享中心操作 + treeEveManager.queryTreeData.call(this, ""); // 查询左侧树 + this.setState({ SSCCenter: {}, showTreeSearch: false, disabledBtn: true, formListData: [], showEmptyAreaTip: true}); + this.props.syncTree.cancelSelectedNode(this.treeId); + } + // 保存共享中心 + this.props.setUrlParam({pk_sscunit: ssc.hasOwnProperty('refpk') ? JSON.stringify(ssc) : ''}); +} + +/** + * @Author:gaoymf + * @Description:显示停用勾选 + * @Date: 19:17 2018/6/12 + * @param: + */ +let showDisabledChange = function(e) { + this.setState({ showDisabled: e }); + let selectNode = this.props.syncTree.getSelectNode(this.treeId); + // 没有选中树节点不执行查询 + if(selectNode!=null){ + let req = { pk_workinggroup: selectNode.refpk, enablestate: e }; + formEveManager.queryFormListData.call(this,req); + } +} + +/** + * @Author:gaoymf + * @Description:查询单位明细范围 + * @Date: 19:44 2018/6/12 + * @param: + */ +let queryGroupDetails = function(item) { + let multiLang = this.props.MutiInit.getIntl(7010); + requestApi.queryGroupDetailTableData({ + data: { group: item.values.group.value }, + success: (res) => { + //701001RWCL-0102:单位范围 + this.setState({ showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0102'), value: this.groupTableId } }); + this.props.editTable.setTableData(this.groupTableId, res[this.groupTableId]); + } + }) +} +/** + * @Author:gaoymf + * @Description:查询交易类型/单据类型明细 + * @Date: 19:46 2018/6/12 + * @param: + */ +let queryBillTypeDetails = function(item, key) { + let multiLang = this.props.MutiInit.getIntl(7010); + switch (key) { + case this.tranctionTableId: + requestApi.queryDetailTableData({ + data: { billtype: item.values.tranction.value, type: this.tranctionTableId }, + success: (res) => { + //multiLang && multiLang.get('701001RWCL-0103'):交易类型 + this.setState({ showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0103'), value: this.tranctionTableId } }); + this.props.editTable.setTableData(key, res[this.tranctionTableId]); + } + }) + break; + case this.billtypeTableId: + requestApi.queryDetailTableData({ + data: { billtype: item.values.billtype.value, type: this.billtypeTableId }, + success: (res) => { + //multiLang && multiLang.get('701001RWCL-0104'):单据类型 + this.setState({ showDetailModal: true, searchValue: '', modalType: { display: multiLang && multiLang.get('701001RWCL-0104'), value: this.billtypeTableId } }); + this.props.editTable.setTableData(key, res[this.billtypeTableId]); + } + }) + break; + } +} +/** + * @Author:gaoymf + * @Description:查询详细信息 + * @Date: 19:44 2018/6/12 + * @param: + */ +let queryDetailTable = function(searchValue) { + let filterKey = []; + // 单据类型/交易类型查询 billtypename 单位范围查询name + this.state.modalType.value == this.groupTableId ? filterKey.push('name') :filterKey.push('billtypename') + this.props.editTable.setFiltrateTableData(this.state.modalType.value, filterKey, searchValue, false) +} +export default { onSSCCenterChange, showDisabledChange, queryGroupDetails, queryBillTypeDetails, queryDetailTable } +/*QxYwc1QCwyRcKpenqWuRKUBgRwwb+3V509Zd1/ZuIuY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/events/treeEveManager.js b/src/ssctpaaa/sscsetting/workinggroup/config/events/treeEveManager.js new file mode 100644 index 0000000..81aa58c --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/events/treeEveManager.js @@ -0,0 +1,345 @@ +/*nuioL80pq0ljVs94b3ZOklYmf+7T8e0Ad2GeoH173x4=*/ +import { toast,promptBox } from "nc-lightapp-front"; +import requestApi from "./../requestApi"; +import query from "./query"; +import formEveManager from "./formEveManager" + +/** + * @Author:gaoymf + * @Description:新增icon点击 + * @Date: 18:18 2018/6/12 + * @param:node 当前点击的节点 + */ +let clickAddIconEve = function(node) { + this.setState({ showTreeModal: true,isEditTree:false }); + this.isRoot = node.refpk == "0001ZG100000SSCGROUP"; + // 可编辑 + this.props.form.setFormStatus(this.treeFormId, 'edit'); + // 清空 + this.props.form.EmptyAllFormValue(this.treeFormId); + this.props.form.setFormItemsValue(this.treeFormId, { pid: { value: node.refpk } }); +}; + +/** + * @Author:gaoymf + * @Description:删除icon点击 + * @Date: 18:22 2018/6/12 + * @param:当前点击的节点 + */ +let clickDelIconEve = function(node) { + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('7010-0002'), //删除 + content: multiLang && multiLang.get('701001RWCL-0168'), //"701001RWCL-0168": "确定要删除所选数据吗?" + beSureBtnClick: () => { + let req = this.props.syncTree.getSyncTreeValue(this.treeId, node.refpk); + requestApi.delTreeData({ + data: req, + success: res => { + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + if (res.result == false) { + toast({ color: "danger", content: res.msg }); + } else { + queryTreeData.call(this, req); + } + } + }); + }, // 确定按钮点击调用函数,非必输 + }) +}; + +/** + * @Author:gaoymf + * @Description:树型编辑icon点击 + * @Date: 18:04 2018/6/12 + * @param:node 当前编辑的节点 + */ +let clickEditIconEve = function(node) { + this.setState({ showTreeModal: true,isEditTree:true }); + this.isRoot = true; + this.props.form.EmptyAllFormValue(this.treeFormId); + this.props.form.setFormItemsValue(this.treeFormId, { + refname: { value: node.refname1?node.refname1:node.refname, display: node.refname1?node.refname1:node.refname }, + refname2: { value: node.refname2, display: node.refname2 }, + refname3: { value: node.refname3, display: node.refname3 }, + refcode: { display: node.refcode, value: node.refcode }, + pid: { display: node.pid, value: node.pid }, + refpk: { display: node.refpk, value: node.refpk } + }); +}; +/** + * @Author:gaoymf + * @Description:树型停用icon点击 + * @Date: 18:04 2018/6/12 + * @param:node 当前编辑的节点 + */ +let clickStopIconEve = function(node) { + let treeNode = this.props.syncTree.getSyncTreeValue(this.treeId, node.refpk); + let arr = []; + arr.push(treeNode.refpk); + if( treeNode.refValue.enablestate=='3'){ + // 启用 :更新目标节点和上级节点 + // 查询所有上级节点并更新父节点启用状态 + findP.call(this,treeNode,arr); + console.log('启用的树pk',arr); + requestApi.enableTreeData({ + data: arr, + success: res => { + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + queryTreeData.call(this, req); + this.closeModal(this.treeModalId); + } + }); + }else { + if(treeNode.children!=null){ + // 查询所有下级节点 + queryTreeList(treeNode.children,arr); + } + console.log('停用的树pk',arr); + requestApi.disableTreeData({ + data: arr, + success: res => { + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + queryTreeData.call(this, req); + this.closeModal(this.treeModalId); + } + }); + } +}; + + +/** + * @Author:gaoymf + * @Description:树型启用icon点击 + * @Date: 18:04 2018/6/12 + * @param:node 当前编辑的节点 + */ +let clickUpIconEve = function(node) { + let treeNode = this.props.syncTree.getSyncTreeValue(this.treeId, node.refpk); + if( treeNode.refValue.enablestate=='3'){ + // 启用 :更新目标节点和上级节点 + let ans = []; + // 查询所有上级节点并更新父节点启用状态 + ans.push(treeNode.refpk); + findP.call(this,treeNode,ans); + requestApi.enableTreeData({ + data: ans, + success: res => { + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + queryTreeData.call(this, req); + this.closeModal(this.treeModalId); + } + }); + }else { + let arr = []; + arr.push(treeNode.refpk); + if(treeNode.children!=null){ + // 查询所有下级节点 + queryTreeList(treeNode.children,arr); + } + requestApi.disableTreeData({ + data: arr, + success: res => { + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + queryTreeData.call(this, req); + this.closeModal(this.treeModalId); + } + }); + } +}; +/** + * @Author:gaoymf + * @Description:递归树结构子集节点,更新作业组启用/停用状态 + * @Date: 16:13 2019/1/17 + * @param: + */ +let queryTreeList = function(treeNode,arr){ + for (var i = 0; i < treeNode.length; i++) { + arr.push(treeNode[i].refpk); + var children = treeNode[i].children; + if (children != null) { + queryTreeList(children, arr); + } + } + return arr; +}; + +/** + * @Author:gaoymf + * @Description:递归查询树结构父集节点 + * @Date: 16:13 2019/1/17 + * @param: + */ +function findP(treeNode,ans) { + let pNode = this.props.syncTree.getSyncTreeValue(this.treeId, treeNode.pid); + if(pNode!=null){ + ans.push(pNode.refpk); + findP.call(this,pNode,ans); + } +} + + +/** + * @Author:gaoymf + * @Description:查询对应规则 + * @Date: 16:13 2018/6/11 + * @param: + */ +let onSelectEve = function(node) { + // 虚拟节点点击不触发查询 + if (node === "0001ZG100000SSCGROUP") { + this.setState({ disabledBtn: true, formListData: [] }); + return; + } else { + let req = { pk_workinggroup: node, enablestate: this.state.showDisabled }; + formEveManager.queryFormListData.call(this, req); + } +}; + + +/** + * @Author:gaoymf + * @Description:保存节点 + * @Date: 16:45 2018/7/18 + * @param: + */ +let saveNode = function(treeFormData, flag) { + let req = { + refpk: treeFormData.rows[0].values.refpk.value, + refcode: treeFormData.rows[0].values.refcode.value, + refname: treeFormData.rows[0].values.refname.value, + refname1: treeFormData.rows[0].values.refname.value, + refname2: treeFormData.rows[0].values.refname2?treeFormData.rows[0].values.refname2.value:'', + refname3: treeFormData.rows[0].values.refname3?treeFormData.rows[0].values.refname3.value:'', + pk_sscunit: this.state.SSCCenter.refpk + }; + if (treeFormData.rows[0].values.pid.value !== "0001ZG100000SSCGROUP") { + req.pid = treeFormData.rows[0].values.pid.value; + } + requestApi.addTreeData({ + data: req, + success: res => { + // this.props.syncTree.addNodeSuccess(this.treeId, res); + // 清空 + this.props.form.EmptyAllFormValue(this.treeFormId); + // pid初始化 + this.props.form.setFormItemsValue(this.treeFormId, { pid: { value: treeFormData.rows[0].values.pid.value } }); + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + queryTreeData.call(this, req); + if (flag) { + this.closeModal(this.treeModalId); + } + + } + }); +}; + +/** + * @Author:gaoymf + * @Description:保存同级节点 + * @Date: 16:13 2018/7/18 + * @param: + */ +let saveAndAddTreeButton = function() { + if (this.props.form.isCheckNow(this.treeFormId)) { + let treeFormData = this.props.form.getAllFormValue(this.treeFormId); + // false控制点击后弹窗不消失 + saveNode.call(this, treeFormData, false); + } +}; + +/** + * @Author:gaoymf + * @Description:保存按钮点击 + * @Date: 16:13 2018/7/18 + * @param: + */ +let saveOrUpdateTreeButton = function() { + if (this.props.form.isCheckNow(this.treeFormId)) { + let treeFormData = this.props.form.getAllFormValue(this.treeFormId); + let refpk = treeFormData.rows[0].values.refpk.value; + if (refpk == undefined) { + // 新增节点 + saveNode.call(this, treeFormData, true); + } else { + // 更新节点 + let updateReq = this.props.syncTree.getSyncTreeValue(this.treeId, refpk); + updateReq.refcode = treeFormData.rows[0].values.refcode.value; + updateReq.refname = treeFormData.rows[0].values.refname.value; + updateReq.refname1 = treeFormData.rows[0].values.refname.value; + updateReq.refname2 = treeFormData.rows[0].values.refname2?treeFormData.rows[0].values.refname2.value:''; + updateReq.refname3 = treeFormData.rows[0].values.refname3?treeFormData.rows[0].values.refname3.value:''; + requestApi.updateTreeData({ + data: updateReq, + success: res => { + // this.props.syncTree.editNodeSuccess(this.treeId,res); + let req = { pk_sscunit: this.state.SSCCenter.refpk }; + queryTreeData.call(this, req); + this.closeModal(this.treeModalId); + } + }); + } + } +}; +/** + * @Author:gaoymf + * @Description:取消 + * @Date: 16:15 2018/6/11 + * @param: + */ +let cancelTreeButton = function() { + this.closeModal(this.treeModalId); +}; + +// 查询树节点数据 +function queryTreeData(req) { + let { syncTree } = this.props; + let multiLang = this.props.MutiInit.getIntl(7010); + let { setSyncTreeData } = syncTree; + if (req == "") { + setSyncTreeData(this.treeId, []); + } else { + requestApi.queryTreeData({ + data: req, + success: res => { + // 生成启用/停用数据结构 + let iconData = getUpAndStopIconData(res.nodes); + // 设置虚拟根节点 + res.nodes.push({ + refpk: "0001ZG100000SSCGROUP", + refcode: "ROOT", + refname: multiLang && multiLang.get('701001RWCL-0051')//作业组 + }); + let newTree = syncTree.createTreeData(res.nodes); //创建树 组件需要的数据结构 + setSyncTreeData(this.treeId, newTree); + this.props.syncTree.setIconVisible('tree',iconData);// 设置启用/停用icon + this.props.syncTree.hideIcon(this.treeId, "0001ZG100000SSCGROUP", { delIcon: false, editIcon: false }); + } + }); + } +} +// 构建树组件启用/停用数据结构 +let getUpAndStopIconData = function(datas){ + let iconDatas = datas.map((data) => { + if(data.refValue.enablestate=='2'){ + return { + key:data.refpk, + value:{ + stopUpIon: 'up' // 启用 + } + } + }else { + return { + key:data.refpk, + value:{ + stopUpIon: 'stop' // 停用 + } + } + } + }) + return iconDatas; +} + +export default { clickAddIconEve, clickDelIconEve, clickEditIconEve,clickStopIconEve,clickUpIconEve, queryTreeData, onSelectEve, saveAndAddTreeButton, saveOrUpdateTreeButton, cancelTreeButton }; +/*nuioL80pq0ljVs94b3ZOklYmf+7T8e0Ad2GeoH173x4=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/index.css b/src/ssctpaaa/sscsetting/workinggroup/config/index.css new file mode 100644 index 0000000..c1ef33c --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/index.css @@ -0,0 +1,6 @@ +.column-2-2 .label-value { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: calc(100% - 238px); +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/index.js b/src/ssctpaaa/sscsetting/workinggroup/config/index.js new file mode 100644 index 0000000..dc556b9 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/index.js @@ -0,0 +1,6 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import A from './workGroup'; +ReactDOM.render( < A / > , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/index.less b/src/ssctpaaa/sscsetting/workinggroup/config/index.less new file mode 100644 index 0000000..7da1b7e --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/index.less @@ -0,0 +1,234 @@ +.ssctp-workinggroup-form { + width: 100%; + border: 1px solid rgba(206, 206, 206, 0.75); + border-radius: 4px; + margin-bottom: 10px; + font-family: MicrosoftYaHei; + + .head-grow { + width: 100%; + height: 35px; + margin-bottom: 19px; + position: relative; + background: #f3f3f3; + .name-area { + font-size: 14px; + color: #111111; + display: inline-block; + height: 35px; + line-height: 35px; + left: 88px; + position: absolute; + font-weight: bold; + } + .operate-area { + font-size: 13px; + color: #007ACE; + height: 35px; + line-height: 35px; + position: absolute; + right: 30px; + display: flex; + align-items: center; + + .btn { + cursor: pointer; + margin-right: 12px !important; + } + } + + .operate-area span:nth-child(1) { + float: left; + } + } + .grow { + margin-bottom: 11px; + padding-left: 30px; + width: 100%; + height: auto; + font-size: 13px; + line-height: 21px; + .label-name { + font-size: 13px; + width: 140px; + color: #555555; + text-align: right; + position: relative; + white-space: normal; + float: left; + } + .item-colon { + margin-right: 15px; + float: left; + } + .label-value { + // &::after { + // content: "..."; + // } + margin-right: 5px; + color: #111111; + } + .label-single-value { + font-size: 13px; + color: #111111; + width: 200px; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + vertical-align: bottom; + } + .label-value-all { + cursor: pointer; + } + .column-1-1 { + font-size: 13px; + width: 100%; + white-space: nowrap; + } + .column-2-1 { + font-size: 13px; + display: inline-block; + width: 40%; + white-space: nowrap; + } + .column-2-2 { + font-size: 13px; + display: inline-block; + width: 60%; + white-space: nowrap; + .label-name { + float: left; + } + .label-value { + float: left; + } + } + } +} + +.u-button { + min-width: 60px !important; +} + +.img { + position: absolute; + width: 30px; + height: 30px; + left: 32px; + top: 2px; +} + +.formula-div { + width: 100%; + height: 30px; + position: relative; + .formula-input { + border: 1px solid #dbdbdb; + outline: none; + color: #292e35; + padding: 0 8px; + border-radius: 4px; + font-size: 13px; + width: 100%; + height: 100%; + position: relative; + display: inline-block; + letter-spacing: normal; + word-spacing: normal; + text-transform: none; + text-indent: 0px; + text-shadow: none; + text-rendering: auto; + text-align: start; + } + .icon-refer { + position: absolute; + z-index: 0; + top: 1px; + right: 4px; + width: 18px; + height: 26px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + display: flex; + align-items: center; + &::after { + font-family: "iconfont"; + content: "\E6CE"; + color: #999; + font-size: 14px; + } + } +} + +.formula-publicfiled-content { + li:hover { + background: #1e88e5; + } +} + +.u-button-group .u-button { + min-width: 60px !important; +} + +.tree-card { + height: calc(~"100% - 114px"); +} + +.header { + height: 46px; + .search-box { + width: 200px; + margin-left: 30px !important; + margin-right: 25px; + } + .title { + font-weight: bold; + } +} + +.ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 3px; + margin-top: 9px; +} + +.ssc_footbutton { + width: 72px !important; +} + +.refer-wrapper { + width: 100% !important; +} + +.page-title-Icon { + margin-right: 8px; + margin-top: 0 !important; +} + +.u-modal-body { + padding-bottom: 16px !important; +} + +.group-form-wrapper { + padding-bottom: 6px !important; +} + +.btn-group { + .button-primary { + border: none !important; + } +} + +#ssc_group_add { + .form-item-label { + width: 150px; + max-width: 150px; + min-width: 150px; + } + .form-item-control { + width: calc(~"100% - 150px"); + } +} \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/requestApi.js b/src/ssctpaaa/sscsetting/workinggroup/config/requestApi.js new file mode 100644 index 0000000..302ebc4 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/requestApi.js @@ -0,0 +1,216 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { ajax } from 'nc-lightapp-front'; + +let requestApi = { + // 新增树节点 + addTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/InsertAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 删除树节点 + delTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/DeleteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 修改树节点 + updateTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/UpdateAction.do', + data: opt.data, + success: (data) => { + console.log(data); + data = data.data; + opt.success(data); + } + }) + }, + // 启用树节点 + enableTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/EnableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 停用树节点 + disableTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/DisableAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 查询树节点 + queryTreeData: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/QueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 重置任务 + resetTask: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskResetNotakeTaskAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 保存规则 + saveFormData: (opt) => { + ajax({ + url: '/nccloud/sscbd/allotrule/InsertAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 删除规则 + delFormData: (opt) => { + ajax({ + url: '/nccloud/sscbd/allotrule/DeleteAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 修改规则 + updateFormData: (opt) => { + ajax({ + url: '/nccloud/sscbd/allotrule/UpdateAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 查询规则 + queryFormListData: (opt) => { + ajax({ + url: '/nccloud/sscbd/allotrule/QueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 查询父级作业组规则 + queryParentFormListData: (opt) => { + ajax({ + url: '/nccloud/sscbd/allotrule/QueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 保存上级作业组规则 + copyParentRule: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/CopyParentRulesAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 启用/停用规则 + changeEnableState: (opt) => { + ajax({ + url: '/nccloud/sscbd/allotrule/changeEnableStateAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + // 查询交易类型/单据类型详细 + queryDetailTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/BillTypeQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + // 查询单位范围详细 + queryGroupDetailTableData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/OrgsQueryAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + }, + }); + }, + queryPublicFields: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/QueryPublicFieldAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 校验父级作业组规则是否能CRUD + checkParentHandleEnable: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/CheckEnableAddRuleAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + }, + // 修改单据类型需要更新交易类型 + UpdateBilltype: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroup/UpdateBilltypeAction.do', + data: opt.data, + success: (data) => { + data = data.data; + opt.success(data); + } + }) + } +} +export default requestApi; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroup/config/workgroup.js b/src/ssctpaaa/sscsetting/workinggroup/config/workgroup.js new file mode 100644 index 0000000..ad7063a --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroup/config/workgroup.js @@ -0,0 +1,637 @@ +/*QV/xb50vWndooCRXIylWUa+iVO1/Eoiib50JwYZwlI8=*/ +import React, { Component } from "react"; +import { createPage, base, high, createPageIcon, getTheme} from "nc-lightapp-front"; +import { + initTemplate, + formEveManager, + treeEveManager, + query, + afterEvent +} from "./events"; +import requestApi from "./requestApi"; +import SSCCenter from "../../../refer/sscbd/SSCUnitGridRef"; +import { Nav } from "ssccommon/components/global-nav"; +import gxicon1 from "../../../public/image/gxicon1.png"; +import gxicon2 from "../../../public/image/gxicon2.png"; +import gxicon3 from "../../../public/image/gxicon3.png"; +import gxicon4 from "../../../public/image/gxicon4.png"; +import gxicon5 from "../../../public/image/gxicon5.png"; +import "./index.less"; +import "./index.css"; +const { + NCModal, + NCButton, + NCFormControl, + NCCheckbox, + NCPopconfirm, + NCDiv, + NCTableSwitch, + EmptyAreaTip, + NCTooltip, +} = base; + +const { FormulaEditor } = high; + +function PublicField({ setName, setExplain, name }) { + let rowList = []; + name.map(item => { + rowList.push( +
  • { + setExplain(""); + }} + onDoubleClick={() => { + setName("" + item.code + ""); + }} + > + {item.code} +    + {item.name} +
  • + ); + }); + return
      {rowList}
    ; +} +class WorkGroup extends Component { + constructor(props) { + super(props); + this.treeId = "tree"; // 树组件模板 + this.treeFormId = "treeForm"; // 树节点新增/修改模板 + this.formId = "listForm"; // 表单模板 + this.groupTableId = "orglist"; // 单位范围表格模板 + this.tranctionTableId = "tranctionlist"; // 交易类型表格模板 + this.billtypeTableId = "billtypelist"; // 单据类型表格模板 + this.formModalId = "formModal"; // 表单modal + this.treeModalId = "treeModal"; // 树表单modal + this.detailModalId = "detailModal"; // 详情modal + this.isRoot = false; // 判断虚拟工作组使用 + this.formulaInputValue = ""; // 公式内容 + // this.isShowPop = false; // 控制拉取上级规则确认 + this.state = { + SSCCenter: {}, // 共享中心 + disabledBtn: true, // 控制按钮是否禁用 true 禁用,false 启用 + isEditTree:false, // 控制树修改/新增时是否显示保存-新增按钮,false:显示 true:不显示 + showFormModal: false, // 新增/编辑表单模态显示 + showFormula: false, // 公式编辑器显示/隐藏 + publicFieldData: "", // 公式编辑器-公共字段内容 + showTreeModal: false, // 新增/编辑树模态显示 + showTreeSearch: true, // 控制树查询区显示 + showDetailModal: false, // 详细表格显示 [单位范围,交易类型,单据类型] + showDisabled: false, // 显示停用 + isShowPop: false, // 控制拉取上级规则确认 + modalType: {}, // 控制显示全部模态内容显示 控制显示 [单位范围,交易类型,单据类型] + detailTableData: [], // 详细信息的数据 + formListData: [], // 表单集合数据 + isBlackTheme: null, + showEmptyAreaTip: true, + }; + initTemplate.call(this, props); + + getTheme().then((theme) => { + this.setState({ + isBlackTheme: theme == 'black' + }) + }) + } + + // 页面加载 + componentDidMount() { + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + setTimeout(() => { + pk_sscunit && query.onSSCCenterChange.call(this, JSON.parse(pk_sscunit)); + }, 300); + } + + // 渲染表单集合 + drawFormList = () => { + let multiLang = this.props.MutiInit.getIntl(7010); + let formList = []; + let imgList = [gxicon1, gxicon2, gxicon3, gxicon4, gxicon5]; + this.state.formListData.map((item, index) => { + let billTypeArr = item.values.billtype.display.split(","); + let displayArr = billTypeArr.slice(0, 3); // 单据类型默认显示3个 + let billTypeStr = displayArr.join(" ; "); + let tranStr = ""; + if (item.values.tranction.display == "") { + tranStr = ""; + } else { + let tranctionArr = item.values.tranction.display.split(","); + let displayTranArr = tranctionArr.slice(0, 8); // 交易类型默认显示8个 + tranStr = displayTranArr.join(" ; "); + } + let groupArr = item.values.group.display.split(","); + let displayGroupArr = groupArr.slice(0, 8); // 单位范围默认显示8个 + let groupStr = displayGroupArr.join(" ; "); + formList.push( +
    +
    + + {/*"701001RWCL-0106": "规则名称"*/} + + {index + 1} + 、{multiLang && multiLang.get('701001RWCL-0110')}:  + {item.values.multiLangName.value} + + + + {/*"701001RWCL-0105": "确定停用作业组规则?","701001RWCL-0106": "确定启用作业组规则?"*/} + + + + + + + + + {multiLang && multiLang.get('701001RWCL-0038')}{/*"701001RWCL-0038": "修改""*/} + + + + + {multiLang && multiLang.get('7010-0002')}{/*"7010-0002": "删除""*/} + + + + +
    +
    + + {multiLang && multiLang.get('701001RWCL-0050')} + : + + {item.values.pk_sscnode.display} + + + {/*"701001RWCL-0104": "单据类型","701001RWCL-0111":"【查看全部】"*/} + + {multiLang && multiLang.get('701001RWCL-0104')} + : + {billTypeStr} + + {multiLang && multiLang.get('701001RWCL-0111')} + + +
    + {/*"701001RWCL-0103": "交易类型"*/} +
    + + {multiLang && multiLang.get('701001RWCL-0103')} + : + + {tranStr} + + {tranStr == "" ? ( + "" + ) : ( + + {multiLang && multiLang.get('701001RWCL-0111')} + + )} + +
    + {/*"701001RWCL-0102": "单位范围"*/} +
    + + {/* 单位范围 */} + {multiLang && multiLang.get('701001RWCL-0102')} + : + + {groupStr} + + {groupStr == "" ? ( + "" + ) : ( + + {multiLang && multiLang.get('701001RWCL-0111')} + + )} + +
    +
    + + {/*"701001RWCL-0113": "包含下级单位"*/} + {multiLang && multiLang.get('701001RWCL-0113')} + : + + {item.values.iscontainslower.display} + + + + {/*"701001RWCL-0112": "更多范围"*/} + {multiLang && multiLang.get('701001RWCL-0112')} + : + {/* {item.values.formula.value} */} + + + {item.values.formula.value} + + + +
    + {/* 时间 */} +
    + + {multiLang && multiLang.get('701001RWCL-0193')} + : + {item.values.standardtime==undefined?"":item.values.standardtime.value} + + + {multiLang && multiLang.get('701001RWCL-0194')} + : + {item.values.advancetime==undefined?"":item.values.advancetime.value} + +
    + {/* 审核要点必须全部通过 */} +
    + + {multiLang && multiLang.get('701001RWCL-0198')} + : + + { + item.values.isallpass + ? (item.values.isallpass.value ? multiLang && multiLang.get('701001RWCL-0199') : multiLang && multiLang.get('701001RWCL-0200')) + : '' + } + + +
    +
    + ); + }); + return formList; + }; + // 渲染模态详情 + drawDetailModelContent = () => { + let { createEditTable } = this.props.editTable; + switch (this.state.modalType.value) { + case this.tranctionTableId: + return createEditTable(this.tranctionTableId, { + showIndex: true, + height: 265, + }); + case this.groupTableId: + return createEditTable(this.groupTableId, { + showIndex: true, + height: 265, + }); + case this.billtypeTableId: + return createEditTable(this.billtypeTableId, { + showIndex: true, + height: 265, + }); + } + }; + // 关闭指定modal + closeModal(key) { + switch (key) { + case this.treeModalId: + this.setState({ showTreeModal: false }); + break; + case this.detailModalId: + this.setState({ showDetailModal: false }); + break; + case this.formModalId: + this.setState({ showFormModal: false }); + break; + default: + break; + } + } + + openFormula() { + // 查询 + requestApi.queryPublicFields({ + data: "", + success: res => { + console.log("公共字段数据", res); + this.setState({ publicFieldData: res, showFormula: true }); + } + }); + } + render() { + let { syncTree, form, DragWidthCom } = this.props; + let { createSyncTree } = syncTree; + let { createForm } = form; + let formLists = this.drawFormList(); + let detailModalContent = this.drawDetailModelContent(); + let multiLang = this.props.MutiInit.getIntl(7010); + return ( +
    + {/* 导航条*/} +
    +
    + + {/*新增/修改树节点modal*/} + {this.setState({showTreeModal:false})}} className="junior"> + + {multiLang && multiLang.get('701001RWCL-0051')} + +
    {createForm(this.treeFormId)}
    + +
    +
    + + {/*"7010-0003": "保存"*/} + {multiLang && multiLang.get('7010-0003')} + + {/*"701001RWCL-0115": "保存新增"*/} + {this.state.isEditTree ?"": + + {multiLang && multiLang.get('701001RWCL-0115')} + + } +
    +
    + + {multiLang && multiLang.get('7010-0004')} + +
    +
    + + {/*新增/修改表单modal*/} + + (this.formulaInputId == undefined + ? "" + : this.formulaInputId.value) + } + onHide={()=>{this.setState({showFormModal:false})}} + backdrop='false' + > + {/*'701001RWCL-0116':'新增作业组规则'*/} + + {multiLang && multiLang.get('701001RWCL-0116')} + + +
    + {createForm(this.formId, { + //编辑后事件 + onAfterEvent: afterEvent.bind(this) + })} +
    + { + this.setState({ showFormula: false }); + this.formulaInputId.value = value; + }} //点击确定回调 + onCancel={a => { + this.setState({ showFormula: false }); + }} //点击确定回调 + metaParam={{ + pk_billtype: "", + bizmodelStyle: "fip", + classid: "7bd63d9b-f394-4a7d-a52c-72f8274d471f" + }} + onHide={() => { + this.setState({ showFormula: false }); + }} + /> +
    +
    +
    + + + {/*"7010-0003": "保存"*/} + {multiLang && multiLang.get('7010-0003')} + + + {multiLang && multiLang.get('7010-0004')} + + +
    + + {/*显示全部modal*/} + this.closeModal(this.detailModalId)} + > + + + {this.state.modalType.display} + + {/*701001RWCL-0109:搜索名称*/} + { + this.setState({ searchValue: searchValue }); + }} + className="dnd-cancel" + onSearch={query.queryDetailTable.bind(this)} + type="search" + /> + + + + + {detailModalContent} + + +
    +
    + ); + } +} + +let WorkGroupDom = createPage({ + mutiLangCode: '7010' +})(WorkGroup); +export default WorkGroupDom; + +/*QV/xb50vWndooCRXIylWUa+iVO1/Eoiib50JwYZwlI8=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/events/affixButtonClick.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/affixButtonClick.js new file mode 100644 index 0000000..85b480a --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/affixButtonClick.js @@ -0,0 +1,54 @@ +/*R26hyIs/35YemAaf2O/E7YeVusQ/+Fu5LhIRysWS0Ws=*/ +import manager from "./managerWorkUser"; + +/** + * @Author:gaoymf + * @Description:清空 + * @Date: 14:00 2018/6/20 + */ +let emptyButtonClick = function() { + this.setState({ checkInfoArr: [] }); +}; + +/** + * @Author:gaoymf + * @Description:移除 + * @Date: 14:00 2018/6/20 + */ +let delButtonClick = function() { + let { checkInfoArr } = this.state; + manager.delWorkUser.call(this, checkInfoArr); +}; + +/** + * @Author:gaoymf + * @Description:确定 + * @Date: 14:43 2018/6/15 + * @param: + */ +let modalSaveButton = function(type, groupInfoArr) { + let { checkInfoArr } = this.state; + let groupArr = []; + groupInfoArr.map((groupInfo)=>{ + groupArr.push(groupInfo.refpk); + }) + // 已选用户且已选目标作业组 + if (checkInfoArr.length > 0 && groupArr.length > 0) { + switch (type) { + case "copy": + manager.addWorkUser.call(this, groupArr, checkInfoArr); + break; + case "move": + let flag = manager.addWorkUser.call(this, groupArr, checkInfoArr); + if(flag){ + manager.delWorkUser.call(this, checkInfoArr); + } + break; + default: + break; + } + } +}; + +export default { emptyButtonClick, delButtonClick, modalSaveButton }; +/*R26hyIs/35YemAaf2O/E7YeVusQ/+Fu5LhIRysWS0Ws=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/events/buttonClick.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/buttonClick.js new file mode 100644 index 0000000..3e02db0 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/buttonClick.js @@ -0,0 +1,98 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from "../requestApi"; +import { base,toast,promptBox } from "nc-lightapp-front"; +const { NCMessage } = base; +/** + * 管理 + */ +let managerButtonClick = function() { + this.setState({ isEdit: true }); +}; +/** + * 保存 + */ +let saveButtonClick = function() { + let { addInfoArr, delInfoArr, initInfoArr } = this.state; + let treeTableData = this.props.treeTableManyCol.getAllValue("treeTableCol"); + let multiLang = this.props.MutiInit.getIntl(7010); + console.log(treeTableData.length); + //701001RWCL-0117:表格无可操作数据,不允许保存 + if(treeTableData.length==0){ + toast({ content: multiLang && multiLang.get('701001RWCL-0117'),color: 'danger' }) + }else { + let data = { + deletes: [], + inserts: addInfoArr + }; + initInfoArr.map(initInfo => { + delInfoArr.map(delInfo => { + if (delInfo.pk_workinggroup == initInfo.pk_workinggroup) { + if (delInfo.usertype == "chargeman") { + initInfo.chargeman.map(charge => { + if (delInfo.pk_user == charge.value) { + data.deletes.push(charge.vos); + } + }); + } else { + initInfo.member.map(mem => { + if (delInfo.pk_user == mem.value) { + data.deletes.push(mem.vos); + } + }); + } + } + }); + }); + requestApi.saveWorkGroupUser({ + data: data, + success: res => { + this.queryData(this.state.SSCCenter.refpk); + //701001RWCL-0118:保存成功 + toast({color:"success", content: multiLang && multiLang.get('701001RWCL-0118')}) + } + }); + } + +}; +/** + * 取消 + */ +let cancelButtonClick = function() { + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('7010-0004'), //"提示信息" + content: multiLang && multiLang.get('701001RWCL-0170'),//确定要取消吗? + beSureBtnClick: ()=>{ + this.setState({ + isEdit: false, + checkInfoArr: [], + addInfoArr: [], + delInfoArr: [] + }); + } + }) + +}; + +/** + * @Author:gaoymf + * @Description:导航条点击 + * @Date: 16:12 2018/9/15 + * @param: + */ + +let handleTruncation = function(){ + let multiLang = this.props.MutiInit.getIntl(7010); + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'), //"提示信息" + content: multiLang && multiLang.get('701001RWCL-0074'),//此操作会丢失本次修改,请确定? + beSureBtnClick: ()=>{ + this.refs.nav.linkByClickedIdx(); + } + }) +} + +export default { managerButtonClick, saveButtonClick, cancelButtonClick,handleTruncation }; +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/events/index.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/index.js new file mode 100644 index 0000000..cd9d905 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/index.js @@ -0,0 +1,7 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick'; +import initTemplate from './initTemplate'; +import manager from './managerWorkUser'; +import affixButtonClick from './affixButtonClick'; +export { initTemplate, buttonClick, affixButtonClick, manager }; +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/events/initTemPlate.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/initTemPlate.js new file mode 100644 index 0000000..191a680 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/initTemPlate.js @@ -0,0 +1,696 @@ +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ +import manager from "./managerWorkUser"; +import User from "../../../../refer/sscbd/SSCSMUserGridRef/index.js"; +import { base,getMultiLang } from "nc-lightapp-front"; + +const { NCTooltip } = base; +export default function(props) { + getMultiLang({moduleId: 7010, domainName: 'ssctp',currentLocale: 'zh-CN', callback: (json) => { + let _this = this; + let meta = { + treeTableCol: { + moduletype: "table", + pagination: false, + items: [ + { + label: json['701001RWCL-0051'],//作业组 + col: 12, + width: "174px", + attrcode: "pk_workinggroup", + itemtype: "label", + visible: true + }, + { + label: json['701001RWCL-0119'],//组长 + col: 12, + width: "174px", + attrcode: "chargeman", + itemtype: "label", + visible: true, + //编辑态渲染:普通样式、选中样式、转移/复制后的样式、搜索样式 + //浏览态渲染:搜索高亮样式、普通样式 + render(text, record, index) { + let { checkInfoArr, isEdit, addInfoArr, delInfoArr } = _this.state; + let itemList = [];// 结果集 + let checkArr = [];// 选中人员pkArr + let pk_workinggroup = record.values.pk_workinggroup.value; + let searchItem = "" +_this.state.searchValue +""; + if (isEdit) { + checkInfoArr.map(obj => { + if ("chargeman" == obj.usertype &&pk_workinggroup == obj.pk_workinggroup) { + checkArr.push(obj.pk_user); + } + }); + //根据工作组pk获取组长 + let initInfoArr = manager.getWorkUserArrByGroupPk.call(_this,[pk_workinggroup],"chargeman"); + //根据操作后数据(增加、删除)计算出最终渲染的数据 + let renderInfoArr = manager.getRenderWorkGroupInfoArr(initInfoArr,addInfoArr,delInfoArr,"chargeman"); + //数据渲染 + renderInfoArr[0].pk_userArr.map((pk_user, idx) => { + let deptName = renderInfoArr[0].deptNames[idx]; // 部门名称 + let orgName = renderInfoArr[0].orgNames[idx]; // 组织名称 + let username = renderInfoArr[0].display[idx]; // 人员名称 + let code = renderInfoArr[0].code[idx]; + let search = username.replace(_this.state.searchValue,searchItem); + + const overlay = (deptName || orgName || code) ? ( +
    + {code &&
    {code}
    } + {deptName &&
    {deptName}
    } + {orgName &&
    {orgName}
    } +
    + ) : (
    {json['701001RWCL-0092']}
    ) + + // 查询 + if (_this.state.searchValue !== "" &&username.indexOf(_this.state.searchValue) > -1) { + // 选中 + if (checkArr.indexOf(pk_user) > -1) { + // 已查询 已选中 原始 + if (renderInfoArr[0].status[idx] == 0) { + //701001RWCL-0092:无 + itemList.push( + + + + ); + } else if (renderInfoArr[0].status[idx] == 1) { + let tempSearchItem = "" +_this.state.searchValue +""; + let tempSearch = username.replace( _this.state.searchValue,tempSearchItem); + // 已查询 已选中 临时 + itemList.push( + + + + ); + } + } else { + // 未选中 + if (renderInfoArr[0].status[idx] == 0) { + // 已查询 未选中 原始 + itemList.push( + + + + ); + } else { + let tempSearchItem = "" +_this.state.searchValue +""; + let tempSearch = username.replace( _this.state.searchValue,tempSearchItem); + // 已查询 未选中 临时 + itemList.push( + + + + ); + } + } + } else { + // 未查询 + if (checkArr.indexOf(pk_user) > -1) { + // 选中 + if (renderInfoArr[0].status[idx] == 0) { + // 未查询 已选中 原始 + itemList.push( + + + {username} + + + ); + } else if (renderInfoArr[0].status[idx] == 1) { + // 未查询 已选中 临时 + itemList.push( + + + {username} + + + ); + } + } else { + // 未选中 + if (renderInfoArr[0].status[idx] == 0) { + // 未查询 未选中 原始 + itemList.push( + + + {username} + + + ); + } else { + // 未查询 未选中 临时 + itemList.push( + + + {username} + + + ); + } + } + } + }); + return ( +
    + {itemList} +
    + ); + } else { + // 浏览态 + record.values.chargeman.display.map((item, idx) => { + let code = record.values.chargeman.code[idx]; + let deptName = record.values.chargeman.deptNames[idx]; // 部门名称 + let orgName = record.values.chargeman.orgNames[idx]; // 组织名称 + + const overlay = (deptName || orgName || code) ? ( +
    + {code &&
    {code}
    } + {deptName &&
    {deptName}
    } + {orgName &&
    {orgName}
    } +
    + ) : (
    {json['701001RWCL-0092']}
    ) + + //搜索关键字高亮 + if (_this.state.searchValue !== "" &&item.indexOf(_this.state.searchValue) > -1) { + let search = item.replace(_this.state.searchValue,searchItem); + itemList.push( + //悬停弹窗 + + + + ); + } else { + itemList.push( + + {item} + + ); + } + }); + return
    {itemList}
    ; + } + } + }, + { + label: json['701001RWCL-0120'],//组员 + col: 12, + width: "auto", + attrcode: "member", + itemtype: "label", + visible: true, + render(text, record, index) { + let { checkInfoArr, isEdit, addInfoArr, delInfoArr } = _this.state; + let itemList = [];// 结果集 + let checkArr = [];// 选中的人员pk + let searchItem ={_this.state.searchValue} + let pk_workinggroup = record.values.pk_workinggroup.value; + /*末级节点*/ + if (record.isleaf) { + /*编辑态*/ + if (isEdit) { + // 暂存选中的人员 + checkInfoArr.map(obj => { + if ("member" == obj.usertype &&pk_workinggroup == obj.pk_workinggroup) { + checkArr.push(obj.pk_user); + } + }); + // 返回作业组原始的人员 + let initInfoArr = manager.getWorkUserArrByGroupPk.call(_this,[pk_workinggroup],"member"); + // 返回作业组显示的人员 显示人员 = 原始人员 + 新增人员 - 删除人员 + let renderInfoArr = manager.getRenderWorkGroupInfoArr(initInfoArr,addInfoArr,delInfoArr,"member"); + renderInfoArr[0].pk_userArr.map((pk_user, idx) => { + let orgName = renderInfoArr[0].orgNames[idx]; // 组织名称 + let deptName = renderInfoArr[0].deptNames[idx]; // 部门名称 + let username = renderInfoArr[0].display[idx]; // 人员名称 + let code = renderInfoArr[0].code[idx]; + let search = highLightKeyWord(_this.state.searchValue, username, searchItem) + + const overlay = (deptName || orgName || code) ? ( +
    + {code &&
    {code}
    } + {deptName &&
    {deptName}
    } + {orgName &&
    {orgName}
    } +
    + ) : (
    {json['701001RWCL-0092']}
    ) + + if (_this.state.searchValue !== "" &&username.indexOf(_this.state.searchValue) > -1) { + // 已查询 + if (checkArr.indexOf(pk_user) > -1) { + // 已选中 + if (renderInfoArr[0].status[idx] == 0) { + //已查询 已选中 原始 + itemList.push( + + + {search} + + + ); + } else if (renderInfoArr[0].status[idx] == 1) { + let tempSearchItem = {_this.state.searchValue} + let tempSearch = highLightKeyWord(_this.state.searchValue, username, tempSearchItem) + //已查询 已选中 临时 + itemList.push( + + + {tempSearch} + + + ); + } + } else { + // 未选中 + if (renderInfoArr[0].status[idx] == 0) { + // 已查询 未选中 原始 + itemList.push( + + + {search} + + + ); + } else { + let tempSearchItem = {_this.state.searchValue} + let tempSearch = highLightKeyWord(_this.state.searchValue, username, tempSearchItem) + // 已查询 未选中 临时数据 + itemList.push( + + + {tempSearch} + + + ); + } + } + } else { + // 未查询 + if (checkArr.indexOf(pk_user) > -1) { + // 选中 + if (renderInfoArr[0].status[idx] == 0) { + // 未查询 已选中 原始 + itemList.push( + + + {username} + + + ); + } else if (renderInfoArr[0].status[idx] == 1) { + // 未查询 已选中 临时数据 + itemList.push( + + + {username} + + + ); + } + } else { + // 未选中 + if (renderInfoArr[0].status[idx] == 0) { + // 未查询 未选中 原始 + itemList.push( + + + {username} + + + ); + } else { + // 未查询 未选中 临时 + itemList.push( + + + {username} + + + ); + } + } + } + }); + return ( +
    + {itemList} +
    + ); + } else { + /*浏览态*/ + record.values.member.display.map((item, idx) => { + let orgName = record.values.member.orgNames[idx]; + let deptName = record.values.member.deptNames[idx]; + let code = record.values.member.code[idx]; + + const overlay = (deptName || orgName || code) ? ( +
    + {code &&
    {code}
    } + {deptName &&
    {deptName}
    } + {orgName &&
    {orgName}
    } +
    + ) : (
    {json['701001RWCL-0092']}
    ) + + if (_this.state.searchValue !== "" &&item.indexOf(_this.state.searchValue) > -1) { + let search = highLightKeyWord(_this.state.searchValue, item, searchItem) + itemList.push( + + + {search} + + + ); + } else { + itemList.push( + + + {item} + + + ); + } + }); + return
    {itemList}
    ; + } + } else { + if (isEdit) { + // 编辑态父节点不显示人数 + } else { + /* 浏览态父节点显示人数 */ + let count = 0; + let children = []; + manager.getLeafChildrenById.call(_this,pk_workinggroup,children); + children.map(child => { + count += child.member.length; + }); + return ( + //701001RWCL-0121:人 +
    + {count + json['701001RWCL-0121']} +
    + ); + } + } + } + }, + { + label: json['701001RWCL-0060'],//操作 + col: 12, + width: "200px", + height: "auto", + itemtype: "customer", + attrcode: "opr", + visible: true, + // fixed: 'right', + render(text, record, index) { + let pk_workinggroup = record.values.pk_workinggroup.value; + /*编辑态*/ + if (_this.state.isEdit) { + return ( +
    + {record.isleaf ? ( +
    + {json['701001RWCL-0122']} +
    + ) : ( + "" + )} +
    + ); + } else { + /*浏览态*/ + return ( +
    + {User({ + fieldid:'SSCSMUserGridRef', + onChange: manager.addWorkGroupUser.bind(_this,pk_workinggroup,"chargeman"), + clickContainer: {`+${json['701001RWCL-0119']}`},//组长 + unitProps: { + placeholder: json['701001RWCL-0195'],//业务单元+集团 + refName: json['701001RWCL-0195'],//业务单元+集团 + refType: "tree", + refCode: "uapbd.refer.org.BusinessUnitAndGroupTreeRef", + // rootNode:{ refname: `+${json['701001RWCL-0195']}`, refpk: 'root' }, + queryTreeUrl: "/nccloud/uapbd/ref/BusinessUnitAndGroupTreeRef.do", + isMultiSelectedEnabled: true + }, + queryCondition:{pk_workinggroup:pk_workinggroup,usertype:'chargeman'}, + isCacheable:false, + isShowUnit: true, + // unitValueIsNeeded:true + })} + {record.isleaf + ? User({ + fieldid:'SSCSMUserGridRef', + onChange: manager.addWorkGroupUser.bind( _this,pk_workinggroup,"member"), + clickContainer: ({`+${json['701001RWCL-0120']}`}),//组员 + unitProps: { + placeholder: json['701001RWCL-0195'],//业务单元+集团 + refName: json['701001RWCL-0195'],//业务单元+集团 + // rootNode:{ refname: `+${json['701001RWCL-0195']}`, refpk: 'root' }, + refType: "tree", + refCode: "uapbd.refer.org.BusinessUnitAndGroupTreeRef", + queryTreeUrl: "/nccloud/uapbd/ref/BusinessUnitAndGroupTreeRef.do", + isMultiSelectedEnabled: true + }, + queryCondition:{pk_workinggroup:pk_workinggroup,usertype:'member'}, + isCacheable:false, + isShowUnit: true, + // unitValueIsNeeded:true + }) + : ""} +
    + ); + } + } + } + ] + } + }; + props.meta.setMeta(meta); + }}) +} + +// 高亮显示搜索关键词 +function highLightKeyWord (searchcontent, val, hightLight) { + if ( + val.indexOf(searchcontent) > -1 + ) { + const arr = val.split(searchcontent), ret = [] + let _idx = -1, onoff = false + while(++_idx < arr.length) { + ret.push(arr[_idx]) + if (_idx !== arr.length - 1) { + if (onoff) { + ret.push(searchcontent) + } else { + ret.push(hightLight) + onoff = true + } + } + } + return ret + } + return val +} + +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/events/managerWorkUser.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/managerWorkUser.js new file mode 100644 index 0000000..9fbbbb7 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/events/managerWorkUser.js @@ -0,0 +1,430 @@ +/*LUMP5jVMiqUsmDt0yAGc515qVJv/XaGG1kSQO/dG1P4=*/ +import { base,toast } from 'nc-lightapp-front'; +import requestApi from '../requestApi' +const { NCMessage } = base; +/** + * @Author:gaoymf + * @Description:根据id查找末级节点,递归计算作业组人员 + * @Date: 14:00 2018/6/11 + * @param: + */ +let getLeafChildrenById = function(id, children) { + let { initInfoArr } = this.state; + initInfoArr.map((initInfo) => { + if (initInfo.pid == id) { + if (initInfo.isleaf) { + children.push(initInfo); + } else { + getLeafChildrenById.call(this, initInfo.pk_workinggroup, children); + } + } + }) +}; + +/** + * @Author:gaoymf + * @Description:获得当前组下的人员 = 原始数据 + 新增 - 删除 + * @Date: 16:40 2018/6/7 + * @param: + */ +let getRenderWorkGroupInfoArr = function(initInfoArr, addInfoArr, delInfoArr, usertype) { + // 原始的数据 + initInfoArr.map((workGroupInfo) => { + // 新增的 + addInfoArr.map((addInfo) => { + if (addInfo.usertype == usertype) { + if (workGroupInfo.pk_workinggroup == addInfo.pk_workinggroup) { + workGroupInfo.orgNames.push(addInfo.orgName); + workGroupInfo.deptNames.push(addInfo.deptName); + workGroupInfo.pk_userArr.push(addInfo.pk_user); + workGroupInfo.status.push(1); + workGroupInfo.display.push(addInfo.display); + workGroupInfo.code.push(addInfo.code); + } + } + }) + // 删除的 + delInfoArr.map((delInfo) => { + if (delInfo.usertype == usertype) { + if (workGroupInfo.pk_workinggroup == delInfo.pk_workinggroup) { + let index = workGroupInfo.pk_userArr.indexOf(delInfo.pk_user); + workGroupInfo.deptNames.splice(index, 1); + workGroupInfo.orgNames.splice(index, 1); + workGroupInfo.pk_userArr.splice(index, 1); + workGroupInfo.status.splice(index, 1); + workGroupInfo.display.splice(index, 1); + workGroupInfo.code.splice(index, 1); + } + } + }) + }) + return initInfoArr; +} + +/** + * @Author:gaoymf + * @Description:根据组的pk获得末级对应的组长/组员用户 + * @Date: 9:38 2018/6/7 + * @param: groupArr 选中组的pk usertype 选中的类型 + */ +let getWorkUserArrByGroupPk = function(groupArr, usertype) { + let { initInfoArr } = this.state; + let workGroupInfoArr = []; + groupArr.map((group) => { + initInfoArr.map((initInfo) => { + let workGroupInfo = { + pid: initInfo.pid, // 作业组pid + orgNames: [], // 组织名称 + deptNames: [], // 部门名称 + pk_workinggroup: group,// 作业组pk + pk_userArr: [], // 人员pks + display: [], // 人员名称 + status: [], // 人员状态 0是原始 1 是新增 + code: [], + isleaf: initInfo.isleaf// 是否是末级作业组 + }; + if (initInfo.isleaf) { + // 末级组返回组员和组长信息 + if (initInfo.pk_workinggroup == group) { + if ('member' === usertype) { + // 组员 member + initInfo.member.map((obj) => { + workGroupInfo.display.push(obj.name); + workGroupInfo.pk_userArr.push(obj.value); + workGroupInfo.deptNames.push(obj.deptNames); + workGroupInfo.orgNames.push(obj.orgNames); + workGroupInfo.code.push(obj.code); + workGroupInfo.status.push(0); + }) + workGroupInfoArr.push(workGroupInfo); + } else { + // 组长 chargeman + initInfo.chargeman.map((obj) => { + workGroupInfo.display.push(obj.name); + workGroupInfo.pk_userArr.push(obj.value); + workGroupInfo.deptNames.push(obj.deptNames); + workGroupInfo.orgNames.push(obj.orgNames); + workGroupInfo.code.push(obj.code); + workGroupInfo.status.push(0); + }) + workGroupInfoArr.push(workGroupInfo); + } + } + } else { + // 父级作业组只返回组长信息 + if (initInfo.pk_workinggroup == group) { + initInfo.chargeman.map((obj) => { + workGroupInfo.display.push(obj.name); + workGroupInfo.pk_userArr.push(obj.value); + workGroupInfo.deptNames.push(obj.deptNames); + workGroupInfo.orgNames.push(obj.orgNames); + workGroupInfo.code.push(obj.code); + workGroupInfo.status.push(0); + }) + workGroupInfoArr.push(workGroupInfo); + } + } + }) + }) + return workGroupInfoArr; +} +/** + * @Author:gaoymf + * @Description: 新增作业组用户 + * @Date: 10:30 2018/6/6 + * @param:groupArr:选中的组pk checkInfoArr:选中的人员 isDrag:标识是拖拽的还是选中引起的新增 + */ +let addWorkUser = function(groupArr, checkInfoArr, isDrag) { + let { delInfoArr, addInfoArr } = this.state; + let multiLang = this.props.MutiInit.getIntl(7010); + // 目标组的信息 + let workGroupInfoArr = getWorkUserArrByGroupPk.call(this, groupArr, checkInfoArr[0].usertype); + // 现在的数据=原始数据+新增的数据+删除的数据 + let nowWorkUserInfoArr = getRenderWorkGroupInfoArr(workGroupInfoArr, addInfoArr, delInfoArr, checkInfoArr[0].usertype); + // 1.判断重复数据 + let repeatArr = []; + // 临时缓存移动人员,防止兼职人员多选移动到统一组中 + let checkInfoUsers1 = []; + nowWorkUserInfoArr.map((workUserInfo) => { + checkInfoArr.map((checkInfo)=>{ + if(workUserInfo.pk_userArr.indexOf(checkInfo.pk_user)>-1){ + // 校验兼职人员复制到同一个组中 + if(checkInfoUsers1.indexOf(checkInfo.pk_user+'-'+workUserInfo.pk_workinggroup)<0){ + repeatArr.push(checkInfo.display); + // 缓存已处理的人员 + checkInfoUsers1.push(checkInfo.pk_user+'-'+workUserInfo.pk_workinggroup); + } + } + }) + }) + // 存在重复的数据 + if(repeatArr.length>0){ + //701001RWCL-0123:'目标作业组下已存在用户:' , 701001RWCL-0124:'、' + toast({ content: multiLang && multiLang.get('701001RWCL-0123') + '\n' + repeatArr.join(multiLang && multiLang.get('701001RWCL-0124')), color: 'danger' }) + return false; + }else { + // 临时缓存移动人员,防止兼职人员多选移动到统一组中 + let checkInfoUsers2 = []; + nowWorkUserInfoArr.map((workUserInfo) => { + if (workUserInfo.isleaf) { + checkInfoArr.map((checkInfo) => { + // 校验兼职人员复制到同一个组中 + if(checkInfoUsers2.indexOf(checkInfo.pk_user+'-'+workUserInfo.pk_workinggroup)<0){ + addInfoArr.push({ + orgName:checkInfo.orgName, // 组织名称 + deptName:checkInfo.deptName, // 部门名称 + pk_workinggroup: workUserInfo.pk_workinggroup, // 作业组pk + usertype: checkInfo.usertype, // 人员类型 + display: checkInfo.display, // 人员名称 + pk_user: checkInfo.pk_user, // 人员pk + code: checkInfo.code, + }) + // 缓存已处理的人员 + checkInfoUsers2.push(checkInfo.pk_user+'-'+workUserInfo.pk_workinggroup); + } + }) + } + }) + if (isDrag) { + this.setState({ addInfoArr: addInfoArr }); + } else { + this.setState({ addInfoArr: addInfoArr, checkInfoArr: [] }); + } + return true; + } +} +/** + * @Author:gaoymf + * @Description:删除作业组用户 + * @Date: 10:31 2018/6/6 + * @param: checkInfoArr:选中的人员 isDrag:标识是拖拽的还是选中的,此处用来控制选中是否清空 + */ +let delWorkUser = function(checkInfoArr, isDrag) { + let { delInfoArr, addInfoArr } = this.state; + checkInfoArr.map((checkInfo) => { + if (checkInfo.isTemp) { + // 临时数据删除 + addInfoArr.map((addInfo, idx) => { + if (addInfo.pk_workinggroup == checkInfo.pk_workinggroup) { + if (addInfo.pk_user == checkInfo.pk_user) { + addInfoArr.splice(idx, 1); + } + } + }) + } else { + delInfoArr.push({ + pk_workinggroup: checkInfo.pk_workinggroup, + pk_user: checkInfo.pk_user, + usertype: checkInfo.usertype, + display: checkInfo.display + }) + } + }) + if (isDrag) { + this.setState({ delInfoArr: delInfoArr, addInfoArr: addInfoArr }); + } else { + this.setState({ delInfoArr: delInfoArr, addInfoArr: addInfoArr, checkInfoArr: [] }); + } +} + +/** + * @Author:gaoymf + * @Description:选中作业组用户 + * @Date: 10:32 2018/6/6 + * @param: + */ +let checkWorkUser = function(deptName,orgName,pk_workinggroup, pk_user, display, usertype, isTemp) { + let { checkInfoArr } = this.state; + let flag = true; + let content; + let multiLang = this.props.MutiInit.getIntl(7010); + // 组长/组员分开操作 + if (checkInfoArr.length > 0) { + if(checkInfoArr[0].usertype!==usertype){ + flag = false; + if(checkInfoArr[0].usertype=='chargeman'){ + content = multiLang && multiLang.get('701001RWCL-0126');//请继续选择组员 + }else { + content = multiLang && multiLang.get('701001RWCL-0125');//请继续选择组长 + } + } + if(flag){ + // checkInfoArr.map((checkInfo)=>{ + // if(checkInfo.pk_user==pk_user){ + // flag = false; + // content = display+'已选中,请勿重复选择'; + // } + // }) + } + } + if (flag) { + // 临时数据点击 + checkInfoArr.push({ + deptName:deptName, // 部门名称 + orgName:orgName, // 组织名称 + pk_workinggroup: pk_workinggroup, // 组的pk + usertype: usertype, // 人员类型 member 组员 chargman 组长 + pk_user: pk_user, // 用户pk + display: display, // 显示值 + isTemp: isTemp // 原始数据:false 临时数据:true + }) + this.setState({ checkInfoArr: checkInfoArr }) + } else { + toast({ content: content, color: 'danger' }) + } + +} +/** + * @Author:gaoymf + * @Description:全选 + * @Date: 16:28 2018/6/6 + * @param: + */ +let checkAllWorkUser = function(record) { + let { checkInfoArr, addInfoArr, delInfoArr } = this.state; + let multiLang = this.props.MutiInit.getIntl(7010); + // 获得原始数据 + let workGroupInfoArr = getWorkUserArrByGroupPk.call(this, [record.pk_workinggroup.value], 'member'); + // 获得当前数据 + let renderWorkUserInfoArr = getRenderWorkGroupInfoArr(workGroupInfoArr, addInfoArr, delInfoArr, 'member'); + // 维护已经选中的人员 + let hasCheckPKUserArr = [] + // 判断选中区是否有相同的人员 + let flag = true + // 提示内容 + let content = []; + renderWorkUserInfoArr[0].pk_userArr.map((pk_user, idx) => { + if (checkInfoArr.length > 0) { + // 校验相同的人员是否已经被选中了 + checkInfoArr.map((checkInfo) => { + // 获得当前作业组已经选中的人员 hasCheckPKUserArr + if (checkInfo.pk_workinggroup == renderWorkUserInfoArr[0].pk_workinggroup) { + if (checkInfo.pk_user == pk_user) { + hasCheckPKUserArr.push(pk_user); + } + }else { + // 已选中中有不同作业组的相同人员 + if (checkInfo.pk_user == pk_user) { + flag = false; + content.push(checkInfo.display); + } + } + }) + } + }) + if(flag){ + renderWorkUserInfoArr[0].pk_userArr.map((pk_user, idx) => { + // 已选中中没有的人员新增到选中中 + if (hasCheckPKUserArr.indexOf(pk_user) == -1) { + checkInfoArr.push({ + deptName:renderWorkUserInfoArr[0].deptName, // 部门名称 + orgName:renderWorkUserInfoArr[0].orgName, // 组织名称 + pk_workinggroup: renderWorkUserInfoArr[0].pk_workinggroup, // 组的pk + usertype: 'member', // 人员类型 member 组员 chargman 组长 + pk_user: pk_user, // 用户pk + display: renderWorkUserInfoArr[0].display[idx], // 显示值 + isTemp: renderWorkUserInfoArr[0].status[idx] == 1 ? true : false // 1 表示新增 0 是原始 + }) + } + }) + }else { + //701001RWCL-0127:']已选中,请勿重复选择' + toast({ content: "["+content+ multiLang && multiLang.get('701001RWCL-0127'), color: 'danger' }) + } + + this.setState({ checkInfoArr: checkInfoArr, addInfoArr: addInfoArr }); +} +/** + * @Author:gaoymf + * @Description:删除选中区的人员 + * @Date: 14:22 2018/6/6 + * @param:pk_workinggroup 组pk pk_user:人员pk + */ +let delCheckWorkUser = function(pk_workinggroup, pk_user) { + let newCheckInfoArr = this.state.checkInfoArr.filter((item) => { + if (item.pk_workinggroup == pk_workinggroup) { + if (item.pk_user !== pk_user) { + return true + } else { + return false; + } + } else { + return true; + } + }) + this.setState({ checkInfoArr: newCheckInfoArr }) +} +/** + * @Author:gaoymf + * @Description:新增人员 + * @Date: 14:22 2018/6/6 + * @param:pk_workinggroup 组pk usertype:人员类型 infoArr:选中的数据 + */ +let addWorkGroupUser = function(pk_workinggroup, usertype, infoArr) { + let data = [] + if (infoArr.length > 0) { + infoArr.map((info) => { + data.push({ + pk_workinggroup: pk_workinggroup, + usertype: usertype, + pk_user: info.refpk + }) + }) + requestApi.addWorkGroupUser({ + data: data, + success: (res) => { + this.queryData(this.state.SSCCenter.refpk); + } + }) + } +} + +/** + * @Author:gaoymf + * @Description:拖拽人员放下时触发 + * @Date: 14:22 2018/8/8 + * @param:pk_workinggroup 组pk + */ +let drop = function(pk_workinggroup, e) { + e.preventDefault(); + // 目标组新增 + let flag = addWorkUser.call(this, [pk_workinggroup], this.dragInfoArr, true); + // 源组删除 + if(flag){ + delWorkUser.call(this, this.dragInfoArr, true); + // 清除选中区中的人员 + delCheckWorkUser.call(this, this.dragInfoArr[0].pk_workinggroup, this.dragInfoArr[0].pk_user); + this.dragInfoArr = []; + } +} +/** + * @Author:gaoymf + * @Description:目标区域阻止浏览器事件 + * @Date: 14:22 2018/8/8 + * @param: + */ +let allowDrop = function(e) { + e.preventDefault(); +} +/** + * @Author:gaoymf + * @Description:拖动时触发 + * @Date: 14:22 2018/8/8 + * @param: + */ +let drag = function(code,deptName,orgName,pk_workinggroup,pk_user,pk_username,usertype,isTemp,e) { + let dragInfoArr = []; + dragInfoArr.push({ + code, + orgName, // 组织名称 + deptName, // 部门名称 + pk_workinggroup, // 组的pk + usertype, // 人员类型 member 组员 chargman 组长 + pk_user, // 用户pk + display:pk_username, // 显示值 + isTemp, // 原始数据 false 临时数据 true + }) + this.dragInfoArr = dragInfoArr; +} +export default { addWorkUser, delWorkUser, checkWorkUser, checkAllWorkUser, delCheckWorkUser, getRenderWorkGroupInfoArr, getWorkUserArrByGroupPk, getLeafChildrenById, addWorkGroupUser,drag,drop,allowDrop } +/*LUMP5jVMiqUsmDt0yAGc515qVJv/XaGG1kSQO/dG1P4=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/index.css b/src/ssctpaaa/sscsetting/workinggroupuser/config/index.css new file mode 100644 index 0000000..e98721d --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/index.css @@ -0,0 +1,6 @@ +@media screen and (min-width: 1920px) { + #fixed-bottom-area { + padding-left: calc(50% - 930px) !important; + padding-right: calc(50% - 930px) !important; + } +} diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/index.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/index.js new file mode 100644 index 0000000..04a4007 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/index.js @@ -0,0 +1,6 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import WorkingGroupUser from './workingGroupUser'; +ReactDOM.render( , document.querySelector('#app')); +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/index.less b/src/ssctpaaa/sscsetting/workinggroupuser/config/index.less new file mode 100644 index 0000000..f4a859b --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/index.less @@ -0,0 +1,408 @@ +@import "~base"; + +.container{ + .nc-single-table{ + height: 91%; + } +} + +.nc-singleTable-table-area{ + .treeTableManyCol{ + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + } + .void{ + position: absolute; + width: 100%; + background: #f6f6f6; + bottom: 0; + top: 300px; + } +} +.nc-singleTable-table-area--edit { + margin-bottom: 48px; +} +.nc-singleTable-header-area { + border-bottom: 0px solid #edecec !important; + height: 46px!important; + .title-search-detail{ + font-weight: bold!important; + } + .header-button-area{ + .u-button:nth-child(1) { + min-width: 60px !important; + border: none; + &:hover{ + border: none; + } + } + } +} +// 锚点样式 +#fixed-bottom-area { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + padding-left: 16px; + padding-right: 16px; + z-index: 1; +} +.nc-ssctp-bottom-area { + width: 100%; + height: 100%; + position: relative; + background: #717478; + padding: 9px 30px 9px 36px; + display: flex; + align-items: center; + .nc-ssctp-bottom-button-area { + margin-left: auto; + display: -webkit-box; + display: flex; + + .u-button { + width: max-content; + } + } + .nc-ssctp-bottom-count-area { + margin-right: 24px; + min-width: 68px; + height: 24px; + line-height: 24px; + display: inline-block; + color: #FFFFFF; + font-family: MicrosoftYaHei; + } + .nc-ssctp-bottom-items-area { + height: 100%; + align-items: center; + line-height: 30px; + margin-right: 38px; + .nc-ssctp-bottom-item { + display: inline-block; + border-radius: 4px; + margin-left: 8px; + min-width: 60px; + height: 24px; + line-height: 24px; + background-color:rgb(224,224,224); + padding: 0px 5px 0px 8px; + font-size: 12px; + font-family: PingFangHK; + .nc-ssctp-bottom-item-del-icon { + float: right; + height: 7px; + width: 7px; + color: #76797D; + cursor: pointer; + } + &:hover { + background-color: rgb(238,238,238); + } + } + } + +} + +// 操作列样式 +.currency-opr-col > div { + display: inline-block !important; + cursor: pointer; + line-height: 17px; + color: #007ACE; + width: auto; + min-width: 54px; + margin-right: 10px; +} + +.currency-opr-col > div:last-child { + margin-right: 0; +} + +.currency-opr-col { + width: 175px; +} + + +.nc-ssctp-orgin-div { + padding: 5px 11px 1px 0px; + vertical-align: middle; + text-align: center; + + &:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + + span { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +.u-table-row { + td:nth-child(4) { + position: relative; + overflow: hidden; + padding: 0 !important; + + .nc-ssctp-orgin-div { + position: relative; + left: -1px; + } + } +} + + +// 组员样式 +// 初始&&浏览态 +.nc-ssctp-orgin-span { + width: 70px; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #111111; + float: left; + margin: 2px 0 2px 0px; + line-height: 22px; + + &::before { + content: ''; + width: 1px; + height: 10px; + background-color: #979797; + float: left; + margin-top: 6px; + } + + span { + padding: 2px 6px; + } +} + +// 初始&&编辑态 +.nc-ssctp-orgin-span-edit { + cursor: pointer; + width: 70px; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #111111; + float: left; + margin: 2px 0 2px 0px; + line-height: 22px; + + &::before { + content: ''; + width: 1px; + height: 10px; + background-color: #979797; + float: left; + margin-top: 6px; + } + + span { + padding: 2px 6px; + } +} + +// 初始&&已选中 +.nc-ssctp-orgin-span-check { + cursor: pointer; + width: 70px; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #0073e1; + float: left; + margin: 2px 0 2px 0px; + line-height: 22px; + + &::before { + content: ''; + width: 1px; + height: 10px; + background-color: #979797; + float: left; + margin-top: 6px; + } + + span { + background-color: rgba(243, 243, 243, 1); + border-radius: 9px; + padding: 2px 6px; + } +} + +// 新增&&未选中 +.nc-ssctp-add-span-uncheck { + cursor: pointer; + width: 70px; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #0073e1; + float: left; + margin: 2px 0 2px 0px; + line-height: 22px; + + &::before { + content: ''; + width: 1px; + height: 10px; + background-color: #979797; + float: left; + margin-top: 6px; + } + + span { + background-color: rgba(229, 227, 227, 1); + border-radius: 9px; + padding: 2px 6px; + } +} + +// 新增&&已选中 +.nc-ssctp-add-span-check { + cursor: pointer; + width: 70px; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #0073e1; + float: left; + margin: 2px 0 2px 0px; + line-height: 22px; + + &::before { + content: ''; + width: 1px; + height: 10px; + background-color: #979797; + float: left; + margin-top: 6px; + } + + span { + background-color: rgba(243, 243, 243, 1); + border-radius: 9px; + padding: 2px 6px; + } +} + +.nc-ssctp-orgin-div--black { + .nc-ssctp-orgin-span-check, + .nc-ssctp-add-span-check { + span { + background-color: #35353c !important; + } + } + + .nc-ssctp-add-span-uncheck { + span { + background-color: #2b2b30 !important; + } + } +} + +.ssc-must { + position: absolute; + z-index: 2; + color: #f22c1d; + margin-left: 4px; +} + +// 原始已查询 +.nc-ssctp-orgin-span-search { + height: 17px; + background: #ffd400; + border-radius: 2px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #111111; + line-height: 17px; + padding-left: 0 !important; + padding-right: 0 !important; +} +// 临时已查询 +.nc-ssctp-temp-span-search{ + height: 17px; + background: #ffd400; + border-radius: 2px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #C59D1B; + line-height: 17px; + padding-left: 0 !important; + padding-right: 0 !important; +} + +// 组长样式 +.nc-ssctp-orgin-span-check-chargman { + width: auto; + height: 22px; + border-radius: 3px; + background: #F9F2D3; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #111111; + float: left; + padding: 1px 9px 1px 9px; + margin: 1px 2px 3px 2px; + line-height: 22px; +} + +.nc-ssctp-add-span-check-chargman { + float:left; + width: auto; + height: 22px; + border-radius: 3px; + background: #F9F2D3; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #C59D1B; + float: left; + padding: 1px 9px 1px 9px; + margin: 1px 2px 1px 2px; + line-height: 22px; +} + +.nc-ssctp-orgin-span-edit-chargman { + cursor: pointer; + width: auto; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #111111; + float: left; + margin: 2px 11px 2px 11px; + line-height: 22px; +} + +.nc-ssctp-add-span-uncheck-chargman { + cursor: pointer; + width: auto; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #C59D1B; + float: left; + margin: 2px 11px 2px 11px; + line-height: 22px; +} + +.nc-ssctp-orgin-span-chargman { + width: auto; + height: 22px; + font-size: 13px !important; + font-family: MicrosoftYaHei; + color: #111111; + float: left; + margin: 2px 22px 2px 0px; + line-height: 22px; +} diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/requestApi.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/requestApi.js new file mode 100644 index 0000000..58c8016 --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/requestApi.js @@ -0,0 +1,34 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { ajax } from 'nc-lightapp-front'; + +let requestDomain = ''; + +let requestApiOverwrite = { + // 新增组长/组员接口 + addWorkGroupUser: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroupuser/InsertAction.do', + data: opt.data, + success: opt.success + }); + }, + // 查询作业组人员接口 + queryWorkGroupUser: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroupuser/QueryAction.do', + data: opt.data, + success: opt.success + }); + }, + // 保存接口 + saveWorkGroupUser: (opt) => { + ajax({ + url: '/nccloud/sscbd/workinggroupuser/ConvertUserAction.do', + data: opt.data, + success: opt.success + }); + } +} + +export default requestApiOverwrite; +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscsetting/workinggroupuser/config/workingGroupUser.js b/src/ssctpaaa/sscsetting/workinggroupuser/config/workingGroupUser.js new file mode 100644 index 0000000..e6ad17e --- /dev/null +++ b/src/ssctpaaa/sscsetting/workinggroupuser/config/workingGroupUser.js @@ -0,0 +1,253 @@ +/*5ClB7Pnn+Vci3QeuVCVXi90t/e2aio0eKQpEd2QHkco=*/ +import React, { Component } from 'react'; +import { createPage, base, createPageIcon} from 'nc-lightapp-front'; +import { buttonClick, initTemplate, manager, affixButtonClick } from './events'; +import requestApi from './requestApi' +import SSCCenter from '../../../refer/sscbd/SSCUnitGridRef' +import SSCWorkGroup from '../../../refer/sscbd/SSCWorkGroupGridRef' +import { Nav } from 'ssccommon/components/global-nav' +import './index.less'; +import './index.css'; +const { NCFormControl, NCAffix, NCButton,NCDiv} = base; +import { + nccGetTheme, + } from 'ssccommon/utils/asyncFunctions.js'; + +class WorkingGroupUser extends Component { + constructor(props) { + super(props); + this.state = { + isEdit:false, // 编辑态/浏览态 + SSCCenter:{}, // 共享中心 + searchValue:'', // 查询项 + initInfoArr:[], // 原始的人员 + checkInfoArr:[], // 选中的人员 + addInfoArr:[], // 新增的人员 + delInfoArr:[], // 删除的人员 + isBlackTheme: false, // 是否暗黑主题 + }; + this.dragInfoArr = []; // 拖拽的信息 + initTemplate.call(this, props); + } + componentDidMount() { + this._getTheme() + // 初始化表格 + this.props.treeTableManyCol.initTreeTableData('treeTableCol', [], ''); + + let pk_sscunit = this.props.getUrlParam('pk_sscunit'); + setTimeout(() => { + pk_sscunit && this.onSSCCenterChange.call(this, JSON.parse(pk_sscunit)); + }, 300); + } + + // 获取主题 + _getTheme = async () => { + const theme = await nccGetTheme() + this.setState({isBlackTheme: theme === 'black'}) + } + //共享中心改变事件 + onSSCCenterChange = (ssc) => { + if (ssc.refpk) { + this.setState({ SSCCenter: ssc }); + this.queryData(ssc.refpk); + } else { + this.setState({ SSCCenter: {} }); + this.props.treeTableManyCol.initTreeTableData('treeTableCol', [], ''); + } + // 保存共享中心 + this.props.setUrlParam({pk_sscunit: ssc.hasOwnProperty('refpk') ? JSON.stringify(ssc) : ''}); + } + // 查询datas + queryData(pk_sscunit) { + requestApi.queryWorkGroupUser({ + data:{pk_sscunit:pk_sscunit}, + success:(res)=>{ + //console.log('作业组用户查询',res); + // 以下代码维护一个初始化数据 + let initInfoArr = [] + if(res.data.rows){ + res.data.rows.map((node)=>{ + // pid为null的节点为顶级节点 + node.values.pid==null&&delete node.values.pid; + }) + res.data.rows.map((item)=>{ + let initInfo ={ + pid:item.values.pid!==undefined&&item.values.pid.value, // 父节点pk + pk_workinggroup:item.values.pk_workinggroup.value, // 工作组pk + pk_workinggroup_name:item.values.pk_workinggroup.display,// 工作组名称 + isleaf:item.values.isleaf.value, // 是否末级节点 + chargeman:[], // 组长数组 + member:[], // 组员数组 + } + item.values.chargeman.display.map((name,idx)=>{ + initInfo.chargeman.push({ + orgNames:item.values.chargeman.orgNames[idx], // 组织名称 + deptNames:item.values.chargeman.deptNames[idx], // 部门名称 + name:name, // 组长名称 + value:item.values.chargeman.value[idx], // 组长pk + vos:item.values.chargeman.vos[idx], // 接口返回VO + code: item.values.chargeman.code[idx] + }); + }) + item.values.member.display.map((name,idx)=>{ + initInfo.member.push({ + orgNames:item.values.member.orgNames[idx], // 组织名称 + deptNames:item.values.member.deptNames[idx], // 部门名称 + name:name, // 组员名称 + value:item.values.member.value[idx], // 组员pk + vos:item.values.member.vos[idx], // 接口返回VO + code: item.values.member.code[idx], + }); + }) + initInfoArr.push(initInfo); + }) + //console.log('作业组用户初始化数据',initInfoArr) + //同步时,将数据转换成组件需要的数据结构。需要先添加refpk(值为自身主键的值)、pid(值为父元素主键的值)两个字段。 + let data = this.props.treeTableManyCol.createNewData(res.data.rows); + this.props.treeTableManyCol.initTreeTableData('treeTableCol', data, 'pk_workinggroup',true); + this.setState({ initInfoArr: initInfoArr, addInfoArr: [], delInfoArr: [] ,isEdit: false }); + }else { + this.props.treeTableManyCol.initTreeTableData('treeTableCol', [], ''); + } + // 以上代码维护一个初始化数据 + } + }) + } + // 渲染锚点操作行 + drawCtrContent = () => { + let itemList = []; + this.state.checkInfoArr.map((item)=>{ + itemList.push( + + {item.display} + x + + ) + }) + return itemList; + } + + render() { + const { treeTableManyCol } = this.props; + let { treeTableCol } = treeTableManyCol; + let itemContent = this.drawCtrContent(); + let multiLang = this.props.MutiInit.getIntl(7010); + + const tableClass = this.state.isEdit ? 'nc-singleTable-table-area nc-singleTable-table-area--edit' : 'nc-singleTable-table-area' + + return ( +
    + {/* 导航条*/} +
    + ) + } +} +WorkingGroupUser = createPage({ + mutiLangCode: '7010' +})(WorkingGroupUser); +export default WorkingGroupUser; +/*5ClB7Pnn+Vci3QeuVCVXi90t/e2aio0eKQpEd2QHkco=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/AdjustDialog.js b/src/ssctpaaa/sscuser/sscuser/list/components/AdjustDialog.js new file mode 100644 index 0000000..1bb0b73 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/AdjustDialog.js @@ -0,0 +1,67 @@ +/*RYs8HAAEM9KNDnbInZhf7uKd5AB1PazSQimXyaU5WvI=*/ +import React, {Component} from 'react' +import {base} from 'nc-lightapp-front' +const {NCModal,NCButton,NCTextArea} = base +import requestApi from '../requestApi' + +class AdjustDialog extends Component { + constructor(props) { + super(props) + this.state={ + memo:'' + } + } + // 保存并关闭 + save = () => { + requestApi.taskAdjustAction({ + data: { + pk_task: this.props.data.pk_currenttask.value, + actiontype: "adjust", + memo:this.state.memo, + ts: this.props.data.ts.value + }, + success: (data) => { + this.setState({memo: ''}) + this.props.successAdjust(data) + } + }) + } + + cancel = () => { + this.props.handleCloseModal() + this.setState({memo:''}) + } + + render() { + let multiLang = this.props.MutiInit.getIntl(7010); + return ( + {this.cancel()}}> + + {/*701001RWCL-0007:申请调整*/} + {multiLang && multiLang.get('701001RWCL-0007')} + + +
    +
    + {/*701001RWCL-0134:请输入申请调整原因*/} + {this.state.memo=val}} + /> +
    +
    +
    + + {multiLang && multiLang.get('701001RWCL-0007')} + {multiLang && multiLang.get('7010-0004')} + +
    + ) + } +} + +export default AdjustDialog +/*RYs8HAAEM9KNDnbInZhf7uKd5AB1PazSQimXyaU5WvI=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/CashierRejectDialog.js b/src/ssctpaaa/sscuser/sscuser/list/components/CashierRejectDialog.js new file mode 100644 index 0000000..267311b --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/CashierRejectDialog.js @@ -0,0 +1,62 @@ +/*Qa44rZ25gdfsWVjxPrmnzTmsSitiRVWiLkfAsQj6gko=*/ +import React, { + Component +} from 'react' + +let animTimer = null, top = 0 + +class CashierRejectDialog extends Component { + constructor(props) { + super(props) + this.state = {} + } + + componentDidMount() { + const anim = document.getElementById('inner-text') + const flot = document.getElementById('floating-text') + this.setAnimatem(anim) + anim.onmouseenter = () => { + if (animTimer) clearInterval(animTimer) + // anim.style.top = '0' + // top = 0 + flot.style.transform = 'scale(1)' + } + anim.onmouseleave = () => { + if (animTimer) clearInterval(animTimer) + this.setAnimatem(anim) + flot.style.transform = 'scale(0)' + } + } + + setAnimatem = tag => { + animTimer = setInterval(() => { + top -= 0.02 + const basicHeight = document.getElementById('inner-text').childNodes[0].getBoundingClientRect().height + if (top <= basicHeight * -1) { + top = 0 + } + tag.style.top = `${top}px` + }, 0) + } + + render() { + const {manualReason} = this.props + return ( +
    +
    +
    + ! {manualReason}
    + ! {manualReason} +
    +
    + +
    + {manualReason} +
    +
    + ) + } +} + +export default CashierRejectDialog +/*Qa44rZ25gdfsWVjxPrmnzTmsSitiRVWiLkfAsQj6gko=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/creditApproval.js b/src/ssctpaaa/sscuser/sscuser/list/components/creditApproval.js new file mode 100644 index 0000000..e6f568d --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/creditApproval.js @@ -0,0 +1,239 @@ +/*ZsBXL3NdlRxYIImu/l1dnge++xqxU9zcuVCp6oPp5Qk=*/ +import React, {Component} from 'react' +import {base, toast,promptBox, viewModel } from 'nc-lightapp-front' +const {NCModal,NCButton,NCTextArea} = base +const { getGlobalStorage } = viewModel +import requestApi from '../requestApi' +import { reloadBillPage } from '../events' +import classnames from 'classnames'; + + +class CreditApprovalDialog extends Component { + constructor(props) { + super(props) + this.state={ + memo:'', + jkCheck:false, + ntbCheck:false, + memo:'', + ruleSearchValue: '' + } + this.ruleSearchThresholdTime = null; + + + } + + save = () => { + let credits = [] + let multiLang = this.props.MutiInit.getIntl(7010); + this.props.creditsArray.forEach(each => { + credits.push(each.refpk) + }) + if (this.props.creditView && credits.length == 0) { + toast({ + color: 'warning', + title: multiLang && multiLang.get('701001RWCL-0135'),//701001RWCL-0135:请注意 + content: multiLang && multiLang.get('701001RWCL-0136')//701001RWCL-0136:请选择至少一个信用指标 + }) + return + } + + requestApi.taskApproveAction({ + data: { + pk_currenttask: this.state.currentRowData.pk_currenttask.value, + pk_task: this.state.currentRowData.pk_task.value, + pk_group: this.state.currentRowData.pk_group.value, + info: this.state.memo, + billtype:this.props.currentRowData.billtypecode.value, + billno:this.props.currentRowData.billno.value, + busiid:this.props.currentRowData.busiid.value, + skipcodes:this.state.skipcodes, + ntbCheck:this.state.ntbCheck, + actiontype: "sscapprove", + credits, + jkCheck:this.state.jkCheck, + transtypecode:this.props.currentRowData.transtypecode.value, + mod:this.props.currentRowData.module.value, + ts: this.props.currentRowData.ts.value + }, + success: (data) => { + if (data.success) { + if(data.data&&data.data['jkAlarm']){ + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'),//"提示信息" + content: (multiLang && multiLang.get('701001RWCL-0048'))+ data.data['jkAlarm'] + (multiLang && multiLang.get('701001RWCL-0049')), + noFooter: false, // 是否显示底部按钮(确定、取消),默认显示(false),非必输 + noCancelBtn: false, // 是否显示取消按钮,,默认显示(false),非必输 + beSureBtnName: multiLang && multiLang.get('7010-0001'), + cancelBtnName: multiLang && multiLang.get('7010-0004'), + beSureBtnClick: ()=>{ + this.state.jkCheck=true; + this.save(); + } + //cancelBtnClick: functionCancel // 取消按钮点击调用函数,非必输 + }) + }else if(data.data&&data.data['bugetAlarm']){ + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'),//"提示信息" + content: (multiLang && multiLang.get('701001RWCL-0048'))+ data.data['bugetAlarm'] + (multiLang && multiLang.get('701001RWCL-0049')), + noFooter: false, // 是否显示底部按钮(确定、取消),默认显示(false),非必输 + noCancelBtn: false, // 是否显示取消按钮,,默认显示(false),非必输 + beSureBtnName: multiLang && multiLang.get('7010-0001'), + cancelBtnName: multiLang && multiLang.get('7010-0004') , + beSureBtnClick: ()=>{ + this.state.ntbCheck = true; + this.state.skipcodes = data.data['skipcodes'] + this.save(); + } + //cancelBtnClick: functionCancel // 取消按钮点击调用函数,非必输 + }) + } else { + this.props.successCreditApproval(data.data.ts) + this.state.currentRowData = this.props.currentRowData; + let module = this.props.currentRowData.module.value || ""; + let _ncc_websocket_switch_ = getGlobalStorage("localStorage", "_ncc_websocket_switch_") || "0";//默认为合盘环境 + if (_ncc_websocket_switch_ == "0" || module == "webdbl") {//非微服务环境或者工单 + reloadBillPage.call(this); + } + } + } + } + }) + } + + cancel = () => { + this.props.handleCloseModal() + this.setState({memo:''}) + } + + ruleItemSelect = (item, selectedRuleItems) => { + if (selectedRuleItems[item.refpk]) { + delete selectedRuleItems[item.refpk] + } else { + selectedRuleItems[item.refpk] = item; + } + + this.props.setCheckedCredits(Object.values(selectedRuleItems)); + } + + ruleSearchChange(e) { + let value = e.target.value; + let trimValue = value.trim(); + this.setState({ + ruleSearchValue: value + }); + clearTimeout(this.ruleSearchThresholdTime); + this.ruleSearchThresholdTime = setTimeout(() => { + + let creditRuleItems = this.props.creditRuleItems; + Object.values(creditRuleItems).forEach((rootItem) => { + rootItem.children.forEach((item) => { + if (!trimValue || item.refname.indexOf(trimValue) != -1) { + item.notSearch = false; + } else { + item.notSearch = true; + } + }) + }) + this.props.setCreditRuleItems(creditRuleItems); + }, 200) + + + } + + render() { + const { + creditsArray, + setCheckedCredits, + creditView + } = this.props + + let selectedRuleItems = {} + let multiLang = this.props.MutiInit.getIntl(7010); + creditsArray && creditsArray.forEach((item) => { + selectedRuleItems[item.refpk] = item; + }) + + return ( + {this.cancel()}}> + + {/*701001RWCL-0139:信用审批*/} + {multiLang && multiLang.get('701001RWCL-0139')} + + +
    +
    + { + creditsArray.map((each, idx) => ( + + {each.refname} + { + this.props.deleteCreditByIdx(idx) + }} + > - + + )) + } +
    + {/*"701001RWCL-0137": "请输入信用审批建议"*/} + {this.state.memo=val}} + /> +
    +
    +
    + {/*"701001RWCL-0140": "信用评价"*/} + {multiLang && multiLang.get('701001RWCL-0140')} + + {/*"701001RWCL-0138": "请查询"*/} + + +
    +
    + {Object.values(this.props.creditRuleItems).map((rootItem) => { + return [ +
    {rootItem.item.refname}
    , +
      + {rootItem.children.map((item) => { + return ( +
    • + {item.refname} +
    • + ) + })} +
    + ] + })} + +
    + +
    +
    + + {/*701001RWCL-0037:信用批准,7010-0004:取消*/} + {multiLang && multiLang.get('701001RWCL-0037')} + {multiLang && multiLang.get('7010-0004')} + +
    + ) + } +} + +export default CreditApprovalDialog +/*ZsBXL3NdlRxYIImu/l1dnge++xqxU9zcuVCp6oPp5Qk=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/getTask.js b/src/ssctpaaa/sscuser/sscuser/list/components/getTask.js new file mode 100644 index 0000000..9053382 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/getTask.js @@ -0,0 +1,34 @@ +/*IQX/BvUIMt8UjvN5o3gbnTiguPwFDmb2VqQv+Z12dfw=*/ +import React, {Component} from 'react' + +export default class GetTask extends Component { + constructor(props) { + super(props) + this.state = {} + } + + render() { + let multiLang = this.props.MutiInit.getIntl(7010); + const { + search: {NCCreateSearch}, + queryAreaCode, + taskTakeAction, + oid + } = this.props + + return ( + NCCreateSearch( + queryAreaCode, + { + clickSearchBtn: (props, data, key) => { + taskTakeAction(data) + }, + oid: oid, + onlyShowSuperBtn: true, + replaceSuperBtn: multiLang && multiLang.get('701001RWCL-0001')//701001RWCL-0001:定向提取 + } + ) + ) + } +} +/*IQX/BvUIMt8UjvN5o3gbnTiguPwFDmb2VqQv+Z12dfw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/handonDialog.js b/src/ssctpaaa/sscuser/sscuser/list/components/handonDialog.js new file mode 100644 index 0000000..1f821a2 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/handonDialog.js @@ -0,0 +1,74 @@ +/*NNSmk6bhmwq4ZjyD4WJSYuETud2+SW9BqNpYn95LG98=*/ +import React, { Component } from 'react' +import { base } from 'nc-lightapp-front' +const { NCModal, NCButton, NCTextArea } = base +import requestApi from '../requestApi' + +class HandonDialog extends Component { + constructor(props) { + super(props) + this.state = { + memo: '' + } + } + // 保存并关闭 + save = () => { + let reqData = { + pk_task: this.props.data.pk_currenttask.value, + actiontype: "handon", + memo: this.state.memo, + ts: this.props.data.ts.value, + } + if (this.props.showModal) { //单据详情页传递审核侧边栏数据 + reqData = { + ...reqData, + ...this.props.parentThis.auditPointBarInst.getAuditData(true) + } + } + requestApi.taskHandOnAction({ + data: reqData, + success: (data) => { + this.setState({ memo: '' }) + this.props.successHangUp(data) + } + }) + } + // 取消并关闭 + cancel = () => { + this.props.handleCloseModal() + this.setState({ memo: '' }) + } + + render() { + let multiLang = this.props.MutiInit.getIntl(7010); + return ( + { this.cancel() }}> + + {multiLang && multiLang.get('701001RWCL-0006')} + + +
    +
    + {/*701001RWCL-0141:请输入挂起原因*/} + { this.state.memo = val }} + /> +
    +
    +
    + + {/*7010-0004:取消,701001RWCL-0006:挂起*/} + this.save()} >{multiLang && multiLang.get('701001RWCL-0006')} + {multiLang && multiLang.get('7010-0004')} + +
    + ) + } +} + +export default HandonDialog +/*NNSmk6bhmwq4ZjyD4WJSYuETud2+SW9BqNpYn95LG98=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/imagAndVoucherHandle.js b/src/ssctpaaa/sscuser/sscuser/list/components/imagAndVoucherHandle.js new file mode 100644 index 0000000..d33b028 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/imagAndVoucherHandle.js @@ -0,0 +1,82 @@ +/*zhyjEPGIRKA975SGI1uWC5ht7qFtvsInzPCZLpeEjy4=*/ +import requestApi from '../requestApi' +import { imageView } from "sscrp/rppub/components/image"; + +//打开影像和展示联查凭证按钮处理逻辑 +function imagAndVoucherHandle() { + let imagAndVoucherOpsPromise = null; + let billInfoMap = {}; + billInfoMap.pk_billid = this.state.currentRowData.busiid.value; + billInfoMap.pk_billtype = this.state.currentRowData.billtypecode.value; + billInfoMap.pk_tradetype = this.state.currentRowData.transtypecode.value; + billInfoMap.pk_org = this.state.currentRowData.pk_org.value; + + //存在外系统,创建外系统请求Promise备用 + if (this.alreadySettingOts) { + imagAndVoucherOpsPromise = new Promise((resolve, _) => { + requestApi.imagAndVoucherOps({ + data: { + isImagInstalled: this.isImagInstalled, + billid: billInfoMap.pk_billid, + tradeType: billInfoMap.pk_tradetype, + pk_org: billInfoMap.pk_org, + pk_group: this.state.currentRowData.pk_group.value + }, + success: (data) => { + resolve(data); + } + }) + }) + } + + // TOP 打开未处理单据时打开影像 ADD + if (this.isImagInstalled && this.queryKey.taskstatus == 'pending') { + if (this.alreadySettingOts) { //外系统打开方式 + imagAndVoucherOpsPromise.then((data) => { + if (data.imagShowType == 1) { + openPage(data.imagShowUrl, data.imagShowName); + } else if (data.imagShowType == 2) { + imageView(billInfoMap, 'iweb'); + } + }) + } else { + imageView(billInfoMap, 'iweb'); + } + + } + // BTM 打开单据直接打开影像 + + //是否显示联查凭证按钮 + let showLinkVoucherBtn = false; + if (this.alreadySettingOts) { + imagAndVoucherOpsPromise.then((data) => { + if (data.voucherShowType == 1) { + //显示联查凭证按钮 + showLinkVoucherBtn = true; + } + this.setState({ + showLinkVoucherBtn + }) + }) + } else { + this.setState({ + showLinkVoucherBtn + }) + } + +} + +function openPage(url, name) { + let w = (window.screen || {}).width || 1440; + let h = (window.screen || {}).height || 900; + let l = (window.screen || {}).width || 1440; + let t = (window.screen || {}).height || 900; + if (window.opener == null) { + window.imageBrowserWin = window.open(url, name, "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ",toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no"); + } else { + window.imageBrowserWin = window.opener.open(url, name, "width=" + w + ",height=" + h + ",left=" + l + ",top=" + t + ",toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no"); + } +} + +export { imagAndVoucherHandle } +/*zhyjEPGIRKA975SGI1uWC5ht7qFtvsInzPCZLpeEjy4=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/rejectDialog.js b/src/ssctpaaa/sscuser/sscuser/list/components/rejectDialog.js new file mode 100644 index 0000000..6a879f8 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/rejectDialog.js @@ -0,0 +1,307 @@ +/*rqIYqQ1CPTAbQUBuqyz4iAGkfps9dmfqfRyrNDqqih4=*/ +import React, { Component } from 'react'; +import { base, ajax, toast, viewModel } from 'nc-lightapp-front'; +const { NCModal, NCButton, NCRadio, NCTextArea, NCSelect } = base; +const { getGlobalStorage } = viewModel +const NCOption = NCSelect.NCOption; +import classnames from 'classnames'; +import { reloadBillPage } from '../events' + +class RejectDialog extends Component { + constructor(props) { + super(); + this.state = { + actid: '', + repeat: '1', + ruleSearchValue: '' + } + this.ruleSearchThresholdTime = null; + } + + save = () => { + let multiLang = this.props.MutiInit.getIntl(7010); + if (!this.state.actid && !this.props.defOption) { + toast({ + color: 'warning', + title: multiLang && multiLang.get('701001RWCL-0135'),//701001RWCL-0135:请注意 + content: multiLang && multiLang.get('701001RWCL-0142')//701001RWCL-0142:请选择驳回流程 + }) + return + } + if (!this.props.reason) { + toast({ + color: 'warning', + title: multiLang && multiLang.get('701001RWCL-0135'),//701001RWCL-0135:请注意 + content: multiLang && multiLang.get('701001RWCL-0143')//701001RWCL-0143:请输入驳回原因 + }) + return + } + let credits = [] + this.props.creditsArray.forEach(each => { + credits.push(each.refpk) + }) + if (this.props.creditView && credits.length == 0) { + toast({ + color: 'warning', + title: multiLang && multiLang.get('701001RWCL-0135'),//701001RWCL-0135:请注意 + content: multiLang && multiLang.get('701001RWCL-0136')//701001RWCL-0136:请选择至少一个信用指标 + }) + return + } + + let actid = this.state.actid || this.props.defOption; + let oneOpt = this.props.ncoptions.find((oneOpt) => { + return oneOpt.value == actid + }) + let actname = oneOpt && oneOpt.name; + + ajax({ + url: '/nccloud/' + this.props.data.module.value + '/ssctp/sscbd/SSCTaskHandleRejectAction.do', + data: { + busiid: this.props.data.busiid.value, + billtypecode: this.props.data.billtypecode.value, + transtypecode: this.props.data.transtypecode.value, + pk_currenttask: this.props.data.pk_currenttask.value, + pk_group: this.props.data.pk_group.value, + pk_task: this.props.data.pk_task.value, + actiontype: 'sscreject', + actid: actid, + actname, + memo: this.props.reason, + mod: this.props.data.module.value, + repeat: this.state.repeat, + credits, + ts: this.props.data.ts.value, + ...this.props.parentThis.auditPointBarInst.getAuditData(true) + }, + success: () => { + // this.props.that.queryKey.taskstatus = 'sscreject';; + //不能用上面注释的方式改状态来控制侧边栏的编辑状态,否则会导致翻页状态不对。见bug NCCLOUD-182090 + let currentRowData = this.props.that.state.currentRowData; + currentRowData.taskstatus.value = 'reject'; + this.props.that.setState({ currentRowData, showdialogmodel: false, creditsArray: [], didAction: true, currentKey: 'sscreject' }); + this.setState({ + actid: '', + atcname: '' + }); + + this.props.setDidAction() + let module = currentRowData.module.value || ""; + let _ncc_websocket_switch_ = getGlobalStorage("localStorage", "_ncc_websocket_switch_") || "0";//默认为合盘环境 + if (_ncc_websocket_switch_ == "0" || module == "webdbl") {//非微服务环境或者工单 + reloadBillPage.call(this.props.that); + } + + toast({ + color: 'success', + title: multiLang && multiLang.get('701001RWCL-0144'),//701001RWCL-0144:驳回成功 + // content: multiLang && multiLang.get('701001RWCL-0144') + }) + return; + } + }); + } + + cancel = () => { + this.setState({ + actid: '' + }); + this.props.that.setState({ showdialogmodel: false, creditsArray: [] }) + } + + handleChange = (value) => { + this.setState({ + actid: value + }) + } + + handleRadio = (value) => { + this.setState({ + repeat: value + }) + } + + ruleItemSelect = (item, selectedRuleItems) => { + if (selectedRuleItems[item.refpk]) { + delete selectedRuleItems[item.refpk] + } else { + selectedRuleItems[item.refpk] = item; + } + + this.props.setCheckedCredits(Object.values(selectedRuleItems)); + } + + ruleSearchChange(e) { + let value = e.target.value; + let trimValue = value.trim(); + this.setState({ + ruleSearchValue: value + }); + clearTimeout(this.ruleSearchThresholdTime); + this.ruleSearchThresholdTime = setTimeout(() => { + + let creditRuleItems = this.props.creditRuleItems; + Object.values(creditRuleItems).forEach((rootItem) => { + rootItem.children.forEach((item) => { + if (!trimValue || item.refname.indexOf(trimValue) != -1) { + item.notSearch = false; + } else { + item.notSearch = true; + } + }) + }) + + this.props.setCreditRuleItems(creditRuleItems); + }, 200) + + + } + + componentwillreceiveprops(nextProps) { + /* if (this.props.reason != nextProps.reason) { + this.setState({ + memo: nextProps.reason + }) + } */ + } + + render() { + let { + ncoptions, + creditsArray, + setCheckedCredits, + creditView + } = this.props + let getNCOptions = () => { + let refHtml = []; + if (ncoptions != null && ncoptions != "" && ncoptions != '') { + ncoptions.map((one) => { + refHtml.push({one.name}) + }) + } + return refHtml + } + + let selectedRuleItems = {} + creditsArray && creditsArray.forEach((item) => { + selectedRuleItems[item.refpk] = item; + }) + let multiLang = this.props.MutiInit.getIntl(7010); + + return ( + { this.cancel() }}> + + {/*701001RWCL-0005:驳回*/} + {multiLang && multiLang.get('701001RWCL-0005')} + + +
    +
    + {/*701001RWCL-0145:驳回至*/} + {multiLang && multiLang.get('701001RWCL-0145')} + + + {getNCOptions()} + + + {/*
    + {CreditRuleTreeRef({ + onChange: setCheckedCredits, + clickContainer: 信用评价, + isMultiSelectedEnabled: true + })} +
    */} +
    +
    +
    + { + creditsArray.map((each, idx) => ( + + {each.refname} + { + this.props.deleteCreditByIdx(idx) + }} + > - + + )) + } +
    + {/*701001RWCL-0143:请输入驳回原因*/} + { this.props.reasonOnChange(val) }} + /> +
    +
    +
    +
    + + {/*701001RWCL-0140:信用评价*/} + {multiLang && multiLang.get('701001RWCL-0140')} + + +
    +
    + {Object.values(this.props.creditRuleItems).map((rootItem) => { + return [ +
    {rootItem.item.refname}
    , +
      + {rootItem.children.map((item) => { + return ( +
    • + {item.refname} +
    • + ) + })} +
    + ] + })} + +
    + +
    +
    + + {this.props.showRadio ? ( + + {/*701001RWCL-0146:重走流程,701001RWCL-0147:不重走流程*/} + {multiLang && multiLang.get('701001RWCL-0146')} + {multiLang && multiLang.get('701001RWCL-0147')} + + ) : ("")} + + + {multiLang && multiLang.get('701001RWCL-0005')} + {multiLang && multiLang.get('7010-0004')} + +
    + ) + } +} + +export default RejectDialog; +/*rqIYqQ1CPTAbQUBuqyz4iAGkfps9dmfqfRyrNDqqih4=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/unAdjustDialog.js b/src/ssctpaaa/sscuser/sscuser/list/components/unAdjustDialog.js new file mode 100644 index 0000000..4401a6f --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/unAdjustDialog.js @@ -0,0 +1,67 @@ +/*W1kgRP7NHxpUeUhDJs3ZyDkqoyjawADYH/03GpAM+28=*/ +import React, {Component} from 'react' +import {base} from 'nc-lightapp-front' +const {NCModal,NCButton,NCTextArea} = base +import requestApi from '../requestApi' + +class UnAdjustDialog extends Component { + constructor(props) { + super(props) + this.state={ + memo:'' + } + } + // 保存并关闭 + save = () => { + requestApi.taskUnAdjustAction({ + data: { + pk_task: this.props.data.pk_currenttask.value, + actiontype: "un-adjust", + memo:this.state.memo, + ts: this.props.data.ts.value + }, + success: (data) => { + this.setState({memo: ''}) + this.props.successUnAdjust(data) + } + }) + } + + cancel = () => { + this.props.handleCloseModal() + this.setState({memo:''}) + } + + render() { + let multiLang = this.props.MutiInit.getIntl(7010); + return ( + {this.cancel()}}> + + {/*701001RWCL-0017:取消调整*/} + {multiLang && multiLang.get('701001RWCL-0017')} + + +
    +
    + {/*701001RWCL-0148:请输入取消调整原因*/} + {this.state.memo=val}} + /> +
    +
    +
    + + {multiLang && multiLang.get('701001RWCL-0017')} + {multiLang && multiLang.get('7010-0004')} + +
    + ) + } +} + +export default UnAdjustDialog +/*W1kgRP7NHxpUeUhDJs3ZyDkqoyjawADYH/03GpAM+28=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/components/unHandonDialog.js b/src/ssctpaaa/sscuser/sscuser/list/components/unHandonDialog.js new file mode 100644 index 0000000..c207e80 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/components/unHandonDialog.js @@ -0,0 +1,67 @@ +/*KJz9VYhIa2zfu7+ozKyhdBrzjFoSuFCZVWqKcof3Hak=*/ +import React, {Component} from 'react' +import {base} from 'nc-lightapp-front' +const {NCModal,NCButton,NCTextArea} = base +import requestApi from '../requestApi' + +class UnHandonDialog extends Component { + constructor(props) { + super(props) + this.state={ + memo:'' + } + } + // 保存并关闭 + save = () => { + requestApi.taskUnHandOnAction({ + data: { + pk_task: this.props.data.pk_currenttask.value, + actiontype: "un-handon", + memo:this.state.memo, + ts: this.props.data.ts.value + }, + success: (data) => { + this.setState({memo: ''}) + this.props.successUnHangUp(data) + } + }) + } + + cancel = () => { + this.props.handleCloseModal() + this.setState({memo:''}) + } + + render() { + let multiLang = this.props.MutiInit.getIntl(7010); + return ( + {this.cancel()}}> + + {/*701001RWCL-0018:取消挂起*/} + {multiLang && multiLang.get('701001RWCL-0018')} + + +
    +
    + {/*701001RWCL-0149:请输入取消挂起原因*/} + {this.state.memo=val}} + /> +
    +
    +
    + + {multiLang && multiLang.get('701001RWCL-0018')} + {multiLang && multiLang.get('7010-0004')} + +
    + ) + } +} + +export default UnHandonDialog +/*KJz9VYhIa2zfu7+ozKyhdBrzjFoSuFCZVWqKcof3Hak=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/config.json b/src/ssctpaaa/sscuser/sscuser/list/config.json new file mode 100644 index 0000000..7e605d0 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/config.json @@ -0,0 +1,4 @@ +{ + "dependjs": ["../../../../sscrp/rppub/components/image/index.js"], + "dependModuleName": ["sscrp/rppub/components/image"] +} \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/Showtipss.js b/src/ssctpaaa/sscuser/sscuser/list/events/Showtipss.js new file mode 100644 index 0000000..c28ffae --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/Showtipss.js @@ -0,0 +1,92 @@ +/*As6sWqh0yZSSVRl+0f6j6F51J7uUUpQjKEIAG4EeJmU=*/ +import React, { + Component +} from 'react'; + +import urgent1 from '../../../../public/image/billnoOpr/urgent1.png' +import ismereject1 from '../../../../public/image/billnoOpr/ismereject1.png' +import isleaderreject1 from '../../../../public/image/billnoOpr/isleaderreject1.png' +import isappointed1 from '../../../../public/image/billnoOpr/isappointed1.png' +import isunapprove1 from '../../../../public/image/billnoOpr/isunapprove1.png' +import outerhandon from '../../../../public/image/billnoOpr/outerhandon.png' + +let setScreen = null, wrapper = null + +class Showtipss extends Component { + + constructor() { + super() + this.state = {} + setScreen = this.setScreen + } + + componentDidMount() { + wrapper = document.getElementsByClassName('tips-fixed--wrapper')[0] + } + + showTipsHandler(showtips, ev) { + ev = ev || window.event + setScreen(ev.clientX, ev.clientY, showtips) + } + + setScreen = (x, y, showtips) => { + wrapper.style.transform = 'scale(1)' + wrapper.style.left = x + 5 + 'px' + wrapper.style.top = y + 5 + 'px' + this.props.setTipsWrapper(showtips) + } + + hideTipsHandler = () => { + wrapper.style.transform = 'scale(0)' + } + + render() { + const {billnoa, record, json} = this.props.info + + const ret = [], showtips = [] + + if(record.urgent && record.urgent.value == true){ + ret.push( )//紧急 + showtips.push(
    {json['701001RWCL-0056']}
    )//紧急 + } + if(record.ismereject && record.ismereject.value == true){ + ret.push( )//本人驳回 + showtips.push(
    {json['701001RWCL-0057']}
    )//本人驳回 + } + if(record.isleaderreject && record.isleaderreject.value == true){ + ret.push( )//上级驳回 + showtips.push(
    {json['701001RWCL-0058']}
    )//上级驳回 + } + if(record.isappointed && record.isappointed.value == true){ + ret.push( )//强制分配 + showtips.push(
    {json['701001RWCL-0055']}
    )//强制分配 + } + if(record.isunapprove && record.isunapprove.value == true){ + ret.push( )//取消审批 + showtips.push(
    {json['701001RWCL-0169']}
    )//取消审批 + } // + if (record.taskstatus && record.taskstatus.value == 'outerhandon') { + ret.push( )//外部挂起 + showtips.push(
    {json['701001RWCL-0184']}
    )//外部挂起 + } + + if (record.iscmpreject && record.iscmpreject.value == true) { + ret.push( {json['701001RWCL-0203'] || '出纳驳回'})// 出纳驳回 + showtips.push(
    {json['701001RWCL-0203'] || '出纳驳回'}
    )//出纳驳回 + + } + + return ( +
    this.showTipsHandler(showtips)} + onMouseLeave = {this.hideTipsHandler} + > + { billnoa } + { [...ret] } +
    + ) + } +} + +export default Showtipss +/*As6sWqh0yZSSVRl+0f6j6F51J7uUUpQjKEIAG4EeJmU=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/buttonClick.js b/src/ssctpaaa/sscuser/sscuser/list/events/buttonClick.js new file mode 100644 index 0000000..8449277 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/buttonClick.js @@ -0,0 +1,161 @@ +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ +import requestApi from '../requestApi' +import { initTemplate } from './index' +import { pageTo } from 'nc-lightapp-front' +import urlHandle from 'ssccommon/utils/urlHandle'; +import { setPointTreeData } from 'ssccommon/components/auditPointBar/handle'; +import { imagAndVoucherHandle } from '../components/imagAndVoucherHandle'; + + + +export default function buttonClick(key, index) { + switch (key) { + case 'TaskExtract': // 任务提取 + requestApi.taskTakeAction({ + success: (data) => { + if (data.success) { + initTemplate.call(this, this.props) + } + } + }) + break + case 'approve': + let currentRowData = this.data.listRows[index].values; + + this.setState({ + //showModal: true, + didAction: false, + sagaStatus: currentRowData.saga_status.value, + didApprove: currentRowData.taskstatus.value === 'sscapprove', + alarm: false, + hitMessage: '' + }, () => { + // 信用 + let timer = null + const wrap = document.getElementsByClassName('uf-jewel')[0] + const float = document.getElementsByClassName('uf-jewel-float')[0] + wrap.onmouseenter = () => { + if (timer) clearTimeout(timer) + float.style.display = 'block' + } + wrap.onmouseleave = () => { + if (timer) clearTimeout(timer) + timer = setTimeout(() => { + float.style.display = 'none' + }, 800) + } + float.onmouseenter = () => { + if (timer) clearTimeout(timer) + float.style.display = 'block' + } + float.onmouseleave = () => { + if (timer) clearTimeout(timer) + timer = setTimeout(() => { + float.style.display = 'none' + }, 800) + } + }) + this.state.currentRowData = currentRowData; + this.setState({ activeIndex: index + 1 }) + const _this = this + requestApi.openBill({ + data: { + billtypeCode: _this.state.currentRowData.billtypecode.value, + transtypeCode: _this.state.currentRowData.transtypecode.value, + billid: _this.state.currentRowData.busiid.value, + pk_group: _this.state.currentRowData.pk_group.value + }, + success: (data) => { + let approveUrl = urlHandle(data, 'scene=zycl' + `&deal=${this.queryKey.taskstatus}`, null, 'approve-detail'); + let params = data.data.data; + + let pk_task = this.state.currentRowData.pk_task.value; + let billid = this.state.currentRowData.busiid.value; + + //出纳驳回原因 + let cashierRejectReason = this.state.currentRowData.cmprejectinfo ? this.state.currentRowData.cmprejectinfo.value : ''; + + //设置审核侧边栏数据 + setPointTreeData.call(this.auditPointBarInst, { pk_task, billid }) + + _this.setState({ + showModal: true, + approveUrl, + reason: cashierRejectReason + }, () => { + pageTo.addUrlParam({ + c: params.appcode, + p: params.pagecode, + n: params.appname, + custom: JSON.stringify({ + pk_group: _this.state.currentRowData.pk_group.value + }) + }) + }) + + //打开影像和展示联查凭证按钮处理逻辑 + imagAndVoucherHandle.call(_this); + + //手动驳回原因 出纳驳回与手动驳回用同一个变量, 两个原因不会同时存在 + requestApi.manualReasonQry({ + pk: this.data.listRows[index].values.pk_currenttask.value, + success: (response) => { + response.data && _this.setState({ reason: response.data}) + } + }) + + } + }) + // 信用是否设置 + let isCreditInstall + requestApi.queryCredits({ + queryMethod: 'isCreditInstall', + success: (data) => { + isCreditInstall = data.data.isCreditInstall + this.setState({ isCreditInstall }) + if (isCreditInstall) { + // 信用等级 + requestApi.queryCredits({ + queryMethod: 'queryCreditLevel', + success: (data) => { + let levels = data.data + if (levels.length > 5) levels.length = 5 + _this.setState({ levels }, () => { + // 查询信用信息详情 + requestApi.queryCredits({ + queryMethod: 'queryCreditInfo', + billMakerId: _this.state.currentRowData.billmaker.value, + success: (data) => { + _this.setState({ creditLevelInfo: data.data }) + } + }) + }) + } + }) + } + } + }) + + //是否有预警消息 + requestApi.queryBudgetMessage({ + data: { + busiid: _this.state.currentRowData.busiid.value, + billtype: _this.state.currentRowData.transtypecode.value, + pk_group: _this.state.currentRowData.pk_group.value + }, + success: (data) => { + if (data.data && data.data['alarm']) { + this.setState({ + alarm: data.data['alarm'], + hitMessage: data.data['message'] + }) + } + } + }) + + break + default: + break + } +} +/*q2LCmxM8POvl78IL0LiydtfSRmpYU3scGkCvS8PYeCQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/cardButtonClick.js b/src/ssctpaaa/sscuser/sscuser/list/events/cardButtonClick.js new file mode 100644 index 0000000..cba0b98 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/cardButtonClick.js @@ -0,0 +1,214 @@ +/*qH4y8n9P8knQu7KPTubTGpTxDQVIUVgaWdisB4B6Xls=*/ +import requestApi from '../requestApi' +import { pageTo } from 'nc-lightapp-front' +import urlHandle from 'ssccommon/utils/urlHandle'; +import { initTemplate } from './index' +import { setPointTreeData } from 'ssccommon/components/auditPointBar/handle'; +import { imagAndVoucherHandle } from '../components/imagAndVoucherHandle'; + + + + +/**卡片态按钮处理逻辑, 这里后期应与列表态处理逻辑合并 */ +export default function cardButtonClick(btnKey, record, index, acrecordtionFrom) { + let text = this.data.listRows[index].values + switch (btnKey) { + case "AdjustApply": // 申请调整 + this.setState({ showadjustmodel: true, adjustmodeldata: text }) + break + case "OpenBill": // 卡片模式 单据编号点击 + this.setState({ + showModal: true, + didAction: false, + didApprove: this.queryKey.taskstatus === 'handled' ? true : false, + alarm: false, + hitMessage: '' + }, () => { + // 信用 + let timer = null + const wrap = document.getElementsByClassName('uf-jewel')[0] + const float = document.getElementsByClassName('uf-jewel-float')[0] + wrap.onmouseenter = () => { + if (timer) clearTimeout(timer) + float.style.display = 'block' + } + wrap.onmouseleave = () => { + if (timer) clearTimeout(timer) + timer = setTimeout(() => { + float.style.display = 'none' + }, 800) + } + float.onmouseenter = () => { + if (timer) clearTimeout(timer) + float.style.display = 'block' + } + float.onmouseleave = () => { + if (timer) clearTimeout(timer) + timer = setTimeout(() => { + float.style.display = 'none' + }, 800) + } + }) + this.state.currentRowData = this.data.listRows[index].values + const _this = this + requestApi.openBill({ + data: { + billtypeCode: _this.state.currentRowData.billtypecode.value, + transtypeCode: _this.state.currentRowData.transtypecode.value, + billid: _this.state.currentRowData.busiid.value, + pk_group: _this.state.currentRowData.pk_group.value + }, + success: (data) => { + let approveUrl = urlHandle(data, 'scene=zycl' + `&deal=${this.queryKey.taskstatus}`, null, 'approve-detail'); + let params = data.data.data; + + let pk_task = this.state.currentRowData.pk_task.value; + let billid = this.state.currentRowData.busiid.value; + + //出纳驳回原因 + let cashierRejectReason = this.state.currentRowData.cmprejectinfo ? this.state.currentRowData.cmprejectinfo.value : ''; + + //设置审核侧边栏数据 + setPointTreeData.call(this.auditPointBarInst, { pk_task, billid }) + + _this.setState({ + showModal: true, + approveUrl, + reason: cashierRejectReason + }, () => { + pageTo.addUrlParam({ + c: params.appcode, + p: params.pagecode, + n: params.appname, + custom: JSON.stringify({ + pk_group: _this.state.currentRowData.pk_group.value + }) + }) + }) + + //打开影像和展示联查凭证按钮处理逻辑 + imagAndVoucherHandle.call(_this); + + //手动驳回原因 出纳驳回与手动驳回用同一个变量 + requestApi.manualReasonQry({ + pk: this.data.listRows[index].values.pk_currenttask.value, + success: response => _this.setState({ reason: response.data || '' }) + }) + + } + }) + // 信用是否设置 + let isCreditInstall + requestApi.queryCredits({ + queryMethod: 'isCreditInstall', + success: (data) => { + isCreditInstall = data.data.isCreditInstall + this.setState({ isCreditInstall }) + if (isCreditInstall) { + // 信用等级 + requestApi.queryCredits({ + queryMethod: 'queryCreditLevel', + success: (data) => { + let levels = data.data + if (levels.length > 5) levels.length = 5 + _this.setState({ levels }, () => { + // 查询信用信息详情 + requestApi.queryCredits({ + queryMethod: 'queryCreditInfo', + billMakerId: _this.state.currentRowData.billmaker.value, + success: (data) => { + _this.setState({ creditLevelInfo: data.data }) + } + }) + }) + } + }) + } + } + }) + + //是否有预警消息 + requestApi.queryBudgetMessage({ + data: { + busiid: _this.state.currentRowData.busiid.value, + billtype: _this.state.currentRowData.transtypecode.value, + pk_group: _this.state.currentRowData.pk_group.value + }, + success: (data) => { + if (data.data && data.data['alarm']) { + this.setState({ + alarm: data.data['alarm'], + hitMessage: data.data['message'] + }) + } + } + }) + break + case "HangUp": // 挂起 + this.setState({ showhandonmodel: true, handonmodeldata: text }) + break + case "CancelHangUp": // 取消挂起 + this.setState({ + showUnHandonModal: true, + unHandonModalData: text + }) + break + case "CancelAdjust": // 取消调整 + this.setState({ + showUnAdjustModal: true, + unAdjustModalData: text + }) + break + case 'QueryOperation': + requestApi.taskQueryOperationAction({ + data: { + busiid: text.busiid.value + }, + success: (data) => { + if (data.success && data.data.ssctaskhistory) { + let newRows = data.data.ssctaskhistory.rows.map((row, index) => { + let values = row.values; + let newRow = { values }; + for (let attrcode in values) { + if (attrcode != 'opt') { + newRow[attrcode] = values[attrcode].display || values[attrcode].value + newRow.key = values['pk_bill'].value + '_' + index; + } + } + return newRow; + }) + this.setState({ + sscTaskHistoryData: newRows, + showOperateNote: true + }) + } + } + }) + break + case "CancelHandled": // 取消审核 + requestApi.taskUnApproveAction({ + data: { + busiid: record.busiid.value, + billtypecode: record.billtypecode.value, + transtypecode: record.transtypecode.value, + pk_task: record.pk_task.value, + pk_group: record.pk_group.value, + actiontype: "un-sscapprove", + ts: record.ts.value, + mod: record.module.value + }, + success: (data) => { + if (data.success) { + initTemplate.call(this, this.props) + } + } + }) + break + default: + break + } +} + + + +/*qH4y8n9P8knQu7KPTubTGpTxDQVIUVgaWdisB4B6Xls=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/fixedTemplate.js b/src/ssctpaaa/sscuser/sscuser/list/events/fixedTemplate.js new file mode 100644 index 0000000..ba0f696 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/fixedTemplate.js @@ -0,0 +1,57 @@ +/*7hOekIf8hUsv8p/Si0HVBtJo9qHX0rmchb8gnkywXYE=*/ +const buttons = [ + /* { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "AdjustApply", + "title": "申请调整", + "area": "sscuserlist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "HangUp", + "title": "挂起", + "area": "sscuserlist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "CancelHangUp", + "title": "取消挂起", + "area": "sscuserlist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "CancelAdjust", + "title": "取消调整", + "area": "sscuserlist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "CancelHandled", + "title": "取消审核", + "area": "sscuserlist", + "children": [] + }, + { + "id": "0001A41000000006J5B1", + "type": "button_main", + "key": "QueryOperation", + "title": "操作记录", + "area": "sscuserlist", + "children": [] + }*/ +] + + +export default { + buttons +} +/*7hOekIf8hUsv8p/Si0HVBtJo9qHX0rmchb8gnkywXYE=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/getListBtn.js b/src/ssctpaaa/sscuser/sscuser/list/events/getListBtn.js new file mode 100644 index 0000000..8d879b6 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/getListBtn.js @@ -0,0 +1,106 @@ +/*qhVudgKW6ht1y9z2TuPcG5AIM+Or16J7zDlAFufMfx0=*/ +import { listButtonClick } from './index' + +/** + * + * @param {*} props + * @param {*} sagasButtonVisible 判断是否处理sagas事务重试按钮 + */ +export default function getListButtonRender(props, sagasButtonVisible) { + const that = this + let r_render + let multiLang = props.MutiInit.getIntl(7010); + switch (this.queryKey.taskstatus) { + case 'pending': + r_render = (text, record, index) => { + let btnArr = ['AdjustApply', 'HangUp', 'QueryOperation']; + if (record.taskstatus && record.taskstatus.value == 'sscapprove' && record.iscmpreject && record.iscmpreject.value === true) { //出纳驳回时 + btnArr = ['CancelHandled', 'QueryOperation'] + } + return props.button.createOprationButton( + btnArr, + { + area: "sscuserlist", + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ) + } + break + case 'handon': + r_render = (text, record, index) => props.button.createOprationButton( + ['CancelHangUp', 'QueryOperation'], + { + area: "sscuserlist", + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ) + break + case 'adjust': + r_render = (text, record, index) => props.button.createOprationButton( + ['CancelAdjust', 'QueryOperation'], + { + area: "sscuserlist", + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ) + break + case 'handled': + r_render = (text, record, index) => props.button.createOprationButton( + ['CancelHandled', 'QueryOperation'], + { + area: "sscuserlist", + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ) + break + case 'sscreject': + r_render = (text, record, index) => props.button.createOprationButton( + ['QueryOperation'], + { + area: "sscuserlist", + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ) + break + default: + r_render = (text, record, index) => props.button.createOprationButton( + ['QueryOperation'], + { + area: "sscuserlist", + onButtonClick: (props, btnKey) => { + listButtonClick(props, btnKey, text, record, index, that) + } + } + ) + break + } + return { + label: multiLang && multiLang.get('701001RWCL-0060'),//操作 + itemtype: 'customer', + attrcode: 'opr', + visible: true, + width: '205px', + fixed: 'right', + className: "opr", + render: (text, record, index) => { + return sagasButtonVisible ? props.button.createErrorButton({ + record: record, + sucessCallBack: () => { + //状态切换成功后,显示业务 + return r_render(text, record, index); + } + }) : r_render(text, record, index); + } + } +} +/*qhVudgKW6ht1y9z2TuPcG5AIM+Or16J7zDlAFufMfx0=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/index.js b/src/ssctpaaa/sscuser/sscuser/list/events/index.js new file mode 100644 index 0000000..879eb23 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/index.js @@ -0,0 +1,11 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import buttonClick from './buttonClick' +import initTemplate from './initTemplate' +import listButtonClick from './listButtonClick' +import cardButtonClick from './cardButtonClick' +import paginationClick from './paginationClick' +import onRowDoubleClick from './onRowDoubleClick' +import reloadBillPage from './reloadBillPage' +export { buttonClick, initTemplate, listButtonClick, cardButtonClick, paginationClick, onRowDoubleClick, reloadBillPage} + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/initTemPlate.js b/src/ssctpaaa/sscuser/sscuser/list/events/initTemPlate.js new file mode 100644 index 0000000..a826ff6 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/initTemPlate.js @@ -0,0 +1,268 @@ +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ +import getListButtonRender from './getListBtn'; +import { buttonClick } from './index'; +import { getMultiLang } from 'nc-lightapp-front'; +import Showtipss from './Showtipss'; +import { tableAndCardListScrollLoad } from 'ssccommon/utils/scrollLoad'; +import { tplHandle } from 'ssccommon/components/auditPointBar/handle'; +import requestApi from '../requestApi' + +import exceedImg from '../../../../public/image/exceed.png' +import preImg from '../../../../public/image/pre.png' +import timedRefresh from './timedRefresh' + +export default function (props) { + + const _this = this + + props.createUIDom( + { + }, + (data) => { + requestApi.checkGetBillStatus({ + success: (data) => { + _this.setState({ getBillStatus: data.data.state }); + } + }) + getMultiLang({ + moduleId: 7010, domainName: 'ssctp', currentLocale: 'zh-CN', callback: (json) => { + _this.searchAreaConfig = { + searchArea_pending: data.template.searchArea_pending.items, + searchArea_adjust: data.template.searchArea_adjust.items, + searchArea_handled: data.template.searchArea_handled.items, + searchArea_handon: data.template.searchArea_handon.items, + searchArea_sscreject: data.template.searchArea_reject.items + } + let buttonTpl = {} + buttonTpl = { + button: (data.button == null || data.button == undefined) ? [] : data.button + } + props.button.setButtons(buttonTpl.button) + + data.template[window.presetVar.listCode].pagination = false + + //拼装操作记录模板 使用NCTable组件 + let sscTaskHistoryTpl = [{ + title: json['701001RWCL-0201'], + dataIndex: 'index', + key: 'index', + width: '40px', + render(text, record, index) { + return index + 1 + } + }]; + data.template.ssctaskhistory.items.forEach((item) => { + if (item.visible) { + sscTaskHistoryTpl.push( + { + title:
    {item.label}
    , + dataIndex: item.attrcode, + key: item.attrcode, + width: item.width, + render: (text, record, index) => { + return
    {text ||  }
    + } + } + ); + } + }) + sscTaskHistoryTpl.push( + { + title:
    {json['7010-PROBLEM-04']}
    , + dataIndex: "opt", + key: "opt", + width: 100, + fixed: "right", + render: (text, record, index) => { + let optHistoryExpandRowKeys = this.state.optHistoryExpandRowKeys; + let key = record['pk_bill'] + '_' + index; + let hasKey = optHistoryExpandRowKeys[key]; + let isShowBtn = false; + switch (record.values['actiontype'].value) { + //case 'handon': + case 'sscapprove': + case 'sscreject': + isShowBtn = true; + } + return isShowBtn ? + ( +
    { + if (hasKey) { + delete optHistoryExpandRowKeys[key] + } else { + optHistoryExpandRowKeys[key] = true; + + } + this.setState({ + optHistoryExpandRowKeys + }); + } + } style={{ color: '#0073e1', cursor: 'pointer' }} + > + {hasKey ? json['7010-PROBLEM-02'] : json['7010-PROBLEM-03']} +
    + ) + : + null + } + } + ) + this.setState({ + sscTaskHistoryTpl + }) + + + tplHandle.call(this.auditPointBarInst, data.template) + + + // 列表操作列 + const listButtonRender = getListButtonRender.call(_this, props, true); + + const oprBtnsRender = listButtonRender.render + data.template[window.presetVar.list].items.push( + listButtonRender + ) + // 单据编码列 + data.template[window.presetVar.list].items.unshift({ + label: json['7010-0008'], + attrcode: 'billnoa', + visible: true, + width: '235px', + render: (text, record, index) => { + let billnoa = ( + + {record.billno.value} + + ) + + props.table.saveFilterCustomColData(window.presetVar.list, { + attrcode: 'billnoa', + rowId: props.table.getAllTableData(window.presetVar.list).rows[index].rowId, + value: record.billno.value + }) + + if (_this.queryKey.taskstatus === 'handled') return billnoa + + return ( + _this.setState({ tipsInfo: [...showtips] })} + /> + ) + } + }) + + // 定向提取 + if (!_this.state.oid) { + _this.setState({ + oid: data.template.search_Area.oid, + queryAreaCode: data.template.search_Area.code + }) + } + let searchAreaItems = data.template.search_Area.items + let idx = -1 + while (++idx < searchAreaItems.length) { + if (!searchAreaItems[idx].required) searchAreaItems[idx].visible = false + } + data.template['search_Area'] = { + moduletype: 'search', + items: searchAreaItems + } + + data.template[window.presetVar.list].items.map((item) => { + if (item.attrcode === 'billno' + || item.attrcode === 'pk_tradetype' + || item.attrcode === 'pk_currtype' + || item.attrcode === 'remark' + || item.attrcode === 'amount' + || item.attrcode === 'billdate' + || item.attrcode === 'billmaker') { + + item.isSort = true; + } else { + + item.isSort = false; + } + + if (item.attrcode === 'billno') item.visible = false + }) + + setTimeout(() => { + const prevMeta = props.meta.getMeta() + if (!prevMeta.code) { + props.meta.setMeta(data.template, () => { + //setPointTreeData.call(this.auditPointBarInst, tempData); + + tableAndCardListScrollLoad(() => { + if ( + Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number) + && this.canChangPageFlag + ) { + this.canChangPageFlag = false; + setTimeout(() => { this.queryData(true) }, 300); + } + }); + }) + } + // 操作列自定义 + props.table.setTableRender(window.presetVar.list, "opr", oprBtnsRender) + + //超时预警 + const listKeys = data.template[window.presetVar.list].items.map(item => item.attrcode) + if (listKeys.indexOf('exceedstatus') > -1) { + props.table.setTableRender(window.presetVar.list, "exceedstatus", (text, record, index) => { + const { exceedstatus } = record + let txt = '', src = '' + if (exceedstatus) { // exceed:超期 + if (exceedstatus.value === 'exceed') { + txt = `${JSON.parse(exceedstatus.display).hour}${json['7010-0009']}${JSON.parse(exceedstatus.display).minute}${json['7010-0010']}` + src = exceedImg + } else if (exceedstatus.value === 'pre') { // pre:即将超期 + txt = `${JSON.parse(exceedstatus.display).hour}${json['7010-0009']}${JSON.parse(exceedstatus.display).minute}${json['7010-0010']}` + src = preImg + } + } + + props.table.saveFilterCustomColData(window.presetVar.list, { + attrcode: 'exceedstatus', + rowId: props.table.getAllTableData(window.presetVar.list).rows[index].rowId, + value: txt + }) + + return src && txt + ? ([ + , + {txt} + ]) + : null + }) + } + + // 查询列表数据 + _this.queryData(); + if (!_this.queryInterval) { + // 两分钟一次定时执行 + _this.queryInterval = window.setInterval(() => { + timedRefresh.call(this); + }, 10000); + } + }, 200) + } + }) + } + ) + requestApi.checkImageInstalled({ + success: (data) => { + this.isImagInstalled = data.isImagInstalled; + this.alreadySettingOts = data.alreadySettingOts; + } + }) +} + +/*2kFYPys7dcTdBIA5Qvd/fKqvxXOTejMQigvPOvRReys=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/listButtonClick.js b/src/ssctpaaa/sscuser/sscuser/list/events/listButtonClick.js new file mode 100644 index 0000000..d1d2713 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/listButtonClick.js @@ -0,0 +1,78 @@ +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ +import requestApi from '../requestApi' +import {initTemplate} from './index' + +export default function listButtonClick(props, btnKey, text, record, index, that) { + switch(btnKey){ + case "AdjustApply": // 申请调整 + that.setState({showadjustmodel: true, adjustmodeldata: record}) + break + case "HangUp": // 挂起 + that.setState({showhandonmodel: true, handonmodeldata: record}) + break + case "CancelHangUp": // 取消挂起 + that.setState({ + showUnHandonModal: true, + unHandonModalData: record + }) + break + case "CancelAdjust": // 取消调整 + that.setState({ + showUnAdjustModal: true, + unAdjustModalData: record + }) + break + case "CancelHandled": // 取消审核 + requestApi.taskUnApproveAction({ + data: { + busiid: record.busiid.value, + billtypecode: record.billtypecode.value, + transtypecode: record.transtypecode.value, + pk_task: record.pk_task.value, + pk_group:record.pk_group.value, + actiontype: "un-sscapprove", + ts: record.ts.value, + mod: record.module.value + }, + success: (data) => { + if (data.success) { + initTemplate.call(that, props) + } + } + }) + break + case 'QueryOperation': + that.setState({showOperateNote: true}) + requestApi.taskQueryOperationAction({ + data: { + busiid: record.busiid.value + }, + success: (data) => { + if(data.success && data.data.ssctaskhistory) { + let newRows = data.data.ssctaskhistory.rows.map((row, index) => { + let values = row.values; + let newRow = {values}; + for (let attrcode in values) { + if (attrcode != 'opt') { + newRow[attrcode] = values[attrcode].display || values[attrcode].value + newRow.key = values['pk_bill'].value + '_' + index; + } + } + return newRow + }) + that.setState({ + sscTaskHistoryData: newRows, + showOperateNote: true + }) + } + } + }) + break + default: + break + } +} + + + +/*Yad/lD1IE5qm15+d1Lx2QhILg9kVPpuvH2qXGe3BBe8=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/onRowDoubleClick.js b/src/ssctpaaa/sscuser/sscuser/list/events/onRowDoubleClick.js new file mode 100644 index 0000000..c6745e8 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/onRowDoubleClick.js @@ -0,0 +1,6 @@ +/*xbBNZdDFBeHR0NxHIc8oEFCYUdZU5pfbtwgHQlLbfrY=*/ +import buttonClick from './buttonClick' +export default function (record,index,props) { + buttonClick.call(this,'approve', index) +}; +/*xbBNZdDFBeHR0NxHIc8oEFCYUdZU5pfbtwgHQlLbfrY=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/paginationClick.js b/src/ssctpaaa/sscuser/sscuser/list/events/paginationClick.js new file mode 100644 index 0000000..e3158c4 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/paginationClick.js @@ -0,0 +1,164 @@ +/*3jl14Tzepje6wznKjVSKoE3yDgadOV5bdAGwu8Dl5Uc=*/ +import requestApi from '../requestApi' +import { pageTo, toast } from 'nc-lightapp-front'; +import urlHandle from 'ssccommon/utils/urlHandle'; +import { setPointTreeData } from 'ssccommon/components/auditPointBar/handle'; +import { imagAndVoucherHandle } from '../components/imagAndVoucherHandle'; + + + +export default function paginationClick(position, that) { + + that.setState({ activeIndex: position }); + // 选择的数据pk + let selectPK = ''; + // 根据不同页签取得PK + if (that.queryKey.taskstatus == 'pending') { + // 待处理页签,从pendingPklist中取得pk + selectPK = that.pendingPklist[position - 1]; + }else{ + // 其他页签,从列表缓存中取得pk + selectPK = that.data.listRows[position - 1].values.pk_task.value; + } + + getCurrentRowData.call(that, selectPK, currentRowData => { + that.state.currentRowData = currentRowData; + requestApi.openBill({ + data: { + billtypeCode: that.state.currentRowData.billtypecode.value, + transtypeCode: that.state.currentRowData.transtypecode.value, + billid: that.state.currentRowData.busiid.value, + pk_group: that.state.currentRowData.pk_group.value + }, + success: (data) => { + let approveUrl = urlHandle(data, 'scene=zycl' + `&deal=${that.queryKey.taskstatus}`, null, 'approve-detail'); + let params = data.data.data; + + //出纳驳回原因 + let cashierRejectReason = that.state.currentRowData.cmprejectinfo ? that.state.currentRowData.cmprejectinfo.value : ''; + + that.setState({ + approveUrl, + reason: cashierRejectReason, + // didApprove: that.state.currentRowData.isApproved, + didApprove: that.state.currentRowData.taskstatus.value === 'sscapprove', + didAction: that.state.currentRowData.didAction, + sagaStatus: that.state.currentRowData.saga_status.value, + alarm: false, + hitMessage: '' + }, () => { + pageTo.addUrlParam({ + c: params.appcode, + p: params.pagecode, + n: params.appname, + custom: JSON.stringify({ + pk_group: that.state.currentRowData.pk_group.value + }) + }) + + let pk_task = that.state.currentRowData.pk_task.value; + let billid = that.state.currentRowData.busiid.value; + setPointTreeData.call(that.auditPointBarInst, { pk_task, billid }) + }) + + // 信用是否设置 + let isCreditInstall + requestApi.queryCredits({ + queryMethod: 'isCreditInstall', + success: (data) => { + isCreditInstall = data.data.isCreditInstall + that.setState({ isCreditInstall }) + if (isCreditInstall) { + // 信用等级 + requestApi.queryCredits({ + queryMethod: 'queryCreditLevel', + success: (data) => { + let levels = data.data + if (levels.length > 5) levels.length = 5 + that.setState({ levels }, () => { + // 查询信用信息详情 + requestApi.queryCredits({ + queryMethod: 'queryCreditInfo', + billMakerId: that.state.currentRowData.billmaker.value, + success: (data) => { + that.setState({ creditLevelInfo: data.data }) + } + }) + }) + } + }) + } + } + }) + + //是否有预警消息 + requestApi.queryBudgetMessage({ + data: { + busiid: that.state.currentRowData.busiid.value, + billtype: that.state.currentRowData.transtypecode.value, + pk_group: that.state.currentRowData.pk_group.value + }, + success: (data) => { + if (data.data && data.data['alarm']) { + that.setState({ + alarm: data.data['alarm'], + hitMessage: data.data['message'] + }) + } + } + }) + + //手动驳回原因 出纳驳回与手动驳回用同一个变量, 两个原因不会同时存在 + requestApi.manualReasonQry({ + pk: that.data.listRows[position - 1].values.pk_currenttask.value, + success: (response) => { + response.data && that.setState({ manualReason: response.data}) + } + }) + + //打开影像和展示联查凭证按钮处理逻辑 + imagAndVoucherHandle.call(that); + } + }) + }); +} + +/** + * 取得当前行数据 + * @param {*} pk + */ +function getCurrentRowData(pk, callbackFunction) { + // 查找列表中是否有当前行数据 + let currentRowData = this.data.listRows.find(element => { + if (element.values.pk_task.value == pk) { + return element; + } + }); + // 没有找到 + if (!currentRowData) { + // 后端查找数据 + requestApi.query({ + data: { + taskstatus: 'pending', + pk_task: pk, + pageinfo: { + number: 1, + size: 1 + } + }, + loading: false, + success: (data) => { + if (data && data.tasklist && data.tasklist.rows && data.tasklist.rows.length > 0 && data.tasklist.rows[0].values.pk_task.value) { + currentRowData = data.tasklist.rows[0]; + this.data.listRows.push(currentRowData); + callbackFunction.call(this, currentRowData.values); + } else { + toast({ color: 'danger', content: '数据已经变更,请刷新列表重试。' }); + } + } + }); + } else { + callbackFunction.call(this, currentRowData.values); + } +} +/*3jl14Tzepje6wznKjVSKoE3yDgadOV5bdAGwu8Dl5Uc=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/reloadBillPage.js b/src/ssctpaaa/sscuser/sscuser/list/events/reloadBillPage.js new file mode 100644 index 0000000..63f0d92 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/reloadBillPage.js @@ -0,0 +1,53 @@ +/*gxR5J8Nf55REdl6jjtmqQ2FoIFCVo5rsru24fGzhZ7c=*/ +import { pageTo } from 'nc-lightapp-front' + +import requestApi from '../requestApi' +import urlHandle from 'ssccommon/utils/urlHandle'; + +export default function reloadBillPage(deal) { + + // if(this.alreadySettingOts) { + // return; + // } + //非同域下不刷新 + let url = document.getElementById("approve-detail").getAttribute("src"); + if(url && url.indexOf("/nccloud/resources") === -1) { + return; + } + + //尝试直接调用iframe的刷新按钮来刷新单据数据 + let refrushBtn = document.getElementById("approve-detail").contentWindow.document.getElementsByClassName("icon-shuaxin1"); + if(refrushBtn && refrushBtn.length > 0) { + for(let i = 0; i < refrushBtn.length; i++) { + refrushBtn[i].click(); + } + return; + } + + + requestApi.openBill({ + data: { + billtypeCode: this.state.currentRowData.billtypecode.value, + transtypeCode: this.state.currentRowData.transtypecode.value, + billid: this.state.currentRowData.busiid.value, + pk_group: this.state.currentRowData.pk_group.value + }, + success: (data) => { + + let approveUrl = urlHandle(data, 'scene=zycl&deal=' + deal) + + let params = data.data.data; + this.setState({ approveUrl }, () => { + pageTo.addUrlParam({ + c: params.appcode, + p: params.pagecode, + n: params.appname + }) + //强制刷新iframe,只修改iframe的值并没有刷新iframe + document.getElementById("approve-detail").contentWindow.location.reload(true); + }) + } + }) + +} +/*gxR5J8Nf55REdl6jjtmqQ2FoIFCVo5rsru24fGzhZ7c=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/events/timedRefresh.js b/src/ssctpaaa/sscuser/sscuser/list/events/timedRefresh.js new file mode 100644 index 0000000..f3fffb7 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/events/timedRefresh.js @@ -0,0 +1,109 @@ +/*a2eEGcFaeWYjQJZnukZLlgnLTkIoxWKM3QoS4o6XAbo=*/ +import requestApi from '../requestApi'; +import { toast } from 'nc-lightapp-front'; + +export default function () { + checkNewData.call(this, () => { + if (this.queryKey.taskstatus == 'pending') { + // 待处理页签时====================================================(1)=============================================================== + // 判断页面形态 + if (this.state.showModal) { + // 卡片形态时---------------------(1-1)-------------------------- + // 只更新pklist,查询时间戳 + requestApi.query({ + data: { + ...this.queryKey, + pageinfo: { + number: 1, + size: 1 + } + }, + loading: false, + success: (data) => { + // 更新查询时间戳 + this.lastQueryTime = data.lastQueryTime; + // 更新pkList + data.taskPkList.forEach(element => { + if (this.pendingPklist.indexOf(element) < 0) { + this.pendingPklist.push(element); + } + }); + // 更新翻页器 + this.setState({ paginationItems: this.pendingPklist.length }); + } + }); + } else { + // 列表形态时---------------------(1-2)-------------------------- + // 重新查询并更新列表信息 + this.queryData(null, null, true); + } + } else { + // 非待处理页签时=========================================================(2)========================================================== + // 查询待处理数量以及时间戳 + requestApi.query({ + data: { + ...this.queryKey, + pageinfo: { + number: 1, + size: 1 + } + }, + loading: false, + success: (data) => { + // 更新查询时间戳 + this.lastQueryTime = data.lastQueryTime; + // 判断页面形态 + if (this.state.showModal) { + // 卡片形态时-----------------------(2-1)------------------------ + // 不做处理 + } else { + // 列表形态时-----------------------(2-2)------------------------ + // 仅更新待处理数量 + let newState = {} + newState = this.state; + // 更新待处理数字 + newState.showNumbers.pending = data.pending; + // // 更新已驳回数字(暂时只刷新待处理 数字、列表) + // newState.showNumbers.sscreject = data.sscreject; + this.setState(newState); + } + } + }); + } + }) +} +/** + * 判断是否有新分配的数据 + * @param {*} callbackFunction + */ +function checkNewData(callbackFunction) { + requestApi.checkNewData({ + data: { lastQueryTime: this.lastQueryTime }, + success: (data) => { + if (data.addNotice) { + // 存在新数据 + // 提示有新的单据分配 + showPrompt.call(this); + // 回调方法 + callbackFunction && callbackFunction.call(this); + } + } + }); +} +/** + * 提示有新的单据分配 + */ +function showPrompt() { + // 提示消息 + let multiLang = this.props.MutiInit.getIntl(7010); + multiLang && multiLang.get('701001RWCL-0207') && toast({ color: "success", content: multiLang.get('701001RWCL-0207') }); // 有新的单据分配。 + // 播放声音 + window.setTimeout(()=>{ + try { + this.audio.play(); + } catch (e) { + console.log('不支持提示音。'); + } + }, 100); +} +/*a2eEGcFaeWYjQJZnukZLlgnLTkIoxWKM3QoS4o6XAbo=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/index.js b/src/ssctpaaa/sscuser/sscuser/list/index.js new file mode 100644 index 0000000..37301a9 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/index.js @@ -0,0 +1,6 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, {Component} from 'react' +import ReactDOM from 'react-dom' +import SscUserList from './sscUserList' +ReactDOM.render(, document.querySelector('#app')) +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/index.less b/src/ssctpaaa/sscuser/sscuser/list/index.less new file mode 100644 index 0000000..f38ed4f --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/index.less @@ -0,0 +1,792 @@ +.single-line-and-ellipsis[field="opr1"]{overflow:initial!important} +#sscUserList{ + //background: #fff; + border-radius: 3px; + .container { + height: 100%; + display: flex; + flex-direction: column; + } + #WorkbenchDetail { + position: absolute; + width: 100%; + top: 0; + bottom: -10px; + overflow: auto; + } + .title { + float: left; + line-height: 60px; + font-size: 18px; + margin-right:20px; + } + .header { + line-height: 60px; + } + + .content { + clear: both; + background: #fff; + } + + .change-page{ + background-color: white; + text-align: center; + } + + .body-btn-area{ + cursor: pointer; + color: #007ACE; + } + .data-area-show{ + display: block; + position: relative; + flex: 1; + } + .data-area-hide{ + display: none; + } + .billnoa{ + cursor: pointer; + float: left; + margin-right: 5px; + } + .scroll-add-more { + text-align: center; + font-size: 13px; + color: #555; + line-height: 30px; + user-select: none; + background: #fff; + } + #SysComponentsWorkbenchTab{ + .u-tabs-nav-container{ + padding-left: 0!important; + } + } + .u-pagination-list{ + margin: 0!important; + } + .get-bill-checkbox{ + button { + min-width: 96px; + margin-top: -2px; + padding: 0; + height: 30px; + span.active { + width: 100%; + height: 30px; + position: relative; + display: inline-block; + i { + position: absolute; + left: 10px; + top: 6px; + } + span { + display: inline-block; + line-height: 28px; + // text-indent: 20px; + margin-left: 36px; + margin-right: 10px; + } + } + } + .get-bill--default { + i { + color: rgb(0, 148, 67) !important; + } + &:hover { + border-color:#d0d0d0 !important; + color: #111 !important; + i { + color: rgb(0, 148, 67) !important; + } + } + } + .get-bill--black { + i { + color: rgb(0, 148, 67) !important; + } + &:hover { + i { + color: rgb(0, 148, 67) !important; + } + } + } + } + .u-table-fixed-right { + .opr { + .single-line-and-ellipsis { + text-overflow: initial; + } + } + } + .error-flag { + max-width: 28px !important; + } +} + +.approvel-details { + height: 100%; + .approve-header { + background-color: #fff; + padding: 0 20px; + border-radius: 3px; + position: absolute; + top: 0; + width: 100%; + .back{ + float: left; + margin-top: 12px; + } + .back-btn { + float: left; + } + + .approve-title { + color: #111; + //font-weight: normal !important; + //padding-left: 10px; + line-height: 46px; + font-size: 16px; + float: left; + font-weight: bold; + } + + .approve-controls { + height: 46px; + //margin-right: 20px; + display: flex; + align-items: center; + float: right; + .u-form-control-wrapper { + width: 280px !important; + margin-left: 8px; + } + .error-flag { + font-size: 18px; + color: #fc5855; + cursor: pointer; + } + } + + .uf-jewel-wrap { + height: 60px; + float: left; + position: relative; + + .uf-jewel { + margin-left: 10px; + cursor: pointer; + margin-top: 15px; + width: 26px; + } + } + } + + .approve-body { + + height: 100%; + border-top: 50px solid transparent; + box-sizing: border-box; + iframe { + height: 100%; + // padding: 0 90px; + width: 100%; + // min-height: 620px; + } + } + + .reason-control { + width: 280px; + border-radius: 4px; + } + + .cashier-reject--wrap { + position: relative; + float: left; + width: 248px; + height: 22px; + margin-left: 10px; + } + + .cashier-reject--dialog { + width: 248px; + height: 22px; + border: 1px solid #ffcdaf; + border-radius: 4px; + margin-top: 20px; + color: #fc5f00; + font-size: 12px; + position: relative; + overflow: hidden; + cursor: pointer; + + #inner-text { + line-height: 22px; + position: absolute; + left: 0; + top: 0; + padding: 0 10px; + user-select: none; + width: 100%; + + span { + display: inline-block; + width: 100%; + } + } + + span { + display: inline-block; + } + } + + #floating-text { + position: absolute; + left: 134px; + top: 48px; + border: 1px solid #ffcdaf; + border-radius: 4px; + width: 275px; + height: auto; + padding: 6px 10px; + background-color: #fff; + line-height: 22px; + color: #fc5f00; + font-size: 12px; + user-select: none; + transition: .2s; + transform: scale(0); + z-index: 1; + word-break: break-all; + } +} + +.billno-reject { + height: 16px; + font-size: 12px; + color: #E14C46; + line-height: 11px; + border-radius: 2px; + margin-left: 3px; + padding: 3px; + display: inline-block; +} +.operate-note, +.approvel-details { + .u-modal-body { + padding-left: 0!important; + padding-right: 0!important; + padding-top: 0 !important; + } + .operate-note-body-div{ + padding-top: 10px; + } +} +.billno-img { + width: 18px; + height: 18px; + float: left; + cursor: pointer; +} +.cashier-reject-tip { + font-size: 12px; + border-radius: 2px; + margin-left: 3px; + padding: 0 3px; + background: #FFEBEE; + border: 1px solid #F44336; + color: #F44336 +} + +.tips-fixed--wrapper { + color: #555; + background: rgba(255,255,255,1); + border-radius: 2px; + position: fixed; + color: #555; + width:100px; + box-shadow:0px 2px 4px 0px rgba(146,146,146,0.5); + line-height: 20px; + left: 0; + top: 0; + transform: scale(0); + transition: .3s; + + div { + height: 20px; + display: flex; + align-items: center; + } + + img { + width: 14px; + height: 14px; + margin-right: 6px; + margin-left: 14px; + } +} +.reason-amount { + width: 68px; + height: 21px; + font-size: 13px; + line-height: 21px; + padding-left: 8px !important; + border: none !important; + color: #999; + font-weight: normal; +} + +.approve-pagination { + height: 32px; + margin: 0; + margin-left: 10px; + + li { + display: none; + height: 32px; + a { + height: 30px; + padding-top: 0; + padding-bottom: 0; + span { + display: block; + line-height: 28px; + font-size: 16px; + } + } + } + + li:nth-child(1), + li:nth-child(2), + li:nth-last-child(1), + li:nth-last-child(2) { + display: block; + } +} + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.task-take-modal .u-modal-dialog { + width: 850px; +} + +.NC_searchAdvModalBackground { + opacity: 1; + background: rgba(0, 0, 0, .5); + + .NC_searchAdvModal { + height: 570px!important; + + .modalBody { + height: 427px; + } + } +} + +.searchAdvCom_remove { + position: absolute; + right: 15px; +} + + + +.reject-content { + div:nth-child(1) { + margin-bottom: 5px; + + div.u-form-control-wrapper { + width: 300px!important; + margin-left: 10px; + margin-right: 10px; + } + } +} + +.footer-radio-group { + float: left; +} + +.credits-show { + margin-bottom: 3px; +} + +.credits-box { + //border: 1px solid #d0d0d0; + border-radius: 3px; + height: auto; +} + +.nc-modal.u-modal .u-modal-dialog .u-modal-content { + overflow: inherit; + height: auto; +} + +.uf-jewel-float { + position: relative; + top: 10px; + left: 0; + z-index:1; + min-width: 180px; + height: 80px; + background: #fff; + border-radius: 4px; + // border: 1px solid #d0d0d0; + display: none; + + .uf-t { + width: 15px; + height: 15px; + border: 1px solid #d0d0d0; + position: absolute; + left: 18px; + bottom: 71px; + // box-shadow: 0px 3px 12px 0px rgba(74,81,93,0.25); + transform: rotate(45deg); + background: #fff; + z-index: 999; + border-right-color: transparent; + border-bottom-color: transparent; + } + + .content { + // width: 100%; + height: 100%; + background: #fff; + position: absolute; + border-radius: 4px; + display: flex; + border: 1px solid #d0d0d0; + padding-right: 5px; + + .content-left { + width: 54px; + height: 100%; + float: left; + + img { + margin-left: 5px; + width: 48px; + margin-top: 14px; + } + } + + .content-right { + // width: 70%; + height: 100%; + float: left; + flex: 1; + + div { + height: 40px; + line-height: 36px; + padding-left: 14px; + font-size: 17px; + } + + .user-name { + padding-top: 4px; + height: 25px; + } + + .credit-level { + padding-bottom: 4px; + white-space: nowrap; + } + } + } +} + +.item-credit-view { + float: left; + margin: 5px; + background-color: #d0d0d0; + border-radius: 4px; + text-align: center; + font-size: 12px; + position: relative; + color: #F87321; + background: #E8E8E8; + padding: 4px 10px 4px 5px; + + i { + display: none; + position: absolute; + background: red; + color: #fff; + font-weight: bold; + width: 15px; + height: 15px; + border-radius: 50%; + right: -7px; + top: 7px; + line-height: 13px; + font-size: 22px; + cursor: pointer; + } + + &:hover i { + display: block; + } +} + +.credit-content--top { + margin-bottom: 15px; + + .refer-click-container { + cursor: pointer; + color: #007ACE; + } +} + +.reject-title--content { + display: flex; + align-items: center; + + div:nth-child(3) { + .refer-click-container { + cursor: pointer; + color: #007ACE; + } + } + + div.u-form-control-wrapper { + margin-top: 8px; + } +} + +.content-show { + div:nth-child(2) { + display: inline-block; + } +} +.content-hide { + div:nth-child(2) { + display: none; + } +} + +.contentdiv-show { + display: block; +} +.contentdiv-hide { + display: none; +} + +.operate-note { + .viewer-close { + position: absolute; + font-size: 16px; + font-weight: bold; + padding-left: 19px; + text-align: left; + top: 18px; + right: 15px; + cursor: pointer; + color: #000; + } +} + +#rejectdialog { + .u-modal-body { + padding-top: 0; + } + + .reject-title--content > span { + width: 80px; + } +} + +#handon-dialog { + .u-modal-dialog { + height: 300px; + // overflow: auto; + .u-modal-body .textarea-wrap { + border-radius: 3px; + height: auto; + } + } +} + +#credit-dialog { + .u-modal-dialog { + overflow: auto; + } +} + +.rule-title { + padding: 8px; + color: #111; + font-size: 14px; + font-weight: normal; +} +.rule-search-input { + border: 1px solid #D0D0D0; + margin-left: 24px; + width: 200px; + height: 30px; + border-radius: 4px; + font-size: 13px; + padding: 5px; + padding-right: 25px; +} + +.icon-sousuo-c:after { + content: "\E611"; + position: relative; + right: 23px; + font-size: 20px; + top: 3px; + color: #555; +} +.rule-content-wrap { + background:rgba(255,251,244,1); + border: 1px dashed #FBDB94; + padding: 10px 23px; + height: 200px; + overflow: auto; + .first-level { + position: relative; + color: #111; + font-size: 13px; + .icon { + position: absolute; + top: 2px; + left: -16px; + font-size: 12px; + color: #898888; + } + } + .second-level { + color: #555555; + font-size: 12px; + cursor: pointer; + } + .rule-item-selected { + color: #F87321; + } +} + +.credits-box { + textarea { + resize: none !important; + } +} + +.icon-yujing{ + color: #d7332c; + display: inline-block; + height: 30px; + width: 30px; + vertical-align: middle; + margin-left: 5px; + border-radius: 4px; + background: #e0e0e0; + line-height: 30px; + text-align: center; +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +#SysComponentsWorkbenchTab { + .tab-btns { + .search-area-contant { + margin-left: 0px !important; + } + } +} + +.work-bench-search-area { + margin-bottom: 4px; +} + +.u-pagination-list { + li > a { + padding-top: 0 !important; + padding-bottom: 0 !important; + } +} + +.opt_history_ul { + margin-top: 8px; + .opt_history_li { + margin-bottom: 8px; + .opt_history_name_wrap { + color: #111111; + font-weight: 500; + font-size: 14px; + } + .opt_history_level { + padding: 0 4px; + height:15px; + border-radius:9px; + font-weight:400; + line-height:17px; + font-size: 12px; + display: inline-block; + text-align: center; + margin-left: 12px; + } + //一般 + .pro-GENERAL { + color:rgba(255,165,9,1); + background:rgba(255,238,211,1); + } + //非常严重 + .pro-MORESERIOUS { + color:rgba(225,76,70,1); + background:rgba(255,228,228,1); + + } + //很轻微 + .pro-MORESLIGHT { + color:rgba(54,193,61,1); + background:rgba(210,244,212,1); + + } + //严重 + .pro-SERIOUS { + color:rgba(250,100,19,1); + background:rgba(255,234,220,1); + + } + //轻微 + .pro-SLIGHT { + color:rgba(0,145,255,1); + background:rgba(212,236,255,1); + + } + .opt_history_memo { + margin-top: 4px; + font-size: 14px; + font-weight: 400; + white-space: pre-wrap; + } + + } +} + + +.ellipsis { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; +} + +.operate-note .u-table-expanded-row-expand-icon,.operate-note .u-table-row-expand-icon { + display: none !important; +} \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/requestApi.js b/src/ssctpaaa/sscuser/sscuser/list/requestApi.js new file mode 100644 index 0000000..e073814 --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/requestApi.js @@ -0,0 +1,280 @@ +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ +import { ajax } from 'nc-lightapp-front' + +let requestApiOverwrite = { + // 查询条件 模板查询 + querySSCTemplateAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskTempletAction.do', + data: opt.data, + success: (data) => { + opt.success(data.data.searchArea) + } + }) + }, + // 作业任务查询 + query: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleQueryAction.do', + data: opt.data, + loading: opt.loading, + success: (data) => { + opt.success(data.data) + } + }) + }, + // 作业任务申请调整 作业任务挂起 + taskAdjustAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleAdjustAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任务挂起 + taskHandOnAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleHandonAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任取消调整 + taskUnAdjustAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleUnAdjustAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任务取消挂起 + taskUnHandOnAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleUnHandonAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任务提取 + taskTakeAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleTakeAction.do', + data: opt.data || {}, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任务驳回 + taskRejectAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleRejectAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 驳回活动 + getRejectActivityAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskGetRejectActivityAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任务审核 + taskApproveAction: (opt) => { + ajax({ + url: '/nccloud/' + opt.data.mod + '/ssctp/sscbd/SSCTaskHandleApproveAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 作业任务联查操作记录 + taskQueryOperationAction: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleQueryOperationAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 获取iframe url + openBill: (opt) => { + ajax({ + url: '/nccloud/sscrp/rpbill/BrowseBillAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }); + }, + // 作业任务取消审核 + taskUnApproveAction: (opt) => { + ajax({ + url: '/nccloud/' + opt.data.mod + '/ssctp/sscbd/SSCTaskHandleUnApproveAction.do', + data: opt.data, + success: (data) => { + opt.success(data) + } + }) + }, + // 模糊查询 + queryFuzzyKey: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskBlurQueryAction.do', + data: opt.data, + success: data => { + opt.success(data) + } + }) + }, + // 查询云端信用指标 + queryCredits: (opt) => { + /*** + * @param queryMethod {String} 查询方法 + * 1、queryStandard(查询启用的信用标准) + * 2、queryCreditRuleClass(查询信用指标分类) + * 3、queryCreditRule(查询信用指标) + * 4、queryCreditInfo(查询信用值信息) + * 5、queryCreditLevel(查询信用等级) + * 6、isCreditInstall(是否设置信用) + * **/ + ajax({ + url: '/nccloud/ssctp/credit/creditAction.do', + data: { method: opt.queryMethod, billMakerId: opt.billMakerId || '' }, + success: data => { + opt.success(data) + } + }) + }, + // + queryCreditRule: (opt) => { + ajax({ + url: '/nccloud/ssctp/credit/creditRuleAction.do', + data: { + "pid": "", + "keyword": "", + "queryCondition": { + "isShowUnit": false + }, + "pageInfo": { + "pageSize": 50, + "pageIndex": -1 + } + }, + success: data => { + opt.success(data) + } + }) + }, + + //查询预算预警信息 + queryBudgetMessage: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskBudgetMessagAction.do', + data: opt.data, + success: data => { + opt.success(data) + } + }) + }, + + manualReasonQry: ({ pk, success }) => { + ajax({ + url: '/nccloud/ssctp/sscapv/TransToManualReasonQryAction.do', + data: { pk }, + success + }) + }, + + checkGetBillStatus: ({ success }) => { + ajax({ + url: '/nccloud/ssctp/intellidispatch/QueryNowMyStateAction.do', + data: {}, + success + }) + }, + + setStart: ({ success, error }) => { + ajax({ + url: '/nccloud/ssctp/intellidispatch/SetStartStateAction.do', + data: {}, + success, + error + }) + }, + + setEnd: ({ success, error }) => { + ajax({ + url: '/nccloud/ssctp/intellidispatch/SetEndStateAction.do', + data: {}, + success, + error + }) + }, + // 判断是否有新的任务分配 + checkNewData: (opt) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleAddNoticeAction.do', + data: opt.data, + loading: false, + success: (data) => { + opt.success(data.data) + } + }) + }, + updateTs: ({ pk_task, success }) => { + ajax({ + url: '/nccloud/ssctp/sscbd/SSCUpdateTaskAction.do', + data: { pk_task }, + success + }) + }, + // 判断影响是否安装 + checkImageInstalled: (opt) => { + ajax({ + url: '/nccloud/ssctp/dapsystem/DapSystemInstalled4ImageAction.do', + data: opt.data, + loading: false, + success: (data) => { + opt.success(data.data) + } + }) + }, + //外系统凭证和影像接口 + imagAndVoucherOps: (opt) => { + ajax({ + url: '/nccloud/ssctp/dapsystem/TryReqImageAndVoucherShowTypeAction.do', + data: opt.data, + loading: false, + success: (data) => { + opt.success(data.data) + } + }) + }, + // 取得子页面控制列表刷新注册信息 + apiRefreshList: ({success}) => { + ajax({ + url: '/nccloud/sscrp/rpbill/RPRefreshActionQueryAction.do', + success + }) + } +} + +export default requestApiOverwrite +/*Mq+ry/aXt/6nN0mNqW5qEIFeSGycgB9gi2ynbY6bvYw=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/sscuser/list/sscUserList.js b/src/ssctpaaa/sscuser/sscuser/list/sscUserList.js new file mode 100644 index 0000000..c714c1c --- /dev/null +++ b/src/ssctpaaa/sscuser/sscuser/list/sscUserList.js @@ -0,0 +1,1579 @@ +/*b8DESLMYZe2kOZjnZDqmEhRfChTTStWDAoDSflO4zHk=*/ +import React, { Component } from 'react' +import { createPage, promptBox, base, pageTo, toast, broadcast, viewModel } from 'nc-lightapp-front' +const { NCModal, NCButton, NCFormControl, NCPagination, NCIcon, NCBackBtn, NCAffix, NCTooltip, NCDiv, NCCheckbox, NCTable } = base +const { getGlobalStorage } = viewModel +import { buttonClick, initTemplate, cardButtonClick, paginationClick, onRowDoubleClick, reloadBillPage } from './events' +import requestApi from './requestApi' +import './index.less' + +import WorkbenchTab from 'ssccommon/components/workbench-tab' +import WorkbenchSearcharea from 'ssccommon/components/workbench-searcharea' +import WorkbenchDetail from 'ssccommon/components/workbench-detail' + +import RejectDialog from './components/rejectDialog' +import HandonDialog from './components/handonDialog' +import AdjustDialog from './components/AdjustDialog' +import CreditApprovalDialog from './components/creditApproval' +import UnHandonDialog from './components/unHandonDialog' +import UnAdjustDialog from './components/unAdjustDialog' +import { setPointTreeData } from 'ssccommon/components/auditPointBar/handle'; + +import GetTask from './components/getTask' + +import AuditPointBar from 'ssccommon/components/auditPointBar/AuditPointBar'; + +import level1_1 from '../../../public/image/level1_1.png' +import level1_2 from '../../../public/image/level1_2.png' +import level2_1 from '../../../public/image/level2_1.png' +import level2_2 from '../../../public/image/level2_2.png' +import level3_1 from '../../../public/image/level3_1.png' +import level3_2 from '../../../public/image/level3_2.png' +import level4_1 from '../../../public/image/level4_1.png' +import level4_2 from '../../../public/image/level4_2.png' +import level5_1 from '../../../public/image/level5_1.png' +import level5_2 from '../../../public/image/level5_2.png' + +const levelImgs = [ + { img1: level1_1, img2: level1_2 }, + { img1: level2_1, img2: level2_2 }, + { img1: level3_1, img2: level3_2 }, + { img1: level4_1, img2: level4_2 }, + { img1: level5_1, img2: level5_2 } +] + +window.presetVar = { + ...window.presetVar, + list: 'ssctaskhandle', + card: 'sscusercard', + listCode: 'ssctaskhandle', + pageSize: 30 +} + +import CashierRejectDialog from './components/CashierRejectDialog.js' + +import { + nccGetTheme, +} from 'ssccommon/utils/asyncFunctions.js'; + +class SscUserList extends Component { + constructor(props) { + super(props) + + this.state = { + showType: 'list', //列表页:列表显示、缩略图显示 + showNumbers: {}, //存放pending 、handled、handon、sscreject 等状态的单据数 + searcharea: { //查询条件,传给WorkbenchSearcharea组件 + conditions: [] + }, + pageControll: 'none', //滚动翻页标记,标识是否翻到页尾 + fuzzyquerychild: [], //模糊查询变量,传入WorkbenchSearcharea组件 + showModal: false, //是否显示单据详情页 + showdialogmodel: false, //是否显示驳回dialog + showradio: false, //驳回dialog中是否显示 冲走流程 不重走流程 单选组件。 + ncoptions: '', //驳回dialog中, 驳回至下拉组建的选项 + defaultOption: '', //驳回dialog,驳回至下拉组件默认选项 + showOperateNote: false, //是否显示操作记录dialog + currentRowData: null, //打开列表某张单据时,记录当前行数据 + approveUrl: '', //单据详情页的url, iframe src的值 + reason: '', //审批或驳回原因 + activeIndex: 1, //tab活动标签索引 + didApprove: false, //审批逻辑完成时的标记变量 + defaultKey: 'pending', //列表页默认的tab状态 + currentKey: 'pending', //列表页当前的tab状态 + showhandonmodel: false, //是否显示挂起dialog + handonmodeldata: null, //挂起组件HandonDialog用到的属性 + showadjustmodel: false,//是否显示调整dialog + adjustmodeldata: null, //调整组件用到的属性 + showcreditmodel: false, //是否显示信用批准dialog + creditmodeldata: null, //信用批准dialog用到的数据 + creditsArray: [], //信用指标 + levels: [], //信用级别 + creditLevelInfo: {}, //信用级别信息 + isCreditInstall: true, // + showUnHandonModal: false, //显示取消挂起dialog + unHandonModalData: null, //取消挂起dialog变量 + showUnAdjustModal: false, //显示取消调整dialog + unAdjustModalData: null, //取消调整dialog变量 + creditView: false, //显示信用指标 + didAction: false, //操作完成时的状态标记 + sagaStatus: "0", //sgaa参数 + oid: '', //任务提取用到的变量 + queryAreaCode: '', //任务提取参数 + jkCheck: false, //审批接口参数 + ntbCheck: false, //审批接口参数 + skipcodes: '', //审批接口参数 + alarm: false, //预警标记 + hitMessage: '', //预警信息 + creditRuleItems: {}, //信用查询规则 + tipsInfo: [], + getBillStatus: false, //接单状态:开始接单 停止接单 + sscTaskHistoryTpl: [], //操作记录NCTable模板 + sscTaskHistoryData: [], //操作记录NCTable数据 + optHistoryExpandRowKeys: {}, //操作记录中已经展开的行的key + paginationItems: 0, // 翻页器总页数 + showCashierReject: false, + orderInfo: true, // 接单按钮提示语 + theme: '', // 当前主题 + } + // 查询条件 + this.queryKey = { + taskstatus: 'pending', + fuzzyQueryKey: [], + pageinfo: { + number: 1, + size: window.presetVar.pageSize, + totalElements: 0, + totalPages: 0 + }, + iscmpreject: 'N' //是否查询出纳驳回 + } + this.searchAreaConfig = {} + this.data = { + listRows: [], + oid: '', + queryAreaCode: '' + } + this.canChangPageFlag = true + this.fuzzyKey = "" + // initTemplate.call(this, props) + + // 当前查询时间戳,用于提示用户是否有新的单据指派功能 + this.lastQueryTime = ''; + + // 待处理pklist + this.pendingPklist = []; + } + componentWillMount() { + // debugger + const key = this.props.getUrlParam("process") ? this.props.getUrlParam("process").toLowerCase() : 'pending' + const that = this + this.setState({ + defaultKey: key, + currentKey: key, + showCashierReject: key == 'pending' ? true : false + }, () => { + this.queryKey.taskstatus = key + initTemplate.call(that, that.props) + }) + } + componentDidMount() { + let iframeObj = document.getElementById('approve-detail'); + iframeObj.onload = () => { + if (iframeObj.contentWindow) { + iframeObj.contentWindow.document.body.style.padding = 0; + iframeObj.contentWindow.app.style.minWidth = 'auto'; + } + } + this.getTheme() + + setTimeout(() => { //降低请求优先级 + requestApi.apiRefreshList({ //请求需要刷新的接口列表 + success: (data) => { + let urlArr = data.data.actionnames; + broadcast.on('TabBroadcast', (obj, key) => { //监听ajax事件 + if (this.state.showModal) { //只在审批详情页面时触发 + if (urlArr.indexOf(obj.ajaxUrl.slice(9, -3).split('/').join('.')) > -1) { + let currentRowData = this.state.currentRowData; + //调用审核侧边栏刷新 + setPointTreeData.call(this.auditPointBarInst, this.auditPointBarInst.baseReqParam, true, null, true) + //更新ts 否则接口提示:数据已修改,请刷新页面后重试! + requestApi.query({ + data: { + pk_task: currentRowData.pk_task.value, + pk_sscnode: currentRowData.pk_sscnode.value, + taskstatus: currentRowData.taskstatus.value, + pageinfo: this.queryKey.pageinfo + }, + success: (data) => { + currentRowData.ts.value = data.tasklist.rows[0].values.ts.value; + this.setState({ + currentRowData + }) + } + }) + } + } + + }) + } + }) + }) + } + // 获取主题 + getTheme = async () => { + const theme = await nccGetTheme() + this.setState({ theme }) + } + // 查询数据(参数:是否是翻页动作) + /** + * + * @param {*} isAddPage 是否翻页 + * @param {*} afterSortCb 排序查询回调 + * @param {*} isTimeRefresh 是否是自动刷新 + * @param {*} callback 查询成功后调用的回调函数 扫描单据需求会用到 + * @param {*} barcode 扫描单据码 + */ + queryData = (isAddPage, afterSortCb, isTimeRefresh, callback, barcode) => { + // 翻页标志 + let addPageFlag = isAddPage; + if (addPageFlag) { + if (this.queryKey.taskstatus == 'pending') { + // 待处理页签时,由于自动审批功能会在不固定位置插入数据,所以翻页动作使用全部查询模式。 + this.queryKey.pageinfo.number = 1; + this.queryKey.pageinfo.size = this.queryKey.pageinfo.size + window.presetVar.pageSize; + addPageFlag = false; + } else { + // 待处理以外页签使用默认后端翻页模式 + this.queryKey.pageinfo.number++ + this.queryKey.pageinfo.size = window.presetVar.pageSize; + } + } else { + // 非翻页模式时重置页信息 + if (!isTimeRefresh) { + // 非自动刷新场合 + this.queryKey.pageinfo.number = 1; + this.queryKey.pageinfo.size = window.presetVar.pageSize; + } + } + + let queryCondtion; + if (this.queryKey.taskstatus !== 'pending') { + queryCondtion = JSON.parse(JSON.stringify(this.queryKey)); + delete queryCondtion['alarm']; + } else { + queryCondtion = this.queryKey; + } + + if (barcode) { + queryCondtion.barcode = barcode; + } + requestApi.query({ + data: queryCondtion, + success: (data) => { + callback && callback(data); + //设置查询区域数据 + this.queryDataCallback(data, addPageFlag); + //排序查询后,回调函数 + afterSortCb && afterSortCb(); + //重新计算表格高度 + this.props.table.updateTableHeight(); + } + }) + if (this.queryKey.taskstatus === 'pending') { // 待处理隐藏 超期日期 预警日期 列 + this.props.table.showColByKey(window.presetVar.list, 'endtime') + this.props.table.showColByKey(window.presetVar.list, 'warningtime') + } else { // 其他标签页显示 + this.props.table.hideColByKey(window.presetVar.list, 'endtime') + this.props.table.hideColByKey(window.presetVar.list, 'warningtime') + } + } + queryDataCallback = (data, isAddPage = false) => { + + // 更新查询时间戳 + this.lastQueryTime = data.lastQueryTime; + // 更新待处理pklist + this.pendingPklist = data.taskPkList; + + let listRows = [] + let detailData = {}; + if (isAddPage) { + this.data.listRows.map((one) => { + listRows.push(this.copyData(one)) + }); + detailData = data.taskcard; + } else { + detailData = data.taskcard; + this.refs.detail.clearAllDetailData(); + } + data.tasklist.rows.map((one) => { + listRows.push(this.copyData(one)) + }) + this.data.listRows = listRows; + // 设置列表数据 + this.props.table.setAllTableData(window.presetVar.list, { + areacode: window.presetVar.list, + rows: listRows + }) + // 设置缩略数据 + this.refs.detail.addDetailData(detailData, this.data.listRows); + let newState = {} + newState = this.state + // 更新未完成数量 + if (data.pending) { + newState.showNumbers.pending = data.pending + } + if (data.handled) { + newState.showNumbers.handled = data.handled + } + if (data.handon) { + newState.showNumbers.handon = data.handon + } + if (data.sscreject) { + newState.showNumbers.sscreject = data.sscreject + } + if (data.adjust) { + newState.showNumbers.adjust = data.adjust + } + // 更新查询条件区域 + let conditions = null + switch (this.queryKey.taskstatus) { + case 'pending': + conditions = this.searchAreaConfig.searchArea_pending + break + case 'handled': + conditions = this.searchAreaConfig.searchArea_handled + break + case 'handon': + conditions = this.searchAreaConfig.searchArea_handon + break + case 'sscreject': + conditions = this.searchAreaConfig.searchArea_sscreject + break + case 'adjust': + conditions = this.searchAreaConfig.searchArea_adjust + break + default: + conditions = this.searchAreaConfig.searchArea_pending + break + } + let idx = -1 + conditions.forEach((ele, index) => { + if (ele.attrcode === 'pk_tradetype') { + idx = index + } + }) + if (idx != -1) { + conditions[idx] = data.searchArea.items[0] + } + + newState.searcharea.conditions = conditions + // 更新页信息 + this.queryKey.pageinfo = data.tasklist.pageinfo + if (Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number)) { + newState.pageControll = 'notend' + } else if (Number(this.queryKey.pageinfo.totalPages) == Number(this.queryKey.pageinfo.number)) { + newState.pageControll = 'end' + } else { + newState.pageControll = 'none' + } + newState.creditView = data.isCreditInstall || false + if (newState.creditView) { + //查询规则 + this.queryCreditRuleItems(); + } + newState.paginationItems = this.pendingPklist.length; + this.setState(newState); + setTimeout(() => { this.canChangPageFlag = true; }, 100) + } + // 复制列表数据 + copyData(data) { + let newData = {} + newData.values = {} + for (let child in data.values) { + newData.values[child] = { + display: data.values[child].display, + value: data.values[child].value, + scale: data.values[child].scale + } + } + return newData + } + // 已完成/未完成 页签切换 + selectTabChange(selectKey) { + this.queryKey.taskstatus = selectKey + for (let attr in this.queryKey) { + if (attr !== 'pageinfo' && attr !== 'taskstatus' && attr != 'iscmpreject') { + delete this.queryKey[attr] + } + } + this.refs.searchArea.resetState() + this.setState({ + currentKey: selectKey, + showCashierReject: selectKey == 'pending' ? true : false, + fuzzyquerychild: [] + }, () => { + initTemplate.call(this, this.props) + }) + } + // 查询条件选择变更 + handleConditionChange(attrcode, value) { + this.queryKey[attrcode] = value + this.queryData() + } + // 列表/缩略切换 + showTypeClick(type) { + this.setState({ showType: type }) + } + // 查询操作记录 + queryOperNote() { + requestApi.taskQueryOperationAction({ + data: { + busiid: this.state.currentRowData.busiid.value, + pk_currenttask: this.state.currentRowData.pk_currenttask.value + }, + success: (data) => { + if (data.success && data.data.ssctaskhistory) { + let newRows = data.data.ssctaskhistory.rows.map((row, index) => { + let values = row.values; + let newRow = { values }; + for (let attrcode in values) { + if (attrcode != 'opt') { + newRow[attrcode] = values[attrcode].display || values[attrcode].value + newRow.key = values['pk_bill'].value + '_' + index; + } + } + return newRow + }) + this.setState({ + sscTaskHistoryData: newRows, + showOperateNote: true + }) + } + } + }) + } + // 申请调整 + adjustApply() { + this.setState({ showadjustmodel: true, adjustmodeldata: this.state.currentRowData }) + } + successAdjust = (data) => { + if (data.success) { + initTemplate.call(this, this.props) + this.setState({ showadjustmodel: false, showModal: false, reason: '', activeIndex: 1, currentKey: this.queryKey.taskstatus, didAction: true }) + } + } + successUnAdjust = (data) => { + if (data.success) { + initTemplate.call(this, this.props) + this.setState({ showUnAdjustModal: false, showModal: false, reason: '', activeIndex: 1, currentKey: this.queryKey.taskstatus }) + } + } + // 取消调整 + adjustUnApply() { + this.setState({ + showUnAdjustModal: true, + unAdjustModalData: this.state.currentRowData + }) + } + // 按钮 挂起 + hangUp() { + this.setState({ showhandonmodel: true, handonmodeldata: this.state.currentRowData }) + } + successHangUp = (data) => { + if (data.success) { + initTemplate.call(this, this.props) + this.setState({ showhandonmodel: false, showModal: false, reason: '', activeIndex: 1, currentKey: this.queryKey.taskstatus, didAction: true }) + } + } + successUnHangUp = (data) => { + if (data.success) { + initTemplate.call(this, this.props) + this.setState({ showUnHandonModal: false, showModal: false, reason: '', activeIndex: 1, currentKey: this.queryKey.taskstatus }) + } + } + // 取消挂起 + cancelHangUp() { + this.setState({ + showUnHandonModal: true, + unHandonModalData: this.state.currentRowData + }) + } + reasonOnChange = (val) => { + if (val.length > 200) return + this.setState({ reason: val }) + } + // 批准 + taskApprove() { + let multiLang = this.props.MutiInit.getIntl(7010); + requestApi.taskApproveAction({ + data: { + pk_currenttask: this.state.currentRowData.pk_currenttask.value, + pk_task: this.state.currentRowData.pk_task.value, + reason: this.state.reason, + billtype: this.state.currentRowData.billtypecode.value, + billno: this.state.currentRowData.billno.value, + busiid: this.state.currentRowData.busiid.value, + skipcodes: this.state.skipcodes, + actiontype: "sscapprove", + ntbCheck: this.state.ntbCheck, + jkCheck: this.state.jkCheck, + ts: this.state.currentRowData.ts.value, + pk_group: this.state.currentRowData.pk_group.value, + transtypecode: this.state.currentRowData.transtypecode.value, + mod: this.state.currentRowData.module.value, + ...this.auditPointBarInst.getAuditData(true) + }, + success: (data) => { + if (data.success) { + let currentRowData = this.state.currentRowData; + currentRowData.taskstatus.value = 'sscapprove'; //此处设置用于审核侧边栏编辑态控制 + this.setState({ + currentRowData, + currentKey: 'handled' + }) + if (data.data && data.data['jkAlarm']) { //监控预警 + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'),//"提示信息" + content: (multiLang && multiLang.get('701001RWCL-0048')) + data.data['jkAlarm'] + (multiLang && multiLang.get('701001RWCL-0049')), + noFooter: false, // 是否显示底部按钮(确定、取消),默认显示(false),非必输 + noCancelBtn: false, // 是否显示取消按钮,,默认显示(false),非必输 + beSureBtnName: multiLang && multiLang.get('7010-0001'), + cancelBtnName: multiLang && multiLang.get('7010-0004'), + beSureBtnClick: () => { + this.state.jkCheck = true; + this.taskApprove(); + } + //cancelBtnClick: functionCancel // 取消按钮点击调用函数,非必输 + }) + } else if (data.data && data.data['bugetAlarm']) { //预算预警 + promptBox({ + color: 'warning', // 提示类别默认"success", "success"/"info"/"warning"/"danger",非必输 + title: multiLang && multiLang.get('701001RWCL-0047'),//"提示信息" + content: (multiLang && multiLang.get('701001RWCL-0048')) + data.data['bugetAlarm'] + (multiLang && multiLang.get('701001RWCL-0049')), + noFooter: false, // 是否显示底部按钮(确定、取消),默认显示(false),非必输 + noCancelBtn: false, // 是否显示取消按钮,,默认显示(false),非必输 + beSureBtnName: multiLang && multiLang.get('7010-0001'), + cancelBtnName: multiLang && multiLang.get('7010-0004'), + beSureBtnClick: () => { + this.state.ntbCheck = true; + this.state.skipcodes = data.data['skipcodes'] + this.taskApprove(); + } + //cancelBtnClick: functionCancel // 取消按钮点击调用函数,非必输 + }) + } else { + this.state.currentRowData.ts.value = data.data.ts + this.state.currentRowData.isApproved = true; + this.setState({ didApprove: true, approveUrl: '' }, () => { + let module = this.state.currentRowData.module.value || ""; + let _ncc_websocket_switch_ = getGlobalStorage("localStorage", "_ncc_websocket_switch_") || "0";//默认为合盘环境 + if (_ncc_websocket_switch_ == "0" || module == "webdbl") {//非微服务环境或者工单 + reloadBillPage.call(this); + } + }) + } + // document.getElementById('approve-detail').contentWindow.location.reload(true) + } + } + }) + + } + + // 取消审核 + taskUnApprove() { + requestApi.taskUnApproveAction({ + data: { + busiid: this.state.currentRowData.busiid.value, + billtypecode: this.state.currentRowData.billtypecode.value, + transtypecode: this.state.currentRowData.transtypecode.value, + pk_task: this.state.currentRowData.pk_task.value, + pk_group: this.state.currentRowData.pk_group.value, + pk_currenttask: this.state.currentRowData.pk_currenttask.value, + actiontype: "un-sscapprove", + ts: this.state.currentRowData.ts.value, + mod: this.state.currentRowData.module.value + }, + success: (data) => { + if (data.success) { + this.setState({ + currentKey: 'pending' + }) + this.state.ntbCheck = false; + this.state.jkCheck = false; + this.state.currentRowData.ts.value = data.data.ts + this.state.currentRowData.isApproved = false; + this.state.currentRowData.taskstatus.value = 'taken'; + this.setState({ didApprove: false, approveUrl: '' }, () => { + let module = this.state.currentRowData.module.value || ""; + let _ncc_websocket_switch_ = getGlobalStorage("localStorage", "_ncc_websocket_switch_") || "0";//默认为合盘环境 + if (_ncc_websocket_switch_ == "0" || module == "webdbl") {//非微服务环境或者工单 + reloadBillPage.call(this); + } + }) + } + } + }) + } + // 按钮 驳回 + taskReject() { + requestApi.getRejectActivityAction({ + data: { + billid: this.state.currentRowData.busiid.value, + billtype: this.state.currentRowData.transtypecode.value, + pk_currenttask: this.state.currentRowData.pk_currenttask.value, + pk_group: this.state.currentRowData.pk_group.value + }, + success: (data) => { + if (data.success) { + this.setState({ + showdialogmodel: true, + operationData: this.state.currentRowData, + showradio: data.data.showradio, + ncoptions: data.data.NCOptions, + defaultOption: data.data.default + }) + // this.refs.rejectDialog.setDefaultDefOption(data.data.default || '') + } + } + }) + } + // 分页点击 + paginationClick(position) { + paginationClick(position, this) + } + // 模糊查询输入内容变化 + onFuzzyChange(data) { + this.fuzzyKey = data + let newQueryKey = {} + let multiLang = this.props.MutiInit.getIntl(7010) + for (let child in this.queryKey) { + newQueryKey[child] = this.queryKey[child] + } + newQueryKey.fuzzyQueryKey = data + setTimeout((that, data) => { + if (data == that.fuzzyKey) { + requestApi.queryFuzzyKey({ + data: newQueryKey, + success: (data) => { + + let fuzzyquerychild = this.state.fuzzyquerychild; + + data.data.forEach((item) => { + let obj = {}; + obj.value = item.value + '=' + that.fuzzyKey; + obj.key = item.key + (multiLang && multiLang.get('701001RWCL-0061')) + that.fuzzyKey;//包含 + if (!this.queryKey.fuzzyQueryKey || !this.queryKey.fuzzyQueryKey.includes(obj.value)) { //避免重复 + fuzzyquerychild.push(obj); + } + }) + + that.setState({ fuzzyquerychild }); + } + }) + } + }, 500, this, data) + } + + // 模糊查询选择 + onFuzzySelected(data) { + let fuzzyquerychild = []; + + if (data) { //data为空时是清空操作, 需要清空记录。 不为控制进行下面的逻辑 + this.state.fuzzyquerychild.forEach((item) => { //取消没有选择的项 + if (data.includes(item.value)) { + fuzzyquerychild.push(item); + } + }) + } + + this.setState({ fuzzyquerychild }) + this.queryKey.fuzzyQueryKey = data + this.queryData() + } + backToUserList(multiLang) { + let $frame = document.querySelector("#approve-detail"); + try { + let frameWin = $frame.contentWindow; + let targetDom = frameWin.document.querySelector(".nc-bill-form-area .form-component-item-wrapper"); + if (targetDom && targetDom.className.includes('edit')) { + alert(multiLang && multiLang.get('701004RWCL-0173')); + return; + } + } catch (e) { + //跨域报错,不处理 + } + + this.setState({ + showModal: false, + reason: '', + activeIndex: -1, + approveUrl: '', + currentKey: this.queryKey.taskstatus + }) + // this.queryKey = { + // taskstatus: this.queryKey.taskstatus, + // fuzzyQueryKey: [], + // pageinfo: { + // number: 1, + // size: 30, + // totalElements: 0, + // totalPages: 0 + // } + // } + initTemplate.call(this, this.props) + // 重置查询区焦点 + // this.refs.searchArea.resetState() + } + + //定向提取 + taskTakeAction = (params) => { + const { + queryAreaCode, + oid + } = this.data + + requestApi.taskTakeAction({ + data: { + querycondition: params, + oid, + queryAreaCode, + querytype: 'tree', + pagecode: window.presetVar.listCode + }, + success: (data) => { + if (data.success) { + initTemplate.call(this, this.props) + } + } + }) + } + + //扫描条码未查询到单据时调用:任务提取 + taskTakeActionByBarCode = (barcode, callback) => { + requestApi.taskTakeAction({ + data: { + barcode + }, + success: (data) => { + if (data.success) { + this.queryData(null, null, true, callback, barcode) + } + } + }) + } + + // 删除信用指标 + deleteCreditByIdx = (idx) => { + let newarr = this.state.creditsArray.filter((each, index) => index != idx) + this.setState({ creditsArray: newarr }) + } + setCheckedCredits = (arr, mixin) => { + this.setState({ + creditsArray: arr + }) + } + + setCreditRuleItems = (data) => { + this.setState({ + creditRuleItems: data + }) + } + queryCreditRuleItems = () => { + requestApi.queryCreditRule({ + success: (data) => { + let creditRuleItems = {}; + let rules = data.data.rows + rules.forEach((rule) => { + if (!rule.pid) { + creditRuleItems[rule.refpk] || (creditRuleItems[rule.refpk] = { item: null, children: [] }) + creditRuleItems[rule.refpk].item = rule + } else { + creditRuleItems[rule.pid] || (creditRuleItems[rule.pid] = { item: null, children: [] }) + creditRuleItems[rule.pid].children.push(rule) + } + }) + this.setState({ + creditRuleItems + }) + } + }); + } + + // 处理排序后的模板变化 + handleTempletAfterSort(sortParam) { + let sortObj = {}; + sortParam.forEach(item => { + sortObj[item.field] = item; + }); + let meta = this.props.meta.getMeta() + meta[window.presetVar.list].items.forEach(item => { + //保存返回的column状态,没有则终止order状态 + if (sortObj[item.attrcode]) { + item.order = sortObj[item.attrcode].order; + item.orderNum = sortObj[item.attrcode].orderNum; + } else { + item.order = "flatscend"; + item.orderNum = ""; + } + }) + this.props.meta.setMeta(meta); + } + + getBillChange(params) { + if (params) { + requestApi.setStart({ + success: () => { + this.setState({ getBillStatus: true }); + }, + error: (res) => { + this.setState({ getBillStatus: false }); + toast({ color: 'danger', content: res.message }); + } + }) + } else { + requestApi.setEnd({ + success: () => { + this.setState({ getBillStatus: false }); + }, + error: (res) => { + this.setState({ getBillStatus: true }); + toast({ color: 'danger', content: res.message }); + } + }) + } + } + + handleSagaErrorClick = () => { + const { currentRowData: { saga_gtxid, busiid, billtypecode } } = this.state; + + this.refs.detail.setState({ + billErrorInfo: { + show: true, + pk: (busiid && busiid.value) || "", + gtxid: (saga_gtxid && saga_gtxid.value) || "", + type: (billtypecode && billtypecode.value) || "" + } + }); + } + + socketMesg = (props, mesg) => { + let sagaStatus = mesg.error ? "1" : "0"; + // this.setState({ sagaStatus }); + const refreshData = mesg.refreshData || []; + const { activeIndex } = this.state; + refreshData.forEach(data => { + if (activeIndex === -1) {//表示在列表界面 + //列表下需要处理更新列表数据,根据已处理取消批准操作的逻辑,重新查询列表数据 + if (sagaStatus === "0") { + initTemplate.call(this, this.props); + } + } else { + //卡片也需要更新缓存数据 根据_businessPk和当前数据的busiid来判断是否还打开了此单据 + const { _businessPk } = data; + if (_businessPk) { + const { currentRowData } = this.state; + let { saga_gtxid, saga_status, busiid, ts, module } = currentRowData; + let row = this.data.listRows.find(r => r.values.busiid.value === data._businessPk); + if (row) { + row.values.saga_status.value = data.saga_status; + row.values.saga_gtxid.value = data.saga_gtxid; + if (sagaStatus === "0") {//saga事务正确 + requestApi.updateTs({ + pk_task: row.values.pk_task.value, + success: response => { + let _ts = response.data.data; + row.values.ts.value = _ts; + if (_businessPk === busiid.value) { + saga_status.value = data.saga_status; + saga_gtxid.value = data.saga_gtxid; + ts.value = _ts; + this.setState({ currentRowData, sagaStatus }) + } + } + }) + } else {//saga事务出错 + if (_businessPk === busiid.value) { + saga_status.value = data.saga_status; + saga_gtxid.value = data.saga_gtxid; + this.setState({ currentRowData, sagaStatus }) + } + } + //微服务环境下不刷新工单 + if (module.value !== "webdbl") { + reloadBillPage.call(this); + } + } + } + } + + }) + } + + render() { + const { button, table, socket } = this.props + const { createSimpleTable } = table + const { queryAreaCode, oid, didApprove, defaultKey, currentKey, levels, creditLevelInfo, isCreditInstall, theme, getBillStatus } = this.state + {/* 连接到 socket */ } + + const tablePkName = "pk_task"; + let multiLang = this.props.MutiInit.getIntl(7010); //this.moduleId + let isShow = (type) => { + if (this.state.showType == "list" && type == "list") { + return "data-area-show"; + } else if (this.state.showType == "card" && type == "card") { + return "data-area-show"; + } else { + return "data-area-hide"; + } + } + // 信用评级 + let img1 = '' + let img2 = '' + if (isCreditInstall && creditLevelInfo.creditscore) { + const { creditscore } = creditLevelInfo + let imgIdx = -1 + levels.forEach((ele, idx) => { + if (creditscore == ele.limitscore) imgIdx = idx + }) + if (imgIdx == -1) imgIdx = levels.length - 1 + if (imgIdx != -1) { + img1 = levelImgs[imgIdx].img1 + img2 = levelImgs[imgIdx].img2 + } + } + + let addMoreOnOff = this.data.listRows.length > 0 && Number(this.queryKey.pageinfo.totalPages) > Number(this.queryKey.pageinfo.number) + + let getDetailBtns = (record, index) => { + switch (this.queryKey.taskstatus) { + case 'pending': + let btnArr; + if (record.taskstatus && record.taskstatus.value == 'sscapprove' && record.iscmpreject && record.iscmpreject.value === true) { //出纳驳回时 + btnArr = ['CancelHandled', 'QueryOperation']; + } else { + btnArr = ['AdjustApply', 'HangUp', 'QueryOperation']; + } + return btnArr; + case 'handon': + return ['CancelHangUp', 'QueryOperation'] + case 'adjust': + return ['CancelAdjust', 'QueryOperation'] + case 'handled': + case 'sscreject': + return ['CancelHandled', 'QueryOperation'] + default: + return ['AdjustApply', 'HangUp', 'QueryOperation'] + } + } + + let hintContent =
    {this.state.hitMessage}
    + + const sagaError = this.state.sagaStatus === "1" && + + {/* 操作记录 页签 */ } + const operateAndNCPagination = [ + { + this.queryOperNote.call(this) + // "701001RWCL-0008": "操作记录" + }} + >{multiLang && multiLang.get('701001RWCL-0008')}, + ]; + const pending = ( +
    + {sagaError} + + {/* reason */} + { + !this.state.didAction + && + ( + + ) + } + { + !this.state.didAction + && + + {this.state.reason ? this.state.reason.length : 0}/200 + + } + { + this.state.alarm ? + + : "" + } + {/* 批准 */} + { + !this.state.didAction + && + {multiLang && multiLang.get('701001RWCL-0003')} + } + { + !this.state.didAction + && + {multiLang && multiLang.get('701001RWCL-0004')} + } + { + !this.state.didAction + && + { + this.setState({ showcreditmodel: true, creditmodeldata: this.state.currentRowData }) + }} + > + {/*"701001RWCL-0037": "信用批准"*/} + {multiLang && multiLang.get('701001RWCL-0037')} + + } + { + !this.state.didAction + && + {multiLang && multiLang.get('701001RWCL-0005')} + } + { + !this.state.didAction + && + {multiLang && multiLang.get('701001RWCL-0006')} + } + { + !this.state.didAction + && + {multiLang && multiLang.get('701001RWCL-0007')} + } + + {/* 联查凭证 按钮*/} + { + this.state.showLinkVoucherBtn + && + { + let cRow = this.state.currentRowData + this.props.openTo('/nccloud/resources/ssctp/dooroad/linkvoucher/config/', { + appcode: '700107LCPZ', + pagecode: '700107LCPZ_list', + billid: cRow.busiid.value, + pk_group: cRow.pk_group.value, + pk_org: cRow.pk_org.value, + transtypecode: cRow.transtypecode.value + }) + }} + > + {multiLang && multiLang.get('701001RWCL-0202')} + + } + + {/* 操作记录 页签 */} + {operateAndNCPagination} + +
    + ) + + const sscreject = ( +
    + {sagaError} + {operateAndNCPagination} +
    + ) + + const handon = ( +
    + {sagaError} + {multiLang && multiLang.get('701001RWCL-0018')} + {operateAndNCPagination} +
    + ) + + const adjust = ( +
    + {sagaError} + {multiLang && multiLang.get('701001RWCL-0017')} + {operateAndNCPagination} +
    + ) + + let getBillClass = '' + if (theme === 'black') { // 暗黑主题接单css类 + getBillClass = `get-bill--black` + } else { // 其他主题接单css类 + getBillClass = `get-bill--default` + } + + const orderInnerContent = ( + getBillStatus + ? + ( + + + {this.state.orderInfo ? multiLang && multiLang.get('701001RWCL-0204') : multiLang && multiLang.get('701001RWCL-0205')} + + ) + : + ( + + + {multiLang && multiLang.get('701001RWCL-0206')} + + ) + ) + + return ( +
    + { + socket.connectMesg({ + tableAreaCode: window.presetVar.list, + billpkname: "busiid",//需要传单据的主键,不然不能显示单据追溯 + billtypeFromList: "billtypecode", + billtype: "", + onMessage: this.socketMesg, + isShowToast: false + // 本地前端调试,请传ip和端口 + // 打包到测试环境之前 去掉 + // serverLocation: "172.16.86.11:8883" + }) + } +
    +
    + {/*
    { + this.setState({ + currentKey: this.state.currentKey == 'pending' ? '66' : 'pending' + }) + } + }>666
    */} +
    + +
    + + {/*"701001RWCL-0002": "审批情况"*/} +
    + {multiLang && multiLang.get('701001RWCL-0002')} +
    +
    + +
    + +
    +
    + +
    +
    +
    + {this.state.creditLevelInfo.name} +
    +
    + {/*"701001RWCL-0036": "信用:"*/} + {multiLang && multiLang.get('701001RWCL-0036')} + {this.state.creditLevelInfo.creditlevel} +
    +
    +
    +
    +
    + {/* 出纳驳回 */} + {/* {this.state.manualReason && } */} + { + (() => { + switch (this.queryKey.taskstatus) { + case 'pending': + return pending + case 'sscreject': + return sscreject + case 'handon': + + return handon + case 'adjust': + return adjust + case 'handled': + return pending + default: + return pending + } + })() + } +
    +
    + this.auditPointBarInst = auditPointBarInst} + {...this.props} + > + + + + +
    +
    + +
    + + + + + +
    + {/* 作业任务状态 */} + + { + if (this.state.getBillStatus) { + this.getBillChange.call(this, false) + } else { + this.getBillChange.call(this, true) + } + }} + onMouseEnter={() => this.setState({ orderInfo: false })} + onMouseLeave={() => this.setState({ orderInfo: true })} + + > + {orderInnerContent} + +
    + )} + btnsClick={buttonClick.bind(this)} + currentKey={currentKey} + superBtn={( + + )} + /> +
    + +
    + {/* 查询条件 */} + { + this.onFuzzyChange.call(this, data) + }} + onFuzzySelected={this.onFuzzySelected.bind(this)} + showTypeClick={this.showTypeClick.bind(this)} + barcodeApi={requestApi.query} + queryKey={this.queryKey} + queryData={this.queryData} + queryDataCallback={this.queryDataCallback} + showCashierReject={this.state.showCashierReject} + taskTakeActionByBarCode={this.taskTakeActionByBarCode} + /> +
    +
    + {/* 列表模式 */} + {createSimpleTable(window.presetVar.list, { + pkname: tablePkName, + lazyload: false, + showIndex: true, + onRowDoubleClick: (...params) => { onRowDoubleClick.call(this, ...params) }, + sort: { + mode: 'single', + backSource: true, + sortFun: (sortParam) => { + if (sortParam[0].order == 'flatscend') { + this.queryKey.orderByInfo = []; + } else { + this.queryKey.orderByInfo = sortParam; + } + this.queryData(null, () => { + this.handleTempletAfterSort(sortParam); + }); + } + } + })} + {/*
    {multiLang && multiLang.get('701001RWCL-0062')}
    {/*"701001RWCL-0062": "滑动加载更多"*/} +
    +
    + {/* 卡片模式 */} + getDetailBtns(data, index)} + sagasButtonVisible={true} + /> + {/*
    {multiLang && multiLang.get('701001RWCL-0062')}
    {/*"701001RWCL-0062": "滑动加载更多"*/} */} +
    +
    + + {/* 操作记录 */} + this.setState({ showOperateNote: false })} + size='lg' + > + + {/*"701001RWCL-0008": "操作记录"*/} + {multiLang && multiLang.get('701001RWCL-0008')} + + + + + { + let problems = []; + if (record.problems) { + problems = record.problems.map((item, index) => { + return ( +
  • +
    + {index + 1}. {item.displayname} + + {item.serious_level_name} + +
    +
    {item.memo}
    +
  • + ) + }) + } + return problems.length ? + ( +
      + {problems} +
    + ) + : + ({multiLang && multiLang.get('7010-PROBLEM-01')}) + }} + /> + +
    +
    +
    +
    + + {/* 挂起 */} + { this.setState({ showhandonmodel: false }) }} + successHangUp={this.successHangUp} + data={this.state.handonmodeldata} + parentThis={this} + /> + {/* 取消挂起 */} + { this.setState({ showUnHandonModal: false }) }} + successUnHangUp={this.successUnHangUp} + data={this.state.unHandonModalData} + /> + + {/* 申请调整 */} + { this.setState({ showadjustmodel: false }) }} + successAdjust={this.successAdjust} + data={this.state.adjustmodeldata} + /> + {/* 取消调整 */} + { this.setState({ showUnAdjustModal: false }) }} + successUnAdjust={this.successUnAdjust} + data={this.state.unAdjustModalData} + /> + + {/* 驳回 */} + { + this.state.currentRowData.didAction = true + }} + reason={this.state.reason} + reasonOnChange={this.reasonOnChange} + /> + {/* 信用审批 */} + { + this.setState({ showcreditmodel: false, creditsArray: [] }) + }} + successCreditApproval={(ts) => { + this.state.currentRowData.ts.value = ts + this.setState({ showcreditmodel: false, didApprove: true, approveUrl: '' }, () => { + requestApi.openBill({ + data: { + billtypeCode: this.state.currentRowData.billtypecode.value, + transtypeCode: this.state.currentRowData.transtypecode.value, + billid: this.state.currentRowData.busiid.value, + pk_group: this.state.currentRowData.pk_group.value + }, + success: (data) => { + let url = data.data.url + let params = data.data.data + if (url.indexOf('#') > -1) { + if (url.indexOf('#/') > -1) { + if (url.indexOf('?') < 0) { + url += '?' + } + } + } else { + url += '#/?' + } + let approveUrl = '/nccloud/resources' + url + 'status=' + params.status + '&scene=zycl&deal=done' + for (let attr in params) { + if (attr != 'status') { + approveUrl += `&${attr}=${params[attr]}` + } + } + this.setState({ approveUrl }, () => { + pageTo.addUrlParam({ + c: params.appcode, + p: params.pagecode, + n: params.appname + }) + }) + } + }) + }) + // document.getElementById('approve-detail').contentWindow.location.reload(true) + }} + data={this.state.creditmodeldata} + creditsArray={this.state.creditsArray} + deleteCreditByIdx={this.deleteCreditByIdx} + setCheckedCredits={this.setCheckedCredits} + currentRowData={this.state.currentRowData} + reason={this.state.reason} + creditView={this.state.creditView} + creditRuleItems={this.state.creditRuleItems} + setCreditRuleItems={this.setCreditRuleItems} + /> + + + { + [...this.state.tipsInfo] + } + + +
    + ) + } +} +SscUserList = createPage({ + mutiLangCode: '7010', + appAutoFocus: true +})(SscUserList) +export default SscUserList +/*b8DESLMYZe2kOZjnZDqmEhRfChTTStWDAoDSflO4zHk=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/widgets/bzclqk/config.json b/src/ssctpaaa/sscuser/widgets/bzclqk/config.json new file mode 100644 index 0000000..9efb30f --- /dev/null +++ b/src/ssctpaaa/sscuser/widgets/bzclqk/config.json @@ -0,0 +1,4 @@ +{ + "template": "widget.html", + "hash": false +} \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/widgets/bzclqk/index.js b/src/ssctpaaa/sscuser/widgets/bzclqk/index.js new file mode 100644 index 0000000..7eff74c --- /dev/null +++ b/src/ssctpaaa/sscuser/widgets/bzclqk/index.js @@ -0,0 +1,132 @@ +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ +import React, { Component } from 'react'; +import './index.less'; +import {ajax,base,createPage, getMultiLang} from 'nc-lightapp-front' + +const { NCSelect } = base; +const NCOption = NCSelect.NCOption; + + +class Test1 extends Component { + constructor(props) { + super(props); + this.state={ + activeKey:'', + groups: [], + json: {}, + res: {} + } + } + + componentWillMount() { + + } + deal(groupid) { + if(!groupid || '' == groupid){ + return; + } + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleBzclqkWidgetAction.do', + sysAppcode: '701011BZCL', + data: {"groupid":groupid}, + loading: false, + success: (res) => { + this.setState({res: res.data}); + } + }); + } + + componentDidMount() { + let callback = (json) => { + this.setState({json}); + + ajax({ + url: '/nccloud/ssctp/sscbd/SSCTaskHandleBzclqkWidgetAction.do', + sysAppcode: '701011BZCL', + data: {}, + async: false, + loading: false, + success: (res) => { + if(res.data && res.data.groups && res.data.groups[0]){ + this.setState({groups: res.data.groups, activeKey: res.data.groups[0].groupid}); + this.deal.call(this, res.data.groups[0].groupid); + } + } + }); + + } + getMultiLang({moduleId: 7010, currentLocale: 'zh-CN',domainName: 'ssctp',callback}); + } + + selectTabChange(selectKey){ + this.setState({activeKey: selectKey}); + this.deal.call(this, selectKey); + } + render() { + return ( +
    + + + + + + + + + + + + + + +
    + {/*"701001RWCL-0029": "本周作业情况"*/} + {this.state.json['701001RWCL-0029']} + + { + this.state.activeKey + ? + ( + document.body} + > + { + this.state.groups.map(one => {one.groupname}) + } + + + ) + : + null + } +
    + {/*701001RWCL-0150:单*/} + {/*
    {(this.state.res.handleCount || '') + (this.state.json['701001RWCL-0150'] || '')}
    */} +
    {this.state.res.handleCount ? (this.state.res.handleCount + this.state.json['701001RWCL-0150']) : '--'}
    + {/*"701001RWCL-0015": "已处理"*/} +
    {this.state.json['701001RWCL-0015']}
    +
    +
    {this.state.res.avgHandleMinutes ? this.state.res.avgHandleMinutes : '--'}
    + {/*"701001RWCL-0030": "平均处理时间"*/} +
    {this.state.json['701001RWCL-0030']}
    +
    +
    {this.state.res.rank ? this.state.res.rank : '--'}
    + {/*"701001RWCL-0031": "组内排名"*/} +
    {this.state.json['701001RWCL-0031']}
    +
    +
    + ); + } +} +Test1 = createPage({ + // initTemplate: initTemplate, + // mutiLangCode: '7010' + +})(Test1) +export default Test1 +// ReactDOM.render(, document.querySelector('#app')); + +/*FDKFkr+TYgGKTTudQv9suM5TObrl0kaUnLjqLMCkTsQ=*/ \ No newline at end of file diff --git a/src/ssctpaaa/sscuser/widgets/bzclqk/index.less b/src/ssctpaaa/sscuser/widgets/bzclqk/index.less new file mode 100644 index 0000000..b0047fd --- /dev/null +++ b/src/ssctpaaa/sscuser/widgets/bzclqk/index.less @@ -0,0 +1,64 @@ +@import '~widgetsless'; + +#Operational-status { + //.title{ + // //padding: 11px 0 0 0!important; + // //font-size: 16px; + // font-family: MicrosoftYaHei; + // //color: rgba(17,17,17,1); + //} + #bzclqk-select { + .nc-select { + margin-right: 0 !important; + } + } + #bzclqk-content { + .one { + width: 108px; + padding-top: 31px; + text-align: center; + padding-left: 3px; + padding-right: 3px; + } + } + + .avg-minutes { + padding-top: 31px; + text-align: center; + padding-left: 3px; + padding-right: 3px; + width: 130px; + } + .biankuang { + width: 0; + height: 18px; + // color: rgba(151,151,151,1); + // padding-top: 14px; + margin-top: 14px; + // opacity: 0.3771; + // font-size: 18px; + border: 1px solid rgba(151, 151, 151, 0.3771); + } + .one-content { + font-size: 22px; + font-family: 'PingFangSC-Medium'; + color: #111111; + line-height: 30px; + font-weight: 500; + } + .one-title { + font-size: 13px; + font-family: MicrosoftYaHei; + color: rgba(139, 142, 149, 1); + line-height: 17px; + } + #bzclqk-select { + position: absolute; + left: 230px; + top: 10px; + } + #bzclqk-content { + display: flex; + align-items: center; + } +} diff --git a/src/ssctpaaa/sscuser/widgets/linkquery/components/card.js b/src/ssctpaaa/sscuser/widgets/linkquery/components/card.js new file mode 100644 index 0000000..44dc04b --- /dev/null +++ b/src/ssctpaaa/sscuser/widgets/linkquery/components/card.js @@ -0,0 +1,83 @@ +/*9p2K2vOAWNpnqaOIf99//g==*/ +import React, { Component } from 'react'; +import { pageTo, base } from 'nc-lightapp-front' +const { NCTabs } = base; +const NCTabPane = NCTabs.NCTabPane; +import requestApi from '../requestApi' +import urlHandle from 'ssccommon/utils/urlHandle'; +import { setPointTreeData } from 'ssccommon/components/auditPointBar/handle'; +import AuditPointBar from 'ssccommon/components/auditPointBar/AuditPointBar'; + + + +class Card extends Component { + constructor(props) { + super(props); + this.state = { + letfSrc: '', + defaultActiveKey: '', + tabs: [] + } + this.parent = this.props.parentComponent; + this.record = this.parent.state.billRecord; + this.auditPointBarInst; + } + componentDidMount() { + let iframeObj = document.getElementById('leftcard'); + iframeObj.onload = () => { + if (iframeObj.contentWindow) { + iframeObj.contentWindow.document.body.style.padding = 0; + iframeObj.contentWindow.app.style.minWidth = 'auto'; + } + } + requestApi.openBill({ + data: { + billtypeCode: this.record.billtypecode.value, + transtypeCode: this.record.tradetypecode.value, + billid: this.record.billid.value, + pk_group: this.record.pk_group.value + }, + success: (data) => { + let letfSrc = urlHandle(data, 'scene=bzcx', null, 'leftcard'); + this.setState({ + letfSrc + }, () => { + pageTo.addUrlParam({ + c: data.data.data.appcode, + p: data.data.data.pagecode, + n: data.data.data.appname, + custom: JSON.stringify({ + pk_group: this.record.pk_group.value + }) + }) + + setPointTreeData.call(this.auditPointBarInst, { billid: this.record.billid.value }); + + }) + } + }) + + } + + render() { + + return ( +
    + this.auditPointBarInst = auditPointBarInst} + queryUrl="/nccloud/ssctp/ssccheck/LinkBillQueryProblemsAction.do" + notJudgeBarHide={true} + {...this.props} + > +