listing-management-order.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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. <div>
  57. <sa-item name="上架状态">
  58. <el-select v-model="p.upStatus" style="width: 120px;">
  59. <el-option label="全部" value=""></el-option>
  60. <el-option label="未上架" value="1"></el-option>
  61. <el-option label="已上架" value="2"></el-option>
  62. </el-select>
  63. </sa-item>
  64. <sa-item name="转售状态">
  65. <el-select v-model="p.resaleStatus" style="width: 120px;">
  66. <el-option label="全部" value=""></el-option>
  67. <el-option label="未转售" value="0"></el-option>
  68. <el-option label="已转售" value="1"></el-option>
  69. </el-select>
  70. </sa-item>
  71. </div>
  72. <div>
  73. <sa-item name="销售状态">
  74. <el-select v-model="p.beingOrder" style="width: 120px;">
  75. <el-option label="全部" value=""></el-option>
  76. <el-option label="未销售" value="0"></el-option>
  77. <el-option label="已销售" value="1"></el-option>
  78. </el-select>
  79. </sa-item>
  80. <sa-item type="text" name="边民" v-model="p.buyUserName" width="11em"></sa-item>
  81. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  82. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  83. <el-button v-if="sa.isAuth('tb-order-edit-price')" type="primary" style="margin-bottom:10px;"
  84. @click="editPriceByIds()">批量修改总价</el-button>
  85. <el-button v-if="sa.isAuth('tb-order-edit-price')" type="primary" style="margin-bottom:10px;"
  86. @click="saleBatch()">批量转售</el-button>
  87. <el-button v-if="sa.isAuth('tb-order-edit-price')" type="warning" style="margin-bottom:10px;"
  88. @click="callBackSleBatch()">批量撤销转售</el-button>
  89. </div>
  90. </el-form>
  91. <div style="display: flex;padding: 10px;font-size: 16px;">
  92. <div>订单总数:{{dataCount}};</div>
  93. <div style="margin-left: 10px;">已上架:{{statics.upSize}};</div>
  94. <div style="margin-left: 10px;">未上架:<span style="color:red">{{statics.notUpSize}}</span>;</div>
  95. <div style="margin-left: 10px;">上架总金额:<span
  96. style="color:red;font-weight: bold;">{{statics.upTotalPrice}}元</span>;</div>
  97. <div style="margin-left: 10px;">已转售:{{statics.saleSize}};</div>
  98. <div style="margin-left: 10px;">未转售:<span style="color:red">{{statics.notSaleSize}}</span></div>
  99. </div>
  100. <!-- ------------- 数据列表 ------------- -->
  101. <el-table class="data-table" ref="data-table" :data="dataList">
  102. <sa-td type="selection"></sa-td>
  103. <sa-td name="车牌号" prop="veNo"></sa-td>
  104. <sa-td name="边民" prop="buyUserName"></sa-td>
  105. <sa-td name="商品名称" prop="goodsNames" width="200px"></sa-td>
  106. <sa-td name="净重(kg)" prop="netWt"></sa-td>
  107. <sa-td name="总金额" prop="totalPrice"></sa-td>
  108. <sa-td name="上架金额(元)" prop="upPrice" width="180"></sa-td>
  109. <sa-td name="边民确认" prop="peopleConfirmStatus">
  110. <template slot-scope="s">
  111. <div v-if="s.row.peopleConfirmStatus==1">已确认</div>
  112. <div v-else>未确认</div>
  113. </template>
  114. </sa-td>
  115. <sa-td name="是否上架" prop="upStatus">
  116. <template slot-scope="s">
  117. <div v-if="s.row.upStatus==2">已上架</div>
  118. <div v-else>未上架</div>
  119. </template>
  120. </sa-td>
  121. <sa-td name="是否转售" prop="resaleStatus">
  122. <template slot-scope="s">
  123. <div v-if="s.row.resaleStatus==1">已转售</div>
  124. <div v-else>未转售</div>
  125. </template>
  126. </sa-td>
  127. <sa-td name="销售状态" prop="beingOrder"><!--订单转售后是否在二级市场被下单-->
  128. <template slot-scope="s">
  129. <div v-if="s.row.beingOrder==1">已销售</div>
  130. <div v-else>未销售</div>
  131. </template>
  132. </sa-td>
  133. <el-table-column label="操作" fixed="right" width="150px">
  134. <template slot-scope="s">
  135. <div>
  136. <el-button
  137. v-if="s.row.upStatus==2&&s.row.resaleStatus==0&&sa.isAuth('tb-order-edit-price')"
  138. class="c-btn" type="success" @click="editPrice(s.row)">修改总价</el-button>
  139. <el-button
  140. v-if="s.row.peopleConfirmStatus==1&&s.row.upStatus==2&&s.row.resaleStatus==0&&sa.isAuth('tb-order-edit-price')"
  141. class="c-btn" type="primary" @click="sel(s.row)">转售二级</el-button>
  142. <el-button
  143. v-if="s.row.beingOrder==0&&s.row.peopleConfirmStatus==1&&s.row.upStatus==2&&s.row.resaleStatus==1&&sa.isAuth('tb-order-edit-price')"
  144. class="c-btn" type="warning" @click="callBackSel(s.row)">撤销转售</el-button>
  145. </div>
  146. </template>
  147. </el-table-column>
  148. </el-table>
  149. <!-- ------------- 分页 ------------- -->
  150. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
  151. @change="f5()"></sa-item>
  152. </div>
  153. <el-dialog :title="model.title" :visible.sync="model.visible" width="500px">
  154. <div>
  155. 当前价格(元):{{model.form.upPrice}}
  156. </div>
  157. <sa-item type="num" name="金额" v-model="model.form.selPrice" placeholder="确认金额" br></sa-item>
  158. <span slot="footer" class="dialog-footer">
  159. <el-button @click="model.visible = false">取 消</el-button>
  160. <el-button type="primary" @click="save">保存</el-button>
  161. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  162. </span>
  163. </el-dialog>
  164. <el-dialog :title="model1.title" :visible.sync="model1.visible" width="500px">
  165. <sa-item type="num" name="金额" v-model="model1.selPrice" placeholder="确认金额" br></sa-item>
  166. <span slot="footer" class="dialog-footer">
  167. <el-button @click="model1.visible = false">取 消</el-button>
  168. <el-button type="primary" @click="savePriceByIds">保存</el-button>
  169. <!--<el-button type="primary" @click="sel">转售二级</el-button>-->
  170. </span>
  171. </el-dialog>
  172. </div>
  173. <script>
  174. var app = new Vue({
  175. components: {
  176. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  177. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  178. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
  179. },
  180. el: '.vue-box',
  181. data: {
  182. id: sa.p('id', 0),
  183. bigData: [],
  184. model: {
  185. title: '修改价格',
  186. visible: false,
  187. form: {
  188. id: '',
  189. upPrice: '',
  190. selPrice: 0
  191. }
  192. },
  193. statics: {
  194. notSaleSize: '',
  195. notUpSize: '',
  196. saleSize: '',
  197. upSize: '',
  198. upTotalPrice: ''
  199. },
  200. model1: {
  201. title: '批量修改订单价格',
  202. visible: false,
  203. ids: '',
  204. selPrice: 0
  205. },
  206. p: { // 查询参数
  207. tradeNo: '', // 订单号
  208. upStatus: '', // 买家
  209. resaleStatus: '', // 商家名称
  210. saleMainId: sa.p('mainId', 0),
  211. pageNo: 1, // 当前页
  212. pageSize: 20, // 页大小
  213. sortType: 0 // 排序方式
  214. },
  215. dataCount: 0,
  216. dataList: [], // 数据集合
  217. },
  218. methods: {
  219. callBackSleBatch(){
  220. let selection = this.$refs['data-table'].selection;
  221. let ids = sa.getArrayField(selection, 'id');
  222. if (selection.length == 0) {
  223. return sa.msg('请至少选择一条数据')
  224. }
  225. let selectList = [];
  226. selectList = this.dataList.filter(item => ids.includes(item.id));
  227. for (let i = 0; i < selectList.length; i++) {
  228. if (selectList[i].resaleStatus == 0) {
  229. return sa.msg('当前选中数据包含未转售订单,请重新选择!');
  230. }
  231. if (selectList[i].upStatus != 2) {
  232. return sa.msg('当前选中数据包含未上架订单,请重新选择!');
  233. }
  234. if (selectList[i].peopleConfirmStatus == 0) {
  235. return sa.msg('当前选中数据包含未确认订单,请重新选择!');
  236. }
  237. if (selectList[i].beingOrder == 1) {
  238. return sa.msg('当前选中数据包含已销售订单,请重新选择!')
  239. }
  240. }
  241. sa.confirm('批量撤销转售总数【' + selectList.length + '】单?', function() {
  242. sa.ajax('/level-one-server/TbOrder/cancelSaleBatch', {
  243. ids: ids.join(',')
  244. }, function(res) {
  245. this.f5();
  246. }.bind(this));
  247. }.bind(this));
  248. },
  249. callBackSel(data) {
  250. sa.confirm('是否撤销转售订单【' + data.buyUserName + '】订单到二级市场?', function() {
  251. sa.ajax('/level-one-server/TbOrder/cancelSale', {
  252. id: data.id
  253. }, function(res) {
  254. this.f5();
  255. }.bind(this));
  256. }.bind(this));
  257. },
  258. getStatic() {
  259. sa.ajax('/level-one-server/TbOrder/staticsStatus', {
  260. saleMainId: this.p.saleMainId
  261. }, function(res) {
  262. this.statics = res.data;
  263. }.bind(this));
  264. },
  265. // 批量修改总价
  266. editPriceByIds: function() {
  267. // 获取选中元素的id列表
  268. let selection = this.$refs['data-table'].selection;
  269. let ids = sa.getArrayField(selection, 'id');
  270. if (selection.length == 0) {
  271. return sa.msg('请至少选择一条数据')
  272. }
  273. let selectList = [];
  274. selectList = this.dataList.filter(item => ids.includes(item.id));
  275. for (let i = 0; i < selectList.length; i++) {
  276. if (selectList[i].upStatus != 2) {
  277. return sa.msg('当前选中数据包含未上架订单,不可修改总价,请重新选择!');
  278. }
  279. if (selectList[i].resaleStatus != 0) {
  280. return sa.msg('当前选中数据包含已转售订单,不可修改总价,请重新选择!')
  281. }
  282. }
  283. this.model1 = {
  284. title: '批量修改订单价格',
  285. visible: true,
  286. ids: ids,
  287. }
  288. },
  289. // 修改总价
  290. editPrice(item) {
  291. this.model = {
  292. title: '修改订单【' + item.tradeNo + '】价格',
  293. visible: true,
  294. form: item
  295. }
  296. },
  297. savePriceByIds() {
  298. let ids = this.model1.ids;
  299. if (!ids) {
  300. sa.error('当前没有选择数据,请至少选择一条数据')
  301. return;
  302. }
  303. let price = this.model1.selPrice;
  304. if (!price) {
  305. sa.error('请输入金额')
  306. return;
  307. }
  308. sa.ajax('/level-one-server/TbOrder/editUpPriceByIds', {
  309. ids: ids.toString(),
  310. price: price
  311. }, function(res) {
  312. this.f5();
  313. this.model1.visible = false;
  314. }.bind(this));
  315. },
  316. save() {
  317. let price = this.model.form.selPrice;
  318. if (!price) {
  319. sa.error('请输入金额')
  320. return;
  321. }
  322. sa.ajax('/level-one-server/TbOrder/editUpPrice', {
  323. id: this.model.form.id,
  324. price: price
  325. }, function(res) {
  326. this.f5();
  327. this.model.visible = false;
  328. }.bind(this));
  329. },
  330. // 转售二级
  331. sel(item) {
  332. if (!item.upPrice) {
  333. sa.error('转售价格不能为空')
  334. return;
  335. }
  336. sa.confirm('是否转售到二级市场?', function() {
  337. sa.ajax('/level-two-server/TbOrders/addOrderByResale', {
  338. id: item.id,
  339. resalePrice: item.upPrice
  340. }, function(res) {
  341. this.f5();
  342. }.bind(this));
  343. }.bind(this));
  344. },
  345. saleBatch() {
  346. // 获取选中元素的id列表
  347. let selection = this.$refs['data-table'].selection;
  348. for (let i in selection) {
  349. let item = selection[i];
  350. if (!item.upPrice) {
  351. sa.error(item.tradeNo + '转售价格不能为空')
  352. return;
  353. }
  354. if (item.resaleStatus == 1) {
  355. sa.error(item.tradeNo + '已转售')
  356. return;
  357. }
  358. }
  359. let ids = sa.getArrayField(selection, 'id');
  360. if (selection.length == 0) {
  361. return sa.msg('请至少选择一条数据')
  362. }
  363. sa.confirm('是否转售到二级市场?', function() {
  364. sa.ajax('/level-two-server/TbOrders/addOrderByResaleBatch', {
  365. ids: ids.join(',')
  366. }, function(res) {
  367. this.f5();
  368. }.bind(this));
  369. }.bind(this));
  370. },
  371. // 刷新
  372. f5: function() {
  373. this.getStatic();
  374. sa.ajax('/level-one-server/TbOrder/getList', sa.removeNull(this.p), function(res) {
  375. this.dataList = res.data; // 数据
  376. this.dataCount = res.dataCount; // 数据总数
  377. sa.f5TableHeight(); // 刷新表格高度
  378. }.bind(this));
  379. },
  380. // 查看银行回执
  381. getBank: function(data) {
  382. sa.showIframe('银行回执', 'tb-order-bank-list.html?tradeNo=' + bigData.tradeNo, '1300px', '90%');
  383. }
  384. },
  385. created: function() {
  386. this.f5();
  387. sa.ajax('/level-one-server/HtTradeSettlement/getById', {
  388. id: this.id
  389. }, function(res) {
  390. this.bigData = res.data; // 数据
  391. sa.f5TableHeight(); // 刷新表格高度
  392. }.bind(this));
  393. sa.onInputEnter();
  394. }
  395. })
  396. </script>
  397. </body>
  398. </html>