ProjectManager.js 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492
  1. var projectObj = {
  2. personnelId: null,
  3. accountId: null,
  4. channelId: null,
  5. projectId: null,
  6. nature: null,
  7. IsAdmin: null,
  8. remote: null,
  9. identify: null,
  10. xmid: null
  11. }
  12. function viewModel() {
  13. this.id = "";
  14. //渠道信息
  15. this.init = function () {
  16. var search = $("#dtn-search").val();
  17. $('#ChannelInfo').datagrid({
  18. url: '/ProManager/Datagrid',
  19. method: 'Get',
  20. singleSelect: true,
  21. rownumbers: true,
  22. onSelect: function (rowIndex, rowData) {
  23. $("#dtn-search-project").searchbox("setValue", "");
  24. projectObj.channelId = $('#ChannelInfo').datagrid("getSelected")["ID"];
  25. databindProject()
  26. databindStation(0)
  27. databindServer(0)
  28. databindWorker(0)
  29. databindProduct(0)
  30. databindModual(0)
  31. databindInstrument(0)
  32. databindRemote(0)
  33. databindInter(0)
  34. databindSmart(0)
  35. }
  36. });
  37. $('#project').datagrid({
  38. toolbar: '#btn_func',
  39. fit: true,
  40. rownumbers: true,
  41. columns: [[
  42. { field: '名称', title: '名称', width: 180 },
  43. { field: '负责人', title: '负责人', width: 80 },
  44. { field: '性质', title: '性质', width: 80, align: 'center' },
  45. { field: '实施方式', title: '实施方式', width: 80, align: 'center' },
  46. { field: '统一社会信用代码', title: '统一社会信用代码', width: 120, align: 'center' },
  47. {
  48. field: '状态', title: '项目状态', width: 70, align: 'center'
  49. },
  50. //{ field: '上线时间', title: '上线时间', width: 120, align: 'center' },
  51. //{ field: '验收时间', title: '验收时间', width: 120, align: 'center' },
  52. { field: '中心数量', title: '中心数量', width: 100 },
  53. { field: '村站数量', title: '村站数量', width: 80 },
  54. { field: '网络带宽', title: '网络带宽', width: 80 },
  55. { field: '服务器分离', title: '服务器分离', width: 90, align: 'center' },
  56. { field: '账号', title: '账号', width: 80 },
  57. { field: '密码', title: '密码', width: 80 },
  58. { field: '联系方式', title: '联系方式', width: 90, align: 'center' },
  59. { field: '启用监控', title: '启用监控', width: 90, align: 'center' },
  60. { field: '概况', title: '概况', width: 300 }
  61. ]]
  62. })
  63. }
  64. //加载项目
  65. this.load = function (id) {
  66. //ID
  67. $("#id").val(id);
  68. //性质
  69. $("#nature").combobox({
  70. url: '/ProManager/GetNature',
  71. valueField: 'ID',
  72. textField: '显示名',
  73. onLoadSuccess: function (data) {
  74. $('#nature').combobox('setValue', data[0].ID);
  75. }
  76. });
  77. //工作流目录
  78. $("#GZLMLID").combobox({
  79. url: '/ProManager/GetCatalog?id=1',
  80. valueField: 'ID',
  81. textField: '名称',
  82. onLoadSuccess: function (data) {
  83. $('#GZLMLID').combobox('setValue', data[0].ID);
  84. }
  85. });
  86. //实施方式
  87. $("#implementation").combobox({
  88. url: '/ProManager/GetImplementation',
  89. valueField: 'ID',
  90. textField: '显示名',
  91. onLoadSuccess: function (data) {
  92. $('#implementation').combobox('setValue', data[0].ID);
  93. }
  94. });
  95. //项目状态
  96. $("#state").combobox({
  97. url: '/ProManager/GetState',
  98. valueField: 'ID',
  99. textField: '显示名',
  100. onLoadSuccess: function (data) {
  101. $('#state').combobox('setValue', data[0].ID);
  102. }
  103. });
  104. $('#BHCustomer').combogrid({
  105. mode: 'remote',
  106. value: '',
  107. idField: '编码',
  108. textField: '名称',
  109. panelHeight: 380,
  110. url: "/ProManager/GetBHCustomer",
  111. columns: [[
  112. {
  113. field: 'son', title: '序号', width: 40,
  114. formatter: function (value, row, index) {//设置自动增长列
  115. index += 1;//设置起始序号为1,如果不加这行代码序号就会从0开始
  116. return index++;//根据行的数量不断自增
  117. }
  118. },
  119. { field: 'id', title: 'id', width: 100, hidden: true },
  120. { field: '编码', title: '编码', width: 100, hidden: true },
  121. { field: '名称', title: '客户名称', width: 230 },
  122. { field: '社会信用代码', title: '社会信用代码', width: 170 },
  123. { field: '简码', title: '简码', width: 100 }
  124. ]],
  125. onSelect: function (rowIndex, rowData) {
  126. $('#name').val(rowData.名称);
  127. $('#SocialCreditCode').val(rowData.社会信用代码);
  128. $('#simple').val(rowData.简码);
  129. $('#BHID').val(rowData.id);
  130. }
  131. });
  132. //上线时间
  133. $(function () {
  134. var curr_time = new Date();
  135. var str = curr_time.getFullYear() + "-";
  136. str += curr_time.getMonth() + 1 + "-";
  137. str += curr_time.getDate();
  138. $('#onlineDate').datebox('setValue', str);
  139. });
  140. }
  141. //绑定项目信息
  142. this.bindData = function (id) {
  143. //性质
  144. $("#nature").combobox({
  145. url: '/ProManager/GetNature',
  146. valueField: 'ID',
  147. textField: '显示名'
  148. });
  149. //实施方式
  150. $("#implementation").combobox({
  151. url: '/ProManager/GetImplementation',
  152. valueField: 'ID',
  153. textField: '显示名'
  154. });
  155. //项目状态
  156. $("#state").combobox({
  157. url: '/ProManager/GetState',
  158. valueField: 'ID',
  159. textField: '显示名'
  160. });
  161. //工作流目录
  162. $("#GZLMLID").combobox({
  163. url: '/ProManager/GetCatalog?id=1',
  164. valueField: 'ID',
  165. textField: '名称',
  166. });
  167. //详细信息加载
  168. $.ajax({
  169. url: '/ProManager/GetProInfo/' + id,
  170. method: 'GET',
  171. success: function (data) {
  172. if (data.code == 200) {
  173. $('#id').val(data.obj[0].渠道ID);
  174. $('#charge').val(data.obj[0].负责人);
  175. $('#name').val(data.obj[0].名称);
  176. $('#survey').val(data.obj[0].概况);
  177. $('#simple').val(data.obj[0].简码);
  178. $('#SocialCreditCode').val(data.obj[0].统一社会信用代码);
  179. $('#coreNum').val(data.obj[0].中心数量);
  180. $('#villageNum').val(data.obj[0].村站数量);
  181. $('#bandwidth').val(data.obj[0].网络带宽);
  182. if (data.obj[0].服务器分离 == 1) {
  183. $('#serveSeparate').switchbutton({ checked: true });
  184. }
  185. else {
  186. $('#serveSeparate').switchbutton({ checked: false });
  187. }
  188. $('#nature').combobox('setValue', data.obj[0].性质);
  189. $('#implementation').combobox('setValue', data.obj[0].实施方式);
  190. $('#state').combobox('setValue', data.obj[0].状态);
  191. $('#onlineDate').datebox('setValue', data.obj[0].上线时间);
  192. $('#checkDate').datebox('setValue', data.obj[0].验收时间);
  193. $('#endTime').val(data.obj[0].授权到期时间);
  194. $('#another').val(data.obj[0].分管领导);
  195. $('#anotherPhone').val(data.obj[0].分管领导电话);
  196. $('#principal').val(data.obj[0].项目对接人);
  197. $('#principalPhone').val(data.obj[0].项目对接人电话);
  198. $('#attentionLevel').val(data.obj[0].关注度);
  199. if (data.obj[0].启用监控 == 1) {
  200. $('#enable').switchbutton({ checked: true });
  201. }
  202. else {
  203. $('#enable').switchbutton({ checked: false });
  204. }
  205. $('#email').val(data.obj[0].邮件推送);
  206. $('#wxin').val(data.obj[0].微信推送);
  207. layui.use(['rate'], function () {
  208. var rate = layui.rate;
  209. // 单个渲染
  210. rate.render({
  211. elem: '.attentionLevel',
  212. choose: function (value) {
  213. $('#attentionLevel').val(value);
  214. console.log(value); // 获得选中的评分值
  215. },
  216. value: $('#attentionLevel').val()
  217. });
  218. });
  219. } else {
  220. //弹出错误消息
  221. ZLPMS.Alert(data.msg, 1);
  222. }
  223. }
  224. })
  225. //问题审核流程
  226. $.ajax({
  227. url: '/ProManager/GetXMWTLC/' + id,
  228. method: 'GET',
  229. success: function (data) {
  230. if (data.length > 0) {
  231. $("#SHID").val(data[0].ID)
  232. $("#GZLMLID").combobox('setValue', data[0].工作流目录ID);
  233. } else {
  234. //弹出错误消息
  235. top.ZLPMS.Msg("该项目暂未设置审核流程,请前往设置!");
  236. }
  237. }
  238. })
  239. //附件
  240. $.post("/ProManager/Attachment?id=" + id + "&type=1", {}, function (data) {
  241. if (data != null || data.length > 0) {
  242. $("#attchment").html();
  243. var html = "";
  244. for (var i = 0; i < data.length; i++) {
  245. if (data[i].type == 1) {
  246. 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>";
  247. }
  248. else {
  249. 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>";
  250. }
  251. }
  252. $("#attchment").html(html);
  253. }
  254. })
  255. //BH客户数据获取
  256. $('#BHCustomer').combogrid({
  257. mode: 'remote',
  258. value: '',
  259. idField: '编码',
  260. textField: '名称',
  261. panelHeight: 380,
  262. url: "/ProManager/GetBHCustomer",
  263. columns: [[
  264. {
  265. field: 'son', title: '序号', width: 40,
  266. formatter: function (value, row, index) {//设置自动增长列
  267. index += 1;//设置起始序号为1,如果不加这行代码序号就会从0开始
  268. return index++;//根据行的数量不断自增
  269. }
  270. },
  271. { field: 'id', title: 'id', width: 100, hidden: true },
  272. { field: '编码', title: '编码', width: 100, hidden: true },
  273. { field: '名称', title: '客户名称', width: 230 },
  274. { field: '社会信用代码', title: '社会信用代码', width: 170 },
  275. { field: '简码', title: '简码', width: 100 }
  276. ]],
  277. onSelect: function (rowIndex, rowData) {
  278. $('#name').val(rowData.名称);
  279. $('#SocialCreditCode').val(rowData.社会信用代码);
  280. $('#simple').val(rowData.简码);
  281. $('#BHID').val(rowData.id);
  282. }
  283. });
  284. }
  285. //加载机构
  286. this.StationLoad = function (id) {
  287. //ID
  288. $("#ID").val(id);
  289. //项目等级
  290. $("#DJ").combobox({
  291. url: '/ProManager/GetLevel',
  292. valueField: 'ID',
  293. textField: '显示名',
  294. onLoadSuccess: function (data) {
  295. $('#DJ').combobox('setValue', data[0].ID);
  296. }
  297. });
  298. //项目状态
  299. $("#ZT").combobox({
  300. url: '/ProManager/GetState',
  301. valueField: 'ID',
  302. textField: '显示名',
  303. onLoadSuccess: function (data) {
  304. $('#ZT').combobox('setValue', data[0].ID);
  305. }
  306. });
  307. //上线时间
  308. $(function () {
  309. var curr_time = new Date();
  310. var str = curr_time.getFullYear() + "-";
  311. str += curr_time.getMonth() + 1 + "-";
  312. str += curr_time.getDate();
  313. $('#SXSJ').datebox('setValue', str);
  314. });
  315. //工作流目录
  316. $("#GZLMLID").combobox({
  317. url: '/ProManager/GetCatalog?id=2',
  318. valueField: 'ID',
  319. textField: '名称',
  320. onLoadSuccess: function (data) {
  321. $('#GZLMLID').combobox('setValue', data[0].ID);
  322. }
  323. });
  324. }
  325. //绑定机构信息
  326. this.StationBind = function (id) {
  327. //项目等级
  328. $("#DJ").combobox({
  329. url: '/ProManager/GetLevel',
  330. valueField: 'ID',
  331. textField: '显示名'
  332. });
  333. //项目状态
  334. $("#ZT").combobox({
  335. url: '/ProManager/GetState',
  336. valueField: 'ID',
  337. textField: '显示名'
  338. });
  339. $.ajax({
  340. url: '/ProManager/GetStationInfo/' + id,
  341. method: 'GET',
  342. success: function (data) {
  343. if (data.code == 200) {
  344. $("#ID").val(data.obj[0].ID);
  345. $("#XMID").val(data.obj[0].项目ID);
  346. $('#MC').val(data.obj[0].名称);
  347. $('#GK').val(data.obj[0].概况);
  348. $('#JM').val(data.obj[0].简码);
  349. $('#CWL').val(data.obj[0].床位量);
  350. $('#RMZL').val(data.obj[0].日门诊量);
  351. $('#NSR').val(data.obj[0].年收入);
  352. $('#DJ').combobox('setValue', data.obj[0].等级);
  353. $('#ZT').combobox('setValue', data.obj[0].状态);
  354. $('#SXSJ').datebox('setValue', data.obj[0].上线时间);
  355. $('#YSSJ').datebox('setValue', data.obj[0].验收时间);
  356. $('#IPD').val(data.obj[0].IP段);
  357. $('#FZRM').val(data.obj[0].负责人名);
  358. $('#DH').val(data.obj[0].电话);
  359. $('#GLRM').val(data.obj[0].管理人名);
  360. $('#GLRDH').val(data.obj[0].管理人电话);
  361. ProblemLoad($("#XMID").val())
  362. } else {
  363. //弹出错误消息
  364. ZLPMS.Alert(data.msg, 1);
  365. }
  366. }
  367. })
  368. //工作流目录
  369. $("#GZLMLID").combobox({
  370. url: '/ProManager/GetCatalog?id=2',
  371. valueField: 'ID',
  372. textField: '名称',
  373. });
  374. //问题审核流程
  375. function ProblemLoad(XMID) {
  376. $.ajax({
  377. url: '/ProManager/GetProblem?XMID=' + XMID + "&ID=" + id,
  378. method: 'GET',
  379. success: function (data) {
  380. if (data.length > 0) {
  381. $("#GZLMLID").combobox('setValue', data[0].工作流目录ID);
  382. } else {
  383. //弹出错误消息
  384. top.ZLPMS.Msg("该项目暂未设置审核流程,请前往设置!");
  385. }
  386. }
  387. })
  388. }
  389. }
  390. //加载服务器
  391. this.ServerLoad = function (id) {
  392. //ID
  393. $("#XMID").val(id);
  394. //服务器类型
  395. $("#LX").combobox({
  396. url: '/ProManager/GetServerType',
  397. valueField: 'ID',
  398. textField: '显示名',
  399. multiple: true,// 开启多选
  400. onLoadSuccess: function (data) {
  401. $('#LX').combobox('setValue', data[0].ID);
  402. }
  403. });
  404. //安装服务类型
  405. $("#AZFW").combobox({
  406. url: '/ProManager/GetInstallServerType',
  407. valueField: 'ID',
  408. textField: '显示名',
  409. multiple: true, // 开启多选
  410. onLoadSuccess: function (data) {
  411. $('#AZFW').combobox('setValue', data[0].ID);
  412. }
  413. });
  414. //数据库类型
  415. $("#SJKLX").combobox({
  416. url: '/ProManager/GetDataBaseType',
  417. valueField: 'ID',
  418. textField: '显示名',
  419. onLoadSuccess: function (data) {
  420. $('#SJKLX').combobox('setValue', '');
  421. }
  422. });
  423. //产品
  424. $("#CP").combobox({
  425. url: '/ProManager/GetProduct',
  426. valueField: 'ID',
  427. textField: '显示名',
  428. onLoadSuccess: function (data) {
  429. $('#CP').combobox('setValue', data[0].ID);
  430. }
  431. });
  432. }
  433. //绑定服务器
  434. this.ServerBind = function (id) {
  435. //ID
  436. $("#ID").val(id);
  437. //服务器类型
  438. $("#LX").combobox({
  439. url: '/ProManager/GetServerType',
  440. valueField: 'ID',
  441. textField: '显示名',
  442. multiple: true // 开启多选
  443. });
  444. //安装服务类型
  445. $("#AZFW").combobox({
  446. url: '/ProManager/GetInstallServerType',
  447. valueField: 'ID',
  448. textField: '显示名',
  449. multiple: true // 开启多选
  450. });
  451. //数据库类型
  452. $("#SJKLX").combobox({
  453. url: '/ProManager/GetDataBaseType',
  454. valueField: 'ID',
  455. textField: '显示名'
  456. });
  457. //产品
  458. $("#CP").combobox({
  459. url: '/ProManager/GetProduct',
  460. valueField: 'ID',
  461. textField: '显示名'
  462. });
  463. $.ajax({
  464. url: '/ProManager/GetServerInfo/' + id,
  465. method: 'GET',
  466. success: function (data) {
  467. if (data.code == 200) {
  468. $('#ID').val(id);
  469. $('#XMID').val(data.obj[0].项目ID);
  470. $('#NC').val(data.obj[0].内存);
  471. $('#XH').val(data.obj[0].型号);
  472. $('#CZJT').val(data.obj[0].操作系统);
  473. $('#CPU').val(data.obj[0].CPU);
  474. $('#IPDZ').val(data.obj[0].IP地址);
  475. $('#SJKBB').val(data.obj[0].数据库版本);
  476. $('#JQM').val(data.obj[0].机器码);
  477. $('#SM').val(data.obj[0].说明);
  478. if (data.obj[0].类型 != "" && data.obj[0].类型 != null) {
  479. $('#LX').combobox('setValue', data.obj[0].类型.split(","));
  480. }
  481. if (data.obj[0].安装服务 != "" && data.obj[0].类型 != null) {
  482. $('#AZFW').combobox('setValue', data.obj[0].安装服务.split(","));
  483. }
  484. $('#SJKLX').combobox('setValue', data.obj[0].数据库类型);
  485. $('#CP').combobox('setValue', data.obj[0].产品);
  486. $('#SJKLJC').val(data.obj[0].数据库连接串);
  487. $('#FWFXDK').val(data.obj[0].服务发现端口);
  488. $('#FHQ').val(data.obj[0].防火墙);
  489. $('#SDRJ').val(data.obj[0].杀毒软件);
  490. $('#BFFS').val(data.obj[0].备份方式);
  491. $('#BFLJ').val(data.obj[0].备份路径);
  492. $('#BFRJ').val(data.obj[0].备份软件);
  493. $('#ZH').val(data.obj[0].账号);
  494. $('#MM').val(data.obj[0].密码);
  495. } else {
  496. //弹出错误消息
  497. ZLPMS.Alert(data.msg, 1);
  498. }
  499. }
  500. })
  501. }
  502. //加载项目人员
  503. this.Workerload = function (id) {
  504. //ID
  505. $("#ID").val(id);
  506. //人员项目
  507. $("#XM").combobox({
  508. url: '/ProManager/GetWorkerInfo',
  509. valueField: 'ID',
  510. textField: '姓名'
  511. });
  512. //加入时间
  513. $(function () {
  514. var curr_time = new Date();
  515. var str = curr_time.getFullYear() + "-";
  516. str += curr_time.getMonth() + 1 + "-";
  517. str += curr_time.getDate();
  518. $('#RZSJ').datebox('setValue', str);
  519. });
  520. $('#RZSJ').datebox({ panelHeight: '250px' })
  521. }
  522. //加载产品
  523. this.ProductLoad = function (id) {
  524. //ID
  525. $("#ID").val(id);
  526. //产品
  527. $("#CPID").combobox({
  528. url: '/ProManager/GetProductByID',
  529. valueField: 'ID',
  530. textField: '名称',
  531. onChange: function (newValue, oldValue) {
  532. //版本
  533. $("#BB").combobox({
  534. url: '/ProManager/GetEditionByID/' + newValue,
  535. valueField: 'ID',
  536. textField: '版本号'
  537. });
  538. }
  539. });
  540. }
  541. //绑定产品
  542. this.ProductBind = function (id) {
  543. var cpID = "";
  544. //产品
  545. $("#CPID").combobox({
  546. url: '/ProManager/GetProductByID',
  547. valueField: 'ID',
  548. textField: '名称',
  549. onChange: function (newValue, oldValue) {
  550. cpID = newValue;
  551. $("#BB").combobox({
  552. url: '/ProManager/GetEditionByID/' + newValue,
  553. valueField: 'ID',
  554. textField: '版本号'
  555. });
  556. }
  557. });
  558. $.ajax({
  559. url: '/ProManager/GetProductInfo/' + id,
  560. method: 'GET',
  561. success: function (data) {
  562. if (data != null) {
  563. $('#CPID').combobox('setValue', data[0].ID);
  564. bindProduct(id);
  565. } else {
  566. //弹出错误消息
  567. top.ZLPMS.Msg("系统中没有该条数据");
  568. }
  569. }
  570. })
  571. //应用状态
  572. $("#YYZT").combobox({
  573. //data: [{ "ID": "-1", "名称": "无" }, { "ID": "0", "名称": "停用" }, { "ID": "1", "名称": "正在使用" }, { "ID": "2", "名称": "使用元HIS" }],
  574. url: '/ProManager/SelectNature?ID=DD2C3294-4FBB-4616-A046-07D3CAF52414',
  575. valueField: '代码',
  576. textField: '名称',
  577. limitToList: true,
  578. onLoadSuccess: function (data) {
  579. //let found = data.find(item => item.是否默认="0");
  580. //$(this).combobox('select', found.代码);
  581. }
  582. });
  583. }
  584. //版本和说明
  585. function bindProduct(id) {
  586. $.ajax({
  587. url: '/ProManager/GetProjectProducct/' + id,
  588. method: 'post',
  589. success: function (data) {
  590. $('#BB').combobox('setValue', data[0].版本);
  591. $('#YYZT').combobox('setValue', data[0].应用状态);
  592. $('#SM').val(data[0].说明);
  593. }
  594. })
  595. }
  596. //绑定远程方式
  597. this.RemoteLoad = function (obj) {
  598. obj = JSON.parse(obj.replace(/&quot;/g, '"'))
  599. $("#ID").val(obj.ID)
  600. $("#MC").val(obj.名称);
  601. $("#ZH").val(obj.账号);
  602. $("#MM").val(obj.密码);
  603. $("#BZ").val(obj.备注);
  604. $("#LJR").val(obj.联系人);
  605. $("#LJRDH").val(obj.联系人电话);
  606. }
  607. //加载项目个性化
  608. this.IdentifyData = function (id) {
  609. //项目所属的产品
  610. $("#CPID").combobox({
  611. url: '/Problem/GetProductByID/' + id,
  612. valueField: '产品ID',
  613. textField: '名称',
  614. onChange: function (newValue, oldValue) {
  615. //版本
  616. $("#BB").combobox({
  617. url: '/ProManager/GetEditionByID/' + newValue,
  618. valueField: 'ID',
  619. textField: '版本号',
  620. });
  621. }
  622. })
  623. $("#XGR").combobox({
  624. url: '/ProManager/GetWorker/' + id,
  625. valueField: '姓名',
  626. textField: '姓名DECODE'
  627. });
  628. }
  629. //绑定项目个性化
  630. this.IdentifyLoad = function (obj) {
  631. $.get("/ProManager/GetDataById", { id: obj }, function (data) {
  632. //项目所属的产品
  633. $("#CPID").combobox({
  634. url: '/Problem/GetProductByID/' + data[0].项目ID,
  635. valueField: '产品ID',
  636. textField: '名称',
  637. onChange: function (newValue, oldValue) {
  638. //版本
  639. $("#BB").combobox({
  640. url: '/ProManager/GetEditionByID/' + newValue,
  641. valueField: 'ID',
  642. textField: '版本号',
  643. });
  644. }
  645. })
  646. $("#XGR").combobox({
  647. url: '/ProManager/GetWorker/' + data[0].项目ID,
  648. valueField: '姓名',
  649. textField: '姓名DECODE'
  650. });
  651. switch (data[0].修改性质) {
  652. case 1: $("input[name=XGXZ][value=1]").attr('checked', 'checked'); break;
  653. case 2: $("input[name=XGXZ][value=2]").attr('checked', 'checked'); break;
  654. case 3: $("input[name=XGXZ][value=3]").attr('checked', 'checked'); break;
  655. }
  656. $("#ID").val(data[0].ID)
  657. $("#XMID").val(data[0].项目ID)
  658. $("#MC").textbox("setValue", data[0].名称)
  659. $("#CPID").combobox('setValue', data[0].产品ID);
  660. $("#XGR").combobox('setValue', data[0].修改人);
  661. $("#BB").combobox('setValue', data[0].版本);
  662. UM.getEditor('XGSM').setContent(data[0].修改说明 == null ? "" : data[0].修改说明);
  663. $("#XGSJ").datebox("setValue", data[0].修改时间)
  664. })
  665. //附件
  666. $.post("/ProManager/Attachment?id=" + obj + "&type=1", {}, function (data) {
  667. if (data != null || data.length > 0) {
  668. $("#attchment").html();
  669. var html = "";
  670. for (var i = 0; i < data.length; i++) {
  671. if (data[i].type == 1) {
  672. 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>";
  673. }
  674. else {
  675. 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>";
  676. }
  677. }
  678. $("#attchment").html(html);
  679. }
  680. })
  681. }
  682. //加载验收模块数据
  683. this.ModualData = function (id) {
  684. //项目所属的产品
  685. $("#CPID").combobox({
  686. url: '/Problem/GetProductByID/' + id,
  687. valueField: 'ID',
  688. textField: '名称',
  689. onChange: function (newValue, oldValue) {
  690. //所属模块
  691. $('#MKID').combotree({
  692. url: "/Problem/getmk/" + newValue,
  693. });
  694. }
  695. })
  696. }
  697. //初始化全局接口信息
  698. this.GlobalInit = function () {
  699. //项目
  700. $("#XMID").combobox({
  701. url: '/Problem/GetProjectByInfo',
  702. valueField: 'ID',
  703. textField: '名称',
  704. limitToList: true,
  705. })
  706. //创建人
  707. $("#CJR").combobox({
  708. url: '/ProManager/GetinfoBynature?type=0',
  709. valueField: 'ID',
  710. textField: '名称',
  711. limitToList: true,
  712. onLoadSuccess: function () {
  713. $.post("/ProManager/GetFeedbackID", function (data) {
  714. $("#CJR").combobox("setValue", data.id)
  715. })
  716. }
  717. })
  718. //负责人
  719. $("#ZRR").combobox({
  720. url: '/ProManager/GetinfoBynature?type=0',
  721. valueField: 'ID',
  722. textField: '名称',
  723. limitToList: true,
  724. onLoadSuccess: function () {
  725. $.post("/ProManager/GetFeedbackID", function (data) {
  726. $("#ZRR").combobox("setValue", data.id)
  727. })
  728. }
  729. })
  730. //用户名称
  731. $("#JKDFMC").combobox({
  732. url: '/ProManager/GetinfoBynature?type=1',
  733. valueField: 'ID',
  734. textField: '名称',
  735. })
  736. }
  737. //绑定全局接口信息
  738. this.GlobalBind = function (id) {
  739. //项目
  740. $("#XMID").combobox({
  741. url: '/Problem/GetProjectByInfo',
  742. valueField: 'ID',
  743. textField: '名称',
  744. limitToList: true,
  745. })
  746. //创建人
  747. $("#CJR").combobox({
  748. url: '/ProManager/GetinfoBynature?type=0',
  749. valueField: 'ID',
  750. textField: '名称',
  751. limitToList: true,
  752. onLoadSuccess: function () {
  753. $.post("/ProManager/GetFeedbackID", function (data) {
  754. //用户名称
  755. $("#JKDFMC").combobox({
  756. url: '/ProManager/GetinfoBynature?type=1',
  757. valueField: 'ID',
  758. textField: '名称',
  759. onLoadSuccess: function () {
  760. //负责人
  761. $("#ZRR").combobox({
  762. url: '/ProManager/GetinfoBynature?type=0',
  763. valueField: 'ID',
  764. textField: '名称',
  765. limitToList: true,
  766. onLoadSuccess: function () {
  767. $.post("/ProManager/GetFeedbackID", function (data) {
  768. $.ajax({
  769. url: '/ProManager/GetInterface/' + id,
  770. method: 'post',
  771. success: function (data) {
  772. if (data.length > 0) {
  773. $('#ID').val(id);
  774. $('#XMID').combobox('setValue', data[0].项目ID);
  775. $('#MC').textbox('setValue', data[0].名称);
  776. $('#MS').val(data[0].描述)
  777. $('#ZRR').combobox('setValue', data[0].责任人);
  778. $('#CJR').combobox('setValue', data[0].创建人);
  779. $('#JKDFMC').combobox('setValue', data[0].接口对方名称);
  780. $("#YSSJ").datebox("setValue", data[0].验收时间)
  781. $("#SQSJ").datebox("setValue", data[0].申请时间)
  782. $("#WCSJ").datebox("setValue", data[0].完成时间)
  783. switch (data[0].状态) {
  784. case 1: $("input[name=ZT][value=1]").attr('checked', 'checked'); break;
  785. case 2: $("input[name=ZT][value=2]").attr('checked', 'checked'); break;
  786. case 3: $("input[name=ZT][value=3]").attr('checked', 'checked'); break;
  787. case 4: $("input[name=ZT][value=4]").attr('checked', 'checked'); break;
  788. case 5: $("input[name=ZT][value=5]").attr('checked', 'checked'); break;
  789. case 6: $("input[name=ZT][value=6]").attr('checked', 'checked'); break;
  790. }
  791. switch (data[0].类型) {
  792. case 1: $("input[name=LX][value=1]").attr('checked', 'checked'); break;
  793. case 2: $("input[name=LX][value=2]").attr('checked', 'checked'); break;
  794. case 3: $("input[name=LX][value=3]").attr('checked', 'checked'); break;
  795. case 4: $("input[name=LX][value=4]").attr('checked', 'checked'); break;
  796. case 5: $("input[name=LX][value=5]").attr('checked', 'checked'); break;
  797. }
  798. //layui重新渲染
  799. layui.use('form', function () {
  800. var form = layui.form;//高版本建议把括号去掉,有的低版本,需要加()
  801. form.render()
  802. });
  803. } else {
  804. //弹出错误消息
  805. ZLPMS.Alert("数据异常,请联系管理人员", 3);
  806. }
  807. }
  808. })
  809. //附件
  810. $.post("/ProManager/Attachment?id=" + id + "&type=3", {}, function (data) {
  811. if (data != null && data.length > 0) {
  812. $("#attchment").html();
  813. var html = "";
  814. for (var i = 0; i < data.length; i++) {
  815. if (data[i].type == 1) {
  816. 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>";
  817. }
  818. else {
  819. 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>";
  820. }
  821. }
  822. $("#attchment").html(html);
  823. }
  824. })
  825. })
  826. }
  827. })
  828. }
  829. })
  830. })
  831. }
  832. })
  833. }
  834. //绑定产品服务时间
  835. this.ProductServicesBind = function (id) {
  836. $.ajax({
  837. url: '/ProManager/Get_SingleServiceRecord/' + id,
  838. method: 'GET',
  839. success: function (data) {
  840. if (data != null) {
  841. $("#ID").val(data[0].ID);
  842. $('#QDID').val(data[0].渠道ID);
  843. $("#XMID").val(data[0].项目ID);
  844. $("#CPID").val(data[0].项目产品模块ID);
  845. $("#FFLX").combobox('setValue', data[0].服务类型);
  846. $("#SM").val(data[0].说明);
  847. $("#ServiceStartTime").datebox("setValue", data[0].服务开始时间);
  848. $("#ServiceEndTime").datebox("setValue", data[0].服务结束时间);
  849. /* $("#contractDate").datebox("setValue", data[0].签订时间);*/
  850. $("#ALL").attr('disabled', 'disabled');
  851. } else {
  852. //弹出错误消息
  853. top.ZLPMS.Msg("系统中没有该条数据");
  854. }
  855. }
  856. })
  857. //应用状态
  858. }
  859. }
  860. //提交请求
  861. var Forms = {
  862. //表单提交
  863. Submit: function (index, layero) {
  864. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  865. iframeWin.Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  866. },
  867. //项目信息
  868. PostData: function (index) {
  869. //执行提交验证
  870. var r = $('#ff').form('validate');
  871. var name = $("#name").val();
  872. if (name == null || name == "") {
  873. top.ZLPMS.Msg("项目名称不能为空");
  874. }
  875. else {
  876. if (r) {//post到后台
  877. var url = '/ProManager/Add_Project';
  878. var param = ZLPMS.FormToObject('ff');
  879. var dealflow = $("#GZLMLID").combobox('getValue');
  880. if (param.enable) {
  881. if (param.email == "" && param.wxin == "") {
  882. top.ZLPMS.Msg("启用监控后必须填写项目经理邮箱或者微信");
  883. return;
  884. }
  885. }
  886. param.GZLMLID = dealflow;
  887. $.post(url, param, function (data) {
  888. if (data.length == 1) {
  889. document.getElementById("btn_upload").click()
  890. top.ZLPMS.CloseWindow(index);
  891. top.ZLPMS.Msg("添加成功");
  892. } else if (data == -1) {
  893. top.ZLPMS.Msg("项目名称已被使用请勿重复输入");
  894. }
  895. else {
  896. top.ZLPMS.CloseWindow(index);
  897. top.ZLPMS.Msg("添加失败");
  898. }
  899. });
  900. }
  901. }
  902. },
  903. //接口信息
  904. Interface_PostData: function (index, type, mode, obj) {
  905. var url = '/ProManager/Add_Interface';
  906. if (type == 2) {
  907. var url = '/ProManager/Edit_Interface';
  908. }
  909. //执行提交验证
  910. var r = $('#insert_interface').form('validate');
  911. if (r) {//post到后台
  912. var param = ZLPMS.FormToObject("insert_interface");//取页面填写的值
  913. param.JKMS = mode;
  914. if (param.LX == null) {
  915. top.ZLPMS.Msg("请选择类型");
  916. return
  917. }
  918. if (param.ZT == null && type == 1) {
  919. top.ZLPMS.Msg("请选择状态");
  920. return
  921. }
  922. $.post(url, param, function (data) {
  923. if (data == 1) {
  924. document.getElementById("btn_upload").click()
  925. obj.datagrid("reload")
  926. top.ZLPMS.Msg("保存成功");
  927. top.ZLPMS.CloseWindow(index);
  928. }
  929. else {
  930. top.ZLPMS.Msg("保存失败");
  931. top.ZLPMS.CloseWindow(index);
  932. }
  933. });
  934. }
  935. },
  936. //变更接口状态
  937. DealInte_PostData: function (index, obj) {
  938. var r = $('#insert_interface').form('validate');
  939. if (r) {//post到后台
  940. var param = ZLPMS.FormToObject("insert_interface");//取页面填写的值
  941. if (param.MS.length == 0) {
  942. top.ZLPMS.Msg("请务必填写变更描述", 2);
  943. } else {
  944. $.post('/ProManager/DealInte', param, function (data) {
  945. if (data == 1) {
  946. document.getElementById("btn_upload").click()
  947. obj.datagrid("reload")
  948. top.ZLPMS.Msg("保存成功");
  949. top.ZLPMS.CloseWindow(index);
  950. }
  951. else {
  952. top.ZLPMS.Msg("保存失败");
  953. top.ZLPMS.CloseWindow(index);
  954. }
  955. });
  956. }
  957. }
  958. },
  959. //项目个性化
  960. identify_PostData: function (index, type) {
  961. var url = '/ProManager/Edit_Identify';
  962. if (type == 1) {
  963. url = '/ProManager/Add_Identify';
  964. }
  965. //执行提交验证
  966. var r = $('#insert_identify').form('validate');
  967. if (r) {//post到后台
  968. var param = ZLPMS.FormToObject("insert_identify");//取页面填写的值
  969. param.XGSM = escape((UM.getEditor('XGSM').getContent()));
  970. $.post(url, param, function (data) {
  971. if (data.length == 36) {
  972. document.getElementById("btn_upload").click()
  973. top.ZLPMS.Msg("保存成功");
  974. $('#identify').datagrid('reload');
  975. top.ZLPMS.CloseWindow(index);
  976. }
  977. else {
  978. top.ZLPMS.CloseWindow(index);
  979. top.ZLPMS.Msg("保存失败");
  980. }
  981. });
  982. }
  983. }
  984. };
  985. //项目信息
  986. function databindProject() {
  987. var search = $("#dtn-search-project").val();
  988. if (projectObj.channelId != null) {
  989. var Params = {
  990. ChannelID: projectObj.channelId,
  991. Search: search
  992. }
  993. $('#project').datagrid({
  994. url: '/ProManager/BingProData',
  995. method: 'Get',
  996. singleSelect: true,
  997. toolbar: '#btn_func',
  998. fit: true,
  999. rownumbers: true,
  1000. queryParams: Params,
  1001. columns: [[
  1002. { field: '名称', title: '名称', width: 180 },
  1003. { field: '负责人', title: '负责人', width: 80 },
  1004. { field: '性质', title: '性质', width: 80, align: 'center' },
  1005. { field: '实施方式', title: '实施方式', width: 80, align: 'center' },
  1006. {
  1007. field: '状态', title: '项目状态', width: 70, align: 'center', styler: function (value, row, index) {
  1008. if (value == '计划中') {
  1009. return 'color:#EEA2AD;font-weight:bold';
  1010. }
  1011. if (value == '上线中') {
  1012. return 'color:green;font-weight:bold;';
  1013. }
  1014. if (value == '已暂停') {
  1015. return 'color:#FF4500;font-weight:bold;';
  1016. }
  1017. if (value == '已终止') {
  1018. return 'color:gray;font-weight:bold;';
  1019. }
  1020. if (value == '售后中') {
  1021. return 'color:blue;font-weight:bold;';
  1022. }
  1023. }
  1024. },
  1025. { field: '统一社会信用代码', title: '统一社会信用代码', width: 120, align: 'center' },
  1026. //{ field: '上线时间', title: '上线时间', width: 120, align: 'center' },
  1027. //{ field: '验收时间', title: '验收时间', width: 120, align: 'center' },
  1028. { field: '中心数量', title: '中心数量', width: 100 },
  1029. { field: '村站数量', title: '村站数量', width: 80 },
  1030. { field: '网络带宽', title: '网络带宽', width: 80 },
  1031. { field: '服务器分离', title: '服务器分离', width: 90, align: 'center' },
  1032. {
  1033. field: 'BHID', title: 'BH客户对照', width: 90, sortable: false, align: 'center'
  1034. ,
  1035. styler: function (value, rowData, index) {
  1036. if (rowData.BHID == null) {
  1037. return 'color:#3c8b3c;font-weight:bold;';
  1038. }
  1039. }
  1040. , formatter: function (value, row, index) {
  1041. if (row.BHID == null) {
  1042. return '未对照';
  1043. }
  1044. else {
  1045. return '已对照';
  1046. }
  1047. }
  1048. },
  1049. {
  1050. field: '关注度', title: '关注度', width: 70, align: 'center', styler: function (value, row, index) {
  1051. if (value == '0') {
  1052. return 'color:#EEA2AD;font-weight:bold';
  1053. }
  1054. if (value == '1') {
  1055. return 'color:red;font-weight:bold;';
  1056. }
  1057. if (value == '2') {
  1058. return 'color:red;font-weight:bold;';
  1059. }
  1060. if (value == '3') {
  1061. return 'color:red;font-weight:bold;';
  1062. }
  1063. if (value == '4') {
  1064. return 'color:red;font-weight:bold;';
  1065. }
  1066. if (value == '5') {
  1067. return 'color:red;font-weight:bold;';
  1068. }
  1069. },
  1070. formatter: function (value, rowData, index) {
  1071. if (rowData.关注度 == '0') {
  1072. return '未关注';
  1073. }
  1074. if (value == '1') {
  1075. return '❤';
  1076. }
  1077. if (value == '2') {
  1078. return '❤❤';
  1079. }
  1080. if (value == '3') {
  1081. return '❤❤❤';
  1082. }
  1083. if (value == '4') {
  1084. return '❤❤❤❤';
  1085. }
  1086. if (value == '5') {
  1087. return '❤❤❤❤❤';
  1088. }
  1089. }
  1090. },
  1091. {
  1092. field: '启用监控', title: '启用监控', width: 90, align: 'center',
  1093. formatter: function (value, rowData, index) {
  1094. switch (value) {
  1095. case 1: {
  1096. return '√';
  1097. }
  1098. default: {
  1099. return '';
  1100. }
  1101. }
  1102. }
  1103. },
  1104. { field: '概况', title: '概况', width: 300 }
  1105. ]],
  1106. onSelect: function (rowIndex, rowData) {
  1107. databindStation(rowData["ID"])
  1108. databindServer(rowData["ID"])
  1109. databindWorker(rowData["ID"])
  1110. databindProduct(rowData["ID"])
  1111. //远程方式
  1112. databindRemote(rowData["ID"])
  1113. // 个性化修改
  1114. databindIdentify(rowData["ID"])
  1115. // 验收仪器
  1116. databindInstrument(rowData["ID"])
  1117. // 验收模块
  1118. databindModual(rowData["ID"])
  1119. // 接口信息
  1120. databindInter(rowData["ID"])
  1121. //项目ID
  1122. projectObj.xmid = rowData["ID"]
  1123. //智能表单
  1124. databindSmart(rowData["ID"])
  1125. }
  1126. })
  1127. }
  1128. }
  1129. //机构信息
  1130. function databindStation(id) {
  1131. if (id.length < 36) {
  1132. var search = $("#dtn-search-station").val();
  1133. id = $("#project").datagrid("getSelected")["ID"]
  1134. }
  1135. var Params = {
  1136. Search: search
  1137. }
  1138. $('#Station').datagrid({
  1139. url: '/ProManager/BingStationData?id=' + id,
  1140. method: 'GET',
  1141. toolbar: '#btn_Station',
  1142. fit: true,
  1143. singleSelect: true,
  1144. collapsible: true,
  1145. queryParams: Params,
  1146. rownumbers: true,
  1147. pagination: true,
  1148. });
  1149. }
  1150. //项目服务器信息
  1151. function databindServer(id) {
  1152. $('#Server').datagrid({
  1153. url: '/ProManager/BingServerData?id=' + id,
  1154. method: 'GET',
  1155. toolbar: '#btn_Server',
  1156. singleSelect: true,
  1157. collapsible: true,
  1158. rownumbers: true,
  1159. fit: true,
  1160. pagination: true,
  1161. onClickRow: function (index,row) {
  1162. databindServerDataBaseInfo(row.ID);
  1163. }
  1164. });
  1165. }
  1166. //项目服务器数据库
  1167. function databindServerDataBaseInfo(id) {
  1168. $('#serverDataBaseInfo').datagrid({
  1169. url: '/CloudMonitor/GetDbInfoByServerId?serverId=' + id,
  1170. method: 'GET',
  1171. toolbar: '#btn_Server_DataBaseInfo',
  1172. singleSelect: true,
  1173. collapsible: true,
  1174. rownumbers: true,
  1175. fit: true,
  1176. pagination: true
  1177. });
  1178. }
  1179. //项目人员信息
  1180. function databindWorker(id) {
  1181. $('#Worker').datagrid({
  1182. url: '/ProManager/BingWorkerData?id=' + id,
  1183. method: 'GET',
  1184. singleSelect: true,
  1185. collapsible: true,
  1186. rownumbers: true,
  1187. toolbar: '#btn_Worker',
  1188. fit: true,
  1189. pagination: true
  1190. });
  1191. }
  1192. //项目产品信息
  1193. function databindProduct(id) {
  1194. $('#product').datagrid({
  1195. url: '/ProManager/BingProductData?id=' + id,
  1196. method: 'GET',
  1197. singleSelect: true,
  1198. toolbar: "#btn_Product",
  1199. collapsible: true,
  1200. rownumbers: true,
  1201. fit: true,
  1202. pagination: true,
  1203. onClickRow: function (index, row) {
  1204. Product_StatusChange_Forms.ProductServiceRecords();
  1205. },
  1206. onLoadSuccess: function () {
  1207. $(this).datagrid('selectRow', 0);
  1208. Product_StatusChange_Forms.ProductServiceRecords();
  1209. }
  1210. });
  1211. }
  1212. //添加项目弹窗
  1213. function add_project() {
  1214. var ChannelInfo = $('#ChannelInfo').datagrid("getSelected");
  1215. if (ChannelInfo == null) {
  1216. top.ZLPMS.Msg("请选择一个渠道")
  1217. }
  1218. else {
  1219. top.ZLPMS.OpenWindow({
  1220. title: '新建项目',
  1221. url: '/ProManager/ProjectInfo/' + ChannelInfo["ID"],
  1222. area: ['800px', '715px'],
  1223. yes: function (index, layero) {
  1224. Forms.Submit(index, layero);
  1225. $('#project').datagrid('reload');
  1226. $('#Station').datagrid('reload');
  1227. $('#Server').datagrid('reload');
  1228. $('#Worker').datagrid('reload');
  1229. $('#product').datagrid('reload');
  1230. $('#ProductServiceRecords').datagrid('reload');
  1231. },
  1232. });
  1233. }
  1234. };
  1235. //修改项目弹窗
  1236. function update_project() {
  1237. var ProjectlInfo = $('#project').datagrid("getSelected");
  1238. if (ProjectlInfo == null || ProjectlInfo == "") {
  1239. top.ZLPMS.Msg("请选择一行数据");
  1240. }
  1241. else {
  1242. top.ZLPMS.OpenWindow({
  1243. title: '修改项目',
  1244. url: '/ProManager/UpdateProjectInfo/' + ProjectlInfo["ID"],
  1245. area: ['800px', '715px'],
  1246. yes: function (index, layero) {
  1247. updateForms.Submit(index, layero);
  1248. $('#project').datagrid('reload');
  1249. $('#Station').datagrid('reload');
  1250. $('#Server').datagrid('reload');
  1251. $('#Worker').datagrid('reload');
  1252. $('#product').datagrid('reload');
  1253. $('#ProductServiceRecords').datagrid('reload');
  1254. },
  1255. });
  1256. }
  1257. };
  1258. //修改项目
  1259. var updateForms = {
  1260. //表单提交
  1261. Submit: function (index, layero) {
  1262. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1263. iframeWin.updateForms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1264. $('#project').datagrid('reload');
  1265. $('#Station').datagrid('reload');
  1266. $('#Server').datagrid('reload');
  1267. $('#Worker').datagrid('reload');
  1268. $('#product').datagrid('reload');
  1269. $('#ProductServiceRecords').datagrid('reload');
  1270. },
  1271. //读取数据
  1272. PostData: function (index) {
  1273. //执行提交验证
  1274. var r = $('#update_project').form('validate');
  1275. if (r) {//post到后台
  1276. var dealflow = $("#GZLMLID").combobox('getValue');
  1277. var param = ZLPMS.FormToObject('update_project');
  1278. if (param.enable) {
  1279. if (param.email == "" && param.wxin == "") {
  1280. top.ZLPMS.Msg("启用监控后必须填写项目经理邮箱或者微信");
  1281. return;
  1282. }
  1283. }
  1284. param.GZLMLID = dealflow;
  1285. var url = '/ProManager/Update_Project';
  1286. $.post(url, param, function (data) {
  1287. if (data == 1) {
  1288. document.getElementById("btn_upload").click()
  1289. top.ZLPMS.CloseWindow(index);
  1290. top.ZLPMS.Msg("修改成功");
  1291. } else if (data == -1) {
  1292. top.ZLPMS.Msg("项目名称已被使用请勿重复输入");
  1293. }
  1294. else {
  1295. top.ZLPMS.Msg("修改失败");
  1296. top.ZLPMS.CloseWindow(index);
  1297. }
  1298. });
  1299. }
  1300. return null;
  1301. }
  1302. };
  1303. //删除项目提示窗体
  1304. function delete_project() {
  1305. var ProjectInfo = $('#project').datagrid("getSelected");
  1306. if (ProjectInfo != null) {
  1307. //确认删除对话框
  1308. top.ZLPMS.Confirm('您确定要删除选中的记录吗?删除后无法正常使用关于该项目的所有资源.', 5, function () {
  1309. //执行删除
  1310. Worker_Delete_Forms.Del(ProjectInfo["ID"]);
  1311. $('#project').datagrid('reload');
  1312. $('#Station').datagrid('reload');
  1313. $('#Server').datagrid('reload');
  1314. $('#Worker').datagrid('reload');
  1315. $('#product').datagrid('reload');
  1316. $('#ProductServiceRecords').datagrid('reload');
  1317. });
  1318. $('#project').datagrid('reload');
  1319. } else {
  1320. top.ZLPMS.Msg("请选择一行数据");
  1321. }
  1322. };
  1323. //删除项目
  1324. var Worker_Delete_Forms = {
  1325. //表单提交
  1326. Del: function (id) {
  1327. $.ajax({
  1328. url: '/ProManager/Del_Project/' + id,
  1329. method: "post",
  1330. success: function (data) {
  1331. if (data != 0) {
  1332. $('#project').datagrid('reload');
  1333. top.ZLPMS.Msg("删除成功");
  1334. }
  1335. else {
  1336. top.ZLPMS.Msg("删除失败");
  1337. }
  1338. }
  1339. })
  1340. }
  1341. };
  1342. //添加机构窗口
  1343. function add_station() {
  1344. projectObj.projectId = $('#project').datagrid("getSelected");
  1345. if (projectObj.projectId == null) {
  1346. top.ZLPMS.Msg("请选择一个项目")
  1347. }
  1348. else {
  1349. top.ZLPMS.OpenWindow({
  1350. title: '新建机构',
  1351. url: '/ProManager/StationInfo/' + projectObj.projectId["ID"],
  1352. area: ['700px', '600px'],
  1353. yes: function (index, layero) {
  1354. Station_Add_Forms.Submit(index, layero);
  1355. $('#Station').datagrid('reload');
  1356. },
  1357. });
  1358. }
  1359. };
  1360. //添加机构
  1361. var Station_Add_Forms = {
  1362. //表单提交
  1363. Submit: function (index, layero) {
  1364. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1365. iframeWin.Station_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1366. $('#Station').datagrid('reload');
  1367. },
  1368. //读取数据
  1369. PostData: function (index) {
  1370. var Name = $("#MC").val();
  1371. if (Name == null || Name == "") {
  1372. top.ZLPMS.Msg("机构名称不能为空")
  1373. }
  1374. else {
  1375. //执行提交验证
  1376. var r = $('#insert_station').form('validate');
  1377. if (r) {//post到后台
  1378. var param = ZLPMS.FormToObject('insert_station');
  1379. var dealflow = $("#GZLMLID").combobox('getValue');
  1380. var url = '/ProManager/Add_Station';
  1381. param.GZLMLID = dealflow;
  1382. $.post(url, param, function (data) {
  1383. if (data == 1) {
  1384. top.ZLPMS.CloseWindow(index);
  1385. top.ZLPMS.Msg("添加成功");
  1386. } else if (data == -1) {
  1387. top.ZLPMS.Msg("机构名称已经被使用请重新输入");
  1388. }
  1389. else {
  1390. top.ZLPMS.CloseWindow(index);
  1391. top.ZLPMS.Msg("添加失败");
  1392. }
  1393. });
  1394. }
  1395. }
  1396. return null;
  1397. }
  1398. };
  1399. //机构修改窗口
  1400. function update_station() {
  1401. var ProjectlInfo = $('#project').datagrid("getSelected");
  1402. if (ProjectlInfo == null) {
  1403. top.ZLPMS.Msg("请选择一个项目")
  1404. }
  1405. else {
  1406. $.ajax({
  1407. url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
  1408. method: 'POST',
  1409. })
  1410. var StationInfo = $('#Station').datagrid("getSelected");
  1411. if (StationInfo == null) {
  1412. top.ZLPMS.Msg("请选择一行数据")
  1413. }
  1414. else {
  1415. top.ZLPMS.OpenWindow({
  1416. title: '修改机构',
  1417. url: '/ProManager/UpdatStationInfo/' + StationInfo["ID"],
  1418. area: ['700px', '600px'],
  1419. yes: function (index, layero) {
  1420. Station_Update_Forms.Submit(index, layero);
  1421. $('#Station').datagrid('reload');
  1422. },
  1423. });
  1424. }
  1425. }
  1426. };
  1427. //修改机构
  1428. var Station_Update_Forms = {
  1429. //表单提交
  1430. Submit: function (index, layero) {
  1431. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1432. iframeWin.Station_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1433. $('#Station').datagrid('reload');
  1434. },
  1435. //读取数据
  1436. PostData: function (index) {
  1437. //执行提交验证
  1438. var r = $('#update_station').form('validate');
  1439. if (r) {//post到后台
  1440. var url = '/ProManager/UpdateStation';
  1441. var param = ZLPMS.FormToObject('update_station');
  1442. var dealflow = $("#GZLMLID").combobox('getValue');
  1443. param.GZLMLID = dealflow;
  1444. $.post(url, param, function (data) {
  1445. if (data == 1) {
  1446. top.ZLPMS.CloseWindow(index);
  1447. top.ZLPMS.Msg("修改成功");
  1448. } else if (data == -1) {
  1449. top.ZLPMS.Msg("机构名称已被使用请勿重新输入");
  1450. }
  1451. else {
  1452. ZLPMS.Msg("修改失败");
  1453. }
  1454. });
  1455. }
  1456. return null;
  1457. }
  1458. };
  1459. //删除机构提示窗体
  1460. function delete_station() {
  1461. var StationInfo = $('#Station').datagrid("getSelected");
  1462. if (StationInfo != null) {
  1463. //确认删除对话框
  1464. top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
  1465. //执行删除
  1466. Station_Delete_Forms.Del(StationInfo["ID"]);
  1467. $('#Station').datagrid('reload');
  1468. });
  1469. } else {
  1470. top.ZLPMS.Msg("请选择一行数据");
  1471. }
  1472. };
  1473. //删除机构
  1474. var Station_Delete_Forms = {
  1475. //表单提交
  1476. Del: function (id) {
  1477. $.ajax({
  1478. url: '/ProManager/Del_Station/' + id,
  1479. method: "post",
  1480. success: function (data) {
  1481. if (data != 0) {
  1482. top.ZLPMS.Msg("删除成功");
  1483. $('#Station').datagrid('reload');
  1484. }
  1485. else {
  1486. top.ZLPMS.Msg("删除失败");
  1487. }
  1488. }
  1489. })
  1490. }
  1491. };
  1492. //将机构变成项目
  1493. function MigrationOrganization() {
  1494. var projectId = $('#project').datagrid("getSelected");
  1495. if (projectId == null) {
  1496. top.ZLPMS.Msg("请选择一个项目")
  1497. }
  1498. var Station = $('#Station').datagrid("getSelected");
  1499. if (Station == null) {
  1500. top.ZLPMS.Msg("请选择一个机构")
  1501. }
  1502. $.ajax({
  1503. url: '/ProManager/MigrationOrganization?ProjectID=' + projectId["ID"] + "&SiteID=" + Station["ID"] ,
  1504. method: "post",
  1505. success: function (data) {
  1506. $("#Station").datagrid("reload");
  1507. if (data.code == 200) {
  1508. top.ZLPMS.Msg(data.msg);
  1509. }
  1510. else {
  1511. top.ZLPMS.Msg("迁移失败");
  1512. }
  1513. }
  1514. })
  1515. }
  1516. //添加服务器窗口
  1517. function add_Server() {
  1518. var project = $('#project').datagrid("getSelected");
  1519. if (project == null) {
  1520. top.ZLPMS.Msg("请选择一个项目")
  1521. }
  1522. else {
  1523. top.ZLPMS.OpenWindow({
  1524. title: '新建服务器',
  1525. url: '/ProManager/ServerInfo/' + project["ID"],
  1526. area: ['670px', '490px'],
  1527. yes: function (index, layero) {
  1528. Server_Add_Forms.Submit(index, layero);
  1529. $('#Server').datagrid('reload');
  1530. },
  1531. });
  1532. }
  1533. };
  1534. //添加服务器数据库窗口
  1535. function add_Server_DataBase() {
  1536. var project = $('#Server').datagrid("getSelected");
  1537. if (project == null) {
  1538. top.ZLPMS.Msg("请选择一个服务器")
  1539. }
  1540. else {
  1541. top.ZLPMS.OpenWindowSuccess({
  1542. title: '新建数据库',
  1543. url: '/ProManager/ServerDataBaseInfo',
  1544. area: ['670px', '350px'],
  1545. success: function (layero) {
  1546. var iframeWindow = top.window.frames[layero.find('iframe')[0]['name']];
  1547. iframeWindow.LoadPage();
  1548. },
  1549. yes: function (index, layero) {
  1550. Server_DataBase_Add_Forms.Submit(index, layero, project.ID);
  1551. $('#serverDataBaseInfo').datagrid('reload');
  1552. },
  1553. });
  1554. }
  1555. };
  1556. //添加服务器
  1557. var Server_Add_Forms = {
  1558. //表单提交
  1559. Submit: function (index, layero) {
  1560. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1561. iframeWin.Server_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1562. $('#Server').datagrid('reload');
  1563. },
  1564. //读取数据
  1565. PostData: function (index) {
  1566. var XH = $("#XH").val();
  1567. //执行提交验证
  1568. var r = $('#insert_server')[0].reportValidity();
  1569. if (r) {//post到后台
  1570. var url = '/ProManager/Add_Server';
  1571. var param = ZLPMS.FormToObject('insert_server');
  1572. $.post(url, param, function (data) {
  1573. if (data == 1) {
  1574. top.ZLPMS.CloseWindow(index);
  1575. top.ZLPMS.Msg("添加成功");
  1576. } else if (data = -1) {
  1577. ZLPMS.Msg("服务器型号已经被使用请重新输入");
  1578. }
  1579. });
  1580. }
  1581. return null;
  1582. }
  1583. };
  1584. //添加服务器数据库
  1585. var Server_DataBase_Add_Forms = {
  1586. //表单提交
  1587. Submit: function (index, layero,serverID) {
  1588. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1589. iframeWin.Server_DataBase_Add_Forms.PostData(index, serverID);//调用子页面的方法,得到子页面返回的ids
  1590. },
  1591. //读取数据
  1592. PostData: function (index, serverID) {
  1593. var 名称 = $("#名称").val();
  1594. //执行提交验证
  1595. var r = $('#insert_server').form('validate');
  1596. if (名称 == null || 名称 == "") {
  1597. top.ZLPMS.Msg("数据库名称不能为空")
  1598. }
  1599. else {
  1600. if (r) {//post到后台
  1601. var url = '/CloudMonitor/InsertDbInfo';
  1602. var param = ZLPMS.FormToObject('insert_server');
  1603. param.服务器ID = serverID;
  1604. $.ajax({
  1605. url: url,
  1606. type: 'POST',
  1607. data: param,
  1608. async: false, // 设置为同步请求
  1609. success: function (data) {
  1610. if (data == 1) {
  1611. top.ZLPMS.CloseWindow(index);
  1612. top.ZLPMS.Msg("添加成功");
  1613. } else {
  1614. top.ZLPMS.Msg("添加失败");
  1615. }
  1616. },
  1617. error: function () {
  1618. top.ZLPMS.Msg("请求失败");
  1619. }
  1620. });
  1621. }
  1622. }
  1623. return null;
  1624. }
  1625. };
  1626. //服务器修改窗口
  1627. function update_server() {
  1628. var ProjectlInfo = $('#project').datagrid("getSelected");
  1629. if (ProjectlInfo == null) {
  1630. top.ZLPMS.Msg("请选择一个项目")
  1631. }
  1632. else {
  1633. $.ajax({
  1634. url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
  1635. method: 'POST'
  1636. })
  1637. var ServerInfo = $('#Server').datagrid("getSelected");
  1638. if (ServerInfo == null) {
  1639. top.ZLPMS.Msg("请选择一行数据")
  1640. }
  1641. else {
  1642. top.ZLPMS.OpenWindow({
  1643. title: '修改服务器',
  1644. url: '/ProManager/UpdateServerInfo/' + ServerInfo["ID"],
  1645. area: ['670px', '490px'],
  1646. yes: function (index, layero) {
  1647. Server_Update_Forms.Submit(index, layero);
  1648. $('#Server').datagrid('reload');
  1649. },
  1650. });
  1651. }
  1652. }
  1653. };
  1654. //服务器数据库修改窗口
  1655. function update_server_database() {
  1656. var ServerInfo = $('#Server').datagrid("getSelected");
  1657. if (ServerInfo == null) {
  1658. top.ZLPMS.Msg("请选择一个服务器")
  1659. }
  1660. else {
  1661. var DataBaseInfo = $('#serverDataBaseInfo').datagrid("getSelected");
  1662. if (DataBaseInfo == null) {
  1663. top.ZLPMS.Msg("请选择一行数据")
  1664. }
  1665. else {
  1666. top.ZLPMS.OpenWindowSuccess({
  1667. title: '修改数据库',
  1668. url: '/ProManager/ServerDataBaseInfo',
  1669. area: ['670px', '350px'],
  1670. success: function (layero) {
  1671. var iframeWindow = top.window.frames[layero.find('iframe')[0]['name']];
  1672. iframeWindow.LoadPage(DataBaseInfo);
  1673. },
  1674. yes: function (index, layero) {
  1675. Server_DataBase_Update_Forms.Submit(index, layero, DataBaseInfo);
  1676. $('#serverDataBaseInfo').datagrid('reload');
  1677. },
  1678. });
  1679. }
  1680. }
  1681. };
  1682. //修改服务器
  1683. var Server_Update_Forms = {
  1684. //表单提交
  1685. Submit: function (index, layero) {
  1686. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1687. iframeWin.Server_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1688. $('#Server').datagrid('reload');
  1689. },
  1690. //读取数据
  1691. PostData: function (index) {
  1692. //执行提交验证
  1693. var r = $('#update_server')[0].reportValidity();
  1694. if (r) {//post到后台
  1695. var url = '/ProManager/UpdateServer';
  1696. var param = ZLPMS.FormToObject('update_server');
  1697. $.post(url, param, function (data) {
  1698. if (data == 1) {
  1699. top.ZLPMS.CloseWindow(index);
  1700. top.ZLPMS.Msg("修改成功");
  1701. } else if (data == -1) {
  1702. top.ZLPMS.Msg("服务器型号已经被使用请重新输入");
  1703. }
  1704. else {
  1705. top.ZLPMS.Msg("添加失败");
  1706. }
  1707. });
  1708. }
  1709. return null;
  1710. }
  1711. };
  1712. //修改服务器数据库
  1713. var Server_DataBase_Update_Forms = {
  1714. //表单提交
  1715. Submit: function (index, layero,row) {
  1716. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1717. iframeWin.Server_DataBase_Update_Forms.PostData(index,row);//调用子页面的方法,得到子页面返回的ids
  1718. },
  1719. //读取数据
  1720. PostData: function (index,row) {
  1721. var 名称 = $("#名称").val();
  1722. //执行提交验证
  1723. var r = $('#insert_server').form('validate');
  1724. if (名称 == null || 名称 == "") {
  1725. top.ZLPMS.Msg("数据库名称不能为空")
  1726. }
  1727. else {
  1728. if (r) {//post到后台
  1729. var url = '/CloudMonitor/UpdateDbInfo';
  1730. var param = ZLPMS.FormToObject('insert_server');
  1731. row.名称 = 名称;
  1732. row.数据库类型 = param.数据库类型;
  1733. row.数据库连接串 = param.数据库连接串;
  1734. $.ajax({
  1735. url: url,
  1736. type: 'POST',
  1737. data: row,
  1738. async: false, // 设置为同步请求
  1739. success: function (data) {
  1740. if (data == 1) {
  1741. top.ZLPMS.CloseWindow(index);
  1742. top.ZLPMS.Msg("修改成功");
  1743. } else {
  1744. top.ZLPMS.Msg("修改失败");
  1745. }
  1746. },
  1747. error: function () {
  1748. top.ZLPMS.Msg("请求失败");
  1749. }
  1750. });
  1751. //$.post(url, row, function (data) {
  1752. // if (data == 1) {
  1753. // top.ZLPMS.CloseWindow(index);
  1754. // top.ZLPMS.Msg("修改成功");
  1755. // } else {
  1756. // top.ZLPMS.Msg("修改失败");
  1757. // }
  1758. //});
  1759. }
  1760. }
  1761. return null;
  1762. }
  1763. };
  1764. //删除服务器提示窗体
  1765. function delete_server() {
  1766. var ServerInfo = $('#Server').datagrid("getSelected");
  1767. if (ServerInfo != null) {
  1768. //确认删除对话框
  1769. top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
  1770. //执行删除
  1771. Server_Delete_Forms.Del(ServerInfo["ID"]);
  1772. $('#Server').datagrid('reload');
  1773. });
  1774. } else {
  1775. top.ZLPMS.Msg("请选择一行数据");
  1776. }
  1777. };
  1778. //删除服务器数据库提示窗体
  1779. function delete_server_DataBase() {
  1780. let table = $('#serverDataBaseInfo');
  1781. var ServerInfo = table.datagrid("getSelected");
  1782. if (ServerInfo != null) {
  1783. //确认删除对话框
  1784. top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
  1785. //执行删除
  1786. Server_DataBase_Delete_Forms.Del(ServerInfo["ID"]);
  1787. table.datagrid('reload');
  1788. });
  1789. } else {
  1790. top.ZLPMS.Msg("请选择一行数据");
  1791. }
  1792. };
  1793. //删除服务器
  1794. var Server_Delete_Forms = {
  1795. //表单提交
  1796. Del: function (id) {
  1797. $.ajax({
  1798. url: '/ProManager/Del_Server/' + id,
  1799. method: "post",
  1800. success: function (data) {
  1801. if (data != 0) {
  1802. top.ZLPMS.Msg("删除成功");
  1803. $('#Server').datagrid('reload');
  1804. }
  1805. else {
  1806. top.ZLPMS.Msg("删除失败");
  1807. }
  1808. }
  1809. })
  1810. }
  1811. };
  1812. //删除服务器数据库
  1813. var Server_DataBase_Delete_Forms = {
  1814. //表单提交
  1815. Del: function (id) {
  1816. $.ajax({
  1817. url: '/CloudMonitor/DeleteDbInfoById/' + id,
  1818. method: "post",
  1819. success: function (data) {
  1820. if (data != 0) {
  1821. top.ZLPMS.Msg("删除成功");
  1822. }
  1823. else {
  1824. top.ZLPMS.Msg("删除失败");
  1825. }
  1826. }
  1827. })
  1828. }
  1829. };
  1830. //添加项目人员窗口
  1831. function add_Worker() {
  1832. projectObj.projectId = $('#project').datagrid("getSelected");
  1833. if (projectObj.projectId == null) {
  1834. top.ZLPMS.Msg("请选择一个项目")
  1835. }
  1836. else {
  1837. top.ZLPMS.OpenWindow({
  1838. title: '新建项目人员',
  1839. url: '/ProManager/WorkerInfo/' + projectObj.projectId["ID"],
  1840. area: ['670px', '420px'],
  1841. yes: function (index, layero) {
  1842. Worker_Add_Forms.Submit(index, layero);
  1843. $('#Worker').datagrid('reload');
  1844. },
  1845. });
  1846. }
  1847. }
  1848. //添加项目人员
  1849. var Worker_Add_Forms = {
  1850. //表单提交
  1851. Submit: function (index, layero) {
  1852. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1853. iframeWin.Worker_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1854. $('#Worker').datagrid('reload');
  1855. },
  1856. //读取数据
  1857. PostData: function (index) {
  1858. //执行提交验证
  1859. var r = $('#insert_worker').form('validate');
  1860. if (r) {//post到后台
  1861. var url = '/ProManager/Add_Worker';
  1862. var param = ZLPMS.FormToObject('insert_worker');
  1863. $.post(url, param, function (data) {
  1864. if (data != 0) {
  1865. top.ZLPMS.CloseWindow(index);
  1866. $('#product').datagrid('reload');
  1867. top.ZLPMS.Msg("成功添加" + data + "人到该项目中服务。", 1);
  1868. }
  1869. else {
  1870. top.ZLPMS.CloseWindow(index);
  1871. top.ZLPMS.Msg("添加失败,请重新添加", 2);
  1872. }
  1873. });
  1874. }
  1875. return null;
  1876. }
  1877. };
  1878. //撤离项目人员窗口
  1879. function update_Worker() {
  1880. var WorkerInfo = $('#Worker').datagrid("getSelected");
  1881. if (WorkerInfo != null) {
  1882. //确认撤离对话框
  1883. top.ZLPMS.Confirm('您确定要从该项目中撤离该人员吗?', 3, function () {
  1884. //执行撤离
  1885. $.ajax({
  1886. url: '/ProManager/UpdateWorker/' + WorkerInfo["ID"],
  1887. method: "post",
  1888. success: function (data) {
  1889. if (data != 0) {
  1890. top.ZLPMS.Msg("撤离成功");
  1891. $('#Worker').datagrid('reload');
  1892. }
  1893. else {
  1894. top.ZLPMS.Msg("撤离失败");
  1895. }
  1896. }
  1897. })
  1898. $('#Worker').datagrid('reload');
  1899. });
  1900. } else {
  1901. top.ZLPMS.Msg("请选择一行数据");
  1902. }
  1903. }
  1904. //添加项目产品窗口
  1905. function add_Product() {
  1906. var project = $('#project').datagrid("getSelected");
  1907. if (project == null) {
  1908. top.ZLPMS.Msg("请选择一个项目")
  1909. }
  1910. else {
  1911. top.ZLPMS.OpenWindow({
  1912. title: '添加项目产品',
  1913. url: '/ProManager/ProductInfo/' + project["ID"],
  1914. area: ['670px', '400px'],
  1915. yes: function (index, layero) {
  1916. Product_Add_Forms.Submit(index, layero);
  1917. $('#product').datagrid('reload');
  1918. },
  1919. });
  1920. }
  1921. }
  1922. //添加项目产品
  1923. var Product_Add_Forms = {
  1924. //表单提交
  1925. Submit: function (index, layero) {
  1926. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1927. iframeWin.Product_Add_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1928. $('#product').datagrid('reload');
  1929. },
  1930. //读取数据
  1931. PostData: function (index) {
  1932. //执行提交验证
  1933. var r = $('#insert_product').form('validate');
  1934. if (r) {//post到后台
  1935. var url = '/ProManager/Add_Product';
  1936. var param = ZLPMS.FormToObject('insert_product');
  1937. $.post(url, param, function (data) {
  1938. if (data == 1) {
  1939. top.ZLPMS.CloseWindow(index);
  1940. top.ZLPMS.Msg("添加成功");
  1941. } else {
  1942. top.ZLPMS.CloseWindow(index);
  1943. top.ZLPMS.Msg("该产品已试用于本产品,请勿重复添加!");
  1944. }
  1945. });
  1946. }
  1947. return null;
  1948. }
  1949. };
  1950. //修改项目产品窗口
  1951. function update_Product() {
  1952. var ProductInfo = $('#product').datagrid("getSelected");
  1953. var ProjectlInfo = $('#project').datagrid("getSelected");
  1954. if (ProjectlInfo == null) {
  1955. top.ZLPMS.Msg("请选择项目!");
  1956. }
  1957. if (ProductInfo != null) {
  1958. $.ajax({
  1959. url: '/ProManager/PostChannelId/' + ProjectlInfo["ID"],
  1960. method: 'POST'
  1961. })
  1962. top.ZLPMS.OpenWindow({
  1963. title: '修改项目产品',
  1964. url: '/ProManager/UpdateProductInfo?id=' + ProductInfo["ID"] + '&xmid=' + ProjectlInfo["ID"],
  1965. area: ['670px', '400px'],
  1966. yes: function (index, layero) {
  1967. Product_Update_Forms.Submit(index, layero);
  1968. $('#product').datagrid('reload');
  1969. }
  1970. });
  1971. } else {
  1972. top.ZLPMS.Msg("请选择一行数据");
  1973. }
  1974. };
  1975. //修改项目产品
  1976. var Product_Update_Forms = {
  1977. //表单提交
  1978. Submit: function (index, layero) {
  1979. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  1980. iframeWin.Product_Update_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  1981. $('#product').datagrid('reload');
  1982. },
  1983. //读取数据
  1984. PostData: function (index) {
  1985. //执行提交验证
  1986. var r = $('#update_product').form('validate');
  1987. if (r) {//post到后台
  1988. var url = '/ProManager/UpdateProduct';
  1989. var param = ZLPMS.FormToObject('update_product');
  1990. $.post(url, param, function (data) {
  1991. if (data == 1) {
  1992. top.ZLPMS.CloseWindow(index);
  1993. top.ZLPMS.Msg("修改成功");
  1994. } else if (data == 0) {
  1995. top.ZLPMS.CloseWindow(index);
  1996. top.ZLPMS.Msg("该产品已经在本项目中使用请勿重复添加");
  1997. }
  1998. else {
  1999. top.ZLPMS.CloseWindow(index);
  2000. top.ZLPMS.Msg("修改失败");
  2001. }
  2002. });
  2003. }
  2004. return null;
  2005. }
  2006. };
  2007. //产品服务合同时间维护1新增2修改
  2008. function StatusChange(type) {
  2009. var ProductInfo = $('#product').datagrid("getSelected");
  2010. var ProjectlInfo = $('#project').datagrid("getSelected");
  2011. if (ProjectlInfo == null) {
  2012. top.ZLPMS.Msg("请选择项目!");
  2013. }
  2014. if (ProductInfo != null) {
  2015. var title = "服务登记";
  2016. top.ZLPMS.OpenWindow({
  2017. title: title,
  2018. url: '/ProManager/UpdateProductStatusChange?id=' + ProductInfo["ID"] + '&xmid=' + ProjectlInfo["ID"] + '&qdid=' + projectObj.channelId + '&type=1',
  2019. area: ['670px', '500px'],
  2020. yes: function (index, layero) {
  2021. Product_StatusChange_Forms.Submit(index, layero);
  2022. }
  2023. });
  2024. } else {
  2025. top.ZLPMS.Msg("请选择一行数据");
  2026. }
  2027. };
  2028. //修改产品服务合同记录2修改
  2029. function UpdateProductServiceRecords() {
  2030. var ServerInfo = $('#ProductServiceRecords').datagrid("getSelected");
  2031. if (ServerInfo == null) {
  2032. top.ZLPMS.Msg("请选择一条记录")
  2033. }
  2034. else {
  2035. top.ZLPMS.OpenWindowSuccess({
  2036. title: '修改服务登记',
  2037. url: '/ProManager/UpdateProductStatusChange?id=' + ServerInfo["ID"] + '&xmid=0&qdid=0&type=2',
  2038. area: ['670px', '500px'],
  2039. yes: function (index, layero) {
  2040. Product_StatusChange_Forms.UpdateSubmit(index, layero);
  2041. $('#product').datagrid('reload');
  2042. },
  2043. });
  2044. }
  2045. };
  2046. //产品服务合同时间维护
  2047. var Product_StatusChange_Forms = {
  2048. //表单提交
  2049. Submit: function (index, layero) {
  2050. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2051. iframeWin.Product_StatusChange_Forms.PostData(index);//调用子页面的方法,得到子页面返回的ids
  2052. $('#product').datagrid('reload');
  2053. },
  2054. //读取数据
  2055. PostData: function (index) {
  2056. //执行提交验证
  2057. var r = $('#productStatusChange').form('validate');
  2058. if (r) {//post到后台
  2059. var url = '/ProManager/AdjustServiceTime';
  2060. var param = ZLPMS.FormToObject('productStatusChange');
  2061. if ($('#ALL').is(":checked")) {
  2062. param.ALL = 1;
  2063. }
  2064. else {
  2065. param.ALL = 0;
  2066. }
  2067. var state = ZLPMS.compareTime(param.ServiceStartTime, param.ServiceEndTime, "开始时间不能大于结束时间");
  2068. if (!state) {
  2069. return;
  2070. }
  2071. $.post(url, param, function (data) {
  2072. if (data == 1) {
  2073. top.ZLPMS.CloseWindow(index);
  2074. top.ZLPMS.Msg("操作成功");
  2075. } else if (data == 0) {
  2076. top.ZLPMS.CloseWindow(index);
  2077. top.ZLPMS.Msg("系统异常");
  2078. }
  2079. else {
  2080. top.ZLPMS.CloseWindow(index);
  2081. top.ZLPMS.Msg("操作失败");
  2082. }
  2083. });
  2084. }
  2085. return null;
  2086. },
  2087. //产品合同签订记录, string XMID, string CPID
  2088. ProductServiceRecords: function() {
  2089. var ProductInfo = $('#product').datagrid("getSelected");
  2090. var ProjectlInfo = $('#project').datagrid("getSelected");
  2091. if (ProjectlInfo == null) {
  2092. $('#ProductServiceRecords').datagrid('loadData', { total: 0, rows: [] });
  2093. return
  2094. }
  2095. if (ProductInfo == null) {
  2096. $('#ProductServiceRecords').datagrid('loadData', { total: 0, rows: [] });
  2097. return
  2098. }
  2099. $('#ProductServiceRecords').datagrid({
  2100. url: '/ProManager/Get_ProductAdjustService?QDID=' + projectObj.channelId + '&XMID=' + ProjectlInfo["ID"] + '&CPID=' + ProductInfo["ID"],
  2101. method: 'GET',
  2102. /* toolbar: '#btn_Server_DataBaseInfo',*/
  2103. singleSelect: true,
  2104. collapsible: true,
  2105. rownumbers: true,
  2106. fit: true,
  2107. pagination: true
  2108. });
  2109. },
  2110. //删除产品服务合同记录
  2111. Del: function () {
  2112. var GetRow = $('#ProductServiceRecords').datagrid("getSelected");
  2113. if (GetRow == null) {
  2114. top.ZLPMS.Msg("请选择一行数据");
  2115. }
  2116. $.ajax({
  2117. url: '/ProManager/DeleteAdjustServiceTime/' + GetRow["ID"],
  2118. method: "post",
  2119. success: function (data) {
  2120. if (data != 0) {
  2121. top.ZLPMS.Msg("删除成功");
  2122. $('#product').datagrid('reload');
  2123. }
  2124. else {
  2125. top.ZLPMS.Msg("删除失败");
  2126. }
  2127. }
  2128. })
  2129. },
  2130. //刷新表格
  2131. refresh: function () {
  2132. $('#ProductServiceRecords').datagrid('reload');
  2133. },
  2134. //修改数据提交
  2135. UpdateSubmit: function (index, layero) {
  2136. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2137. iframeWin.Product_StatusChange_Forms.UpdatePostData(index);//调用子页面的方法,得到子页面返回的ids
  2138. $('#product').datagrid('reload');
  2139. },
  2140. //修改数据提交
  2141. UpdatePostData: function (index) {
  2142. //执行提交验证
  2143. var r = $('#productStatusChange').form('validate');
  2144. if (r) {//post到后台
  2145. var url = '/ProManager/UpdateAdjustServiceTime';
  2146. var param = ZLPMS.FormToObject('productStatusChange');
  2147. param.ALL = 0;
  2148. var state = ZLPMS.compareTime(param.ServiceStartTime, param.ServiceEndTime, "开始时间不能大于结束时间");
  2149. if (!state) {
  2150. return;
  2151. }
  2152. $.post(url, param, function (data) {
  2153. if (data == 1) {
  2154. top.ZLPMS.CloseWindow(index);
  2155. top.ZLPMS.Msg("操作成功");
  2156. } else if (data == 0) {
  2157. top.ZLPMS.CloseWindow(index);
  2158. top.ZLPMS.Msg("系统异常");
  2159. }
  2160. else {
  2161. top.ZLPMS.CloseWindow(index);
  2162. top.ZLPMS.Msg("操作失败");
  2163. }
  2164. });
  2165. }
  2166. return null;
  2167. },
  2168. };
  2169. //删除项目产品提示窗体
  2170. function delete_product() {
  2171. var ProductInfo = $('#product').datagrid("getSelected");
  2172. if (ProductInfo != null) {
  2173. //确认删除对话框
  2174. top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
  2175. //执行删除
  2176. Product_Delete_Forms.Del(ProductInfo["ID"]);
  2177. $('#product').datagrid('reload');
  2178. });
  2179. } else {
  2180. top.ZLPMS.Msg("请选择一行数据");
  2181. }
  2182. };
  2183. //删除项目产品
  2184. var Product_Delete_Forms = {
  2185. //表单提交
  2186. Del: function (id) {
  2187. $.ajax({
  2188. url: '/ProManager/Del_Product/' + id,
  2189. method: "post",
  2190. success: function (data) {
  2191. if (data != 0) {
  2192. top.ZLPMS.Msg("删除成功");
  2193. $('#product').datagrid('reload');
  2194. }
  2195. else {
  2196. top.ZLPMS.Msg("删除失败");
  2197. }
  2198. }
  2199. })
  2200. }
  2201. };
  2202. //个性化
  2203. function databindIdentify(id) {
  2204. if (id != null) {
  2205. $('#identify').datagrid({
  2206. url: '/ProManager/BingIdentify',
  2207. method: 'post',
  2208. singleSelect: true,
  2209. toolbar: '#btn_func6',
  2210. fit: true,
  2211. rownumbers: true,
  2212. queryParams: { id: id },
  2213. columns: [[
  2214. { field: '名称', title: '标题', width: 250 },
  2215. { field: '修改时间', title: '修改时间', width: 100, align: 'center' },
  2216. { field: '修改人', title: '修改人', width: 100, align: 'center' },
  2217. {
  2218. field: '状态', title: '状态', width: 100, align: 'center', styler: function (value, row, index) {
  2219. if (value == '0') {
  2220. value = "放弃";
  2221. return 'color:#EEA2AD;font-weight:bold';
  2222. }
  2223. if (value == '1') {
  2224. value = "确认";
  2225. return 'color:green;font-weight:bold;';
  2226. }
  2227. if (value == '2') {
  2228. value = "删除";
  2229. return 'color:#FF4500;font-weight:bold;';
  2230. }
  2231. },
  2232. formatter: function (row) {
  2233. if (row == '0') {
  2234. return row = "放弃";
  2235. }
  2236. if (row == '1') {
  2237. return row = "确认";
  2238. }
  2239. if (row == '2') {
  2240. return row = "删除";
  2241. }
  2242. }
  2243. },
  2244. { field: '产品名称', title: '产品', width: 120, align: 'center' },
  2245. { field: '版本号', title: '版本', width: 150, align: 'center' },
  2246. ]],
  2247. onSelect: function (rowIndex, rowData) {
  2248. projectObj.identify = rowData
  2249. var detail = rowData.修改说明 == null ? "暂无" : rowData.修改说明
  2250. $("#detail").html("<p>" + detail + "</p>")
  2251. }
  2252. })
  2253. }
  2254. }
  2255. //新增个性化
  2256. function add_identify() {
  2257. var identify = $('#project').datagrid("getSelected");
  2258. if (identify == null) {
  2259. top.ZLPMS.Msg("请选择一个项目")
  2260. }
  2261. else {
  2262. top.ZLPMS.OpenWindow({
  2263. title: '新建项目个性化',
  2264. url: '/ProManager/Identify_Window?id=' + identify["ID"] + "&type=1",
  2265. area: ['900px', '900px'],
  2266. yes: function (index, layero) {
  2267. //表单提交
  2268. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2269. iframeWin.Forms.identify_PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
  2270. $('#identify').datagrid('reload');
  2271. }
  2272. });
  2273. }
  2274. };
  2275. //修改个性化
  2276. function edit_identify() {
  2277. var identify = $('#identify').datagrid("getSelected");
  2278. if (identify == null) {
  2279. top.ZLPMS.Msg("请选择一条记录")
  2280. }
  2281. else {
  2282. top.ZLPMS.OpenWindow({
  2283. title: '编辑项目个性化',
  2284. url: '/ProManager/Identify_Window?id=' + identify["ID"] + '&type=2',
  2285. area: ['900px', '900px'],
  2286. yes: function (index, layero) {
  2287. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2288. iframeWin.Forms.identify_PostData(index, 2);//调用子页面的方法,得到子页面返回的ids
  2289. $('#identify').datagrid('reload');
  2290. }
  2291. });
  2292. }
  2293. };
  2294. //删除个性化
  2295. function del_identify() {
  2296. var identify = projectObj.identify
  2297. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  2298. //执行删除
  2299. $.post('/ProManager/Del_Identify?id=' + identify.ID + "&type=1", function (data) {
  2300. if (data) {
  2301. $('#identify').datagrid('reload');
  2302. top.ZLPMS.Msg("删除成功");
  2303. }
  2304. else {
  2305. top.ZLPMS.Msg("删除失败");
  2306. }
  2307. })
  2308. });
  2309. }
  2310. //放弃个性化
  2311. function giveup_identify() {
  2312. var identify = projectObj.identify
  2313. if (identify == null) {
  2314. top.ZLPMS.Msg("请选择一条记录")
  2315. }
  2316. else {
  2317. top.ZLPMS.Confirm('您确定要修改选中的记录状态吗?', 3, function () {
  2318. //执行
  2319. $.ajax({
  2320. url: '/ProManager/Del_Identify?id=' + identify.ID + "&type=2",
  2321. method: "post",
  2322. success: function (data) {
  2323. if (data != 0) {
  2324. top.ZLPMS.Msg("该记录已经成功放弃使用");
  2325. $('#identify').datagrid('reload');
  2326. }
  2327. else {
  2328. top.ZLPMS.Msg("状态修改失败");
  2329. }
  2330. }
  2331. })
  2332. $('#product').datagrid('reload');
  2333. });
  2334. }
  2335. }
  2336. //远程方式
  2337. function databindRemote(id) {
  2338. if (id != null) {
  2339. $('#remote').datagrid({
  2340. url: '/ProManager/BingRemote',
  2341. method: 'post',
  2342. singleSelect: true,
  2343. toolbar: '#btn_func2',
  2344. fit: true,
  2345. rownumbers: true,
  2346. queryParams: { id: id },
  2347. columns: [[
  2348. { field: '名称', title: '名称', width: 180, align: 'center' },
  2349. { field: '联系人', title: '联系人', width: 100, align: 'center' },
  2350. { field: '联系人电话', title: '联系电话', width: 120, align: 'center' },
  2351. { field: '账号', title: '账号', width: 120, align: 'center' },
  2352. { field: '密码', title: '密码', width: 120, align: 'center' },
  2353. { field: '备注', title: '备注', width: 120, align: 'center' },
  2354. ]],
  2355. onSelect: function (rowIndex, rowData) {
  2356. projectObj.remote = rowData
  2357. }
  2358. })
  2359. }
  2360. }
  2361. // 删除远程
  2362. function del_remote() {
  2363. var id = projectObj.remote.ID
  2364. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  2365. //执行删除
  2366. $.post("/ProManager/Del_Remote?id=" + id, function (data) {
  2367. if (data) {
  2368. $('#remote').datagrid('reload');
  2369. top.ZLPMS.Msg("删除成功");
  2370. }
  2371. else {
  2372. top.ZLPMS.Msg("删除失败");
  2373. }
  2374. })
  2375. });
  2376. }
  2377. //新增远程
  2378. function add_remote() {
  2379. var projectId = $('#project').datagrid("getSelected");
  2380. if (projectId == null) {
  2381. top.ZLPMS.Msg("请选择一个项目")
  2382. }
  2383. else {
  2384. top.ZLPMS.OpenWindow({
  2385. title: '新建远程方式',
  2386. url: '/ProManager/Remote_Window?id=' + projectId["ID"] + "&type=1",
  2387. area: ['700px', '420px'],
  2388. yes: function (index, layero) {
  2389. //表单提交
  2390. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2391. iframeWin.Remote_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
  2392. $('#remote').datagrid('reload');
  2393. }
  2394. });
  2395. }
  2396. };
  2397. //修改远程
  2398. function edit_remote() {
  2399. var remote = escape(JSON.stringify(projectObj.remote))
  2400. if (remote == null) {
  2401. top.ZLPMS.Msg("请选择一条记录")
  2402. }
  2403. else {
  2404. top.ZLPMS.OpenWindow({
  2405. title: '编辑远程方式',
  2406. url: '/ProManager/Remote_Window?id=' + remote + '&type=2',
  2407. area: ['700px', '420px'],
  2408. yes: function (index, layero) {
  2409. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2410. iframeWin.Remote_Forms.PostData(index, 2);//调用子页面的方法,得到子页面返回的ids
  2411. $('#remote').datagrid('reload');
  2412. }
  2413. });
  2414. }
  2415. };
  2416. //远程方式请求
  2417. var Remote_Forms = {
  2418. //读取数据
  2419. PostData: function (index, type) {
  2420. var url = '/ProManager/Edit_Remote';
  2421. if (type == 1) {
  2422. url = '/ProManager/Add_Remote';
  2423. }
  2424. //执行提交验证
  2425. var r = $('#insert_remote').form('validate');
  2426. if (r) {//post到后台
  2427. var param = ZLPMS.FormToObject("insert_remote");//取页面填写的值
  2428. $.post(url, param, function (data) {
  2429. if (data == 1) {
  2430. top.ZLPMS.CloseWindow(index);
  2431. top.ZLPMS.Msg("保存成功");
  2432. }
  2433. else {
  2434. top.ZLPMS.CloseWindow(index);
  2435. top.ZLPMS.Msg("保存失败");
  2436. }
  2437. });
  2438. }
  2439. }
  2440. };
  2441. //验收仪器
  2442. function databindInstrument(id) {
  2443. if (id != null) {
  2444. $('#instrument').datagrid({
  2445. url: '/ProManager/Binginstrument',
  2446. method: 'post',
  2447. singleSelect: true,
  2448. toolbar: '#btn_func3',
  2449. fit: true,
  2450. rownumbers: true,
  2451. queryParams: { id: id },
  2452. columns: [[
  2453. { field: '仪器名称', title: '仪器名称', width: 180, align: 'center' },
  2454. { field: '仪器型号', title: '仪器型号', width: 100, align: 'center' },
  2455. { field: '科室负责人', title: '科室负责人', width: 120, align: 'center' },
  2456. { field: '科室联系电话', title: '科室联系电话', width: 120, align: 'center' },
  2457. { field: '厂家负责人', title: '厂家负责人', width: 120, align: 'center' },
  2458. { field: '厂家联系电话', title: '厂家联系电话', width: 120, align: 'center' },
  2459. { field: '仪器类型', title: '仪器类型', width: 120, align: 'center' },
  2460. { field: '仪器厂家', title: '仪器厂家', width: 120, align: 'center' },
  2461. { field: '通讯类型', title: '通讯类型', width: 120, align: 'center' },
  2462. { field: '通讯参数', title: '通讯参数', width: 120, align: 'center' },
  2463. { field: '接口DLL名称', title: '接口DLL名称', width: 120, align: 'center' },
  2464. { field: '实施人员', title: '实施人员', width: 120, align: 'center' },
  2465. {
  2466. field: '启用时间', title: '启用时间', width: 120, align: 'center', formatter: function (row) {
  2467. /*return row.substr(0, 10)*/
  2468. }
  2469. },
  2470. {
  2471. field: '验收时间', title: '验收时间', width: 120, align: 'center', formatter: function (row) {
  2472. /* return row.substr(0, 10)*/
  2473. }
  2474. },
  2475. { field: '备注', title: '备注', width: 120, align: 'center' },
  2476. ]],
  2477. })
  2478. }
  2479. }
  2480. // 删除验收仪器
  2481. function del_instrument() {
  2482. var id = $("#instrument").datagrid("getSelected")["ID"];
  2483. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  2484. //执行删除
  2485. $.post("/ProManager/Del_instrument?id=" + id, function (data) {
  2486. if (data) {
  2487. $('#instrument').datagrid('reload');
  2488. top.ZLPMS.Msg("删除成功");
  2489. }
  2490. else {
  2491. top.ZLPMS.Msg("删除失败");
  2492. }
  2493. })
  2494. });
  2495. }
  2496. //新增验收仪器
  2497. function add_instrument() {
  2498. var projectId = $('#project').datagrid("getSelected");
  2499. if (projectId == null) {
  2500. top.ZLPMS.Msg("请选择一个项目")
  2501. }
  2502. else {
  2503. top.ZLPMS.OpenWindow({
  2504. title: '新建验收仪器',
  2505. url: '/ProManager/Instrument_Window?id=' + projectId["ID"],
  2506. area: ['650px', '520px'],
  2507. yes: function (index, layero) {
  2508. //表单提交
  2509. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2510. iframeWin.Instrument_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
  2511. $('#instrument').datagrid('reload');
  2512. }
  2513. });
  2514. }
  2515. };
  2516. //验收仪器请求
  2517. var Instrument_Forms = {
  2518. //读取数据
  2519. PostData: function (index, type) {
  2520. var url = '/ProManager/Add_Instrument';
  2521. //执行提交验证
  2522. var r = $('#insert_instrument').form('validate');
  2523. if (r) {//post到后台
  2524. var param = ZLPMS.FormToObject("insert_instrument");//取页面填写的值
  2525. $.post(url, param, function (data) {
  2526. if (data == 1) {
  2527. $('#instrument').datagrid('reload');
  2528. top.ZLPMS.CloseWindow(index);
  2529. top.ZLPMS.Msg("保存成功");
  2530. }
  2531. else {
  2532. top.ZLPMS.CloseWindow(index);
  2533. top.ZLPMS.Msg("保存失败");
  2534. }
  2535. });
  2536. }
  2537. }
  2538. };
  2539. //验收模块
  2540. function databindModual(id) {
  2541. if (id != null) {
  2542. $('#modual').datagrid({
  2543. url: '/ProManager/Bingmodual',
  2544. method: 'post',
  2545. singleSelect: true,
  2546. toolbar: '#btn_func4',
  2547. fit: true,
  2548. rownumbers: true,
  2549. queryParams: { id: id },
  2550. columns: [[
  2551. { field: '模块名称', title: '模块名称', width: 180, align: 'center' },
  2552. { field: '验收人', title: '验收人', width: 100, align: 'center' },
  2553. {
  2554. field: '验收时间', title: '验收时间', width: 120, align: 'center', formatter: function (row) {
  2555. return row.substr(0, 10)
  2556. }
  2557. },
  2558. ]],
  2559. })
  2560. }
  2561. }
  2562. // 删除验收模块
  2563. function del_modual() {
  2564. var id = $("#modual").datagrid("getSelected")["ID"];
  2565. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  2566. //执行删除
  2567. $.post("/ProManager/Del_modual?id=" + id, function (data) {
  2568. if (data) {
  2569. $('#modual').datagrid('reload');
  2570. top.ZLPMS.Msg("删除成功");
  2571. }
  2572. else {
  2573. top.ZLPMS.Msg("删除失败");
  2574. }
  2575. })
  2576. });
  2577. }
  2578. //新增验收模块
  2579. function add_modual() {
  2580. var projectId = $('#project').datagrid("getSelected");
  2581. if (projectId == null) {
  2582. top.ZLPMS.Msg("请选择一个项目")
  2583. }
  2584. else {
  2585. top.ZLPMS.OpenWindow({
  2586. title: '新建验收模块',
  2587. url: '/ProManager/Modual_Window?id=' + projectId["ID"],
  2588. area: ['650px', '260px'],
  2589. yes: function (index, layero) {
  2590. //表单提交
  2591. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2592. iframeWin.Modula_Forms.PostData(index, 1);//调用子页面的方法,得到子页面返回的ids
  2593. $('#modual').datagrid('reload');
  2594. }
  2595. });
  2596. }
  2597. };
  2598. //验收模块请求
  2599. var Modula_Forms = {
  2600. //读取数据
  2601. PostData: function (index, type) {
  2602. var url = '/ProManager/Add_modual';
  2603. //执行提交验证
  2604. var r = $('#insert_modual').form('validate');
  2605. if (r) {//post到后台
  2606. var param = ZLPMS.FormToObject("insert_modual");//取页面填写的值
  2607. $.post(url, param, function (data) {
  2608. if (data == 1) {
  2609. $('#modual').datagrid('reload');
  2610. top.ZLPMS.CloseWindow(index);
  2611. top.ZLPMS.Msg("保存成功");
  2612. }
  2613. else {
  2614. top.ZLPMS.CloseWindow(index);
  2615. top.ZLPMS.Msg("保存失败");
  2616. }
  2617. });
  2618. }
  2619. }
  2620. };
  2621. //接口信息
  2622. function databindInter(id) {
  2623. if (id != null) {
  2624. $('#interface').datagrid({
  2625. url: '/ProManager/BingInterface',
  2626. method: 'post',
  2627. singleSelect: true,
  2628. toolbar: '#btn_func5',
  2629. fit: true,
  2630. rownumbers: true,
  2631. fitColumns: true,
  2632. queryParams: {
  2633. xmid: id
  2634. },
  2635. columns: [[
  2636. { field: '名称', title: '接口名称', align: 'left' },
  2637. {
  2638. field: '类型', title: '类型', align: 'center', formatter: function (row) {
  2639. switch (row) {
  2640. case 1: return "医保接口"; break;
  2641. case 2: return "农合接口"; break;
  2642. case 3: return "LIS接口"; break;
  2643. case 4: return "三方接口"; break;
  2644. default: return "其它接口"; break;
  2645. }
  2646. }
  2647. },
  2648. { field: '项目名称', title: '项目名称' },
  2649. {
  2650. field: '状态', title: '状态', align: 'center', formatter: function (row) {
  2651. switch (row) {
  2652. case 1: return "未编写"; break;
  2653. case 2: return "编写中"; break;
  2654. case 3: return "已完成"; break;
  2655. case 4: return "测试完成"; break;
  2656. case 5: return "已验收"; break;
  2657. case 6: return "终止"; break;
  2658. }
  2659. }
  2660. },
  2661. {
  2662. field: '申请时间', title: '申请时间', align: 'center'
  2663. },
  2664. { field: '完成时间', title: '完成时间', align: 'center' },
  2665. { field: '验收时间', title: '验收时间', align: 'center' },
  2666. { field: '创建人', title: '创建人', align: 'center' },
  2667. { field: '责任人', title: '维护人', align: 'center' },
  2668. { field: '接口对方名称', title: '项目对接人', align: 'center' },
  2669. ]],
  2670. onSelect: function (index, row) {
  2671. $.post("/ProManager/GetInteProcess", { id: row.ID }, function (data) {
  2672. var html = ""
  2673. for (var i = 0; i < data.length; i++) {
  2674. html += "<li class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'>&#xe617;</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>"
  2675. }
  2676. $("#timeline").html(html)
  2677. })
  2678. id = row.ID
  2679. },
  2680. onLoadSuccess: function (dd) {
  2681. $("#timeline").html("")
  2682. if (dd.rows.length > 0) {
  2683. $.post("/ProManager/GetInteProcess", { id: dd.rows[0].ID }, function (data) {
  2684. var html = ""
  2685. for (var i = 0; i < data.length; i++) {
  2686. html += "<li class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'>&#xe617;</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>"
  2687. }
  2688. $("#timeline").html(html)
  2689. })
  2690. }
  2691. }
  2692. })
  2693. }
  2694. }
  2695. // 删除接口信息
  2696. function del_interface() {
  2697. var id = $("#interface").datagrid("getSelected")["ID"];
  2698. top.ZLPMS.Confirm('您确定要删除选中的记录吗', 5, function () {
  2699. //执行删除
  2700. $.post("/ProManager/Del_Interface?id=" + id, function (data) {
  2701. if (data) {
  2702. $('#interface').datagrid('reload');
  2703. top.ZLPMS.Msg("删除成功");
  2704. }
  2705. else {
  2706. top.ZLPMS.Msg("删除失败");
  2707. }
  2708. })
  2709. });
  2710. }
  2711. //新增接口信息
  2712. function add_interface() {
  2713. var projectId = $('#project').datagrid("getSelected");
  2714. if (projectId == null) {
  2715. top.ZLPMS.Msg("请选择一个项目")
  2716. }
  2717. else {
  2718. top.ZLPMS.OpenWindow({
  2719. title: '新建接口信息',
  2720. url: '/ProManager/Interface_Window?id=' + projectId["ID"] + '&type=1' + '&state=' + projectId.STATE,
  2721. area: ['750px', '700px'],
  2722. yes: function (index, layero) {
  2723. //表单提交
  2724. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2725. iframeWin.Forms.Interface_PostData(index, 1, 2, $('#interface'));//调用子页面的方法,得到子页面返回的ids
  2726. $('#interface').datagrid('reload');
  2727. }
  2728. });
  2729. }
  2730. };
  2731. //编辑接口信息
  2732. function edit_interface() {
  2733. var obj = $('#interface').datagrid("getSelected");
  2734. if (obj == null) {
  2735. top.ZLPMS.Msg("请选择一条记录")
  2736. }
  2737. else {
  2738. top.ZLPMS.OpenWindow({
  2739. title: '编辑接口信息',
  2740. url: '/ProManager/Interface_Window?id=' + obj["ID"] + '&type=2',
  2741. area: ['750px', '700px'],
  2742. yes: function (index, layero) {
  2743. //表单提交
  2744. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2745. iframeWin.Forms.Interface_PostData(index, 2, 2, $('#interface'));//调用子页面的方法,得到子页面返回的ids
  2746. $('#interface').datagrid('reload');
  2747. }
  2748. });
  2749. }
  2750. };
  2751. //变更接口
  2752. function deal_interface() {
  2753. var obj = $("#interface").datagrid("getSelected");
  2754. if (obj == null) {
  2755. top.ZLPMS.Msg("请选择一条记录");
  2756. return
  2757. }
  2758. top.ZLPMS.OpenWindow({
  2759. title: '变更状态',
  2760. url: '/ProManager/DealWindow?&id=' + obj["ID"],
  2761. area: ['800px', '600px'],
  2762. yes: function (index, layero) {
  2763. //表单提交
  2764. var iframeWin = top.window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象,执行iframe页的方法:
  2765. iframeWin.Forms.DealInte_PostData(index, $("#interface"));//调用子页面的方法,得到子页面返回的ids
  2766. }
  2767. });
  2768. }
  2769. //刷新
  2770. function refresh() {
  2771. $("#Station").datagrid("reload");
  2772. $("#Server").datagrid("reload");
  2773. $("#Worker").datagrid("reload");
  2774. $("#product").datagrid("reload");
  2775. $("#serverDataBaseInfo").datagrid("reload");
  2776. }
  2777. //简码
  2778. function changename() {
  2779. var val = $("#name").val();
  2780. if (val) {//获取简码
  2781. var code = makePy(val);
  2782. $("#simple").val(code);
  2783. }
  2784. var val = $("#MC").val();
  2785. if (val) {//获取简码
  2786. var code = makePy(val);
  2787. $("#JM").val(code);
  2788. }
  2789. }
  2790. //批量导入窗口
  2791. function openItemupload() {
  2792. projectObj.projectId = $('#project').datagrid("getSelected");
  2793. if (!projectObj.projectId) {
  2794. layer.msg('请先选择需要导入数据的项目!', {
  2795. time: 1000
  2796. });
  2797. return false;
  2798. }
  2799. top.ZLPMS.OpenWindow({
  2800. url: "/ProManager/Itemupload?ItemInfoId=" + projectObj.projectId["ID"],
  2801. area: ['670px', '430px'],
  2802. title: "人员信息批量录入",
  2803. yes: false,
  2804. });
  2805. }
  2806. //导入操作
  2807. layui.use(['form', 'upload'], function () {
  2808. var form = layui.form,
  2809. $ = layui.jquery,
  2810. upload = layui.upload; //只有执行了这一步,部分表单元素才会自动修饰成功
  2811. var demoListView = $('#demoList'),
  2812. uploadListIns = upload.render({
  2813. elem: '#Xmlfiles' //允许上传的文件后缀
  2814. , url: '/ProManager/ItemSiteBatch'
  2815. , method: "post"
  2816. , accept: 'file' //普通文件
  2817. , exts: 'xml' //只允许上传压缩文件
  2818. , multiple: false
  2819. , number: '1'
  2820. , auto: false
  2821. , bindAction: '#confirm'
  2822. , choose: function (obj) {
  2823. var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
  2824. //读取本地文件
  2825. obj.preview(function (index, file, result) {
  2826. var tr = $(['<tr id="upload-' + index + '">'
  2827. , '<td class="uplad-filename">' + file.name + '</td>'
  2828. , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
  2829. , '<td>等待导入</td>'
  2830. , '<td>'
  2831. , '<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
  2832. , '<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete">删除</button>'
  2833. , '</td>'
  2834. , '</tr>'].join(''));
  2835. //单个重传
  2836. tr.find('.demo-reload').on('click', function () {
  2837. obj.upload(index, file);
  2838. });
  2839. //删除
  2840. tr.find('.demo-delete').on('click', function () {
  2841. delete files[index]; //删除对应的文件
  2842. tr.remove();
  2843. uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
  2844. });
  2845. demoListView.append(tr);
  2846. });
  2847. }
  2848. , done: function (res, index, upload) {
  2849. if (res.code == 1) { //上传成功
  2850. var text = "共导入" + res.sum + "条记录,添加成功" + res.addsuccess + "条,修改" + res.updatesuccess_In + "条";
  2851. top.ZLPMS.Msg(text, 1, 6000);
  2852. var tr = demoListView.find('tr#upload-' + index)
  2853. , tds = tr.children();
  2854. tds.eq(2).html('<span style="color: #5FB878;">导入成功</span>');
  2855. tds.eq(3).find('.demo-reload').addClass('layui-hide'); //显示重传
  2856. //tds.eq(3).html(''); //清空操作
  2857. return delete this.files[index]; //删除文件队列已经上传成功的文件
  2858. }
  2859. else {
  2860. this.error(index, upload);
  2861. }
  2862. }
  2863. , error: function (index, upload) {
  2864. var tr = demoListView.find('tr#upload-' + index)
  2865. , tds = tr.children();
  2866. tds.eq(2).html('<span style="color: #FF5722;">导入失败</span>');
  2867. tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
  2868. }
  2869. });
  2870. });
  2871. function Close() {
  2872. var index = parent.layer.getFrameIndex(window.name);
  2873. parent.layer.close(index);
  2874. }
  2875. //人员导入导出工具下载
  2876. function DowdTool() {
  2877. window.open('/Problem/ViewProblemImage?id=4197');
  2878. }
  2879. //工具上传
  2880. function toolupload() {
  2881. top.ZLPMS.OpenWindow({
  2882. url: "/ProManager/toolupload",
  2883. area: ['670px', '430px'],
  2884. title: "工具上传",
  2885. yes: false,
  2886. });
  2887. }
  2888. //附件上传
  2889. layui.use('upload', function () {
  2890. var upload = layui.upload;
  2891. var demoListView = $('#demoList');
  2892. var uploadInst = upload.render({
  2893. elem: '#ChooseFile' //文件选择按钮
  2894. , url: '/ProManager/FileUpload'
  2895. , method: "post"
  2896. , accept: 'file' //普通文件(文件类型)
  2897. , multiple: true //多文件上传
  2898. , auto: false //自动上传
  2899. , size: 10000
  2900. , bindAction: "#btn_upload"
  2901. , number: 3//最大允许上传文件数量
  2902. , choose: function (obj) {
  2903. var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
  2904. //读取本地文件
  2905. obj.preview(function (index, file, result) {
  2906. var display = "none";
  2907. if (file.type == "image/jpeg" || file.type == "image/png") {
  2908. display = "";
  2909. }
  2910. var tr = $(['<tr id="upload-' + index + '">'
  2911. , '<td class="uplad-filename">' + file.name + '</td>'
  2912. , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
  2913. , '<td>等待上传</td>'
  2914. , '<td>'
  2915. , '<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete" style="height:25px;line-height:25px">删除</button>'
  2916. , '<img src="' + result + '" class="CheckImg" width="auto" height="40" style="margin-left:10px;display:' + display + '"/>'
  2917. , '</td>'
  2918. , '</tr>'].join(''));
  2919. //单个重传
  2920. tr.find('.demo-reload').on('click', function () {
  2921. obj.upload(index, file);
  2922. });
  2923. //删除
  2924. tr.find('.demo-delete').on('click', function () {
  2925. delete files[index]; //删除对应的文件
  2926. tr.remove();
  2927. uploadInst.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
  2928. });
  2929. demoListView.append(tr);
  2930. });
  2931. }
  2932. , allDone: function (obj) {
  2933. top.ZLPMS.Msg("总共上传" + obj.total + ",成功" + obj.successful + "个,失败" + obj.aborted + "个")
  2934. if ($('#Constantly').prop("checked")) {
  2935. ZLPMS.UnLoading(projectObj.index)
  2936. top.ZLPMS.UnLoading(projectObj.index2);
  2937. //根据Type选择不同的登记弹窗
  2938. ProjectProblem_Window();//项目问题
  2939. ZLPMS.CloseTopWindow(true);
  2940. return;
  2941. }
  2942. ZLPMS.UnLoading(projectObj.index)
  2943. top.ZLPMS.UnLoading(projectObj.index2);
  2944. ZLPMS.CloseTopWindow(true);
  2945. }
  2946. });
  2947. });
  2948. //下载附件文件
  2949. function downloadfile(id) {
  2950. window.open('/Problem/ViewProblemImage?id=' + id);
  2951. }
  2952. //图片放大查看
  2953. function Zoom(event) {
  2954. var img = "<img src='" + event + "'>"
  2955. layer.open({
  2956. type: 1,//Page层类型
  2957. area: ['500px', '300px'],
  2958. title: '附件查看',
  2959. shade: 0.6,//遮罩透明度
  2960. maxmin: true,//允许全屏最小化
  2961. anim: 1,//0-6的动画形式,-1不开启
  2962. content: img
  2963. });
  2964. }
  2965. //删除附件
  2966. function Delete_img(data) {
  2967. top.ZLPMS.Confirm('删除后无法恢复,您确定要删除该附件吗?', 3, function (idx) {
  2968. $.post("/ProManager/Delete_Attachment", { id: data }, function (d) {
  2969. if (d == 1) {
  2970. top.ZLPMS.Msg("删除成功", 1);
  2971. var classname = "#Attachment" + data;
  2972. var icon = "#icon" + data;
  2973. $(classname).attr("style", "display:none;")
  2974. $(icon).attr("style", "display:none;")
  2975. }
  2976. else {
  2977. top.ZLPMS.Msg("删除失败", 2)
  2978. }
  2979. })
  2980. });
  2981. }
  2982. //预览
  2983. function View() {
  2984. if (projectObj.xmid == null) {
  2985. top.ZLPMS.Msg("请先选择项目");
  2986. return false;
  2987. }
  2988. top.ZLPMS.OpenWindow({
  2989. title: '预览',
  2990. url: "/WebForms/WebReportView.aspx?reportName=1&xmid=" + projectObj.xmid,
  2991. area: ['1000px', '800px'],
  2992. });
  2993. }
  2994. //智能表单表格
  2995. function databindSmart(id) {
  2996. var Params = {
  2997. FLID: 0,
  2998. BDXXID: "",
  2999. QDID: "",
  3000. XMID: id,
  3001. BDJLID: "",
  3002. BZ: "0,1,2",//用于传状态
  3003. };
  3004. $('#Smart').datagrid({
  3005. url: '/SmartForm/SelectRecordListAll',
  3006. method: 'post',
  3007. toolbar: '#btn_Smart',
  3008. queryParams: Params,
  3009. singleSelect: true,
  3010. collapsible: true,
  3011. rownumbers: true,
  3012. fit: true,
  3013. pagination: true,
  3014. columns: [[
  3015. { field: 'ID', title: 'ID', width: 20, align: 'center', fixed: true, hidden: true },
  3016. { field: 'FLID', title: '分类id', width: 20, align: 'center', fixed: true, hidden: true },
  3017. {
  3018. field: 'BDM', title: '填写表单', align: 'left', fixed: true, width: 200,
  3019. },
  3020. {
  3021. field: 'TBR', title: '填报人', align: 'left', fixed: true, width: 80,
  3022. },
  3023. {
  3024. field: 'TBSJ', title: '填报时间', width: 140, align: 'center', fixed: true,
  3025. },
  3026. {
  3027. field: 'TBZT', title: '状态', align: 'left', fixed: true, width: 80,
  3028. formatter: function (value, rowData, index) {
  3029. if (rowData.TBZT == 0) {
  3030. return "填报";
  3031. }
  3032. else if (rowData.TBZT == 1) {
  3033. return "通过";
  3034. }
  3035. else {
  3036. return "退回";
  3037. }
  3038. }, styler: function (value, rowData, index) {
  3039. if (rowData.TBZT == 0) {
  3040. return "color:#007aff";
  3041. }
  3042. else if (rowData.TBZT == 1) {
  3043. return "color:#4cd964";
  3044. }
  3045. else {
  3046. return "color: red";
  3047. }
  3048. },
  3049. },
  3050. {
  3051. field: 'SHR', title: '审核人', align: 'left', fixed: true, width: 80,
  3052. },
  3053. {
  3054. field: 'SHSJ', title: '审核时间', width: 140, align: 'center', fixed: true,
  3055. },
  3056. ]],
  3057. });
  3058. $("#BD").combobox({
  3059. url: '/SmartForm/BdxxSelectList',
  3060. queryParams: {
  3061. FLID: 0
  3062. },
  3063. valueField: 'ID',
  3064. textField: 'BT'
  3065. });
  3066. }
  3067. //表单预览
  3068. function smartView() {
  3069. var row = $('#Smart').datagrid('getSelected');
  3070. if (!row) {
  3071. top.ZLPMS.Msg("请选择列");
  3072. return;
  3073. }
  3074. //if (projectObj.xmid == null) {
  3075. // top.ZLPMS.Msg("请先选择项目");
  3076. // return false;
  3077. //}
  3078. top.ZLPMS.OpenWindow({
  3079. title: row.BDM,
  3080. btn: [],
  3081. url: "/SmartForm/SmarView?ID=" + row.ID,
  3082. area: ['1000px', '800px'],
  3083. });
  3084. }
  3085. //表单新增
  3086. function smartAdd() {
  3087. var row = $('#project').datagrid('getSelected');
  3088. if (!row) {
  3089. top.ZLPMS.Msg("请选项目");
  3090. return;
  3091. }
  3092. var combox = $('#BD').combobox('getValue');
  3093. if (!combox) {
  3094. top.ZLPMS.Msg("请选表单");
  3095. return;
  3096. }
  3097. top.ZLPMS.OpenWindow({
  3098. title: row.名称 + "【" + $('#BD').combobox('getText') + "】(新增)",
  3099. btn: [],
  3100. /*url: '/SmartForm/MobileSmartDetail/' + combox,*/
  3101. url: "/SmartForm/PcSmartFormList?ID=" + combox + "&XMID=" + row.ID + "&XMMC=" + row.名称,
  3102. area: ['90%', '90%'],
  3103. yes: function (index, layero) {
  3104. //表单提交
  3105. $('#Smart').datagrid('reload');
  3106. }
  3107. });
  3108. }
  3109. //表单修改
  3110. function smartEdit() {
  3111. var rowPro = $('#project').datagrid('getSelected');
  3112. if (!rowPro) {
  3113. top.ZLPMS.Msg("请选项目");
  3114. return;
  3115. }
  3116. var row = $("#Smart").datagrid('getSelected');
  3117. if (!row) {
  3118. top.ZLPMS.Msg("请选择列");
  3119. return;
  3120. }
  3121. top.ZLPMS.OpenWindow({
  3122. title: rowPro.名称 + "【" + row.BDM + "】(修改)",
  3123. btn: [],
  3124. url: "/SmartForm/EditPcSmartFormList?ID=" + row.ID,
  3125. area: ['90%', '90%'],
  3126. yes: function (index, layero) {
  3127. //表单提交
  3128. $('#Smart').datagrid('reload');
  3129. }
  3130. });
  3131. }
  3132. //表单刷新
  3133. function smartRefresh() {
  3134. $("#Smart").datagrid("reload");
  3135. }
  3136. //删除表单
  3137. function smartDel() {
  3138. var row = $("#Smart").datagrid('getSelected');
  3139. if (!row) {
  3140. top.ZLPMS.Msg("请选择列");
  3141. return;
  3142. }
  3143. if (row.TBZT == 1) {
  3144. top.ZLPMS.Msg("当前记录不能被删除!");
  3145. return;
  3146. }
  3147. top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
  3148. var param = {
  3149. ID: row.ID,
  3150. BZ: 4
  3151. };
  3152. $.post("/SmartForm/UpdateRecord", param, function (data) {
  3153. if (data.code == 200) {
  3154. $("#Smart").datagrid("reload");
  3155. top.ZLPMS.Msg(data.msg);
  3156. } else {
  3157. top.ZLPMS.Msg(data.msg);
  3158. }
  3159. })
  3160. });
  3161. }