EditPcSmartFormList.cshtml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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/element-ui.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" :value="editData" 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"
  34. class="mui-btn mui-btn-danger"
  35. style="width: 100px; height: 30px; border: 1px solid #dedede; border-radius: 2px; background-color: #1E9FFF; border-color: #1E9FFF; color: #fff; margin-right: 10px ">提交</button>
  36. @*<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>*@
  37. </div>
  38. </div>
  39. </body>
  40. </html>
  41. <script>
  42. $(function () {
  43. var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
  44. $('#cancel').click(function () {
  45. top.ZLPMS.CloseWindow(index);
  46. });
  47. var vm = new Vue({
  48. el: '#fill',
  49. data: {
  50. loading: true,
  51. activeName: '1',
  52. /// 表单数据
  53. jsonData: {},
  54. editData: {},
  55. replyjsonData: {},
  56. replyeditData: {},
  57. isshow: false,
  58. isreplyshow: false,
  59. BDMBID: "",//表单模板id
  60. BDXXID:"",//表单信息id
  61. BDNR: "",//表单内容
  62. BDM: "",
  63. ID: '@ViewBag.ID',//表单记录id
  64. BDXXID: '',//表单信息id
  65. XMMC: "",//项目名称
  66. },
  67. computed: {},
  68. methods: {
  69. init: function init() {
  70. var that = this;
  71. $.post('/SmartForm/MyRecordList', { id: '@ViewBag.ID', TBRID:-1 }, function (data) {
  72. that.isshow = false
  73. that.isreplyshow = false;
  74. that.BDM = data[0].BDM;
  75. that.BDXXID = data[0].BDXXID;
  76. that.XMMC = data[0].XMMC;
  77. that.jsonData = JSON.parse(data[0].BDNR == "" ? "{}" : data[0].BDNR);
  78. that.editData = JSON.parse(data[0].BDJG == "" ? "{}" : data[0].BDJG);
  79. that.replyjsonData = JSON.parse(data[0].BDCLNR == "" ? "{}" : data[0].BDCLNR);
  80. that.replyeditData = JSON.parse(data[0].BDCLJG == "" ? "{}" : data[0].BDCLJG);
  81. that.$nextTick(() => {
  82. that.isshow = true
  83. that.isreplyshow = true
  84. that.loading = false
  85. })
  86. })
  87. },
  88. //保存
  89. Save: function Save(type) {
  90. var that = this;
  91. that.loading = true;
  92. that.$refs.fillitem.getData().then(data => {
  93. var param = {
  94. BDJG: escape(JSON.stringify(data)),
  95. ID: that.ID,
  96. BDXXID: that.BDXXID,
  97. BZ: type == 0 ? 3 : 5,
  98. XMMC: that.XMMC,
  99. TBZT: type,
  100. };
  101. $.post("/SmartForm/UpdateRecord", param, function (data) {
  102. if (data.code == 200) {
  103. that.$message({
  104. message: data.msg,
  105. type: 'success'
  106. });
  107. setTimeout(() => {
  108. that.loading = false;
  109. that.MySmart()
  110. }, 1000);
  111. } else {
  112. that.loading = false;
  113. that.$message.error(data.msg);
  114. }
  115. })
  116. }).catch(e => {
  117. console.log(e);
  118. that.loading = false;
  119. that.$message.error("请注意必填项目!");
  120. })
  121. },
  122. ///返回首页
  123. MySmart: function MySmart(){
  124. top.ZLPMS.CloseWindow(index);
  125. } , ///返回上一页
  126. Beforeback: function Beforeback() {
  127. }
  128. },
  129. watch: {
  130. },
  131. mounted: function mounted() {
  132. this.init();
  133. }
  134. });
  135. });
  136. </script>