listing-management-order.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>边民订单表-列表</title>
  5. <meta 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. hr {
  18. border: none; /* 移除默认边框 */
  19. height: 1px; /* 设置高度 */
  20. background-color: gainsboro;/* 设置颜色 */
  21. margin: 5px 0; /* 设置上下外边距 */
  22. }
  23. .c-panel .el-form .c-label{width: 7em !important;}
  24. .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
  25. </style>
  26. </head>
  27. <body>
  28. <div class="vue-box" style="display: none;" :style="'display: block;'">
  29. <div class="c-panel">
  30. <el-form v-if="bigData">
  31. <el-row style="margin-left: 200px;">
  32. <el-col span="12">
  33. <sa-info name="商铺" br>{{bigData.shopName}}</sa-info>
  34. <sa-info name="商品名称" br>{{bigData.goodsNames}}</sa-info>
  35. <sa-info name="总金额" br>{{bigData.sumAmt}}</sa-info>
  36. </el-col>
  37. <el-col span="12">
  38. <sa-info name="车牌号" br>{{bigData.veNo}}</sa-info>
  39. <sa-info name="互市区" br>{{bigData.fieldName}}</sa-info>
  40. <sa-info name="创建时间" br>{{bigData.createTime}}</sa-info>
  41. </el-col>
  42. </el-row>
  43. </el-form>
  44. <hr>
  45. <el-form ref="form" :model='p' @submit.native.prevent>
  46. <div style="margin: 15px 0px 15px 0px;">详情-边民订单</div>
  47. <el-button type="primary" style="margin-bottom:10px;" @click="editPriceByIds()">批量修改总价</el-button>
  48. </el-form>
  49. <!-- ------------- 数据列表 ------------- -->
  50. <el-table class="data-table" ref="data-table" :data="dataList" >
  51. <sa-td type="selection"></sa-td>
  52. <sa-td name="订单号" prop="tradeNo" width="180px"></sa-td>
  53. <sa-td name="买家" prop="buyUserName" ></sa-td>
  54. <sa-td name="商家名称" prop="enterpriseName" ></sa-td>
  55. <sa-td name="商品名称" prop="goodsNames" ></sa-td>
  56. <sa-td name="总重量" prop="totalWeight" ></sa-td>
  57. <sa-td name="车牌号" prop="veNo" ></sa-td>
  58. <sa-td name="总金额" prop="totalPrice" ></sa-td>
  59. <sa-td name="上架金额(元)" prop="upPrice" ></sa-td>
  60. <sa-td name="状态" prop="upPrice" >
  61. <template slot-scope="s">
  62. <div v-if="s.row.upStatus==2">已上架</div>
  63. <div v-else>未上架</div>
  64. </template>
  65. </sa-td>
  66. <el-table-column label="操作" fixed="right" width="200px">
  67. <template slot-scope="s">
  68. <el-button
  69. class="c-btn" type="success" icon="el-icon-view" @click="editPrice(s.row)">修改总价</el-button>
  70. <el-button
  71. class="c-btn" type="primary" icon="el-icon-plus" @click="resale(s.row)">转售二级</el-button>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <!-- ------------- 分页 ------------- -->
  76. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  77. </div>
  78. <el-dialog :title="resaleModel.title" :visible.sync="resaleModel.visible" width="500px">
  79. <div>
  80. 当前价格(元):{{resaleModel.form.upPrice}}
  81. </div>
  82. <sa-item type="num" name="金额" v-model="resaleModel.form.selPrice" placeholder="确认金额" br></sa-item>
  83. <span slot="footer" class="dialog-footer">
  84. <el-button @click="resaleModel.visible = false">取 消</el-button>
  85. <el-button type="primary" @click="sel">转售二级</el-button>
  86. </span>
  87. </el-dialog>
  88. <el-dialog :title="model.title" :visible.sync="model.visible" width="500px">
  89. <div>
  90. 当前价格(元):{{model.form.upPrice}}
  91. </div>
  92. <sa-item type="num" name="金额" v-model="model.form.selPrice" placeholder="确认金额" br></sa-item>
  93. <span slot="footer" class="dialog-footer">
  94. <el-button @click="model.visible = false">取 消</el-button>
  95. <el-button type="primary" @click="save">保存</el-button>
  96. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  97. </span>
  98. </el-dialog>
  99. <el-dialog :title="model1.title" :visible.sync="model1.visible" width="500px">
  100. <sa-item type="num" name="金额" v-model="model1.selPrice" placeholder="确认金额" br></sa-item>
  101. <span slot="footer" class="dialog-footer">
  102. <el-button @click="model1.visible = false">取 消</el-button>
  103. <el-button type="primary" @click="savePriceByIds">保存</el-button>
  104. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  105. </span>
  106. </el-dialog>
  107. </div>
  108. <script>
  109. var app = new Vue({
  110. components: {
  111. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  112. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  113. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
  114. },
  115. el: '.vue-box',
  116. data: {
  117. id: sa.p('id', 0),
  118. bigData: [],
  119. model: {
  120. title: '修改价格',
  121. visible: false,
  122. form: {
  123. id:'',
  124. upPrice:'',
  125. selPrice:0
  126. }
  127. },
  128. model1: {
  129. title: '批量修改订单价格',
  130. visible: false,
  131. ids:'',
  132. selPrice:0
  133. },
  134. resaleModel: {
  135. title: '修改价格',
  136. visible: false,
  137. form: {
  138. id:'',
  139. upPrice:'',
  140. selPrice:0
  141. }
  142. },
  143. p: { // 查询参数
  144. tradeNo: '', // 订单号
  145. buyUserName: '', // 买家
  146. enterpriseName: '', // 商家名称
  147. platSeqNo: sa.p('platSeqNo', 0),
  148. pageNo: 1, // 当前页
  149. pageSize: 20, // 页大小
  150. sortType: 0 // 排序方式
  151. },
  152. dataCount: 0,
  153. dataList: [], // 数据集合
  154. },
  155. methods: {
  156. // 批量修改总价
  157. editPriceByIds: function() {
  158. // 获取选中元素的id列表
  159. let selection = this.$refs['data-table'].selection;
  160. let ids = sa.getArrayField(selection, 'id');
  161. if(selection.length == 0) {
  162. return sa.msg('请至少选择一条数据')
  163. }
  164. let selectList = [];
  165. selectList = this.dataList.filter(item => ids.includes(item.id));
  166. for (let i = 0; i < selectList.length; i++) {
  167. if(selectList[i].upStatus != 2) {
  168. return sa.msg('当前选中数据包含未上架订单,不可修改总价,请重新选择!');
  169. }
  170. if(selectList[i].resaleStatus != 0) {
  171. return sa.msg('当前选中数据包含已转售订单,不可修改总价,请重新选择!')
  172. }
  173. }
  174. this.model1={
  175. title:'批量修改订单价格',
  176. visible:true,
  177. ids:ids,
  178. }
  179. },
  180. // 修改总价
  181. editPrice(item){
  182. this.model={
  183. title:'修改订单【'+item.tradeNo+'】价格',
  184. visible:true,
  185. form:item
  186. }
  187. },
  188. savePriceByIds() {
  189. let ids=this.model1.ids;
  190. if(!ids){
  191. sa.error('当前没有选择数据,请至少选择一条数据')
  192. return;
  193. }
  194. let price=this.model1.selPrice;
  195. if(!price){
  196. sa.error('请输入金额')
  197. return;
  198. }
  199. sa.ajax('/level-one-server/TbOrder/editUpPriceByIds', {ids:ids.toString(),price:price}, function(res) {
  200. this.f5();
  201. this.model1.visible=false;
  202. }.bind(this));
  203. },
  204. save(){
  205. let price=this.model.form.selPrice;
  206. if(!price){
  207. sa.error('请输入金额')
  208. return;
  209. }
  210. sa.ajax('/level-one-server/TbOrder/editUpPrice', {id:this.model.form.id,price:price}, function(res) {
  211. this.f5();
  212. this.model.visible=false;
  213. }.bind(this));
  214. },
  215. // 转售二级
  216. resale(item){
  217. this.resaleModel={
  218. title:'修改订单【'+item.tradeNo+'】价格',
  219. visible:true,
  220. form:item
  221. }
  222. },
  223. sel(){
  224. let price=this.resaleModel.form.selPrice;
  225. console.log("---sel="+price)
  226. if(!price){
  227. sa.error('请输入金额')
  228. return;
  229. }
  230. sa.ajax('/level-two-server/TbOrders/addOrderByResale', {id:this.resaleModel.form.id,resalePrice:price}, function(res) {
  231. this.f5();
  232. this.resaleModel.visible=false;
  233. }.bind(this));
  234. },
  235. // 刷新
  236. f5: function() {
  237. sa.ajax('/level-one-server/TbOrder/getList', sa.removeNull(this.p), function(res) {
  238. this.dataList = res.data; // 数据
  239. this.dataCount = res.dataCount; // 数据总数
  240. sa.f5TableHeight(); // 刷新表格高度
  241. }.bind(this));
  242. },
  243. // 查看银行回执
  244. getBank: function(data) {
  245. sa.showIframe('银行回执', 'tb-order-bank-list.html?tradeNo=' + bigData.tradeNo, '1300px', '90%');
  246. }
  247. },
  248. created: function() {
  249. this.f5();
  250. sa.ajax('/level-one-server/HtTradeSettlement/getById', {id : this.id}, function(res) {
  251. this.bigData = res.data; // 数据
  252. sa.f5TableHeight(); // 刷新表格高度
  253. }.bind(this));
  254. sa.onInputEnter();
  255. }
  256. })
  257. </script>
  258. </body>
  259. </html>