123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492 |
- var projectObj = {
- personnelId: null,
- accountId: null,
- channelId: null,
- projectId: null,
- nature: null,
- IsAdmin: null,
- remote: null,
- identify: null,
- xmid: null
- }
- function viewModel() {
- this.id = "";
- //渠道信息
- this.init = function () {
- var search = $("#dtn-search").val();
- $('#ChannelInfo').datagrid({
- url: '/ProManager/Datagrid',
- method: 'Get',
- singleSelect: true,
- rownumbers: true,
- onSelect: function (rowIndex, rowData) {
- $("#dtn-search-project").searchbox("setValue", "");
- projectObj.channelId = $('#ChannelInfo').datagrid("getSelected")["ID"];
- databindProject()
- databindStation(0)
- databindServer(0)
- databindWorker(0)
- databindProduct(0)
- databindModual(0)
- databindInstrument(0)
- databindRemote(0)
- databindInter(0)
- databindSmart(0)
-
- }
- });
- $('#project').datagrid({
- toolbar: '#btn_func',
- fit: true,
- rownumbers: true,
- columns: [[
- { field: '名称', title: '名称', width: 180 },
- { field: '负责人', title: '负责人', width: 80 },
- { field: '性质', title: '性质', width: 80, align: 'center' },
- { field: '实施方式', title: '实施方式', width: 80, align: 'center' },
- { field: '统一社会信用代码', title: '统一社会信用代码', width: 120, align: 'center' },
- {
- field: '状态', title: '项目状态', width: 70, align: 'center'
- },
- //{ field: '上线时间', title: '上线时间', width: 120, align: 'center' },
- //{ field: '验收时间', title: '验收时间', width: 120, align: 'center' },
- { field: '中心数量', title: '中心数量', width: 100 },
- { field: '村站数量', title: '村站数量', width: 80 },
- { field: '网络带宽', title: '网络带宽', width: 80 },
- { field: '服务器分离', title: '服务器分离', width: 90, align: 'center' },
- { field: '账号', title: '账号', width: 80 },
- { field: '密码', title: '密码', width: 80 },
- { field: '联系方式', title: '联系方式', width: 90, align: 'center' },
- { field: '启用监控', title: '启用监控', width: 90, align: 'center' },
- { field: '概况', title: '概况', width: 300 }
- ]]
- })
- }
- //加载项目
- this.load = function (id) {
- //ID
- $("#id").val(id);
- //性质
- $("#nature").combobox({
- url: '/ProManager/GetNature',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#nature').combobox('setValue', data[0].ID);
- }
- });
- //工作流目录
- $("#GZLMLID").combobox({
- url: '/ProManager/GetCatalog?id=1',
- valueField: 'ID',
- textField: '名称',
- onLoadSuccess: function (data) {
- $('#GZLMLID').combobox('setValue', data[0].ID);
- }
- });
- //实施方式
- $("#implementation").combobox({
- url: '/ProManager/GetImplementation',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#implementation').combobox('setValue', data[0].ID);
- }
- });
- //项目状态
- $("#state").combobox({
- url: '/ProManager/GetState',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#state').combobox('setValue', data[0].ID);
- }
- });
- $('#BHCustomer').combogrid({
- mode: 'remote',
- value: '',
- idField: '编码',
- textField: '名称',
- panelHeight: 380,
- url: "/ProManager/GetBHCustomer",
- columns: [[
- {
- field: 'son', title: '序号', width: 40,
- formatter: function (value, row, index) {//设置自动增长列
- index += 1;//设置起始序号为1,如果不加这行代码序号就会从0开始
- return index++;//根据行的数量不断自增
- }
- },
- { field: 'id', title: 'id', width: 100, hidden: true },
- { field: '编码', title: '编码', width: 100, hidden: true },
- { field: '名称', title: '客户名称', width: 230 },
- { field: '社会信用代码', title: '社会信用代码', width: 170 },
- { field: '简码', title: '简码', width: 100 }
- ]],
- onSelect: function (rowIndex, rowData) {
- $('#name').val(rowData.名称);
- $('#SocialCreditCode').val(rowData.社会信用代码);
- $('#simple').val(rowData.简码);
- $('#BHID').val(rowData.id);
- }
- });
- //上线时间
- $(function () {
- var curr_time = new Date();
- var str = curr_time.getFullYear() + "-";
- str += curr_time.getMonth() + 1 + "-";
- str += curr_time.getDate();
- $('#onlineDate').datebox('setValue', str);
- });
- }
- //绑定项目信息
- this.bindData = function (id) {
- //性质
- $("#nature").combobox({
- url: '/ProManager/GetNature',
- valueField: 'ID',
- textField: '显示名'
- });
- //实施方式
- $("#implementation").combobox({
- url: '/ProManager/GetImplementation',
- valueField: 'ID',
- textField: '显示名'
- });
- //项目状态
- $("#state").combobox({
- url: '/ProManager/GetState',
- valueField: 'ID',
- textField: '显示名'
- });
- //工作流目录
- $("#GZLMLID").combobox({
- url: '/ProManager/GetCatalog?id=1',
- valueField: 'ID',
- textField: '名称',
- });
- //详细信息加载
- $.ajax({
- url: '/ProManager/GetProInfo/' + id,
- method: 'GET',
- success: function (data) {
- if (data.code == 200) {
- $('#id').val(data.obj[0].渠道ID);
- $('#charge').val(data.obj[0].负责人);
- $('#name').val(data.obj[0].名称);
- $('#survey').val(data.obj[0].概况);
- $('#simple').val(data.obj[0].简码);
- $('#SocialCreditCode').val(data.obj[0].统一社会信用代码);
- $('#coreNum').val(data.obj[0].中心数量);
- $('#villageNum').val(data.obj[0].村站数量);
- $('#bandwidth').val(data.obj[0].网络带宽);
- if (data.obj[0].服务器分离 == 1) {
- $('#serveSeparate').switchbutton({ checked: true });
- }
- else {
- $('#serveSeparate').switchbutton({ checked: false });
- }
- $('#nature').combobox('setValue', data.obj[0].性质);
- $('#implementation').combobox('setValue', data.obj[0].实施方式);
- $('#state').combobox('setValue', data.obj[0].状态);
- $('#onlineDate').datebox('setValue', data.obj[0].上线时间);
- $('#checkDate').datebox('setValue', data.obj[0].验收时间);
- $('#endTime').val(data.obj[0].授权到期时间);
- $('#another').val(data.obj[0].分管领导);
- $('#anotherPhone').val(data.obj[0].分管领导电话);
- $('#principal').val(data.obj[0].项目对接人);
- $('#principalPhone').val(data.obj[0].项目对接人电话);
- $('#attentionLevel').val(data.obj[0].关注度);
- if (data.obj[0].启用监控 == 1) {
- $('#enable').switchbutton({ checked: true });
- }
- else {
- $('#enable').switchbutton({ checked: false });
- }
- $('#email').val(data.obj[0].邮件推送);
- $('#wxin').val(data.obj[0].微信推送);
- layui.use(['rate'], function () {
- var rate = layui.rate;
- // 单个渲染
- rate.render({
- elem: '.attentionLevel',
- choose: function (value) {
- $('#attentionLevel').val(value);
- console.log(value); // 获得选中的评分值
- },
- value: $('#attentionLevel').val()
- });
- });
- } else {
- //弹出错误消息
- ZLPMS.Alert(data.msg, 1);
- }
- }
- })
- //问题审核流程
- $.ajax({
- url: '/ProManager/GetXMWTLC/' + id,
- method: 'GET',
- success: function (data) {
- if (data.length > 0) {
- $("#SHID").val(data[0].ID)
- $("#GZLMLID").combobox('setValue', data[0].工作流目录ID);
- } else {
- //弹出错误消息
- top.ZLPMS.Msg("该项目暂未设置审核流程,请前往设置!");
- }
- }
- })
- //附件
- $.post("/ProManager/Attachment?id=" + id + "&type=1", {}, function (data) {
- if (data != null || data.length > 0) {
- $("#attchment").html();
- var html = "";
- for (var i = 0; i < data.length; i++) {
- if (data[i].type == 1) {
- html += "<div><img style='border:1px solid #000000' id='Attachment" + data[i].id + "' onclick='Zoom(" + '"' + data[i].base64ToImage + '"' + ")' src='data:image/jpg;base64," + data[i].base64 + "' width='50' height='50' /><i class='fa fa-times' id='icon" + data[i].id + "' aria-hidden='true' onclick='Delete_img(" + '"' + data[i].id + '"' + ")'></i></div>";
- }
- else {
- html += '<div><a href="#" id="Attachment' + data[i].id + '" onclick="downloadfile(' + data[i].id + ')">下载附件' + (i + 1) + "</a><i class='fa fa-times' aria-hidden='true' id='icon" + data[i].id + "' onclick='Delete_img(" + '"' + data[i].id + '"' + ")'></i></div>";
- }
- }
- $("#attchment").html(html);
- }
- })
- //BH客户数据获取
- $('#BHCustomer').combogrid({
- mode: 'remote',
- value: '',
- idField: '编码',
- textField: '名称',
- panelHeight: 380,
- url: "/ProManager/GetBHCustomer",
- columns: [[
- {
- field: 'son', title: '序号', width: 40,
- formatter: function (value, row, index) {//设置自动增长列
- index += 1;//设置起始序号为1,如果不加这行代码序号就会从0开始
- return index++;//根据行的数量不断自增
- }
- },
- { field: 'id', title: 'id', width: 100, hidden: true },
- { field: '编码', title: '编码', width: 100, hidden: true },
-
- { field: '名称', title: '客户名称', width: 230 },
- { field: '社会信用代码', title: '社会信用代码', width: 170 },
- { field: '简码', title: '简码', width: 100 }
- ]],
- onSelect: function (rowIndex, rowData) {
-
- $('#name').val(rowData.名称);
- $('#SocialCreditCode').val(rowData.社会信用代码);
- $('#simple').val(rowData.简码);
- $('#BHID').val(rowData.id);
-
- }
- });
- }
- //加载机构
- this.StationLoad = function (id) {
- //ID
- $("#ID").val(id);
- //项目等级
- $("#DJ").combobox({
- url: '/ProManager/GetLevel',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#DJ').combobox('setValue', data[0].ID);
- }
- });
- //项目状态
- $("#ZT").combobox({
- url: '/ProManager/GetState',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#ZT').combobox('setValue', data[0].ID);
- }
- });
- //上线时间
- $(function () {
- var curr_time = new Date();
- var str = curr_time.getFullYear() + "-";
- str += curr_time.getMonth() + 1 + "-";
- str += curr_time.getDate();
- $('#SXSJ').datebox('setValue', str);
- });
- //工作流目录
- $("#GZLMLID").combobox({
- url: '/ProManager/GetCatalog?id=2',
- valueField: 'ID',
- textField: '名称',
- onLoadSuccess: function (data) {
- $('#GZLMLID').combobox('setValue', data[0].ID);
- }
- });
-
- }
- //绑定机构信息
- this.StationBind = function (id) {
- //项目等级
- $("#DJ").combobox({
- url: '/ProManager/GetLevel',
- valueField: 'ID',
- textField: '显示名'
- });
- //项目状态
- $("#ZT").combobox({
- url: '/ProManager/GetState',
- valueField: 'ID',
- textField: '显示名'
- });
- $.ajax({
- url: '/ProManager/GetStationInfo/' + id,
- method: 'GET',
- success: function (data) {
- if (data.code == 200) {
- $("#ID").val(data.obj[0].ID);
- $("#XMID").val(data.obj[0].项目ID);
- $('#MC').val(data.obj[0].名称);
- $('#GK').val(data.obj[0].概况);
- $('#JM').val(data.obj[0].简码);
- $('#CWL').val(data.obj[0].床位量);
- $('#RMZL').val(data.obj[0].日门诊量);
- $('#NSR').val(data.obj[0].年收入);
- $('#DJ').combobox('setValue', data.obj[0].等级);
- $('#ZT').combobox('setValue', data.obj[0].状态);
- $('#SXSJ').datebox('setValue', data.obj[0].上线时间);
- $('#YSSJ').datebox('setValue', data.obj[0].验收时间);
- $('#IPD').val(data.obj[0].IP段);
- $('#FZRM').val(data.obj[0].负责人名);
- $('#DH').val(data.obj[0].电话);
- $('#GLRM').val(data.obj[0].管理人名);
- $('#GLRDH').val(data.obj[0].管理人电话);
- ProblemLoad($("#XMID").val())
- } else {
- //弹出错误消息
- ZLPMS.Alert(data.msg, 1);
- }
- }
- })
- //工作流目录
- $("#GZLMLID").combobox({
- url: '/ProManager/GetCatalog?id=2',
- valueField: 'ID',
- textField: '名称',
- });
- //问题审核流程
- function ProblemLoad(XMID) {
- $.ajax({
- url: '/ProManager/GetProblem?XMID=' + XMID + "&ID=" + id,
- method: 'GET',
- success: function (data) {
- if (data.length > 0) {
- $("#GZLMLID").combobox('setValue', data[0].工作流目录ID);
- } else {
- //弹出错误消息
- top.ZLPMS.Msg("该项目暂未设置审核流程,请前往设置!");
- }
- }
- })
- }
- }
- //加载服务器
- this.ServerLoad = function (id) {
- //ID
- $("#XMID").val(id);
- //服务器类型
- $("#LX").combobox({
- url: '/ProManager/GetServerType',
- valueField: 'ID',
- textField: '显示名',
- multiple: true,// 开启多选
- onLoadSuccess: function (data) {
- $('#LX').combobox('setValue', data[0].ID);
- }
- });
- //安装服务类型
- $("#AZFW").combobox({
- url: '/ProManager/GetInstallServerType',
- valueField: 'ID',
- textField: '显示名',
- multiple: true, // 开启多选
- onLoadSuccess: function (data) {
- $('#AZFW').combobox('setValue', data[0].ID);
- }
- });
- //数据库类型
- $("#SJKLX").combobox({
- url: '/ProManager/GetDataBaseType',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#SJKLX').combobox('setValue', '');
- }
- });
- //产品
- $("#CP").combobox({
- url: '/ProManager/GetProduct',
- valueField: 'ID',
- textField: '显示名',
- onLoadSuccess: function (data) {
- $('#CP').combobox('setValue', data[0].ID);
- }
- });
- }
- //绑定服务器
- this.ServerBind = function (id) {
- //ID
- $("#ID").val(id);
- //服务器类型
- $("#LX").combobox({
- url: '/ProManager/GetServerType',
- valueField: 'ID',
- textField: '显示名',
- multiple: true // 开启多选
- });
- //安装服务类型
- $("#AZFW").combobox({
- url: '/ProManager/GetInstallServerType',
- valueField: 'ID',
- textField: '显示名',
- multiple: true // 开启多选
- });
- //数据库类型
- $("#SJKLX").combobox({
- url: '/ProManager/GetDataBaseType',
- valueField: 'ID',
- textField: '显示名'
- });
- //产品
- $("#CP").combobox({
- url: '/ProManager/GetProduct',
- valueField: 'ID',
- textField: '显示名'
- });
- $.ajax({
- url: '/ProManager/GetServerInfo/' + id,
- method: 'GET',
- success: function (data) {
- if (data.code == 200) {
- $('#ID').val(id);
- $('#XMID').val(data.obj[0].项目ID);
- $('#NC').val(data.obj[0].内存);
- $('#XH').val(data.obj[0].型号);
- $('#CZJT').val(data.obj[0].操作系统);
- $('#CPU').val(data.obj[0].CPU);
- $('#IPDZ').val(data.obj[0].IP地址);
- $('#SJKBB').val(data.obj[0].数据库版本);
- $('#JQM').val(data.obj[0].机器码);
- $('#SM').val(data.obj[0].说明);
- if (data.obj[0].类型 != "" && data.obj[0].类型 != null) {
- $('#LX').combobox('setValue', data.obj[0].类型.split(","));
- }
- if (data.obj[0].安装服务 != "" && data.obj[0].类型 != null) {
- $('#AZFW').combobox('setValue', data.obj[0].安装服务.split(","));
- }
- $('#SJKLX').combobox('setValue', data.obj[0].数据库类型);
- $('#CP').combobox('setValue', data.obj[0].产品);
- $('#SJKLJC').val(data.obj[0].数据库连接串);
- $('#FWFXDK').val(data.obj[0].服务发现端口);
- $('#FHQ').val(data.obj[0].防火墙);
- $('#SDRJ').val(data.obj[0].杀毒软件);
- $('#BFFS').val(data.obj[0].备份方式);
- $('#BFLJ').val(data.obj[0].备份路径);
- $('#BFRJ').val(data.obj[0].备份软件);
- $('#ZH').val(data.obj[0].账号);
- $('#MM').val(data.obj[0].密码);
- } else {
- //弹出错误消息
- ZLPMS.Alert(data.msg, 1);
- }
- }
- })
- }
- //加载项目人员
- this.Workerload = function (id) {
- //ID
- $("#ID").val(id);
- //人员项目
- $("#XM").combobox({
- url: '/ProManager/GetWorkerInfo',
- valueField: 'ID',
- textField: '姓名'
- });
- //加入时间
- $(function () {
- var curr_time = new Date();
- var str = curr_time.getFullYear() + "-";
- str += curr_time.getMonth() + 1 + "-";
- str += curr_time.getDate();
- $('#RZSJ').datebox('setValue', str);
- });
- $('#RZSJ').datebox({ panelHeight: '250px' })
- }
- //加载产品
- this.ProductLoad = function (id) {
- //ID
- $("#ID").val(id);
- //产品
- $("#CPID").combobox({
- url: '/ProManager/GetProductByID',
- valueField: 'ID',
- textField: '名称',
- onChange: function (newValue, oldValue) {
- //版本
- $("#BB").combobox({
- url: '/ProManager/GetEditionByID/' + newValue,
- valueField: 'ID',
- textField: '版本号'
- });
- }
- });
- }
- //绑定产品
- this.ProductBind = function (id) {
- var cpID = "";
- //产品
- $("#CPID").combobox({
- url: '/ProManager/GetProductByID',
- valueField: 'ID',
- textField: '名称',
- onChange: function (newValue, oldValue) {
- cpID = newValue;
- $("#BB").combobox({
- url: '/ProManager/GetEditionByID/' + newValue,
- valueField: 'ID',
- textField: '版本号'
- });
- }
- });
- $.ajax({
- url: '/ProManager/GetProductInfo/' + id,
- method: 'GET',
- success: function (data) {
- if (data != null) {
- $('#CPID').combobox('setValue', data[0].ID);
- bindProduct(id);
- } else {
- //弹出错误消息
- top.ZLPMS.Msg("系统中没有该条数据");
- }
- }
- })
- //应用状态
- $("#YYZT").combobox({
- //data: [{ "ID": "-1", "名称": "无" }, { "ID": "0", "名称": "停用" }, { "ID": "1", "名称": "正在使用" }, { "ID": "2", "名称": "使用元HIS" }],
- url: '/ProManager/SelectNature?ID=DD2C3294-4FBB-4616-A046-07D3CAF52414',
- valueField: '代码',
- textField: '名称',
- limitToList: true,
- onLoadSuccess: function (data) {
- //let found = data.find(item => item.是否默认="0");
- //$(this).combobox('select', found.代码);
- }
- });
- }
- //版本和说明
- function bindProduct(id) {
- $.ajax({
- url: '/ProManager/GetProjectProducct/' + id,
- method: 'post',
- success: function (data) {
- $('#BB').combobox('setValue', data[0].版本);
- $('#YYZT').combobox('setValue', data[0].应用状态);
- $('#SM').val(data[0].说明);
- }
- })
- }
- //绑定远程方式
- this.RemoteLoad = function (obj) {
- obj = JSON.parse(obj.replace(/"/g, '"'))
- $("#ID").val(obj.ID)
- $("#MC").val(obj.名称);
- $("#ZH").val(obj.账号);
- $("#MM").val(obj.密码);
- $("#BZ").val(obj.备注);
- $("#LJR").val(obj.联系人);
- $("#LJRDH").val(obj.联系人电话);
- }
- //加载项目个性化
- this.IdentifyData = function (id) {
- //项目所属的产品
- $("#CPID").combobox({
- url: '/Problem/GetProductByID/' + id,
- valueField: '产品ID',
- textField: '名称',
- onChange: function (newValue, oldValue) {
- //版本
- $("#BB").combobox({
- url: '/ProManager/GetEditionByID/' + newValue,
- valueField: 'ID',
- textField: '版本号',
- });
- }
- })
- $("#XGR").combobox({
- url: '/ProManager/GetWorker/' + id,
- valueField: '姓名',
- textField: '姓名DECODE'
- });
- }
- //绑定项目个性化
- this.IdentifyLoad = function (obj) {
- $.get("/ProManager/GetDataById", { id: obj }, function (data) {
- //项目所属的产品
- $("#CPID").combobox({
- url: '/Problem/GetProductByID/' + data[0].项目ID,
- valueField: '产品ID',
- textField: '名称',
- onChange: function (newValue, oldValue) {
- //版本
- $("#BB").combobox({
- url: '/ProManager/GetEditionByID/' + newValue,
- valueField: 'ID',
- textField: '版本号',
- });
- }
- })
- $("#XGR").combobox({
- url: '/ProManager/GetWorker/' + data[0].项目ID,
- valueField: '姓名',
- textField: '姓名DECODE'
- });
- switch (data[0].修改性质) {
- case 1: $("input[name=XGXZ][value=1]").attr('checked', 'checked'); break;
- case 2: $("input[name=XGXZ][value=2]").attr('checked', 'checked'); break;
- case 3: $("input[name=XGXZ][value=3]").attr('checked', 'checked'); break;
- }
- $("#ID").val(data[0].ID)
- $("#XMID").val(data[0].项目ID)
- $("#MC").textbox("setValue", data[0].名称)
- $("#CPID").combobox('setValue', data[0].产品ID);
- $("#XGR").combobox('setValue', data[0].修改人);
- $("#BB").combobox('setValue', data[0].版本);
- UM.getEditor('XGSM').setContent(data[0].修改说明 == null ? "" : data[0].修改说明);
- $("#XGSJ").datebox("setValue", data[0].修改时间)
- })
- //附件
- $.post("/ProManager/Attachment?id=" + obj + "&type=1", {}, function (data) {
- if (data != null || data.length > 0) {
- $("#attchment").html();
- var html = "";
- for (var i = 0; i < data.length; i++) {
- if (data[i].type == 1) {
- html += "<div><img style='border:1px solid #000000' id='Attachment" + data[i].id + "' onclick='Zoom(" + '"' + data[i].base64ToImage + '"' + ")' src='data:image/jpg;base64," + data[i].base64 + "' width='50' height='50' /><i class='fa fa-times' id='icon" + data[i].id + "' aria-hidden='true' onclick='Delete_img(" + '"' + data[i].id + '"' + ")'></i></div>";
- }
- else {
- html += '<div><a href="#" id="Attachment' + data[i].id + '" onclick="downloadfile(' + data[i].id + ')">下载附件' + (i + 1) + "</a><i class='fa fa-times' aria-hidden='true' id='icon" + data[i].id + "' onclick='Delete_img(" + '"' + data[i].id + '"' + ")'></i></div>";
- }
- }
- $("#attchment").html(html);
- }
- })
- }
- //加载验收模块数据
- this.ModualData = function (id) {
- //项目所属的产品
- $("#CPID").combobox({
- url: '/Problem/GetProductByID/' + id,
- valueField: 'ID',
- textField: '名称',
- onChange: function (newValue, oldValue) {
- //所属模块
- $('#MKID').combotree({
- url: "/Problem/getmk/" + newValue,
- });
- }
- })
- }
- //初始化全局接口信息
- this.GlobalInit = function () {
- //项目
- $("#XMID").combobox({
- url: '/Problem/GetProjectByInfo',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- })
- //创建人
- $("#CJR").combobox({
- url: '/ProManager/GetinfoBynature?type=0',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- onLoadSuccess: function () {
- $.post("/ProManager/GetFeedbackID", function (data) {
- $("#CJR").combobox("setValue", data.id)
- })
- }
- })
- //负责人
- $("#ZRR").combobox({
- url: '/ProManager/GetinfoBynature?type=0',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- onLoadSuccess: function () {
- $.post("/ProManager/GetFeedbackID", function (data) {
- $("#ZRR").combobox("setValue", data.id)
- })
- }
- })
- //用户名称
- $("#JKDFMC").combobox({
- url: '/ProManager/GetinfoBynature?type=1',
- valueField: 'ID',
- textField: '名称',
- })
- }
- //绑定全局接口信息
- this.GlobalBind = function (id) {
- //项目
- $("#XMID").combobox({
- url: '/Problem/GetProjectByInfo',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- })
- //创建人
- $("#CJR").combobox({
- url: '/ProManager/GetinfoBynature?type=0',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- onLoadSuccess: function () {
- $.post("/ProManager/GetFeedbackID", function (data) {
- //用户名称
- $("#JKDFMC").combobox({
- url: '/ProManager/GetinfoBynature?type=1',
- valueField: 'ID',
- textField: '名称',
- onLoadSuccess: function () {
- //负责人
- $("#ZRR").combobox({
- url: '/ProManager/GetinfoBynature?type=0',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- onLoadSuccess: function () {
- $.post("/ProManager/GetFeedbackID", function (data) {
- $.ajax({
- url: '/ProManager/GetInterface/' + id,
- method: 'post',
- success: function (data) {
- if (data.length > 0) {
- $('#ID').val(id);
- $('#XMID').combobox('setValue', data[0].项目ID);
- $('#MC').textbox('setValue', data[0].名称);
- $('#MS').val(data[0].描述)
- $('#ZRR').combobox('setValue', data[0].责任人);
- $('#CJR').combobox('setValue', data[0].创建人);
- $('#JKDFMC').combobox('setValue', data[0].接口对方名称);
- $("#YSSJ").datebox("setValue", data[0].验收时间)
- $("#SQSJ").datebox("setValue", data[0].申请时间)
- $("#WCSJ").datebox("setValue", data[0].完成时间)
- switch (data[0].状态) {
- case 1: $("input[name=ZT][value=1]").attr('checked', 'checked'); break;
- case 2: $("input[name=ZT][value=2]").attr('checked', 'checked'); break;
- case 3: $("input[name=ZT][value=3]").attr('checked', 'checked'); break;
- case 4: $("input[name=ZT][value=4]").attr('checked', 'checked'); break;
- case 5: $("input[name=ZT][value=5]").attr('checked', 'checked'); break;
- case 6: $("input[name=ZT][value=6]").attr('checked', 'checked'); break;
- }
- switch (data[0].类型) {
- case 1: $("input[name=LX][value=1]").attr('checked', 'checked'); break;
- case 2: $("input[name=LX][value=2]").attr('checked', 'checked'); break;
- case 3: $("input[name=LX][value=3]").attr('checked', 'checked'); break;
- case 4: $("input[name=LX][value=4]").attr('checked', 'checked'); break;
- case 5: $("input[name=LX][value=5]").attr('checked', 'checked'); break;
- }
- //layui重新渲染
- layui.use('form', function () {
- var form = layui.form;//高版本建议把括号去掉,有的低版本,需要加()
- form.render()
- });
- } else {
- //弹出错误消息
- ZLPMS.Alert("数据异常,请联系管理人员", 3);
- }
- }
- })
- //附件
- $.post("/ProManager/Attachment?id=" + id + "&type=3", {}, function (data) {
- if (data != null && data.length > 0) {
- $("#attchment").html();
- var html = "";
- for (var i = 0; i < data.length; i++) {
- if (data[i].type == 1) {
- html += "<span><img style='border:1px solid #000000' id='Attachment" + data[i].id + "' onclick='Zoom(" + '"' + data[i].base64ToImage + '"' + ")' src='data:image/jpg;base64," + data[i].base64 + "' width='50' height='50' /><i class='fa fa-times' id='icon" + data[i].id + "' aria-hidden='true' onclick='Delete_img(" + '"' + data[i].id + '"' + ")'></i></span>";
- }
- else {
- html += '<span><a href="#" id="Attachment' + data[i].id + '" onclick="downloadfile(' + data[i].id + ')">下载附件' + (i + 1) + "</a><i class='fa fa-times' aria-hidden='true' id='icon" + data[i].id + "' onclick='Delete_img(" + '"' + data[i].id + '"' + ")'></i></span>";
- }
- }
- $("#attchment").html(html);
- }
- })
- })
- }
- })
- }
- })
- })
- }
- })
- }
- //绑定产品服务时间
- this.ProductServicesBind = function (id) {
- $.ajax({
- url: '/ProManager/Get_SingleServiceRecord/' + id,
- method: 'GET',
- success: function (data) {
- if (data != null) {
- $("#ID").val(data[0].ID);
- $('#QDID').val(data[0].渠道ID);
- $("#XMID").val(data[0].项目ID);
- $("#CPID").val(data[0].项目产品模块ID);
- $("#FFLX").combobox('setValue', data[0].服务类型);
- $("#SM").val(data[0].说明);
- $("#ServiceStartTime").datebox("setValue", data[0].服务开始时间);
- $("#ServiceEndTime").datebox("setValue", data[0].服务结束时间);
- /* $("#contractDate").datebox("setValue", data[0].签订时间);*/
- $("#ALL").attr('disabled', 'disabled');
-
- } else {
- //弹出错误消息
- top.ZLPMS.Msg("系统中没有该条数据");
- }
- }
- })
- //应用状态
-
- }
- }
- //提交请求
- var Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- },
- //项目信息
- PostData: function (index) {
- //执行提交验证
- var r = $('#ff').form('validate');
- var name = $("#name").val();
- if (name == null || name == "") {
- top.ZLPMS.Msg("项目名称不能为空");
- }
- else {
- if (r) {//post到后台
- var url = '/ProManager/Add_Project';
- var param = ZLPMS.FormToObject('ff');
- var dealflow = $("#GZLMLID").combobox('getValue');
- if (param.enable) {
- if (param.email == "" && param.wxin == "") {
- top.ZLPMS.Msg("启用监控后必须填写项目经理邮箱或者微信");
- return;
- }
- }
- param.GZLMLID = dealflow;
- $.post(url, param, function (data) {
- if (data.length == 1) {
- document.getElementById("btn_upload").click()
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加成功");
- } else if (data == -1) {
- top.ZLPMS.Msg("项目名称已被使用请勿重复输入");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加失败");
- }
- });
- }
- }
- },
- //接口信息
- Interface_PostData: function (index, type, mode, obj) {
- var url = '/ProManager/Add_Interface';
- if (type == 2) {
- var url = '/ProManager/Edit_Interface';
- }
- //执行提交验证
- var r = $('#insert_interface').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject("insert_interface");//取页面填写的值
- param.JKMS = mode;
- if (param.LX == null) {
- top.ZLPMS.Msg("请选择类型");
- return
- }
- if (param.ZT == null && type == 1) {
- top.ZLPMS.Msg("请选择状态");
- return
- }
- $.post(url, param, function (data) {
- if (data == 1) {
- document.getElementById("btn_upload").click()
- obj.datagrid("reload")
- top.ZLPMS.Msg("保存成功");
- top.ZLPMS.CloseWindow(index);
- }
- else {
- top.ZLPMS.Msg("保存失败");
- top.ZLPMS.CloseWindow(index);
- }
- });
- }
- },
- //变更接口状态
- DealInte_PostData: function (index, obj) {
- var r = $('#insert_interface').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject("insert_interface");//取页面填写的值
- if (param.MS.length == 0) {
- top.ZLPMS.Msg("请务必填写变更描述", 2);
- } else {
- $.post('/ProManager/DealInte', param, function (data) {
- if (data == 1) {
- document.getElementById("btn_upload").click()
- obj.datagrid("reload")
- top.ZLPMS.Msg("保存成功");
- top.ZLPMS.CloseWindow(index);
- }
- else {
- top.ZLPMS.Msg("保存失败");
- top.ZLPMS.CloseWindow(index);
- }
- });
- }
- }
- },
- //项目个性化
- identify_PostData: function (index, type) {
- var url = '/ProManager/Edit_Identify';
- if (type == 1) {
- url = '/ProManager/Add_Identify';
- }
- //执行提交验证
- var r = $('#insert_identify').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject("insert_identify");//取页面填写的值
- param.XGSM = escape((UM.getEditor('XGSM').getContent()));
- $.post(url, param, function (data) {
- if (data.length == 36) {
- document.getElementById("btn_upload").click()
- top.ZLPMS.Msg("保存成功");
- $('#identify').datagrid('reload');
- top.ZLPMS.CloseWindow(index);
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存失败");
- }
- });
- }
- }
- };
- //项目信息
- function databindProject() {
- var search = $("#dtn-search-project").val();
- if (projectObj.channelId != null) {
- var Params = {
- ChannelID: projectObj.channelId,
- Search: search
- }
- $('#project').datagrid({
- url: '/ProManager/BingProData',
- method: 'Get',
- singleSelect: true,
- toolbar: '#btn_func',
- fit: true,
- rownumbers: true,
- queryParams: Params,
- columns: [[
- { field: '名称', title: '名称', width: 180 },
- { field: '负责人', title: '负责人', width: 80 },
- { field: '性质', title: '性质', width: 80, align: 'center' },
- { field: '实施方式', title: '实施方式', width: 80, align: 'center' },
- {
- field: '状态', title: '项目状态', width: 70, align: 'center', styler: function (value, row, index) {
- if (value == '计划中') {
- return 'color:#EEA2AD;font-weight:bold';
- }
- if (value == '上线中') {
- return 'color:green;font-weight:bold;';
- }
- if (value == '已暂停') {
- return 'color:#FF4500;font-weight:bold;';
- }
- if (value == '已终止') {
- return 'color:gray;font-weight:bold;';
- }
- if (value == '售后中') {
- return 'color:blue;font-weight:bold;';
- }
- }
- },
- { field: '统一社会信用代码', title: '统一社会信用代码', width: 120, align: 'center' },
- //{ field: '上线时间', title: '上线时间', width: 120, align: 'center' },
- //{ field: '验收时间', title: '验收时间', width: 120, align: 'center' },
- { field: '中心数量', title: '中心数量', width: 100 },
- { field: '村站数量', title: '村站数量', width: 80 },
- { field: '网络带宽', title: '网络带宽', width: 80 },
- { field: '服务器分离', title: '服务器分离', width: 90, align: 'center' },
- {
- field: 'BHID', title: 'BH客户对照', width: 90, sortable: false, align: 'center'
- ,
- styler: function (value, rowData, index) {
- if (rowData.BHID == null) {
- return 'color:#3c8b3c;font-weight:bold;';
- }
- }
- , formatter: function (value, row, index) {
- if (row.BHID == null) {
- return '未对照';
- }
- else {
- return '已对照';
- }
- }
- },
- {
- field: '关注度', title: '关注度', width: 70, align: 'center', styler: function (value, row, index) {
- if (value == '0') {
- return 'color:#EEA2AD;font-weight:bold';
- }
- if (value == '1') {
- return 'color:red;font-weight:bold;';
- }
- if (value == '2') {
- return 'color:red;font-weight:bold;';
- }
- if (value == '3') {
- return 'color:red;font-weight:bold;';
- }
- if (value == '4') {
- return 'color:red;font-weight:bold;';
- }
- if (value == '5') {
- return 'color:red;font-weight:bold;';
- }
- },
- formatter: function (value, rowData, index) {
- if (rowData.关注度 == '0') {
- return '未关注';
- }
- if (value == '1') {
- return '❤';
- }
- if (value == '2') {
- return '❤❤';
- }
- if (value == '3') {
- return '❤❤❤';
- }
- if (value == '4') {
- return '❤❤❤❤';
- }
- if (value == '5') {
- return '❤❤❤❤❤';
- }
- }
- },
- {
- field: '启用监控', title: '启用监控', width: 90, align: 'center',
- formatter: function (value, rowData, index) {
- switch (value) {
- case 1: {
- return '√';
- }
- default: {
- return '';
- }
- }
- }
- },
- { field: '概况', title: '概况', width: 300 }
- ]],
- onSelect: function (rowIndex, rowData) {
- databindStation(rowData["ID"])
- databindServer(rowData["ID"])
- databindWorker(rowData["ID"])
- databindProduct(rowData["ID"])
- //远程方式
- databindRemote(rowData["ID"])
- // 个性化修改
- databindIdentify(rowData["ID"])
- // 验收仪器
- databindInstrument(rowData["ID"])
- // 验收模块
- databindModual(rowData["ID"])
- // 接口信息
- databindInter(rowData["ID"])
- //项目ID
- projectObj.xmid = rowData["ID"]
- //智能表单
- databindSmart(rowData["ID"])
- }
- })
- }
- }
- //机构信息
- function databindStation(id) {
- if (id.length < 36) {
- var search = $("#dtn-search-station").val();
- id = $("#project").datagrid("getSelected")["ID"]
- }
- var Params = {
- Search: search
- }
- $('#Station').datagrid({
- url: '/ProManager/BingStationData?id=' + id,
- method: 'GET',
- toolbar: '#btn_Station',
- fit: true,
- singleSelect: true,
- collapsible: true,
- queryParams: Params,
- rownumbers: true,
- pagination: true,
- });
- }
- //项目服务器信息
- function databindServer(id) {
- $('#Server').datagrid({
- url: '/ProManager/BingServerData?id=' + id,
- method: 'GET',
- toolbar: '#btn_Server',
- singleSelect: true,
- collapsible: true,
- rownumbers: true,
- fit: true,
- pagination: true,
- onClickRow: function (index,row) {
- databindServerDataBaseInfo(row.ID);
- }
- });
- }
- //项目服务器数据库
- function databindServerDataBaseInfo(id) {
- $('#serverDataBaseInfo').datagrid({
- url: '/CloudMonitor/GetDbInfoByServerId?serverId=' + id,
- method: 'GET',
- toolbar: '#btn_Server_DataBaseInfo',
- singleSelect: true,
- collapsible: true,
- rownumbers: true,
- fit: true,
- pagination: true
- });
- }
- //项目人员信息
- function databindWorker(id) {
- $('#Worker').datagrid({
- url: '/ProManager/BingWorkerData?id=' + id,
- method: 'GET',
- singleSelect: true,
- collapsible: true,
- rownumbers: true,
- toolbar: '#btn_Worker',
- fit: true,
- pagination: true
- });
- }
- //项目产品信息
- function databindProduct(id) {
- $('#product').datagrid({
- url: '/ProManager/BingProductData?id=' + id,
- method: 'GET',
- singleSelect: true,
- toolbar: "#btn_Product",
- collapsible: true,
- rownumbers: true,
- fit: true,
- pagination: true,
- onClickRow: function (index, row) {
- Product_StatusChange_Forms.ProductServiceRecords();
- },
- onLoadSuccess: function () {
- $(this).datagrid('selectRow', 0);
- Product_StatusChange_Forms.ProductServiceRecords();
- }
- });
- }
- //添加项目弹窗
- function add_project() {
- var ChannelInfo = $('#ChannelInfo').datagrid("getSelected");
- if (ChannelInfo == null) {
- top.ZLPMS.Msg("请选择一个渠道")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建项目',
- url: '/ProManager/ProjectInfo/' + ChannelInfo["ID"],
- area: ['800px', '715px'],
- yes: function (index, layero) {
- Forms.Submit(index, layero);
- $('#project').datagrid('reload');
- $('#Station').datagrid('reload');
- $('#Server').datagrid('reload');
- $('#Worker').datagrid('reload');
- $('#product').datagrid('reload');
- $('#ProductServiceRecords').datagrid('reload');
-
- },
- });
- }
- };
- //修改项目弹窗
- function update_project() {
- var ProjectlInfo = $('#project').datagrid("getSelected");
- if (ProjectlInfo == null || ProjectlInfo == "") {
- top.ZLPMS.Msg("请选择一行数据");
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '修改项目',
- url: '/ProManager/UpdateProjectInfo/' + ProjectlInfo["ID"],
- area: ['800px', '715px'],
- yes: function (index, layero) {
- updateForms.Submit(index, layero);
- $('#project').datagrid('reload');
- $('#Station').datagrid('reload');
- $('#Server').datagrid('reload');
- $('#Worker').datagrid('reload');
- $('#product').datagrid('reload');
- $('#ProductServiceRecords').datagrid('reload');
-
- },
- });
- }
- };
- //修改项目
- var updateForms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.updateForms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#project').datagrid('reload');
- $('#Station').datagrid('reload');
- $('#Server').datagrid('reload');
- $('#Worker').datagrid('reload');
- $('#product').datagrid('reload');
- $('#ProductServiceRecords').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#update_project').form('validate');
- if (r) {//post到后台
- var dealflow = $("#GZLMLID").combobox('getValue');
- var param = ZLPMS.FormToObject('update_project');
- if (param.enable) {
- if (param.email == "" && param.wxin == "") {
- top.ZLPMS.Msg("启用监控后必须填写项目经理邮箱或者微信");
- return;
- }
- }
- param.GZLMLID = dealflow;
- var url = '/ProManager/Update_Project';
- $.post(url, param, function (data) {
- if (data == 1) {
- document.getElementById("btn_upload").click()
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("修改成功");
- } else if (data == -1) {
- top.ZLPMS.Msg("项目名称已被使用请勿重复输入");
- }
- else {
- top.ZLPMS.Msg("修改失败");
- top.ZLPMS.CloseWindow(index);
- }
- });
- }
- return null;
- }
- };
- //删除项目提示窗体
- function delete_project() {
- var ProjectInfo = $('#project').datagrid("getSelected");
- if (ProjectInfo != null) {
- //确认删除对话框
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?删除后无法正常使用关于该项目的所有资源.', 5, function () {
- //执行删除
- Worker_Delete_Forms.Del(ProjectInfo["ID"]);
- $('#project').datagrid('reload');
- $('#Station').datagrid('reload');
- $('#Server').datagrid('reload');
- $('#Worker').datagrid('reload');
- $('#product').datagrid('reload');
- $('#ProductServiceRecords').datagrid('reload');
- });
- $('#project').datagrid('reload');
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //删除项目
- var Worker_Delete_Forms = {
- //表单提交
- Del: function (id) {
- $.ajax({
- url: '/ProManager/Del_Project/' + id,
- method: "post",
- success: function (data) {
- if (data != 0) {
- $('#project').datagrid('reload');
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- }
- })
- }
- };
- //添加机构窗口
- function add_station() {
- projectObj.projectId = $('#project').datagrid("getSelected");
- if (projectObj.projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建机构',
- url: '/ProManager/StationInfo/' + projectObj.projectId["ID"],
- area: ['700px', '600px'],
- yes: function (index, layero) {
- Station_Add_Forms.Submit(index, layero);
- $('#Station').datagrid('reload');
- },
- });
- }
- };
- //添加机构
- var Station_Add_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Station_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#Station').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- var Name = $("#MC").val();
- if (Name == null || Name == "") {
- top.ZLPMS.Msg("机构名称不能为空")
- }
- else {
- //执行提交验证
- var r = $('#insert_station').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject('insert_station');
- var dealflow = $("#GZLMLID").combobox('getValue');
- var url = '/ProManager/Add_Station';
- param.GZLMLID = dealflow;
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加成功");
- } else if (data == -1) {
- top.ZLPMS.Msg("机构名称已经被使用请重新输入");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加失败");
- }
- });
- }
- }
- return null;
- }
- };
- //机构修改窗口
- function update_station() {
- var ProjectlInfo = $('#project').datagrid("getSelected");
- if (ProjectlInfo == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- $.ajax({
- url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
- method: 'POST',
- })
- var StationInfo = $('#Station').datagrid("getSelected");
- if (StationInfo == null) {
- top.ZLPMS.Msg("请选择一行数据")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '修改机构',
- url: '/ProManager/UpdatStationInfo/' + StationInfo["ID"],
- area: ['700px', '600px'],
- yes: function (index, layero) {
- Station_Update_Forms.Submit(index, layero);
- $('#Station').datagrid('reload');
- },
- });
- }
- }
- };
- //修改机构
- var Station_Update_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Station_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#Station').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#update_station').form('validate');
- if (r) {//post到后台
- var url = '/ProManager/UpdateStation';
- var param = ZLPMS.FormToObject('update_station');
- var dealflow = $("#GZLMLID").combobox('getValue');
- param.GZLMLID = dealflow;
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("修改成功");
- } else if (data == -1) {
- top.ZLPMS.Msg("机构名称已被使用请勿重新输入");
- }
- else {
- ZLPMS.Msg("修改失败");
- }
- });
- }
- return null;
- }
- };
- //删除机构提示窗体
- function delete_station() {
- var StationInfo = $('#Station').datagrid("getSelected");
- if (StationInfo != null) {
- //确认删除对话框
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
- //执行删除
- Station_Delete_Forms.Del(StationInfo["ID"]);
- $('#Station').datagrid('reload');
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //删除机构
- var Station_Delete_Forms = {
- //表单提交
- Del: function (id) {
- $.ajax({
- url: '/ProManager/Del_Station/' + id,
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("删除成功");
- $('#Station').datagrid('reload');
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- }
- })
- }
- };
- //将机构变成项目
- function MigrationOrganization() {
- var projectId = $('#project').datagrid("getSelected");
- if (projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- var Station = $('#Station').datagrid("getSelected");
- if (Station == null) {
- top.ZLPMS.Msg("请选择一个机构")
- }
- $.ajax({
- url: '/ProManager/MigrationOrganization?ProjectID=' + projectId["ID"] + "&SiteID=" + Station["ID"] ,
- method: "post",
- success: function (data) {
- $("#Station").datagrid("reload");
- if (data.code == 200) {
- top.ZLPMS.Msg(data.msg);
- }
- else {
- top.ZLPMS.Msg("迁移失败");
- }
- }
- })
- }
- //添加服务器窗口
- function add_Server() {
- var project = $('#project').datagrid("getSelected");
- if (project == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建服务器',
- url: '/ProManager/ServerInfo/' + project["ID"],
- area: ['670px', '490px'],
- yes: function (index, layero) {
- Server_Add_Forms.Submit(index, layero);
- $('#Server').datagrid('reload');
- },
- });
- }
- };
- //添加服务器数据库窗口
- function add_Server_DataBase() {
- var project = $('#Server').datagrid("getSelected");
- if (project == null) {
- top.ZLPMS.Msg("请选择一个服务器")
- }
- else {
- top.ZLPMS.OpenWindowSuccess({
- title: '新建数据库',
- url: '/ProManager/ServerDataBaseInfo',
- area: ['670px', '350px'],
- success: function (layero) {
- var iframeWindow = top.window.frames[layero.find('iframe')[0]['name']];
- iframeWindow.LoadPage();
- },
- yes: function (index, layero) {
- Server_DataBase_Add_Forms.Submit(index, layero, project.ID);
- $('#serverDataBaseInfo').datagrid('reload');
- },
- });
- }
- };
- //添加服务器
- var Server_Add_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Server_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#Server').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- var XH = $("#XH").val();
- //执行提交验证
- var r = $('#insert_server')[0].reportValidity();
- if (r) {//post到后台
- var url = '/ProManager/Add_Server';
- var param = ZLPMS.FormToObject('insert_server');
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加成功");
- } else if (data = -1) {
- ZLPMS.Msg("服务器型号已经被使用请重新输入");
- }
- });
- }
- return null;
- }
- };
- //添加服务器数据库
- var Server_DataBase_Add_Forms = {
- //表单提交
- Submit: function (index, layero,serverID) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Server_DataBase_Add_Forms.PostData(index, serverID);//调用子页面的方法,得到子页面返回的ids
- },
- //读取数据
- PostData: function (index, serverID) {
- var 名称 = $("#名称").val();
- //执行提交验证
- var r = $('#insert_server').form('validate');
- if (名称 == null || 名称 == "") {
- top.ZLPMS.Msg("数据库名称不能为空")
- }
- else {
- if (r) {//post到后台
- var url = '/CloudMonitor/InsertDbInfo';
- var param = ZLPMS.FormToObject('insert_server');
- param.服务器ID = serverID;
- $.ajax({
- url: url,
- type: 'POST',
- data: param,
- async: false, // 设置为同步请求
- success: function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加成功");
- } else {
- top.ZLPMS.Msg("添加失败");
- }
- },
- error: function () {
- top.ZLPMS.Msg("请求失败");
- }
- });
- }
- }
- return null;
- }
- };
- //服务器修改窗口
- function update_server() {
- var ProjectlInfo = $('#project').datagrid("getSelected");
- if (ProjectlInfo == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- $.ajax({
- url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
- method: 'POST'
- })
- var ServerInfo = $('#Server').datagrid("getSelected");
- if (ServerInfo == null) {
- top.ZLPMS.Msg("请选择一行数据")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '修改服务器',
- url: '/ProManager/UpdateServerInfo/' + ServerInfo["ID"],
- area: ['670px', '490px'],
- yes: function (index, layero) {
- Server_Update_Forms.Submit(index, layero);
- $('#Server').datagrid('reload');
- },
- });
- }
- }
- };
- //服务器数据库修改窗口
- function update_server_database() {
- var ServerInfo = $('#Server').datagrid("getSelected");
- if (ServerInfo == null) {
- top.ZLPMS.Msg("请选择一个服务器")
- }
- else {
- var DataBaseInfo = $('#serverDataBaseInfo').datagrid("getSelected");
- if (DataBaseInfo == null) {
- top.ZLPMS.Msg("请选择一行数据")
- }
- else {
- top.ZLPMS.OpenWindowSuccess({
- title: '修改数据库',
- url: '/ProManager/ServerDataBaseInfo',
- area: ['670px', '350px'],
- success: function (layero) {
- var iframeWindow = top.window.frames[layero.find('iframe')[0]['name']];
- iframeWindow.LoadPage(DataBaseInfo);
- },
- yes: function (index, layero) {
- Server_DataBase_Update_Forms.Submit(index, layero, DataBaseInfo);
- $('#serverDataBaseInfo').datagrid('reload');
- },
- });
- }
- }
- };
- //修改服务器
- var Server_Update_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Server_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#Server').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#update_server')[0].reportValidity();
- if (r) {//post到后台
- var url = '/ProManager/UpdateServer';
- var param = ZLPMS.FormToObject('update_server');
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("修改成功");
- } else if (data == -1) {
- top.ZLPMS.Msg("服务器型号已经被使用请重新输入");
- }
- else {
- top.ZLPMS.Msg("添加失败");
- }
- });
- }
- return null;
- }
- };
- //修改服务器数据库
- var Server_DataBase_Update_Forms = {
- //表单提交
- Submit: function (index, layero,row) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Server_DataBase_Update_Forms.PostData(index,row);//调用子页面的方法,得到子页面返回的ids
- },
- //读取数据
- PostData: function (index,row) {
- var 名称 = $("#名称").val();
- //执行提交验证
- var r = $('#insert_server').form('validate');
- if (名称 == null || 名称 == "") {
- top.ZLPMS.Msg("数据库名称不能为空")
- }
- else {
- if (r) {//post到后台
- var url = '/CloudMonitor/UpdateDbInfo';
- var param = ZLPMS.FormToObject('insert_server');
- row.名称 = 名称;
- row.数据库类型 = param.数据库类型;
- row.数据库连接串 = param.数据库连接串;
- $.ajax({
- url: url,
- type: 'POST',
- data: row,
- async: false, // 设置为同步请求
- success: function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("修改成功");
- } else {
- top.ZLPMS.Msg("修改失败");
- }
- },
- error: function () {
- top.ZLPMS.Msg("请求失败");
- }
- });
- //$.post(url, row, function (data) {
- // if (data == 1) {
- // top.ZLPMS.CloseWindow(index);
- // top.ZLPMS.Msg("修改成功");
- // } else {
- // top.ZLPMS.Msg("修改失败");
- // }
- //});
- }
- }
- return null;
- }
- };
- //删除服务器提示窗体
- function delete_server() {
- var ServerInfo = $('#Server').datagrid("getSelected");
- if (ServerInfo != null) {
- //确认删除对话框
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
- //执行删除
- Server_Delete_Forms.Del(ServerInfo["ID"]);
- $('#Server').datagrid('reload');
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //删除服务器数据库提示窗体
- function delete_server_DataBase() {
- let table = $('#serverDataBaseInfo');
- var ServerInfo = table.datagrid("getSelected");
- if (ServerInfo != null) {
- //确认删除对话框
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
- //执行删除
- Server_DataBase_Delete_Forms.Del(ServerInfo["ID"]);
- table.datagrid('reload');
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //删除服务器
- var Server_Delete_Forms = {
- //表单提交
- Del: function (id) {
- $.ajax({
- url: '/ProManager/Del_Server/' + id,
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("删除成功");
- $('#Server').datagrid('reload');
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- }
- })
- }
- };
- //删除服务器数据库
- var Server_DataBase_Delete_Forms = {
- //表单提交
- Del: function (id) {
- $.ajax({
- url: '/CloudMonitor/DeleteDbInfoById/' + id,
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- }
- })
- }
- };
- //添加项目人员窗口
- function add_Worker() {
- projectObj.projectId = $('#project').datagrid("getSelected");
- if (projectObj.projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建项目人员',
- url: '/ProManager/WorkerInfo/' + projectObj.projectId["ID"],
- area: ['670px', '420px'],
- yes: function (index, layero) {
- Worker_Add_Forms.Submit(index, layero);
- $('#Worker').datagrid('reload');
- },
- });
- }
- }
- //添加项目人员
- var Worker_Add_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Worker_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#Worker').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#insert_worker').form('validate');
- if (r) {//post到后台
- var url = '/ProManager/Add_Worker';
- var param = ZLPMS.FormToObject('insert_worker');
- $.post(url, param, function (data) {
- if (data != 0) {
- top.ZLPMS.CloseWindow(index);
- $('#product').datagrid('reload');
- top.ZLPMS.Msg("成功添加" + data + "人到该项目中服务。", 1);
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加失败,请重新添加", 2);
- }
- });
- }
- return null;
- }
- };
- //撤离项目人员窗口
- function update_Worker() {
- var WorkerInfo = $('#Worker').datagrid("getSelected");
- if (WorkerInfo != null) {
- //确认撤离对话框
- top.ZLPMS.Confirm('您确定要从该项目中撤离该人员吗?', 3, function () {
- //执行撤离
- $.ajax({
- url: '/ProManager/UpdateWorker/' + WorkerInfo["ID"],
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("撤离成功");
- $('#Worker').datagrid('reload');
- }
- else {
- top.ZLPMS.Msg("撤离失败");
- }
- }
- })
- $('#Worker').datagrid('reload');
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- }
- //添加项目产品窗口
- function add_Product() {
- var project = $('#project').datagrid("getSelected");
- if (project == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '添加项目产品',
- url: '/ProManager/ProductInfo/' + project["ID"],
- area: ['670px', '400px'],
- yes: function (index, layero) {
- Product_Add_Forms.Submit(index, layero);
- $('#product').datagrid('reload');
- },
- });
- }
- }
- //添加项目产品
- var Product_Add_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Product_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#product').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#insert_product').form('validate');
- if (r) {//post到后台
- var url = '/ProManager/Add_Product';
- var param = ZLPMS.FormToObject('insert_product');
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("添加成功");
- } else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("该产品已试用于本产品,请勿重复添加!");
- }
- });
- }
- return null;
- }
- };
- //修改项目产品窗口
- function update_Product() {
- var ProductInfo = $('#product').datagrid("getSelected");
- var ProjectlInfo = $('#project').datagrid("getSelected");
- if (ProjectlInfo == null) {
- top.ZLPMS.Msg("请选择项目!");
- }
- if (ProductInfo != null) {
- $.ajax({
- url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
- method: 'POST'
- })
- top.ZLPMS.OpenWindow({
- title: '修改项目产品',
- url: '/ProManager/UpdateProductInfo?id=' + ProductInfo["ID"] + '&xmid=' + ProjectlInfo["ID"],
- area: ['670px', '400px'],
- yes: function (index, layero) {
- Product_Update_Forms.Submit(index, layero);
- $('#product').datagrid('reload');
- }
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //修改项目产品
- var Product_Update_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Product_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#product').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#update_product').form('validate');
- if (r) {//post到后台
- var url = '/ProManager/UpdateProduct';
- var param = ZLPMS.FormToObject('update_product');
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("修改成功");
- } else if (data == 0) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("该产品已经在本项目中使用请勿重复添加");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("修改失败");
- }
- });
- }
- return null;
- }
- };
- //产品服务合同时间维护1新增2修改
- function StatusChange(type) {
- var ProductInfo = $('#product').datagrid("getSelected");
- var ProjectlInfo = $('#project').datagrid("getSelected");
- if (ProjectlInfo == null) {
- top.ZLPMS.Msg("请选择项目!");
- }
- if (ProductInfo != null) {
-
- var title = "服务登记";
- top.ZLPMS.OpenWindow({
- title: title,
- url: '/ProManager/UpdateProductStatusChange?id=' + ProductInfo["ID"] + '&xmid=' + ProjectlInfo["ID"] + '&qdid=' + projectObj.channelId + '&type=1',
- area: ['670px', '500px'],
- yes: function (index, layero) {
- Product_StatusChange_Forms.Submit(index, layero);
- }
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //修改产品服务合同记录2修改
- function UpdateProductServiceRecords() {
- var ServerInfo = $('#ProductServiceRecords').datagrid("getSelected");
- if (ServerInfo == null) {
- top.ZLPMS.Msg("请选择一条记录")
- }
- else {
- top.ZLPMS.OpenWindowSuccess({
- title: '修改服务登记',
- url: '/ProManager/UpdateProductStatusChange?id=' + ServerInfo["ID"] + '&xmid=0&qdid=0&type=2',
- area: ['670px', '500px'],
- yes: function (index, layero) {
- Product_StatusChange_Forms.UpdateSubmit(index, layero);
- $('#product').datagrid('reload');
- },
- });
-
- }
- };
- //产品服务合同时间维护
- var Product_StatusChange_Forms = {
- //表单提交
- Submit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Product_StatusChange_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#product').datagrid('reload');
- },
- //读取数据
- PostData: function (index) {
- //执行提交验证
- var r = $('#productStatusChange').form('validate');
- if (r) {//post到后台
- var url = '/ProManager/AdjustServiceTime';
- var param = ZLPMS.FormToObject('productStatusChange');
- if ($('#ALL').is(":checked")) {
- param.ALL = 1;
- }
- else {
- param.ALL = 0;
- }
- var state = ZLPMS.compareTime(param.ServiceStartTime, param.ServiceEndTime, "开始时间不能大于结束时间");
- if (!state) {
- return;
- }
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("操作成功");
- } else if (data == 0) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("系统异常");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("操作失败");
- }
- });
- }
- return null;
- },
- //产品合同签订记录, string XMID, string CPID
- ProductServiceRecords: function() {
- var ProductInfo = $('#product').datagrid("getSelected");
- var ProjectlInfo = $('#project').datagrid("getSelected");
- if (ProjectlInfo == null) {
- $('#ProductServiceRecords').datagrid('loadData', { total: 0, rows: [] });
- return
- }
- if (ProductInfo == null) {
- $('#ProductServiceRecords').datagrid('loadData', { total: 0, rows: [] });
- return
- }
- $('#ProductServiceRecords').datagrid({
- url: '/ProManager/Get_ProductAdjustService?QDID=' + projectObj.channelId + '&XMID=' + ProjectlInfo["ID"] + '&CPID=' + ProductInfo["ID"],
- method: 'GET',
- /* toolbar: '#btn_Server_DataBaseInfo',*/
- singleSelect: true,
- collapsible: true,
- rownumbers: true,
- fit: true,
- pagination: true
- });
- },
- //删除产品服务合同记录
- Del: function () {
- var GetRow = $('#ProductServiceRecords').datagrid("getSelected");
- if (GetRow == null) {
- top.ZLPMS.Msg("请选择一行数据");
- }
- $.ajax({
- url: '/ProManager/DeleteAdjustServiceTime/' + GetRow["ID"],
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("删除成功");
- $('#product').datagrid('reload');
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- }
- })
- },
- //刷新表格
- refresh: function () {
- $('#ProductServiceRecords').datagrid('reload');
- },
- //修改数据提交
- UpdateSubmit: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Product_StatusChange_Forms.UpdatePostData(index);//调用子页面的方法,得到子页面返回的ids
- $('#product').datagrid('reload');
-
- },
- //修改数据提交
- UpdatePostData: function (index) {
- //执行提交验证
- var r = $('#productStatusChange').form('validate');
- if (r) {//post到后台
- var url = '/ProManager/UpdateAdjustServiceTime';
- var param = ZLPMS.FormToObject('productStatusChange');
- param.ALL = 0;
- var state = ZLPMS.compareTime(param.ServiceStartTime, param.ServiceEndTime, "开始时间不能大于结束时间");
- if (!state) {
- return;
- }
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("操作成功");
- } else if (data == 0) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("系统异常");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("操作失败");
- }
- });
- }
- return null;
- },
- };
- //删除项目产品提示窗体
- function delete_product() {
- var ProductInfo = $('#product').datagrid("getSelected");
- if (ProductInfo != null) {
- //确认删除对话框
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
- //执行删除
- Product_Delete_Forms.Del(ProductInfo["ID"]);
- $('#product').datagrid('reload');
- });
- } else {
- top.ZLPMS.Msg("请选择一行数据");
- }
- };
- //删除项目产品
- var Product_Delete_Forms = {
- //表单提交
- Del: function (id) {
- $.ajax({
- url: '/ProManager/Del_Product/' + id,
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("删除成功");
- $('#product').datagrid('reload');
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- }
- })
- }
- };
- //个性化
- function databindIdentify(id) {
- if (id != null) {
- $('#identify').datagrid({
- url: '/ProManager/BingIdentify',
- method: 'post',
- singleSelect: true,
- toolbar: '#btn_func6',
- fit: true,
- rownumbers: true,
- queryParams: { id: id },
- columns: [[
- { field: '名称', title: '标题', width: 250 },
- { field: '修改时间', title: '修改时间', width: 100, align: 'center' },
- { field: '修改人', title: '修改人', width: 100, align: 'center' },
- {
- field: '状态', title: '状态', width: 100, align: 'center', styler: function (value, row, index) {
- if (value == '0') {
- value = "放弃";
- return 'color:#EEA2AD;font-weight:bold';
- }
- if (value == '1') {
- value = "确认";
- return 'color:green;font-weight:bold;';
- }
- if (value == '2') {
- value = "删除";
- return 'color:#FF4500;font-weight:bold;';
- }
- },
- formatter: function (row) {
- if (row == '0') {
- return row = "放弃";
- }
- if (row == '1') {
- return row = "确认";
- }
- if (row == '2') {
- return row = "删除";
- }
- }
- },
- { field: '产品名称', title: '产品', width: 120, align: 'center' },
- { field: '版本号', title: '版本', width: 150, align: 'center' },
- ]],
- onSelect: function (rowIndex, rowData) {
- projectObj.identify = rowData
- var detail = rowData.修改说明 == null ? "暂无" : rowData.修改说明
- $("#detail").html("<p>" + detail + "</p>")
- }
- })
- }
- }
- //新增个性化
- function add_identify() {
- var identify = $('#project').datagrid("getSelected");
- if (identify == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建项目个性化',
- url: '/ProManager/Identify_Window?id=' + identify["ID"] + "&type=1",
- area: ['900px', '900px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Forms.identify_PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
- $('#identify').datagrid('reload');
- }
- });
- }
- };
- //修改个性化
- function edit_identify() {
- var identify = $('#identify').datagrid("getSelected");
- if (identify == null) {
- top.ZLPMS.Msg("请选择一条记录")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '编辑项目个性化',
- url: '/ProManager/Identify_Window?id=' + identify["ID"] + '&type=2',
- area: ['900px', '900px'],
- yes: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Forms.identify_PostData(index, 2);//调用子页面的方法,得到子页面返回的ids
- $('#identify').datagrid('reload');
- }
- });
- }
- };
- //删除个性化
- function del_identify() {
- var identify = projectObj.identify
- top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
- //执行删除
- $.post('/ProManager/Del_Identify?id=' + identify.ID + "&type=1", function (data) {
- if (data) {
- $('#identify').datagrid('reload');
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- })
- });
- }
- //放弃个性化
- function giveup_identify() {
- var identify = projectObj.identify
- if (identify == null) {
- top.ZLPMS.Msg("请选择一条记录")
- }
- else {
- top.ZLPMS.Confirm('您确定要修改选中的记录状态吗?', 3, function () {
- //执行
- $.ajax({
- url: '/ProManager/Del_Identify?id=' + identify.ID + "&type=2",
- method: "post",
- success: function (data) {
- if (data != 0) {
- top.ZLPMS.Msg("该记录已经成功放弃使用");
- $('#identify').datagrid('reload');
- }
- else {
- top.ZLPMS.Msg("状态修改失败");
- }
- }
- })
- $('#product').datagrid('reload');
- });
- }
- }
- //远程方式
- function databindRemote(id) {
- if (id != null) {
- $('#remote').datagrid({
- url: '/ProManager/BingRemote',
- method: 'post',
- singleSelect: true,
- toolbar: '#btn_func2',
- fit: true,
- rownumbers: true,
- queryParams: { id: id },
- columns: [[
- { field: '名称', title: '名称', width: 180, align: 'center' },
- { field: '联系人', title: '联系人', width: 100, align: 'center' },
- { field: '联系人电话', title: '联系电话', width: 120, align: 'center' },
- { field: '账号', title: '账号', width: 120, align: 'center' },
- { field: '密码', title: '密码', width: 120, align: 'center' },
- { field: '备注', title: '备注', width: 120, align: 'center' },
- ]],
- onSelect: function (rowIndex, rowData) {
- projectObj.remote = rowData
- }
- })
- }
- }
- // 删除远程
- function del_remote() {
- var id = projectObj.remote.ID
- top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
- //执行删除
- $.post("/ProManager/Del_Remote?id=" + id, function (data) {
- if (data) {
- $('#remote').datagrid('reload');
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- })
- });
- }
- //新增远程
- function add_remote() {
- var projectId = $('#project').datagrid("getSelected");
- if (projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建远程方式',
- url: '/ProManager/Remote_Window?id=' + projectId["ID"] + "&type=1",
- area: ['700px', '420px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Remote_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
- $('#remote').datagrid('reload');
- }
- });
- }
- };
- //修改远程
- function edit_remote() {
- var remote = escape(JSON.stringify(projectObj.remote))
- if (remote == null) {
- top.ZLPMS.Msg("请选择一条记录")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '编辑远程方式',
- url: '/ProManager/Remote_Window?id=' + remote + '&type=2',
- area: ['700px', '420px'],
- yes: function (index, layero) {
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Remote_Forms.PostData(index, 2);//调用子页面的方法,得到子页面返回的ids
- $('#remote').datagrid('reload');
- }
- });
- }
- };
- //远程方式请求
- var Remote_Forms = {
- //读取数据
- PostData: function (index, type) {
- var url = '/ProManager/Edit_Remote';
- if (type == 1) {
- url = '/ProManager/Add_Remote';
- }
- //执行提交验证
- var r = $('#insert_remote').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject("insert_remote");//取页面填写的值
- $.post(url, param, function (data) {
- if (data == 1) {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存成功");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存失败");
- }
- });
- }
- }
- };
- //验收仪器
- function databindInstrument(id) {
- if (id != null) {
- $('#instrument').datagrid({
- url: '/ProManager/Binginstrument',
- method: 'post',
- singleSelect: true,
- toolbar: '#btn_func3',
- fit: true,
- rownumbers: true,
- queryParams: { id: id },
- columns: [[
- { field: '仪器名称', title: '仪器名称', width: 180, align: 'center' },
- { field: '仪器型号', title: '仪器型号', width: 100, align: 'center' },
- { field: '科室负责人', title: '科室负责人', width: 120, align: 'center' },
- { field: '科室联系电话', title: '科室联系电话', width: 120, align: 'center' },
- { field: '厂家负责人', title: '厂家负责人', width: 120, align: 'center' },
- { field: '厂家联系电话', title: '厂家联系电话', width: 120, align: 'center' },
- { field: '仪器类型', title: '仪器类型', width: 120, align: 'center' },
- { field: '仪器厂家', title: '仪器厂家', width: 120, align: 'center' },
- { field: '通讯类型', title: '通讯类型', width: 120, align: 'center' },
- { field: '通讯参数', title: '通讯参数', width: 120, align: 'center' },
- { field: '接口DLL名称', title: '接口DLL名称', width: 120, align: 'center' },
- { field: '实施人员', title: '实施人员', width: 120, align: 'center' },
- {
- field: '启用时间', title: '启用时间', width: 120, align: 'center', formatter: function (row) {
-
- /*return row.substr(0, 10)*/
- }
- },
- {
- field: '验收时间', title: '验收时间', width: 120, align: 'center', formatter: function (row) {
- /* return row.substr(0, 10)*/
- }
- },
- { field: '备注', title: '备注', width: 120, align: 'center' },
- ]],
- })
- }
- }
- // 删除验收仪器
- function del_instrument() {
- var id = $("#instrument").datagrid("getSelected")["ID"];
- top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
- //执行删除
- $.post("/ProManager/Del_instrument?id=" + id, function (data) {
- if (data) {
- $('#instrument').datagrid('reload');
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- })
- });
- }
- //新增验收仪器
- function add_instrument() {
- var projectId = $('#project').datagrid("getSelected");
- if (projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建验收仪器',
- url: '/ProManager/Instrument_Window?id=' + projectId["ID"],
- area: ['650px', '520px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Instrument_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
- $('#instrument').datagrid('reload');
- }
- });
- }
- };
- //验收仪器请求
- var Instrument_Forms = {
- //读取数据
- PostData: function (index, type) {
- var url = '/ProManager/Add_Instrument';
- //执行提交验证
- var r = $('#insert_instrument').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject("insert_instrument");//取页面填写的值
- $.post(url, param, function (data) {
- if (data == 1) {
- $('#instrument').datagrid('reload');
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存成功");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存失败");
- }
- });
- }
- }
- };
- //验收模块
- function databindModual(id) {
- if (id != null) {
- $('#modual').datagrid({
- url: '/ProManager/Bingmodual',
- method: 'post',
- singleSelect: true,
- toolbar: '#btn_func4',
- fit: true,
- rownumbers: true,
- queryParams: { id: id },
- columns: [[
- { field: '模块名称', title: '模块名称', width: 180, align: 'center' },
- { field: '验收人', title: '验收人', width: 100, align: 'center' },
- {
- field: '验收时间', title: '验收时间', width: 120, align: 'center', formatter: function (row) {
- return row.substr(0, 10)
- }
- },
- ]],
- })
- }
- }
- // 删除验收模块
- function del_modual() {
- var id = $("#modual").datagrid("getSelected")["ID"];
- top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
- //执行删除
- $.post("/ProManager/Del_modual?id=" + id, function (data) {
- if (data) {
- $('#modual').datagrid('reload');
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- })
- });
- }
- //新增验收模块
- function add_modual() {
- var projectId = $('#project').datagrid("getSelected");
- if (projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建验收模块',
- url: '/ProManager/Modual_Window?id=' + projectId["ID"],
- area: ['650px', '260px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Modula_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
- $('#modual').datagrid('reload');
- }
- });
- }
- };
- //验收模块请求
- var Modula_Forms = {
- //读取数据
- PostData: function (index, type) {
- var url = '/ProManager/Add_modual';
- //执行提交验证
- var r = $('#insert_modual').form('validate');
- if (r) {//post到后台
- var param = ZLPMS.FormToObject("insert_modual");//取页面填写的值
- $.post(url, param, function (data) {
- if (data == 1) {
- $('#modual').datagrid('reload');
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存成功");
- }
- else {
- top.ZLPMS.CloseWindow(index);
- top.ZLPMS.Msg("保存失败");
- }
- });
- }
- }
- };
- //接口信息
- function databindInter(id) {
- if (id != null) {
- $('#interface').datagrid({
- url: '/ProManager/BingInterface',
- method: 'post',
- singleSelect: true,
- toolbar: '#btn_func5',
- fit: true,
- rownumbers: true,
- fitColumns: true,
- queryParams: {
- xmid: id
- },
- columns: [[
- { field: '名称', title: '接口名称', align: 'left' },
- {
- field: '类型', title: '类型', align: 'center', formatter: function (row) {
- switch (row) {
- case 1: return "医保接口"; break;
- case 2: return "农合接口"; break;
- case 3: return "LIS接口"; break;
- case 4: return "三方接口"; break;
- default: return "其它接口"; break;
- }
- }
- },
- { field: '项目名称', title: '项目名称' },
- {
- field: '状态', title: '状态', align: 'center', formatter: function (row) {
- switch (row) {
- case 1: return "未编写"; break;
- case 2: return "编写中"; break;
- case 3: return "已完成"; break;
- case 4: return "测试完成"; break;
- case 5: return "已验收"; break;
- case 6: return "终止"; break;
- }
- }
- },
- {
- field: '申请时间', title: '申请时间', align: 'center'
- },
- { field: '完成时间', title: '完成时间', align: 'center' },
- { field: '验收时间', title: '验收时间', align: 'center' },
- { field: '创建人', title: '创建人', align: 'center' },
- { field: '责任人', title: '维护人', align: 'center' },
- { field: '接口对方名称', title: '项目对接人', align: 'center' },
- ]],
- onSelect: function (index, row) {
- $.post("/ProManager/GetInteProcess", { id: row.ID }, function (data) {
- var html = ""
- for (var i = 0; i < data.length; i++) {
- html += "<li class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'></i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'> <span style='margin-right:15px'>" + data[i].操作人 + "</span><span style='margin-right:15px;color:#00b8ff'>" + data[i].状态 + "</span><span style='margin-right:15px;color:#a2a2a2'>" + data[i].操作时间 + "</span></h3><p style='font-size:15px;width:350px;word-break: break-word;'><br>" + data[i].备注 + "</p></div></li>"
- }
- $("#timeline").html(html)
- })
- id = row.ID
- },
- onLoadSuccess: function (dd) {
- $("#timeline").html("")
- if (dd.rows.length > 0) {
- $.post("/ProManager/GetInteProcess", { id: dd.rows[0].ID }, function (data) {
- var html = ""
- for (var i = 0; i < data.length; i++) {
- html += "<li class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'></i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'> <span style='margin-right:15px'>" + data[i].操作人 + "</span><span style='margin-right:15px;color:#00b8ff'>" + data[i].状态 + "</span><span style='margin-right:15px;color:#a2a2a2'>" + data[i].操作时间 + "</span></h3><p style='font-size:15px;width:350px;word-break: break-word;color:#a2a2a2'><br>" + data[i].备注 + "</p></div></li>"
- }
- $("#timeline").html(html)
- })
- }
- }
- })
- }
- }
- // 删除接口信息
- function del_interface() {
- var id = $("#interface").datagrid("getSelected")["ID"];
- top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
- //执行删除
- $.post("/ProManager/Del_Interface?id=" + id, function (data) {
- if (data) {
- $('#interface').datagrid('reload');
- top.ZLPMS.Msg("删除成功");
- }
- else {
- top.ZLPMS.Msg("删除失败");
- }
- })
- });
- }
- //新增接口信息
- function add_interface() {
- var projectId = $('#project').datagrid("getSelected");
- if (projectId == null) {
- top.ZLPMS.Msg("请选择一个项目")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '新建接口信息',
- url: '/ProManager/Interface_Window?id=' + projectId["ID"] + '&type=1' + '&state=' + projectId.STATE,
- area: ['750px', '700px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Forms.Interface_PostData(index, 1, 2, $('#interface'));//调用子页面的方法,得到子页面返回的ids
- $('#interface').datagrid('reload');
- }
- });
- }
- };
- //编辑接口信息
- function edit_interface() {
- var obj = $('#interface').datagrid("getSelected");
- if (obj == null) {
- top.ZLPMS.Msg("请选择一条记录")
- }
- else {
- top.ZLPMS.OpenWindow({
- title: '编辑接口信息',
- url: '/ProManager/Interface_Window?id=' + obj["ID"] + '&type=2',
- area: ['750px', '700px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Forms.Interface_PostData(index, 2, 2, $('#interface'));//调用子页面的方法,得到子页面返回的ids
- $('#interface').datagrid('reload');
- }
- });
- }
- };
- //变更接口
- function deal_interface() {
- var obj = $("#interface").datagrid("getSelected");
- if (obj == null) {
- top.ZLPMS.Msg("请选择一条记录");
- return
- }
- top.ZLPMS.OpenWindow({
- title: '变更状态',
- url: '/ProManager/DealWindow?&id=' + obj["ID"],
- area: ['800px', '600px'],
- yes: function (index, layero) {
- //表单提交
- var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
- iframeWin.Forms.DealInte_PostData(index, $("#interface"));//调用子页面的方法,得到子页面返回的ids
- }
- });
- }
- //刷新
- function refresh() {
- $("#Station").datagrid("reload");
- $("#Server").datagrid("reload");
- $("#Worker").datagrid("reload");
- $("#product").datagrid("reload");
- $("#serverDataBaseInfo").datagrid("reload");
- }
- //简码
- function changename() {
- var val = $("#name").val();
- if (val) {//获取简码
- var code = makePy(val);
- $("#simple").val(code);
- }
- var val = $("#MC").val();
- if (val) {//获取简码
- var code = makePy(val);
- $("#JM").val(code);
- }
- }
- //批量导入窗口
- function openItemupload() {
- projectObj.projectId = $('#project').datagrid("getSelected");
- if (!projectObj.projectId) {
- layer.msg('请先选择需要导入数据的项目!', {
- time: 1000
- });
- return false;
- }
- top.ZLPMS.OpenWindow({
- url: "/ProManager/Itemupload?ItemInfoId=" + projectObj.projectId["ID"],
- area: ['670px', '430px'],
- title: "人员信息批量录入",
- yes: false,
- });
- }
- //导入操作
- layui.use(['form', 'upload'], function () {
- var form = layui.form,
- $ = layui.jquery,
- upload = layui.upload; //只有执行了这一步,部分表单元素才会自动修饰成功
- var demoListView = $('#demoList'),
- uploadListIns = upload.render({
- elem: '#Xmlfiles' //允许上传的文件后缀
- , url: '/ProManager/ItemSiteBatch'
- , method: "post"
- , accept: 'file' //普通文件
- , exts: 'xml' //只允许上传压缩文件
- , multiple: false
- , number: '1'
- , auto: false
- , bindAction: '#confirm'
- , choose: function (obj) {
- var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
- //读取本地文件
- obj.preview(function (index, file, result) {
- var tr = $(['<tr id="upload-' + index + '">'
- , '<td class="uplad-filename">' + file.name + '</td>'
- , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
- , '<td>等待导入</td>'
- , '<td>'
- , '<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
- , '<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete">删除</button>'
- , '</td>'
- , '</tr>'].join(''));
- //单个重传
- tr.find('.demo-reload').on('click', function () {
- obj.upload(index, file);
- });
- //删除
- tr.find('.demo-delete').on('click', function () {
- delete files[index]; //删除对应的文件
- tr.remove();
- uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
- });
- demoListView.append(tr);
- });
- }
- , done: function (res, index, upload) {
- if (res.code == 1) { //上传成功
- var text = "共导入" + res.sum + "条记录,添加成功" + res.addsuccess + "条,修改" + res.updatesuccess_In + "条";
- top.ZLPMS.Msg(text, 1, 6000);
- var tr = demoListView.find('tr#upload-' + index)
- , tds = tr.children();
- tds.eq(2).html('<span style="color: #5FB878;">导入成功</span>');
- tds.eq(3).find('.demo-reload').addClass('layui-hide'); //显示重传
- //tds.eq(3).html(''); //清空操作
- return delete this.files[index]; //删除文件队列已经上传成功的文件
- }
- else {
- this.error(index, upload);
- }
- }
- , error: function (index, upload) {
- var tr = demoListView.find('tr#upload-' + index)
- , tds = tr.children();
- tds.eq(2).html('<span style="color: #FF5722;">导入失败</span>');
- tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
- }
- });
- });
- function Close() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- //人员导入导出工具下载
- function DowdTool() {
- window.open('/Problem/ViewProblemImage?id=4197');
- }
- //工具上传
- function toolupload() {
- top.ZLPMS.OpenWindow({
- url: "/ProManager/toolupload",
- area: ['670px', '430px'],
- title: "工具上传",
- yes: false,
- });
- }
- //附件上传
- layui.use('upload', function () {
- var upload = layui.upload;
- var demoListView = $('#demoList');
- var uploadInst = upload.render({
- elem: '#ChooseFile' //文件选择按钮
- , url: '/ProManager/FileUpload'
- , method: "post"
- , accept: 'file' //普通文件(文件类型)
- , multiple: true //多文件上传
- , auto: false //自动上传
- , size: 10000
- , bindAction: "#btn_upload"
- , number: 3//最大允许上传文件数量
- , choose: function (obj) {
- var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
- //读取本地文件
- obj.preview(function (index, file, result) {
- var display = "none";
- if (file.type == "image/jpeg" || file.type == "image/png") {
- display = "";
- }
- var tr = $(['<tr id="upload-' + index + '">'
- , '<td class="uplad-filename">' + file.name + '</td>'
- , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
- , '<td>等待上传</td>'
- , '<td>'
- , '<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete" style="height:25px;line-height:25px">删除</button>'
- , '<img src="' + result + '" class="CheckImg" width="auto" height="40" style="margin-left:10px;display:' + display + '"/>'
- , '</td>'
- , '</tr>'].join(''));
- //单个重传
- tr.find('.demo-reload').on('click', function () {
- obj.upload(index, file);
- });
- //删除
- tr.find('.demo-delete').on('click', function () {
- delete files[index]; //删除对应的文件
- tr.remove();
- uploadInst.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
- });
- demoListView.append(tr);
- });
- }
- , allDone: function (obj) {
- top.ZLPMS.Msg("总共上传" + obj.total + ",成功" + obj.successful + "个,失败" + obj.aborted + "个")
- if ($('#Constantly').prop("checked")) {
- ZLPMS.UnLoading(projectObj.index)
- top.ZLPMS.UnLoading(projectObj.index2);
- //根据Type选择不同的登记弹窗
- ProjectProblem_Window();//项目问题
- ZLPMS.CloseTopWindow(true);
- return;
- }
- ZLPMS.UnLoading(projectObj.index)
- top.ZLPMS.UnLoading(projectObj.index2);
- ZLPMS.CloseTopWindow(true);
- }
- });
- });
- //下载附件文件
- function downloadfile(id) {
- window.open('/Problem/ViewProblemImage?id=' + id);
- }
- //图片放大查看
- function Zoom(event) {
- var img = "<img src='" + event + "'>"
- layer.open({
- type: 1,//Page层类型
- area: ['500px', '300px'],
- title: '附件查看',
- shade: 0.6,//遮罩透明度
- maxmin: true,//允许全屏最小化
- anim: 1,//0-6的动画形式,-1不开启
- content: img
- });
- }
- //删除附件
- function Delete_img(data) {
- top.ZLPMS.Confirm('删除后无法恢复,您确定要删除该附件吗?', 3, function (idx) {
- $.post("/ProManager/Delete_Attachment", { id: data }, function (d) {
- if (d == 1) {
- top.ZLPMS.Msg("删除成功", 1);
- var classname = "#Attachment" + data;
- var icon = "#icon" + data;
- $(classname).attr("style", "display:none;")
- $(icon).attr("style", "display:none;")
- }
- else {
- top.ZLPMS.Msg("删除失败", 2)
- }
- })
- });
- }
- //预览
- function View() {
- if (projectObj.xmid == null) {
- top.ZLPMS.Msg("请先选择项目");
- return false;
- }
- top.ZLPMS.OpenWindow({
- title: '预览',
- url: "/WebForms/WebReportView.aspx?reportName=1&xmid=" + projectObj.xmid,
- area: ['1000px', '800px'],
- });
- }
- //智能表单表格
- function databindSmart(id) {
- var Params = {
- FLID: 0,
- BDXXID: "",
- QDID: "",
- XMID: id,
- BDJLID: "",
- BZ: "0,1,2",//用于传状态
- };
- $('#Smart').datagrid({
- url: '/SmartForm/SelectRecordListAll',
- method: 'post',
- toolbar: '#btn_Smart',
- queryParams: Params,
- singleSelect: true,
- collapsible: true,
- rownumbers: true,
- fit: true,
- pagination: true,
- columns: [[
- { field: 'ID', title: 'ID', width: 20, align: 'center', fixed: true, hidden: true },
- { field: 'FLID', title: '分类id', width: 20, align: 'center', fixed: true, hidden: true },
- {
- field: 'BDM', title: '填写表单', align: 'left', fixed: true, width: 200,
- },
- {
- field: 'TBR', title: '填报人', align: 'left', fixed: true, width: 80,
- },
- {
- field: 'TBSJ', title: '填报时间', width: 140, align: 'center', fixed: true,
- },
- {
- field: 'TBZT', title: '状态', align: 'left', fixed: true, width: 80,
- formatter: function (value, rowData, index) {
- if (rowData.TBZT == 0) {
- return "填报";
- }
- else if (rowData.TBZT == 1) {
- return "通过";
- }
- else {
- return "退回";
- }
- }, styler: function (value, rowData, index) {
- if (rowData.TBZT == 0) {
- return "color:#007aff";
- }
- else if (rowData.TBZT == 1) {
- return "color:#4cd964";
- }
- else {
- return "color: red";
- }
- },
- },
- {
- field: 'SHR', title: '审核人', align: 'left', fixed: true, width: 80,
- },
- {
- field: 'SHSJ', title: '审核时间', width: 140, align: 'center', fixed: true,
- },
- ]],
- });
- $("#BD").combobox({
- url: '/SmartForm/BdxxSelectList',
- queryParams: {
- FLID: 0
- },
- valueField: 'ID',
- textField: 'BT'
- });
- }
- //表单预览
- function smartView() {
- var row = $('#Smart').datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选择列");
- return;
- }
- //if (projectObj.xmid == null) {
- // top.ZLPMS.Msg("请先选择项目");
- // return false;
- //}
- top.ZLPMS.OpenWindow({
- title: row.BDM,
- btn: [],
- url: "/SmartForm/SmarView?ID=" + row.ID,
- area: ['1000px', '800px'],
- });
- }
- //表单新增
- function smartAdd() {
- var row = $('#project').datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选项目");
- return;
- }
- var combox = $('#BD').combobox('getValue');
- if (!combox) {
- top.ZLPMS.Msg("请选表单");
- return;
- }
- top.ZLPMS.OpenWindow({
- title: row.名称 + "【" + $('#BD').combobox('getText') + "】(新增)",
- btn: [],
- /*url: '/SmartForm/MobileSmartDetail/' + combox,*/
- url: "/SmartForm/PcSmartFormList?ID=" + combox + "&XMID=" + row.ID + "&XMMC=" + row.名称,
- area: ['90%', '90%'],
- yes: function (index, layero) {
- //表单提交
- $('#Smart').datagrid('reload');
- }
- });
- }
- //表单修改
- function smartEdit() {
- var rowPro = $('#project').datagrid('getSelected');
- if (!rowPro) {
- top.ZLPMS.Msg("请选项目");
- return;
- }
- var row = $("#Smart").datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选择列");
- return;
- }
- top.ZLPMS.OpenWindow({
- title: rowPro.名称 + "【" + row.BDM + "】(修改)",
- btn: [],
- url: "/SmartForm/EditPcSmartFormList?ID=" + row.ID,
- area: ['90%', '90%'],
- yes: function (index, layero) {
- //表单提交
- $('#Smart').datagrid('reload');
- }
- });
- }
- //表单刷新
- function smartRefresh() {
- $("#Smart").datagrid("reload");
- }
- //删除表单
- function smartDel() {
- var row = $("#Smart").datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选择列");
- return;
- }
- if (row.TBZT == 1) {
- top.ZLPMS.Msg("当前记录不能被删除!");
- return;
- }
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
- var param = {
- ID: row.ID,
- BZ: 4
- };
- $.post("/SmartForm/UpdateRecord", param, function (data) {
- if (data.code == 200) {
- $("#Smart").datagrid("reload");
- top.ZLPMS.Msg(data.msg);
- } else {
- top.ZLPMS.Msg(data.msg);
- }
- })
- });
- }
|