MobileSmartDetail - 复制.cshtml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. 
  2. @{
  3. ViewBag.Title = "MobileSmart";
  4. Layout = "~/Views/MobileProblem/_APPMain.cshtml";
  5. }
  6. <link href="~/Content/Scripts/plugins/mui/css/mui.imageviewer.css" rel="stylesheet" />
  7. <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  8. <link href="~/Content/Scripts/plugins/form-making-advanced@1.4.4.00/dist/FormMaking.css" rel="stylesheet" />
  9. <script src="~/Content/Scripts/plugins/mui/js/mui.zoom.js"></script>
  10. <script src="~/Content/Scripts/plugins/mui/js/mui.previewimage.js"></script>
  11. <!-- 引入组件库 -->
  12. <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  13. <script src="~/Content/Scripts/plugins/form-making-advanced@1.4.4.00/dist/FormMaking.umd.js"></script>
  14. <style>
  15. .message-title {
  16. font-size: 16px;
  17. font-weight: 500;
  18. padding: 1rem 1rem;
  19. }
  20. .message-detail {
  21. font-size: 14px;
  22. padding: 1rem 1rem;
  23. display: inline-block
  24. }
  25. .message-person {
  26. font-size: 12px;
  27. padding: 0 1rem;
  28. color: #adadb5;
  29. }
  30. .mui-content {
  31. background-color: white
  32. }
  33. div {
  34. word-wrap: break-word;
  35. word-break: break-all;
  36. }
  37. p {
  38. word-wrap: break-word;
  39. word-break: break-all;
  40. }
  41. </style>
  42. <header class="mui-bar mui-bar-nav">
  43. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#ffffff"></a>
  44. <h1 class="mui-title" style="color:white">表单填写</h1>
  45. </header>
  46. <div class="mui-content mui-scroll-wrapper" style="margin-bottom: 50px; " id="fill">
  47. <div class="mui-scroll">
  48. <div title="填报内容表单" style=" padding-top: 5px; height: 100%;">
  49. <fm-generate-form v-if="isshow" :data="jsonData" :value="editData" preview generate-code generate-json ref="fillitem"></fm-generate-form>
  50. </div>
  51. </div>
  52. <nav class="mui-bar mui-bar-tab">
  53. <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>
  54. <button v-on:click="Save()" type="button" class="mui-btn mui-btn-danger" style="width:48%;border:none;background-color: #fb7e00">保存</button>
  55. </nav>
  56. </div>
  57. <script>
  58. var vm = new Vue({
  59. el: '#fill',
  60. data: {
  61. /// 表单数据
  62. jsonData: {},
  63. editData: {},
  64. isshow: false,
  65. BDBBID: "",//表单版本id
  66. BDM: "",
  67. BDJG: "",
  68. BDCLJG: '',
  69. QDID: '',//渠道id
  70. QDMC: '',//渠道名称
  71. XMID: "",//项目id
  72. XMMC:"",//项目名称
  73. },
  74. computed: {},
  75. methods: {
  76. init: function init() {
  77. var that = this;
  78. $.post('/SmartForm/BdxxSelect', { id: '@ViewBag.ID' }, function (data) {
  79. that.isshow = false
  80. that.jsonData = JSON.parse(data.BDNR);
  81. that.BDM = data.MC;
  82. that.$nextTick(() => {
  83. that.isshow = true
  84. })
  85. })
  86. },
  87. //保存
  88. Save: function Save() {
  89. var that = this;
  90. that.$refs.fillitem.getData().then(data => {
  91. var param = {
  92. BDBBID: this.BDBBID,
  93. BDM: this.BDM,
  94. BDJG: JSON.stringify(data),
  95. BDCLJG: '',
  96. QDID: '',
  97. QDMC: '',
  98. XMID: '',
  99. XMMC: '项目名称',
  100. };
  101. $.post("/SmartForm/AddRecord", param, function (data) {
  102. if (data.code == 200) {
  103. mui.toast(data.msg, { duration: 'long', type: 'div' });
  104. } else {
  105. mui.toast(data.msg, { duration: 'long', type: 'div' });
  106. }
  107. })
  108. }).catch(e => {
  109. })
  110. }
  111. },
  112. watch: {
  113. },
  114. mounted: function mounted() {
  115. this.init();
  116. mui.init({
  117. swipeBack: true //启用右滑关闭功能
  118. });
  119. mui.previewImage();
  120. mui('.mui-scroll-wrapper').scroll();
  121. }
  122. });
  123. </script>