tb-order-add.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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.tradeAreaId" br></sa-item>
  30. <sa-item type="text" name="" v-model="m.tradeAreaName" br></sa-item>
  31. <sa-item type="text" name="" v-model="m.addressIds" br></sa-item>
  32. <sa-item type="text" name="" v-model="m.saleMainId" br></sa-item>
  33. <sa-item type="text" name="订单号" v-model="m.tradeNo" br></sa-item>
  34. <sa-item type="text" name="买家" v-model="m.buyUserName" br></sa-item>
  35. <sa-item type="num" name="购买用户类型" v-model="m.buyUserType" br></sa-item>
  36. <sa-item type="text" name="商家名称" v-model="m.enterpriseName" br></sa-item>
  37. <sa-item type="text" name="总重量" v-model="m.totalWeight" br></sa-item>
  38. <sa-item type="text" name="总金额" v-model="m.totalPrice" br></sa-item>
  39. <sa-item type="datetime" name="交易时间" v-model="m.tradeTime" br></sa-item>
  40. <sa-item type="enum" name="交易状态" v-model="m.tradeStatus" :jv="{0: '未支付', 1: '已支付'}" jtype="3" br></sa-item>
  41. <sa-item type="text" name="支付方式" v-model="m.payType" br></sa-item>
  42. <sa-item type="text" name="结算时间" v-model="m.settleTime" br></sa-item>
  43. <sa-item type="text" name="当前结算金额" v-model="m.realPrice" br></sa-item>
  44. <sa-item type="text" name="应结金额" v-model="m.shouldPrice" br></sa-item>
  45. <sa-item type="text" name="对账人" v-model="m.settleUserId" br></sa-item>
  46. <sa-item type="text" name="对账人员" v-model="m.recordUserId" br></sa-item>
  47. <sa-item type="text" name="对账时间" v-model="m.recordTime" br></sa-item>
  48. <sa-item type="text" name="是否对账" v-model="m.record" br></sa-item>
  49. <sa-item type="text" name="退款原因" v-model="m.refundReason" br></sa-item>
  50. <sa-item type="text" name="退款时间" v-model="m.refundTime" br></sa-item>
  51. <sa-item type="text" name="" v-model="m.receiveName" br></sa-item>
  52. <sa-item type="text" name="" v-model="m.receivePhone" br></sa-item>
  53. <sa-item type="text" name="" v-model="m.receiveAddress" br></sa-item>
  54. <sa-item type="text" name="出互市区时间" v-model="m.outTime" br></sa-item>
  55. <sa-item type="text" name="商品名称字符串" v-model="m.goodsNames" br></sa-item>
  56. <sa-item type="text" name="是否申报" v-model="m.apply" br></sa-item>
  57. <sa-item type="text" name="申报时间" v-model="m.applyTime" br></sa-item>
  58. <sa-item type="text" name="申报结果" v-model="m.applyResult" br></sa-item>
  59. <sa-item type="text" name="" v-model="m.applyFailReason" br></sa-item>
  60. <sa-item type="enum" name="分配方式" v-model="m.distribution" :jv="{0: '均分', 1: '自选数量'}" jtype="3" br></sa-item>
  61. <sa-item type="enum" name="是否确认" v-model="m.confirm" :jv="{0: '否', 1: '是'}" jtype="3" br></sa-item>
  62. <sa-item type="text" name="是否接单" v-model="m.pick" br></sa-item>
  63. <sa-item type="text" name="接单时间" v-model="m.pickTime" br></sa-item>
  64. <sa-item type="text" name="" v-model="m.shopId" br></sa-item>
  65. <sa-item type="text" name="" v-model="m.shopName" br></sa-item>
  66. <sa-item type="text" name="是否发货" v-model="m.send" br></sa-item>
  67. <sa-item type="text" name="发货时间" v-model="m.sendTime" br></sa-item>
  68. <sa-item type="text" name="对应二级市场中的收购单ID" v-model="m.levelTwoOrderId" br></sa-item>
  69. <sa-item type="text" name="创建时间" v-model="m.createTime" br></sa-item>
  70. <sa-item type="text" name="创建人编号" v-model="m.createBy" br></sa-item>
  71. <sa-item type="text" name="创建人名称" v-model="m.createName" br></sa-item>
  72. <sa-item type="text" name="更新时间" v-model="m.updateTime" br></sa-item>
  73. <sa-item type="text" name="更新人编号" v-model="m.updateBy" br></sa-item>
  74. <sa-item type="text" name="更新人名称" v-model="m.updateName" br></sa-item>
  75. <sa-item type="enum" name="删除状态" v-model="m.deleteStatus" :jv="{0: '禁用', 1: '启用'}" jtype="3" br></sa-item>
  76. <sa-item name="" class="s-ok" br>
  77. <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  78. </sa-item>
  79. </el-form>
  80. </div>
  81. </div>
  82. <!-- ------- 底部按钮 ------- -->
  83. <div class="s-foot">
  84. <el-button type="primary" @click="ok()">确定</el-button>
  85. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  86. </div>
  87. </div>
  88. <script>
  89. var app = new Vue({
  90. components: {
  91. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  92. },
  93. el: '.vue-box',
  94. data: {
  95. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  96. m: null, // 实体对象
  97. },
  98. methods: {
  99. // 创建一个 默认Model
  100. createModel: function() {
  101. return {
  102. id: '', // 主键
  103. tradeAreaId: '', //
  104. tradeAreaName: '', //
  105. addressIds: '', //
  106. saleMainId: '', //
  107. tradeNo: '', // 订单号
  108. buyUserId: '', // 买家ID
  109. buyUserName: '', // 买家
  110. buyUserType: '', // 购买用户类型(3=边民,2=组长)
  111. enterpriseId: '', // 商家ID
  112. enterpriseName: '', // 商家名称
  113. totalWeight: '', // 总重量
  114. totalPrice: '', // 总金额
  115. tradeTime: '', // 交易时间
  116. tradeStatus: '', // 交易状态(0=未支付,1=已支付)
  117. payType: '', // 支付方式(0=金融互助,1=现金刷卡)
  118. settleTime: '', // 结算时间
  119. realPrice: '', // 当前结算金额
  120. shouldPrice: '', // 应结金额
  121. settleUserId: '', // 对账人
  122. recordUserId: '', // 对账人员
  123. recordTime: '', // 对账时间
  124. record: '', // 是否对账(0=否,)
  125. refundReason: '', // 退款原因
  126. refundTime: '', // 退款时间
  127. receiveName: '', //
  128. receivePhone: '', //
  129. receiveAddress: '', //
  130. outTime: '', // 出互市区时间
  131. goodsNames: '', // 商品名称字符串
  132. apply: '', // 是否申报
  133. applyTime: '', // 申报时间
  134. applyResult: '', // 申报结果
  135. applyFailReason: '', //
  136. distribution: '', // 分配方式(0=均分,1=自选数量)
  137. confirm: '', // 是否确认(0=否,1=是)
  138. pick: '', // 是否接单
  139. pickTime: '', // 接单时间
  140. shopId: '', //
  141. shopName: '', //
  142. send: '', // 是否发货
  143. sendTime: '', // 发货时间
  144. levelTwoOrderId: '', // 对应二级市场中的收购单ID
  145. createTime: '', // 创建时间
  146. createBy: '', // 创建人编号
  147. createName: '', // 创建人名称
  148. updateTime: '', // 更新时间
  149. updateBy: '', // 更新人编号
  150. updateName: '', // 更新人名称
  151. deleteStatus: '', // 删除状态(0=禁用,1=启用)
  152. }
  153. },
  154. // 提交数据
  155. ok: function(){
  156. // 表单校验
  157. let m = this.m;
  158. // sa.checkNull(m.id, '请输入 [主键]');
  159. sa.checkNull(m.tradeAreaId, '请输入 []');
  160. sa.checkNull(m.tradeAreaName, '请输入 []');
  161. sa.checkNull(m.addressIds, '请输入 []');
  162. sa.checkNull(m.saleMainId, '请输入 []');
  163. sa.checkNull(m.tradeNo, '请输入 [订单号]');
  164. // sa.checkNull(m.buyUserId, '请输入 [买家ID]');
  165. sa.checkNull(m.buyUserName, '请输入 [买家]');
  166. sa.checkNull(m.buyUserType, '请输入 [购买用户类型]');
  167. // sa.checkNull(m.enterpriseId, '请输入 [商家ID]');
  168. sa.checkNull(m.enterpriseName, '请输入 [商家名称]');
  169. sa.checkNull(m.totalWeight, '请输入 [总重量]');
  170. sa.checkNull(m.totalPrice, '请输入 [总金额]');
  171. sa.checkNull(m.tradeTime, '请输入 [交易时间]');
  172. sa.checkNull(m.tradeStatus, '请输入 [交易状态]');
  173. sa.checkNull(m.payType, '请输入 [支付方式]');
  174. sa.checkNull(m.settleTime, '请输入 [结算时间]');
  175. sa.checkNull(m.realPrice, '请输入 [当前结算金额]');
  176. sa.checkNull(m.shouldPrice, '请输入 [应结金额]');
  177. sa.checkNull(m.settleUserId, '请输入 [对账人]');
  178. sa.checkNull(m.recordUserId, '请输入 [对账人员]');
  179. sa.checkNull(m.recordTime, '请输入 [对账时间]');
  180. sa.checkNull(m.record, '请输入 [是否对账]');
  181. sa.checkNull(m.refundReason, '请输入 [退款原因]');
  182. sa.checkNull(m.refundTime, '请输入 [退款时间]');
  183. sa.checkNull(m.receiveName, '请输入 []');
  184. sa.checkNull(m.receivePhone, '请输入 []');
  185. sa.checkNull(m.receiveAddress, '请输入 []');
  186. sa.checkNull(m.outTime, '请输入 [出互市区时间]');
  187. sa.checkNull(m.goodsNames, '请输入 [商品名称字符串]');
  188. sa.checkNull(m.apply, '请输入 [是否申报]');
  189. sa.checkNull(m.applyTime, '请输入 [申报时间]');
  190. sa.checkNull(m.applyResult, '请输入 [申报结果]');
  191. sa.checkNull(m.applyFailReason, '请输入 []');
  192. sa.checkNull(m.distribution, '请输入 [分配方式]');
  193. sa.checkNull(m.confirm, '请输入 [是否确认]');
  194. sa.checkNull(m.pick, '请输入 [是否接单]');
  195. sa.checkNull(m.pickTime, '请输入 [接单时间]');
  196. sa.checkNull(m.shopId, '请输入 []');
  197. sa.checkNull(m.shopName, '请输入 []');
  198. sa.checkNull(m.send, '请输入 [是否发货]');
  199. sa.checkNull(m.sendTime, '请输入 [发货时间]');
  200. sa.checkNull(m.levelTwoOrderId, '请输入 [对应二级市场中的收购单ID]');
  201. sa.checkNull(m.createTime, '请输入 [创建时间]');
  202. sa.checkNull(m.createBy, '请输入 [创建人编号]');
  203. sa.checkNull(m.createName, '请输入 [创建人名称]');
  204. sa.checkNull(m.updateTime, '请输入 [更新时间]');
  205. sa.checkNull(m.updateBy, '请输入 [更新人编号]');
  206. sa.checkNull(m.updateName, '请输入 [更新人名称]');
  207. sa.checkNull(m.deleteStatus, '请输入 [删除状态]');
  208. // 开始增加或修改
  209. if(this.id <= 0) { // 添加
  210. sa.ajax('/level-one-server/TbOrder/add', m, function(res){
  211. sa.alert('增加成功', this.clean);
  212. }.bind(this));
  213. } else { // 修改
  214. sa.ajax('/level-one-server/TbOrder/update', m, function(res){
  215. sa.alert('修改成功', this.clean);
  216. }.bind(this));
  217. }
  218. },
  219. // 添加/修改 完成后的动作
  220. clean: function() {
  221. if(this.id == 0) {
  222. this.m = this.createModel();
  223. } else {
  224. parent.app.f5(); // 刷新父页面列表
  225. sa.closeCurrIframe(); // 关闭本页
  226. }
  227. }
  228. },
  229. mounted: function(){
  230. // 初始化数据
  231. if(this.id <= 0) {
  232. this.m = this.createModel();
  233. } else {
  234. sa.ajax('/level-one-server/TbOrder/getById?id=' + this.id, function(res) {
  235. this.m = res.data;
  236. if(res.data == null) {
  237. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  238. }
  239. }.bind(this))
  240. }
  241. }
  242. })
  243. </script>
  244. </body>
  245. </html>