listing-management-order.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>边民订单表-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. <style type="text/css">
  18. hr {
  19. border: none;
  20. /* 移除默认边框 */
  21. height: 1px;
  22. /* 设置高度 */
  23. background-color: gainsboro;
  24. /* 设置颜色 */
  25. margin: 5px 0;
  26. /* 设置上下外边距 */
  27. }
  28. .c-panel .el-form .c-label {
  29. width: 7em !important;
  30. }
  31. .c-panel .el-form .el-input,
  32. .c-panel .el-form .el-textarea__inner {
  33. width: 150px;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38. <div class="vue-box" style="display: none;" :style="'display: block;'">
  39. <div class="c-panel">
  40. <el-form v-if="bigData">
  41. <el-row style="margin-left: 200px;">
  42. <el-col span="12">
  43. <sa-info name="商铺" br>{{bigData.shopName}}</sa-info>
  44. <sa-info name="商品名称" br>{{bigData.goodsNames}}</sa-info>
  45. <sa-info name="总金额" br>{{bigData.sumAmt}}</sa-info>
  46. </el-col>
  47. <el-col span="12">
  48. <sa-info name="车牌号" br>{{bigData.veNo}}</sa-info>
  49. <sa-info name="互市区" br>{{bigData.fieldName}}</sa-info>
  50. <sa-info name="创建时间" br>{{bigData.createTime}}</sa-info>
  51. </el-col>
  52. </el-row>
  53. </el-form>
  54. <el-divider content-position="left">边民订单-列表</el-divider>
  55. <el-form ref="form" :model='p' @submit.native.prevent>
  56. <sa-item name="上架状态">
  57. <el-select v-model="p.upStatus" style="width: 120px;">
  58. <el-option label="全部" value=""></el-option>
  59. <el-option label="未上架" value="1"></el-option>
  60. <el-option label="已上架" value="2"></el-option>
  61. </el-select>
  62. </sa-item>
  63. <sa-item name="转售状态">
  64. <el-select v-model="p.resaleStatus" style="width: 120px;">
  65. <el-option label="全部" value=""></el-option>
  66. <el-option label="未转售" value="0"></el-option>
  67. <el-option label="已转售" value="1"></el-option>
  68. </el-select>
  69. </sa-item>
  70. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  71. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  72. </el-form>
  73. <el-form ref="form" :model='p' @submit.native.prevent>
  74. <el-button v-if="sa.isAuth('tb-order-edit-price')" type="primary" style="margin-bottom:10px;"
  75. @click="editPriceByIds()">批量修改总价</el-button>
  76. <el-button v-if="sa.isAuth('tb-order-edit-price')" type="primary" style="margin-bottom:10px;"
  77. @click="saleBatch()">批量转售</el-button>
  78. </el-form>
  79. <div style="display: flex;padding: 10px;font-size: 16px;">
  80. <div>订单总数:{{dataCount}};</div>
  81. <div style="margin-left: 10px;">已上架:{{statics.upSize}};</div>
  82. <div style="margin-left: 10px;">未上架:<span style="color:red">{{statics.notUpSize}}</span>;</div>
  83. <div style="margin-left: 10px;">上架总金额:<span style="color:red;font-weight: bold;">{{statics.upTotalPrice}}元</span>;</div>
  84. <div style="margin-left: 10px;">已转售:{{statics.saleSize}};</div>
  85. <div style="margin-left: 10px;">未转售:<span style="color:red">{{statics.notSaleSize}}</span></div>
  86. </div>
  87. <!-- ------------- 数据列表 ------------- -->
  88. <el-table class="data-table" ref="data-table" :data="dataList">
  89. <sa-td type="selection"></sa-td>
  90. <sa-td name="车牌号" prop="veNo"></sa-td>
  91. <sa-td name="订单号" prop="tradeNo" width="180px"></sa-td>
  92. <sa-td name="买家" prop="buyUserName"></sa-td>
  93. <sa-td name="商家名称" prop="enterpriseName" width="280px"></sa-td>
  94. <sa-td name="商品名称" prop="goodsNames" width="200px"></sa-td>
  95. <sa-td name="净重(kg)" prop="netWt"></sa-td>
  96. <sa-td name="总金额" prop="totalPrice"></sa-td>
  97. <sa-td name="上架金额(元)" prop="upPrice"></sa-td>
  98. <sa-td name="是否上架" prop="upStatus">
  99. <template slot-scope="s">
  100. <div v-if="s.row.upStatus==2">已上架</div>
  101. <div v-else>未上架</div>
  102. </template>
  103. </sa-td>
  104. <sa-td name="是否转售" prop="resaleStatus">
  105. <template slot-scope="s">
  106. <div v-if="s.row.resaleStatus==1">已转售</div>
  107. <div v-else>未转售</div>
  108. </template>
  109. </sa-td>
  110. <sa-td name="销售状态" prop="beingOrder"><!--订单转售后是否在二级市场被下单-->
  111. <template slot-scope="s">
  112. <div v-if="s.row.beingOrder==1">已销售</div>
  113. <div v-else>未销售</div>
  114. </template>
  115. </sa-td>
  116. <el-table-column label="操作" fixed="right" width="100px">
  117. <template slot-scope="s">
  118. <div>
  119. <el-button
  120. v-if="s.row.upStatus==2&&s.row.resaleStatus==0&&sa.isAuth('tb-order-edit-price')"
  121. class="c-btn" type="success" icon="el-icon-view"
  122. @click="editPrice(s.row)">修改总价</el-button>
  123. <el-button v-else :disabled="true" class="c-btn" type="success" icon="el-icon-view"
  124. @click="editPrice(s.row)">修改总价</el-button>
  125. </div>
  126. <div>
  127. <el-button
  128. v-if="s.row.upStatus==2&&s.row.resaleStatus==0&&sa.isAuth('tb-order-edit-price')"
  129. class="c-btn" type="primary" icon="el-icon-plus"
  130. @click="sel(s.row)">转售二级</el-button>
  131. <el-button v-else :disabled="true" class="c-btn" type="primary" icon="el-icon-plus"
  132. @click="sel(s.row)">转售二级</el-button>
  133. </div>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. <!-- ------------- 分页 ------------- -->
  138. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
  139. @change="f5()"></sa-item>
  140. </div>
  141. <el-dialog :title="model.title" :visible.sync="model.visible" width="500px">
  142. <div>
  143. 当前价格(元):{{model.form.upPrice}}
  144. </div>
  145. <sa-item type="num" name="金额" v-model="model.form.selPrice" placeholder="确认金额" br></sa-item>
  146. <span slot="footer" class="dialog-footer">
  147. <el-button @click="model.visible = false">取 消</el-button>
  148. <el-button type="primary" @click="save">保存</el-button>
  149. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  150. </span>
  151. </el-dialog>
  152. <el-dialog :title="model1.title" :visible.sync="model1.visible" width="500px">
  153. <sa-item type="num" name="金额" v-model="model1.selPrice" placeholder="确认金额" br></sa-item>
  154. <span slot="footer" class="dialog-footer">
  155. <el-button @click="model1.visible = false">取 消</el-button>
  156. <el-button type="primary" @click="savePriceByIds">保存</el-button>
  157. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  158. </span>
  159. </el-dialog>
  160. </div>
  161. <script>
  162. var app = new Vue({
  163. components: {
  164. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  165. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  166. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
  167. },
  168. el: '.vue-box',
  169. data: {
  170. id: sa.p('id', 0),
  171. bigData: [],
  172. model: {
  173. title: '修改价格',
  174. visible: false,
  175. form: {
  176. id: '',
  177. upPrice: '',
  178. selPrice: 0
  179. }
  180. },
  181. statics: {
  182. notSaleSize: '',
  183. notUpSize: '',
  184. saleSize: '',
  185. upSize: '',
  186. upTotalPrice: ''
  187. },
  188. model1: {
  189. title: '批量修改订单价格',
  190. visible: false,
  191. ids: '',
  192. selPrice: 0
  193. },
  194. p: { // 查询参数
  195. tradeNo: '', // 订单号
  196. upStatus: '', // 买家
  197. resaleStatus: '', // 商家名称
  198. saleMainId: sa.p('mainId', 0),
  199. pageNo: 1, // 当前页
  200. pageSize: 20, // 页大小
  201. sortType: 0 // 排序方式
  202. },
  203. dataCount: 0,
  204. dataList: [], // 数据集合
  205. },
  206. methods: {
  207. getStatic() {
  208. sa.ajax('/level-one-server/TbOrder/staticsStatus', {
  209. saleMainId: this.p.saleMainId
  210. }, function(res) {
  211. this.statics=res.data;
  212. }.bind(this));
  213. },
  214. // 批量修改总价
  215. editPriceByIds: function() {
  216. // 获取选中元素的id列表
  217. let selection = this.$refs['data-table'].selection;
  218. let ids = sa.getArrayField(selection, 'id');
  219. if (selection.length == 0) {
  220. return sa.msg('请至少选择一条数据')
  221. }
  222. let selectList = [];
  223. selectList = this.dataList.filter(item => ids.includes(item.id));
  224. for (let i = 0; i < selectList.length; i++) {
  225. if (selectList[i].upStatus != 2) {
  226. return sa.msg('当前选中数据包含未上架订单,不可修改总价,请重新选择!');
  227. }
  228. if (selectList[i].resaleStatus != 0) {
  229. return sa.msg('当前选中数据包含已转售订单,不可修改总价,请重新选择!')
  230. }
  231. }
  232. this.model1 = {
  233. title: '批量修改订单价格',
  234. visible: true,
  235. ids: ids,
  236. }
  237. },
  238. // 修改总价
  239. editPrice(item) {
  240. this.model = {
  241. title: '修改订单【' + item.tradeNo + '】价格',
  242. visible: true,
  243. form: item
  244. }
  245. },
  246. savePriceByIds() {
  247. let ids = this.model1.ids;
  248. if (!ids) {
  249. sa.error('当前没有选择数据,请至少选择一条数据')
  250. return;
  251. }
  252. let price = this.model1.selPrice;
  253. if (!price) {
  254. sa.error('请输入金额')
  255. return;
  256. }
  257. sa.ajax('/level-one-server/TbOrder/editUpPriceByIds', {
  258. ids: ids.toString(),
  259. price: price
  260. }, function(res) {
  261. this.f5();
  262. this.model1.visible = false;
  263. }.bind(this));
  264. },
  265. save() {
  266. let price = this.model.form.selPrice;
  267. if (!price) {
  268. sa.error('请输入金额')
  269. return;
  270. }
  271. sa.ajax('/level-one-server/TbOrder/editUpPrice', {
  272. id: this.model.form.id,
  273. price: price
  274. }, function(res) {
  275. this.f5();
  276. this.model.visible = false;
  277. }.bind(this));
  278. },
  279. // 转售二级
  280. sel(item) {
  281. if (!item.upPrice) {
  282. sa.error('转售价格不能为空')
  283. return;
  284. }
  285. sa.confirm('是否转售到二级市场?', function() {
  286. sa.ajax('/level-two-server/TbOrders/addOrderByResale', {
  287. id: item.id,
  288. resalePrice: item.upPrice
  289. }, function(res) {
  290. this.f5();
  291. }.bind(this));
  292. }.bind(this));
  293. },
  294. saleBatch() {
  295. // 获取选中元素的id列表
  296. let selection = this.$refs['data-table'].selection;
  297. for (let i in selection) {
  298. let item = selection[i];
  299. if (!item.upPrice) {
  300. sa.error(item.tradeNo + '转售价格不能为空')
  301. return;
  302. }
  303. if (item.resaleStatus == 1) {
  304. sa.error(item.tradeNo + '已转售')
  305. return;
  306. }
  307. }
  308. let ids = sa.getArrayField(selection, 'id');
  309. if (selection.length == 0) {
  310. return sa.msg('请至少选择一条数据')
  311. }
  312. sa.confirm('是否转售到二级市场?', function() {
  313. sa.ajax('/level-two-server/TbOrders/addOrderByResaleBatch', {
  314. ids: ids.join(',')
  315. }, function(res) {
  316. this.f5();
  317. }.bind(this));
  318. }.bind(this));
  319. },
  320. // 刷新
  321. f5: function() {
  322. this.getStatic();
  323. sa.ajax('/level-one-server/TbOrder/getList', sa.removeNull(this.p), function(res) {
  324. this.dataList = res.data; // 数据
  325. this.dataCount = res.dataCount; // 数据总数
  326. sa.f5TableHeight(); // 刷新表格高度
  327. }.bind(this));
  328. },
  329. // 查看银行回执
  330. getBank: function(data) {
  331. sa.showIframe('银行回执', 'tb-order-bank-list.html?tradeNo=' + bigData.tradeNo, '1300px', '90%');
  332. }
  333. },
  334. created: function() {
  335. this.f5();
  336. sa.ajax('/level-one-server/HtTradeSettlement/getById', {
  337. id: this.id
  338. }, function(res) {
  339. this.bigData = res.data; // 数据
  340. sa.f5TableHeight(); // 刷新表格高度
  341. }.bind(this));
  342. sa.onInputEnter();
  343. }
  344. })
  345. </script>
  346. </body>
  347. </html>