合并发货页面前端修改
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<div class="flexbox" style="align-items: center; padding: 0 10px; width: 34px; border-right: 1px solid #CFF3ED;">
|
||||
<el-form-item label-width="0" :prop="`list.${index}.isMerge`" :rules="[
|
||||
{ required: true, message: '此项为必填项', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="de.isMerge" size="mini">
|
||||
<el-radio-group v-model="de.isMerge" size="mini" @input="MergeRadioListChanged($event,index)">
|
||||
<div>
|
||||
<el-radio label="true"><br/></el-radio>
|
||||
</div>
|
||||
@@ -105,7 +105,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
merOneList: [],
|
||||
buttonDisable:true,
|
||||
buttonDisable: true,
|
||||
flag:false,
|
||||
submitMrgeIdList:[],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
@@ -137,6 +139,13 @@ export default {
|
||||
this.getMergeOrders()
|
||||
},
|
||||
methods: {
|
||||
// 选择批量合并发货
|
||||
MergeRadioListChanged(val,index) {
|
||||
console.log(this.ruleForm.list,'this.ruleForm.list')
|
||||
this.ruleForm.list[index].isMerge = 'true'
|
||||
this.buttonDisable = false
|
||||
this.radio3 = ''
|
||||
},
|
||||
// 获取快递公司列表
|
||||
getExpressList() {
|
||||
this.$http({
|
||||
@@ -169,6 +178,9 @@ export default {
|
||||
this.totalPage = data.page.totalCount
|
||||
loading.close()
|
||||
this.ruleForm.list = data.page.records
|
||||
this.ruleForm.list.map(item => {
|
||||
return item.isMerge = 'false'
|
||||
})
|
||||
console.log(this.ruleForm.list)
|
||||
//this.mergeDliverVisible = true
|
||||
} else {
|
||||
@@ -197,8 +209,9 @@ export default {
|
||||
}
|
||||
},
|
||||
closeDeliverDialog(val) {
|
||||
this.setDeliverVisible = false
|
||||
this.getMergeOrders()
|
||||
this.setDeliverVisible = false
|
||||
this.getMergeOrders()
|
||||
this.merOneList = []
|
||||
},
|
||||
// 单个合并订单发货
|
||||
mergeOne(list, index) {
|
||||
@@ -207,8 +220,8 @@ export default {
|
||||
return item.orderId
|
||||
})
|
||||
console.log(this.merOneList)
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// this.$refs['ruleForm'].validate((valid) => {
|
||||
// if (valid) {
|
||||
this.$confirm('正在进行合并发货, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@@ -221,10 +234,10 @@ export default {
|
||||
message: '已取消操作'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return this.$message.error('请核对必填项')
|
||||
}
|
||||
})
|
||||
// } else {
|
||||
// return this.$message.error('请核对必填项')
|
||||
// }
|
||||
// })
|
||||
},
|
||||
radioChange(val){
|
||||
// console.log(this.ruleForm.list)
|
||||
@@ -257,24 +270,32 @@ export default {
|
||||
},
|
||||
submit() {
|
||||
// 表单验证
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// console.log(4545)
|
||||
this.ruleForm.list.forEach((item, index) => {
|
||||
let list = []
|
||||
list = item.orderList.map((element) => {
|
||||
return element.orderId
|
||||
})
|
||||
this.multMergeIdList = this.multMergeIdList.concat(list)
|
||||
})
|
||||
console.log(this.multMergeIdList)
|
||||
this.merOneList = this.multMergeIdList
|
||||
this.setDeliverVisible = true
|
||||
// console.log(this.merOneList)
|
||||
} else {
|
||||
return this.$message.error('请核对必填项')
|
||||
// this.$refs['ruleForm'].validate((valid) => {
|
||||
// if (valid) {
|
||||
this.multMergeIdList = []
|
||||
this.submitMrgeIdList = JSON.parse(JSON.stringify(this.ruleForm.list)) // 深度拷贝选中的订单
|
||||
this.submitMrgeIdList.map((item, index) => {
|
||||
if (item.isMerge == 'false') {
|
||||
this.submitMrgeIdList.splice(index, 1) // 去掉未选中的合并项
|
||||
}
|
||||
|
||||
})
|
||||
this.submitMrgeIdList.map(element => {
|
||||
let list = []
|
||||
list = element.orderList.map(ele => { // 转换成id格式
|
||||
return ele.orderId
|
||||
})
|
||||
this.multMergeIdList = this.multMergeIdList.concat(list)
|
||||
})
|
||||
// console.log(this.submitMrgeIdList,'submitMrgeIdList')
|
||||
// console.log(this.multMergeIdList,'multMergeIdList')
|
||||
this.merOneList = this.multMergeIdList
|
||||
this.setDeliverVisible = true
|
||||
console.log(this.merOneList)
|
||||
// } else {
|
||||
// return this.$message.error('请核对必填项')
|
||||
// }
|
||||
// })
|
||||
}
|
||||
},
|
||||
components:{
|
||||
|
||||
Reference in New Issue
Block a user