tb-iport-order-add.html 5.9 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="身份证号" v-model="m.idno" br></sa-item>
  31. <sa-item type="text" name="边民备案编号" v-model="m.borderPutrecNo" br></sa-item>
  32. <sa-item type="text" name="边民姓名不能为空" v-model="m.borderName" br></sa-item>
  33. <sa-item type="text" name="结算单号" v-model="m.settleBillNo" br></sa-item>
  34. <sa-item type="text" name="进出口预申报单号" v-model="m.preIeportNo" br></sa-item>
  35. <sa-item type="text" name="购买申报确认状态:Y->确认购买申报,N->不购买申报" v-model="m.buyConfirmStatus" br></sa-item>
  36. <sa-item type="text" name="支付状态:01->未支付,02->已支付" v-model="m.payStatus" br></sa-item>
  37. <sa-item type="text" name="互助委托申报确认状态" v-model="m.cooperEntrustStatus" br></sa-item>
  38. <sa-item type="text" name="互助委托申报确认时间" v-model="m.cooperEntrustTime" br></sa-item>
  39. <sa-item type="text" name="边民进口申报确认状态" v-model="m.applyConfirmStatus" br></sa-item>
  40. <sa-item type="text" name="边民进口申报确认时间" v-model="m.applyConfirmTime" 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. idno: '', // 身份证号
  69. borderPutrecNo: '', // 边民备案编号(可选)
  70. borderName: '', // 边民姓名不能为空
  71. settleBillNo: '', // 结算单号
  72. preIeportNo: '', // 进出口预申报单号
  73. buyConfirmStatus: '', // 购买申报确认状态:Y->确认购买申报,N->不购买申报
  74. payStatus: '', // 支付状态:01->未支付,02->已支付
  75. cooperEntrustStatus: '', // 互助委托申报确认状态
  76. cooperEntrustTime: '', // 互助委托申报确认时间
  77. applyConfirmStatus: '', // 边民进口申报确认状态
  78. applyConfirmTime: '', // 边民进口申报确认时间
  79. }
  80. },
  81. // 提交数据
  82. ok: function(){
  83. // 表单校验
  84. let m = this.m;
  85. sa.checkNull(m.id, '请输入 [主键]');
  86. sa.checkNull(m.idno, '请输入 [身份证号]');
  87. sa.checkNull(m.borderPutrecNo, '请输入 [边民备案编号]');
  88. sa.checkNull(m.borderName, '请输入 [边民姓名不能为空]');
  89. sa.checkNull(m.settleBillNo, '请输入 [结算单号]');
  90. sa.checkNull(m.preIeportNo, '请输入 [进出口预申报单号]');
  91. sa.checkNull(m.buyConfirmStatus, '请输入 [购买申报确认状态:Y->确认购买申报,N->不购买申报]');
  92. sa.checkNull(m.payStatus, '请输入 [支付状态:01->未支付,02->已支付]');
  93. sa.checkNull(m.cooperEntrustStatus, '请输入 [互助委托申报确认状态]');
  94. sa.checkNull(m.cooperEntrustTime, '请输入 [互助委托申报确认时间]');
  95. sa.checkNull(m.applyConfirmStatus, '请输入 [边民进口申报确认状态]');
  96. sa.checkNull(m.applyConfirmTime, '请输入 [边民进口申报确认时间]');
  97. // 开始增加或修改
  98. if(this.id <= 0) { // 添加
  99. sa.ajax('/TbIportOrder/add', m, function(res){
  100. sa.alert('增加成功', this.clean);
  101. }.bind(this));
  102. } else { // 修改
  103. sa.ajax('/TbIportOrder/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('/TbIportOrder/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>