|
|
|
@ -13,10 +13,10 @@
|
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="10"> |
|
|
|
|
<el-form-item label="预约时间:" prop="reservationData" label-width="100px" > |
|
|
|
|
<el-form-item label="预约时间:" prop="reservationDate" label-width="100px" > |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="form.reservationData" |
|
|
|
|
type="datetime" |
|
|
|
|
v-model="form.reservationDate" |
|
|
|
|
type="date" |
|
|
|
|
clearable |
|
|
|
|
placeholder="选择日期时间"> |
|
|
|
|
</el-date-picker> |
|
|
|
@ -48,7 +48,7 @@
|
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="10"> |
|
|
|
|
<el-form-item label="配送方式:" prop="serveType" label-width="100px" > |
|
|
|
|
<el-radio-group v-model="form.deliveryType"> |
|
|
|
|
<el-radio-group v-model="form.deliveryWay"> |
|
|
|
|
<el-radio v-for="item in this.deliveryWayData" :label="item.dictValue" :value="item.dictKey"></el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
@ -168,7 +168,7 @@
|
|
|
|
|
|
|
|
|
|
<el-row style="margin: 50px;"> |
|
|
|
|
<el-button-group> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus">增加订单</el-button> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="bbb">增加订单</el-button> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus">增加包件<i class="el-icon-arrow-right el-icon--right"></i></el-button> |
|
|
|
|
</el-button-group> |
|
|
|
|
<div class="avue-crud__left" style="margin-left: 50px"> |
|
|
|
@ -204,11 +204,50 @@
|
|
|
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
<el-form-item style="margin-left: 45%;margin-top: 5px"> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmit">提交</el-button> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmit">提交(配送订单预约)</el-button> |
|
|
|
|
<el-button icon="el-icon-circle-close" @click="$router.go(-1)">返 回</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
v-model="orderShow" |
|
|
|
|
title="在库订单信息" |
|
|
|
|
width="100%" |
|
|
|
|
:model="addvalue" |
|
|
|
|
:before-close="handleClose" |
|
|
|
|
> |
|
|
|
|
<el-table ref="table" |
|
|
|
|
v-loading="loading" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
:data="stockArticleInfo" |
|
|
|
|
:height="height" |
|
|
|
|
style="width: 90%" |
|
|
|
|
:border="option.border"> |
|
|
|
|
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column v-if="option.index" label="序号" type="index" width="80px" align="center"></el-table-column> |
|
|
|
|
<template v-for="(item,index) in option.column"> |
|
|
|
|
<el-table-column v-if="item.hide!==true" |
|
|
|
|
:prop="item.prop" |
|
|
|
|
:label="item.label" |
|
|
|
|
:width="item.width" |
|
|
|
|
:key="index"> |
|
|
|
|
</el-table-column> |
|
|
|
|
</template> |
|
|
|
|
<!-- 操作栏模块 --> |
|
|
|
|
<!-- <el-table-column prop="menu" label="操作" :width="220" align="center">--> |
|
|
|
|
<!-- <template #="{row}">--> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-view" @click="viewPackage(row)">查看包件</el-button>--> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">移除</el-button>--> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-delete" @click="addvalueServe(row)">增值服务</el-button>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- </el-table-column>--> |
|
|
|
|
</el-table> |
|
|
|
|
<el-form-item style="margin-left: 45%;margin-top: 5px"> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmitOrder">提交(订单选择)</el-button> |
|
|
|
|
<el-button icon="el-icon-circle-close" @click="$router.go(-1)">返 回</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
v-model="dialogVisible" |
|
|
|
@ -218,8 +257,8 @@
|
|
|
|
|
:before-close="handleClose" |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<el-form-item label="费用类型" prop="freightMark"> |
|
|
|
|
<el-checkbox-group v-model="form.freightMark" @change="handleCheckedCitiesChange"> |
|
|
|
|
<el-form-item label="增值服务" prop="freightMark"> |
|
|
|
|
<el-checkbox-group v-model="form.addvalueType" @change="handleCheckedCitiesChange"> |
|
|
|
|
<el-checkbox style="width: 100%;margin-bottom: 3%;" |
|
|
|
|
v-for="(item,index) in addvalueServeTypeData" |
|
|
|
|
:key="item.dictKey" |
|
|
|
@ -252,33 +291,8 @@
|
|
|
|
|
<!-- <el-input type="number" v-model="item.remark" placeholder="请输入费用" :disabled = "this.form?.freightMark?.indexOf(item.dictKey) == -1"--> |
|
|
|
|
<!-- @change="textbox($event,index)" style="width: 50%;border:none; border-bottom:2px solid #eee;"/>--> |
|
|
|
|
</el-checkbox> |
|
|
|
|
|
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
<div v-for="(item,index) in this.addvalueServeTypeData"> |
|
|
|
|
<el-checkbox :label="item.dictValue" :value="item.dictKey" v-model="this.addvalueServeType"/> |
|
|
|
|
|
|
|
|
|
<span v-if="index===0||index===6||index===2||index===4"> 件数: |
|
|
|
|
<input v-model="addvalueServeType.number" type="text" style="width: 5%;border:none; border-bottom:2px solid #eee;"> |
|
|
|
|
</span> |
|
|
|
|
<span v-if="index===1">公里: |
|
|
|
|
<input v-model="addvalueServeType.kilometer" type="text" style="width: 5%;border:none; border-bottom:2px solid #eee;"> |
|
|
|
|
</span> |
|
|
|
|
<span v-if="index===3">距离: |
|
|
|
|
<input v-model="addvalueServeType.distance" type="text" style="width: 5%;border:none; border-bottom:2px solid #eee;"> |
|
|
|
|
</span> |
|
|
|
|
<span v-if="index===5">人数: |
|
|
|
|
<input v-model="addvalueServeType.peopleNum" type="text" style="width: 5%;border:none; border-bottom:2px solid #eee;"> |
|
|
|
|
</span> |
|
|
|
|
<span v-if="index===0">楼层: |
|
|
|
|
<input v-model="addvalueServeType.floor" type="text" style="width: 5%;border:none; border-bottom:2px solid #eee;"> |
|
|
|
|
</span> |
|
|
|
|
<span v-if="item">预计费用: |
|
|
|
|
<input v-model="addvalueServeType.fee" type="text" style="width: 5%;border:none; border-bottom:2px solid #eee;"> |
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="dialogVisible = false">取消</el-button> |
|
|
|
@ -295,11 +309,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList, getDetail, add, update, remove } from "@/api/distribution/distributionReservation"; |
|
|
|
|
import { add, update, remove } from "@/api/distribution/distributionReservation"; |
|
|
|
|
|
|
|
|
|
import { getList } from "@/api/distribution/distributionStockArticle"; |
|
|
|
|
|
|
|
|
|
import { getListDelivery, getDetailDelivery, addDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery"; |
|
|
|
|
|
|
|
|
|
import option from "@/option/distribution/distributionDelivery"; |
|
|
|
|
import { addIncrement } from "@/api/distribution/distributionStockArticle"; |
|
|
|
|
|
|
|
|
|
// import option from "@/option/distribution/distributionDelivery"; |
|
|
|
|
import option from "@/option/distribution/distributionStockArticle"; |
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; |
|
|
|
|
|
|
|
|
@ -349,6 +368,16 @@ export default {
|
|
|
|
|
costList:[], //字典 |
|
|
|
|
//增值服务对象 |
|
|
|
|
addvalueObj:{}, |
|
|
|
|
//费用列表 |
|
|
|
|
feeList:[], |
|
|
|
|
//楼层 |
|
|
|
|
floorList:[], |
|
|
|
|
//订单行数据 |
|
|
|
|
orderInfo:{}, |
|
|
|
|
//增加订单弹窗 |
|
|
|
|
orderShow:false, |
|
|
|
|
//在库订单信息 |
|
|
|
|
stockArticleInfo:{}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
@ -371,8 +400,43 @@ export default {
|
|
|
|
|
this.height = this.setPx(document.body.clientHeight - 340); |
|
|
|
|
}, |
|
|
|
|
aaa(){ |
|
|
|
|
console.log(this.addvalueServeType); |
|
|
|
|
console.log(this.costList); |
|
|
|
|
let addvalueInfos=[]; |
|
|
|
|
this.form.addvalueType.forEach((item,index)=>{ |
|
|
|
|
let addvalueInfo={}; |
|
|
|
|
addvalueInfo.addvalueId=item; |
|
|
|
|
if (item==1||item==3||item==5||item==7){ |
|
|
|
|
addvalueInfo.number=this.costList[item]; |
|
|
|
|
} |
|
|
|
|
if (item==2){ |
|
|
|
|
addvalueInfo.kilometer = this.costList[item]; |
|
|
|
|
} |
|
|
|
|
if (item==4){ |
|
|
|
|
addvalueInfo.distance = this.costList[item]; |
|
|
|
|
} |
|
|
|
|
if (item==6){ |
|
|
|
|
addvalueInfo.peopleNum = this.costList[item]; |
|
|
|
|
} |
|
|
|
|
if (this.floorList.length>1){ |
|
|
|
|
addvalueInfo.floor = this.floorList[1]; |
|
|
|
|
this.floorList=[]; |
|
|
|
|
} |
|
|
|
|
addvalueInfo.fee= this.feeList[item]; |
|
|
|
|
addvalueInfos.push(addvalueInfo) |
|
|
|
|
}) |
|
|
|
|
let params={} |
|
|
|
|
params.id=this.orderInfo.id |
|
|
|
|
params.addvalue = addvalueInfos; |
|
|
|
|
addIncrement(params).then(res=>{ |
|
|
|
|
this.dialogVisible =false; |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
console.log("a[]>>>>>>>",params); |
|
|
|
|
}, |
|
|
|
|
bbb(){ |
|
|
|
|
this.orderShow = true; |
|
|
|
|
}, |
|
|
|
|
handleCheckedCitiesChange(value) { |
|
|
|
|
console.log(">>>>>>>",value ); |
|
|
|
@ -385,31 +449,31 @@ export default {
|
|
|
|
|
this.costListName = []; |
|
|
|
|
} |
|
|
|
|
this.deliveryWayData.forEach(i =>{ |
|
|
|
|
// console.log("value.includes(i.dictkey)",value,i.dictKey); |
|
|
|
|
if(value.includes(i.dictKey)){ |
|
|
|
|
console.log(i); |
|
|
|
|
i.pitch = true; |
|
|
|
|
this.costListName = value; |
|
|
|
|
// console.log(this.costListName); |
|
|
|
|
// this.$set(i,'pitch',false); |
|
|
|
|
} |
|
|
|
|
// else{ |
|
|
|
|
// console.log("123"); |
|
|
|
|
// i.pitch = false; |
|
|
|
|
// this.costList[i] = null; |
|
|
|
|
// i.remark = null; |
|
|
|
|
// } |
|
|
|
|
}); |
|
|
|
|
// let checkedCount = value.length; |
|
|
|
|
// this.checkAll = checkedCount === this.cities.length; |
|
|
|
|
// this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length; |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
textbox(e,index,a) { |
|
|
|
|
console.log("e,index",e,index,a); |
|
|
|
|
this.costList[index+1] = e; |
|
|
|
|
if (index===1 && a === 1 ){ |
|
|
|
|
|
|
|
|
|
// if (index===1 && a === 1 ){ |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
if (a===6){ |
|
|
|
|
this.feeList[index+1] = e; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (a===5) |
|
|
|
|
if (index===0 && a===5){ |
|
|
|
|
this.floorList[index+1] = e; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.costList[index+1]=e; |
|
|
|
|
|
|
|
|
|
//费用列表 |
|
|
|
|
console.log(">>>>>>>",this.costList); |
|
|
|
|
}, |
|
|
|
|
//数据字典数据获取 |
|
|
|
@ -427,10 +491,14 @@ export default {
|
|
|
|
|
console.log(this.deliveryTypeData); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
addvalueServe(){ |
|
|
|
|
addvalueServe(row){ |
|
|
|
|
this.addvalueServeType = []; |
|
|
|
|
this.addvalue={}; |
|
|
|
|
this.dialogVisible =true; |
|
|
|
|
this.costList=[]; |
|
|
|
|
this.feeList=[]; |
|
|
|
|
this.floorList=[]; |
|
|
|
|
this.orderInfo = row; |
|
|
|
|
}, |
|
|
|
|
searchHide () { |
|
|
|
|
this.search = !this.search; |
|
|
|
@ -468,10 +536,38 @@ export default {
|
|
|
|
|
this.isaddvalue = true; |
|
|
|
|
}, |
|
|
|
|
onSubmit(){ |
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
addDelivery(this.form).then(() => { |
|
|
|
|
console.log(">>>>>>>>this.form",this.form); |
|
|
|
|
let ids = []; |
|
|
|
|
this.data.forEach(item=>{ |
|
|
|
|
ids.push(item.id) |
|
|
|
|
}) |
|
|
|
|
ids.join(","); |
|
|
|
|
console.log(ids); |
|
|
|
|
this.form.ids=ids.toString(); |
|
|
|
|
this.deliveryWayData.forEach(item=>{ |
|
|
|
|
if (this.form.deliveryWay === item.dictValue){ |
|
|
|
|
this.form.deliveryWay = item.dictKey; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.deliveryTypeData.forEach(item=>{ |
|
|
|
|
if (this.form.deliveryType === item.dictValue){ |
|
|
|
|
this.form.deliveryType = item.dictKey; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
let a=[] |
|
|
|
|
this.addvalueServeTypeData.forEach(item=>{ |
|
|
|
|
this.form.serveType.forEach(type=>{ |
|
|
|
|
if (type===item.dictValue){ |
|
|
|
|
a.push(item.dictKey) |
|
|
|
|
// this.form.serveType=item.dictKey; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.form.serveType= a.toString(); |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$router.go(-1); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
@ -481,27 +577,20 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
handleClose(done) { |
|
|
|
|
this.$confirm('确认关闭?') |
|
|
|
|
.then(_ => { |
|
|
|
|
done(); |
|
|
|
|
}) |
|
|
|
|
.catch(_ => {}); |
|
|
|
|
.then(_ => { |
|
|
|
|
done(); |
|
|
|
|
}) |
|
|
|
|
.catch(_ => {}); |
|
|
|
|
}, |
|
|
|
|
handleAdd () { |
|
|
|
|
this.title = '新增' |
|
|
|
|
this.form = {} |
|
|
|
|
this.box = true |
|
|
|
|
// this.$router.push({ |
|
|
|
|
// path: '/distribution/reservation/reservationFrom', |
|
|
|
|
// query: { |
|
|
|
|
// name:'新增', |
|
|
|
|
// type:'add' |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
}, |
|
|
|
|
handleEdit (row) { |
|
|
|
|
this.title = '编辑' |
|
|
|
|
this.box = true |
|
|
|
|
getDetail(row.id).then(res => { |
|
|
|
|
getDetailDelivery(row.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -509,7 +598,7 @@ export default {
|
|
|
|
|
this.title = '查看' |
|
|
|
|
this.view = true; |
|
|
|
|
this.box = true; |
|
|
|
|
getDetail(row.id).then(res => { |
|
|
|
|
getDetailDelivery(row.id).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -558,8 +647,21 @@ export default {
|
|
|
|
|
this.view = false; |
|
|
|
|
}, |
|
|
|
|
selectionChange (list) { |
|
|
|
|
console.log(">>>>>>>>>>>>>",list); |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 增加订单提交 |
|
|
|
|
*/ |
|
|
|
|
onSubmitOrder(){ |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.data = this.selectionList |
|
|
|
|
this.orderShow =false |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
selectionClear () { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
@ -574,22 +676,16 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
onLoad (page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
// const data = res.data.data; |
|
|
|
|
// this.page.total = data.total; |
|
|
|
|
// // this.data = data.records; |
|
|
|
|
// this.loading = false; |
|
|
|
|
// this.selectionClear(); |
|
|
|
|
// }); |
|
|
|
|
getListDelivery(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|
this.data = data.records; |
|
|
|
|
this.stockArticleInfo = data.records; |
|
|
|
|
this.loading = false; |
|
|
|
|
this.selectionClear(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style> |
|
|
|
|