|
@@ -14,6 +14,7 @@
|
|
|
v-model="goodsExchangeAddForm.sn"
|
|
|
:disabled="type === 'detail' || type === 'audit'"
|
|
|
ref="order"
|
|
|
+ @keyup.enter.native="blurUsername()"
|
|
|
>
|
|
|
</el-input>
|
|
|
<el-button @click="blurUsername()">搜索</el-button>
|
|
@@ -173,8 +174,8 @@
|
|
|
</el-table-column>-->
|
|
|
<el-table-column label="差异">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.sn_code_list">{{
|
|
|
- scope.row.num - scope.row.sn_code_list.length || 0
|
|
|
+ <span v-if="scope.row.orderNum">{{
|
|
|
+ scope.row.num - scope.row.orderNum || 0
|
|
|
}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -340,7 +341,8 @@
|
|
|
:data="orderList.data"
|
|
|
border
|
|
|
style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ ref="tables"
|
|
|
+ @selection-change="handleSelOrderChange"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="" label="订单编号">
|
|
@@ -397,7 +399,7 @@
|
|
|
</el-pagination>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="closeOrder">取 消</el-button>
|
|
|
- <el-button type="primary">确 定</el-button>
|
|
|
+ <el-button @click="searchOrderAdd" type="primary">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
@@ -581,6 +583,7 @@ export default {
|
|
|
sku: "",
|
|
|
sn_code_list: [],
|
|
|
index: "",
|
|
|
+ snMultipleSelection:''
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -635,6 +638,16 @@ export default {
|
|
|
...mapGetters(["user"]),
|
|
|
},
|
|
|
methods: {
|
|
|
+ /* 订单列表选择 */
|
|
|
+ handleSelOrderChange(val){
|
|
|
+ if (val.length > 1) {
|
|
|
+ // 如果当前选中数量超过1,移除先前选中的,保留最后选中的
|
|
|
+ const lastSelected = val[val.length - 1];
|
|
|
+ this.$refs.tables.clearSelection(); // 清除所有选中
|
|
|
+ this.$refs.tables.toggleRowSelection(lastSelected, true); // 重新选中最后一个
|
|
|
+ }
|
|
|
+ this.snMultipleSelection=val
|
|
|
+ },
|
|
|
/* 返回出入明细 */
|
|
|
toBack() {
|
|
|
this.$router.push({
|
|
@@ -766,6 +779,28 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ searchOrderAdd(){
|
|
|
+ if (this.snMultipleSelection.length >=1) {
|
|
|
+ API_GoodsExchange.getOneBySn(this.snMultipleSelection[0].sn).then(
|
|
|
+ (res) => {
|
|
|
+ this.goodsExchangeAddForm.scan_order_sn=this.snMultipleSelection[0].sn
|
|
|
+ this.goodsExchangeAddForm.scan_order_type=res.type
|
|
|
+ this.goodsExchangeAddForm.order_id=res.id
|
|
|
+ res.item_list.map(el=>{
|
|
|
+ el.scan_order_item_id=el.id
|
|
|
+ el.scan_order_id=res.id
|
|
|
+ el.orderNum=el.num
|
|
|
+ el.num=0
|
|
|
+ el.sn_code_list=[]
|
|
|
+ })
|
|
|
+ this.goodsExchangeAddForm.product_list=res.item_list
|
|
|
+ this.orderVisible=false
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }else{
|
|
|
+ this.$message.error("请选择订单")
|
|
|
+ }
|
|
|
+ },
|
|
|
// 查询订单编号
|
|
|
blurUsername() {
|
|
|
if (this.goodsExchangeAddForm.sn !== undefined) {
|
|
@@ -778,14 +813,15 @@ export default {
|
|
|
el.scan_order_item_id=el.id
|
|
|
el.scan_order_id=res.id
|
|
|
el.orderNum=el.num
|
|
|
+ el.num=0
|
|
|
el.sn_code_list=[]
|
|
|
})
|
|
|
this.goodsExchangeAddForm.product_list=res.item_list
|
|
|
}
|
|
|
);
|
|
|
- } /* else{
|
|
|
+ } else{
|
|
|
this.$message.error("请填写订单编号")
|
|
|
- } */
|
|
|
+ }
|
|
|
},
|
|
|
/* 通过id查询商品信息
|
|
|
orderInfo(id){
|