|
@@ -46,6 +46,10 @@
|
|
|
<div style="margin: 15px 0px 15px 0px;">详情-边民订单</div>
|
|
|
<el-button v-if="sa.isAuth('tb-order-edit-price')"
|
|
|
type="primary" style="margin-bottom:10px;" @click="editPriceByIds()">批量修改总价</el-button>
|
|
|
+ <el-button v-if="sa.isAuth('tb-order-edit-price')"
|
|
|
+ type="primary" style="margin-bottom:10px;" @click="saleBatch()">批量转售</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary" style="margin-bottom:10px;" @click="f5()">刷新</el-button>
|
|
|
</el-form>
|
|
|
<!-- ------------- 数据列表 ------------- -->
|
|
|
<el-table class="data-table" ref="data-table" :data="dataList" >
|
|
@@ -211,12 +215,43 @@
|
|
|
|
|
|
// 转售二级
|
|
|
sel(item){
|
|
|
- sa.confirm('是否转售到二级市场,此操作不可撤销', function(){
|
|
|
+ if(!item.upPrice){
|
|
|
+ sa.error('转售价格不能为空')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ sa.confirm('是否转售到二级市场?', function(){
|
|
|
sa.ajax('/level-two-server/TbOrders/addOrderByResale', {id:item.id,resalePrice:item.upPrice}, function(res) {
|
|
|
this.f5();
|
|
|
}.bind(this));
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ saleBatch(){
|
|
|
+ // 获取选中元素的id列表
|
|
|
+ let selection = this.$refs['data-table'].selection;
|
|
|
+ for(let i in selection){
|
|
|
+ let item=selection[i];
|
|
|
+ if(!item.upPrice){
|
|
|
+ sa.error(item.tradeNo+'转售价格不能为空')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(item.resaleStatus==1){
|
|
|
+ sa.error(item.tradeNo+'已转售')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ let ids = sa.getArrayField(selection, 'id');
|
|
|
+ if(selection.length == 0) {
|
|
|
+ return sa.msg('请至少选择一条数据')
|
|
|
+ }
|
|
|
+ sa.confirm('是否转售到二级市场?', function(){
|
|
|
+ sa.ajax('/level-two-server/TbOrders/addOrderByResaleBatch', {ids:ids.join(',')}, function(res) {
|
|
|
+ this.f5();
|
|
|
+ }.bind(this));
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
+ },
|
|
|
// 刷新
|
|
|
f5: function() {
|
|
|
sa.ajax('/level-one-server/TbOrder/getList', sa.removeNull(this.p), function(res) {
|