| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>郑州市第一人民医院</title>
- <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <link rel="stylesheet" href="../layui/css/layui.mobile.css" />
- <link href="../css/mui.min.css" rel="stylesheet" />
- <link rel="stylesheet" href="../css/app.css" />
- <link href="../css/mui.picker.css" rel="stylesheet" />
- <link href="../css/mui.picker.min.css" rel="stylesheet" />
- <link href="../css/mui.poppicker.css" rel="stylesheet" />
- <link rel="stylesheet" href="../css/iconfont.css" />
- <!--<link rel="stylesheet" type="text/css" href="../css/feedback-page.css" />-->
- <link rel="stylesheet" href="../js/webuploader/webuploader.css" />
- <link rel="stylesheet" href="../css/inits.css" />
- <style>
- .mui-bar-popover {
- width: 30%;
- }
- .mui-popover.mui-bar-popover .mui-table-view {
- width: 100%;
- }
- .mui-table-view .mui-table-view-cell > a:not(.mui-btn) {
- text-align: center;
- }
- .mui-table-view-cell {
- padding: 1px 15px !important;
- }
- .san {
- font-size: 14px;
- margin-right: 5px
- }
- .nav_a {
- border-right: 1px solid #ccc;
- }
- .radio_box {
- display: inline-block;
- }
- .mui-radio input[type=radio]:before {
- font-size: 20px;
- vertical-align: middle;
- }
- .mui-radio.mui-left input[type=radio] {
- line-height: 24px !important;
- }
- .mui-radio.mui-left label {
- padding-right: 1px !important;
- padding-left: 51px !important;
- }
- .ztext {
- width: 100%;
- margin: 0;
- border: 0;
- }
- .action {
- padding: 11px 15px;
- }
- .type_down {
- float: right !important;
- display: inline-block !important;
- vertical-align: middle !important;
- line-height: 42px;
- }
- .type_con {
- width: 55% !important;
- float: left !important;
- vertical-align: middle !important;
- display: inline-block !important;
- padding: 10px 0 !important;
- }
-
- .get_yzm {
- padding: 5px !important;
- width: auto !important;
- }
- .yzm_con {
- float: left !important;
- width: 40% !important;
- }
- .mui-btn {
- padding: 10px 25px !important;
- }
- .btn-grop {
- text-align: center;
- }
- @font-face {
- font-family: 'iconfont';
- /* project id 280843 */
- src: url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.eot');
- src: url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.woff') format('woff'), url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.ttf') format('truetype'), url('//at.alicdn.com/t/font_280843_7m2gttvpislfecdi.svg#iconfont') format('svg');
- }
- .iconfont {
- font-family: "iconfont";
- font-size: 20px;
- color: #13a7f1;
- font-style: normal;
- -webkit-font-smoothing: antialiased;
- -webkit-text-stroke-width: 0.2px;
- -moz-osx-font-smoothing: grayscale;
- }
- .image-list {
- width: 100%;
- background-size: cover;
- padding: 10px 10px;
- overflow: hidden;
- }
- #image-list {
- display: none;
- }
- /*自定义CSS*/
- .mui-preview-image.mui-fullscreen {
- position: fixed;
- z-index: 20;
- background-color: #000;
- }
- .mui-preview-header,
- .mui-preview-footer {
- position: absolute;
- width: 100%;
- left: 0;
- z-index: 10;
- }
- .mui-preview-header {
- height: 44px;
- top: 0;
- }
- .mui-preview-footer {
- height: 50px;
- bottom: 0px;
- }
- .mui-preview-header .mui-preview-indicator {
- display: block;
- line-height: 25px;
- color: #fff;
- text-align: center;
- margin: 15px auto 4;
- width: 70px;
- background-color: rgba(0, 0, 0, 0.4);
- border-radius: 12px;
- font-size: 16px;
- }
- .mui-preview-image {
- display: none;
- -webkit-animation-duration: 0.5s;
- animation-duration: 0.5s;
- -webkit-animation-fill-mode: both;
- animation-fill-mode: both;
- }
- .mui-preview-image.mui-preview-in {
- -webkit-animation-name: fadeIn;
- animation-name: fadeIn;
- }
- .mui-preview-image.mui-preview-out {
- background: none;
- -webkit-animation-name: fadeOut;
- animation-name: fadeOut;
- }
- .mui-preview-image.mui-preview-out .mui-preview-header,
- .mui-preview-image.mui-preview-out .mui-preview-footer {
- display: none;
- }
- .mui-zoom-scroller {
- position: absolute;
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- width: 100%;
- height: 100%;
- margin: 0;
- -webkit-backface-visibility: hidden;
- }
- .mui-zoom {
- -webkit-transform-style: preserve-3d;
- transform-style: preserve-3d;
- }
- .mui-slider .mui-slider-group .mui-slider-item img {
- width: auto;
- height: auto;
- max-width: 100%;
- max-height: 100%;
- }
- .mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
- width: 100%;
- }
- .mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
- display: inline-table;
- }
- .mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
- display: table-cell;
- vertical-align: middle;
- }
- .mui-preview-loading {
- position: absolute;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- display: none;
- }
- .mui-preview-loading.mui-active {
- display: block;
- }
- .mui-preview-loading .mui-spinner-white {
- position: absolute;
- top: 50%;
- left: 50%;
- margin-left: -25px;
- margin-top: -25px;
- height: 50px;
- width: 50px;
- }
- .mui-preview-image img.mui-transitioning {
- -webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
- transition: transform 0.5s ease, opacity 0.5s ease;
- }
-
- @-webkit-keyframes fadeIn {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
- }
- @keyframes fadeIn {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
- }
- @-webkit-keyframes fadeOut {
- 0% {
- opacity: 1;
- }
- 100% {
- opacity: 0;
- }
- }
- @keyframes fadeOut {
- 0% {
- opacity: 1;
- }
- 100% {
- opacity: 0;
- }
- }
- p img {
- max-width: 100%;
- height: auto;
- }
- .mui-content > .mui-table-view:first-child {
- margin-top: 5px;
- }
- .mui-icon-clear {
- position: absolute;
- right: 0;
- line-height: 40px;
- color: #999;
- font-size: 20px;
- }
- .Hides {
- display: none !important;
- }
- .SHOW {
- display: block !important;
- }
- #Appointtime {
- width: -webkit-calc(65% - 20px) !important;
- width: -moz-calc(65%-20px) !important;
- width: calc(65% - 20px) !important;
- float: none;
- }
- #Repairtime {
- width: -webkit-calc(65% - 20px) !important;
- width: -moz-calc(65%-20px) !important;
- width: calc(65% - 20px) !important;
- float: none;
- }
- .content-title {
- margin-bottom: 0;
- padding: 0 30px;
- }
- .mui-input-row label {
- line-height: normal !important;
- }
- .mui-input-row select {
- font-size: 14px;
- height: 40px !important;
- padding: 0;
- }
- #showZhuTiPickers {
- display: none;
- }
- .mui-radio input[type=radio] {
- top: 7px;
- }
- #userResult {
- width: 30% !important;
- }
- .QRaddOrder{
- display: none;
- }
- </style>
- </head>
- <body>
- <!--<header id="header" class="mui-bar mui-bar-nav new_head">
- <h1 class="mui-title new_head_title">我要投诉</h1>
- <button class="new_head_left mui-action-back mui-btn mui-btn-blue mui-btn-link mui-btn-nav mui-pull-left">
- <span class="mui-icon mui-icon-left-nav"></span>返回
- </button>
- <button class="new_head_right mui-btn mui-btn-blue mui-btn-link mui-pull-right"><span class="iconfont icon-unie644" style="font-size: 25px;"></span></button>
- </header>-->
- <!--<header id="header" class="mui-bar mui-bar-transparent">
- <h1 class="mui-title">导航栏</h1>
- </header>-->
- <div style="margin-top: 20px;">
- <p class="content-title">我的位置</p>
- <ul class="mui-table-view">
- <li class="mui-table-view-cell SDaddOrder" id='showLocation'>
- <div class="mui-input-row">
- <label class="label"><i class="iconfont "></i></label>
- <input type="text" id='Faulttypes' class="ui-alert type_con" placeholder="请选择位置" data-index="" readonly="readonly" />
- <input type="hidden" id="provinceCode" />
- <input type="hidden" id="cityCode" />
- <input type="hidden" id="proNameCode" />
- <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
- </div>
- </li>
- <li class="mui-table-view-cell QRaddOrder">
- <div class="mui-input-row">
- <label class="label"><i class="iconfont "></i></label>
- <input type="text" id='QRFaulttypes' class="ui-alert type_con" placeholder="请选择位置" data-index="" readonly="readonly" />
- </div>
- </li>
- </ul>
- <p class="content-title">报修详情</p>
- </div>
- <div class="mui-content">
- <ul class="mui-table-view">
- <li class="mui-table-view-cell SDaddOrder" id="showBuildPicker">
- <div class="mui-input-row">
- <label class="label">报修地点:</label>
- <input type="text" id='buildName' class="ui-alert type_con" placeholder="请选择报修地点" data-index="" readonly="readonly" />
- <input type="hidden" id='buildCode' />
- <input type="hidden" id='floorCode' />
- <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
- </div>
- </li>
- <li class="mui-table-view-cell QRaddOrder">
- <div class="mui-input-row">
- <label class="label">报修地点:</label>
- <input type="text" id='QRbuildName' class="ui-alert type_con" placeholder="请选择报修地点" data-index="" readonly="readonly" />
- </div>
- </li>
- <li class="mui-table-view-cell">
- <div class="mui-input-row">
- <label class="label">房间号:</label>
- <input type="text" id='repairoom' class="ui-alert type_con" placeholder="请填写房间号" />
- </div>
- </li>
- <li class="mui-table-view-cell" id="showProType">
- <div class="mui-input-row">
- <label class="label">项目类型:</label>
- <input type="text" id='ProTypename' class="ui-alert type_con" data-index="" readonly="readonly" />
- <input type="hidden" id='ProTypeId' />
- <!--<a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>-->
- </div>
- </li>
- <!--<li class="mui-table-view-cell" id="showZhuTiPicker">
- <div class="mui-input-row">
- <label class="label">报修地点:</label>
- <input type="text" id='Repairreplace' class="ui-alert type_con" data-index="" />
- </div>
- </li>-->
- <!--<li class="mui-table-view-cell" id="showTimePicker">
- <div class="mui-input-row">
- <label class="label">报修时间:</label>
- <input type="date" id='Repairtime' class="ui-alert type_con" data-index="" />
- <input type="text" id='Repairtime' class="ui-alert type_con" data-index="" readonly="readonly" />
- <span class="mui-icon mui-icon-clear mui-hidden Repairtime"></span>
- <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
- </div>
- </li>-->
- <li class="mui-table-view-cell" id="showZhuTiPicker">
- <div class="mui-input-row">
- <label class="label">报修人:</label>
- <input type="text" id='Repairman' class="ui-alert type_con" placeholder="请填写报修人" />
- </div>
- </li>
- <li class="mui-table-view-cell">
- <div class="mui-input-row">
- <label class="label">联系方式:</label>
- <input type="tel" id="Contactway" placeholder="请填写联系电话">
- </div>
- </li>
- <!--<li class="mui-table-view-cell" id="showEquipname">
- <div class="mui-input-row">
- <label class="label">设备名称:</label>
- <input type="text" id='Equipname' class="ui-alert type_con" data-index="" readonly="readonly" />
- <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
- </div>
- </li>-->
- <!--<li class="mui-table-view-cell" id="showFaulttype">
- <div class="mui-input-row">
- <label class="label">故障类型:</label>
- <input type="text" id='Faulttype' class="ui-alert type_con" data-index="" readonly="readonly" />
- <a href=""><span class="type_down mui-icon mui-icon-arrowdown mui-pull-right"></span></a>
- </div>
- </li>-->
- <li class="mui-table-view-cell">
- <div class="mui-input-row">
- <label class="label">故障说明:</label>
- <textarea class="ztext content" name="" id="Faultdescripe" rows="3" cols="" placeholder="请详细描述您的问题..."></textarea>
- </div>
- </li>
- <li class="mui-table-view-cell">
- <div class="mui-input-row">
- <label class="label">故障图片:</label>
- <div id="filePicker">
- <i class="iconfont"></i>
- </div>
- <div id='image-list' class="row image-list">
- </div>
- </div>
- </li>
- <!--<li class="mui-table-view-cell">
- <div class="mui-input-row">
- <label class="label">预约时间:</label>
- <input type="date" id="Appointtime" placeholder="">
- <span class="mui-icon mui-icon-clear mui-hidden Appointtime"></span>
- </div>
- </li>-->
- <!--<li class="mui-table-view-cell baoMi">
- <div class="mui-input-row">
- <label class="label" style="width:42%;">指定维修人:</label>
- <div class="mui-input-row mui-radio mui-left radio_box">
- <label>否</label>
- <input type="radio" name="secret" checked="checked" value="1" />
- </div>
- <div class="mui-input-row mui-radio mui-left radio_box">
- <label>是</label>
- <input type="radio" name="secret" value="0" />
- </div>
- </div>
- </li>-->
- <!--<li class="mui-table-view-cell" id="showZhuTiPickers">
- <div class="mui-input-row">
- <label class="label">维修人:</label>
- <select class="mui-select" name="" id="Appointman">
- <option value="张三">张三</option>
- <option value="李四">李四</option>
- <option value="王五">王五</option>
- </select>
- </div>
- </li>-->
- <div style="padding: 20px;" class="btn-grop">
- <div>
- <button type="button" id="HY_add" class="mui-btn mui-btn-primary " style="width: 100%;">提交</button>
- </div>
- </div>
- </ul>
- </div>
- <script src="../layui/layui.js?v=1.1"></script>
- <script src="../js/jquery.min.js?v=1.1"></script>
- <script src="../js/mui.min.js?v=1.1"></script>
- <script src="../js/mui.picker.js?v=1.1"></script>
- <script src="../js/mui.picker.min.js?v=1.1"></script>
- <script src="../js/mui.poppicker.js?v=1.1"></script>
- <script src="../js/zepto.js?v=1.1"></script>
- <script src="../js/mui.zoom.js?v=1.1"></script>
- <script src="../js/mui.previewimage.js?v=1.1"></script>
- <script src="../Script/Common/huayi.config.js?v=1.1"></script>
- <script src="../Script/Common/huayi.http.js?v=1.1"></script>
- <script src="../js/webuploader/webuploader.min.js?v=1.1"></script>
- <!-- <script src="../js/city.data-3.js?v=1.1"></script>-->
- <!--<script src="../js/city.data.js?v=1.1"></script>-->
- <script type="text/javascript">
- //获取楼层信息
- var Loid = helper.request.queryString("id");
- mui.previewImage();
- var Faultpic;
- var Nid;
- //维修人
- // $(' input[name="secret"]').change(function() {
- // var val = $(this).val();
- // if(val == "1") {
- // $("#showZhuTiPickers").hide();
- // } else {
- // $("#showZhuTiPickers").show();
- // }
- // })
- if (Loid) {
- $('.QRaddOrder').show();
- $('.SDaddOrder').hide();
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'equipmentapi/api/Equipment/gettreeinfo',
- async: false,
- data: {
- floorid: Loid
- },
- dataType: 'json',
- success: function(data) {
- if (data.state.toLowerCase() == "success") {
- $('#Faulttypes').val(data.data.provincename + " " + data.data.cityname + " " + data.data.projectname);
- $('#QRFaulttypes').val(data.data.provincename + " " + data.data.cityname + " " + data.data.projectname);
- $('#provinceCode').val(data.data.province);
- $('#cityCode').val(data.data.city);
- $('#proNameCode').val(data.data.projectid);
- $('#buildName').val(data.data.bulidname + " " + data.data.floorname);
- $('#QRbuildName').val(data.data.bulidname + " " + data.data.floorname);
- $('#buildCode').val(data.data.bulidid);
- $('#floorCode').val(data.data.floorid);
- $('#repairoom').val(data.data.repairoom);
- $('#ProTypename').val(data.data.protypename);
- $('#ProTypeId').val(data.data.property);
- localStorage.setItem("projectid", data.data.projectid); //项目信息存储到localStorage
- }
- }
- });
- }
- //报修时间
- //getFormatDate($('#Repairtime'));
- function getFormatDate() {
- var nowDate = new Date();
- var year = nowDate.getFullYear();
- var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
- var date = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
- var hour = nowDate.getHours() < 10 ? "0" + nowDate.getHours() : nowDate.getHours();
- var minute = nowDate.getMinutes() < 10 ? "0" + nowDate.getMinutes() : nowDate.getMinutes();
- var second = nowDate.getSeconds() < 10 ? "0" + nowDate.getSeconds() : nowDate.getSeconds();
- return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
- }
- //楼下拉
- var blildPicker, Adress = [];
- function getBuild() {
- Adress = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'equipmentapi/api/equipment/getaddresstree',
- async: false,
- data: {
- projectid: $('#proNameCode').val()
- },
- dataType: 'json',
- success: function(data) {
- var type_data = data.data;
- if (type_data != null && type_data.length > 0) {
- $(type_data).each(function(i, n) {
- var obj = {};
- obj.value = n.id;
- obj.text = n.name;
- if (n.entityJson != null && n.entityJson.length > 0) {
- var children2 = [];
- $(n.entityJson).each(function(j, k) {
- var obj2 = {};
- obj2.value = k.code;
- obj2.text = k.name;
- children2.push(obj2);
- })
- obj.children = children2;
- }
- Adress.push(obj);
- blildPicker.setData(Adress);
- })
- } else {
- //var obj = {};
- //obj.value = "";
- //obj.text = "暂无楼选择";
- //obj.children = [{
- // value: '',
- // text: '暂无楼层'
- //}];
- //Adress.push(obj);
- blildPicker.setData(Adress);
- }
- }
- });
- }
- //省市项目三级联动
- var cityData3 = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'equipmentapi/api/equipment/getprojecttree',
- async: false,
- data: {},
- dataType: 'json',
- success: function(data) {
- var key_data = data.data;
- $(key_data).each(function(i, n) {
- var obj1 = {};
- obj1.value = n.code;
- obj1.text = n.name;
- if (n.entityJson != null && n.entityJson.length > 0) {
- var children2 = [];
- $(n.entityJson).each(function(j, k) {
- var obj2 = {};
- obj2.value = k.code;
- obj2.text = k.name;
- children2.push(obj2);
- if (k.entityJson != null && k.entityJson.length > 0) {
- var children3 = [];
- $(k.entityJson).each(function(p, q) {
- var obj3 = {}
- obj3.value = q.code;
- obj3.text = q.name;
- obj3.protypeid = q.protypeid;
- obj3.protypename = q.protypename;
- children3.push(obj3);
- })
- obj2.children = children3;
- }
- })
- obj1.children = children2;
- }
- cityData3.push(obj1)
- })
- if (cityData3.length == 0) {
- $('#Faulttypes').attr("placeholder", "暂无数据");
- } else {
- $('#Faulttypes').attr("placeholder", "请选择位置");
- }
- }
- });
- //填充数据
- (function($, doc) {
- $.init();
- $.ready(function() {
- var _getParam = function(obj, param) {
- return obj[param] || '';
- };
- //位置
- var cityPicker3 = new $.PopPicker({
- layer: 3
- });
- // var zhuTiPicker_ = new $.PopPicker();
- cityPicker3.setData(cityData3);
- var showZhuTiPickerButton_ = doc.getElementById('showLocation');
- var zhuTiPicker_ = doc.getElementById('Faulttypes');
- showZhuTiPickerButton_.addEventListener('tap', function(event) {
- cityPicker3.show(function(items) {
- zhuTiPicker_.value = _getParam(items[0], 'text') + " " + _getParam(items[1], 'text') + " " + _getParam(
- items[2], 'text');
- zhuTiPicker_.setAttribute("data-index", _getParam(items[0], 'value') + " " + _getParam(items[1], 'value') +
- " " + _getParam(items[2], 'value'));
- doc.getElementById('provinceCode').value = _getParam(items[0], 'value');
- doc.getElementById('cityCode').value = _getParam(items[1], 'value');
- doc.getElementById('proNameCode').value = _getParam(items[2], 'value');
- doc.getElementById('ProTypeId').value = _getParam(items[2], 'protypeid');
- doc.getElementById('ProTypename').value = _getParam(items[2], 'protypename');
- doc.getElementById('buildName').value = "";
- doc.getElementById('buildCode').value = "";
- doc.getElementById('floorCode').value = "";
- getBuild();
- if (Adress.length == 0) {
- doc.getElementById('buildName').setAttribute("placeholder", "暂无数据");
- } else {
- doc.getElementById('buildName').setAttribute("placeholder", "请选择报修地点");
- }
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }, false);
- //报修地点 楼
- blildPicker = new $.PopPicker({
- layer: 2
- });
- var ShowBuildPickerButton = doc.getElementById('showBuildPicker');
- var BuildResult = doc.getElementById('buildName');
- ShowBuildPickerButton.addEventListener('tap', function(event) {
- if (Adress.length > 0) {
- blildPicker.show(function(items) {
- BuildResult.value = (items[0].text ? items[0].text : "") + " " + (items[1].text ? items[1].text : "");
- doc.getElementById('buildCode').value = items[0].value ? items[0].value : "";
- doc.getElementById('floorCode').value = items[1].value ? items[1].value : "";
- //返回 false 可以阻止选择框的关闭
- //return false;
- });
- }
- }, false);
- })
- })(mui, document);
- //
- var uploader; //上传实例
- var applicationPath = window.applicationPath === "" ? "" : window.applicationPath || "../../";
- var $ = jQuery,
- $list = $('#image-list'),
- // 优化retina, 在retina下这个值是2
- ratio = window.devicePixelRatio || 1,
- // // 缩略图大小
- thumbnailWidth = 50 * ratio,
- thumbnailHeight = 50 * ratio;
- // Web Uploader实例
- //添加图片
- $(function() {
- if (uploader) {
- uploader.destroy();
- }
- uploader = WebUploader.create({
- // 自动上传。
- auto: true,
- // swf文件路径
- swf: '../js/webuploader/Uploader.swf',
- // 文件接收服务端。
- server: huayi.config.callcenter_url + 'fileserverapi/Api/Upload',
- // 选择文件的按钮。可选。
- // 内部根据当前运行是创建,可能是input元素,也可能是flash.
- pick: '#filePicker',
- // 图片数量限制
- fileNumLimit: 4,
- formData: {
- uploadtype: "Works"
- },
- //可以重复上传
- duplicate: true,
- // 只允许选择文件,可选。
- accept: {
- title: 'Images',
- extensions: 'gif,jpg,jpeg,bmp,png',
- mimeTypes: 'image/*'
- },
- resize: false
- });
- //上传图片提示
- uploader.on('error', function(handler) {
- if (handler == "Q_EXCEED_NUM_LIMIT") {
- mui.toast("超出最大文件数");
- }
- });
- // 当有文件添加进来的时候
- uploader.on('fileQueued', function(file) {
- $('#image-list').addClass('SHOW');
- console.log(file);
- var $li = $(
- '<div id="' + file.id + '" class="file-item thumbnail">' +
- '<div class="image-close">X</div>' +
- '<img>' +
- '<div class="info">' + file.name + '</div>' +
- '</div>'
- ),
- $img = $li.find('img');
- $list.prepend($li);
- var IMGLIST = $(".thumbnail");
- $(".image-close").on('tap', function() {
- event.stopPropagation();
- $(this).parent().remove();
- file_num()
- });
- });
- // 文件上传成功,给item添加成功class, 用样式标记上传成功。
- uploader.on('uploadSuccess', function(file, response) {
- $.each(response.data, function(i, j) {
- var $img = $('#' + file.id).find('img');
- var img = j.fileurl;
- // console.log(img);
- $('#' + file.id).attr({
- 'data-filename': j.filename,
- 'data-fileext': j.fileext,
- 'data-filemd5': j.filemd5,
- 'data-filesize': j.filesize,
- 'data-filesmallurl': j.filesmallurl,
- 'data-fileurl': j.fileurl
- });
- uploader.makeThumb(file, function(error, src) {
- if (error) {
- $img.replaceWith('<span class="Phone">' + file.ext + '</span>');
- return;
- }
- $img.attr('src', j.fileurl);
- $img.attr('data-preview-src', '');
- $img.addClass('image-item');
- $img.attr('data-preview-group', "1");
- }, thumbnailWidth, thumbnailHeight);
- });
- $('#' + file.id).addClass('upload-state-done');
- file_num()
- });
- // 文件上传失败,现实上传出错。
- uploader.on('uploadError', function(file) {
- var $li = $('#' + file.id),
- $error = $li.find('div.error');
- // 避免重复创建
- if (!$error.length) {
- $error = $('<div class="error"></div>').appendTo($li);
- }
- $error.text('上传失败');
- });
- // 完成上传完了,成功或者失败,先删除进度条。
- uploader.on('uploadComplete', function(file) {
- $('#' + file.id).find('.progress').remove();
- });
- });
- function file_num() {
- var arr = [];
- $('#image-list').find('.thumbnail').each(function(j, m) {
- var obj = {
- 'filename': $(m).attr("data-filename"),
- 'fileext': $(m).attr("data-fileext"),
- 'filemd5': $(m).attr("data-filemd5"),
- 'filesize': $(m).attr("data-filesize"),
- 'filesmallurl': $(m).attr("data-filesmallurl"),
- 'fileurl': $(m).attr("data-fileurl")
- }
- arr.push(obj)
- })
- window['Faultpic'] = arr;
- }
- $("#HY_add").on('tap', function() {
- if (!$("#proNameCode").val()) {
- mui.alert('位置不能为空!');
- return;
- }
- if (!$("#floorCode").val()) {
- mui.alert('请选择报修地点!');
- return;
- }
- if (!$("#ProTypename").val()) {
- mui.alert('请选择项目类型!');
- return;
- }
- if (!$("#Repairman").val()) {
- mui.alert('请输入报修人!');
- return;
- }
- if (!$("#Contactway").val()) {
- mui.alert('请输入联系方式!');
- return;
- }
- mui.confirm('是否要提交工单', '温馨提示', ['否', '是'], function(e) {
- if (e.index == 1) {
- Submit();
- }
- });
- })
- //时间删除
- // $("#Appointtime").focus(function() {
- // $('.Appointtime').removeClass('mui-hidden');
- // });
- // $('.Appointtime').on('tap', function() {
- // $("#Appointtime").val('');
- // $(this).addClass('mui-hidden');
- // })
- // $("#Repairtime").focus(function() {
- // $('.Repairtime').removeClass('mui-hidden');
- // });
- // $('.Repairtime').on('tap', function() {
- // $("#Repairtime").val('');
- // $(this).addClass('mui-hidden');
- // })
- //提交工单
- function Submit() {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + 'equipmentapi/api/worepairbase/add',
- async: true,
- data: {
- // openid: "oKOqcv31fh76rtNmJDjKc39oIsfA",
- channel: 4, //微信
- province: $('#provinceCode').val(), //省
- city: $('#cityCode').val(), //市
- projectid: $('#proNameCode').val(), //项目名称
- protypeid: $('#ProTypeId').val(), //项目类型
- buildid: $('#buildCode').val(), //楼
- floorid: $('#floorCode').val(), //楼层
- repairreplace: $("#buildName").val(), //报修地点
- repairoom: $('#repairoom').val(), //房间号
- repairtime: getFormatDate(), //$("#Repairtime").val(), //报修时间
- repairman: $("#Repairman").val(), //报修人
- contactway: $("#Contactway").val(), //联系电话
- // faulttype: $("#Faulttype").val(), //故障类型
- faultdescripe: $("#Faultdescripe").val(),
- faultpic: Faultpic,
- // appointtime: $("#Appointtime").val(),
- // appointman: $("#Appointman").val(), //维修人
- // isappoint: $('input[name="secret"]:checked').val() //是否指定维修人 0否,1是
- },
- success: function(data) {
- var str = JSON.parse(data);
- if (str.state == "success") {
- mui.alert('投诉成功!');
- window.location.href = 'Workfinish.html';
- $('#Faulttypes').val(''); //位置
- $('#provinceCode').val(''); //省
- $('#cityCode').val(''); //市
- $('#proNameCode').val(''); //项目
- $('#buildCode').val(''); //楼
- $('#buildName').val(''), //楼 文本
- $('#floorCode').val(''); //楼层
- $('#repairoom').val(''); //房间号
- $('#ProTypename').val(''); //项目类型 文本
- $('#ProTypeId').val(''); //项目类型
- $("#Repairtime").val(''); //报修时间
- $("#Repairman").val(''); //报修人
- $("#Contactway").val(''); //联系电话
- // $("#Faulttype").val(''); //故障类型
- $("#Faultdescripe").text(''); //故障说明
- // $("#Appointtime").val('');
- // $("#Appointman").val('');//维修人
- // $('input[name="secret"][value="0"]').prop("checked", "checked");
- }
- }
- });
- }
- </script>
- </body>
- </html>
|