NewProblemForProject.cshtml 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. 
  2. @{
  3. ViewBag.Title = "NewProblemForProject";
  4. Layout = "~/Views/MobileProblem/_APPMain.cshtml";
  5. }
  6. <link href="~/Content/Style/MobileProductRegist/NewProblemForProject.css?v=1.0" rel="stylesheet" />
  7. <link href="~/Content/Scripts/plugins/mui/css/webuploader.css" rel="stylesheet" />
  8. <link href="~/Content/Scripts/plugins/mui/css/mui.indexedlist.css" rel="stylesheet" />
  9. <script src="~/Content/Scripts/plugins/mui/js/mui.view.js"></script>
  10. <script src="~/Content/Scripts/plugins/mui/js/webuploader.js?v=1.2"></script>
  11. <script src="~/Content/Scripts/babel.min.js"></script>
  12. <script src="~/Content/Scripts/polyfill.min.js"></script>
  13. <script src="~/Content/Scripts/plugins/mui/js/PlusUploader.js?v=2.7422"></script>
  14. <script src="~/Content/Scripts/plugins/mui/js/mui.indexedlist.js?v=1.3"></script>
  15. <script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
  16. <body class="mui-fullscreen">
  17. <style>
  18. .UplodImg {
  19. display: flex;
  20. justify-content: space-between;
  21. flex-direction: row;
  22. align-content: center;
  23. padding: 7px 27px;
  24. }
  25. .filep {
  26. -webkit-line-clamp: 1;
  27. overflow: hidden;
  28. word-break: break-all;
  29. display: -webkit-box;
  30. -webkit-box-orient: vertical;
  31. text-overflow: ellipsis;
  32. position: absolute;
  33. bottom: 12px;
  34. background-color: rgba(0, 0, 0, 0.6);
  35. font-size: 13px;
  36. color: white;
  37. width: 100px;
  38. }
  39. .mui-input-row label {
  40. padding: 11px 20px 11px 13px;
  41. margin-left: 20px;
  42. }
  43. .mui-radio input[type='radio'] {
  44. left: 0;
  45. }
  46. .radiodiv {
  47. display: flex;
  48. flex-direction: row;
  49. background-color: white;
  50. font-size: 14px;
  51. padding: 0 10px;
  52. }
  53. .destory {
  54. position: absolute;
  55. top: 0;
  56. right: -6px;
  57. width: 10px;
  58. height: 10px;
  59. font-size: 20px;
  60. color: #cc9a9a;
  61. margin-bottom: 11px;
  62. transition: color 0.2s ease-out;
  63. background-color: transparent;
  64. border: transparent;
  65. }
  66. .destory:after {
  67. content: '×';
  68. position: absolute;
  69. top: -10px;
  70. right: 5px;
  71. }
  72. .nav-bar {
  73. border-radius: 10px;
  74. font-size: 15px !important;
  75. margin-bottom: 10px !important;
  76. height: 50px;
  77. }
  78. .onselect {
  79. padding: 0 20px;
  80. font-size: 14px;
  81. font-weight: 600;
  82. }
  83. .mui-indexed-list-bar {
  84. background-color: white;
  85. }
  86. .mui-indexed-list-bar.active {
  87. background-color: white !important;
  88. }
  89. .mui-indexed-list-bar a {
  90. color: black;
  91. }
  92. .search_title {
  93. position: absolute;
  94. left: 40px;
  95. border-bottom: none;
  96. width: 82%;
  97. }
  98. .mui-indexed-list {
  99. border-width: 0px;
  100. }
  101. .mui-search .mui-placeholder {
  102. font-size: 13px;
  103. }
  104. .hot_class {
  105. display: inline-block;
  106. line-height: 0.4rem;
  107. padding: 12px 23px;
  108. border-radius: 6px;
  109. color: #000;
  110. margin: 5px;
  111. font-size: 13px;
  112. text-align: center;
  113. list-style: none;
  114. border: solid 1px #dcd9d9;
  115. }
  116. .hot_active {
  117. color: #00aaff;
  118. }
  119. </style>
  120. <div id="vue">
  121. <!--页面主结构开始-->
  122. <div id="app" class="mui-views">
  123. <div class="mui-view">
  124. <div class="mui-navbar">
  125. </div>
  126. <div class="mui-pages">
  127. </div>
  128. </div>
  129. </div>
  130. @*选择项目机构界面
  131. <div id="InstitutionSelect" class="mui-page">
  132. <!--页面标题栏开始-->
  133. <div class="mui-navbar-inner mui-bar mui-bar-nav">
  134. <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
  135. <span class="mui-icon mui-icon-left-nav"></span>
  136. </button>
  137. <h1 class="mui-center mui-title">选择存在问题的项目机构</h1>
  138. <button v-on:click="GoRegister" v-if="ProjectSelect" type="button" class="mui-right mui-btn mui-btn-link mui-btn-nav mui-pull-right">
  139. <span class="mui-icon mui-icon-checkmarkempty" style="color:white;font-size:30px"></span>
  140. </button>
  141. </div>
  142. <!--页面标题栏结束-->
  143. <!--页面主内容区开始-->
  144. <div class="mui-page-content">
  145. <div class="onselect">已选:&nbsp;{{ProjectSelectName}}{{institutionSeleName}}</div>
  146. <div class="mui-content mui-row mui-fullscreen" style="z-index:0;background-color:#efeff4;margin-top:70px">
  147. <div class="mui-col-xs-3" style="width:35%">
  148. <div id="segmentedControls" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-vertical">
  149. <div style="text-align:center">
  150. <input v-model="ProjectSearchText" style="font-size:15px; margin:auto" type="search" class="mui-input-clear" placeholder="项目名称搜索">
  151. </div>
  152. <a v-for="p in ProjectSearchData" v-bind:class="ProjectSelect==p.id?'mui-active':''" v-bind:id="p.text" class="mui-control-item " v-on:click="GetInstitution(p)">{{p.text}}</a>
  153. </div>
  154. </div>
  155. <div id="segmentedControlContents" class="mui-col-xs-9" style="border-left: 1px solid #c8c7cc;width:65%">
  156. <div id="content" class="mui-control-content mui-active">
  157. <div style="text-align:center">
  158. <input v-model="searchText" style="font-size:15px; margin:auto" type="search" class="mui-input-clear" placeholder="机构名称搜索">
  159. </div>
  160. <ul style="margin-top:0" class="mui-table-view">
  161. <li v-for="i in InsitutionSearchData" class="mui-table-view-cell" v-bind:class="institutionSele==i.id?'mui-active':''" v-on:click="InstitutionSelect(i)">{{i.text}}</li>
  162. </ul>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <!--页面主内容区结束-->
  168. </div>*@
  169. <div id="SelectNew" class="mui-page">
  170. <!--页面标题栏开始-->
  171. <div class="mui-navbar-inner mui-bar mui-bar-nav">
  172. <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
  173. <span class="mui-icon mui-icon-left-nav"></span>
  174. </button>
  175. <h1 class="mui-center mui-title">选择存在问题的项目</h1>
  176. </div>
  177. <!--页面标题栏结束-->
  178. <!--页面主内容区开始-->
  179. <div id="modal" class="mui-page-content">
  180. <div id="list" class="mui-indexed-list">
  181. <div>
  182. <div class="mui-indexed-list-search mui-input-row mui-search ">
  183. <input type="search" class="mui-input-clear mui-indexed-list-search-input" placeholder="搜索项目名称/简码">
  184. </div>
  185. </div>
  186. <div class="mui-indexed-list-bar">
  187. <a v-if="ProjectSelectName">已选</a>
  188. <a>历史</a>
  189. <a v-for="item in ProjectIndex">{{item.Index}}</a>
  190. </div>
  191. <div class="mui-indexed-list-alert"></div>
  192. <div class="mui-indexed-list-inner">
  193. <div class="mui-indexed-list-empty-alert">没有数据</div>
  194. <ul class="mui-table-view" style="margin-top:0;padding-right: 23px;">
  195. <template v-if="ProjectSelectName">
  196. <li data-group="已选" class="mui-table-view-divider mui-indexed-list-group">已选项目</li>
  197. <li class="hot_class hot_active">{{ProjectSelectName}}</li>
  198. </template>
  199. <li data-group="历史" class="mui-table-view-divider mui-indexed-list-group">历史记录</li>
  200. <li v-if="UserHistoryProject.length>0"
  201. v-on:click="ProjectChooseCompleteHis(item.split('|'))"
  202. v-for="item in UserHistoryProject" class="hot_class">{{item.split('|')[1]}}</li>
  203. <li v-if="!UserHistoryProject.length" class="hot_class">暂无</li>
  204. <template v-for="item in ProjectIndex">
  205. <li v-bind:data-group="item.Index" class="mui-table-view-divider mui-indexed-list-group">{{item.Index}}</li>
  206. <li v-bind:class="project.ID==ProjectSelect?'hot_active':''" v-on:click="ProjectChooseComplete(project)" v-for="project in item.Data" v-bind:data-value="project.CodeName" v-bind:data-tags="project.CodeName" class="mui-table-view-cell mui-indexed-list-item">
  207. {{project.Name}}
  208. </li>
  209. </template>
  210. </ul>
  211. </div>
  212. </div>
  213. </div>
  214. <!--页面主内容区结束-->
  215. </div>
  216. @*登记主界面*@
  217. <div id="register" class="mui-page">
  218. <div class="mui-navbar-inner mui-bar mui-bar-nav">
  219. <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
  220. <span class="mui-icon mui-icon-left-nav"></span>
  221. </button>
  222. <h1 class="mui-center mui-title">中联区卫问题登记</h1>
  223. @*<button v-on:click="Submit()" class="mui-btn mui-btn-blue mui-btn-link mui-pull-right" style="color:#ffffff">直接提交</button>*@
  224. </div>
  225. <nav class="mui-bar mui-bar-tab">
  226. <button v-on:click="Submit()" type="button" class="mui-btn mui-btn-primary" style="width:48%;background-color: #2ab8ff;border:none;margin-right:10px">直接提交</button>
  227. <button v-on:click="StatusSelect()" type="button" class="mui-btn mui-btn-danger" style="width:48%;border:none;background-color: #fb7e00">下一步(填写处理状态)</button>
  228. </nav>
  229. <div class="mui-page-content">
  230. <div class="mui-scroll-wrapper">
  231. <div class="mui-scroll">
  232. <input v-model="institutionSele" type="hidden" />
  233. <div class="mui-input-row" style="margin-top: 7px">
  234. <input v-on:blur="getde()" v-model="ProblemTitile" id="ProblemTitile" type="text" class="mui-input-speech mui-input-clear" placeholder="填写问题标题" style="font-size:15px">
  235. </div>
  236. <div class="mui-input-row" style="font-size:14px">
  237. <textarea v-model="detail" id="detail" rows="8" placeholder="请填写具体的问题描述,以便我们更详细的了解您需要解决的问题。" style="font-size:15px;margin-bottom:-10px"></textarea>
  238. <span id="deatilSpeech" class="mui-icon mui-icon-speech" style="position:absolute;bottom:4px;right:0;color: #999;"></span>
  239. </div>
  240. <div style="background-color:white;margin-top:10px">
  241. <div class="UplodImg" id="pickImg">
  242. <h4 style="font-weight:400">图片</h4>
  243. <div>
  244. @*<span class="mui-icon mui-icon-camera" id="pickCamera" style="color:#1296db;margin-right:20px;font-size:28px"></span>
  245. <span class="mui-icon mui-icon-image" id="pickPhoto" style="color:#1296db"></span>*@
  246. <span class="mui-icon mui-icon-camera" id="pickCamera" style="color:#1296db;"></span>
  247. </div>
  248. </div>
  249. <ul id="ImgList" class="mui-table-view mui-grid-view mui-grid-9" style="background-color:white;border-color:transparent;margin:0"></ul>
  250. </div>
  251. <div style="background-color:white;border-top: solid 1px #efeff4;">
  252. <div class="UplodImg" id="pickFlie">
  253. <h4 style="font-weight:400">附件</h4>
  254. <span class="mui-icon mui-icon-paperclip" style="color:#1296db"></span>
  255. </div>
  256. <ul id="FileList" class="mui-table-view mui-grid-view mui-grid-9" style="background-color:white;border-color:transparent;"></ul>
  257. </div>
  258. <div style="display:none" id="picker">选择文件</div>
  259. <div style="display:none" id="picker2">选择文件</div>
  260. <button style="margin-top: 30px;display:none;" id="ctlBtn" class="btn btn-default">图片上传</button>
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. @*处理状态选择界面*@
  266. <div id="DEALSTATUS" class="mui-page">
  267. <div class="mui-navbar-inner mui-bar mui-bar-nav">
  268. <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left">
  269. <span class="mui-icon mui-icon-left-nav"></span>
  270. </button>
  271. <h1 class="mui-center mui-title">中联区卫问题登记</h1>
  272. @*<button v-on:click="Submit()" class="mui-btn mui-btn-blue mui-btn-link mui-pull-right" style="color:#ffffff">直接提交</button>*@
  273. </div>
  274. <nav class="mui-bar mui-bar-tab">
  275. @*<button v-on:click="Submit()" type="button" style="border-radius: 10px;font-size:15px;margin-bottom:10px;height:50px" class="mui-btn mui-btn-success mui-btn-block btn_2">提交</button>*@
  276. <button v-on:click="Submit()" type="button" class="mui-btn mui-btn-primary" style="width:90%;background-color: #2ab8ff;border:none;margin-left:5%">提交</button>
  277. </nav>
  278. <div class="mui-page-content">
  279. <div class="mui-scroll-wrapper">
  280. <div class="mui-scroll">
  281. <h5 class="mui-content-padded">登记来源</h5>
  282. <select v-model="Origin" class="mui-btn mui-btn-block" style="font-size:15px;padding-left:20px">
  283. <option v-for="os in OriginSelec" v-bind:value="os.代码">{{os.显示名}}</option>
  284. </select>
  285. <h5 class="mui-content-padded">问题性质</h5>
  286. <div class="radiodiv">
  287. <div v-for="pn in ProblemNatureSelec" class="mui-input-row mui-radio ">
  288. <label>{{pn.显示名}}</label>
  289. <input v-model="ProblemNature" name="radio3" type="radio" v-bind:value="pn.代码">
  290. </div>
  291. </div>
  292. @*<select v-model="ProblemNature" class="mui-btn mui-btn-block" style="font-size:15px;padding-left:20px">
  293. <option v-for="pn in ProblemNatureSelec" v-bind:value="pn.代码">{{pn.显示名}}</option>
  294. </select>*@
  295. @* <h5 class="mui-content-padded">处理状态</h5>
  296. <div class="radiodiv">
  297. <div class="mui-input-row mui-radio ">
  298. <label>未处理</label>
  299. <input v-model="DealStatus" name="radio1" type="radio" value="0">
  300. </div>
  301. <div class="mui-input-row mui-radio ">
  302. <label>已处理</label>
  303. <input v-model="DealStatus" name="radio1" type="radio" value="1">
  304. </div>
  305. <div class="mui-input-row mui-radio ">
  306. <label>向上提交</label>
  307. <input v-model="DealStatus" name="radio1" type="radio" value="2">
  308. </div>
  309. </div>*@
  310. <div v-if="DealStatus==1" class="mui-input-row" style="font-size:14px">
  311. <textarea v-model="DealDetail" rows="6" placeholder="请填写处理描述说明" style="font-size:15px;margin-top:20px"></textarea>
  312. </div>
  313. <h5 class="mui-content-padded">紧急程度</h5>
  314. <div class="radiodiv">
  315. <div v-for="er in ErginSelec" class="mui-input-row mui-radio ">
  316. <label>{{er.显示名}}</label>
  317. <input v-model="ErginID" name="radio2" type="radio" v-bind:value="er.代码">
  318. </div>
  319. </div>
  320. <ul class="mui-table-view">
  321. <li class="mui-table-view-cell" style="font-size:14px">
  322. 要求时间
  323. <button type="button" data-options='{"type":"date","beginYear":2017,"endYear":2029}' class="mui-btn time-btn">
  324. {{RequireTime}}
  325. </button>
  326. </li>
  327. </ul>
  328. <div class="mui-input-row" style="font-size:14px;margin-bottom:40px;margin-top:20px">
  329. <textarea v-model="urgentDetail" id="urgentDetail" rows="6" placeholder="请填写紧急描述说明" style="font-size:15px;"></textarea>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. <script >
  337. var IsPlus = mui.os.plus ? true : false;
  338. var Count = 0;
  339. var ProblemProcessIDtoImg;
  340. var lod;
  341. var Code = '@ViewBag.ProductCode';
  342. var PersonProperty = '@ViewBag.PersonProperty';
  343. var ProjectId = '@ViewBag.ProjectId';
  344. var OrgID = '@ViewBag.OrgID';
  345. "use strict";
  346. var vm = new Vue({
  347. el: '#vue',
  348. data: {
  349. ///项目机构
  350. ProjectAndInstitution: {},
  351. Institution: {},
  352. //选择的项目
  353. ProjectSelect: '',
  354. //已选项目名称
  355. ProjectSelectName: '',
  356. ///项目人员选择的机构
  357. institutionSele: "",
  358. //已选机构名称
  359. institutionSeleName: "",
  360. ///项目人员选择的处理状态
  361. DealStatus: 2,
  362. ///问题标题
  363. ProblemTitile: '',
  364. ///问题描述
  365. detail: '',
  366. ///处理描述说明
  367. DealDetail: '',
  368. ///紧急程度选择项
  369. ErginSelec: null,
  370. ///紧急程度
  371. ErginID: '',
  372. ///紧急描述
  373. urgentDetail: '',
  374. ///紧急处理时间
  375. RequireTime: '请选择时间',
  376. viewApi: null,
  377. ///登记来源
  378. Origin: '',
  379. ///登记来源选择项
  380. OriginSelec: null,
  381. ///问题性质
  382. ProblemNature: '',
  383. ///问题性质选择项
  384. ProblemNatureSelec: null,
  385. //项目搜索项
  386. ProjectSearchText: '',
  387. //机构搜索项
  388. searchText: '',
  389. FivePlusUploder: null,
  390. //项目索引列表
  391. ProjectIndex: null,
  392. AddProject: '',
  393. //用户的登记的历史项目
  394. UserHistoryProject: []
  395. },
  396. watch: {
  397. ProjectIndex: function ProjectIndex(newProject, oldProject) {
  398. var that = this;
  399. this.$nextTick(function () {
  400. that.InitIndexSelect();
  401. });
  402. }
  403. },
  404. methods: {
  405. ///获取项目
  406. GetProject: function GetProject() {
  407. var that = this;
  408. this.$http.get('/MobileProblem/GetProjectTreeByCode/' + Code).then(function (res) {
  409. this.ProjectAndInstitution = res.body;
  410. var UserSetProject = getCookie("UserSetProject");
  411. if (UserSetProject && UserSetProject.split('|')[0]) {
  412. ///判断获取的项目中是否存在设置的默认项目
  413. var status = false;
  414. for (var _iterator = res.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]() ; ;) {
  415. var _ref;
  416. if (_isArray) {
  417. if (_i >= _iterator.length) break;
  418. _ref = _iterator[_i++];
  419. } else {
  420. _i = _iterator.next();
  421. if (_i.done) break;
  422. _ref = _i.value;
  423. }
  424. var item = _ref;
  425. if (item.id == UserSetProject.split('|')[0]) {
  426. status = true;
  427. break;
  428. }
  429. }
  430. if (status) {
  431. that.SetProjectAndInstitution();
  432. that.CheckInsitution(res.body, UserSetProject.split('|')[0]);
  433. }
  434. }
  435. }, function (res) {
  436. console.log(res.status);
  437. });
  438. },
  439. //筛选机构
  440. CheckInsitution: function CheckInsitution(project, id) {
  441. for (var _iterator2 = project, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]() ; ;) {
  442. var _ref2;
  443. if (_isArray2) {
  444. if (_i2 >= _iterator2.length) break;
  445. _ref2 = _iterator2[_i2++];
  446. } else {
  447. _i2 = _iterator2.next();
  448. if (_i2.done) break;
  449. _ref2 = _i2.value;
  450. }
  451. var item = _ref2;
  452. if (item.id == id) {
  453. this.Institution = item.children;
  454. return;
  455. }
  456. }
  457. },
  458. ///重置项目机构
  459. ResetProjectAndInstitution: function ResetProjectAndInstitution() {
  460. this.ProjectSelect = '';
  461. this.ProjectSelectName = '';
  462. this.institutionSele = '';
  463. this.institutionSeleName = '';
  464. },
  465. //设置默认项目机构
  466. SetProjectAndInstitution: function SetProjectAndInstitution() {
  467. //判断是否设置默认项目和机构
  468. var UserSetProject = getCookie("UserSetProject");
  469. if (UserSetProject && UserSetProject.split('|')[0]) {
  470. this.ProjectSelect = UserSetProject.split('|')[0];
  471. this.ProjectSelectName = UserSetProject.split('|')[1] + " ->";
  472. var UserSetInstitution = getCookie("UserSetInstitution");
  473. if (UserSetInstitution && UserSetInstitution.split('|')[0]) {
  474. this.institutionSele = UserSetInstitution.split('|')[0];
  475. this.institutionSeleName = UserSetInstitution.split('|')[1];
  476. }
  477. }
  478. },
  479. ///获取登记来源
  480. GetOriginSelec: function GetOriginSelec() {
  481. this.$http.get('/MobileProblem/GetComboboxByCode/026').then(function (res) {
  482. this.OriginSelec = res.body;
  483. this.Origin = this.OriginSelec[1].代码;
  484. }, function (res) {
  485. console.log(res.status);
  486. });
  487. },
  488. ///获取问题性质
  489. GetProblemNatureSelec: function GetProblemNatureSelec() {
  490. this.$http.get('/MobileProblem/GetComboboxByCode/013').then(function (res) {
  491. this.ProblemNatureSelec = res.body;
  492. this.ProblemNature = this.ProblemNatureSelec[1].代码;
  493. }, function (res) {
  494. console.log(res.status);
  495. });
  496. },
  497. ///获取机构
  498. GetInstitution: function GetInstitution(i) {
  499. this.ProjectSelect = i.id;
  500. this.ProjectSelectName = i.text + " ->";
  501. this.institutionSele = '';
  502. this.institutionSeleName = ''; //$(".mui-control-item ").removeClass("mui-active");
  503. //$("#" + i.text).addClass("mui-active");
  504. this.Institution = i.children;
  505. },
  506. ///获取紧急程度选择项
  507. GetErgin: function GetErgin() {
  508. this.$http.get('/MobileProblem/GetComboboxByCode/014').then(function (res) {
  509. this.ErginSelec = res.body;
  510. this.ErginID = this.ErginSelec[0].代码;
  511. }, function (res) {
  512. console.log(res.status);
  513. });
  514. },
  515. //只选择项目直接跳转页面
  516. GoRegister: function GoRegister() {
  517. this.viewApi.go("#register");
  518. },
  519. ///选择机构并跳转登记主页面
  520. InstitutionSelect: function InstitutionSelect(i) {
  521. this.institutionSele = i.id;
  522. this.institutionSeleName = i.text;
  523. this.viewApi.go("#register");
  524. },
  525. ///问题状态选择界面
  526. StatusSelect: function StatusSelect() {
  527. if (Code == '') {
  528. mui.toast('请重新选择产品', {
  529. duration: 'long',
  530. type: 'div'
  531. });
  532. return;
  533. }
  534. if (this.ProblemTitile == '') {
  535. mui.toast('请输入问题标题', {
  536. duration: 'long',
  537. type: 'div'
  538. });
  539. return;
  540. }
  541. if (this.detail == '') {
  542. mui.toast('请填写问题详细描述', {
  543. duration: 'long',
  544. type: 'div'
  545. });
  546. return;
  547. }
  548. if (this.ProjectSelect == '') {
  549. mui.toast('至少选择一个存在问题的项目', {
  550. duration: 'long',
  551. type: 'div'
  552. });
  553. return;
  554. }
  555. this.viewApi.go("#DEALSTATUS");
  556. },
  557. ///紧急问题登记界面
  558. ErginSelect: function ErginSelect() {
  559. this.viewApi.go("#Ergin");
  560. },
  561. ///提交问题
  562. Submit: function Submit() {
  563. var that = this;
  564. var param = {
  565. ProblemTitile: this.ProblemTitile,
  566. detail: this.detail,
  567. InstitutionID: this.institutionSele,
  568. ProjectID: this.ProjectSelect,
  569. DealStatus: this.DealStatus,
  570. DealDetail: this.DealDetail,
  571. ErginID: this.ErginID,
  572. urgentDetail: this.urgentDetail,
  573. RequireTime: this.RequireTime,
  574. Origin: this.Origin,
  575. ProblemNature: this.ProblemNature,
  576. ProductCode: Code
  577. };
  578. if (Code == '') {
  579. mui.toast('请重新选择产品', {
  580. duration: 'long',
  581. type: 'div'
  582. });
  583. return;
  584. }
  585. if (this.ProblemTitile == '') {
  586. mui.toast('请输入问题标题', {
  587. duration: 'long',
  588. type: 'div'
  589. });
  590. return;
  591. }
  592. if (this.detail == '') {
  593. mui.toast('请填写问题详细描述', {
  594. duration: 'long',
  595. type: 'div'
  596. });
  597. return;
  598. }
  599. if (this.ProjectSelect == '') {
  600. mui.toast('至少选择一个存在问题的项目', {
  601. duration: 'long',
  602. type: 'div'
  603. });
  604. return;
  605. }
  606. lod = mui.showLoading("正在提交,请稍后...", "div");
  607. $.post("/MobileProblem/SubmitProblem", param, function (data) {
  608. if (data.code == 200) {
  609. ProblemProcessIDtoImg = data.msg;
  610. $("#ctlBtn").click();
  611. } else {
  612. mui.toast("该项目下不存在该产品!", {
  613. duration: 'long',
  614. type: 'div'
  615. });
  616. mui.hideLoading(lod);
  617. }
  618. });
  619. },
  620. ///初始化页面
  621. init: function init() {
  622. var that = this;
  623. mui.init(); ///判断是否为机构管理员
  624. //var defaultPages = '#InstitutionSelect';
  625. var defaultPages = '#SelectNew';
  626. if (PersonProperty == 4) {
  627. this.institutionSele = OrgID;
  628. this.ProjectSelect = ProjectId;
  629. defaultPages = "#register";
  630. } //初始化单页view
  631. that.viewApi = mui('#app').view({
  632. defaultPage: defaultPages
  633. });
  634. mui('.mui-scroll-wrapper').scroll(); //处理view的后退与webview后退
  635. var oldBack = mui.back;
  636. var view = that.viewApi.view;
  637. mui.back = function () {
  638. if (that.viewApi.canBack()) {
  639. //如果view可以后退,则执行view的后退
  640. that.viewApi.back();
  641. } else {
  642. //执行webview后退
  643. oldBack();
  644. }
  645. };
  646. },
  647. ///实例化日期组件
  648. loadTime: function loadTime() {
  649. var that = this;
  650. var btns = $('.time-btn');
  651. btns.each(function (i, btn) {
  652. btn.addEventListener('tap', function () {
  653. var _self = this;
  654. if (_self.picker) {
  655. _self.picker.show(function (rs) {
  656. btn.innerHTML = rs.text;
  657. _self.picker.dispose();
  658. _self.picker = null;
  659. });
  660. } else {
  661. var optionsJson = this.getAttribute('data-options') || '{}';
  662. var options = JSON.parse(optionsJson);
  663. var id = this.getAttribute('id');
  664. _self.picker = new mui.DtPicker(options);
  665. _self.picker.show(function (rs) {
  666. that.RequireTime = rs.text;
  667. _self.picker.dispose();
  668. _self.picker = null;
  669. });
  670. }
  671. }, false);
  672. });
  673. },
  674. ///初始化图片上传插件
  675. ImagUploaderInit: function ImagUploaderInit() {
  676. var that = this;
  677. var $list = $("#ImgList");
  678. var $list2 = $("#FileList");
  679. var $btn = $("#ctlBtn");
  680. var thumbnailWidth = 100;
  681. var thumbnailHeight = 100;
  682. var uploader = WebUploader.create({
  683. // 选完文件后,是否自动上传。
  684. auto: false,
  685. // swf文件路径
  686. swf: '/Content/Scripts/plugins/mui/js/Uploader.swf',
  687. // 文件接收服务端。
  688. server: '/MobileProblem/FlieUploadAndSave',
  689. // 选择文件的按钮。可选。
  690. // 内部根据当前运行是创建,可能是input元素,也可能是flash.
  691. pick: '#picker2',
  692. compress: {
  693. width: 1600,
  694. height: 1600,
  695. // 图片质量,只有type为`image/jpeg`的时候才有效。
  696. quality: 90,
  697. // 是否允许放大,如果想要生成小图的时候不失真,此选项应该设置为false.
  698. allowMagnify: false,
  699. // 是否允许裁剪。
  700. crop: false,
  701. // 是否保留头部meta信息。
  702. preserveHeaders: true,
  703. // 如果发现压缩后文件大小比原来还大,则使用原来图片
  704. // 此属性可能会影响图片自动纠正功能
  705. noCompressIfLarger: false,
  706. // 单位字节,如果图片大小小于此值,不会采用压缩。
  707. compressSize: 0
  708. }
  709. });
  710. uploader.on('fileQueued', function (file) {
  711. var $li = $('<li id="' + file.id + '" class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><img > <button class="destory" ></button><p class="filep">' + file.name + '</p> </li>'),
  712. $img = $li.find('img'); // $list为容器jQuery实例
  713. if (file.type.substring(0, 5) == "image") {
  714. $list.append($li);
  715. } else {
  716. $list2.append('<li id="' + file.id + '" class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><span class="mui-icon mui-icon-upload" style="padding-bottom:10px"></span><button class="destory" ></button>' + '<p class="filep">' + file.name + '</p> </li>');
  717. }
  718. $("#" + file.id).children(".destory").click(function () {
  719. uploader.removeFile(file);
  720. $("#" + file.id).remove();
  721. }); // 创建缩略图
  722. // 如果为非图片文件,可以不用调用此方法。
  723. // thumbnailWidth x thumbnailHeight 为 100 x 100
  724. uploader.makeThumb(file, function (error, src) {
  725. if (error) {
  726. $img.replaceWith('<span>不能预览</span>');
  727. return;
  728. }
  729. $img.attr('src', src);
  730. }, thumbnailWidth, thumbnailHeight);
  731. }); // 文件上传成功,给item添加成功class, 用样式标记上传成功。
  732. uploader.on('uploadSuccess', function (file, response) {
  733. $('#' + file.id).addClass('upload-state-done');
  734. if (response.msg = "1") {
  735. Count += 1;
  736. }
  737. }); // 文件上传失败,显示上传出错。
  738. uploader.on('uploadError', function (file) {
  739. var $li = $('#' + file.id),
  740. $error = $li.find('div.error'); // 避免重复创建
  741. if (!$error.length) {
  742. $error = $('<div class="error"></div>').appendTo($li);
  743. }
  744. $error.text('上传失败');
  745. }); // 完成上传完了,成功或者失败,先删除进度条。
  746. uploader.on('uploadComplete', function (file) {
  747. $('#' + file.id).find('.progress').remove();
  748. });
  749. uploader.on('uploadFinished', function () {
  750. mui.hideLoading(lod);
  751. if (IsPlus) {
  752. that.FivePlusUploder.uplod(ProblemProcessIDtoImg, lod);
  753. } else {
  754. mui.alert("问题反馈成功,请耐心等待,成功上传" + Count + "个附件!", "提交成功", "确定", function () {
  755. window.location.href = "/MobileProblem/Home";
  756. }, 'div');
  757. }
  758. });
  759. $btn.on('click', function () {
  760. uploader.options.formData.ProcessId = ProblemProcessIDtoImg;
  761. uploader.upload();
  762. });
  763. if (!IsPlus) {
  764. document.getElementById('pickImg').addEventListener('tap', function () {
  765. $("#picker").find('.webuploader-element-invisible').click();
  766. });
  767. }
  768. document.getElementById('pickFlie').addEventListener('tap', function () {
  769. $("#picker2").find('.webuploader-element-invisible').click();
  770. });
  771. uploader.addButton({
  772. id: '#picker',
  773. innerHTML: '选择文件',
  774. accept: {
  775. title: 'Images',
  776. extensions: 'gif,jpg,jpeg,bmp,png',
  777. mimeTypes: 'image/*'
  778. },
  779. capture: 'camera'
  780. });
  781. },
  782. getde: function getde() {
  783. if (!this.detail) {
  784. this.detail = this.ProblemTitile;
  785. }
  786. },
  787. LoadUploder: function LoadUploder() {
  788. this.ImagUploaderInit();
  789. if (IsPlus) {
  790. this.FivePlusUploder = new FivePlus();
  791. }
  792. },
  793. //初始化索引列表
  794. InitIndexSelect: function InitIndexSelect() {
  795. var header = document.querySelector('.mui-navbar-inner');
  796. var list = document.getElementById('list');
  797. var modal = document.getElementById('modal'); //calc hieght
  798. list.style.height = modal.offsetHeight + 'px'; //create
  799. window.indexedList = new mui.IndexedList(list);
  800. },
  801. //获取项目索引列表
  802. GetProjectIndex: function GetProjectIndex() {
  803. var that = this;
  804. $.get("/MobileProblem/GetProjectIndexByCode/" + Code, {}, function (data) {
  805. that.ProjectIndex = data;
  806. });
  807. },
  808. //索引选择项目
  809. ProjectChooseComplete: function ProjectChooseComplete(project) {
  810. this.ProjectSelect = project.ID;
  811. this.ProjectSelectName = project.Name;
  812. this.AddHistoryProject(project);
  813. this.viewApi.go("#register");
  814. },
  815. //从历史中选择
  816. ProjectChooseCompleteHis: function ProjectChooseCompleteHis(projectIn) {
  817. var project = {
  818. ID: projectIn[0],
  819. Name: projectIn[1]
  820. };
  821. this.ProjectSelect = project.ID;
  822. this.ProjectSelectName = project.Name;
  823. this.AddHistoryProject(project);
  824. this.viewApi.go("#register");
  825. },
  826. //获取历史登记项目
  827. GetHistoryProject: function GetHistoryProject() {
  828. var UserHistoryProject = getCookie("UserHistoryProject");
  829. if (UserHistoryProject) {
  830. this.UserHistoryProject = JSON.parse(UserHistoryProject);
  831. }
  832. },
  833. //增加历史登记项目
  834. AddHistoryProject: function AddHistoryProject(projectIn) {
  835. var project = projectIn.ID + "|" + projectIn.Name;
  836. var UserHistoryProject = getCookie("UserHistoryProject");
  837. if (UserHistoryProject) {
  838. var OldKeys = JSON.parse(UserHistoryProject);
  839. var findIndex = OldKeys.indexOf(project);
  840. if (findIndex == -1) {
  841. OldKeys.unshift(project);
  842. } else {
  843. OldKeys.splice(findIndex, 1);
  844. OldKeys.unshift(project);
  845. } //最多5个纪录
  846. OldKeys.length > 5 && OldKeys.pop();
  847. setCookie("UserHistoryProject", JSON.stringify(OldKeys), 3);
  848. this.UserHistoryProject = OldKeys; //更新历史搜索
  849. } else {
  850. var OldKeys = [project];
  851. setCookie("UserHistoryProject", JSON.stringify(OldKeys), 3);
  852. this.UserHistoryProject = OldKeys; //更新历史搜索
  853. }
  854. },
  855. AddSpeech: function () {
  856. var that = this;
  857. if (IsPlus) {
  858. mui.plusReady(function () {
  859. document.getElementById('deatilSpeech').addEventListener('tap', function () {
  860. plus.speech.startRecognize({
  861. engine: 'baidu',
  862. lang: 'zh-cn'
  863. }, function (s) {
  864. that.detail = s;
  865. }, function (e) {
  866. console.log('语音识别失败:' + JSON.stringify(e));
  867. });
  868. });
  869. });
  870. } else {
  871. $('#ProblemTitile').removeClass('mui-input-speech');
  872. $('#deatilSpeech').remove();
  873. }
  874. }
  875. },
  876. computed: {
  877. InsitutionSearchData: function InsitutionSearchData() {
  878. var searchText = this.searchText;
  879. if (searchText) {
  880. return this.Institution.filter(function (Institutions) {
  881. return Object.keys(Institutions).some(function (key) {
  882. return String(Institutions[key]).toLowerCase().indexOf(searchText) > -1;
  883. });
  884. });
  885. }
  886. return this.Institution;
  887. },
  888. ProjectSearchData: function ProjectSearchData() {
  889. var ProjectSearchText = this.ProjectSearchText;
  890. if (ProjectSearchText) {
  891. return this.ProjectAndInstitution.filter(function (ProjectAndInstitutions) {
  892. return Object.keys(ProjectAndInstitutions).some(function (key) {
  893. return String(ProjectAndInstitutions[key]).toLowerCase().indexOf(ProjectSearchText) > -1;
  894. });
  895. });
  896. }
  897. return this.ProjectAndInstitution;
  898. }
  899. },
  900. mounted: function mounted() {
  901. this.init();
  902. this.LoadUploder();
  903. this.loadTime(); //this.GetProject();
  904. this.AddSpeech();
  905. this.GetHistoryProject();
  906. this.GetErgin();
  907. this.GetOriginSelec();
  908. this.GetProblemNatureSelec();
  909. this.GetProjectIndex();
  910. }
  911. });
  912. </script>
  913. </body>