tb-invoice-order-add.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. <script src="../../static/kj/upload-util.js"></script>
  17. <style type="text/css">
  18. .c-panel .el-form .c-label{width: 7em !important;}
  19. .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
  20. </style>
  21. </head>
  22. <body>
  23. <div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
  24. <!-- ------- 内容部分 ------- -->
  25. <div class="s-body">
  26. <div class="c-panel">
  27. <div class="c-title" v-if="id == 0">上传账单</div>
  28. <div class="c-title" v-else>数据修改</div>
  29. <el-form v-if="m">
  30. <sa-item v-if="idShow === 1" type="text" name="交易单号" v-model="m.transactionId" placeholder="请填写账单中的交易单号" br></sa-item>
  31. <!-- <sa-item type="text" name="账单金额" v-model="m.billMoney" br></sa-item>-->
  32. <sa-item type="img" name="账单截图" v-model="m.billImage" br></sa-item>
  33. <sa-item name="" class="s-ok" br>
  34. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  35. </sa-item>
  36. </el-form>
  37. </div>
  38. </div>
  39. <!-- ------- 底部按钮 ------- -->
  40. <div class="s-foot">
  41. <el-button type="primary" @click="ok()">确定</el-button>
  42. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  43. </div>
  44. </div>
  45. <script>
  46. var app = new Vue({
  47. components: {
  48. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  49. },
  50. el: '.vue-box',
  51. data: {
  52. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  53. m: null, // 实体对象
  54. idShow: 0,
  55. },
  56. methods: {
  57. // 创建一个 默认Model
  58. createModel: function() {
  59. return {
  60. id: '', // 主键
  61. customerId: sa.p('customerId', ''),
  62. businessId: '', // 业务订单id
  63. businessName: '', // 业务名称
  64. businessNo: '', // 业务订单号
  65. transactionId: '', // 微信支付订单号
  66. billMoney: '', // 账单金额
  67. billImage: '', // 账单截图
  68. status: '', // 支付状态(0=未开票,1=已开票)
  69. invoiceTime: '', // 开票时间
  70. createTime: '', // 创建时间
  71. infoId: '', // 开票信息id
  72. }
  73. },
  74. // 提交数据
  75. ok: function(){
  76. // 表单校验
  77. let m = this.m;
  78. // sa.checkNull(m.transactionId, '请输入 [微信支付订单号]');
  79. // sa.checkNull(m.billMoney, '请输入 [账单金额]');
  80. sa.checkNull(m.billImage, '请输入 [账单截图]');
  81. // 开始增加或修改
  82. if(this.id <= 0) { // 添加
  83. sa.ajax('/TbInvoiceOrder/add', m, function(res){
  84. if(res.msg === '操作成功'){
  85. sa.alert('识别成功', this.clean);
  86. }else if(res.msg === 'fail'){
  87. this.idShow = 1;
  88. if(this.m.transactionId === ''){
  89. sa.alert('失败:截图无法识别,或不存在与该账单关联的业务订,请填写截图中的交易单号。');
  90. }else {
  91. sa.alert('失败:不存在与该交易单号关联的业务订单');
  92. }
  93. }
  94. }.bind(this));
  95. }
  96. },
  97. // 添加/修改 完成后的动作
  98. clean: function() {
  99. if(this.id == 0) {
  100. this.m = this.createModel();
  101. } else {
  102. parent.app.f5(); // 刷新父页面列表
  103. sa.closeCurrIframe(); // 关闭本页
  104. }
  105. }
  106. },
  107. mounted: function(){
  108. // 初始化数据
  109. if(this.id <= 0) {
  110. this.m = this.createModel();
  111. } else {
  112. sa.ajax('/TbInvoiceOrder/getById?id=' + this.id, function(res) {
  113. this.m = res.data;
  114. if(res.data == null) {
  115. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  116. }
  117. }.bind(this))
  118. }
  119. }
  120. })
  121. </script>
  122. </body>
  123. </html>