tb-collage-orders-add.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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="贸易区域id" v-model="m.tradeAreaId" br></sa-item>
  31. <sa-item type="text" name="贸易区域名称" v-model="m.tradeAreaName" br></sa-item>
  32. <sa-item type="text" name="订单编号" v-model="m.orderNo" br></sa-item>
  33. <sa-item type="text" name="合作社ID" v-model="m.cooperativeId" br></sa-item>
  34. <sa-item type="text" name="合作社名称" v-model="m.cooperativeName" br></sa-item>
  35. <sa-item type="text" name="总金额" v-model="m.totalPrice" br></sa-item>
  36. <sa-item type="text" name="进境边民确认" v-model="m.entryPeopleStatus" br></sa-item>
  37. <sa-item type="text" name="进境组长确认" v-model="m.entryLeaderStatus" br></sa-item>
  38. <sa-item type="text" name="进境报关企业确认" v-model="m.entryCustomsStatus" br></sa-item>
  39. <sa-item type="text" name="进境申报单号" v-model="m.entryNo" br></sa-item>
  40. <sa-item type="text" name="进境申报时间" v-model="m.entryTime" br></sa-item>
  41. <sa-item type="text" name="进境申报结果" v-model="m.entryResult" br></sa-item>
  42. <sa-item type="text" name="进境申报失败理由" v-model="m.entryFailReason" br></sa-item>
  43. <sa-item type="text" name="进口边民确认" v-model="m.importPeopleStatus" br></sa-item>
  44. <sa-item type="text" name="进口组长确认" v-model="m.importLeaderStatus" br></sa-item>
  45. <sa-item type="text" name="进口申报单号" v-model="m.importNumber" br></sa-item>
  46. <sa-item type="text" name="进口申报时间" v-model="m.importTime" br></sa-item>
  47. <sa-item type="text" name="是否收货" v-model="m.isDelivery" br></sa-item>
  48. <sa-item type="text" name="订单完成状态" v-model="m.orderFinish" br></sa-item>
  49. <sa-item type="text" name="司机ID" v-model="m.driverId" br></sa-item>
  50. <sa-item type="text" name="司机名称" v-model="m.driverName" br></sa-item>
  51. <sa-item type="text" name="司机电话" v-model="m.driverPhone" br></sa-item>
  52. <sa-item type="text" name="车ID" v-model="m.carId" br></sa-item>
  53. <sa-item type="text" name="车名称" v-model="m.carType" br></sa-item>
  54. <sa-item type="text" name="车牌号" v-model="m.vehiclePlate" br></sa-item>
  55. <sa-item type="text" name="装货地址" v-model="m.loadingAddress" br></sa-item>
  56. <sa-item type="text" name="卸货地址" v-model="m.unloadingAddress" br></sa-item>
  57. <sa-item type="text" name="创建人编号" v-model="m.createBy" br></sa-item>
  58. <sa-item type="text" name="创建人名称" v-model="m.createName" br></sa-item>
  59. <sa-item type="text" name="创建时间" v-model="m.createTime" br></sa-item>
  60. <sa-item type="text" name="更新人编号" v-model="m.updateBy" br></sa-item>
  61. <sa-item type="text" name="更新人名称" v-model="m.updateName" br></sa-item>
  62. <sa-item type="text" name="更新时间" v-model="m.updateTime" br></sa-item>
  63. <sa-item type="text" name="删除状态" v-model="m.deleteStatus" br></sa-item>
  64. <sa-item name="" class="s-ok" br>
  65. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  66. </sa-item>
  67. </el-form>
  68. </div>
  69. </div>
  70. <!-- ------- 底部按钮 ------- -->
  71. <div class="s-foot">
  72. <el-button type="primary" @click="ok()">确定</el-button>
  73. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  74. </div>
  75. </div>
  76. <script>
  77. var app = new Vue({
  78. components: {
  79. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  80. },
  81. el: '.vue-box',
  82. data: {
  83. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  84. m: null, // 实体对象
  85. },
  86. methods: {
  87. // 创建一个 默认Model
  88. createModel: function() {
  89. return {
  90. id: '', // 拼单订单表主键
  91. tradeAreaId: '', // 贸易区域id
  92. tradeAreaName: '', // 贸易区域名称
  93. orderNo: '', // 订单编号
  94. cooperativeId: '', // 合作社ID
  95. cooperativeName: '', // 合作社名称
  96. totalPrice: '', // 总金额
  97. entryPeopleStatus: '', // 进境边民确认
  98. entryLeaderStatus: '', // 进境组长确认
  99. entryCustomsStatus: '', // 进境报关企业确认
  100. entryNo: '', // 进境申报单号
  101. entryTime: '', // 进境申报时间
  102. entryResult: '', // 进境申报结果
  103. entryFailReason: '', // 进境申报失败理由
  104. importPeopleStatus: '', // 进口边民确认
  105. importLeaderStatus: '', // 进口组长确认
  106. importNumber: '', // 进口申报单号
  107. importTime: '', // 进口申报时间
  108. isDelivery: '', // 是否收货
  109. orderFinish: '', // 订单完成状态(0=未完成,1=已完成)
  110. driverId: '', // 司机ID
  111. driverName: '', // 司机名称
  112. driverPhone: '', // 司机电话
  113. carId: '', // 车ID
  114. carType: '', // 车名称
  115. vehiclePlate: '', // 车牌号
  116. loadingAddress: '', // 装货地址
  117. unloadingAddress: '', // 卸货地址
  118. createBy: '', // 创建人编号
  119. createName: '', // 创建人名称
  120. createTime: '', // 创建时间
  121. updateBy: '', // 更新人编号
  122. updateName: '', // 更新人名称
  123. updateTime: '', // 更新时间
  124. deleteStatus: '', // 删除状态(0=禁用,1=启用)
  125. }
  126. },
  127. // 提交数据
  128. ok: function(){
  129. // 表单校验
  130. let m = this.m;
  131. sa.checkNull(m.id, '请输入 [拼单订单表主键]');
  132. sa.checkNull(m.tradeAreaId, '请输入 [贸易区域id]');
  133. sa.checkNull(m.tradeAreaName, '请输入 [贸易区域名称]');
  134. sa.checkNull(m.orderNo, '请输入 [订单编号]');
  135. sa.checkNull(m.cooperativeId, '请输入 [合作社ID]');
  136. sa.checkNull(m.cooperativeName, '请输入 [合作社名称]');
  137. sa.checkNull(m.totalPrice, '请输入 [总金额]');
  138. sa.checkNull(m.entryPeopleStatus, '请输入 [进境边民确认]');
  139. sa.checkNull(m.entryLeaderStatus, '请输入 [进境组长确认]');
  140. sa.checkNull(m.entryCustomsStatus, '请输入 [进境报关企业确认]');
  141. sa.checkNull(m.entryNo, '请输入 [进境申报单号]');
  142. sa.checkNull(m.entryTime, '请输入 [进境申报时间]');
  143. sa.checkNull(m.entryResult, '请输入 [进境申报结果]');
  144. sa.checkNull(m.entryFailReason, '请输入 [进境申报失败理由]');
  145. sa.checkNull(m.importPeopleStatus, '请输入 [进口边民确认]');
  146. sa.checkNull(m.importLeaderStatus, '请输入 [进口组长确认]');
  147. sa.checkNull(m.importNumber, '请输入 [进口申报单号]');
  148. sa.checkNull(m.importTime, '请输入 [进口申报时间]');
  149. sa.checkNull(m.isDelivery, '请输入 [是否收货]');
  150. sa.checkNull(m.orderFinish, '请输入 [订单完成状态]');
  151. sa.checkNull(m.driverId, '请输入 [司机ID]');
  152. sa.checkNull(m.driverName, '请输入 [司机名称]');
  153. sa.checkNull(m.driverPhone, '请输入 [司机电话]');
  154. sa.checkNull(m.carId, '请输入 [车ID]');
  155. sa.checkNull(m.carType, '请输入 [车名称]');
  156. sa.checkNull(m.vehiclePlate, '请输入 [车牌号]');
  157. sa.checkNull(m.loadingAddress, '请输入 [装货地址]');
  158. sa.checkNull(m.unloadingAddress, '请输入 [卸货地址]');
  159. sa.checkNull(m.createBy, '请输入 [创建人编号]');
  160. sa.checkNull(m.createName, '请输入 [创建人名称]');
  161. sa.checkNull(m.createTime, '请输入 [创建时间]');
  162. sa.checkNull(m.updateBy, '请输入 [更新人编号]');
  163. sa.checkNull(m.updateName, '请输入 [更新人名称]');
  164. sa.checkNull(m.updateTime, '请输入 [更新时间]');
  165. sa.checkNull(m.deleteStatus, '请输入 [删除状态]');
  166. // 开始增加或修改
  167. if(this.id <= 0) { // 添加
  168. sa.ajax('/TbCollageOrders/add', m, function(res){
  169. sa.alert('增加成功', this.clean);
  170. }.bind(this));
  171. } else { // 修改
  172. sa.ajax('/TbCollageOrders/update', m, function(res){
  173. sa.alert('修改成功', this.clean);
  174. }.bind(this));
  175. }
  176. },
  177. // 添加/修改 完成后的动作
  178. clean: function() {
  179. if(this.id == 0) {
  180. this.m = this.createModel();
  181. } else {
  182. parent.app.f5(); // 刷新父页面列表
  183. sa.closeCurrIframe(); // 关闭本页
  184. }
  185. }
  186. },
  187. mounted: function(){
  188. // 初始化数据
  189. if(this.id <= 0) {
  190. this.m = this.createModel();
  191. } else {
  192. sa.ajax('/TbCollageOrders/getById?id=' + this.id, function(res) {
  193. this.m = res.data;
  194. if(res.data == null) {
  195. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  196. }
  197. }.bind(this))
  198. }
  199. }
  200. })
  201. </script>
  202. </body>
  203. </html>