Przeglądaj źródła

转售时增加批量转售

qzy 2 miesięcy temu
rodzic
commit
7634edeeb2

+ 36 - 1
sa-view/listing-management/listing-management-order.html

@@ -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) {

+ 1 - 17
sa-view/listing-management/listing-management.html

@@ -95,23 +95,7 @@
 					getOrder(data){
 						sa.showIframe('详情', 'listing-management-order.html?platSeqNo='+data.platSeqNo+'&id='+data.id, '90%', '94%');
 					},
-					// 批量删除
-					deleteByIds: function() {
-						// 获取选中元素的id列表
-						let selection = this.$refs['data-table'].selection;
-						let ids = sa.getArrayField(selection, 'id');
-						if(selection.length == 0) {
-							return sa.msg('请至少选择一条数据')
-						}
-						// 提交删除
-						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
-							sa.ajax('/HtTradeSettlement/deleteByIds', {ids: ids.join(',')}, function(res) {
-								sa.arrayDelete(this.dataList, selection);
-								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度
-							}.bind(this))
-						}.bind(this));
-					},
+				
 				},
 				created: function() {
 					this.f5();