tb-people-profit-record-add.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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="边民ID" v-model="m.peopleId" br></sa-item>
  31. <sa-item type="text" name="边民姓名" v-model="m.peopleName" br></sa-item>
  32. <sa-item type="text" name="二级市场订单ID" v-model="m.levelTwoOrderId" br></sa-item>
  33. <sa-item type="text" name="二级市场订单号" v-model="m.levelTwoOrderNo" br></sa-item>
  34. <sa-item type="text" name="收益金额" v-model="m.price" br></sa-item>
  35. <sa-item type="text" name="收益类型" v-model="m.profitType" br></sa-item>
  36. <sa-item type="text" name="收益数值" v-model="m.profitNum" br></sa-item>
  37. <sa-item type="text" name="创建时间" v-model="m.createTime" br></sa-item>
  38. <sa-item type="text" name="支付/划拨时间" v-model="m.payTime" br></sa-item>
  39. <sa-item type="enum" name="支付/划拨状态" v-model="m.payStatus" :jv="{0: '未划拨', 1: '划拨成功', 2: '划拨失败'}" jtype="3" br></sa-item>
  40. <sa-item type="text" name="支付备注" v-model="m.payRemark" br></sa-item>
  41. <sa-item name="" class="s-ok" br>
  42. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  43. </sa-item>
  44. </el-form>
  45. </div>
  46. </div>
  47. <!-- ------- 底部按钮 ------- -->
  48. <div class="s-foot">
  49. <el-button type="primary" @click="ok()">确定</el-button>
  50. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  51. </div>
  52. </div>
  53. <script>
  54. var app = new Vue({
  55. components: {
  56. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  57. },
  58. el: '.vue-box',
  59. data: {
  60. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  61. m: null, // 实体对象
  62. },
  63. methods: {
  64. // 创建一个 默认Model
  65. createModel: function() {
  66. return {
  67. id: '', // 主键
  68. peopleId: '', // 边民ID
  69. peopleName: '', // 边民姓名
  70. levelTwoOrderId: '', // 二级市场订单ID
  71. levelTwoOrderNo: '', // 二级市场订单号
  72. price: '', // 收益金额
  73. profitType: '', // 收益类型(0=均分,1=按笔数算,2=交易比例)
  74. profitNum: '', // 收益数值
  75. createTime: '', // 创建时间
  76. payTime: '', // 支付/划拨时间
  77. payStatus: '', // 支付/划拨状态(0=未划拨,1=划拨成功,2=划拨失败)
  78. payRemark: '', // 支付备注
  79. }
  80. },
  81. // 提交数据
  82. ok: function(){
  83. // 表单校验
  84. let m = this.m;
  85. sa.checkNull(m.id, '请输入 [主键]');
  86. sa.checkNull(m.peopleId, '请输入 [边民ID]');
  87. sa.checkNull(m.peopleName, '请输入 [边民姓名]');
  88. sa.checkNull(m.levelTwoOrderId, '请输入 [二级市场订单ID]');
  89. sa.checkNull(m.levelTwoOrderNo, '请输入 [二级市场订单号]');
  90. sa.checkNull(m.price, '请输入 [收益金额]');
  91. sa.checkNull(m.profitType, '请输入 [收益类型]');
  92. sa.checkNull(m.profitNum, '请输入 [收益数值]');
  93. sa.checkNull(m.createTime, '请输入 [创建时间]');
  94. sa.checkNull(m.payTime, '请输入 [支付/划拨时间]');
  95. sa.checkNull(m.payStatus, '请输入 [支付/划拨状态]');
  96. sa.checkNull(m.payRemark, '请输入 [支付备注]');
  97. // 开始增加或修改
  98. if(this.id <= 0) { // 添加
  99. sa.ajax('/TbPeopleProfitRecord/add', m, function(res){
  100. sa.alert('增加成功', this.clean);
  101. }.bind(this));
  102. } else { // 修改
  103. sa.ajax('/TbPeopleProfitRecord/update', m, function(res){
  104. sa.alert('修改成功', this.clean);
  105. }.bind(this));
  106. }
  107. },
  108. // 添加/修改 完成后的动作
  109. clean: function() {
  110. if(this.id == 0) {
  111. this.m = this.createModel();
  112. } else {
  113. parent.app.f5(); // 刷新父页面列表
  114. sa.closeCurrIframe(); // 关闭本页
  115. }
  116. }
  117. },
  118. mounted: function(){
  119. // 初始化数据
  120. if(this.id <= 0) {
  121. this.m = this.createModel();
  122. } else {
  123. sa.ajax('/TbPeopleProfitRecord/getById?id=' + this.id, function(res) {
  124. this.m = res.data;
  125. if(res.data == null) {
  126. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  127. }
  128. }.bind(this))
  129. }
  130. }
  131. })
  132. </script>
  133. </body>
  134. </html>