Browse Source

预约维护包件信息

dev-warehouse
kilo 2 years ago
parent
commit
0aaecfddc0
  1. 12
      src/router/views/index.js
  2. 298
      src/views/distribution/reservation/reservationFrom.vue
  3. 25
      src/views/distribution/turndelivery/deliveryInfo.vue
  4. 2
      vite.config.js

12
src/router/views/index.js

@ -423,6 +423,18 @@ export default [
},
],
},
{
path: '/distribution/deliverylist/distributionDeliveryList',
component: Layout,
redirect: '/distribution/deliverylist/distributionDeliveryList',
children: [
{
path: '/distribution/deliverylist/distributionDeliveryList',
id:'id',
component: () => import('@/views/distribution/deliverylist/distributionDeliveryList.vue'),
},
],
},
{
path: '/distribution/turndelivery/deliveryInfo',
component: Layout,

298
src/views/distribution/reservation/reservationFrom.vue

@ -32,13 +32,14 @@
</el-col>
<el-col :span="10">
<el-form-item label="时&emsp;&emsp;段:" prop="deliveryAddress" label-width="100px">
<el-radio-group v-model="form.periodOfTime" v-for="item in this.periodOfTimeData">
<el-radio-group v-model="form.periodOfTime" v-for="item in this.periodOfTimeData">
<el-radio
:label="item.dictKey"
:value="item.dictKey">{{item.dictValue}}&emsp;</el-radio>
:value="item.dictKey">{{item.dictValue}}&emsp;
</el-radio>
</el-radio-group>
<!-- :label="item.dictValue"-->
<!-- :label="item.dictValue"-->
</el-form-item>
</el-col>
@ -55,8 +56,9 @@
<el-form-item label="配送类型:" prop="serveType" label-width="100px">
<el-radio-group v-model="form.deliveryType" v-for="item in this.deliveryTypeData">
<el-radio
:label="item.dictKey"
:value="item.dictKey">{{item.dictValue}}&emsp;</el-radio>
:label="item.dictKey"
:value="item.dictKey">{{item.dictValue}}&emsp;
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -76,9 +78,10 @@
</el-col>
<el-col :span="10">
<el-form-item label="配送方式:" prop="serveType" label-width="100px">
<el-radio-group v-model="form.deliveryWay" v-for="item in this.deliveryWayData" >
<el-radio-group v-model="form.deliveryWay" v-for="item in this.deliveryWayData">
<el-radio :label="item.dictKey"
:value="item.dictKey">{{item.dictValue}}&emsp;</el-radio>
:value="item.dictKey">{{item.dictValue}}&emsp;
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -89,7 +92,7 @@
<el-row>
<el-col :span="10">
<el-form-item label="到付运费:" prop="collectFee" label-width="100px">
<el-input type="number" v-model="form.collectFee" :disabled="true" />
<el-input type="number" v-model="form.collectFee" :disabled="true"/>
</el-form-item>
</el-col>
@ -97,8 +100,9 @@
<el-form-item label="服务类型:" prop="serveType" label-width="100px">
<!-- <el-input v-model="form.serveType" clearable placeholder="请选择服务类型"/>-->
<el-checkbox-group v-model="serveType" v-for="item in this.addvalueServeTypeData">
<el-checkbox :label="item.dictKey"
:value="item.dictKey">{{item.dictValue}}&emsp;</el-checkbox>
<el-checkbox :label="item.dictKey"
:value="item.dictKey">{{item.dictValue}}&emsp;
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
@ -137,15 +141,17 @@
</el-table-column>
</template>
<el-table-column label="预约数量" type="index" width="100px">
<el-table-column label="包件数量" type="index" width="100px">
<template #="{row}">
<el-input v-model="row.reservationNum" type="number" :disabled="true" placeholder="请输入内容"></el-input>
<el-input v-model="row.reservationNum" type="number" :disabled="true"
placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" link icon="el-icon-view" @click="viewStockArticlePackage(row)">查看包件
<el-button type="primary" link icon="el-icon-view"
@click="viewStockArticlePackage(row)">查看包件
</el-button>
<el-button type="primary" link icon="el-icon-delete" @click="addvalueServe(row)">增值服务
</el-button>
@ -182,7 +188,7 @@
</el-table-column>
<el-table-column prop="menu" label="操作" :width="220" align="center">
<template #="{row}">
<el-button type="primary" link icon="el-icon-edit" @click="removeStockList(row)">移除
<el-button type="primary" link icon="el-icon-edit" @click="removeStockList(row)">移除
</el-button>
</template>
</el-table-column>
@ -330,7 +336,8 @@
:height="height"
style="width: 100%"
:border="option.border">
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
<el-table-column type="selection" v-if="option.selection" width="55"
align="center"></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="60" align="center">
</el-table-column>
@ -370,7 +377,7 @@
v-for="(item,index) in addvalueServeTypeData"
:key="item.dictKey"
:label="item.dictKey"
>{{item.dictValue}
>{{item.dictValue}}
<span v-if="index===0||index===6||index===2||index===4">&nbsp;件数:
<el-input type="number" v-model="item.f"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@ -431,7 +438,7 @@
import { getDetailDelivery, addDelivery } from '@/api/distribution/distributionDelivery';
import { addIncrement } from '@/api/distribution/distributionStockArticle';
import { getInventoryList } from '@/api/distribution/distributionStockList';
import { getListOwn } from "@/api/distribution/distributionParcelList";
import { getListOwn } from '@/api/distribution/distributionParcelList';
// import option from "@/option/distribution/distributionDelivery";
import option from '@/option/distribution/distributionStockArticle';
@ -509,8 +516,9 @@
inventoryData: [],
orderData: [],
stockListShow: false,
isaddvalue:false,
packageData:[],
isaddvalue: false,
packageData: [],
packageList: []
};
},
created() {
@ -590,9 +598,11 @@
this.onLoad(this.page);
},
handleAddOrder() {
this.selectionList = [];
this.orderShow = true;
},
handleAddInventory() {
this.selectionList = [];
this.stockListShow = true;
},
handleCheckedCitiesChange(value) {
@ -665,100 +675,104 @@
this.onLoad(this.page);
},
viewStockArticlePackage(row) {
this.loading=true;
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",row);
this.loading = true;
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', row);
this.isaddvalue = true;
getListOwn("1","10",{stockArticleId : row.id}).then(res=>{
const packages = res.data.data
console.log(">>>>>>>",packages);
getListOwn('1', '10', { stockArticleId: row.id }).then(res => {
const packages = res.data.data;
console.log('>>>>>>>', packages);
this.packageData = packages.records;
this.loading = false;
})
});
},
onSubmitPackage(){
console.log(">>>>>>>>>>>>",this.selectionList);
this.orderData.forEach(item=>{
onSubmitPackage() {
console.log('>>>>>>>>>>>>', this.selectionList);
this.orderData.forEach(item => {
item.reservationNum = 0;
this.selectionList.forEach(list=>{
if (item.id === list.stockArticleId){
this.selectionList.forEach(list => {
if (item.id === list.stockArticleId) {
item.reservationNum += list.quantity;
}
})
})
this.isaddvalue=false;
});
item.packageList = this.selectionList;
});
console.log("+++++++++++++++",this.orderData);
this.isaddvalue = false;
},
onSubmit() {
//
let orderIds = [];
let inventoryIds = [];
let inventoryList = [];
let stockArticleList = [];
let operation = true;
this.orderData.forEach(item => {
if (item.reservationNum === '0'){
this.$message({
type: 'warning',
message: '请选择' + item.orderSelfNumbering + '包件数量!'
});
operation = false;
}
orderIds.push(item.id);
item.reservationNum = item.reservationNum;
stockArticleList.push(item);
});
this.inventoryData.forEach(item => {
if (item.reservationNum==="0" || item.reservationNum > item.quantityStock) {
this.$message({
type: 'warning',
message: '请输入' + item.orderSelfNumbering + '正确数量!'
});
operation = false;
}
item.reservationNum = item.reservationNum;
inventoryIds.push(item.id);
inventoryList.push(item);
});
orderIds.join(',');
inventoryIds.join(',');
this.form.stockArticleIds = orderIds.toString();
this.form.inventoryIds = inventoryIds.toString();
this.form.inventoryList = inventoryList;
this.form.stockArticleList = stockArticleList;
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;
}
});
this.periodOfTimeData.forEach(item => {
if (this.form.periodOfTime === item.dictValue) {
this.form.periodOfTime = item.dictKey;
}
});
this.form.serveType = this.serveType.join(",")
if (operation){
if (this.reservationId){
update(this.form).then(()=>{
this.$router.go(-1);
this.$message({
type: 'success',
message: '操作成功!'
});
})
}else {
add(this.form).then(() => {
this.$router.go(-1);
this.$message({
type: 'success',
message: '操作成功!'
});
});
}
//
let orderIds = [];
let inventoryIds = [];
let inventoryList = [];
let stockArticleList = [];
let operation = true;
this.orderData.forEach(item => {
if (item.reservationNum === '0') {
this.$message({
type: 'warning',
message: '请选择' + item.orderSelfNumbering + '包件数量!'
});
operation = false;
}
orderIds.push(item.id);
item.reservationNum = item.reservationNum;
stockArticleList.push(item);
});
this.inventoryData.forEach(item => {
if (item.reservationNum === '0' || item.reservationNum > item.quantityStock) {
this.$message({
type: 'warning',
message: '请输入' + item.orderSelfNumbering + '正确数量!'
});
operation = false;
}
item.reservationNum = item.reservationNum;
inventoryIds.push(item.id);
inventoryList.push(item);
});
orderIds.join(',');
inventoryIds.join(',');
this.form.stockArticleIds = orderIds.toString();
this.form.inventoryIds = inventoryIds.toString();
this.form.inventoryList = inventoryList;
this.form.stockArticleList = stockArticleList;
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;
}
});
this.periodOfTimeData.forEach(item => {
if (this.form.periodOfTime === item.dictValue) {
this.form.periodOfTime = item.dictKey;
}
});
this.form.serveType = this.serveType.join(',');
// this.form.packageList = this.packageList;
console.log(">>>>>>>>",this.form);
// if (operation){
// if (this.reservationId){
// update(this.form).then(()=>{
// this.$router.go(-1);
// this.$message({
// type: 'success',
// message: '!'
// });
// })
// }else {
// add(this.form).then(() => {
// this.$router.go(-1);
// this.$message({
// type: 'success',
// message: '!'
// });
// });
// }
// }
},
handleClose(done) {
this.$confirm('确认关闭?')
@ -769,21 +783,21 @@
});
},
removeStockArticle(row) {
this.orderData.forEach((item,index)=>{
if (item.id === row.id){
this.orderData.splice(index,1);
this.orderData.forEach((item, index) => {
if (item.id === row.id) {
this.orderData.splice(index, 1);
}
console.log(item);
})
});
console.log('>>>>>>>>>>>>>>>row', row);
},
removeStockList(row) {
this.inventoryData.forEach((item,index)=>{
if (item.id === row.id){
this.inventoryData.splice(index,1);
this.inventoryData.forEach((item, index) => {
if (item.id === row.id) {
this.inventoryData.splice(index, 1);
}
console.log(item);
})
});
console.log('>>>>>>>>>>>>>>>row', row);
},
handleView(row) {
@ -864,42 +878,42 @@
});
return;
}
if (this.orderData.length>=1) {
if (this.orderData.length >= 1) {
let flag = false;
this.selectionList.some(i => {
//
let b = this.orderData.filter(a=>{
return i.customerName !== a.customerName && i.customerTelephone !== a.customerTelephone && i.customerAddress !== a.customerAddress
}).length>=1;
console.log(">>>>>>>>>>>>>>>",b);
let b = this.orderData.filter(a => {
return i.customerName !== a.customerName && i.customerTelephone !== a.customerTelephone && i.customerAddress !== a.customerAddress;
}).length >= 1;
console.log('>>>>>>>>>>>>>>>', b);
//
let a = this.orderData.filter((ele) => ele.id == i.id).length >= 1;
if (!b){
if (!a){
if (!b) {
if (!a) {
this.orderData.push(i);
}else {
} else {
flag = true;
}
}
});
if (flag){
this.$message({
type: 'warning',
message: '请选择同一顾客订单!'
});
if (flag) {
this.$message({
type: 'warning',
message: '请选择同一顾客订单!'
});
}
} else {
this.orderData = this.selectionList;
let a = 0 ;
this.orderData.forEach(item=>{
if (item.collectFee){
a += parseInt(item.collectFee);
}
})
let a = 0;
this.orderData.forEach(item => {
if (item.collectFee) {
a += parseInt(item.collectFee);
}
});
this.form.collectFee = a;
console.log("@@@@@@@@@@@@@@@@@@",a);
console.log('@@@@@@@@@@@@@@@@@@', a);
}
this.orderShow = false;
@ -926,7 +940,7 @@
let phone = '';
let address = '';
let typeService = '';
console.log(">>>>>>>>>>>>>",data);
console.log('>>>>>>>>>>>>>', data);
for (let i = 0; i < data.length; i++) {
if (i === 0) {
name = data[0].customerName;
@ -953,20 +967,20 @@
this.form.deliveryType = reservation.deliveryType;
this.form.periodOfTime = reservation.periodOfTime;
this.form.periodOfTime = reservation.periodOfTime;
if (reservation.serveType){
if (reservation.serveType) {
//','
this.serveType = Array.from(reservation.serveType).filter(s=>{
return s !==','
})
this.serveType = Array.from(reservation.serveType).filter(s => {
return s !== ',';
});
}
this.form = reservation;
});
}
getInventoryList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const inventoryList = res.data.data;
inventoryList.records.forEach(item=>{
item.reservationNum = "0";
})
inventoryList.records.forEach(item => {
item.reservationNum = '0';
});
this.page.total = inventoryList.total;
this.inventoryInfo = inventoryList.records;
this.loading = false;
@ -975,9 +989,9 @@
this.query.genre = 1;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
data.records.forEach(item=>{
item.reservationNum = "0";
})
data.records.forEach(item => {
item.reservationNum = item.handQuantity;
});
this.page.total = data.total;
this.stockArticleInfo = data.records;
this.loading = false;

25
src/views/distribution/turndelivery/deliveryInfo.vue

@ -355,7 +355,7 @@
<template #="{row}">
<span>
<!-- <el-button type="primary" text size="small" @click="MoveUpVehictle(row)">置顶-->
<!-- </el-button>-->
<!-- </el-button>-->
<el-button type="primary" text size="small" @click="moveUpVehictle(row)">上移
</el-button>
</span>
@ -756,7 +756,7 @@
const params = this.form;
let stockup = {};
let tripartite = {};
let allocationInfo=[];
let allocationInfo = [];
//
if (params.loader) {
this.loaderData.forEach(a => {
@ -786,7 +786,7 @@
}
stockup.loadAndUnload = this.loadAndUnload.join(',');
//
if (params.tripartiteSource){
if (params.tripartiteSource) {
//
if (params.driverName) {
tripartite.driverName = params.driverName;
@ -808,7 +808,7 @@
}
});
}
}else {
} else {
//
if (this.driverList.length !== this.vehticleList.length) {
this.$message({
@ -820,16 +820,17 @@
let info = [];
for (let i = 0; i < this.driverInfo.length; i++) {
let obj = {};
obj.driver = this.driverInfo[i].name
obj.driverId = this.driverInfo[i].id
obj.driver = this.driverInfo[i].name;
obj.driverId = this.driverInfo[i].id;
obj.vehicle = this.vehticleInfo[i].vehicleNub;
obj.vehicleId = this.vehticleInfo[i].id;
info.push(obj); this.driverInfo[i].name;
info.push(obj);
this.driverInfo[i].name;
}
allocationInfo = info;
}
}
let data ={};
let data = {};
data.stockup = stockup;
data.masterDriverName = this.form.masterDriverName;
data.masterVehicleNub = this.form.masterVehicleNub;
@ -837,9 +838,11 @@
data.tripartite = tripartite;
data.reservationIds = this.ids;
console.log(data);
deliveryTask(data).then((res)=>{
console.log(res);
})
deliveryTask(data).then((res) => {
this.$router.push({
path: '/distribution/deliverylist/distributionDeliveryList'
});
});
},
onLoad() {
this.loading = false;

2
vite.config.js

@ -12,7 +12,7 @@ export default ({ mode, command }) => {
port: 2888,
proxy: {
'/api': {
target: 'http://192.168.2.11:8889',
target: 'http://192.168.2.29:13000',
//target: 'http://test3.javablade.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),

Loading…
Cancel
Save