@@ -512,22 +535,22 @@
@@ -536,7 +559,7 @@
上移
+ >上移
@@ -562,11 +585,10 @@
import { getListUser } from '@/api/distribution/distributionStockup';
import { getPostList } from '@/api/system/post';
import { getListOwn } from '@/api/system/user';
- import { getPackageList } from '@/api/distribution/distributionParcelList';
import { stockUpInfo } from '@/api/basicdata/basicdataGoodsArea';
import { getVehicleList } from '@/api/basicdata/basicdataVehicle';
import { getDriverList } from '@/api/basicdata/basicdataDriverArtery';
- import { selectStockArticleAndParcel } from '@/api/distribution/distributionStockArticle';
+ import { selectStockArticleInfoList } from '@/api/distribution/distributionStockArticle';
import { getInventoryList } from '@/api/distribution/distributionStockList';
import { getDeliveryList ,updateDeliveryList} from '@/api/distribution/distributionDeliveryList';
import { mapGetters } from 'vuex';
@@ -671,6 +693,11 @@
loadAndUnload:[],
//服务类型
serveType:[],
+ page: {
+ currentPage: 1,
+ pageSize: 10,
+ total: 40
+ },
//外协数据来源
tripartiteSourceData:[],
deliveryListId:'',
@@ -684,29 +711,29 @@
isUpdate:false,
};
},
- watch:{
- // obj:{
- // deep:true,
- // handler(newVal,oldVal){
- // if (this.isInitialized){
- // console.log('输入框的值'+JSON.stringify(oldVal)+'从变成了'+JSON.stringify(newVal));
- // //这里就需要返回一个false;
- // this.isUpdate = true;
- // }else {
- // this.isInitialized=true;
- // }
- // }
- // }
- },
+ watch:{
+ // obj:{
+ // deep:true,
+ // handler(newVal,oldVal){
+ // if (this.isInitialized){
+ // console.log('输入框的值'+JSON.stringify(oldVal)+'从变成了'+JSON.stringify(newVal));
+ // //这里就需要返回一个false;
+ // this.isUpdate = true;
+ // }else {
+ // this.isInitialized=true;
+ // }
+ // }
+ // }
+ },
created() {
this.$watch(
- () => this.$route.params,
- () => {
- this.fetchData();
- },
- // 组件创建完后获取数据,
- // 此时 data 已经被 observed 了
- { immediate: true }
+ () => this.$route.params,
+ () => {
+ this.fetchData();
+ },
+ // 组件创建完后获取数据,
+ // 此时 data 已经被 observed 了
+ { immediate: true }
);
this.getDictionary();
this.getFork();
@@ -829,8 +856,6 @@
console.log("selectionStockArticleChange",list);
this.stockArticleList = list;
},
-
-
//查询车辆信息
getvehicleData() {
return new Promise((rv,rev)=>{
@@ -847,6 +872,16 @@
if (this.$route.query.id) {
this.deliveryListId = this.$route.query.id;
}
+ this.loading = false;
+
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ this.onLoad(this.page);
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ this.onLoad(this.page);
},
checkPackage(row,index){
@@ -867,11 +902,11 @@
},
handleClose(done) {
this.$confirm('确认关闭?')
- .then(_ => {
- done();
- })
- .catch(_ => {
- });
+ .then(_ => {
+ done();
+ })
+ .catch(_ => {
+ });
},
/**
* 查看包件
@@ -886,7 +921,6 @@
//编辑
let params={};
console.log("^^^^^^^^",row);
- this.query.stockArticleId = row.id;
//这里订单的对象中应该存在三个数组,一个数组是该订单下的所有包件细信息
//一个数组是该订单被选择使用的包件信息
//还有一个就是正在操作的包件信息
@@ -915,21 +949,14 @@
//新增
//默认打开包件信息,包件列表处于全选状态
let params={};
- console.log("^^^^^^^^",row);
- this.query.stockArticleId = row.id;
- getPackageList(Object.assign(params,this.query)).then(res=>{
- console.log(res.data.data);
- let data =res.data.data;
- this.packageData =data.records;
- this.packageData.forEach((item,index)=>{
- this.$nextTick( ()=> {
- this.$refs.packageList.toggleRowSelection(this.packageData[index],true);
- })
+ this.packageData = row.parcelListVOS
+ this.packageData.forEach((item,index)=>{
+ this.$nextTick( ()=> {
+ this.$refs.packageList.toggleRowSelection(this.packageData[index],true);
})
- this.selectionClear();
})
+ console.log("^^^^^^^^",row);
}
-
this.loading = false;
this.isShowPackage = true;
@@ -986,257 +1013,260 @@
} else {
this.inventoryData = this.selectionList;
}
-
- this.stockListShow = false;
- },
- onSubmitOrder() {
- console.log('>>>>>>>>>>>>', this.stockArticleList);
- console.log('>>>>>>>>orderData', this.orderData);
- if (this.orderData){
- let a = this.orderData;
- this.stockArticleList.forEach(item=>{
- a.forEach(order=>{
- console.log("order----------------->",order);
- if (item.id === order.id){
- item.packageListInfo = order.packageList;
- }
+ this.stockListShow = false;
+ },
+ onSubmitOrder() {
+ console.log('>>>>>>>>>>>>', this.stockArticleList);
+ console.log('>>>>>>>>orderData', this.orderData);
+ const data = this.stockArticleList;
+ let info = [];
+ if (this.orderData){
+ let a = this.orderData;
+ data.forEach(item=>{
+ a.forEach(order=>{
+ if (item.id === order.id){
+ console.log("order----------------->",order);
+ item = order;
+ }
+ })
+ info.push(item);
})
- })
- }
- // this.orderData.forEach(item => {
- // item.reservationNum = 0;
- // this.stockArticleList.forEach((list, index) => {
- // if (item.id === list.id) {
- // list = item;
- // }
- // });
- // });
- this.orderData = this.stockArticleList;
- console.log('+++++++++++++++', this.orderData);
- this.orderShow = false;
- },
- /**
- * 订单提交
- */
- onSubmitBusiness() {
- if (this.deliveryListId){
- let data = {};
- let tripartite = {};
- let stockup = {};
- let allocationInfo = [];
- //备货区数据构建
- if (this.stockUpForm.loader) {
- this.loaderData.forEach(a => {
- if (this.stockUpForm.loader === a.dictKey) {
- stockup.loaderName = a.dictValue;
- stockup.loaderId = a.dictKey;
- }
- });
}
- console.log("this.stockUpForm.forklift-------->",this.stockUpForm.forklift);
- this.forkliftData.forEach(b => {
- if (this.stockUpForm.forklift === b.dictKey) {
- stockup.forkliftName = b.dictValue;
- stockup.forkliftId = b.dictKey;
- }
- });
- this.goodsAreaData.forEach(c => {
- if (this.stockUpForm.goodsAreaId === c.dictKey) {
- stockup.goodsAreaId = c.dictKey;
- stockup.goodsAreaName = c.dictValue;
+ this.orderData = info;
+
+ // this.orderData.forEach(item => {
+ // item.reservationNum = 0;
+ // this.stockArticleList.forEach((list, index) => {
+ // if (item.id === list.id) {
+ // list = item;
+ // }
+ // });
+ // });
+ console.log('+++++++++++++++', this.orderData);
+ this.orderShow = false;
+ },
+ /**
+ * 订单提交
+ */
+ onSubmitBusiness() {
+ if (this.deliveryListId){
+ let data = {};
+ let tripartite = {};
+ let stockup = {};
+ let allocationInfo = [];
+ //备货区数据构建
+ if (this.stockUpForm.loader) {
+ this.loaderData.forEach(a => {
+ if (this.stockUpForm.loader === a.dictKey) {
+ stockup.loaderName = a.dictValue;
+ stockup.loaderId = a.dictKey;
+ }
+ });
}
- });
- if (this.stockUpForm.stockupDate) {
- stockup.stockupDate = this.stockUpForm.stockupDate;
- }
- if (this.stockUpForm.remarks) {
- stockup.remarks = this.stockUpForm.remarks;
- }
- if (this.stockUpForm.outboundDate){
- stockup.outboundDate = this.stockUpForm.outboundDate;
- }
- stockup.loadAndUnload = this.loadAndUnload.join(',');
- data.stockupInfo = stockup;
- //将服务类型转为数组
- if (this.serveType){
- console.log("this.serveType---------->",this.serveType);
- let serve = Object.values(this.serveType);
- serve = serve.sort((a, b) => {
- return a - b;
+ console.log("this.stockUpForm.forklift-------->",this.stockUpForm.forklift);
+ this.forkliftData.forEach(b => {
+ if (this.stockUpForm.forklift === b.dictKey) {
+ stockup.forkliftName = b.dictValue;
+ stockup.forkliftId = b.dictKey;
+ }
});
- this.stockUpForm.serveType = serve.join(',');
- console.log("this.stockUpForm.serveType----------->",this.stockUpForm.serveType);
- }
- //判断是否是三方配送
- if (this.waixieForm.tripartiteSource) {
- //三方配送数据构建
- if (this.waixieForm.driverName) {
- tripartite.driverName = this.waixieForm.driverName;
+ this.goodsAreaData.forEach(c => {
+ if (this.stockUpForm.goodsAreaId === c.dictKey) {
+ stockup.goodsAreaId = c.dictKey;
+ stockup.goodsAreaName = c.dictValue;
+ }
+ });
+ if (this.stockUpForm.stockupDate) {
+ stockup.stockupDate = this.stockUpForm.stockupDate;
}
- if (this.waixieForm.driverPhone) {
- tripartite.driverPhone = this.waixieForm.driverPhone;
+ if (this.stockUpForm.remarks) {
+ stockup.remarks = this.stockUpForm.remarks;
}
- if (this.waixieForm.vehicleNum) {
- tripartite.vehicleNum = this.waixieForm.vehicleNum;
+ if (this.stockUpForm.outboundDate){
+ stockup.outboundDate = this.stockUpForm.outboundDate;
}
- if (this.waixieForm.deliveryFee) {
- tripartite.deliveryFee = this.waixieForm.deliveryFee;
+ stockup.loadAndUnload = this.loadAndUnload.join(',');
+ data.stockupInfo = stockup;
+ //将服务类型转为数组
+ if (this.serveType){
+ console.log("this.serveType---------->",this.serveType);
+ let serve = Object.values(this.serveType);
+ serve = serve.sort((a, b) => {
+ return a - b;
+ });
+ this.stockUpForm.serveType = serve.join(',');
+ console.log("this.stockUpForm.serveType----------->",this.stockUpForm.serveType);
}
+ //判断是否是三方配送
if (this.waixieForm.tripartiteSource) {
- this.tripartiteSourceData.forEach(item => {
- if (this.waixieForm.tripartiteSource === item.dictKey) {
- tripartite.distributionCompanyId = item.dictKey;
- tripartite.distributionCompany = item.dictValue;
+ //三方配送数据构建
+ if (this.waixieForm.driverName) {
+ tripartite.driverName = this.waixieForm.driverName;
+ }
+ if (this.waixieForm.driverPhone) {
+ tripartite.driverPhone = this.waixieForm.driverPhone;
+ }
+ if (this.waixieForm.vehicleNum) {
+ tripartite.vehicleNum = this.waixieForm.vehicleNum;
+ }
+ if (this.waixieForm.deliveryFee) {
+ tripartite.deliveryFee = this.waixieForm.deliveryFee;
+ }
+ if (this.waixieForm.tripartiteSource) {
+ this.tripartiteSourceData.forEach(item => {
+ if (this.waixieForm.tripartiteSource === item.dictKey) {
+ tripartite.distributionCompanyId = item.dictKey;
+ tripartite.distributionCompany = item.dictValue;
+ }
+ });
+ data.tripartite = tripartite;
+ }
+ } else {
+ //自主配送数据构建
+ console.log("this.driverList",this.driverList);
+ console.log("this.vehticleList",this.vehticleList);
+ if (this.driverList.length !== this.vehticleList.length) {
+ this.$message({
+ message: '司机车辆数量有误!!!',
+ type: 'warning'
+ });
+ return;
+ } else {
+ let info = [];
+ for (let i = 0; i < this.driverInfo.length; i++) {
+ let obj = {};
+ obj.driverName = this.driverInfo[i].name;
+ obj.driverPhone = this.driverInfo[i].phone;
+ obj.driverId = this.driverInfo[i].id;
+ obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
+ obj.vehicleId = this.vehticleInfo[i].id;
+ info.push(obj);
+ this.driverInfo[i].name;
}
- });
- data.tripartite = tripartite;
+ allocationInfo = info;
+ }
+ console.log(allocationInfo);
+ data.allocationInfo = allocationInfo;
}
- } else {
- //自主配送数据构建
- console.log("this.driverList",this.driverList);
- console.log("this.vehticleList",this.vehticleList);
- if (this.driverList.length !== this.vehticleList.length) {
- this.$message({
- message: '司机车辆数量有误!!!',
- type: 'warning'
+ data.masterDriverName = this.driverForm.masterDriverName;
+ data.masterVehicleNub = this.driverForm.masterVehicleNub;
+ data.stockArticle = this.orderData;
+ let reservation = {};
+ reservation.deliveryType = this.stockUpForm.deliveryType;
+ reservation.deliveryWay = this.stockUpForm.deliveryWay;
+ reservation.serveType = this.stockUpForm.serveType;
+ reservation.otherFee = this.stockUpForm.otherFee;
+ data.taskTime = this.stockUpForm.taskTime;
+ data.reservation = reservation;
+ data.id = this.deliveryListId;
+ console.log('data>>>>>>>>>>>', data);
+ updateDeliveryList(data).then(res=>{
+ this.$router.push({
+ path: '/distribution/deliverylist/distributionDeliveryListdis'
+ });
+ })
+ }else {
+ let data = {};
+ let stockup = {};
+ let tripartite = {};
+ let allocationInfo = [];
+ //备货区数据构建
+ if (this.stockUpForm.loader) {
+ this.loaderData.forEach(a => {
+ if (this.stockUpForm.loader === a.dictKey) {
+ stockup.loaderName = a.dictValue;
+ stockup.loaderId = a.dictKey;
+ }
});
- return;
- } else {
- let info = [];
- for (let i = 0; i < this.driverInfo.length; i++) {
- let obj = {};
- obj.driverName = this.driverInfo[i].name;
- obj.driverPhone = this.driverInfo[i].phone;
- obj.driverId = this.driverInfo[i].id;
- obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
- obj.vehicleId = this.vehticleInfo[i].id;
- info.push(obj);
- this.driverInfo[i].name;
- }
- allocationInfo = info;
}
- console.log(allocationInfo);
- data.allocationInfo = allocationInfo;
- }
- data.masterDriverName = this.driverForm.masterDriverName;
- data.masterVehicleNub = this.driverForm.masterVehicleNub;
- data.stockArticle = this.orderData;
- let reservation = {};
- reservation.deliveryType = this.stockUpForm.deliveryType;
- reservation.deliveryWay = this.stockUpForm.deliveryWay;
- reservation.serveType = this.stockUpForm.serveType;
- reservation.otherFee = this.stockUpForm.otherFee;
- data.taskTime = this.stockUpForm.taskTime;
- data.reservation = reservation;
- data.id = this.deliveryListId;
- console.log('data>>>>>>>>>>>', data);
- updateDeliveryList(data).then(res=>{
- this.$router.push({
- path: '/distribution/deliverylist/distributionDeliveryListdis'
+ this.forkliftData.forEach(b => {
+ if (this.stockUpForm.forklift === b.dictKey) {
+ stockup.forkliftName = b.dictValue;
+ stockup.forkliftId = b.dictKey;
+ }
});
- })
- }else {
- let data = {};
- let stockup = {};
- let tripartite = {};
- let allocationInfo = [];
- //备货区数据构建
- if (this.stockUpForm.loader) {
- this.loaderData.forEach(a => {
- if (this.stockUpForm.loader === a.dictKey) {
- stockup.loaderName = a.dictValue;
- stockup.loaderId = a.dictKey;
+ this.goodsAreaData.forEach(c => {
+ if (this.stockUpForm.goodsAreaId === c.dictKey) {
+ stockup.goodsAreaId = c.dictKey;
+ stockup.goodsAreaName = c.dictValue;
}
});
- }
- this.forkliftData.forEach(b => {
- if (this.stockUpForm.forklift === b.dictKey) {
- stockup.forkliftName = b.dictValue;
- stockup.forkliftId = b.dictKey;
+ if (this.stockUpForm.stockupDate) {
+ stockup.stockupDate = this.stockUpForm.stockupDate;
}
- });
- this.goodsAreaData.forEach(c => {
- if (this.stockUpForm.goodsAreaId === c.dictKey) {
- stockup.goodsAreaId = c.dictKey;
- stockup.goodsAreaName = c.dictValue;
- }
- });
- if (this.stockUpForm.stockupDate) {
- stockup.stockupDate = this.stockUpForm.stockupDate;
- }
- if (this.stockUpForm.remarks) {
- stockup.remarks = this.stockUpForm.remarks;
- }
- if (this.stockUpForm.outboundDate){
- stockup.outboundDate = this.stockUpForm.outboundDate;
- }
- //将服务类型转为数组
- let serve = Object.values(this.serveType);
- serve = serve.sort((a, b) => {
- return a - b;
- });
- this.stockUpForm.serveType = serve.join(',');
- stockup.loadAndUnload = this.loadAndUnload.join(',');
- //判断是否是三方配送
- if (this.waixieForm.tripartiteSource) {
- //三方配送数据构建
- if (this.waixieForm.driverName) {
- tripartite.driverName = this.waixieForm.driverName;
+ if (this.stockUpForm.remarks) {
+ stockup.remarks = this.stockUpForm.remarks;
}
- console.log("-------------->",this.waixieForm);
- if (this.waixieForm.driverPhone) {
- tripartite.driverPhone = this.waixieForm.driverPhone;
- }
- if (this.waixieForm.vehicleNum) {
- tripartite.vehicleNum = this.waixieForm.vehicleNum;
- }
- if (this.waixieForm.deliveryFee) {
- tripartite.deliveryFee = this.waixieForm.deliveryFee;
+ if (this.stockUpForm.outboundDate){
+ stockup.outboundDate = this.stockUpForm.outboundDate;
}
+ //将服务类型转为数组
+ let serve = Object.values(this.serveType);
+ serve = serve.sort((a, b) => {
+ return a - b;
+ });
+ this.stockUpForm.serveType = serve.join(',');
+ stockup.loadAndUnload = this.loadAndUnload.join(',');
+ //判断是否是三方配送
if (this.waixieForm.tripartiteSource) {
- this.tripartiteSourceData.forEach(item => {
- if (this.waixieForm.tripartiteSource === item.dictValue) {
- tripartite.distributionCompanyId = item.dictKey;
- tripartite.distributionCompany = item.dictValue;
- }
- });
- data.tripartite = tripartite;
- }
- } else {
- //自主配送数据构建
- if (this.driverList.length !== this.vehticleList.length) {
- this.$message({
- message: '司机车辆数量有误!!!',
- type: 'warning'
- });
- return;
+ //三方配送数据构建
+ if (this.waixieForm.driverName) {
+ tripartite.driverName = this.waixieForm.driverName;
+ }
+ console.log("-------------->",this.waixieForm);
+ if (this.waixieForm.driverPhone) {
+ tripartite.driverPhone = this.waixieForm.driverPhone;
+ }
+ if (this.waixieForm.vehicleNum) {
+ tripartite.vehicleNum = this.waixieForm.vehicleNum;
+ }
+ if (this.waixieForm.deliveryFee) {
+ tripartite.deliveryFee = this.waixieForm.deliveryFee;
+ }
+ if (this.waixieForm.tripartiteSource) {
+ this.tripartiteSourceData.forEach(item => {
+ if (this.waixieForm.tripartiteSource === item.dictValue) {
+ tripartite.distributionCompanyId = item.dictKey;
+ tripartite.distributionCompany = item.dictValue;
+ }
+ });
+ data.tripartite = tripartite;
+ }
} else {
- let info = [];
- for (let i = 0; i < this.driverInfo.length; i++) {
- let obj = {};
- obj.driverName = this.driverInfo[i].name;
- obj.driverPhone = this.driverInfo[i].phone;
- obj.driverId = this.driverInfo[i].id;
- obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
- obj.vehicleId = this.vehticleInfo[i].id;
- info.push(obj);
- this.driverInfo[i].name;
+ //自主配送数据构建
+ if (this.driverList.length !== this.vehticleList.length) {
+ this.$message({
+ message: '司机车辆数量有误!!!',
+ type: 'warning'
+ });
+ return;
+ } else {
+ let info = [];
+ for (let i = 0; i < this.driverInfo.length; i++) {
+ let obj = {};
+ obj.driverName = this.driverInfo[i].name;
+ obj.driverPhone = this.driverInfo[i].phone;
+ obj.driverId = this.driverInfo[i].id;
+ obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
+ obj.vehicleId = this.vehticleInfo[i].id;
+ info.push(obj);
+ this.driverInfo[i].name;
+ }
+ allocationInfo = info;
}
- allocationInfo = info;
}
- }
- data.stockup = stockup;
- data.masterDriverName = this.driverForm.masterDriverName;
- data.masterVehicleNub = this.driverForm.masterVehicleNub;
- data.allocationInfo = allocationInfo;
- data.stockArticle = this.orderData;
- let reservation = {};
- reservation.deliveryType = this.stockUpForm.deliveryType;
- reservation.deliveryWay = this.stockUpForm.deliveryWay;
- reservation.serveType = this.stockUpForm.serveType;
- reservation.otherFee = this.stockUpForm.otherFee;
- data.taskTime = this.stockUpForm.taskTime;
- data.reservation = reservation;
+ data.stockup = stockup;
+ data.masterDriverName = this.driverForm.masterDriverName;
+ data.masterVehicleNub = this.driverForm.masterVehicleNub;
+ data.allocationInfo = allocationInfo;
+ data.stockArticle = this.orderData;
+ let reservation = {};
+ reservation.deliveryType = this.stockUpForm.deliveryType;
+ reservation.deliveryWay = this.stockUpForm.deliveryWay;
+ reservation.serveType = this.stockUpForm.serveType;
+ reservation.otherFee = this.stockUpForm.otherFee;
+ data.taskTime = this.stockUpForm.taskTime;
+ data.reservation = reservation;
//编辑
// data.reservationIds = this.ids;
console.log('data>>>>>>>>>>>', data);
@@ -1246,134 +1276,134 @@
path: '/distribution/deliverylist/distributionDeliveryListdis'
});
});
- }
- },
- changeVehicle(params) {
- console.log(params);
- this.vehticleList = params;
- let b = [];
- if (params) {
- this.vehicleData.forEach(item => {
- this.vehticleList.forEach(p => {
- if (p == item.id) {
- b.push(item);
- console.log(this.driverInfo);
+ }
+ },
+ changeVehicle(params) {
+ console.log(params);
+ this.vehticleList = params;
+ let b = [];
+ if (params) {
+ this.vehicleData.forEach(item => {
+ this.vehticleList.forEach(p => {
+ if (p == item.id) {
+ b.push(item);
+ console.log(this.driverInfo);
+ }
+ });
+ if (params[0] === item.id) {
+ this.driverForm.masterVehicleNub = item.vehicleNub;
}
});
- if (params[0] === item.id) {
- this.driverForm.masterVehicleNub = item.vehicleNub;
- }
- });
- this.vehticleInfo = b;
- }
- },
- changeDriver(params) {
- this.driverList = params;
- let a = [];
- if (params) {
- this.driverData.forEach(item => {
- this.driverList.forEach(p => {
- if (p == item.id) {
- a.push(item);
- console.log(this.driverInfo);
+ this.vehticleInfo = b;
+ }
+ },
+ changeDriver(params) {
+ this.driverList = params;
+ let a = [];
+ if (params) {
+ this.driverData.forEach(item => {
+ this.driverList.forEach(p => {
+ if (p == item.id) {
+ a.push(item);
+ console.log(this.driverInfo);
+ }
+ });
+ if (params[0] === item.id) {
+ this.driverForm.masterDriverName = item.name;
}
});
- if (params[0] === item.id) {
- this.driverForm.masterDriverName = item.name;
- }
- });
- this.driverInfo = a;
- }
- },
- //上移
- moveUpVehictle(row) {
- let i = 0;
- this.vehticleInfo.forEach((item, index) => {
- if (item.id === row.id) {
- i = index;
+ this.driverInfo = a;
}
- });
- //获取当当前选中的下标,如果下标为第一个则不能上移
- if (i > 0) {
- let a = this.vehticleInfo[i - 1];
- this.vehticleInfo.splice(i - 1, 1);
- this.vehticleInfo.splice(i, 0, a);
- } else {
- this.$message({
- message: '已经是第一条,上移失败',
- type: 'warning',
+ },
+ //上移
+ moveUpVehictle(row) {
+ let i = 0;
+ this.vehticleInfo.forEach((item, index) => {
+ if (item.id === row.id) {
+ i = index;
+ }
});
- }
- console.log(this.vehticleInfo);
- },
- handleSelect(selection, row) {
- // 阻止全选框原有逻辑
- this.$refs.multipleTable.clearSelection();
- if (row) {
- if (selection.length === 1) {
- this.multipleSelection = row;
- this.$refs.multipleTable.toggleRowSelection(row, true);
- } else if (selection.length > 1) {
- let a = {};
- selection.forEach((s, index) => {
- if (s.id === row.id) {
- selection.splice(index, 1);
- a = s;
- }
+ //获取当当前选中的下标,如果下标为第一个则不能上移
+ if (i > 0) {
+ let a = this.vehticleInfo[i - 1];
+ this.vehticleInfo.splice(i - 1, 1);
+ this.vehticleInfo.splice(i, 0, a);
+ } else {
+ this.$message({
+ message: '已经是第一条,上移失败',
+ type: 'warning',
});
- this.multipleSelection = selection;
- this.$refs.multipleTable.toggleRowSelection(a, true);
}
- }
- },
- confirmDriver() {
- if (this.multipleSelection.length === 0) {
- this.$message.warning('请选择至少一条数据');
- return;
- }
- console.log('this.adada', this.multipleSelection);
- this.isDriverShow = false;
- //获取到表格的行坐标
- let a = 0;
- this.driverInfo.forEach((item, index) => {
- if (item.id === this.multipleSelection.id) {
- a = index;
+ console.log(this.vehticleInfo);
+ },
+ handleSelect(selection, row) {
+ // 阻止全选框原有逻辑
+ this.$refs.multipleTable.clearSelection();
+ if (row) {
+ if (selection.length === 1) {
+ this.multipleSelection = row;
+ this.$refs.multipleTable.toggleRowSelection(row, true);
+ } else if (selection.length > 1) {
+ let a = {};
+ selection.forEach((s, index) => {
+ if (s.id === row.id) {
+ selection.splice(index, 1);
+ a = s;
+ }
+ });
+ this.multipleSelection = selection;
+ this.$refs.multipleTable.toggleRowSelection(a, true);
+ }
}
- });
- this.driverForm.masterDriverName = this.driverInfo[a].name;
- this.driverForm.masterVehicleNub = this.vehticleInfo[a].vehicleNub;
- },
- // //数据字典数据获取
- getDictionary() {
- getDictionaryBiz('addvalue_serve_type').then(res => {
- this.addvalueServeTypeData = res.data.data;
- });
- getDictionaryBiz('load_and_unload').then(res => {
- this.loadAndUnloadData = res.data.data;
- });
- getDictionaryBiz('delivery_way').then(res => {
- this.deliveryWayData = res.data.data;
- });
- //三方外协来源
- getDictionaryBiz('tripartite_source').then(res => {
- this.tripartiteSourceData = res.data.data;
- });
- },
+ },
+ confirmDriver() {
+ if (this.multipleSelection.length === 0) {
+ this.$message.warning('请选择至少一条数据');
+ return;
+ }
+ console.log('this.adada', this.multipleSelection);
+ this.isDriverShow = false;
+ //获取到表格的行坐标
+ let a = 0;
+ this.driverInfo.forEach((item, index) => {
+ if (item.id === this.multipleSelection.id) {
+ a = index;
+ }
+ });
+ this.driverForm.masterDriverName = this.driverInfo[a].name;
+ this.driverForm.masterVehicleNub = this.vehticleInfo[a].vehicleNub;
+ },
+ // //数据字典数据获取
+ getDictionary() {
+ getDictionaryBiz('addvalue_serve_type').then(res => {
+ this.addvalueServeTypeData = res.data.data;
+ });
+ getDictionaryBiz('load_and_unload').then(res => {
+ this.loadAndUnloadData = res.data.data;
+ });
+ getDictionaryBiz('delivery_way').then(res => {
+ this.deliveryWayData = res.data.data;
+ });
+ //三方外协来源
+ getDictionaryBiz('tripartite_source').then(res => {
+ this.tripartiteSourceData = res.data.data;
+ });
+ },
ccc() {
- if (this.deliveryListId){
- //清空司机、车辆信息
+ if (this.deliveryListId){
+ //清空司机、车辆信息
- this.waixieForm.tripartiteSource = '';
- this.waixieForm.driverName = '';
- this.waixieForm.driverPhone = '';
- this.waixieForm.vehicleNum = '';
- this.waixieForm.deliveryFee = '';
+ this.waixieForm.tripartiteSource = '';
+ this.waixieForm.driverName = '';
+ this.waixieForm.driverPhone = '';
+ this.waixieForm.vehicleNum = '';
+ this.waixieForm.deliveryFee = '';
- }else {
- this.loadAndUnload = [];
- this.serveType=[];
- this.waixieForm = {};
- }
+ }else {
+ this.loadAndUnload = [];
+ this.serveType=[];
+ this.waixieForm = {};
+ }
this.aaa = true;
this.bbb = false;
this.stockUpForm.deliveryType="1";
@@ -1385,16 +1415,16 @@
this.stockUpForm.taskTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
},
ddd() {
- if (this.deliveryListId){
- this.vehicleIds=[];
- this.deliveryDriver=[];
- this.driverForm.masterDriverName = '';
- this.driverForm.masterVehicleNub = '';
- }else {
- this.loadAndUnload = [];
- this.serveType=[];
- this.waixieForm={};
- }
+ if (this.deliveryListId){
+ this.vehicleIds=[];
+ this.deliveryDriver=[];
+ this.driverForm.masterDriverName = '';
+ this.driverForm.masterVehicleNub = '';
+ }else {
+ this.loadAndUnload = [];
+ this.serveType=[];
+ this.waixieForm={};
+ }
this.aaa = false;
this.bbb = true;
this.stockUpForm.deliveryType="1";
@@ -1405,38 +1435,73 @@
this.stockUpForm.stockupDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.stockUpForm.taskTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
},
- handleAddOrder() {
- //TODO 这里还缺少对于订单状态的筛选条件
+ handleAddOrder() {
+ //TODO 这里还缺少对于订单状态的筛选条件
this.query.typeService=1;
this.query.genre = "1";
+ const page = this.page;
let params = {};
- selectStockArticleAndParcel(Object.assign(params,this.query)).then(res=>{
+ console.log("------------->",this.query);
+ selectStockArticleInfoList(page.currentPage,page.pageSize,Object.assign(params,this.query)).then(res=>{
console.log(res.data.data);
const data = res.data.data;
- data.forEach(item => {
- if (this.orderData){
- this.orderData.forEach(a=>{
- if (item.id === a.id){
- item.packageList = a.packageList;
+ this.page.total = data.total;
+ this.stockArticleInfo = data.records;
+ this.stockArticleInfo.forEach((item,index)=>{
+ if (this.orderData){
+ this.orderData.forEach(a=> {
+ if (item.id === a.id) {
+ this.$nextTick(() => {
+ this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
+ })
}
})
}
- // item.reservationNum = item.handQuantity;
- });
- this.page.total = data.total;
- this.stockArticleInfo = data;
+ })
this.loading = false;
this.query={};
// this.selectionClear();
-
- if (this.deliveryListId) {
- //编辑
- console.log("---->", this.stockArticleInfo);
- this.stockArticleInfo.forEach((item, index) => {
- console.log("aaa", item, index);
- this.orderData.forEach(o => {
- console.log("bbb", o);
- if (item.id === o.id) {
+ // if (this.deliveryListId) {
+ // //编辑
+ // console.log("---->", this.stockArticleInfo);
+ // this.stockArticleInfo.forEach((item, index) => {
+ // console.log("aaa", item, index);
+ // this.orderData.forEach(o => {
+ // console.log("bbb", o);
+ // if (item.id === o.id) {
+ // this.$nextTick(() => {
+ // this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
+ // })
+ // }
+ // })
+ // })
+ // }
+ })
+ //新增
+ this.orderShow = true;
+ },
+ searchReset(){
+ this.query={
+ typeService:1,
+ genre:'1'
+ };
+ this.searchChange();
+ },
+ searchChange(){
+ let params = {};
+ this.query.typeService=1;
+ this.query.genre = "1";
+ console.log("query------------->",this.query);
+ const page = this.page;
+ selectStockArticleInfoList(page.currentPage,page.pageSize,Object.assign(params,this.query)).then(res=>{
+ console.log("------------------->",res);
+ const data = res.data.data
+ this.stockArticleInfo = data.records;
+ if (this.orderData){
+ this.stockArticleInfo.forEach((item,index)=>{
+ this.orderData.forEach(order=>{
+ if (item.id === order.id){
+ console.log("----------->");
this.$nextTick(() => {
this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
})
@@ -1445,10 +1510,23 @@
})
}
})
-
- //新增
-
- this.orderShow = true;
+ // selectStockArticleAndParcel(Object.assign(params,this.query)).then(res=>{
+ // console.log("res------------>",res.data.data);
+ // const data = res.data.data
+ // this.stockArticleInfo = data;
+ // if (this.deliveryListId){
+ // this.stockArticleInfo.forEach((item,index)=>{
+ // this.orderData.forEach(order=>{
+ // if (item.id === order.id){
+ // console.log("----------->");
+ // this.$nextTick(() => {
+ // this.$refs.stockArticleTable.toggleRowSelection(this.stockArticleInfo[index], true);
+ // })
+ // }
+ // })
+ // })
+ // }
+ // })
},
handleAddInventory() {
this.form.deliveryType ='1';
@@ -1472,89 +1550,89 @@
this.selectionList = [];
this.query={};
},
- async onLoad(page, params = {}) {
+ async onLoad(page, params = {}) {
console.log("》》》》》》》》》》》》》》》",this.deliveryListId);
if (this.deliveryListId){
- getDeliveryList(this.deliveryListId).then( async res=>{
- let data = res.data.data;
- Object.assign(this.stockUpForm,data.reservationInfo)
- Object.assign(this.stockUpForm,data.stockupInfo)
- this.stockUpForm.deliveryType = '1';
- this.stockUpForm.deliveryWay = data.reservationInfo.deliveryWay;
- this.serveType = data.reservationInfo.serveType.split(",");
- if (data.stockupInfo){
- this.loadAndUnload = data.stockupInfo.teamResponsibility.split(",");
+ getDeliveryList(this.deliveryListId).then( async res=>{
+ let data = res.data.data;
+ Object.assign(this.stockUpForm,data.reservationInfo)
+ Object.assign(this.stockUpForm,data.stockupInfo)
+ this.stockUpForm.deliveryType = '10';
+ this.stockUpForm.deliveryWay = data.reservationInfo.deliveryWay;
+ this.serveType = data.reservationInfo.serveType.split(",");
+ if (data.stockupInfo){
+ this.loadAndUnload = data.stockupInfo.teamResponsibility.split(",");
+ }
+ // data.deliverySelfVO
+ this.stockUpForm.loader = data.stockupInfo.loaderId;
+ this.stockUpForm.forklift = data.stockupInfo.forkliftId;
+ this.stockUpForm.outboundDate = data.stockupInfo.outboundDate;
+ this.stockUpForm.remarks = data.stockupInfo.remarks;
+ this.stockUpForm.taskTime = data.taskTime;
+ data.stockArticleList.forEach(item=>{
+ if (item.packageList){
+ item.packageList = item.packageList;
+ item.packageListInfo = item.packageList;
}
- // data.deliverySelfVO
- this.stockUpForm.loader = data.stockupInfo.loaderId;
- this.stockUpForm.forklift = data.stockupInfo.forkliftId;
- this.stockUpForm.outboundDate = data.stockupInfo.outboundDate;
- this.stockUpForm.remarks = data.stockupInfo.remarks;
- this.stockUpForm.taskTime = data.taskTime;
- data.stockArticleList.forEach(item=>{
- if (item.packageList){
- item.packageList = item.packageList;
- item.packageListInfo = item.packageList;
- }
+ })
+ this.orderData = data.stockArticleList;
+ if (data.teamResponsibility){
+ this.loadAndUnload =data.teamResponsibility.split(",");
+ }
+ console.log("data.kind",data.kind);
+ if (data.kind === "1"){
+ //自主配送
+ let self = data.deliverySelfVO;
+ let vehicle =await this.getvehicleData();
+ console.log("___________________-->",vehicle);
+ let driver =await this.getMasterDriverData();
+ let a = [];
+ let b = [];
+ let vehicleInfo = [];
+ vehicle.forEach(item => {
+ self.forEach(s => {
+ if (item.id === s.vehicleId) {
+ a.push(s.vehicleId);
+ vehicleInfo.push(item);
+ }
+ if (s.isMaster === 2) {
+ this.driverForm.masterVehicleNub = s.vehicleNub;
+ }
+ });
})
- this.orderData = data.stockArticleList;
- if (data.teamResponsibility){
- this.loadAndUnload =data.teamResponsibility.split(",");
- }
- console.log("data.kind",data.kind);
- if (data.kind === "1"){
- //自主配送
- let self = data.deliverySelfVO;
- let vehicle =await this.getvehicleData();
- console.log("___________________-->",vehicle);
- let driver =await this.getMasterDriverData();
- let a = [];
- let b = [];
- let vehicleInfo = [];
- vehicle.forEach(item => {
- self.forEach(s => {
- if (item.id === s.vehicleId) {
- a.push(s.vehicleId);
- vehicleInfo.push(item);
- }
- if (s.isMaster === 2) {
- this.driverForm.masterVehicleNub = s.vehicleNub;
- }
- });
- })
- this.vehticleList = a;
- this.vehicleIds = a;
- console.log(" this.vehicleIds", this.vehicleIds);
- this.vehticleInfo = vehicleInfo;
- let driverInfo = [];
- driver.forEach(item => {
- self.forEach(s => {
- if (item.id === s.driverId) {
- b.push(s.driverId);
- driverInfo.push(item);
- }
- if (s.isMaster === 2) {
- this.driverForm.masterDriverName = s.driverName;
- }
- });
+ this.vehticleList = a;
+ this.vehicleIds = a;
+ console.log(" this.vehicleIds", this.vehicleIds);
+ this.vehticleInfo = vehicleInfo;
+ let driverInfo = [];
+ driver.forEach(item => {
+ self.forEach(s => {
+ if (item.id === s.driverId) {
+ b.push(s.driverId);
+ driverInfo.push(item);
+ }
+ if (s.isMaster === 2) {
+ this.driverForm.masterDriverName = s.driverName;
+ }
});
- this.deliveryDriver = b;
- this.driverList = b;
- this.driverInfo = driverInfo;
- }else {
- let deliveryTripartiteVO = data.deliveryTripartiteVO;
- this.aaa = false;
- this.bbb = true;
- // this.form.tripartiteSource = deliveryTripartiteVO.distributionCompanyId;
- this.waixieForm.tripartiteSource = "1";
- this.waixieForm.driverName = deliveryTripartiteVO.driverName ;
- this.waixieForm.vehicleNum = deliveryTripartiteVO.vehicleNum ;
- this.waixieForm.driverPhone = deliveryTripartiteVO.driverPhone ;
- this.waixieForm.deliveryFee = deliveryTripartiteVO.deliveryFee ;
- //外协配送
- }
- console.log("-------------->",res.data.data);
- })
+ });
+ this.deliveryDriver = b;
+ this.driverList = b;
+ this.driverInfo = driverInfo;
+ }else {
+ let deliveryTripartiteVO = data.deliveryTripartiteVO;
+ this.aaa = false;
+ this.bbb = true;
+ // this.form.tripartiteSource = deliveryTripartiteVO.distributionCompanyId;
+ this.waixieForm.tripartiteSource = "1";
+ this.waixieForm.driverName = deliveryTripartiteVO.driverName ;
+ this.waixieForm.vehicleNum = deliveryTripartiteVO.vehicleNum ;
+ this.waixieForm.driverPhone = deliveryTripartiteVO.driverPhone ;
+ this.waixieForm.deliveryFee = deliveryTripartiteVO.deliveryFee ;
+ //外协配送
+ }
+ console.log("-------------->",res.data.data);
+ })
this.isDisable=true;
}else {
this.stockUpForm.deliveryType="1";
@@ -1566,40 +1644,40 @@
this.stockUpForm.outboundDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
}
this.loading = false;
+ },
},
- },
-};
+ };
diff --git a/src/views/distribution/turndelivery/deliveryMarket.vue b/src/views/distribution/turndelivery/deliveryMarket.vue
index 99ece945..aaf6d641 100644
--- a/src/views/distribution/turndelivery/deliveryMarket.vue
+++ b/src/views/distribution/turndelivery/deliveryMarket.vue
@@ -195,14 +195,14 @@
-
+
-
+
@@ -344,7 +344,7 @@
import option from '@/option/distribution/distributionReservation';
import { getListTeamInfo } from '@/api/basicdata/basicdataTeamGroup';
import { deliveryTask, getReservationAddr } from '@/api/distribution/distributionReservation';
- import { getMarketDeliveryList } from '@/api/distribution/distributionDeliveryList';
+ import { getMarketDeliveryList,updateMarketDelivery } from '@/api/distribution/distributionDeliveryList';
import { getListUser } from '@/api/distribution/distributionStockup';
import { getPostList } from '@/api/system/post';
import { getListOwn } from '@/api/system/user';
@@ -497,6 +497,7 @@
this.getTeam();
this.getvehicleData();
this.getMasterDriverData();
+ this.onLoad(this.page);
},
computed: {
...mapGetters(['permission']),
@@ -508,9 +509,8 @@
return ids.join(',');
}
},
-
mounted() {
- this.onLoad(this.page);
+ // this.onLoad(this.page);
},
methods: {
//查询叉车人员
@@ -633,6 +633,8 @@
if (this.$route.query.deliveryId) {
this.deliveryListId = this.$route.query.deliveryId;
}
+ this.loading = false;
+
},
removeStockArticle(row){
@@ -643,7 +645,13 @@
});
return;
}
-
+ let data = this.data;
+ data.forEach((item,index)=>{
+ if (item.id === row.id){
+ data.splice(index, 1);
+ }
+ })
+ this.data = data;
console.log("row------------->",row);
},
viewDriverInfo() {
@@ -685,6 +693,7 @@
for (let i = 0; i < this.driverInfo.length; i++) {
let obj = {};
obj.driver = this.driverInfo[i].name;
+ obj.driverName = this.driverInfo[i].name;
obj.driverId = this.driverInfo[i].id;
obj.driverPhone = this.driverInfo[i].phone;
obj.vehicleNub = this.vehticleInfo[i].vehicleNub;
@@ -767,8 +776,8 @@
}
data.stockup = stockup;
}
- if (this.form.taskTime) {
- data.taskTime = this.form.taskTime;
+ if (this.stockUpForm.taskTime) {
+ data.taskTime = this.stockUpForm.taskTime.toString();
}
}
console.log('this.data------------>', this.data);
@@ -782,10 +791,19 @@
});
});
} else {
- data.reservationInfos =this.data ;
- console.log('>>>>>>>>>>>>', data);
-
- console.log('-------------》', '修改提交');
+ data.reservationInfos =this.data;
+ data.id = this.deliveryListId;
+ data.stockupInfo = stockup;
+ updateMarketDelivery(data).then(res=>{
+ if (res.data.data.code === 200){
+ this.$message({
+ message: res.data.data.msg,
+ type: 'warning'
+ });
+ this.$router.go(-1)
+ return;
+ }
+ })
}
},
changeVehicle(params) {
@@ -952,8 +970,8 @@
this.stockUpForm.deliveryType = '2';
this.stockUpForm.deliveryWay = '2';
this.stockUpForm.stockupDate = new Date();
- this.form.taskTime = new Date();
this.stockUpForm.outboundDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
+ this.stockUpForm.taskTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.stockUpForm.otherFee = 0;
this.loadAndUnload = ['1', '2'];
if (this.reservationIds) {
@@ -984,7 +1002,7 @@
this.stockUpForm.loader = deliveryData.stockupInfo.loaderId;
this.stockUpForm.taskTime = deliveryData.taskTime;
console.log('reservationInfo--------------->', res.data.data.reservationInfo);
- this.data = res.data.data.reservationInfos;
+ this.data = deliveryData.reservationInfos;
if (deliveryData.kind === '1') {
//自主配送
let self = deliveryData.deliverySelfVO;
@@ -1025,7 +1043,15 @@
this.driverList = b;
this.driverInfo = driverInfo;
} else {
-
+ let deliveryTripartiteVO = deliveryData.deliveryTripartiteVO;
+ this.aaa = false;
+ this.bbb = true;
+ // this.form.tripartiteSource = deliveryTripartiteVO.distributionCompanyId;
+ this.waixieForm.tripartiteSource = "1";
+ this.waixieForm.driverName = deliveryTripartiteVO.driverName ;
+ this.waixieForm.vehicleNum = deliveryTripartiteVO.vehicleNum ;
+ this.waixieForm.driverPhone = deliveryTripartiteVO.driverPhone ;
+ this.waixieForm.deliveryFee = deliveryTripartiteVO.deliveryFee ;
}
});
}