listing-management-order.html 9.3 KB

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