listing-management-order.html 14 KB

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