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

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