tb-deduction-bind-add.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
  8. <!-- 所有的 css js 资源 -->
  9. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
  12. <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
  13. <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
  14. <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
  15. <script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. <style type="text/css">
  18. .c-panel .el-form .c-label {
  19. width: 7em !important;
  20. }
  21. .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner {
  22. width: 250px;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <div class="vue-box" style="display: none;" :style="'display: block;'">
  28. <!-- ------- 内容部分 ------- -->
  29. <div class="s-body">
  30. <div class="c-panel" style="text-align:center;">
  31. <div class="c-title" >车辆绑定</div>
  32. <el-form v-if="m">
  33. <!-- <sa-item type="text" name="主键" v-model="m.id" br></sa-item>-->
  34. <!-- <sa-item type="text" name="客户id" v-model="m.customerId" br></sa-item>-->
  35. <sa-item type="text" name="客户名称" v-model="m.customerName" :disabled="true" br></sa-item>
  36. <sa-item id="ast" type="text" name="绑定车辆" v-model="m.bindCar" br></sa-item>
  37. <sa-item type="text" name="绑定时间" v-model="m.bindTime" :disabled="true" br></sa-item>
  38. <sa-item name="" class="s-ok" br>
  39. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  40. </sa-item>
  41. </el-form>
  42. </div>
  43. </div>
  44. <!-- ------- 底部按钮 ------- -->
  45. <!-- <div class="s-foot">-->
  46. <!-- <el-button type="primary" @click="ok()">确定</el-button>-->
  47. <!-- <el-button @click="sa.closeCurrIframe()">取消</el-button>-->
  48. <!-- </div>-->
  49. </div>
  50. <script>
  51. var app = new Vue({
  52. components: {
  53. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  54. },
  55. el: '.vue-box',
  56. data: {
  57. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  58. m: null, // 实体对象
  59. },
  60. methods: {
  61. // 创建一个 默认Model
  62. createModel: function () {
  63. return {
  64. id: '', // 主键
  65. customerId: '', // 客户id
  66. customerName: '', // 客户名称
  67. deductMoney: '', // 扣除金额
  68. bindCar: '', // 绑定车辆
  69. bindTime: undefined, // 绑定时间
  70. unbindTime: undefined, // 解绑时候
  71. createBy: '', // 创建人
  72. createTime: undefined, // 创建时间
  73. updateTime: undefined, // 更新时间
  74. updateBy: '', // 更新人
  75. }
  76. },
  77. // 提交数据
  78. ok: function () {
  79. // 表单校验
  80. let m = this.m;
  81. sa.checkNull(m.bindCar, '请输入 [绑定车辆]');
  82. //绑定车辆
  83. sa.ajax('/TbDeductionBind/bindCar', m, function (res) {
  84. sa.alert('绑定成功', this.clean);
  85. }.bind(this));
  86. },
  87. // 添加/修改 完成后的动作
  88. clean: function () {
  89. parent.app.f5(); // 刷新父页面列表
  90. sa.closeCurrIframe();
  91. }
  92. },
  93. mounted: function () {
  94. // 初始化数据
  95. this.m = this.createModel();
  96. // this.m.customerId = this.customerId;
  97. sa.ajax('/TbDeductionBind/getBindByLogin', function (res) {
  98. if(res.data){
  99. this.m = res.data;
  100. }else {
  101. sa.alert('未能查找到客户详细数据,车辆绑定窗口将在5秒后关闭!');
  102. setTimeout(function(){ sa.closeCurrIframe() }, 5000)
  103. }
  104. }.bind(this))
  105. }
  106. })
  107. </script>
  108. </body>
  109. </html>