tb-logistics-add.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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="https://unpkg.com/element-ui@2.13.0/lib/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 type="text" name="申报订单号" v-model="m.declarationNumber" br></sa-item>
  31. <sa-item type="enum" name="订单待确认" v-model="m.prepare" :jv="{0: '待确认', 1: '订单已确认', 2: '订单确认失败'}" jtype="3" br></sa-item>
  32. <sa-item type="text" name="订单确认时间" v-model="m.prepareTime" br></sa-item>
  33. <sa-item type="enum" name="待装货" v-model="m.loading" :jv="{0: '待装货', 1: '已装货'}" jtype="3" br></sa-item>
  34. <sa-item type="text" name="已装货时间" v-model="m.loadingTime" br></sa-item>
  35. <sa-item type="enum" name="发货" v-model="m.delivery" :jv="{0: '未发', 1: '已发'}" jtype="3" br></sa-item>
  36. <sa-item type="text" name="发货时间" v-model="m.deliveryTime" br></sa-item>
  37. <sa-item type="enum" name="已出海关" v-model="m.clearedCustom" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item>
  38. <sa-item type="text" name="出海关时间" v-model="m.clearedCustomTime" br></sa-item>
  39. <sa-item type="enum" name="接货人确定接货" v-model="m.makeCargo" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item>
  40. <sa-item type="text" name="接货完成时间" v-model="m.makeCargoTime" br></sa-item>
  41. <sa-item type="enum" name="收购商确认" v-model="m.confirmReceipt" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item>
  42. <sa-item type="text" name="收货方确认时间" v-model="m.confirmReceiptTime" br></sa-item>
  43. <sa-item type="enum" name="订单状态已完成" v-model="m.orderFinish" :jv="{0: '进行中', 1: '已完成'}" jtype="3" br></sa-item>
  44. <!-- <sa-item type="enum" name="删除状态" v-model="m.deleteStatus" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item> -->
  45. <sa-item name="" class="s-ok" br>
  46. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  47. </sa-item>
  48. </el-form>
  49. </div>
  50. </div>
  51. <!-- ------- 底部按钮 ------- -->
  52. <div class="s-foot">
  53. <el-button type="primary" @click="ok()">确定</el-button>
  54. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  55. </div>
  56. </div>
  57. <script>
  58. var app = new Vue({
  59. components: {
  60. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  61. },
  62. el: '.vue-box',
  63. data: {
  64. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  65. m: null, // 实体对象
  66. },
  67. methods: {
  68. // 创建一个 默认Model
  69. createModel: function() {
  70. return {
  71. id: '', // 物流表主键
  72. ordersId: '', // 订单表ID
  73. declarationNumber: '', // (预留字段) 申报订单号
  74. prepare: '', // 订单待确认(0=待确认,1=订单已确认,2=订单确认失败)
  75. prepareTime: '', // 订单确认时间
  76. loading: '', // 待装货(0=待装货,1=已装货)
  77. loadingTime: '', // 已装货时间
  78. delivery: '', // 发货(0=未发,1=已发)
  79. deliveryTime: '', // 发货时间
  80. clearedCustom: '', // 已出海关(0=禁用,1=启用)
  81. clearedCustomTime: '', // 出海关时间
  82. makeCargo: '', // 接货人确定接货(0=禁用,1=启用)
  83. makeCargoTime: '', // 接货完成时间
  84. confirmReceipt: '', // 收购商确认(0=禁用,1=启用)
  85. confirmReceiptTime: '', // 收货方确认时间(相当于订单完成时间)
  86. orderFinish: '', // 订单状态已完成(0=进行中,1=已完成)
  87. createTime: '', // 创建时间
  88. createBy: '', // 创建人编号
  89. createName: '', // 创建人名称
  90. updateTime: '', // 更新时间
  91. updateBy: '', // 更新人编号
  92. updateName: '', // 更新人名称
  93. deleteStatus: '', // 删除状态(0=禁用,1=启用)
  94. }
  95. },
  96. // 提交数据
  97. ok: function(){
  98. // 表单校验
  99. let m = this.m;
  100. sa.checkNull(m.id, '请输入 [物流表主键]');
  101. sa.checkNull(m.ordersId, '请输入 [订单表ID]');
  102. sa.checkNull(m.declarationNumber, '请输入 [申报订单号]');
  103. sa.checkNull(m.prepare, '请输入 [订单待确认]');
  104. sa.checkNull(m.prepareTime, '请输入 [订单确认时间]');
  105. sa.checkNull(m.loading, '请输入 [待装货]');
  106. sa.checkNull(m.loadingTime, '请输入 [已装货时间]');
  107. sa.checkNull(m.delivery, '请输入 [发货]');
  108. sa.checkNull(m.deliveryTime, '请输入 [发货时间]');
  109. sa.checkNull(m.clearedCustom, '请输入 [已出海关]');
  110. sa.checkNull(m.clearedCustomTime, '请输入 [出海关时间]');
  111. sa.checkNull(m.makeCargo, '请输入 [接货人确定接货]');
  112. sa.checkNull(m.makeCargoTime, '请输入 [接货完成时间]');
  113. sa.checkNull(m.confirmReceipt, '请输入 [收购商确认]');
  114. sa.checkNull(m.confirmReceiptTime, '请输入 [收货方确认时间]');
  115. sa.checkNull(m.orderFinish, '请输入 [订单状态已完成]');
  116. sa.checkNull(m.createTime, '请输入 [创建时间]');
  117. sa.checkNull(m.createBy, '请输入 [创建人编号]');
  118. sa.checkNull(m.createName, '请输入 [创建人名称]');
  119. sa.checkNull(m.updateTime, '请输入 [更新时间]');
  120. sa.checkNull(m.updateBy, '请输入 [更新人编号]');
  121. sa.checkNull(m.updateName, '请输入 [更新人名称]');
  122. sa.checkNull(m.deleteStatus, '请输入 [删除状态]');
  123. // 开始增加或修改
  124. if(this.id <= 0) { // 添加
  125. sa.ajax('/level-one-server/TbLogistics/add', m, function(res){
  126. sa.alert('增加成功', this.clean);
  127. }.bind(this));
  128. } else { // 修改
  129. sa.ajax('/level-one-server/TbLogistics/update', m, function(res){
  130. sa.alert('修改成功', this.clean);
  131. }.bind(this));
  132. }
  133. },
  134. // 添加/修改 完成后的动作
  135. clean: function() {
  136. if(this.id == 0) {
  137. this.m = this.createModel();
  138. } else {
  139. parent.app.f5(); // 刷新父页面列表
  140. sa.closeCurrIframe(); // 关闭本页
  141. }
  142. }
  143. },
  144. mounted: function(){
  145. // 初始化数据
  146. if(this.id <= 0) {
  147. this.m = this.createModel();
  148. } else {
  149. sa.ajax('/level-one-server/TbLogistics/getById?id=' + this.id, function(res) {
  150. this.m = res.data;
  151. if(res.data == null) {
  152. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  153. }
  154. }.bind(this))
  155. }
  156. }
  157. })
  158. </script>
  159. </body>
  160. </html>