EditMobileSmartDetail.cshtml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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/element-ui.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="" v-loading="loading">
  74. <el-tabs v-model="activeName" :stretch="true" v-on:tab-click="handleClick">
  75. <el-tab-pane label="表单内容" name="1" >
  76. <div style="margin:1px 10px 60px 10px;">
  77. <fm-generate-form v-if="isshow" :data="jsonData" :value="editData" ref="fillitem"></fm-generate-form>
  78. </div>
  79. </el-tab-pane>
  80. <el-tab-pane label="回复内容" name="2">
  81. <div style="margin:1px 10px 60px 10px;">
  82. <fm-generate-form v-if="isreplyshow" :data="replyjsonData" :value="replyeditData" :edit="false"></fm-generate-form>
  83. </div>
  84. </el-tab-pane>
  85. </el-tabs>
  86. <nav class="mui-bar mui-bar-tab">
  87. <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>
  88. <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>
  89. <button v-on:click="Save(3)" type="button" class="mui-btn mui-btn-danger" style="width: 30%; border: none; background-color: #fb7e00">暂存</button>
  90. </nav>
  91. </div>
  92. </div>
  93. </body>
  94. </html>
  95. <script>
  96. var vm = new Vue({
  97. el: '#fill',
  98. data: {
  99. loading: true,
  100. activeName: '1',
  101. /// 表单数据
  102. jsonData: {},
  103. editData: {},
  104. replyjsonData: {},
  105. replyeditData: {},
  106. isshow: false,
  107. isreplyshow: false,
  108. BDMBID: "",//表单模板id
  109. BDXXID:"",//表单信息id
  110. BDNR: "",//表单内容
  111. BDM: "",
  112. ID: '@ViewBag.ID',//表单记录id
  113. BDXXID: '',//表单信息id
  114. XMMC: "",//项目名称
  115. },
  116. computed: {},
  117. methods: {
  118. handleClick(tab, event) {
  119. console.log(tab, event);
  120. },
  121. init: function init() {
  122. var that = this;
  123. $.post('/SmartForm/MyRecordList', { id: '@ViewBag.ID' }, function (data) {
  124. that.isshow = false
  125. that.isreplyshow = false;
  126. that.BDM = data[0].BDM;
  127. that.BDXXID = data[0].BDXXID;
  128. that.XMMC = data[0].XMMC;
  129. that.jsonData = JSON.parse(data[0].BDNR == "" ? "{}" : data[0].BDNR);
  130. that.editData = JSON.parse(data[0].BDJG == "" ? "{}" : data[0].BDJG);
  131. that.replyjsonData = JSON.parse(data[0].BDCLNR == "" ? "{}" : data[0].BDCLNR);
  132. that.replyeditData = JSON.parse(data[0].BDCLJG == "" ? "{}" : data[0].BDCLJG);
  133. that.$nextTick(() => {
  134. that.isshow = true
  135. that.isreplyshow = true
  136. that.loading = false
  137. })
  138. })
  139. },
  140. //保存
  141. Save: function Save(type) {
  142. var that = this;
  143. that.loading = true;
  144. that.$refs.fillitem.getData().then(data => {
  145. var param = {
  146. BDJG: escape(JSON.stringify(data)),
  147. ID: that.ID,
  148. BDXXID: that.BDXXID,
  149. BZ: type == 0 ? 3:5,
  150. XMMC: that.XMMC,
  151. TBZT: type,
  152. };
  153. $.post("/SmartForm/UpdateRecord", param, function (data) {
  154. if (data.code == 200) {
  155. that.$message({
  156. message: data.msg,
  157. type: 'success'
  158. });
  159. setTimeout(() => {
  160. that.loading = false;
  161. that.MySmart()
  162. }, 1000);
  163. } else {
  164. that.loading = false;
  165. that.$message.error(data.msg);
  166. }
  167. })
  168. }).catch(e => {
  169. console.log(e);
  170. that.loading = false;
  171. that.$message.error("请注意必填项目!");
  172. })
  173. },
  174. ///返回首页
  175. MySmart: function MySmart(){
  176. window.location.href = '/MobileProblem/Home';
  177. }
  178. , ///返回上一页
  179. Beforeback: function Beforeback() {
  180. window.location.href = '/SmartForm/MobileMySmart';
  181. }
  182. },
  183. watch: {
  184. },
  185. mounted: function mounted() {
  186. this.init();
  187. }
  188. });
  189. </script>