tb-two-market-orders-add.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="num" name="货运订单管理表主键" v-model="m.id" br></sa-item>
  30. <sa-item type="text" name="一级市场订单ID" v-model="m.levelOneOrderId" br></sa-item>
  31. <sa-item type="text" name="订单编号" v-model="m.orderNo" br></sa-item>
  32. <sa-item type="text" name="商品id" v-model="m.goodsId" br></sa-item>
  33. <sa-item type="text" name="商品名称" v-model="m.goodsName" br></sa-item>
  34. <sa-item type="text" name="商品来源" v-model="m.goodsFrom" br></sa-item>
  35. <sa-item type="text" name="发货商电话" v-model="m.shipperPhone" br></sa-item>
  36. <sa-item type="text" name="发货商名称" v-model="m.shipperName" br></sa-item>
  37. <sa-item type="text" name="司机ID" v-model="m.driverId" br></sa-item>
  38. <sa-item type="text" name="司机名称" v-model="m.driverName" br></sa-item>
  39. <sa-item type="text" name="司机电话" v-model="m.driverPhone" br></sa-item>
  40. <sa-item type="text" name="车型ID" v-model="m.carId" br></sa-item>
  41. <sa-item type="text" name="车型名称" v-model="m.carType" br></sa-item>
  42. <sa-item type="text" name="收货人名称" v-model="m.consigneeName" br></sa-item>
  43. <sa-item type="text" name="收货人电话号码" v-model="m.consigneePhone" br></sa-item>
  44. <sa-item type="text" name="申报订单号" v-model="m.declarationNumber" br></sa-item>
  45. <sa-item type="enum" name="订单状态已完成" v-model="m.orderFinish" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item>
  46. <sa-item type="text" name="装货地址" v-model="m.loadingAddress" br></sa-item>
  47. <sa-item type="text" name="卸货地址" v-model="m.unloadingAddress" br></sa-item>
  48. <sa-item type="text" name="备注" v-model="m.comment" br></sa-item>
  49. <sa-item type="text" name="更新时间" v-model="m.updateTime" br></sa-item>
  50. <sa-item type="text" name="创建时间" v-model="m.createTime" br></sa-item>
  51. <sa-item type="text" name="更新人名称" v-model="m.updateName" br></sa-item>
  52. <sa-item type="enum" name="删除状态" v-model="m.deleteStatus" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item>
  53. <sa-item type="text" name="更新人编号" v-model="m.updateBy" br></sa-item>
  54. <sa-item type="text" name="创建人编号" v-model="m.createBy" br></sa-item>
  55. <sa-item type="text" name="创建人名称" v-model="m.createName" br></sa-item>
  56. <sa-item type="text" name="贸易区域id" v-model="m.tradeAreaId" br></sa-item>
  57. <sa-item type="text" name="贸易区域名称" v-model="m.tradeAreaName" br></sa-item>
  58. <sa-item name="" class="s-ok" br>
  59. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  60. </sa-item>
  61. </el-form>
  62. </div>
  63. </div>
  64. <!-- ------- 底部按钮 ------- -->
  65. <div class="s-foot">
  66. <el-button type="primary" @click="ok()">确定</el-button>
  67. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  68. </div>
  69. </div>
  70. <script>
  71. var app = new Vue({
  72. components: {
  73. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  74. },
  75. el: '.vue-box',
  76. data: {
  77. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  78. m: null, // 实体对象
  79. },
  80. methods: {
  81. // 创建一个 默认Model
  82. createModel: function() {
  83. return {
  84. id: '', // 货运订单管理表主键
  85. levelOneOrderId: '', // 一级市场订单ID
  86. orderNo: '', // 订单编号
  87. goodsId: '', // 商品id
  88. goodsName: '', // 商品名称
  89. goodsFrom: '', // 商品来源(国家)
  90. shipperPhone: '', // 发货商电话
  91. shipperName: '', // 发货商名称
  92. driverId: '', // 司机ID
  93. driverName: '', // 司机名称
  94. driverPhone: '', // 司机电话
  95. carId: '', // 车型ID
  96. carType: '', // 车型名称
  97. consigneeName: '', // 收货人名称
  98. consigneePhone: '', // 收货人电话号码
  99. declarationNumber: '', // (预留字段) 申报订单号
  100. orderFinish: '', // 订单状态已完成 (0=禁用,1=启用)
  101. loadingAddress: '', // 装货地址
  102. unloadingAddress: '', // 卸货地址
  103. comment: '', // 备注
  104. updateTime: '', // 更新时间
  105. createTime: '', // 创建时间
  106. updateName: '', // 更新人名称
  107. deleteStatus: '', // 删除状态(0=禁用,1=启用)
  108. updateBy: '', // 更新人编号
  109. createBy: '', // 创建人编号
  110. createName: '', // 创建人名称
  111. tradeAreaId: '', // 贸易区域id
  112. tradeAreaName: '', // 贸易区域名称
  113. }
  114. },
  115. // 提交数据
  116. ok: function(){
  117. // 表单校验
  118. let m = this.m;
  119. sa.checkNull(m.id, '请输入 [货运订单管理表主键]');
  120. sa.checkNull(m.levelOneOrderId, '请输入 [一级市场订单ID]');
  121. sa.checkNull(m.orderNo, '请输入 [订单编号]');
  122. sa.checkNull(m.goodsId, '请输入 [商品id]');
  123. sa.checkNull(m.goodsName, '请输入 [商品名称]');
  124. sa.checkNull(m.goodsFrom, '请输入 [商品来源]');
  125. sa.checkNull(m.shipperPhone, '请输入 [发货商电话]');
  126. sa.checkNull(m.shipperName, '请输入 [发货商名称]');
  127. sa.checkNull(m.driverId, '请输入 [司机ID]');
  128. sa.checkNull(m.driverName, '请输入 [司机名称]');
  129. sa.checkNull(m.driverPhone, '请输入 [司机电话]');
  130. sa.checkNull(m.carId, '请输入 [车型ID]');
  131. sa.checkNull(m.carType, '请输入 [车型名称]');
  132. sa.checkNull(m.consigneeName, '请输入 [收货人名称]');
  133. sa.checkNull(m.consigneePhone, '请输入 [收货人电话号码]');
  134. sa.checkNull(m.declarationNumber, '请输入 [申报订单号]');
  135. sa.checkNull(m.orderFinish, '请输入 [订单状态已完成]');
  136. sa.checkNull(m.loadingAddress, '请输入 [装货地址]');
  137. sa.checkNull(m.unloadingAddress, '请输入 [卸货地址]');
  138. sa.checkNull(m.comment, '请输入 [备注]');
  139. sa.checkNull(m.updateTime, '请输入 [更新时间]');
  140. sa.checkNull(m.createTime, '请输入 [创建时间]');
  141. sa.checkNull(m.updateName, '请输入 [更新人名称]');
  142. sa.checkNull(m.deleteStatus, '请输入 [删除状态]');
  143. sa.checkNull(m.updateBy, '请输入 [更新人编号]');
  144. sa.checkNull(m.createBy, '请输入 [创建人编号]');
  145. sa.checkNull(m.createName, '请输入 [创建人名称]');
  146. sa.checkNull(m.tradeAreaId, '请输入 [贸易区域id]');
  147. sa.checkNull(m.tradeAreaName, '请输入 [贸易区域名称]');
  148. // 开始增加或修改
  149. if(this.id <= 0) { // 添加
  150. sa.ajax('/TbOrders/add', m, function(res){
  151. sa.alert('增加成功', this.clean);
  152. }.bind(this));
  153. } else { // 修改
  154. sa.ajax('/TbOrders/update', m, function(res){
  155. sa.alert('修改成功', this.clean);
  156. }.bind(this));
  157. }
  158. },
  159. // 添加/修改 完成后的动作
  160. clean: function() {
  161. if(this.id == 0) {
  162. this.m = this.createModel();
  163. } else {
  164. parent.app.f5(); // 刷新父页面列表
  165. sa.closeCurrIframe(); // 关闭本页
  166. }
  167. }
  168. },
  169. mounted: function(){
  170. // 初始化数据
  171. if(this.id <= 0) {
  172. this.m = this.createModel();
  173. } else {
  174. sa.ajax('/TbOrders/getById?id=' + this.id, function(res) {
  175. this.m = res.data;
  176. if(res.data == null) {
  177. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  178. }
  179. }.bind(this))
  180. }
  181. }
  182. })
  183. </script>
  184. </body>
  185. </html>