king
2024-10-25 f9455c981f94d5fd89103b1d332baefd039bebb2
src/utils/utils-custom.js
@@ -3100,8 +3100,14 @@
          item.setting.$name = item.$menuname || ''
          let msg = getDataSource(item, mainSearch)
          let roleId = config.uuid
          if (item.wrap && item.wrap.permission === 'false') {
            roleId = ''
          } else if (item.setting.database === 'sso') {
            roleId = ''
          }
          sqls.push({uuid: item.uuid, type: 'datasource', ...msg})
          sqls.push({uuid: item.uuid, roleId: roleId, type: 'datasource', ...msg})
        } else if (item.setting && item.setting.useMSearch === 'true') {
          let searches = item.search || []
          if (mainSearch.length > 0) {
@@ -3196,13 +3202,17 @@
            resetButton(item, group.subButton)
          })
        } else if (item.type === 'module' && item.subtype === 'invoice') {
          let msg = getDataSource(item.buyer, [])
          sqls.push({uuid: item.uuid + 'buyer', type: 'datasource', ...msg})
          if (item.buyer.setting && item.buyer.setting.interType === 'system') {
            let msg = getDataSource(item.buyer, [])
            sqls.push({uuid: item.uuid + 'buyer', type: 'datasource', ...msg})
          }
          let _msg = getDataSource(item.detail, [])
          sqls.push({uuid: item.uuid + 'detail', type: 'datasource', ..._msg})
          if (item.detail.setting && item.detail.setting.interType === 'system') {
            let _msg = getDataSource(item.detail, [])
            sqls.push({uuid: item.uuid + 'detail', type: 'datasource', ..._msg})
          }
          let btnmsg = getInvoicePreSql(item.billSaveBtn, item.$menuname + '-' + item.billSaveBtn.label)
@@ -3222,6 +3232,14 @@
  let resetButton = (item, cell, isback) => {
    cell.logLabel = item.$menuname + '-' + cell.label
    let roleId = cell.uuid
    if (item.wrap && item.wrap.permission === 'false') {
      roleId = ''
    } else if (cell.hidden === 'true' || cell.permission === 'false') {
      roleId = ''
    } else if (cell.database === 'sso') {
      roleId = ''
    }
    if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) {
      if (cell.intertype === 'system' || cell.procMode === 'system') { // 系统接口
@@ -3235,11 +3253,11 @@
          let msg = getSysDefaultSql(cell, _item)
          sqls.push({uuid: cell.uuid, type: 'button', ...msg})
          sqls.push({uuid: cell.uuid, roleId: roleId, type: 'button', ...msg})
        } else {
          let msg = getSysDefaultSql(cell, item)
          sqls.push({uuid: cell.uuid, type: 'button', ...msg})
          sqls.push({uuid: cell.uuid, roleId: roleId, type: 'button', ...msg})
        }
      }
      if (cell.callbackType === 'script' && cell.verify && cell.verify.cbScripts) {
@@ -3274,20 +3292,30 @@
      if (cell.intertype === 'system') {
        let msg = getExcelInSql(cell)
        sqls.push({uuid: cell.uuid, type: 'excelIn', ...msg})
        sqls.push({uuid: cell.uuid, roleId: roleId, type: 'excelIn', ...msg})
      }
    } else if (cell.OpenType === 'excelOut') {
      if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') {
        let msg = getExcelOutSql(cell, item)
        sqls.push({uuid: cell.uuid, type: 'excelOut', ...msg})
        sqls.push({uuid: cell.uuid, roleId: roleId, type: 'excelOut', ...msg})
      } else if (cell.intertype === 'system' && cell.verify && item.setting && item.setting.interType === 'system') {
        if (appType === 'mob') {
          cell.pagination = 'false'
        }
        if (item.subtype === 'dualdatacard' || item.setting.laypage !== cell.pagination) {
          let msg = getDoubleExcelOutSql(cell, item)
          sqls.push({uuid: cell.uuid, roleId: roleId, type: 'excelOut', ...msg})
        }
      }
    } else if (cell.OpenType === 'funcbutton') {
      if (cell.funcType === 'print') {
        if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') {
          let msg = getPrintSql(cell, item)
  
          sqls.push({uuid: cell.uuid, type: 'print', ...msg})
          sqls.push({uuid: cell.uuid, roleId: roleId, type: 'print', ...msg})
        }
        if (cell.execMode === 'pop' && cell.modal && cell.modal.fields) {
          cell.modal.fields.forEach(form => {
@@ -3306,13 +3334,13 @@
      } else if ((cell.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system') {
        let msg = getPaySql(cell, item)
        sqls.push({uuid: cell.uuid, type: 'pay', ...msg})
        sqls.push({uuid: cell.uuid, roleId: roleId, type: 'pay', ...msg})
      }
    } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') {
      if (cell.pageTemplate === 'pay' && cell.payMode === 'system') {
        let msg = getPaySql(cell, item)
        sqls.push({uuid: cell.uuid, type: 'pay', ...msg})
        sqls.push({uuid: cell.uuid, roleId: roleId, type: 'pay', ...msg})
      }
    } else if (cell.OpenType === 'popview') {
      if (cell.config && cell.config.components) {
@@ -4099,11 +4127,11 @@
          begin
              /* 工作流默认sql(或签) */
              set @retmsg =''
              select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@
              select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ and works_flow_detail_id =@works_flow_detail_id@
              if @retmsg =''
              begin
                  select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@
                  select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@ and works_flow_detail_id =@works_flow_detail_id@
                  if @retmsg !=''
                  begin
@@ -4113,18 +4141,31 @@
                  if @dataM@ !='' 
                  begin
                      set @retmsg =''
                      select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0
                    set @retmsg =''
                    select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id@
                      if @retmsg != ''
                    if @retmsg != ''
                    begin
                        goto goto_mk
                    end
                  end
                  else
                  begin
                      set @retmsg =''
                      select @retmsg=userid from s_my_works_flow_role where works_flow_id=@id@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id@
                      if @retmsg !=''
                      begin
                          goto goto_mk
                          select @retmsg=workerCode+workerName from BD_workers where id=@retmsg
                          select @retmsg='页面数据已更新,或没有当前单据的审批权限,请联系'+@retmsg+'操作'
                          goto aaa
                      end
                  end
                  select @retmsg='页面数据已更新,或没有当前单据的审批权限'
                  goto aaa 
              end
              end
              goto_mk:
@@ -4662,8 +4703,6 @@
  }
  let getDataSource = (item, mainSearch = [], type) => {
    if (!item.setting || item.setting.interType !== 'system') return
    let searches = item.search || []
    if (item.setting.useMSearch === 'true' && mainSearch.length > 0) {
      searches = [...searches, ...mainSearch]
@@ -4714,7 +4753,7 @@
      _search = ''
    }
    if (/\s/.test(_dataresource)) {
    if (/\s/.test(_dataresource) && !/\)\s+tb$/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
@@ -5548,6 +5587,23 @@
    return msg
  }
  let getDoubleExcelOutSql = (btn, component) => {
    let item = fromJS(component).toJS()
    item.search = item.$searches || []
    if (item.subtype === 'dualdatacard') {
      item.columns = [...item.columns, ...item.subColumns]
    }
    item.subtype = 'datacard'
    item.setting.laypage = btn.pagination
    item.setting.$name = btn.logLabel || ''
    let msg = getDataSource(item, [])
    return msg
  }
  let getPrintSql = (btn, component) => {
    let item = {setting: {}, columns: btn.verify.columns || [], search: [], useMSearch: 'false'}