| | |
| | | card.elements = card.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | card.backElements = card.backElements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | item.elements = item.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (cell.eleType === 'button') { |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | } |
| | | |
| | | return cell |
| | |
| | | }) |
| | | |
| | | if (cell.subButton) { |
| | | this.resetBtn(cell.subButton, commonId) |
| | | this.resetBtn(cell.subButton, commonId, clear) |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | } else if (item.type === 'login') { |
| | | if (clear) { |
| | | item.wrap.linkmenu = '' |
| | | } |
| | | } |
| | | |
| | | if (item.btnlog) { |
| | |
| | | item.action = item.action.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { |
| | | cell.pageTemplate = '' |
| | | cell.linkmenu = '' |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | this.resetBtn(cell, commonId, clear) |
| | | |
| | | return cell |
| | | }) |
| | |
| | | /** |
| | | * @description 按钮重置 |
| | | */ |
| | | static resetBtn (btn, commonId) { |
| | | static resetBtn (btn, commonId, clear = false) { |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) { |
| | | if (btn.modal && btn.modal.fields.length > 0) { |
| | | if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) { |
| | | btn.modal.fields = btn.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (clear) { |
| | | if (btn.pageTemplate === 'linkpage') { |
| | | btn.pageTemplate = '' |
| | | } |
| | | delete btn.linkmenu |
| | | delete btn.openmenu |
| | | delete btn.refreshTab |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | | btn.switchTab = btn.switchTab.map(m => md5(commonId + m)) |
| | | } |
| | |
| | | btn.anchors = btn.anchors.map(m => md5(commonId + m)) |
| | | } |
| | | if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { |
| | | if (btn.syncComponents[0] && Array.isArray(btn.syncComponents[0])) { |
| | | btn.syncComponents = btn.syncComponents.map((item, i) => { |
| | | return { |
| | | syncComId: item, |
| | | label: '', |
| | | uuid: 'fixed' + i |
| | | } |
| | | }) |
| | | } |
| | | btn.syncComponents = btn.syncComponents.map(m => { |
| | | m.syncComId = m.syncComId.map(n => { |
| | | if (/\$focus/.test(n)) { |
| | |
| | | |
| | | return md5(commonId + m) |
| | | }) |
| | | } |
| | | |
| | | if (btn.OpenType === 'popview' && btn.config && btn.config.components) { |
| | | btn.config.components = this.resetConfig(btn.config.components, commonId) |
| | | } |
| | | } |
| | | |
| | |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | card.backElements = card.backElements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | item.elements = item.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | col.elements = col.elements.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.eleType === 'button') { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | } |
| | | return cell |
| | | }) |
| | |
| | | } |
| | | item.action = item.action.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | |
| | | return cell |
| | | }) |
| | |
| | | }) |
| | | } |
| | | let emptys = [] |
| | | if (cell.Ot !== 'notRequired') { |
| | | forms.push(...columns) |
| | | } |
| | | |
| | | cell.verify.uniques.forEach(m => { |
| | | if (m.status === 'false') return |
| | | |
| | |
| | | }) |
| | | |
| | | if (emptys.length) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单中不存在!`}) |
| | | if (cell.Ot === 'notRequired') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单中不存在!`}) |
| | | } else { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单与字段集中不存在!`}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (cell.OpenType === 'form' && cell.formType === 'count_line') return |
| | | |
| | | if (cell.intertype === 'system') { |
| | | if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | } |
| | | // if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // } |
| | | } else if (cell.intertype === 'custom' || cell.intertype === 'outer') { |
| | | if (cell.callbackType === 'script' && (!cell.verify || !cell.verify.cbScripts || cell.verify.cbScripts.filter(item => item.status !== 'false').length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义脚本回调,回调脚本不可为空!`}) |
| | | } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | } |
| | | } |
| | | } else if (cell.OpenType === 'funcbutton') { |
| | |
| | | GOTO_RETURN: |
| | | ROLLBACK TRAN` |
| | | |
| | | let filterComponent = (components, mainSearch, label = '') => { |
| | | let filterComponent = (components, mainSearch, label = '', ispop) => { |
| | | components.forEach(item => { |
| | | item.$menuname = (config.MenuName || '') + label + '-' + (item.name || '') |
| | | |
| | | if (item.type === 'tabs') { |
| | | if (config.Template === 'BaseTable') { |
| | | item.subtabs.forEach(tab => { |
| | | if (tab.permission !== 'true' && tab.components[0] && tab.components[0].wrap) { |
| | | tab.components[0].wrap.permission = 'false' |
| | | } |
| | | }) |
| | | } |
| | | item.subtabs.forEach(tab => { |
| | | let _mainSearch = mainSearch || [] |
| | | |
| | |
| | | _mainSearch = com.search || [] |
| | | }) |
| | | } |
| | | filterComponent(tab.components, _mainSearch, label) |
| | | |
| | | filterComponent(tab.components, _mainSearch, label, ispop) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | filterComponent(item.components, mainSearch, label) |
| | | filterComponent(item.components, mainSearch, label, ispop) |
| | | } else { |
| | | if (item.wrap && item.setting) { |
| | | if (item.wrap.datatype === 'public' || item.wrap.datatype === 'static') { |
| | |
| | | roleId = '' |
| | | } else if (item.setting.database === 'sso') { |
| | | roleId = '' |
| | | } else if (ispop) { |
| | | roleId = '' |
| | | } |
| | | |
| | | sqls.push({uuid: item.uuid, roleId: roleId, type: 'datasource', ...msg}) |
| | |
| | | item.action && item.action.forEach(cell => { |
| | | if (cell.hidden === 'true') return false |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | |
| | | if (item.type === 'table') { |
| | |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | } else if (item.subtype === 'editable' && col.editable === 'true') { |
| | | if (col.editType === 'select' && col.resourceType === '1') { |
| | |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | |
| | | card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell, true) |
| | | resetButton(item, cell, true, ispop) |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(group => { |
| | |
| | | fields: group.fields |
| | | } |
| | | |
| | | resetButton(item, group.subButton) |
| | | resetButton(item, group.subButton, false, ispop) |
| | | }) |
| | | } else if (item.type === 'module' && item.subtype === 'invoice') { |
| | | if (item.buyer.setting && item.buyer.setting.interType === 'system') { |
| | |
| | | }) |
| | | } |
| | | |
| | | let resetButton = (item, cell, isback) => { |
| | | let resetButton = (item, cell, isback, ispop) => { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | let roleId = cell.uuid |
| | | if (item.wrap && item.wrap.permission === 'false') { |
| | |
| | | } else if (cell.hidden === 'true' || cell.permission === 'false') { |
| | | roleId = '' |
| | | } else if (cell.database === 'sso') { |
| | | roleId = '' |
| | | } else if (ispop) { |
| | | roleId = '' |
| | | } |
| | | |
| | |
| | | } else if (form.type === 'popSelect') { |
| | | let msg = getPopSelectSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } else if (form.type === 'popSelect') { |
| | | let msg = getPopSelectSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent(cell.config.components, _mainSearch, '-' + cell.label) |
| | | let label = (item.name ? '-' + item.name : '') + '-' + cell.label |
| | | |
| | | filterComponent(cell.config.components, _mainSearch, label, true) |
| | | } |
| | | } |
| | | } |
| | |
| | | if (formdata && verify.billcodes && verify.billcodes.length > 0) { |
| | | verify.billcodes.forEach(item => { |
| | | let _key = item.field.toLowerCase() |
| | | let _linkKey = item.linkField ? item.linkField.toLowerCase() : '' |
| | | |
| | | if (!formkeys.includes(_key)) return // 表单中不含单号生成字段 |
| | | |
| | | let _lpline = '' |
| | | if (item.TypeCharOne === 'Lp') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` |
| | | } |
| | | } else if (item.TypeCharOne === 'BN') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)` |
| | | } |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)` |
| | |
| | | let _val2 = '' |
| | | |
| | | arr.push(_key) |
| | | if (_key === 'bid') { // 表单中没有bid则使用系统bid变量 |
| | | if (_key === 'bid') { |
| | | _val = BID |
| | | } else { |
| | | _val = `'@mk_${_key}_mk@'` |
| | | // _val = `'@mk_${_key}_mk@'` |
| | | _val = `@${_field}` |
| | | } |
| | | |
| | | _fieldValue.push(`${_key}=${_val}`) |
| | | |
| | | if (_key === 'bid') { // 表单中没有bid则使用系统bid变量 |
| | | if (_key === 'bid') { |
| | | _val2 = `' + ${BID} + '` |
| | | } else { |
| | | _val2 = `@mk_${_key}_mk@` |
| | | // _val2 = `@mk_${_key}_mk@` |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | | |
| | | _value.push(`${_labels[index] || ''}:${_val2}`) |
| | | }) |
| | | |
| | | if (!arr.includes(primaryKey.toLowerCase())) { |
| | | if (!arr.includes(primaryKey.toLowerCase()) && btn.Ot !== 'notRequired') { |
| | | _fieldValue.push(`${primaryKey} !=${primaryId}`) |
| | | } |
| | | |
| | |
| | | let hasvoucher = false |
| | | |
| | | // 凭证-显示列中选取,必须选行 |
| | | if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | let _voucher = verify.voucher |
| | | let linkField = `@${_voucher.linkField}` |
| | | |
| | | if (/^BID$/ig.test(_voucher.linkField)) { |
| | | linkField = BID |
| | | } |
| | | |
| | | hasvoucher = true |
| | | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill ='0', |
| | | @Bill = ${linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | if @works_flow_countersign@ = 'Y' |
| | | begin |
| | |
| | | } else if (['mk_address'].includes(s)) { |
| | | decSql.push(`@mk_address nvarchar(100)`) |
| | | } else if (['mk_deleted'].includes(s)) { |
| | | secSql.push(`@mk_deleted int`) |
| | | decSql.push(`@mk_deleted int`) |
| | | } else { |
| | | decSql.push(`@${s} nvarchar(50)`) |
| | | } |
| | |
| | | let DateCount = '' |
| | | if (_dataresource) { |
| | | /*system_query*/ |
| | | if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql)) { |
| | | if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql) || (item.wrap && item.wrap.tree === 'true')) { |
| | | LText = `select ${arr_field} from ${_dataresource} ${_search} ` |
| | | } else if (item.setting.laypage === 'true' && item.setting.order) { |
| | | LText = `select top @pageSize@ ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable where rows > @pageSize@ * (@pageIndex@ - 1) order by tmptable.rows ` |
| | |
| | | sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | |
| | | |
| | | filterComponent(config.components, _mainSearch) |
| | | |
| | | let keys = sqls.map(item => item.uuid) |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | if (window.backend) { |
| | | let m = new Map() |
| | | let n = new Map() |
| | | sqls.forEach(item => { |
| | | if (m.has(item.uuid)) { |
| | | if (!n.has(item.uuid)) { |
| | | window.mkInfo(m.get(item.uuid)) |
| | | n.set(item.uuid, true) |
| | | } |
| | | window.mkInfo(item) |
| | | } else { |
| | | m.set(item.uuid, item) |
| | | } |
| | | }) |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在重复的后端脚本ID!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | return [] |
| | | } |
| | | |
| | | return sqls |
| | | } |