合并发货页面前端修改

This commit is contained in:
@fawn-nine
2023-05-25 16:44:48 +08:00
parent a6ae5ee5fd
commit c21d221981
4 changed files with 52 additions and 30 deletions

View File

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

View File

@@ -193,7 +193,7 @@
</div>
<div class="buier td4 xcenter flexbox" style="align-items: center; justify-content: center;">
<div>
<div class="orderStatus">待发货</div>
<div class="orderStatus">待发货{{fitem.orderId}}</div>
<!-- <div class="tabContent">
<div class="time">支付时间2023-02-09 14:16:08</div>
</div> -->
@@ -750,6 +750,7 @@ export default {
orderDeliver(item) {
console.log(item)
this.oprateOrder = item
console.log(this.oprateOrder)
this.splitDeliverVisible = true
},
// 查看面单

View File

@@ -27,7 +27,7 @@
<div class="item_body">
<div class="flexbox" style="justify-content: space-between;">
<div class="td1 flexbox" style="align-items: flex-start;">
<div class="flexbox orderProducts" v-for="products in productsCodeList">
<div class="flexbox orderProducts" v-for="products in productsCodeList" :key="products.productId">
<div class="flexbox productItem" style="">
<!-- <el-checkbox :label="products.allOrderId"></el-checkbox> -->
<img :src="products.image" width="30px" height="30px">

View File

@@ -14,7 +14,7 @@
<el-form-item label="选择物流" prop="deliverLcd">
<el-select size="mini" v-model="ruleForm.deliverLcd" placeholder="请选择物流" @change="selectChanged">
<el-option v-for="(item, index) in expressList" :label="item.dictValue"
:value="item.dictType"></el-option>
:value="item.dictType" :key="item.dictType"></el-option>
</el-select>
</el-form-item>
</el-form>
@@ -96,7 +96,7 @@ export default {
this.$emit('closeDeliverDialog', false)
this.$refs['ruleForm'].resetFields()
this.$refs['ruleForm'].clearValidate()
this.selectData = []
/// this.selectData = []
},
// 发货操作
setDevliverHandle() {