tb-fee-item-record-add.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>收费记录-添加/修改</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <style type="text/css">
  17. .c-panel .el-form .c-label{width: 7em !important;}
  18. .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
  19. </style>
  20. </head>
  21. <body>
  22. <div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
  23. <!-- ------- 内容部分 ------- -->
  24. <div class="s-body">
  25. <div class="c-panel">
  26. <div class="c-title" v-if="id == 0">数据添加</div>
  27. <div class="c-title" v-else>数据修改</div>
  28. <el-form v-if="m">
  29. <sa-item type="text" name="主键" v-model="m.id" br></sa-item>
  30. <sa-item type="text" name="订单号" v-model="m.orderNo" br></sa-item>
  31. <sa-item type="text" name="费项ID" v-model="m.itemId" br></sa-item>
  32. <sa-item type="enum" name="收费类型类型" v-model="m.feeType" :jv="{1: '按交易额收取', 2: '按次收取'}" jtype="3" br></sa-item>
  33. <sa-item type="text" name="类型对应的数值" v-model="m.feeNum" br></sa-item>
  34. <sa-item type="text" name="收费项目" v-model="m.itemName" br></sa-item>
  35. <sa-item type="text" name="收费金额" v-model="m.itemPrice" br></sa-item>
  36. <sa-item type="text" name="收费企业" v-model="m.companyName" br></sa-item>
  37. <sa-item type="text" name="企业ID" v-model="m.companyId" br></sa-item>
  38. <sa-item type="text" name="二级市场订单" v-model="m.levelTwoOrderId" br></sa-item>
  39. <sa-item type="text" name="二级订单单号" v-model="m.levelTwoOrderNo" br></sa-item>
  40. <sa-item type="text" name="创建时间" v-model="m.createTime" br></sa-item>
  41. <sa-item type="text" name="支付/划拨时间" v-model="m.payTime" br></sa-item>
  42. <sa-item type="enum" name="支付/划拨状态" v-model="m.payStatus" :jv="{0: '未划拨', 1: '划拨成功', 2: '划拨失败'}" jtype="3" br></sa-item>
  43. <sa-item type="text" name="支付备注" v-model="m.payRemark" br></sa-item>
  44. <sa-item name="" class="s-ok" br>
  45. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  46. </sa-item>
  47. </el-form>
  48. </div>
  49. </div>
  50. <!-- ------- 底部按钮 ------- -->
  51. <div class="s-foot">
  52. <el-button type="primary" @click="ok()">确定</el-button>
  53. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  54. </div>
  55. </div>
  56. <script>
  57. var app = new Vue({
  58. components: {
  59. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  60. },
  61. el: '.vue-box',
  62. data: {
  63. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  64. m: null, // 实体对象
  65. },
  66. methods: {
  67. // 创建一个 默认Model
  68. createModel: function() {
  69. return {
  70. id: '', // 主键
  71. orderNo: '', // 订单号
  72. itemId: '', // 费项ID
  73. feeType: '', // 收费类型类型(1=按交易额收取,2=按次收取)
  74. feeNum: '', // 类型对应的数值
  75. itemName: '', // 收费项目
  76. itemPrice: '', // 收费金额
  77. companyName: '', // 收费企业
  78. companyId: '', // 企业ID
  79. levelTwoOrderId: '', // 二级市场订单
  80. levelTwoOrderNo: '', // 二级订单单号
  81. createTime: '', // 创建时间
  82. payTime: '', // 支付/划拨时间
  83. payStatus: '', // 支付/划拨状态(0=未划拨,1=划拨成功,2=划拨失败)
  84. payRemark: '', // 支付备注
  85. }
  86. },
  87. // 提交数据
  88. ok: function(){
  89. // 表单校验
  90. let m = this.m;
  91. sa.checkNull(m.id, '请输入 [主键]');
  92. sa.checkNull(m.orderNo, '请输入 [订单号]');
  93. sa.checkNull(m.itemId, '请输入 [费项ID]');
  94. sa.checkNull(m.feeType, '请输入 [收费类型类型]');
  95. sa.checkNull(m.feeNum, '请输入 [类型对应的数值]');
  96. sa.checkNull(m.itemName, '请输入 [收费项目]');
  97. sa.checkNull(m.itemPrice, '请输入 [收费金额]');
  98. sa.checkNull(m.companyName, '请输入 [收费企业]');
  99. sa.checkNull(m.companyId, '请输入 [企业ID]');
  100. sa.checkNull(m.levelTwoOrderId, '请输入 [二级市场订单]');
  101. sa.checkNull(m.levelTwoOrderNo, '请输入 [二级订单单号]');
  102. sa.checkNull(m.createTime, '请输入 [创建时间]');
  103. sa.checkNull(m.payTime, '请输入 [支付/划拨时间]');
  104. sa.checkNull(m.payStatus, '请输入 [支付/划拨状态]');
  105. sa.checkNull(m.payRemark, '请输入 [支付备注]');
  106. // 开始增加或修改
  107. if(this.id <= 0) { // 添加
  108. sa.ajax('/TbFeeItemRecord/add', m, function(res){
  109. sa.alert('增加成功', this.clean);
  110. }.bind(this));
  111. } else { // 修改
  112. sa.ajax('/TbFeeItemRecord/update', m, function(res){
  113. sa.alert('修改成功', this.clean);
  114. }.bind(this));
  115. }
  116. },
  117. // 添加/修改 完成后的动作
  118. clean: function() {
  119. if(this.id == 0) {
  120. this.m = this.createModel();
  121. } else {
  122. parent.app.f5(); // 刷新父页面列表
  123. sa.closeCurrIframe(); // 关闭本页
  124. }
  125. }
  126. },
  127. mounted: function(){
  128. // 初始化数据
  129. if(this.id <= 0) {
  130. this.m = this.createModel();
  131. } else {
  132. sa.ajax('/TbFeeItemRecord/getById?id=' + this.id, function(res) {
  133. this.m = res.data;
  134. if(res.data == null) {
  135. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  136. }
  137. }.bind(this))
  138. }
  139. }
  140. })
  141. </script>
  142. </body>
  143. </html>