PcSmartFormList.cshtml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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/element/element-ui.css" rel="stylesheet" />
  13. @*<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">*@
  14. <link href="~/Content/Scripts/plugins/form-making-advanced@1.4.4.00/dist/FormMaking.css" rel="stylesheet" />
  15. <!-- 引入组件库 -->
  16. <script src="~/Content/Scripts/jquery.min.js"></script>
  17. <script src="~/Content/Scripts/CookieManage.js?v=1.0"></script>
  18. <script src="~/Content/Scripts/vue.js"></script>
  19. <script src="~/Content/Scripts/plugins/element/elementui.js"></script>
  20. <script src="~/Content/Scripts/plugins/form-making-advanced@1.4.4.00/dist/FormMaking.umd.js"></script>
  21. </head>
  22. <body>
  23. <div class="easyui-layout" id="fill" data-options="fit:true,border:false">
  24. <form id="insert_interface" method="post" class="layui-form" style="margin-top:20px">
  25. <div class="mui-content" style="margin:10px 10px 60px 10px;" v-loading="loading">
  26. <label class="layui-form-label"></label>
  27. <div title="填报内容表单" style="padding: 5px 10px; height: 100%; ">
  28. <fm-generate-form v-if="isshow" :data="jsonData" ref="fillitem"></fm-generate-form>
  29. </div>
  30. </div>
  31. </form>
  32. <div data-options="region:'south',border:false" style="height:50px;text-align:right; padding:5px">
  33. <button v-on:click="Save(0)" type="button" class="mui-btn mui-btn-danger" style="width: 100px; height: 30px; border: 1px solid #dedede; border-radius: 2px; background-color: #1E9FFF; margin-right: 10px ">提交</button>
  34. @*<button v-on:click="Save(3)" type="button" class="mui-btn mui-btn-danger" style="width: 100px; height: 30px; border: 1px solid #dedede; border-radius: 2px; background-color: #fb7e00 ">暂存</button>*@
  35. </div>
  36. </div>
  37. @*<div id="fill">
  38. <header class="mui-bar mui-bar-nav">
  39. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" v-on:click="Beforeback()" style="color:#ffffff"></a>
  40. <h1 class="mui-title" style="color:white">{{BDM}}</h1>
  41. </header>
  42. <div class="mui-content" style="margin:10px 10px 60px 10px;" v-loading="loading">
  43. <div title="填报内容表单" style="padding: 5px 10px; height: 100%; ">
  44. <fm-generate-form v-if="isshow" :data="jsonData" ref="fillitem"></fm-generate-form>
  45. </div>
  46. </div>
  47. <nav class="mui-bar mui-bar-tab">
  48. <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>
  49. <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>
  50. <button v-on:click="Save(3)" type="button" class="mui-btn mui-btn-danger" style="width: 30%; border: none; background-color: #fb7e00">暂存</button>
  51. </nav>
  52. </div>*@
  53. </body>
  54. </html>
  55. <script>
  56. $(function () {
  57. var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
  58. $('#cancel').click(function () {
  59. top.ZLPMS.CloseWindow(index);
  60. });
  61. var vm = new Vue({
  62. el: '#fill',
  63. data: {
  64. loading: true,
  65. /// 表单数据
  66. jsonData: {},
  67. isshow: false,
  68. BDMBID: "",//表单模板id
  69. BDXXID:"",//表单信息id
  70. BDNR: "",//表单内容
  71. BDM: "",
  72. QDID: '',//渠道id
  73. QDMC: '',//渠道名称
  74. XMID: "",//项目id
  75. XMMC: "",//项目名称
  76. },
  77. computed: {},
  78. methods: {
  79. init: function init() {
  80. var that = this;
  81. $.post('/SmartForm/BdxxSelect', { id: '@ViewBag.ID' }, function (data) {
  82. that.isshow = false;
  83. that.jsonData = JSON.parse(data.BDNR);
  84. that.BDNR = data.BDNR;
  85. that.BDMBID = data.BDMBID;
  86. that.BDXXID = data.ID;
  87. that.BDM = data.MC;
  88. that.BDCLNR = data.BDCLNR;
  89. that.$nextTick(() => {
  90. that.isshow = true
  91. that.loading = false
  92. })
  93. })
  94. },
  95. //保存
  96. Save: function Save(type) {
  97. var that = this;
  98. that.loading = true;
  99. that.$refs.fillitem.getData().then(data => {
  100. var param = {
  101. BDMBID: that.BDMBID,
  102. BDXXID: that.BDXXID,
  103. BDM: that.BDM,
  104. BDJG: escape(JSON.stringify(data)),
  105. BDNR: escape(that.BDNR),
  106. BDCLNR: escape(that.BDCLNR),
  107. QDID: '',
  108. QDMC: '',
  109. XMID: '@ViewBag.XMID',
  110. XMMC: '@ViewBag.XMMC',
  111. TBZT: type,
  112. };
  113. $.post("/SmartForm/AddRecord", param, function (data) {
  114. if (data.code == 200) {
  115. that.$message({
  116. message: data.msg,
  117. type: 'success'
  118. });
  119. setTimeout(() => {
  120. that.loading = false;
  121. that.MySmart()
  122. } , 1000);
  123. } else {
  124. that.loading = false;
  125. that.$message.error(data.msg);
  126. }
  127. })
  128. }).catch(e => {
  129. console.log(e);
  130. that.loading = false;
  131. that.$message.error("请注意必填项目!");
  132. })
  133. },
  134. ///返回首页
  135. MySmart: function MySmart(){
  136. top.ZLPMS.CloseWindow(index);
  137. } , ///返回上一页
  138. Beforeback: function Beforeback() {
  139. }
  140. },
  141. watch: {
  142. },
  143. mounted: function mounted() {
  144. this.init();
  145. }
  146. });
  147. });
  148. </script>