| | |
| | | dataM: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '', |
| | | ID: orderId |
| | | } |
| | | } else if (window.backend && window.GLOB.CacheData.has('sql_' + btn.uuid)) { |
| | | param = this.getbackParam(orderId, data) |
| | | } else if (btn.payMode === 'system') { |
| | | let sql = this.getSysDeclareSql(orderId, data) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | getbackParam = (ID, data) => { |
| | | const { columns, btn, BID } = this.props |
| | | |
| | | let ex = window.GLOB.CacheData.get('sql_' + btn.uuid) |
| | | let exps = [] |
| | | let values = { |
| | | time_id: Utils.getguid(), |
| | | roleid: sessionStorage.getItem('role_id') || '', |
| | | mk_departmentcode: sessionStorage.getItem('departmentcode') || '', |
| | | mk_organization: sessionStorage.getItem('organization') || '', |
| | | mk_user_type: sessionStorage.getItem('mk_user_type') || '', |
| | | mk_nation: sessionStorage.getItem('nation') || '', |
| | | mk_province: sessionStorage.getItem('province') || '', |
| | | mk_city: sessionStorage.getItem('city') || '', |
| | | mk_district: sessionStorage.getItem('district') || '', |
| | | mk_address: sessionStorage.getItem('address') || '', |
| | | id: ID || '', |
| | | bid: BID || '', |
| | | typename: 'admin', |
| | | datam: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '', |
| | | datam_begin: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '', |
| | | datam_end: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '', |
| | | } |
| | | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | values.db = window.GLOB.externalDatabase |
| | | } |
| | | |
| | | ex.reps.forEach(n => { |
| | | let key = n.toLowerCase() |
| | | if (values.hasOwnProperty(key)) { |
| | | exps.push({ |
| | | key: n, |
| | | value: values[key] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | let _data = {} |
| | | Object.keys(data).forEach(key => { |
| | | _data[key.toLowerCase()] = data[key] |
| | | }) |
| | | |
| | | columns.forEach(col => { |
| | | if (!ex.reps.includes(col.field)) return |
| | | if (!col.datatype) return |
| | | |
| | | let _key = col.field.toLowerCase() |
| | | let _val = _data.hasOwnProperty(_key) ? _data[_key] : '' |
| | | |
| | | if (/^date/ig.test(col.datatype) && !_val) { |
| | | _val = '1949-10-01' |
| | | } |
| | | |
| | | exps.push({ |
| | | key: 'mk_' + col.field + '_mk', |
| | | value: _val |
| | | }) |
| | | }) |
| | | |
| | | let md5_id = '' |
| | | if (window.GLOB.probation) { |
| | | md5_id = md5(ex.id + JSON.stringify(exps) + Math.floor(new Date().getTime() / 600000)) |
| | | md5_id = moment().format('YYYYMMDDHHmmss') + md5_id.slice(-18) |
| | | } |
| | | |
| | | return { |
| | | $backend: true, |
| | | data: [{ |
| | | id: ex.id, |
| | | exps: exps, |
| | | menuname: btn.logLabel || '', |
| | | md5_id: md5_id |
| | | }] |
| | | } |
| | | } |
| | | |
| | | getSysDeclareSql = (ID, data) => { |
| | | const { columns, btn, BID } = this.props |
| | | |