1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433 |
- mod.definePage('workflow/metas/js/approve', function (waf, wfCommonUtil) {
- var _public = {},
- _private = {},
- me = _self
- var okPolicy = new Array()
- var noPolicy = new Array()
- var assign = {}
- var selnextPersons = {}
- var transId = null
- var locationurl = waf.getUrlParams(document.location.href)
- var approvetype = locationurl.type
- var passId = locationurl.passid
- var sourceIDs = locationurl.sourceIDs
- var msgId = locationurl.msgId
- var showerror = ''
- var nextActIndex = '#nextAct'
- var approveOpinions = {}
- var isFirst = true
- var approvePolicy = {}
- var riskInsight = false
- var billInsightOption = {}
- var caConfig = {
- caConfigInfo: null,
- rootDiv: null,
- CA_plainText: null,
- CA_signature: null,
- plainTextMap: null,
- plainSignatureMap: null
- }
- waf.extend(_public, {
- submit: function (event, value) {
- return _private.submit(event, value)
- },
- save: function (event, value) {
- return _private.save(event, value)
- },
- deliver: function (event, value) {
- return _private.deliver(event, value)
- },
- passAssignment: function (event, value) {
- return _private.passAssignment(event, value)
- },
- kickback: function (event, value) {
- return _private.kickback(event, value)
- },
- appendActivity: function (event, value) {
- return _private.appendActivity(event, value)
- },
- dynamicSign: function (event, value) {
- return _private.dynamicSign(event, value)
- },
- jumpto: function (event, value) {
- return _private.jumpto(event, value)
- },
- viewProcessDiagram: function (event, value) {
- return _private.viewProcessDiagram(event, value)
- },
- billImage: function (event, value) {
- return _private.billImage(event, value)
- },
- bill: function (event, value) {
- return _private.bill(event, value)
- },
- showoperate: function (event, value) {
- return _private.showoperate(event, value)
- },
- nextActs: function (event, ui) {
- return _private.nextActs(event, ui)
- },
- modifynextActs: function (event, value) {
- return _private.modifynextActs(event, value)
- },
- changePolicy: function (event, ui) {
- return _private.changePolicy(event, ui)
- },
- changeselPolicy: function (event, ui) {
- return _private.changeselPolicy(event, ui)
- },
- myPhrase: function (event, value) {
- return _private.myPhrase(event, value)
- },
- openPerson: function (event, value) {
- return _private.openPerson(event, value)
- },
- esignatureOnClick: function (event, ui) {
- return _private.esignatureOnClick(event, ui)
- },
- nextAct: function (event, ui) {
- return _private.nextAct(event, ui)
- },
- modifynextAct: function (event, value) {
- return _private.modifynextAct(event, value)
- },
- pageOnload: function (e) {
- return _private.pageOnload(e)
- },
- pageOnRenderBefore: function (e) {
- return _private.pageOnRenderBefore(e)
- },
- phrasedel: function (e) {
- return _private.phrasedel(e)
- },
- phrasesure: function (e) {
- return _private.phrasesure(e)
- },
- addphrase: function (e) {
- return _private.addphrase(e)
- },
- phraseback: function (e) {
- return _private.phraseback(e)
- },
- phraseadd: function (e) {
- return _private.phraseadd(e)
- },
- reloadTranId: function () {
- return _private.reloadTranId()
- },
- getnextacts: function () {
- return _private.getnextacts()
- },
- showtab: function () {
- return _private.showtab()
- },
- setmanualdecision: function () {
- return _private.setmanualdecision()
- },
- setmodifynextAct: function () {
- return _private.setmodifynextAct()
- },
- getbatchlist: function () {
- return _private.getbatchlist()
- },
- displayBillInfo: function (url) {
- return _private.displayBillInfo(url)
- },
- getPolicy: function (approveValueStr) {
- return _private.getPolicy(approveValueStr)
- },
- setPolicy: function (val) {
- return _private.setPolicy(val)
- },
- isNeedDefaultOption: function (vals) {
- return _private.isNeedDefaultOption(vals)
- },
- setsendmailormsg: function (
- isOpenMessageSendOnUI,
- notifyNextBySMS,
- notifyNextByMail
- ) {
- return _private.setsendmailormsg(
- isOpenMessageSendOnUI,
- notifyNextBySMS,
- notifyNextByMail
- )
- },
- resizePage: function () {
- return _private.resizePage()
- },
- showapprovehis: function (procInstId) {
- return _private.showapprovehis(procInstId)
- },
- showbtn: function () {
- return _private.showbtn()
- },
- setselnextperson: function (actId, name, id) {
- return _private.setselnextperson(actId, name, id)
- },
- loadNextActs: function () {
- return _private.loadNextActs()
- },
- getOpinion: function (actInstId, assignId, billId) {
- return _private.getOpinion(actInstId, assignId, billId)
- },
- getphrase: function () {
- return _private.getphrase()
- },
- setselnextactperson: function (resultStr) {
- return _private.setselnextactperson(resultStr)
- },
- shownextActs: function (nextactname, ui) {
- return _private.shownextActs(nextactname, ui)
- },
- passComentsubmit: function () {
- return _private.passComentsubmit()
- },
- initCAConfig: function (tCAConfig) {
- return _private.initCAConfig(tCAConfig)
- },
- batchSubmitForCA: function () {
- return _private.batchSubmitForCA()
- },
- checkCAPassword: function (isBatch) {
- return _private.checkCAPassword(isBatch)
- },
- batchSubmit: function () {
- return _private.batchSubmit()
- },
- getbatchid: function () {
- return _private.getbatchid()
- },
- _batchsubmit: function (info) {
- return _private._batchsubmit(info)
- },
- getApprove: function () {
- return _private.getApprove()
- },
- beforeBatchSubmitSigature: function (selectBillIds) {
- return _private.beforeBatchSubmitSigature(selectBillIds)
- },
- getNextPersons: function (isSave) {
- return _private.getNextPersons(isSave)
- },
- manualdecisionsubmit: function () {
- return _private.manualdecisionsubmit()
- },
- beforeInnerSubmit: function () {
- return _private.beforeInnerSubmit()
- },
- innerSubmit: function () {
- return _private.innerSubmit()
- },
- _submit: function (isReadOnly) {
- return _private._submit(isReadOnly)
- },
- beforeSubmitSigature: function () {
- return _private.beforeSubmitSigature()
- },
- toDecimal: function (src, pos) {
- return _private.toDecimal(src, pos)
- },
- checkIsSave: function (callback, type) {
- return _private.checkIsSave(callback, type)
- },
- _save: function (isReadOnly) {
- return _private._save(isReadOnly)
- },
- backto: function () {
- return _private.backto()
- },
- addUploadHtml: function () {
- return _private.addUploadHtml()
- },
- getAttchmentcount: function () {
- return _private.getAttchmentcount()
- },
- selattachment: function (item, attcreater, beizhu) {
- return _private.selattachment(item, attcreater, beizhu)
- },
- attachmentDelete: function (item, id) {
- return _private.attachmentDelete(item, id)
- },
- attachmentView: function (id, type) {
- return _private.attachmentView(id, type)
- },
- isWaf1Bill: function (url) {
- return _private.isWaf1Bill(url)
- },
- messageDigest: function () {
- return _private.messageDigest()
- },
- jMessageAlert: function (message) {
- return _private.jMessageAlert(message)
- },
- onselect: function (event, ui) {
- return _private.onselect(event, ui)
- },
- addphrase: function () {
- return _private.addphrase()
- },
- openAttachmentPage: function (event, value) {
- return _private.openAttachmentPage(event, value)
- },
- getAssignInfo: function () {
- return _private.getAssignInfo()
- }
- })
- _self.subscribeEvent('pageOnLoadEvent', _public.pageOnload, 'after')
- _self.subscribeEvent(
- 'pageOnRenderEvent',
- _public.pageOnRenderBefore,
- 'before'
- )
- _self.subscribeEvent('phrasedelActionEvent', _public.phrasedel, 'overwrite')
- _self.subscribeEvent('phrasesureActionEvent', _public.phrasesure, 'overwrite')
- _self.subscribeEvent('phrasebackActionEvent', _public.phraseback, 'overwrite')
- _self.subscribeEvent('phraseaddActionEvent', _public.phraseadd, 'overwrite')
- waf.extend(_private, {
- modifyNextAct: '#modifynextAct',
- charFrameId: 'predictionChartIframe',
- curTab: '',
- leftPanelWidth: '',
- rightPanelWidth: '',
- isPredict: true,
- displayBillInfo: function (url) {
- if (assign.attachmentMode) {
- if (!url.endsWith('nobill.html')) {
- url += '&hasAttachment=false'
- }
- }
- waf('#billFrame').wafIframe('option', 'src', url)
- },
- getPolicy: function (approveValueStr) {
- if (approveValueStr == null || approveValueStr == '') {
- approveValueStr =
- '0;' +
- _self._localeStr.WEB_AGREE +
- ';' +
- _self._localeStr.WEB_AGREE +
- ';:1;' +
- _self._localeStr.WEB_DISAGREE +
- ';' +
- _self._localeStr.WEB_DISAGREE +
- ';'
- }
- var strs = approveValueStr.split(':')
- for (var i = 0; i < strs.length; i++) {
- var strTemp = strs[i].split(';')
- var key = strTemp[0]
- var text = strTemp[1]
- var type = strTemp.length == 2 ? _self._localeStr.WEB_ALL : strTemp[2]
- var line = strTemp.length < 4 ? '' : strTemp[3]
- var o = {}
- o.alias = text
- o.value = key
- if (
- 'agree' == type ||
- type == _self._localeStr.WEB_AGREE ||
- '同意' == type
- ) {
- okPolicy.push(o)
- } else {
- if (
- 'disagree' == type ||
- type == _self._localeStr.WEB_DISAGREE ||
- '不同意' == type
- ) {
- noPolicy.push(o)
- } else {
- if (
- 'all' == type ||
- type == _self._localeStr.WEB_ALL ||
- '全部' == type
- ) {
- okPolicy.push(o)
- noPolicy.push(o)
- }
- }
- }
- }
- },
- setPolicy: function (val) {
- if (val == 'true') {
- if (isFirst) {
- isFirst = false
- } else {
- approveOpinions.disagree = $('#approveOpinion').val()
- approvePolicy.disagree = waf('#policy').wafSelect('getValue')
- }
- if (approvePolicy.agree) {
- waf('#policy').wafSelect('setValue', approvePolicy.agree)
- }
- $('#approveOpinion').val(approveOpinions.agree)
- waf('#policy').wafSelect('option', 'enumSource', okPolicy)
- } else {
- if (isFirst) {
- isFirst = false
- } else {
- approveOpinions.agree = $('#approveOpinion').val()
- approvePolicy.agree = waf('#policy').wafSelect('getValue')
- }
- if (approvePolicy.disagree) {
- waf('#policy').wafSelect('setValue', approvePolicy.disagree)
- }
- $('#approveOpinion').val(approveOpinions.disagree)
- waf('#policy').wafSelect('option', 'enumSource', noPolicy)
- }
- _private.reloadTranId()
- if (waf(nextActIndex).wafCheckbox('isChecked')) {
- _private.loadNextActs()
- }
- },
- isNeedDefaultOption: function (vals) {
- if (assign.isNeedDefaultOption) {
- waf('#approveOpinion').val(vals)
- }
- if (assign.defaultOpinion != null && assign.defaultOpinion != '') {
- waf('#approveOpinion').val(assign.defaultOpinion)
- }
- },
- getDefaultOption: function (vals) {
- if (assign.isNeedDefaultOption) {
- approveOpinions = {
- agree: _self._localeStr.WEB_AGREE,
- disagree: _self._localeStr.WEB_DISAGREE
- }
- }
- if (assign.defaultOpinion != null && assign.defaultOpinion != '') {
- approveOpinions = {
- agree: assign.defaultOpinion,
- disagree: assign.defaultOpinion
- }
- }
- },
- setsendmailormsg: function (
- isOpenMessageSendOnUI,
- notifyNextBySMS,
- notifyNextByMail
- ) {
- waf('#issendmsgormail').wafPanel(
- 'option',
- 'hidden',
- !isOpenMessageSendOnUI
- )
- waf('#sendmsg').wafCheckbox('option', 'hidden', !isOpenMessageSendOnUI)
- waf('#sendmail').wafCheckbox('option', 'hidden', !isOpenMessageSendOnUI)
- waf('#sendmsg').wafCheckbox('setChecked', notifyNextBySMS)
- waf('#sendmail').wafCheckbox('setChecked', notifyNextByMail)
- },
- resizePage: function () {
- var rightwidth = Math.ceil((300 / window.innerWidth) * 100)
- if (window.screen.width <= 1366) {
- rightwidth = 21
- }
- var leftwidth = 100 - rightwidth
- waf('#splitPanel').wafSplitPanel('option', {
- split: false,
- leftWidth: leftwidth,
- rightWidth: rightwidth
- })
- var billHeightOffset = 220
- var tabOffset = 100
- if (assign.newPage && approvetype == 'approve') {
- billHeightOffset = 160
- tabOffset = 155
- }
- if (approvetype != 'approve') {
- billHeightOffset -= 120
- }
- $('#tabs .ui-waftabs-panel')
- .eq(0)
- .height(window.innerHeight - tabOffset)
- if (approvetype == 'batchapprove') {
- if (assign.batchApproveUrl) {
- var times = 0
- waf('#billFrame').wafIframe(
- 'option',
- 'height',
- window.innerHeight - 100
- )
- var interval = setInterval(function () {
- try {
- window.frames.billFrame
- .$('#gview_queryGrid .ui-jqgrid-bdiv')
- .eq(0)
- .css('height', window.innerHeight - 220)
- if (times > 4) {
- clearInterval(interval)
- }
- times++
- } catch (e) {}
- }, 500)
- waf('#billFrame').wafIframe('option', 'scrolling', 'auto')
- } else {
- $('#gview_queryGrid .ui-jqgrid-bdiv').height(
- $('#tabs').height() - 100
- )
- $('#gview_queryGrid .ui-jqgrid-bdiv').css('overflow-y', 'auto')
- $('#panel5 .ui-jqgrid').height($('#tabs').height())
- }
- } else {
- if (assign.messageDigest) {
- $('#panel5').css({
- height: window.innerHeight - billHeightOffset,
- 'overflow-y': 'auto',
- 'overflow-x': 'hidden'
- })
- $('#bill_content').css({
- height: window.innerHeight - billHeightOffset,
- overflow: 'auto'
- })
- } else {
- waf('#billFrame').wafIframe(
- 'option',
- 'height',
- window.innerHeight - billHeightOffset
- )
- waf('#billFrame').wafIframe('option', 'scrolling', 'auto')
- }
- }
- if (assign.absStr || assign.decisionDesc) {
- _private.changeBillHeight(90, false)
- }
- if (approvetype == 'batchapprove' || approvetype == 'approve') {
- $('#myPhraseList .scrollhid').height($('#approveTask').height() - 100)
- }
- },
- changeBillHeight: function (height, isClose) {
- var billHeight = 0
- if (assign.messageDigest) {
- billHeight = $('#panel5').height()
- } else {
- billHeight = waf('#billFrame').wafIframe('option', 'height')
- }
- if (isClose) {
- billHeight += height
- } else {
- billHeight -= height
- }
- if (assign.messageDigest) {
- $('#panel5').css({ height: billHeight, 'overflow-y': 'auto' })
- } else {
- waf('#billFrame').wafIframe('option', 'height', billHeight)
- waf('#billFrame').wafIframe('option', 'scrolling', 'auto')
- }
- },
- showapprovehis: function (procInstId) {
- var params = {}
- params.embed = 'true'
- params.proInstId = procInstId
- waf.doPost({
- url: waf.getContextPath() + '/flowRelated.do?method=getFlowRealted',
- data: params,
- success: function (data) {
- var _html = ''
- for (var i = 0; i < data.length; i++) {
- var action = data[i].action
- var node = data[i].node
- if (node == null) {
- node = ''
- }
- var operatorResult = data[i].operatorResult
- if (operatorResult == '' || operatorResult == null) {
- operatorResult = action
- }
- var op = ''
- var operatorOpinion = data[i].operatorOpinion
- if (operatorOpinion == '' || operatorOpinion == null) {
- operatorOpinion = ''
- }
- var classname = 'agree'
- var type = data[i].type
- var titlename = ''
- if (type == 9 || type == 10) {
- var operatorResults = operatorResult.split(',')
- if (operatorResults.length == 2) {
- op +=
- '<span title=' +
- _self._localeStr.WEB_APPROVALRESULTS +
- '>' +
- _self._localeStr.WEB_APPROVALRESULTS +
- ":</span><span title='" +
- operatorResults[0] +
- "'>" +
- operatorResults[0] +
- '</span><br/>'
- op +=
- '<span title=' +
- _self._localeStr.WEB_HANDLEROPINIONS +
- '>' +
- _self._localeStr.WEB_HANDLEROPINIONS +
- ":</span><span title='" +
- operatorResults[1] +
- "'>" +
- operatorResults[1] +
- '</span><br/>'
- if (
- operatorResults[0] == _self._localeStr.WEB_DISAGREE ||
- operatorResults[0] == 'Disagree'
- ) {
- classname = 'disagree'
- }
- } else {
- op +=
- "<span title='" +
- operatorResult +
- "'>" +
- operatorResult +
- '</span><br/>'
- }
- titlename = _self._localeStr.WEB_APPROVALCOMMENTS
- } else {
- op +=
- "<span title='" +
- operatorResult +
- "'>" +
- operatorResult +
- '</span><br/>'
- if (type == 1) {
- classname = 'jump'
- titlename = _self._localeStr.WEB_JUMPCOMMENTS
- } else {
- if (type == 2) {
- classname = 'append'
- titlename = _self._localeStr.WEB_COUNTERSIGNCOMMENTS
- } else {
- if (type == 4) {
- classname = 'stop'
- titlename = _self._localeStr.WEB_ENDCOMMENTS
- } else {
- if (type == 3) {
- classname = 'deliver'
- titlename = _self._localeStr.WEB_TRANSFERRCOMMENTS
- } else {
- if (type == 0) {
- classname = 'jump'
- titlename = _self._localeStr.WEB_REJECTCOMMENTS
- }
- }
- }
- }
- }
- }
- if (titlename != '') {
- op +=
- "<span title='" +
- titlename +
- "'>" +
- titlename +
- ":</span><span title='" +
- operatorOpinion +
- "'>" +
- operatorOpinion +
- '</span><br/>'
- }
- if (i > 0) {
- if (data[i].node == data[i - 1].node) {
- _html +=
- '<div class="infos"> <div class="content"> <div class="title"> <i></i> <span style="float:left;">' +
- data[i].operatorTime +
- '</span> <span style="float:right;">' +
- data[i].operator +
- '</span> </div> <div class="op">' +
- op +
- '</div> </div></div>'
- if (i != data.length - 1) {
- if (data[i].node != data[i + 1].node) {
- _html += '</div></li>'
- }
- }
- continue
- }
- }
- _html +=
- '<li><div class="node"> <i class="' +
- classname +
- '"></i> <span>' +
- node +
- '</span></div>'
- if (i != data.length - 1) {
- if (data[i].node == data[i + 1].node) {
- _html += '<div class="info"><div class="infos">'
- } else {
- _html += '<div class="info">'
- }
- } else {
- _html += '<div class="info">'
- }
- _html += ' <div class="content"> <div class="title">'
- if (i != data.length - 1) {
- if (data[i].node == data[i + 1].node) {
- _html += '<i></i>'
- }
- }
- _html +=
- ' <span style="float:left;">' +
- data[i].operatorTime +
- '</span> <span style="float:right;">' +
- data[i].operator +
- '</span> </div> <div class="op">' +
- op +
- '</div> </div></div>'
- if (i != data.length - 1) {
- if (data[i].node != data[i + 1].node) {
- _html += '</li>'
- }
- }
- }
- if (!_html) {
- _html = _self._localeStr.WEB_NOAPPROVALRECORDS
- }
- $('#approveHisInfo ul')[0].innerHTML = _html
- }
- })
- },
- showbtn: function () {
- waf('#dynamicSign').wafLinkButton('option', 'hidden', !assign.dynamicSign)
- waf('#appendActivity').wafLinkButton(
- 'option',
- 'hidden',
- !assign.allowAppendActivity || approvetype == 'manualdecision'
- )
- waf('#jumpto').wafLinkButton('option', 'hidden', !assign.allowJumpTo)
- waf('#kickback').wafLinkButton('option', 'hidden', !assign.allowKickBack)
- waf('#deliver').wafLinkButton('option', 'hidden', !assign.allowDeliver)
- waf('#YZJShare').wafLinkButton('option', 'hidden', true)
- if (assign.allowJumpTo || assign.allowKickBack) {
- var assignId = assign.assignId
- waf.doPost({
- url:
- waf.getContextPath() +
- '/common/tree.do?method=getJumpAndKickBackModel',
- async: false,
- data: { assignId: assignId },
- success: function (data) {
- if (assign.allowJumpTo) {
- waf('#jumpto').wafLinkButton('option', 'hidden', !data.jumpTo)
- }
- if (assign.allowKickBack) {
- waf('#kickback').wafLinkButton('option', 'hidden', !data.kickBack)
- }
- }
- })
- }
- if (
- assign.canSpecifyNextPerformer ||
- assign.mustShowPostActivities ||
- assign.showNextP
- ) {
- if (assign.mustShowPostActivities || assign.showNextP) {
- waf(nextActIndex).wafCheckbox('option', 'checked', true)
- }
- } else {
- waf(nextActIndex).wafCheckbox('option', 'hidden', true)
- }
- if (approvetype == 'batchapprove') {
- waf('#btnImage').wafLinkButton('option', 'hidden', false)
- waf('#btnBill').wafLinkButton('option', 'hidden', false)
- }
- if (approvetype == 'approve') {
- waf('#save').wafLinkButton('option', 'hidden', false)
- }
- },
- setselnextperson: function (actId, name, id) {
- var ps = {}
- if (selnextPersons[actId]) {
- ps = selnextPersons[actId]
- if (ps[id]) {
- return
- }
- }
- ps[id] = { number: '', name: name, id: id }
- selnextPersons[actId] = ps
- },
- loadNextActs: function () {
- _private.getnextacts()
- var nextActs = assign.nextActs
- _private.innerloadNextActs(nextActs)
- },
- innerloadNextActs: function (nextActs, selectAct) {
- var table = $('#nextActList')
- var _innerhtml = ''
- if (nextActs) {
- var actTitles = {}
- if (nextActs.length == 0) {
- _innerhtml +=
- '<div>' + _self._localeStr.WEB_NOSETACTIVITYPERSON + '</div>'
- $(_private.modifyNextAct).wafLinkButton('option', 'hidden', true)
- } else {
- var hasAct = false
- var selectActobj = {}
- if (selectAct) {
- for (var actid in selectAct) {
- selectActobj[actid] = actid
- }
- }
- for (var i = 0; i != nextActs.length; i++) {
- var act = nextActs[i]
- var num = 0
- var actId = act.actId
- var candidateselected = act.candidateselected
- if (!selectActobj[actId]) {
- for (var id in candidateselected) {
- _private.setselnextperson(actId, candidateselected[id], id)
- num++
- }
- }
- if (_private.isPredict && !act.isPredict) {
- continue
- }
- hasAct = true
- var actKey = act.actKey
- var actName = act.actName
- var isAllPersonAsPerformer = act.isAllPersonAsPerformer
- var persons = act.persons
- var count = act.count
- var issel = false
- var title = ''
- if (num > 0) {
- issel = true
- }
- _innerhtml +=
- "<div class='actInfo' actId='" +
- actId +
- "' actKey='" +
- actKey +
- "' title='" +
- actName +
- "'>" +
- actName +
- "</div><div class='actInfoperson' id='" +
- actId +
- "'>"
- if (issel) {
- _innerhtml += _self._localeStr.WEB_SELECTED
- var j = 0
- for (var id in candidateselected) {
- if (j > 0) {
- title += '、'
- }
- title += candidateselected[id]
- if (j > 2) {
- j++
- continue
- }
- if (j > 0) {
- _innerhtml += '、'
- }
- _innerhtml +=
- "<span class='persons' personid='" +
- id +
- "'>" +
- candidateselected[id] +
- '</span>'
- j++
- }
- actTitles[actId] = title
- if (j > 2) {
- _innerhtml +=
- _self._localeStr.WEB_ANDSOON + j + _self._localeStr.WEB_PEOPLE
- }
- } else {
- if (count > 0) {
- _innerhtml += ''
- var j = 0
- for (var id in persons) {
- if (j > 0) {
- title += '、'
- }
- title += persons[id]
- if (j > 2) {
- _innerhtml +=
- _self._localeStr.WEB_ANDSOON +
- count +
- _self._localeStr.WEB_PEOPLE
- break
- }
- if (j > 0) {
- _innerhtml += '、'
- }
- _innerhtml +=
- "<span class='persons' personid='" +
- id +
- "'>" +
- persons[id] +
- '</span>'
- j++
- }
- actTitles[actId] = title
- } else {
- _innerhtml += _self._localeStr.WEB_UNSELECTEDPERSON
- }
- }
- _innerhtml += '</div>'
- }
- if (!hasAct) {
- _innerhtml += '<div>' + _self._localeStr.WEB_POINTNEXTTIP + '</div>'
- }
- $(_private.modifyNextAct).wafLinkButton('option', 'hidden', false)
- }
- table.html(_innerhtml)
- for (var actTitle in actTitles) {
- $('#' + actTitle).attr('title', actTitles[actTitle])
- }
- }
- },
- getOpinion: function (actInstId, assignId, billId) {
- var params = {}
- params.actInstId = actInstId
- params.assignId = assignId
- params.billId = billId
- params.type = approvetype
- waf.doPost({
- url: waf.getContextPath() + '/workflow/approve.do?method=getOpinion',
- data: params,
- success: function (data) {
- if (
- data != null &&
- data != '' &&
- data.option != null &&
- data.option != ''
- ) {
- $('#approveOpinionInfo span').text(data.option)
- } else {
- $('#approveOpinionInfo').hide()
- }
- }
- })
- },
- supportMulti: function () {
- $('#approveDeliverBtn span').text(_self._localeStr.WEB_DELIVER)
- $('#approvePassBtn span').text(_self._localeStr.WEB_CIRCULATEBTN)
- $('#approveAppendBtn span').text(_self._localeStr.WEB_ADDSIGN)
- $('#approveDynamicSignBtn span').text(_self._localeStr.WEB_CONTERSIGNED)
- $('#approveSaveBtn span').text(_self._localeStr.WEB_SAVE)
- $('#approveSubmitBtn span').text(_self._localeStr.WEB_SUBMIT)
- $('#btnUpload').prepend(_self._localeStr.WEB_UPLOADATTACH)
- $('#attachmul1').prepend(_self._localeStr.WEB_ATTCHNUM)
- $('#attchmul2').prepend(_self._localeStr.WEB_VIEWDETAIL)
- $('#attachmul3').prepend(_self._localeStr.WEB_ATTCHGE)
- $('#attchment').append($('.attchmentnuminfo'))
- $('#attchment').append($('#upload'))
- $('#myPhraseInfo .edit').text(_self._localeStr.WEB_SAVE)
- $('#myPhraseInfo .backprevious').text(_self._localeStr.WEB_BACK)
- $('#myPhraseInfo .commit').text(_self._localeStr.WEB_DETERMINE)
- $('#myPhrasetext').prop(
- 'placeholder',
- _self._localeStr.WEB_ENTER_COMMENTS
- )
- },
- initApprove: function () {
- if (assign.riskInsight) {
- _private.initRiskInsight()
- } else {
- waf('#riskInsight').wafTab('remove')
- }
- _private.initEsignature()
- _private.initCCPerson()
- _private.showbtn()
- _private.initBillPage()
- _private.initAttachment()
- _private.initOperateIframe()
- _private.initAbstractAndPhrase()
- _private.initApprovePolicy()
- },
- initBatchapprove: function () {
- _private.initEsignature()
- _private.showbtn()
- locationurl.billIds = decodeURIComponent(parent.window.billIDs)
- locationurl.assignmentIds = parent.window.assignmentIDs
- _private.getbatchlist()
- _private.initAbstractAndPhrase()
- _private.initApprovePolicy()
- waf('#attchment').wafSection('option', 'hidden', true)
- $('#upload').remove()
- $('#operateInfo').remove()
- $('.attchmentnuminfo').remove()
- },
- initManualdecision: function () {
- _private.initManualdecisionNextAct()
- _private.showbtn()
- _private.initBillPage()
- _private.initAttachment()
- _private.initOperateIframe()
- _private.initDecisionDescAndVal()
- },
- initPassComent: function () {
- if (assign.passcoment != null) {
- waf('#passComentOpinion').val(assign.passcoment)
- }
- if (assign.isFeedBack) {
- waf('#sendmsgs').wafCheckbox('disable')
- waf('#sendmails').wafCheckbox('disable')
- }
- waf('#submit').wafLinkButton('option', 'hidden', assign.isFeedBack)
- waf('#passAssignment').wafLinkButton(
- 'option',
- 'hidden',
- assign.againPass === 'false'
- )
- _private.initBillPage()
- _private.initAttachment()
- _private.initOperateIframe()
- },
- initManualdecisionNextAct: function () {
- nextActIndex = '#nextAct1'
- _private.modifyNextAct = '#modifynextAct1'
- if (waf(nextActIndex).wafCheckbox('isChecked')) {
- _private.loadNextActs()
- }
- },
- initRiskInsight: function () {
- try {
- mod.use('billInsight', function () {
- riskInsight = true
- $('#form').append(
- '<div id="billInsight" class="" ctrlrole="waf.billInsight" data-domcreated="true"></div>'
- )
- $('#li_approveTask').css('width', '50%')
- $('#li_riskInsight').show()
- billInsightOption = _private.getWeakRisk()
- _private.updateBillInsightNum(billInsightOption)
- $(window).resize(function () {
- _private.resizeBillInsight(true)
- })
- })
- } catch (e) {
- console.log(_self._localeStr.WEB_CONSOLETEXT)
- }
- },
- initCCPerson: function () {
- if (assign.allowCC) {
- $('#panelCC').show()
- }
- if (assign.ccPersonIds != null && assign.ccPersonName != null) {
- waf('#textCC').prop('personIds', assign.ccPersonIds)
- waf('#textCC').val(assign.ccPersonName)
- }
- },
- initEsignature: function () {
- if (
- !assign.isEsignature ||
- assign.esignatureAttachId == undefined ||
- assign.esignatureAttachId == ''
- ) {
- $('#panel6').remove()
- } else {
- var _html =
- "<img src='/easweb/webviews/webframework/webcom/attachment/view.jsp?bosID=" +
- assign.esignatureAttachId +
- "'/>"
- $('#esigndiv')[0].innerHTML = _html
- }
- },
- initBillPage: function () {
- if (assign.messageDigest) {
- try {
- _private.messageDigest()
- } catch (e) {
- console.log(_self._localeStr.WEB_BILLINITFAILED)
- }
- } else {
- if (!assign.billEditUrl || assign.billEditUrl == 'nobill.html') {
- assign.billEditUrl = '/easweb/webviews/workflow/nobill.html?'
- }
- if (approvetype == 'passComent' && msgId) {
- assign.billEditUrl =
- assign.billEditUrl + '&msgId=' + encodeURIComponent(msgId)
- }
- _private.displayBillInfo(assign.billEditUrl)
- }
- },
- initAttachment: function () {
- waf('#attachmentBtn').wafLinkButton(
- 'option',
- 'hidden',
- assign.attachDisabled
- )
- _private.refreshAttachCountInner(assign.attachmentCount)
- },
- initOperateIframe: function () {
- var url =
- '/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.approveRelatedInfo&isshowapprove=true&assignmentId=' +
- assign.assignId
- waf('#operateiframe').wafIframe('option', 'src', url)
- },
- initApprovePolicy: function () {
- _private.getPolicy(assign.approveValue)
- _private.getDefaultOption()
- if (assign.id) {
- waf('#approveResult').wafRadioGroup('setValue', assign.approveResult)
- waf('#policy').wafSelect('setValue', assign.handlerOpinion)
- } else {
- waf('#approveResult').wafRadioGroup('setValue', 'true')
- }
- },
- initAbstractAndPhrase: function () {
- if (assign.absStr) {
- waf('#optionalSection').wafSection(
- 'option',
- 'title',
- _self._localeStr.WEB_PROCESSSUMMARY
- )
- waf('#optionalSection').wafSection('option', 'hidden', false)
- $('#description').text(assign.absStr)
- }
- _private.getphrase()
- $('#myPhraseList').on('click', 'li', function (e) {
- _private.clickPhrase(e)
- })
- $('#myPhraseList').on('dblclick', 'li', function (e) {
- _private.dblclickPhrase(e)
- })
- $('#myPhraseList').on('click', 'li i', function (e) {
- _private.phrasedel(e)
- })
- },
- initDecisionDescAndVal: function () {
- if (assign.decisionDesc) {
- waf('#optionalSection').wafSection(
- 'option',
- 'title',
- _self._localeStr.WEB_DECISONDESC
- )
- waf('#optionalSection').wafSection('option', 'hidden', false)
- $('#description').text(assign.decisionDesc)
- _private.changeBillHeight(85, false)
- }
- _private.setmanualdecision()
- },
- initCalProcDiagram: function () {
- var url =
- '/easweb/webviews/workflow/calProcDiagramNew.jsp?procInstId=' +
- assign.procInstId +
- '&actinstId=' +
- assign.actInstId +
- '&newPage=' +
- assign.newPage
- waf('#' + _private.charFrameId).wafIframe('option', 'src', url)
- var urlWin =
- '/easweb/webviews/workflow/calProcDiagram.jsp?procInstId=' +
- assign.procInstId +
- '&actinstId=' +
- assign.actInstId
- waf('#chartIframe').wafIframe('option', 'src', urlWin)
- $('#chart').click(function () {
- $('#chart').hide()
- })
- $('#chartClose').click(function () {
- $('#chart').hide()
- })
- $('#openChartIframe').click(function () {
- $('#chart').show()
- })
- var times = 0
- var interval = setInterval(function () {
- if (window.frames[_private.charFrameId]) {
- var num = window.frames[_private.charFrameId].num
- if (num > 0) {
- var iWidth = window.innerWidth * (4 / 5)
- var rowNum = parseInt(iWidth / 176)
- var calcHeight = Math.ceil(num / rowNum) * 140
- var winHeight = ''
- if (top == parent.parent) {
- winHeight = window.innerHeight
- } else {
- winHeight = window.screen.availHeight - 120
- }
- var iHeight = winHeight * (4 / 5)
- if (calcHeight < iHeight) {
- iHeight = calcHeight
- }
- var iTop = (winHeight - 70 - iHeight) / 2
- var iLeft = (window.innerWidth - 10 - iWidth) / 2
- $('#chartIframe').css({
- 'margin-left': iLeft,
- 'margin-top': iTop,
- width: iWidth,
- height: iHeight
- })
- }
- }
- times++
- if (times > 100) {
- clearInterval(interval)
- }
- }, 100)
- },
- initPageLayout: function () {
- if (assign.newPage) {
- $('#predictionChart').remove()
- _private.charFrameId = 'predictionChartIframeNew'
- _private.initBtnNew()
- } else {
- $('#predictionChartNew').remove()
- }
- if (
- locationurl.isOpenNewTab != undefined &&
- locationurl.isOpenNewTab == 'true'
- ) {
- $('#nextActList').css('height', '20vh')
- }
- },
- initCalProcDiagramPanel: function () {
- if (approvetype == 'approve') {
- _private.initCalProcDiagram()
- } else {
- $('#chart').remove()
- $('#predictionChart').remove()
- $('#predictionChartNew').remove()
- }
- },
- initSection: function () {
- if (approvetype != 'batchapprove') {
- waf('#predictionChart').wafSection(
- 'option',
- 'onopen',
- function (event) {
- _private.changeBillHeight(50, false)
- }
- )
- waf('#predictionChart').wafSection(
- 'option',
- 'onclose',
- function (event) {
- _private.changeBillHeight(50, true)
- }
- )
- waf('#operateInfo').wafSection('option', 'onopen', function (event) {
- _private.changeBillHeight(220, false)
- })
- waf('#operateInfo').wafSection('option', 'onclose', function (event) {
- _private.changeBillHeight(220, true)
- })
- waf('#optionalSection').wafSection(
- 'option',
- 'onopen',
- function (event) {
- _private.changeBillHeight(60, false)
- }
- )
- waf('#optionalSection').wafSection(
- 'option',
- 'onclose',
- function (event) {
- _private.changeBillHeight(60, true)
- }
- )
- }
- },
- initZoomTool: function () {
- $('#onClose').show()
- $('#tabs_ul li')
- .eq($('#tabs_ul li').length - 1)
- .append($('#onClose'))
- $('#splitPanel_LeftSplitPanel').prepend($('#onOpen'))
- $('#onClose').bind('click', function () {
- $('#splitPanel').height($('#splitPanel_LeftSplitPanel').height())
- rightPanelWidth = $('#splitPanel_RightSplitPanel').width()
- leftPanelWidth = $('#splitPanel_LeftSplitPanel').width()
- $('#splitPanel_RightSplitPanel').css('width', '0%')
- $('#splitPanel_LeftSplitPanel').css('width', '100%')
- $('#onOpen').show()
- if (riskInsight && _private.curTab == 'riskInsight') {
- $('.billInsight_cardPanel').css('display', 'none')
- }
- if (approvetype == 'batchapprove' && !assign.batchApproveUrl) {
- var newWidth = $('#queryGrid').wafGrid('getGridParentWidth')
- $('#queryGrid').jqGrid('setGridWidth', newWidth)
- }
- })
- $('#onOpen').bind('click', function () {
- $('#onOpen').hide()
- $('#splitPanel_RightSplitPanel').css('width', rightPanelWidth)
- $('#splitPanel_LeftSplitPanel').css('width', leftPanelWidth)
- if (riskInsight && _private.curTab == 'riskInsight') {
- $('.billInsight_cardPanel').show()
- }
- if (approvetype == 'batchapprove' && !assign.batchApproveUrl) {
- var newWidth = $('#queryGrid').wafGrid('getGridParentWidth')
- $('#queryGrid').jqGrid('setGridWidth', newWidth)
- }
- })
- $('#onOpen').bind('hover', function () {
- $('#onOpen').css('opacity', 1)
- })
- },
- pageOnload: function (e) {
- $('body').ready(function () {
- _private.supportMulti()
- _private.showtab()
- var billId = assign.billId
- if (approvetype == 'approve') {
- _private.initApprove()
- } else {
- if (approvetype == 'batchapprove') {
- _private.initBatchapprove()
- if (locationurl && locationurl.assignmentIds) {
- var actionUrl =
- waf.getContextPath() +
- '/activityProperty.do?method=addAssignReadTime'
- var params = {}
- params.assignIds = locationurl.assignmentIds
- waf.doPost({
- url: actionUrl,
- data: params,
- async: true,
- success: function (data) {}
- })
- }
- } else {
- if (approvetype == 'manualdecision') {
- _private.initManualdecision()
- } else {
- if (approvetype == 'passComent') {
- _private.initPassComent()
- billId = passId
- }
- }
- }
- }
- _private.initSection()
- _private.initPageLayout()
- _private.initCalProcDiagramPanel()
- _private.getOpinion(assign.actInstId, assign.assignId, billId)
- _private.setsendmailormsg(
- assign.isOpenMessageSendOnUI,
- assign.notifyNextBySMS,
- assign.notifyNextByMail
- )
- if (assign.newPage) {
- _private.initZoomTool()
- }
- _private.resizePage()
- window.scrollTo(0, 0)
- var newTab = waf.getUrlParams(document.URL).isOpenNewTab
- if (newTab) {
- $('#operateInfo').css('margin', '3px 5px 5px 0')
- }
- })
- },
- initBtnNew: function () {
- var submitBtn = waf('#submit').wafLinkButton('option', 'hidden')
- $('#toolBar .ui-toolbar-ul').css('float', 'right')
- if (approvetype == 'approve' || approvetype == 'batchapprove') {
- if (approvetype == 'approve') {
- var offset =
- $('#panelNew1').width() - ($('#approveSaveBtn').width() * 2 + 20)
- if (offset > 0) {
- $('#approveSaveBtn').css('margin-left', offset / 2)
- }
- } else {
- $('#approveSubmitBtn').css('float', 'right')
- }
- $('#toolBarNew1').show()
- $('#panelNew1').show()
- $('#labelapproveResult_label').hide()
- waf('#approveSubmitBtn').wafLinkButton('option', 'hidden', submitBtn)
- waf('#approveSaveBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#save').wafLinkButton('option', 'hidden')
- )
- waf('#approveDeliverBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#deliver').wafLinkButton('option', 'hidden')
- )
- waf('#approvePassBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#passAssignment').wafLinkButton('option', 'hidden')
- )
- waf('#approveKickbackBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#kickback').wafLinkButton('option', 'hidden')
- )
- waf('#approveAppendBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#appendActivity').wafLinkButton('option', 'hidden')
- )
- waf('#approveDynamicSignBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#dynamicSign').wafLinkButton('option', 'hidden')
- )
- waf('#approveJumpBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#jumpto').wafLinkButton('option', 'hidden')
- )
- } else {
- if (approvetype == 'manualdecision') {
- $('#panelNew3').show()
- var b = waf('#deliver').wafLinkButton('option', 'hidden')
- if (!b) {
- $('#toolBarNew3').show()
- }
- waf('#decisionDeliverBtn').wafLinkButton(
- 'option',
- 'hidden',
- waf('#deliver').wafLinkButton('option', 'hidden')
- )
- waf('#decisionSubmitBtn').wafLinkButton('option', 'hidden', submitBtn)
- } else {
- if (approvetype == 'passComent') {
- $('#panelNew2').show()
- var b = waf('#passAssignment').wafLinkButton('option', 'hidden')
- if (!b) {
- $('#toolBarNew2').show()
- }
- waf('#passPassBtn').wafLinkButton('option', 'hidden', b)
- waf('#passSubmitBtn').wafLinkButton('option', 'hidden', submitBtn)
- }
- }
- }
- waf('#submit').wafLinkButton('option', 'hidden', true)
- waf('#save').wafLinkButton('option', 'hidden', true)
- waf('#deliver').wafLinkButton('option', 'hidden', true)
- waf('#passAssignment').wafLinkButton('option', 'hidden', true)
- waf('#kickback').wafLinkButton('option', 'hidden', true)
- waf('#appendActivity').wafLinkButton('option', 'hidden', true)
- waf('#dynamicSign').wafLinkButton('option', 'hidden', true)
- waf('#jumpto').wafLinkButton('option', 'hidden', true)
- if (approvetype != 'batchapprove') {
- $('#assignTitle').show()
- $('#assignTitle').css(
- 'width',
- $('#toolBar').width() - $('#toolBar .ui-toolbar-ul').width()
- )
- $('#assignTitle').text(assign.title)
- $('#assignTitle').prop('title', assign.title)
- }
- },
- changePolicy: function (event, ui) {
- _private.setPolicy(ui.current)
- if (ui.current == 'false') {
- $('#panel').hide()
- } else {
- $('#panel').show()
- }
- },
- deliver: function (event, value) {
- var para = {}
- if (approvetype == 'batchapprove') {
- para.sourceID = _private.getbatchid().assignIds
- } else {
- para.sourceID = assign.assignId
- }
- wfCommonUtil.deliverAssignment(para)
- },
- passAssignment: function (event, value) {
- var para = {}
- if (approvetype == 'batchapprove') {
- var info = _private.getbatchid()
- para.sourceID = info.assignIds
- para.bizObjID = info.billIds
- } else {
- para.sourceID = assign.assignId
- para.bizObjID = assign.billId
- }
- wfCommonUtil.passComment(para)
- },
- kickback: function (event, value) {
- var assignid = ''
- if (approvetype == 'batchapprove') {
- assignid = _private.getbatchid().assignIds
- } else {
- assignid = assign.assignId
- }
- var url =
- waf.getContextPath() +
- '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.kickBackPage&assignmentId=' +
- encodeURIComponent(assignid)
- wfCommonUtil.windowopen(url, _self._localeStr.WEB_REJECT, 450, 320)
- },
- jumpto: function (event, value) {
- var assignid = ''
- if (approvetype == 'batchapprove') {
- assignid = _private.getbatchid().assignIds
- } else {
- assignid = assign.assignId
- }
- var url =
- waf.getContextPath() +
- '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.jump&assignmentId=' +
- encodeURIComponent(assignid)
- wfCommonUtil.windowopen(url, _self._localeStr.WEB_JUMP, 450, 281)
- },
- dynamicSign: function (event, value) {
- var assignid = ''
- if (approvetype == 'batchapprove') {
- assignid = _private.getbatchid().assignIds
- } else {
- assignid = assign.assignId
- }
- var url =
- waf.getContextPath() +
- '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.dynamicSignPage&assignmentId=' +
- encodeURIComponent(assignid)
- wfCommonUtil.windowopen(
- url,
- _self._localeStr.WEB_COUNTERSIGNPART,
- 450,
- 281
- )
- },
- appendActivity: function (event, value) {
- var billId = ''
- var assignId = ''
- if (approvetype == 'batchapprove') {
- var info = _private.getbatchid()
- assignId = info.assignIds
- billId = info.billIds
- } else {
- assignId = assign.assignId
- billId = assign.billId
- }
- var url =
- waf.getContextPath() +
- '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.appendSignPage&assignmentId=' +
- encodeURIComponent(assignId) +
- '&billIds=' +
- encodeURIComponent(billId) +
- '&isAppended=' +
- assign.isAppended
- if (assign.appendMode) {
- url += '&appendMode=' + assign.appendMode[0]
- }
- if (assign.routeMode) {
- url += '&routeMode=' + assign.routeMode[0]
- }
- wfCommonUtil.windowopen(url, _self._localeStr.WEB_COUNTERSIGN, 520, 746)
- },
- modifynextAct: function (event, value) {
- _private.setmodifynextAct()
- },
- setselnextactperson: function (resultStr) {
- _private.innerloadNextActs(assign.nextActs, resultStr)
- for (var actid in resultStr) {
- var ps = resultStr[actid]
- var _innerhtml = _self._localeStr.WEB_SELECTED
- var j = 0
- if (_private.isEmptyObject(ps)) {
- delete selnextPersons[actid]
- } else {
- var title = ''
- for (var id in ps) {
- var person = ps[id]
- var name = person.name
- _private.setselnextperson(actid, name, id)
- if (j > 0) {
- title += '、'
- }
- title += name
- if (j > 2) {
- j++
- continue
- }
- if (j > 0) {
- _innerhtml += '、'
- }
- _innerhtml +=
- "<span class='persons' personid='" + id + "'>" + name + '</span>'
- j++
- }
- if (j > 2) {
- _innerhtml +=
- _self._localeStr.WEB_ANDSOON + j + _self._localeStr.WEB_PEOPLE
- }
- $('#' + actid).html(_innerhtml)
- $('#' + actid).attr('title', title)
- }
- }
- },
- isEmptyObject: function (obj) {
- for (var key in obj) {
- return false
- }
- return true
- },
- getphrase: function () {
- waf.doPost({
- url:
- waf.getContextPath() +
- '/workflow/approve.do?method=getAppMyPhraseList',
- success: function (data) {
- var myPhraseList = $('#myPhraseList .showdel')
- myPhraseList.html('')
- for (var i = 0; i < data.length; i++) {
- var row = $('<li></li>')
- row.attr({ 'data-id': data[i].id, title: data[i].phraseText })
- row.text(data[i].phraseText)
- row.append('<i></i>')
- myPhraseList.append(row)
- }
- }
- })
- },
- clickPhrase: function (e) {
- $('#myPhraseInfo li').removeClass('cur')
- var targetElem = $(e.target)
- targetElem.addClass('cur')
- $('#myPhrasetext').val(targetElem.attr('title'))
- $('#myPhrasetext').attr('data-id', targetElem.attr('data-id'))
- },
- dblclickPhrase: function (e) {
- var itemval = $(e.target).attr('title')
- $('#approveOpinion').val(itemval)
- $('#myPhraseInfo li').removeClass('cur')
- $('#myPhrasetext').attr('data-id', '')
- $('#myPhrasetext').val('')
- $('#phrasePanel').hide()
- },
- phrasesure: function (e) {
- var text = $('#myPhrasetext').val()
- if (text != null && text.length > 1000) {
- _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTS_TOOLONG)
- return null
- }
- $('#approveOpinion').val(text)
- $('#myPhraseInfo li').removeClass('cur')
- $('#myPhrasetext').attr('data-id', '')
- $('#myPhrasetext').val('')
- $('#phrasePanel').hide()
- },
- phraseback: function (e) {
- $('#myPhraseInfo li').removeClass('cur')
- $('#myPhrasetext').attr('data-id', '')
- $('#myPhrasetext').val('')
- $('#phrasePanel').hide()
- },
- myPhrase: function (event, value) {
- $('#phrasePanel').show()
- $('#myPhrasesection .ui-jqgrid-bdiv').css('height', 'auto')
- },
- addphrase: function () {
- var text = $('#myPhrasetext').val()
- if (text != null && text.length > 1000) {
- _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTS_TOOLONG)
- return null
- }
- var param = {}
- var rowid = $('#myPhrasetext').attr('data-id')
- var value = $('#myPhrasetext').val()
- if (!value) {
- return
- }
- if (rowid) {
- param.method = 'updateOption'
- param.opId = rowid
- param.opName = value
- } else {
- param.phraseTxt = value
- param.method = 'saveMyPhrase'
- }
- waf.doPost({
- url: waf.getContextPath() + '/workflow/approve.do',
- data: param,
- success: function (data) {
- _private.getphrase()
- _self.showSuccess(_self._localeStr.WEB_ADDCOMMONCOMMENTS)
- }
- })
- },
- phrasedel: function (e) {
- var param = {}
- param.phraseIds = $(e.target).parent().attr('data-id')
- $('#myPhrasetext').attr('data-id', '')
- $('#myPhrasetext').val('')
- waf.doPost({
- url: waf.getContextPath() + '/workflow/approve.do?method=delMyPhrase',
- data: param,
- success: function (data) {
- _private.getphrase()
- _self.showSuccess(_self._localeStr.WEB_DELETECOMMONCOMMENTS)
- }
- })
- },
- pageOnRenderBefore: function (e) {
- assign = _self.getPageInitData()
- if (approvetype != 'passComent') {
- _private.initCAConfig(assign.CAConfig)
- }
- var title = ''
- if (approvetype == 'batchapprove') {
- title = _self._localeStr.WEB_BATCHAPPROVAL
- } else {
- title = assign.title
- }
- _self.changeTitle(title)
- },
- phraseadd: function (e) {
- var datarow = { phraseText: '' }
- waf('#myPhrasegrid').wafGrid('addRow', { data: datarow })
- },
- viewProcessDiagram: function (event, value) {
- var para = {}
- if (approvetype == 'batchapprove') {
- var assignIds = _private.getbatchid().assignIds
- if (assignIds.split(';').length != 1) {
- _self.showInfo(_self._localeStr.WEB_SELECTARECORD)
- return false
- }
- para.sourceID = assignIds.split(';')[0]
- } else {
- para.sourceID = assign.assignId
- }
- wfCommonUtil.viewProcessDiagram(para)
- },
- reloadTranId: function () {
- var approveResult = waf('#approveResult').wafRadioGroup('getValue')
- var policy = waf('#policy').wafSelect('getValue')
- var ispass
- if (approveResult == 'false') {
- ispass = false
- } else {
- if (approveResult == 'true') {
- ispass = true
- }
- }
- if (assign) {
- var approveValueStr = assign.approveValue
- if (approveValueStr == null || approveValueStr == '') {
- approveValueStr =
- '0;' +
- _self._localeStr.WEB_AGREE +
- ';' +
- _self._localeStr.WEB_AGREE +
- ';:1;' +
- _self._localeStr.WEB_DISAGREE +
- ';' +
- _self._localeStr.WEB_DISAGREE +
- ';'
- }
- var strs = approveValueStr.split(':')
- for (var i = 0; i < strs.length; i++) {
- var strTemp = strs[i].split(';')
- if (strTemp.length != 4) {
- continue
- }
- if (ispass && policy == strTemp[0]) {
- transId = strTemp[3]
- return
- }
- }
- }
- },
- changeselPolicy: function (event, ui) {
- _private.reloadTranId()
- if (waf(nextActIndex).wafCheckbox('isChecked')) {
- _private.loadNextActs()
- }
- },
- getnextacts: function () {
- var param = {}
- param.assignId = assign.assignId
- param.associatedLine = transId
- param.isPredict = _private.isPredict
- param.isNewProcessCenter = true
- waf.doPost({
- url:
- waf.getContextPath() + '/common/tree.do?method=findPostParticipants',
- data: param,
- async: false,
- success: function (data) {
- assign.nextActs = data
- }
- })
- },
- showtab: function () {
- if (approvetype == 'approve' || approvetype == 'batchapprove') {
- $('#tabs').wafTabs('remove', '#manualdecision')
- $('#tabs').wafTabs('remove', '#passComent')
- } else {
- if (approvetype == 'manualdecision') {
- $('#tabs').wafTabs('remove', '#approveTask')
- $('#tabs').wafTabs('remove', '#passComent')
- } else {
- if (approvetype == 'passComent') {
- $('#tabs').wafTabs('remove', '#approveTask')
- $('#tabs').wafTabs('remove', '#manualdecision')
- }
- }
- }
- if (approvetype != 'approve') {
- waf('#riskInsight').wafTab('remove')
- }
- },
- setmanualdecision: function () {
- var items = assign.decisionItems
- var opinions = assign.decisionOpinions
- var _html = ''
- var itemArr = items.split(';')
- var opinionArr = new Array()
- if (!opinions) {
- var opinionItem = ''
- for (var i = 0; i < itemArr.length; i++) {
- opinionItem += i + 1
- if (i < itemArr.length - 1) {
- opinionItem += ';'
- }
- opinionArr.push(i + 1)
- }
- assign.decisionOpinions = opinionItem
- } else {
- opinionArr = opinions.split(';')
- }
- var json = []
- for (var i = 0; i < itemArr.length; i++) {
- var name = itemArr[i]
- var val = opinionArr[i]
- var para = {}
- para.value = val + '_' + i
- para.alias = name
- json.push(para)
- }
- waf('#radioDecision').wafRadioGroup('setItems', null, json)
- waf('#radioDecision').wafRadioGroup('setValue', json[0].value)
- },
- nextActs: function (event, ui) {
- _private.shownextActs('modifynextAct1', ui)
- },
- nextAct: function (event, ui) {
- _private.shownextActs('modifynextAct', ui)
- },
- modifynextActs: function (event, value) {
- _private.setmodifynextAct()
- },
- setmodifynextAct: function () {
- var jsonval = ''
- if (selnextPersons == null || selnextPersons.length == 0) {
- jsonval = ''
- } else {
- jsonval = JSON.stringify(selnextPersons)
- }
- waf.window.open({
- url:
- waf.getContextPath() +
- '/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.setNextAct&debug=true&assignmentId=' +
- encodeURIComponent(assign.assignId) +
- '&selnextPersons=' +
- encodeURIComponent(jsonval) +
- '&asso=' +
- transId +
- '&isPredict=' +
- _private.isPredict,
- openType: 'iframe',
- method: 'POST',
- data: {},
- modal: true,
- title: _self._localeStr.WEB_NEXTACTIVITY,
- position: 'center',
- width: 1020,
- height: 580,
- minHeight: 560,
- minWidth: 1020,
- iconCls: 'waf-ui-icon',
- draggable: true,
- resizable: true,
- close: function (event, ui) {},
- retValCallBack: function (resultData) {
- if (
- resultData &&
- resultData.resultStr &&
- resultData.resultStr.length > 0
- ) {
- var resultStr = JSON.parse(resultData.resultStr)
- selnextPersons = {}
- _private.isPredict = resultData.isPredict
- _private.setselnextactperson(resultStr)
- }
- }
- })
- },
- getbatchlist: function () {
- if (assign.batchApproveUrl) {
- var url =
- waf.getContextPath() +
- assign.batchApproveUrl +
- '&hasToolbar=false&showCommonQuery=false'
- var billIds = locationurl.billIds.split(';')
- var temp = 'id%20in%20('
- for (var i = 0; i < billIds.length; i++) {
- if (billIds[i]) {
- if (i == 0) {
- temp += '%27' + encodeURIComponent(billIds[i]) + '%27'
- } else {
- temp += '%2C%27' + encodeURIComponent(billIds[i]) + '%27'
- }
- }
- }
- temp += ')'
- $(
- "<form id='framesrcbillform' method='POST' type='hidden' target='billFrame' action='" +
- url +
- "'></form>"
- )
- .insertAfter($('#billFrame'))
- .append(
- $("<input type='hidden' name='filterInfo' value='" + temp + "'>")
- )
- .append(
- $("<input type='hidden' name='botpFilter' value='" + temp + "'>")
- )
- setTimeout(function () {
- document.getElementById('framesrcbillform').submit()
- }, 500)
- var times = 0
- var interval = setInterval(function () {
- var frame = document.getElementById('billFrame')
- $($(frame)[0].contentDocument.body)
- .find('.ui-jqgrid')
- .css({ margin: '0px', width: '100%' })
- if (times > 600) {
- clearInterval(interval)
- }
- times++
- })
- } else {
- waf('#billFrame').remove()
- var listinfo = {}
- waf.doPost({
- url:
- waf.getContextPath() +
- '/workflow/approve.do?method=getBatchApproveBillGrid',
- data: { billIds: locationurl.billIds },
- async: false,
- success: function (data) {
- listinfo = data
- }
- })
- var headers = listinfo.headers
- var list = listinfo.list
- var fields = listinfo.fields
- if (headers.length > 0) {
- var colmodel = []
- var paraid = { name: 'id', label: 'id', hidden: true, key: true }
- colmodel.push(paraid)
- for (var m = 0; m < headers.length; m++) {
- var para = { name: fields[m], label: headers[m] }
- colmodel.push(para)
- }
- var myGridoptions = {
- id: 'queryGrid',
- colModel: colmodel,
- multiselect: true,
- loadInit: false,
- shrinkToFit: true
- }
- if (headers.length > 15) {
- myGridoptions.shrinkToFit = false
- }
- var dom = waf.createDOM('grid', myGridoptions)
- waf.appendDOM(waf('#panel5'), dom)
- waf.initComponent('grid', myGridoptions, dom)
- for (var i = 0; i < list.length; i++) {
- for (var j in list[i]) {
- if (list[i][j] != null && typeof list[i][j] == 'object') {
- list[i][j] = list[i][j].alias
- }
- }
- waf('#queryGrid').wafGrid('addRow', { data: list[i] })
- }
- }
- }
- },
- shownextActs: function (nextactname, ui) {
- if (ui.checked) {
- $('.approve-next-persons').show()
- _private.loadNextActs()
- } else {
- $('.approve-next-persons').hide()
- waf('#' + nextactname).wafLinkButton('option', 'hidden', true)
- selnextPersons = {}
- }
- },
- submit: function (event, value) {
- if (approvetype == 'approve') {
- _private.confirmSumit('beforeInnerSubmit')
- } else {
- if (approvetype == 'manualdecision') {
- _private.manualdecisionsubmit()
- } else {
- if (approvetype == 'batchapprove') {
- _private.confirmSumit('batchSubmitForCA')
- } else {
- if (approvetype == 'passComent') {
- _private.passComentsubmit()
- }
- }
- }
- }
- },
- confirmSumit: function (funcName) {
- if (assign.enableMultiapproveConfirm == 'true') {
- var ok = function () {
- _private[funcName]()
- }
- var cancel = function () {
- return
- }
- waf.msgBox.showConfirm({
- title: _self._localeStr.WEB_MESSPROMPT,
- summaryMsg: _self._localeStr.WEB_CONFIRMSUBMITAPPROVAL,
- buttonType: 'ok-cancel',
- buttonCallBack: [ok, cancel]
- })
- } else {
- _private[funcName]()
- }
- },
- passComentsubmit: function () {
- var params = {}
- params.parameter = sourceIDs
- params.chksendMessage = 'yes'
- if (waf('#sendmsgs').wafCheckbox('isChecked')) {
- params.chksendMobile = 'yes'
- }
- if (waf('#sendmails').wafCheckbox('isChecked')) {
- params.chksendMail = 'yes'
- }
- params.opinion = $('#passComentOpinion').val()
- var option = $('#passComentOpinion').val()
- if (option != null && option.length > 1000) {
- _self.showInfo(_self._localeStr.WEB_FEEDBACKCOMMENTS_TOOLONG)
- return null
- }
- waf.doPost({
- url: waf.getContextPath() + '/passComment/get.do?method=commit',
- data: params,
- success: function (data) {
- _self.showSuccess(_self._localeStr.WEB_DEEDBACKCIRCULATESUCCESS)
- _private.backto()
- }
- })
- },
- initCAConfig: function (tCAConfig) {
- caConfig.caConfigInfo = tCAConfig
- if (
- caConfig.caConfigInfo.isSignatureApprove === 'true' &&
- caConfig.caConfigInfo.caType != '5'
- ) {
- var initflag = initTopesa()
- if (initflag != 0) {
- waf.msgBox.showError(_self._localeStr.WEB_CAINITFAILED)
- }
- }
- },
- batchSubmitForCA: function () {
- if (
- caConfig.caConfigInfo.checkPassword === 'true' &&
- caConfig.caConfigInfo.isSignatureApprove === 'true' &&
- caConfig.caConfigInfo.caType != '5'
- ) {
- _private.checkCAPassword(true)
- } else {
- _private.batchSubmit()
- }
- },
- checkCAPassword: function (isBatch) {
- var setcss = function () {
- var item = parent.$('.ui-msgbox .ui-prompt .prompt')
- if ($(item)) {
- $(item).css({
- height: '78px',
- margin: '20px 0 20px 190px',
- background:
- 'url(/easweb/webviews/workflow/img/waitpic.png) no-repeat'
- })
- }
- }
- setTimeout(setcss, 100)
- var prmt = function (r, dialog) {
- if (r) {
- var res = -1
- try {
- res = checkPassword(r, caConfig.caConfigInfo.userName)
- } catch (errMsg) {
- _self.showInfo(
- _self._localeStr.WEB_USBKEYCHECKPASSDETAIL + errMsg.message
- )
- return false
- }
- if (res != 0) {
- _self.showInfo(_self._localeStr.WEB_USBKEYCHECKPASS)
- } else {
- if (isBatch) {
- _private.batchSubmit()
- } else {
- _private.innerSubmit()
- }
- }
- }
- }
- var cancel = function () {
- return
- }
- waf.msgBox.showPrompt({
- title: _self._localeStr.WEB_MESSPROMPT,
- icon: 'prompt',
- summaryMsg: _self._localeStr.WEB_INPUTUSBKEYPASSWORD,
- buttonCallBack: [prmt, cancel]
- })
- parent.$('#waf-messageBox-prompt-input').prop('type', 'password')
- },
- batchSubmit: function () {
- var info = _private.getbatchid()
- if (info == null) {
- return
- }
- _private._batchsubmit(info)
- },
- getbatchid: function () {
- var info = {}
- var assignIds = ''
- var billIds = ''
- var allbillIds = locationurl.billIds
- var allassignmentIds = locationurl.assignmentIds
- if (assign.batchApproveUrl) {
- var frame = document.getElementById('billFrame')
- billIds = $(frame)[0]
- .contentWindow.waf('#queryGrid')
- .dataGrid('getSelectedRows')
- } else {
- billIds = waf('#queryGrid').wafGrid('getSelectedRows')
- }
- if (billIds.length == 0) {
- billIds = allbillIds
- assignIds = allassignmentIds
- } else {
- for (var i = 0; i < allbillIds.split(';').length; i++) {
- var allbillId = allbillIds.split(';')[i]
- if (billIds.toString().indexOf(allbillId) > -1) {
- if (assignIds != '') {
- assignIds += ';'
- }
- assignIds += allassignmentIds.split(';')[i]
- }
- }
- billIds = billIds.join(';')
- }
- info.billIds = billIds
- info.assignIds = assignIds
- return info
- },
- _batchsubmit: function (info) {
- var approve = _private.getApprove()
- if (!approve) {
- return
- }
- var billIds = info.billIds
- var assignIds = info.assignIds
- approve.isSignatureApprove = caConfig.caConfigInfo.isSignatureApprove
- if (
- caConfig.caConfigInfo.isSignatureApprove === 'true' &&
- caConfig.caConfigInfo.caType != '5'
- ) {
- if (!_private.beforeBatchSubmitSigature(billIds)) {
- return
- }
- approve.plainTextMap = caConfig.plainTextMap
- approve.plainSignatureMap = caConfig.plainSignatureMap
- }
- var nextPersons = _private.getNextPersons()
- if (!nextPersons) {
- return
- }
- var ok = function () {
- var params = {}
- approve.nextActs = nextPersons
- params.approve = JSON.stringify(approve)
- params.assignIds = assignIds
- params.billIds = billIds
- waf.doPost({
- url: waf.getContextPath() + '/common/tree.do?method=batchSubmits',
- data: params,
- success: function (data) {
- if (data == 'OK') {
- _self.showSuccess(_self._localeStr.WEB_BATCHAPPROVESUCCESS)
- _private.backto()
- } else {
- _self.showInfo(_self._localeStr.WEB_PLEASEREFRESH)
- }
- }
- })
- }
- var cancel = function () {
- return
- }
- if (showerror != '') {
- waf.msgBox.showConfirm({
- title: _self._localeStr.WEB_MESSPROMPT,
- summaryMsg: showerror,
- buttonType: 'ok-cancel',
- buttonCallBack: [ok, cancel]
- })
- } else {
- ok()
- }
- },
- getApprove: function () {
- var opinion = waf('#approveOpinion').val()
- if (
- assign.needApproveOpinion &&
- (opinion == null || opinion.trim() == '')
- ) {
- _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTSNOBLANK)
- return null
- }
- if (opinion != null && opinion.length > 1000) {
- _self.showInfo(_self._localeStr.WEB_APPROVALCOMMENTSTOOLONG)
- return null
- }
- var ispass = null
- var approveResult = waf('#approveResult').wafRadioGroup('getValue')
- if (approveResult == 'false') {
- ispass = 'false'
- if (assign.mustFillOpinionWhenDisagree == 'true') {
- if (
- opinion == null ||
- opinion.trim() == '' ||
- opinion == _self._localeStr.WEB_DISAGREE
- ) {
- _self.showInfo(_self._localeStr.WEB_DISAGREEOPINION)
- return null
- }
- }
- } else {
- if (approveResult == 'true') {
- ispass = 'true'
- }
- }
- var approve = {}
- approve.assignId = assign.assignId
- approve.id = assign.id
- approve.opinion = opinion
- var handlerOpinion = waf('#policy').wafSelect('getValue')
- if (handlerOpinion) {
- approve.handlerOpinion = handlerOpinion
- } else {
- approve.handlerOpinion = '0'
- }
- approve.handlerContent = waf('#policy').wafSelect('getSelectedAlias')
- approve.approveResult = ispass
- approve.transitionId = transId
- approve.isSendSMS = waf('#sendmsg').wafCheckbox('isChecked')
- ? 'true'
- : 'false'
- approve.isSendMail = waf('#sendmail').wafCheckbox('isChecked')
- ? 'true'
- : 'false'
- if (assign.multiapproveinfoId) {
- approve.id = assign.multiapproveinfoId
- }
- var isesignaturecheck = false
- if (approvetype == 'approve' || approvetype == 'batchapprove') {
- isesignaturecheck = waf('#esignature').wafCheckbox('isChecked')
- } else {
- if (approvetype == 'manualdecision') {
- isesignaturecheck = waf('#esignature1').wafCheckbox('isChecked')
- }
- }
- if (assign.isEsignature && isesignaturecheck) {
- approve.esignatureid = assign.esignatureId
- }
- return approve
- },
- beforeBatchSubmitSigature: function (selectBillIds) {
- var modelIDs = ''
- var tbillIDs
- if (Object.prototype.toString.call(selectBillIds) === '[object Array]') {
- tbillIDs = selectBillIds
- } else {
- tbillIDs = selectBillIds.split(';')
- }
- for (var i = 0; i < tbillIDs.length; i++) {
- if (modelIDs != '') {
- modelIDs += ','
- }
- modelIDs += tbillIDs[i]
- }
- if (modelIDs === undefined || modelIDs == null || modelIDs === '') {
- waf.msgBox.showError("bill id can't be null")
- return false
- }
- var actionUrl =
- waf.getContextPath() +
- '/component/ca.do?method=getPlainTextFromDB&billIDs=' +
- waf.encodeURIComponent(modelIDs) +
- '&isFromWF=true'
- waf.doPost({
- url: actionUrl,
- async: false,
- success: function (data) {
- if (data == null || data == '' || data == undefined) {
- return false
- } else {
- caConfig.plainTextMap = data.plainTextMap
- }
- },
- error: function (data) {
- waf.msgBox.showError('getPlainTextFromDB failed')
- return false
- }
- })
- var arraySignature = ''
- var billids = modelIDs.split(',')
- for (var i = 0; i < billids.length; i++) {
- var key = billids[i]
- var signResult = -1
- try {
- signResult = signMessage(
- caConfig.plainTextMap[key],
- caConfig.caConfigInfo.userName
- )
- } catch (errMsg) {
- _self.showInfo(_self._localeStr.WEB_SIGANATUREFAILED + errMsg.message)
- return false
- }
- if (signResult == 1 || signResult == 2 || signResult == 3) {
- if (signResult == 1 || signResult == 2) {
- _self.showInfo(_self._localeStr.WEB_SIGAFAILEDUSBKEY)
- }
- return false
- }
- if (arraySignature != '') {
- arraySignature += ','
- }
- arraySignature += signResult
- }
- caConfig.plainSignatureMap = arraySignature
- return true
- },
- getNextPersons: function (isSave) {
- var locale = waf.getContext().locale
- var symbol = '。'
- if (locale == 'l1') {
- symbol = '.'
- }
- showerror = ''
- var nextPersons = []
- var ispass = waf('#approveResult').wafRadioGroup('getValue')
- if (ispass == 'false') {
- return nextPersons
- }
- var isnextact = waf(nextActIndex).wafCheckbox('isChecked')
- var directActName = ''
- if (isnextact) {
- var num = 0
- var index = 0
- var directCount = 0
- var directIsSel = false
- for (var i = 0; i != assign.nextActs.length; i++) {
- if (_private.isPredict && !assign.nextActs[i].isPredict) {
- continue
- }
- var act = {}
- act.actKey = assign.nextActs[i].actKey
- act.persons = {}
- var flag = false
- directCount++
- for (var actId in selnextPersons) {
- if (actId == assign.nextActs[i].actId) {
- var persons = selnextPersons[actId]
- for (var id in persons) {
- act.persons[id] = 'true'
- flag = true
- }
- }
- }
- if (directCount == 1) {
- directIsSel = flag
- }
- if (!flag) {
- if (num < 3) {
- if (showerror != '') {
- showerror += '、'
- }
- showerror += assign.nextActs[i].actName
- }
- num++
- if (num == 1) {
- directActName = assign.nextActs[i].actName
- }
- } else {
- nextPersons[index] = act
- index++
- }
- }
- if (num > 0) {
- if (num > 2) {
- showerror +=
- _self._localeStr.WEB_ANDSOON + num + _self._localeStr.WEB_NODE
- }
- if (!isSave && assign.mustSetAllNextPerson) {
- _self.showInfo(
- _self._localeStr.WEB_NEXTACTIVITY + ':' + showerror + symbol
- )
- return null
- }
- if (
- !isSave &&
- assign.mustSetAllNextPersonDirectNull &&
- !directIsSel
- ) {
- _self.showInfo(
- _self._localeStr.WEB_NEXTACTIVITY + ':' + directActName + symbol
- )
- return null
- }
- showerror += _self._localeStr.WEB_NOPARTICIPANTSUBMIT
- }
- }
- return nextPersons
- },
- manualdecisionsubmit: function () {
- var selectValue = waf('#radioDecision').wafRadioGroup('getValue')
- if (selectValue) {
- var selItems = $(
- "#radioDecision input[value='" + selectValue + "']"
- ).next()[0].innerHTML
- var params = {}
- var nextPersons = _private.getNextPersons()
- if (!nextPersons) {
- return
- }
- var ok = function () {
- nextPersons = JSON.stringify(nextPersons)
- params.nextperson = nextPersons
- params.assignId = assign.assignId
- params.decisionTitle = assign.decisionName
- params.decisionItems = assign.decisionItems
- params.decisionDesc = assign.decisionDesc
- params.decisionOpinions = assign.decisionOpinions
- params.SelectedItems = selItems
- params.SelectedOpinions = selectValue.substr(
- 0,
- selectValue.indexOf('_')
- )
- waf.doPost({
- url:
- waf.getContextPath() + '/manualdecision/submit.do?method=submit',
- data: params,
- success: function (data) {
- _self.showSuccess(_self._localeStr.WEB_DECISIONSUBMITSUCCESS)
- _private.backto()
- }
- })
- }
- var cancel = function () {
- return
- }
- if (showerror != '') {
- waf.msgBox.showConfirm({
- title: _self._localeStr.WEB_MESSPROMPT,
- summaryMsg: showerror,
- buttonType: 'ok-cancel',
- buttonCallBack: [ok, cancel]
- })
- } else {
- ok()
- }
- }
- },
- beforeInnerSubmit: function () {
- if (
- caConfig.caConfigInfo.checkPassword === 'true' &&
- caConfig.caConfigInfo.isSignatureApprove === 'true' &&
- caConfig.caConfigInfo.caType != '5'
- ) {
- _private.checkCAPassword(false)
- } else {
- _private.innerSubmit()
- }
- },
- innerSubmit: function () {
- if (
- assign.mustUploadAttachment &&
- waf('#approveResult').wafRadioGroup('getValue') == 'true'
- ) {
- var isCurAssignUploadAttach = false
- waf.doPost({
- url:
- waf.getContextPath() +
- '/iwebattachment.do?method=isCurAssignUploadAttach',
- data: { assignId: assign.assignId },
- async: false,
- success: function (data) {
- if (data == false) {
- _self.showWarning(_self._localeStr.WEB_MUSTUPLOAD)
- }
- isCurAssignUploadAttach = data
- }
- })
- if (!isCurAssignUploadAttach) {
- return
- }
- }
- assign.operation = 'approve'
- var callback = function (isSuccess) {
- if (isSuccess) {
- _private._submit(false)
- }
- }
- var issubmit = _private.checkIsSave(callback, 'submit')
- if (issubmit == null) {
- _self.jMessageAlert(_self._localeStr.WEB_CHECKERRORSUBMITEND)
- return false
- }
- _private._submit(issubmit)
- },
- _submit: function (isReadOnly) {
- var approve = _private.getApprove()
- if (!approve) {
- return
- }
- var nextPersons = _private.getNextPersons()
- if (!nextPersons) {
- return
- }
- var ok = function () {
- approve.operation = assign.operation
- var op = approve.operation
- if (
- caConfig.caConfigInfo.isSignatureApprove === 'true' &&
- caConfig.caConfigInfo.caType != '5'
- ) {
- if (!_private.beforeSubmitSigature()) {
- return
- }
- approve.plainText = caConfig.CA_plainText
- approve.signature = caConfig.CA_signature
- }
- if (
- isReadOnly === undefined ||
- isReadOnly === null ||
- isReadOnly === ''
- ) {
- isReadOnly = true
- }
- if (!isReadOnly) {
- var frame = document.getElementById('billFrame')
- if (
- frame.contentDocument.getElementById('frame_tab_0') != null &&
- frame.contentDocument.getElementById('frame_tab_0') != undefined
- ) {
- frame = frame.contentDocument.getElementById('frame_tab_0')
- }
- if (frame.contentWindow._self.getCurrentModel) {
- var modelInfo = frame.contentWindow._self.getCurrentModel()
- var editModel = JSON.stringify(modelInfo)
- approve.model = editModel
- }
- if (approve.model == null) {
- if (frame.contentWindow._self.fireEvent) {
- var s = frame.contentWindow._self.fireEvent('save')
- if (!s) {
- return false
- }
- }
- }
- }
- approve.isReadOnly = isReadOnly.toString()
- approve.isSignatureApprove = caConfig.caConfigInfo.isSignatureApprove
- approve.nextActs = nextPersons
- if ($('#textCC').prop('personIds')) {
- approve.ccPersonIds = $('#textCC').prop('personIds')
- }
- var params = {}
- params.approve = JSON.stringify(approve)
- waf.doPost({
- url: waf.getContextPath() + '/common/tree.do?method=submits',
- data: params,
- success: function (data) {
- if (data) {
- assign.id = data
- _self.showSuccess(_self._localeStr.WEB_SUBMITSUCCESS)
- _private.backto()
- } else {
- _self.showInfo(_self._localeStr.WEB_PLEASEREFRESH)
- }
- }
- })
- }
- var cancel = function () {
- return
- }
- if (showerror != '') {
- waf.msgBox.showConfirm({
- title: _self._localeStr.WEB_MESSPROMPT,
- summaryMsg: showerror,
- buttonType: 'ok-cancel',
- buttonCallBack: [ok, cancel]
- })
- } else {
- ok()
- }
- },
- beforeSubmitSigature: function () {
- var plainText = ''
- var signatureField = caConfig.caConfigInfo.signatureFields
- if (signatureField === null || signatureField === '') {
- return true
- }
- var signatureFields = signatureField.split(';')
- for (var i = 0; i < signatureFields.length; i++) {
- var srcValue = 'CANOTSIGNATURE'
- try {
- srcValue = eval(
- "document.getElementById('billFrame').contentWindow.document.getElementsByName('" +
- signatureFields[i] +
- "')[0].value"
- )
- } catch (e) {
- srcValue = 'CANOTSIGNATURE'
- }
- if (typeof srcValue == 'undefined') {
- srcValue = 'CANOTSIGNATURE'
- }
- if (
- caConfig.caConfigInfo.precisionInfo &&
- caConfig.caConfigInfo.precisionInfo[signatureFields[i]]
- ) {
- var pos = parseInt(
- caConfig.caConfigInfo.precisionInfo[signatureFields[i]]
- )
- if (pos < 0) {
- pos = 2
- } else {
- if (pos > 4) {
- pos = 4
- }
- }
- srcValue = _private.toDecimal(srcValue, pos)
- }
- plainText = plainText + srcValue
- }
- var signResult = -1
- try {
- signResult = signMessage(plainText, caConfig.caConfigInfo.userName)
- } catch (errMsg) {
- _self.showInfo(_self._localeStr.WEB_SIGANATUREFAILED + errMsg.message)
- return false
- }
- if (signResult == 1 || signResult == 2 || signResult == 3) {
- if (signResult == 1 || signResult == 2) {
- _self.showInfo(_self._localeStr.WEB_SIGAFAILEDUSBKEY)
- return false
- }
- } else {
- caConfig.CA_plainText = plainText
- caConfig.CA_signature = signResult
- }
- return true
- },
- toDecimal: function (src, pos) {
- var f = parseFloat(src)
- if (isNaN(f)) {
- return false
- }
- var src_rs = src.indexOf('.')
- if (src_rs > 0) {
- var src_zero = src.lastIndexOf('0')
- while (src.length == src_zero + 1) {
- src = src.substring(0, src_zero)
- src_zero = src.lastIndexOf('0')
- }
- if (src.length == src_rs + 1) {
- var src_int = src.substring(0, src_rs)
- src = src_int
- }
- if (pos == 0) {
- return src
- }
- }
- var f = Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos)
- var s = f.toString()
- var rs = s.indexOf('.')
- if (rs < 0 && pos > 0) {
- rs = s.length
- s += '.'
- }
- while (s.length <= rs + pos) {
- s += '0'
- }
- return s
- },
- save: function (event, value) {
- var callback = function (isSuccess) {
- if (isSuccess) {
- _private._save()
- }
- }
- var issubmit = _private.checkIsSave(callback, 'save')
- if (issubmit == 'callBack') {
- return
- }
- if (issubmit == null) {
- _self.jMessageAlert(_self._localeStr.WEB_CHECKERRORSUBMITEND)
- return false
- }
- _private._save(issubmit)
- if (!issubmit && riskInsight) {
- billInsightOption = _private.getWeakRisk()
- _private.updateBillInsightNum(billInsightOption)
- }
- },
- checkIsSave: function (callback, type) {
- var issubmit = null
- if (!assign.billIsReadOnly) {
- if (
- type == 'submit' &&
- assign.disagreenotsave &&
- waf('#approveResult').wafRadioGroup('getValue') == 'false'
- ) {
- return true
- }
- var frame = document.getElementById('billFrame')
- if (frame) {
- if (
- frame.contentWindow._self &&
- frame.contentWindow._self.saveAndCallBack
- ) {
- frame.contentWindow._self.saveAndCallBack(callback)
- return 'callBack'
- } else {
- var canSaveBill = false
- var haveChangeBill = null
- var contentWindowSelf = null
- if (frame.contentWindow._self) {
- contentWindowSelf = frame.contentWindow._self
- } else {
- if (
- frame.contentDocument.getElementById('frame_tab_0') &&
- frame.contentDocument.getElementById('frame_tab_0')
- .contentWindow._self
- ) {
- contentWindowSelf =
- frame.contentDocument.getElementById('frame_tab_0')
- .contentWindow._self
- }
- }
- if (contentWindowSelf) {
- var WFBizSubmitCheckPriority = false
- if (contentWindowSelf.isWFBizSubmitCheckPriority) {
- WFBizSubmitCheckPriority =
- contentWindowSelf.isWFBizSubmitCheckPriority()
- }
- if (WFBizSubmitCheckPriority) {
- if (contentWindowSelf.fireEvent) {
- haveChangeBill = contentWindowSelf.fireEvent(
- 'judgeDataModifyActionEvent',
- ['workflow']
- )
- } else {
- if (contentWindowSelf.checkBillDataChanges) {
- haveChangeBill = contentWindowSelf.checkBillDataChanges()
- }
- }
- if (contentWindowSelf.beforeSubmit) {
- canSaveBill = contentWindowSelf.beforeSubmit()
- } else {
- if (contentWindowSelf.fireEvent) {
- canSaveBill =
- contentWindowSelf.fireEvent('fieldOnStoreEvent') &&
- contentWindowSelf.fireEvent('submitBeforeActionEvent')
- }
- }
- } else {
- if (contentWindowSelf.beforeSubmit) {
- canSaveBill = contentWindowSelf.beforeSubmit()
- } else {
- if (contentWindowSelf.fireEvent) {
- canSaveBill =
- contentWindowSelf.fireEvent('fieldOnStoreEvent') &&
- contentWindowSelf.fireEvent('submitBeforeActionEvent')
- }
- }
- if (contentWindowSelf.fireEvent) {
- haveChangeBill = contentWindowSelf.fireEvent(
- 'judgeDataModifyActionEvent',
- ['workflow']
- )
- } else {
- if (contentWindowSelf.checkBillDataChanges) {
- haveChangeBill = contentWindowSelf.checkBillDataChanges()
- }
- }
- }
- if (canSaveBill) {
- if (typeof haveChangeBill == 'boolean') {
- issubmit = !haveChangeBill
- } else {
- issubmit = false
- }
- }
- } else {
- issubmit = true
- }
- }
- } else {
- issubmit = true
- }
- } else {
- issubmit = true
- }
- return issubmit
- },
- _save: function (isReadOnly) {
- assign.operation = 'approve'
- var approve = _private.getApprove()
- if (!approve) {
- return
- }
- if (
- isReadOnly === undefined ||
- isReadOnly === null ||
- isReadOnly === ''
- ) {
- isReadOnly = true
- }
- if (!isReadOnly) {
- var frame = document.getElementById('billFrame')
- if (
- frame.contentDocument.getElementById('frame_tab_0') != null &&
- frame.contentDocument.getElementById('frame_tab_0') != undefined
- ) {
- frame = frame.contentDocument.getElementById('frame_tab_0')
- }
- if (frame.contentWindow._self.getCurrentModel) {
- var modelInfo = frame.contentWindow._self.getCurrentModel()
- var editModel = JSON.stringify(modelInfo)
- approve.model = editModel
- }
- if (approve.model == null) {
- if (frame.contentWindow._self.fireEvent) {
- var s = frame.contentWindow._self.fireEvent('save')
- if (!s) {
- return false
- }
- }
- }
- }
- approve.isReadOnly = isReadOnly.toString()
- if ($('#textCC').prop('personIds')) {
- approve.ccPersonIds = $('#textCC').prop('personIds')
- approve.personName = $('#textCC').prop('value')
- }
- var params = {}
- params.approve = JSON.stringify(approve)
- waf.doPost({
- url: waf.getContextPath() + '/common/tree.do?method=saves',
- data: params,
- success: function (data) {
- if (data) {
- assign.id = data
- _self.showSuccess(_self._localeStr.WEB_SAVESUCCESS)
- }
- }
- })
- },
- backto: function () {
- try {
- if (
- $('#billFrame').length > 0 &&
- $('#billFrame')[0].contentWindow._self.fireEvent
- ) {
- $('#billFrame')[0].contentWindow._self.fireEvent('destroyEvent')
- }
- } catch (e) {
- console.log('流程中心手动释放单据锁失败')
- }
- if (waf.isInFramePage()) {
- waf.closeCurPageTab()
- } else {
- if (
- top &&
- top.jMessager &&
- top.jMsgcenter &&
- top.jMsgcenter.tab_post_add
- ) {
- setTimeout(function () {
- top.jMessager.sendMsg(top.jMsgcenter.tab_close)
- }, 800)
- } else {
- setTimeout(function () {
- try {
- if (window.opener) {
- if (window.opener.refreshCurrentPage) {
- window.opener.refreshCurrentPage()
- }
- if (opener.waf && opener.waf('#queryGrid')[0] != undefined) {
- opener.waf('#queryGrid').wafGrid('reloadGrid')
- }
- }
- } catch (e) {}
- try {
- // 尝试关闭窗口
- //window.close();
- // 检查窗口是否仍然存在,如果存在则表示没有权限
- //if (!window.closed) {
- console.log("没有权限关闭窗口。");
- waf.doGet({
- url: '/shr/shr/msf/service.do?method=callService&serviceName=getSsoOAUrl&ssoPath=http%3a%2f%2foa.shichuangyi.cn%3a8080%2fwui%2findex.html%3fssoToken%3d%7b0%7d%23%2fmain%2fworkflow%2flistDoing%3fmenuIds%3d1%2c13%26menuPathIds%3d1%2c13%26_key%3dybt3pm',
- success: function (data) {
- location.href = data
- }
- });
- //location.href = "/shr/dynamic.do?uipk=shr.workflow.view&inFrame=true";
- //}
- } catch (error) {
- console.log("关闭窗口失败:", error.message);
- _self.showSuccess(_self._localeStr.WEB_TASKHASDONE)
- }
- }, 500)
- }
- }
- },
- addUploadHtml: function () {
- var attachmentUploadUrl =
- waf.getContextPath() +
- '/iwebattachment.do?method=upload&bosID=' +
- encodeURIComponent(assign.billId) +
- '&beizhu=' +
- assign.assignId
- var options = {
- autoUpload: true,
- url: attachmentUploadUrl,
- multiSelect: true,
- onComplete: function (e, data) {
- _private.getAttchmentcount()
- },
- onAdd: function (e, data) {},
- onFail: function (e, data) {
- if (data.result.length > 0) {
- if (data.result[0].error) {
- _self.showInfo(data.result[0].error)
- }
- }
- }
- }
- $('#upload').wafFileUploadUI(options)
- _private.getAttchmentcount()
- },
- getAttchmentcount: function () {
- var params = {}
- params.assignId = assign.assignId
- params.billId = assign.billId
- var pageType = _self.getUrlParam('type')
- if (pageType != null && 'passComent' === pageType) {
- params.isPassAround = true
- }
- waf.doPost({
- url: waf.getContextPath() + '/iwebattachment.do?method=getDataList',
- data: params,
- success: function (data) {
- if (data.disabled) {
- $('#attchment,.attchmentnuminfo,#upload').remove()
- return
- }
- if (!data.canAdd) {
- $('#upload').remove()
- }
- var len = data.list.length
- $('#attchmentnum').html(len)
- if (len > 0) {
- waf('#attchment').wafSection('open')
- } else {
- waf('#attchment').wafSection('close')
- }
- var _html = ''
- for (var i = 0; i < len; i++) {
- var row = data.list[i]
- var simpleName = row.simpleName
- var classname = 'file'
- var picFormat = ['jpg', 'gif', 'jpeg', 'png', 'bmp']
- if (picFormat.indexOf(simpleName) > -1) {
- classname = 'pic'
- }
- _html +=
- '<li><div><i class="' +
- classname +
- '"></i><span class="name" title="' +
- row.name +
- '.' +
- simpleName +
- '">' +
- row.name +
- '.' +
- simpleName +
- '</span><span class="size">(' +
- row.size +
- ')</span><a class="download" href="/easweb/webviews/workflow/download.jsp?bosID=' +
- row.id +
- '" download="' +
- row.name +
- '.' +
- simpleName +
- '" target="_blank"></a>'
- if (classname == 'pic') {
- _html +=
- '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
- row.id +
- "','pic')\"></i>"
- } else {
- if (simpleName == 'pdf') {
- _html +=
- '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
- row.id +
- "','pdf')\"></i>"
- }
- }
- if (row.canDelete) {
- _html +=
- '<i class="delete" onclick="javascript:_self.attachmentDelete(\'' +
- row['boAttchAsso.id'] +
- "','" +
- row.id +
- '\')"></i>'
- }
- _html += '</div></li>'
- }
- $('#attachmentContent ul')[0].innerHTML = _html
- }
- })
- },
- attachmentDelete: function (bosId, attachId) {
- var ok = function () {
- waf.doPost({
- url: waf.getContextPath() + '/iwebattachment.do?method=delete',
- data: { bosId: bosId, attachId: attachId },
- success: function (data) {
- _self.showSuccess(_self._localeStr.WEB_ATTACHMENTDELETESUCESS)
- _self.getAttchmentcount()
- }
- })
- }
- var cancel = function () {
- return
- }
- waf.msgBox.showConfirm({
- title: _self._localeStr.WEB_MESSPROMPT,
- summaryMsg: _self._localeStr.WEB_DeleteFile,
- buttonType: 'ok-cancel',
- buttonCallBack: [ok, cancel]
- })
- },
- attachmentView: function (id, type) {
- var url = ''
- if (type == 'pic') {
- url = '/easweb/webviews/workflow/viewpic.jsp?bosID=' + id
- } else {
- if (type == 'pdf') {
- url =
- '/easweb/webviews/webframework/webcom/attachment/view.jsp?bosID=' +
- id
- }
- }
- window.open(url, '_blank')
- },
- billImage: function (event, value) {
- var params = {}
- params.billID = assign.billId
- params.method = 'getimageurl'
- waf.doPost({
- url: waf.getContextPath() + '/workflow/approve.do',
- data: params,
- success: function (data) {
- var url = data.imgurl
- if (url == '') {
- _self.showWarning(
- _self._localeStr.WEB_IMAGESTATE +
- data.state +
- _self._localeStr.WEB_SUPPORTSTATE
- )
- } else {
- if (url == 'noImg') {
- _self.showWarning(_self._localeStr.WEB_HASNOIMAGE)
- } else {
- window.open(url, '_blank')
- }
- }
- }
- })
- },
- bill: function (event, value) {
- var para = {}
- if (approvetype == 'batchapprove') {
- var assignIds = _private.getbatchid().assignIds
- if (assignIds.split(';').length != 1) {
- _self.showInfo(_self._localeStr.WEB_SELECTARECORD)
- return false
- }
- para.sourceID = assignIds
- } else {
- para.sourceID = assign.assignId
- }
- para.msgId = msgId
- wfCommonUtil.showBill(para)
- },
- messageDigest: function () {
- var messageDigest = assign.messageDigest
- if (messageDigest.toString().indexOf('table') > 0) {
- waf('#panel5').wafPanel('option', 'hidden', true)
- waf('#bill').wafSection('option', 'hidden', false)
- document.getElementById('bill_content').innerHTML = messageDigest
- } else {
- waf('#billFrame').remove()
- waf('#billAttachment').remove()
- var billDigest = eval('(' + messageDigest + ')')
- var options = {
- title: _self._localeStr.WEB_BASICINFO,
- id: 'billBaseInfo',
- name: 'billBaseInfo',
- openIconCls: 'ui-section-minus',
- closeIconCls: 'ui-section-plus',
- autoOpen: true,
- style: 'margin-right: 0px;'
- }
- var billBaseInfo = waf.createDOM('section', options)
- waf.appendDOM(waf('#panel5'), billBaseInfo)
- waf.initComponent('section', options, billBaseInfo)
- var items = billDigest.items
- for (var i = 0; i < items.length; i++) {
- var labeloptions = {
- id: 'labelContainer' + i,
- caption: items[i][0],
- style: 'width: 33%;float: left;'
- }
- var labeldom = waf.createDOM('labelContainer', labeloptions)
- waf('#billBaseInfo').wafSection('appendChildren', labeldom)
- waf.initComponent('labelContainer', labeloptions, labeldom)
- var txtoptions = { id: 'billbase' + i, caption: items[i][1] }
- var textDom = waf.createDOM('label', txtoptions)
- labeldom.wafLabelContainer('append', textDom)
- waf.initComponent('label', txtoptions, textDom)
- }
- var entries = billDigest.entrys
- for (var j = 0; j < entries.length; j++) {
- var obj = entries[j]
- var billEntriesoptions = {
- title: obj.alias.l2,
- id: 'billEntriesInfo' + j,
- name: 'billEntriesInfo' + j,
- openIconCls: 'ui-section-minus',
- closeIconCls: 'ui-section-plus',
- autoOpen: true,
- style: 'margin-right: 0px;'
- }
- var billEntriesInfo = waf.createDOM('section', billEntriesoptions)
- waf.appendDOM(waf('#panel5'), billEntriesInfo)
- waf.initComponent('section', billEntriesoptions, billEntriesInfo)
- if (obj.values.length > 0) {
- var colmodel = []
- var env = obj.values[0].items
- for (var m = 0; m < env.length; m++) {
- var para = { name: env[m][3], label: env[m][0] }
- colmodel.push(para)
- }
- var myGridoptions = { id: 'myGrid' + j, colModel: colmodel }
- var dom = waf.createDOM('grid', myGridoptions)
- waf('#billEntriesInfo' + j).wafSection('appendChildren', dom)
- waf.initComponent('grid', myGridoptions, dom)
- var rowData = obj.values
- var gridData = new Array()
- for (var n = 0; n < rowData.length; n++) {
- var rr = rowData[n].items
- var rowdata = {}
- for (var h = 0; h < rr.length; h++) {
- var colname = rr[h][3]
- rowdata[colname] = rr[h][1]
- }
- gridData.push(rowdata)
- }
- waf('#myGrid' + j).wafGrid('addRow', { data: gridData })
- }
- }
- }
- },
- initMsgDigestBillAttach: function () {
- var billAttachmentList = assign.billAttachments
- var billAttachmentOptions = {
- title: _self._localeStr.WEB_ATTACHMENT,
- id: 'billAttachment',
- name: 'billAttachment',
- openIconCls: 'ui-section-minus',
- closeIconCls: 'ui-section-plus',
- autoOpen: true,
- style: 'margin-right: 0px;'
- }
- var billAttachment = waf.createDOM('section', billAttachmentOptions)
- waf.appendDOM(waf('#panel5'), billAttachment)
- waf.initComponent('section', billAttachmentOptions, billAttachment)
- $('#billAttachment .title').after(
- '<span id="billAttachTitle">' +
- _self._localeStr.WEB_TOTALATCHMNT +
- '<i></i><span>' +
- billAttachmentList.length +
- '</span>个</span>'
- )
- var _html = "<div class='attachmentContent'><ul>"
- for (var i = 0; i < billAttachmentList.length; i++) {
- var row = billAttachmentList[i]
- var simpleName = row.simpleName
- var classname = 'file'
- var picFormat = ['jpg', 'gif', 'jpeg', 'png', 'bmp']
- if (picFormat.indexOf(simpleName) > -1) {
- classname = 'pic'
- }
- var judgeAttachType = ''
- if (row.attachTypeEnum == 1) {
- judgeAttachType =
- "<span class='procAttach'>" +
- _self._localeStr.WEB_PROCESSATTACHMENTS +
- '</span>'
- }
- _html +=
- '<li><div><i class="' +
- classname +
- '"></i><span class="name" title="' +
- row.name +
- '.' +
- simpleName +
- '">' +
- judgeAttachType +
- row.name +
- '.' +
- simpleName +
- '</span><span class="size">(' +
- row.size +
- ')</span><a class="download" href="/easweb/webviews/workflow/download.jsp?bosID=' +
- row.id +
- '" download="' +
- row.name +
- '.' +
- simpleName +
- '" target="_blank"></a>'
- if (classname == 'pic') {
- _html +=
- '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
- row.id +
- "','pic')\"></i>"
- } else {
- if (simpleName == 'pdf') {
- _html +=
- '<i class="preview" onclick="javascript:_self.attachmentView(\'' +
- row.id +
- "','pdf')\"></i>"
- }
- }
- _html += '</div></li>'
- }
- _html += '</ul></div>'
- return _html
- },
- selattachment: function (item, attcreater, beizhu) {},
- showoperate: function (event, value) {
- var para = {}
- if (approvetype == 'batchapprove') {
- var assignIds = _private.getbatchid().assignIds
- if (assignIds.split(';').length != 1) {
- _self.showInfo(_self._localeStr.WEB_SELECTARECORD)
- return false
- }
- para.assignmentId = assignIds.split(';')[0]
- } else {
- para.assignmentId = assign.assignId
- }
- if (wfCommonUtil.getOperationRecordsPerm(para.assignmentId)) {
- wfCommonUtil.showApproveDetail(para)
- } else {
- waf.msgBox.showInfo({
- title: _self._localeStr.WEB_MESSAGEALERT,
- summaryMsg: _self._localeStr.WEB_FORBIDVIEW
- })
- $('.ui-msgbox .content').width('330px')
- }
- },
- esignatureOnClick: function (event, ui) {
- if (ui.checked) {
- $('#esigndiv').show()
- } else {
- $('#esigndiv').hide()
- }
- },
- isWaf1Bill: function (url) {},
- jMessageAlert: function (message) {
- _self.showInfo(message)
- },
- onselect: function (event, ui) {
- if (riskInsight) {
- if (ui.panel.id == 'riskInsight') {
- waf('#billInsight').billInsight(
- 'intelligentInspection',
- billInsightOption.list
- )
- waf('body').unbind('click')
- $('.billInsight_cardPanel').draggable('disable')
- _private.updateBillInsightNum(billInsightOption)
- _private.resizeBillInsight(false)
- _private.curTab = 'riskInsight'
- } else {
- $('.billInsight_cardPanel').css('display', 'none')
- _private.curTab = ''
- }
- }
- },
- resizeBillInsight: function (windowResize) {
- var top = $('#li_approveTask').offset().top + 44
- var left = $('#li_approveTask').offset().left
- if (!windowResize) {
- left += 10
- }
- var width = $('#tabs_ul').width()
- var t =
- $('.ui-cardPanel').attr('style') + 'width:' + width + 'px !important'
- $('.billInsight_cardPanel').css('cssText', t)
- $('.billInsight_cardPanel').css({ top: top, left: left })
- $(
- '.ui-cardPanel .noRecords,.ui-cardPanel .noRecordsImage,.ui-cardPanel .noRecordsText'
- ).css({ width: '100%', margin: '0px', 'min-width': '160px' })
- },
- getWeakRisk: function () {
- var urlParams = waf.getUrlParam(assign.billEditUrl)
- var billId = urlParams.billId
- var uipk = urlParams.uipk
- var billInsightOption = {}
- waf.doPost({
- async: false,
- url:
- waf.getContextPath() + '/risk/ForWebController.do?method=getWeakRisk',
- data: { uipk: uipk, id: billId, riskIds: assign.riskInsight },
- success: function (data) {
- if (data != null) {
- billInsightOption = data
- }
- }
- })
- return billInsightOption
- },
- updateBillInsightNum: function (billInsightOption) {
- if (!billInsightOption.allExecSuccess) {
- $('#li_riskInsight span')
- .eq(0)
- .text(
- _self._localeStr.WEB_RISKINSIGHT +
- '(' +
- billInsightOption.failSize +
- ')'
- )
- } else {
- $('#li_riskInsight span').eq(0).text(_self._localeStr.WEB_RISKINSIGHT)
- }
- },
- openPerson: function (event, value) {
- var selectedIds = waf('#textCC').prop('personIds')
- var height = 552
- if (window.screen.height < 800) {
- height = 500
- }
- var tempWin
- if (parent.waf) {
- tempWin = parent.waf.window
- } else {
- tempWin = waf.window
- }
- var params = {}
- params.f7Type = encodeURIComponent('person')
- params.singleSelect = false
- tempWin.open({
- url:
- waf.getContextPath() +
- '/webviews/workflow/commonSelectF7.jsp?selectedIds=' +
- encodeURIComponent(selectedIds),
- openType: 'iframe',
- method: 'POST',
- data: params,
- style: { padding: '0px' },
- modal: true,
- title: _self._localeStr.WEB_CC,
- position: 'center',
- width: 1000,
- height: height,
- minHeight: height,
- minWidth: 1000,
- iconCls: 'waf-ui-icon',
- draggable: true,
- resizable: true,
- close: function (event, ui) {},
- retValCallBack: function (resultData) {
- if (
- resultData &&
- resultData.resultStr &&
- resultData.resultStr.length > 0
- ) {
- var val = resultData.resultStr.split('||')
- waf('#textCC').prop('personIds', val[1])
- waf('#textCC').val(val[2])
- }
- }
- })
- },
- _pageLoadCompletedEventHandler: function () {},
- openAttachmentPage: function (event, value) {
- var url =
- '/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.bos.workflow.metas.AttachmentList&assignId=' +
- assign.assignId +
- '&billId=' +
- encodeURIComponent(assign.billId)
- var pageType = _self.getUrlParam('type')
- if (pageType != null && 'passComent' === pageType) {
- url += '&isPassAround=true'
- }
- waf.window.open({
- url: url,
- openType: 'iframe',
- modal: true,
- title: _self._localeStr.WEB_ATCHMNTMANAGE,
- position: 'center',
- width: 900,
- height: 600,
- iconCls: 'waf-ui-icon',
- draggable: true,
- resizable: true,
- close: function (event, ui) {
- waf.window.close()
- _private.refreshAttachCount()
- }
- })
- },
- refreshAttachCount: function () {
- waf.doPost({
- url:
- waf.getContextPath() +
- '/iwebattachment.do?method=getAttachCountByBill',
- data: { billId: assign.billId },
- async: false,
- success: function (data) {
- _private.refreshAttachCountInner(data)
- }
- })
- },
- refreshAttachCountInner: function (count) {
- var attachmentBtnTitle = _self._localeStr.WEB_ATCHMNTMANAGE
- if (count > 0) {
- attachmentBtnTitle =
- _self._localeStr.WEB_ATCHMNTMANAGE + '(' + count + ')'
- }
- $('#attachmentBtn span').text(attachmentBtnTitle)
- },
- getAssignInfo: function () {
- return assign
- }
- })
- _self.subscribeEvent(
- 'pageLoadCompletedEvent',
- _private._pageLoadCompletedEventHandler,
- 'after'
- )
- return _public
- })
|