listing-management-order.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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 v-if="sa.isAuth('tb-order-edit-price')"
  48. type="primary" style="margin-bottom:10px;" @click="editPriceByIds()">批量修改总价</el-button>
  49. </el-form>
  50. <!-- ------------- 数据列表 ------------- -->
  51. <el-table class="data-table" ref="data-table" :data="dataList" >
  52. <sa-td type="selection"></sa-td>
  53. <sa-td name="订单号" prop="tradeNo" width="180px"></sa-td>
  54. <sa-td name="买家" prop="buyUserName" ></sa-td>
  55. <sa-td name="商家名称" prop="enterpriseName" width="280px"></sa-td>
  56. <sa-td name="商品名称" prop="goodsNames" width="200px"></sa-td>
  57. <sa-td name="总重量" prop="totalWeight" ></sa-td>
  58. <sa-td name="车牌号" prop="veNo" ></sa-td>
  59. <sa-td name="总金额" prop="totalPrice" ></sa-td>
  60. <sa-td name="上架金额(元)" prop="upPrice" ></sa-td>
  61. <sa-td name="是否上架" prop="upStatus" >
  62. <template slot-scope="s">
  63. <div v-if="s.row.upStatus==2">已上架</div>
  64. <div v-else>未上架</div>
  65. </template>
  66. </sa-td>
  67. <sa-td name="是否转售" prop="resaleStatus" >
  68. <template slot-scope="s">
  69. <div v-if="s.row.resaleStatus==1">已转售</div>
  70. <div v-else>未转售</div>
  71. </template>
  72. </sa-td>
  73. <el-table-column label="操作" fixed="right" width="200px">
  74. <template slot-scope="s">
  75. <el-button v-if="s.row.upStatus==2&&s.row.resaleStatus==0&&sa.isAuth('tb-order-edit-price')"
  76. class="c-btn" type="success" icon="el-icon-view" @click="editPrice(s.row)">修改总价</el-button>
  77. <el-button v-if="s.row.upStatus==2&&s.row.resaleStatus==0&&sa.isAuth('tb-order-edit-price')"
  78. class="c-btn" type="primary" icon="el-icon-plus" @click="sel(s.row)">转售二级</el-button>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <!-- ------------- 分页 ------------- -->
  83. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  84. </div>
  85. <el-dialog :title="model.title" :visible.sync="model.visible" width="500px">
  86. <div>
  87. 当前价格(元):{{model.form.upPrice}}
  88. </div>
  89. <sa-item type="num" name="金额" v-model="model.form.selPrice" placeholder="确认金额" br></sa-item>
  90. <span slot="footer" class="dialog-footer">
  91. <el-button @click="model.visible = false">取 消</el-button>
  92. <el-button type="primary" @click="save">保存</el-button>
  93. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  94. </span>
  95. </el-dialog>
  96. <el-dialog :title="model1.title" :visible.sync="model1.visible" width="500px">
  97. <sa-item type="num" name="金额" v-model="model1.selPrice" placeholder="确认金额" br></sa-item>
  98. <span slot="footer" class="dialog-footer">
  99. <el-button @click="model1.visible = false">取 消</el-button>
  100. <el-button type="primary" @click="savePriceByIds">保存</el-button>
  101. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  102. </span>
  103. </el-dialog>
  104. </div>
  105. <script>
  106. var app = new Vue({
  107. components: {
  108. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  109. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  110. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
  111. },
  112. el: '.vue-box',
  113. data: {
  114. id: sa.p('id', 0),
  115. bigData: [],
  116. model: {
  117. title: '修改价格',
  118. visible: false,
  119. form: {
  120. id:'',
  121. upPrice:'',
  122. selPrice:0
  123. }
  124. },
  125. model1: {
  126. title: '批量修改订单价格',
  127. visible: false,
  128. ids:'',
  129. selPrice:0
  130. },
  131. p: { // 查询参数
  132. tradeNo: '', // 订单号
  133. buyUserName: '', // 买家
  134. enterpriseName: '', // 商家名称
  135. platSeqNo: sa.p('platSeqNo', 0),
  136. pageNo: 1, // 当前页
  137. pageSize: 20, // 页大小
  138. sortType: 0 // 排序方式
  139. },
  140. dataCount: 0,
  141. dataList: [], // 数据集合
  142. },
  143. methods: {
  144. // 批量修改总价
  145. editPriceByIds: function() {
  146. // 获取选中元素的id列表
  147. let selection = this.$refs['data-table'].selection;
  148. let ids = sa.getArrayField(selection, 'id');
  149. if(selection.length == 0) {
  150. return sa.msg('请至少选择一条数据')
  151. }
  152. let selectList = [];
  153. selectList = this.dataList.filter(item => ids.includes(item.id));
  154. for (let i = 0; i < selectList.length; i++) {
  155. if(selectList[i].upStatus != 2) {
  156. return sa.msg('当前选中数据包含未上架订单,不可修改总价,请重新选择!');
  157. }
  158. if(selectList[i].resaleStatus != 0) {
  159. return sa.msg('当前选中数据包含已转售订单,不可修改总价,请重新选择!')
  160. }
  161. }
  162. this.model1={
  163. title:'批量修改订单价格',
  164. visible:true,
  165. ids:ids,
  166. }
  167. },
  168. // 修改总价
  169. editPrice(item){
  170. this.model={
  171. title:'修改订单【'+item.tradeNo+'】价格',
  172. visible:true,
  173. form:item
  174. }
  175. },
  176. savePriceByIds() {
  177. let ids=this.model1.ids;
  178. if(!ids){
  179. sa.error('当前没有选择数据,请至少选择一条数据')
  180. return;
  181. }
  182. let price=this.model1.selPrice;
  183. if(!price){
  184. sa.error('请输入金额')
  185. return;
  186. }
  187. sa.ajax('/level-one-server/TbOrder/editUpPriceByIds', {ids:ids.toString(),price:price}, function(res) {
  188. this.f5();
  189. this.model1.visible=false;
  190. }.bind(this));
  191. },
  192. save(){
  193. let price=this.model.form.selPrice;
  194. if(!price){
  195. sa.error('请输入金额')
  196. return;
  197. }
  198. sa.ajax('/level-one-server/TbOrder/editUpPrice', {id:this.model.form.id,price:price}, function(res) {
  199. this.f5();
  200. this.model.visible=false;
  201. }.bind(this));
  202. },
  203. // 转售二级
  204. sel(item){
  205. sa.confirm('是否转售到二级市场,此操作不可撤销', function(){
  206. sa.ajax('/level-two-server/TbOrders/addOrderByResale', {id:item.id,resalePrice:item.upPrice}, function(res) {
  207. this.f5();
  208. }.bind(this));
  209. }.bind(this));
  210. },
  211. // 刷新
  212. f5: function() {
  213. sa.ajax('/level-one-server/TbOrder/getList', sa.removeNull(this.p), function(res) {
  214. this.dataList = res.data; // 数据
  215. this.dataCount = res.dataCount; // 数据总数
  216. sa.f5TableHeight(); // 刷新表格高度
  217. }.bind(this));
  218. },
  219. // 查看银行回执
  220. getBank: function(data) {
  221. sa.showIframe('银行回执', 'tb-order-bank-list.html?tradeNo=' + bigData.tradeNo, '1300px', '90%');
  222. }
  223. },
  224. created: function() {
  225. this.f5();
  226. sa.ajax('/level-one-server/HtTradeSettlement/getById', {id : this.id}, function(res) {
  227. this.bigData = res.data; // 数据
  228. sa.f5TableHeight(); // 刷新表格高度
  229. }.bind(this));
  230. sa.onInputEnter();
  231. }
  232. })
  233. </script>
  234. </body>
  235. </html>