MobileSmartDetail.cshtml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. 
  2. @{
  3. ViewBag.Title = "MobileSmartDetail";
  4. Layout = null;
  5. }
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <meta charset="utf-8">
  10. <title>中联区卫问题登记</title>
  11. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit" />
  12. <link href="~/Content/Scripts/plugins/mui/css/mui.css" rel="stylesheet" />
  13. <link href="~/Content/Scripts/plugins/element/element-ui.css" rel="stylesheet" />
  14. @*<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">*@
  15. <link href="~/Content/Scripts/plugins/form-making-advanced@1.4.4.00/dist/FormMaking.css" rel="stylesheet" />
  16. <!-- 引入组件库 -->
  17. <script src="~/Content/Scripts/jquery.min.js"></script>
  18. <script src="~/Content/Scripts/CookieManage.js?v=1.0"></script>
  19. <script src="~/Content/Scripts/vue.js"></script>
  20. <script src="~/Content/Scripts/plugins/element/elementui.js"></script>
  21. <script src="~/Content/Scripts/plugins/form-making-advanced@1.4.4.00/dist/FormMaking.umd.js"></script>
  22. </head>
  23. <body>
  24. <style>
  25. body {
  26. font-family: -apple-system, BlinkMacSystemFont, "PingFang SC","HelveticaNeue",STHeiti,"Microsoft Yahei",Tahoma,Simsun,sans-serif;
  27. background-color: white
  28. }
  29. .mui-bar {
  30. box-shadow: 0 0 7px rgb(183,210,422);
  31. }
  32. .mui-bar-nav {
  33. background-color: #00aaff;
  34. }
  35. .mui-toast-container {
  36. bottom: 50% !important;
  37. }
  38. [v-cloak] {
  39. display: none;
  40. }
  41. .message-title {
  42. font-size: 16px;
  43. font-weight: 500;
  44. padding: 1rem 1rem;
  45. }
  46. .message-detail {
  47. font-size: 14px;
  48. padding: 1rem 1rem;
  49. display: inline-block
  50. }
  51. .message-person {
  52. font-size: 12px;
  53. padding: 0 1rem;
  54. color: #adadb5;
  55. }
  56. .mui-content {
  57. background-color: white
  58. }
  59. div {
  60. word-wrap: break-word;
  61. word-break: break-all;
  62. }
  63. p {
  64. word-wrap: break-word;
  65. word-break: break-all;
  66. }
  67. </style>
  68. <div id="fill">
  69. <header class="mui-bar mui-bar-nav">
  70. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" v-on:click="Beforeback()" style="color:#ffffff"></a>
  71. <h1 class="mui-title" style="color:white">{{BDM}}</h1>
  72. </header>
  73. <div class="mui-content" style="margin:10px 10px 60px 10px;" v-loading="loading">
  74. <div title="填报内容表单" style="padding: 5px 10px; height: 100%; ">
  75. <fm-generate-form v-if="isshow" :data="jsonData" ref="fillitem"></fm-generate-form>
  76. </div>
  77. </div>
  78. <nav class="mui-bar mui-bar-tab">
  79. <button v-on:click="MySmart()" type="button" class="mui-btn mui-btn-primary" style="width:30%;background-color: #2ab8ff;border:none;margin-right:10px">返回首页</button>
  80. <button v-on:click="Save(0)" type="button" class="mui-btn mui-btn-danger" style="width: 30%; border: none; background-color: #6dd724;margin-right:10px ">提交</button>
  81. <button v-on:click="Save(3)" type="button" class="mui-btn mui-btn-danger" style="width: 30%; border: none; background-color: #fb7e00">暂存</button>
  82. </nav>
  83. </div>
  84. </body>
  85. </html>
  86. <script>
  87. var vm = new Vue({
  88. el: '#fill',
  89. data: {
  90. loading: true,
  91. /// 表单数据
  92. jsonData: {},
  93. isshow: false,
  94. BDMBID: "",//表单模板id
  95. BDXXID:"",//表单信息id
  96. BDNR: "",//表单内容
  97. BDM: "",
  98. QDID: '',//渠道id
  99. QDMC: '',//渠道名称
  100. XMID: "",//项目id
  101. XMMC: "",//项目名称
  102. },
  103. computed: {},
  104. methods: {
  105. init: function init() {
  106. var that = this;
  107. $.post('/SmartForm/BdxxSelect', { id: '@ViewBag.ID' }, function (data) {
  108. that.isshow = false;
  109. that.jsonData = JSON.parse(data.BDNR);
  110. that.BDNR = data.BDNR;
  111. that.BDMBID = data.BDMBID;
  112. that.BDXXID = data.ID;
  113. that.BDM = data.MC;
  114. that.BDCLNR = data.BDCLNR;
  115. that.$nextTick(() => {
  116. that.isshow = true
  117. that.loading = false
  118. })
  119. })
  120. },
  121. //保存
  122. Save: function Save(type) {
  123. var that = this;
  124. that.loading = true;
  125. var ProjectJson = JSON.parse(getCookie("UserMobileSmart"));
  126. that.$refs.fillitem.getData().then(data => {
  127. var param = {
  128. BDMBID: that.BDMBID,
  129. BDXXID: that.BDXXID,
  130. BDM: that.BDM,
  131. BDJG: escape(JSON.stringify(data)),
  132. BDNR: escape(that.BDNR),
  133. BDCLNR: escape(that.BDCLNR),
  134. QDID: '',
  135. QDMC: '',
  136. XMID: ProjectJson.ProjectSelect,
  137. XMMC: ProjectJson.ProjectSelectName,
  138. TBZT: type,
  139. };
  140. $.post("/SmartForm/AddRecord", param, function (data) {
  141. if (data.code == 200) {
  142. that.$message({
  143. message: data.msg,
  144. type: 'success'
  145. });
  146. setTimeout(() => {
  147. that.loading = false;
  148. that.MySmart()
  149. } , 1000);
  150. } else {
  151. that.loading = false;
  152. that.$message.error(data.msg);
  153. }
  154. })
  155. }).catch(e => {
  156. console.log(e);
  157. that.loading = false;
  158. that.$message.error("请注意必填项目!");
  159. })
  160. },
  161. ///返回首页
  162. MySmart: function MySmart(){
  163. window.location.href = '/MobileProblem/Home';
  164. } , ///返回上一页
  165. Beforeback: function Beforeback() {
  166. window.location.href = '/SmartForm/MobileSmart';
  167. }
  168. },
  169. watch: {
  170. },
  171. mounted: function mounted() {
  172. this.init();
  173. }
  174. });
  175. </script>