|
|
|
@ -124,7 +124,9 @@
|
|
|
|
|
<el-col :span="10"> |
|
|
|
|
<el-form-item label="安  装:" prop="serveType" label-width="100px"> |
|
|
|
|
<el-radio-group v-model="form.isInstall" v-for="item in this.whetherData"> |
|
|
|
|
<el-radio :label="item.dictKey" :value="item.dictKey">{{ item.dictValue }}  </el-radio> |
|
|
|
|
<el-radio :label="item.dictKey" :value="item.dictKey" |
|
|
|
|
>{{ item.dictValue }}  |
|
|
|
|
</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
@ -297,7 +299,7 @@
|
|
|
|
|
<!-- </template> --> |
|
|
|
|
|
|
|
|
|
<!-- 零担品类信息 --> |
|
|
|
|
<el-dialog v-model="zeroOrderShow" title="零担品类信息" width="80%" :model="zeroOrderData"> |
|
|
|
|
<el-dialog v-model="zeroOrderShow" title="零担品类信息" width="60%" :model="zeroOrderData"> |
|
|
|
|
<el-row :gutter="24" class="rows"> |
|
|
|
|
<el-col :xl="4" :lg="7" :md="8" :sm="24"> |
|
|
|
|
<h3> |
|
|
|
@ -307,64 +309,27 @@
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<template v-if="zeroOrderData != null"> |
|
|
|
|
<div v-for="(item, index) in zeroOrderData" :key="index"> |
|
|
|
|
<el-row :gutter="24" class="rows"> |
|
|
|
|
<el-col :xl="2" :lg="4" :md="4" :sm="12"> |
|
|
|
|
<span>名称:{{ item.firsts }}</span> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :xl="2" :lg="4" :md="4" :sm="12"> |
|
|
|
|
<span>总数量:{{ item.number }} </span> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :xl="2" :lg="4" :md="4" :sm="12"> |
|
|
|
|
<span>在库数量:{{ item.handQuantity }} </span> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :xl="2" :lg="4" :md="4" :sm="12"> |
|
|
|
|
<span>冻结数量:{{ item.deliveryQuantity }} </span> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :xl="2" :lg="4" :md="4" :sm="12"> |
|
|
|
|
<span>出库数量:{{ item.outboundQuantity }} </span> |
|
|
|
|
</el-col> |
|
|
|
|
<!-- <el-col :xl="4" :lg="7" :md="8" :sm="24"> |
|
|
|
|
<span |
|
|
|
|
>可用数量:{{ |
|
|
|
|
item.handQuantity - item.deliveryQuantity - item.outboundQuantity |
|
|
|
|
}}</span |
|
|
|
|
> |
|
|
|
|
<span>可用数量:{{(item.quantity)}}</span> |
|
|
|
|
</el-col> --> |
|
|
|
|
|
|
|
|
|
<el-col :xl="5" :lg="4" :md="4" :sm="12"> |
|
|
|
|
<div class="el_sumS"> |
|
|
|
|
<span>操作数量:</span> |
|
|
|
|
<el-input-number |
|
|
|
|
v-if="this.isrReservationEntry" |
|
|
|
|
v-model="item.reservationNum" |
|
|
|
|
min="0" |
|
|
|
|
:max="item.reservationNum" |
|
|
|
|
placeholder="请输入预约数量" |
|
|
|
|
></el-input-number> |
|
|
|
|
<el-input-number |
|
|
|
|
v-else |
|
|
|
|
v-model="item.number" |
|
|
|
|
min="0" |
|
|
|
|
:max="maxSum" |
|
|
|
|
placeholder="请输入预约数量" |
|
|
|
|
></el-input-number> |
|
|
|
|
</div> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<!-- <el-input-number v-model="item.reservationNum" min="0" :max="item.quantity - item.deliveryQuantity -item.outboundQuantity " placeholder="请输入预约数量"></el-input-number>--> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="zeroOrderData" border style="width: 100%"> |
|
|
|
|
<el-table-column fixed prop="firsts" label="名称" /> |
|
|
|
|
<el-table-column prop="quantity" label="总数量" /> |
|
|
|
|
<el-table-column prop="handQuantity" label="在库数量" /> |
|
|
|
|
<el-table-column prop="deliveryQuantity" label="冻结数量" /> |
|
|
|
|
<el-table-column prop="outboundQuantity" label="出库数量" /> |
|
|
|
|
<el-table-column prop="maxPlanNum" label="可用数量" /> |
|
|
|
|
<el-table-column fixed="right" label="数量操作"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-input-number |
|
|
|
|
size="small" |
|
|
|
|
v-model="scope.row.reservationNum" |
|
|
|
|
:max="scope.row.maxPlanNum" |
|
|
|
|
:min="0" |
|
|
|
|
:value-on-clear="0" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</template> |
|
|
|
|
<el-form-item style="margin-left: 37%; margin-top: 5px"> |
|
|
|
|
<el-button |
|
|
|
|
v-if="!isrReservationEntry" |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-circle-close" |
|
|
|
|
@click="onSubmitUpdateZeroOrder" |
|
|
|
|
>修改(零担订单) |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmitZeroOrder" |
|
|
|
|
>提交(零担订单) |
|
|
|
|
</el-button> |
|
|
|
@ -1922,7 +1887,7 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
// 表单数据 |
|
|
|
|
form: { |
|
|
|
|
isInstall:'1',//安装 |
|
|
|
|
isInstall: '1', //安装 |
|
|
|
|
}, |
|
|
|
|
// 选择行 |
|
|
|
|
selectionList: [], |
|
|
|
@ -2106,15 +2071,13 @@ export default {
|
|
|
|
|
async handleAddOrder() { |
|
|
|
|
this.loading = true; |
|
|
|
|
this.orderList = [...this.orderData]; |
|
|
|
|
this.query={} |
|
|
|
|
this.stockArtcolumnList.forEach(item=>{ |
|
|
|
|
item.values='' |
|
|
|
|
}) |
|
|
|
|
this.query = {}; |
|
|
|
|
this.stockArtcolumnList.forEach(item => { |
|
|
|
|
item.values = ''; |
|
|
|
|
}); |
|
|
|
|
//这里只需要对订单进行正常的搜索即可 |
|
|
|
|
await this.onLoadOrder(this.page); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.loading = false; |
|
|
|
|
this.orderShow = true; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
@ -2324,24 +2287,12 @@ export default {
|
|
|
|
|
//查询零担计划数量详情 |
|
|
|
|
console.log('order------------>', row.id); |
|
|
|
|
getReservationZeroOrderDetail(this.reservationId, row.id).then(res => { |
|
|
|
|
let a = res.data.data; |
|
|
|
|
a.forEach(item => { |
|
|
|
|
item.zeroOrderMax = |
|
|
|
|
item.handQuantity - |
|
|
|
|
item.deliveryQuantity - |
|
|
|
|
item.outboundQuantity + |
|
|
|
|
item.reservationNum; |
|
|
|
|
}); |
|
|
|
|
this.zeroOrderData = res.data.data; |
|
|
|
|
// console.log(res.data.data); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
getZeroOrderDetail(row.id).then(res => { |
|
|
|
|
if (res.data.data != null) { |
|
|
|
|
let a = res.data.data; |
|
|
|
|
a.forEach(item => { |
|
|
|
|
item.zeroOrderMax = item.handQuantity - item.deliveryQuantity - item.outboundQuantity; |
|
|
|
|
}); |
|
|
|
|
this.zeroOrderData = res.data.data; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -2661,27 +2612,22 @@ export default {
|
|
|
|
|
// this.form.stockArticleList = this.packageList; |
|
|
|
|
console.log('>>>>>>>>', this.form); |
|
|
|
|
if (this.reservationId) { |
|
|
|
|
console.log(this.reservationId,'this.reservationId'); |
|
|
|
|
console.log(this.reservationId, 'this.reservationId'); |
|
|
|
|
// 判断是否都没有选择包件 |
|
|
|
|
console.log(this.form.stockArticleList,'this.form.stockArticleList'); |
|
|
|
|
console.log(this.form.stockArticleList, 'this.form.stockArticleList'); |
|
|
|
|
const checkInfoValues = this.form.stockArticleList.every( |
|
|
|
|
item => !item.reservationNum |
|
|
|
|
); |
|
|
|
|
console.log(this.renderInventoryData,'renderInventoryData'); |
|
|
|
|
console.log(this.renderOrderData,'renderOrderData'); |
|
|
|
|
console.log(checkInfoValues,'checkInfoValues'); |
|
|
|
|
if (!this.renderInventoryData.length && !this.renderOrderData.length) { |
|
|
|
|
|
|
|
|
|
await ElMessageBox.prompt( |
|
|
|
|
'当前计划为空是否"取消本次计划"?', |
|
|
|
|
'请填写取消原因', |
|
|
|
|
{ |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '关闭', |
|
|
|
|
inputPattern: /^\S+$/, |
|
|
|
|
inputErrorMessage: '请填写取消原因', |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
console.log(this.renderInventoryData, 'renderInventoryData'); |
|
|
|
|
console.log(this.renderOrderData, 'renderOrderData'); |
|
|
|
|
console.log(checkInfoValues, 'checkInfoValues'); |
|
|
|
|
if (!this.renderInventoryData.length && !this.renderOrderData.length) { |
|
|
|
|
await ElMessageBox.prompt('当前计划为空是否"取消本次计划"?', '请填写取消原因', { |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '关闭', |
|
|
|
|
inputPattern: /^\S+$/, |
|
|
|
|
inputErrorMessage: '请填写取消原因', |
|
|
|
|
}) |
|
|
|
|
.then(value => { |
|
|
|
|
let data = { |
|
|
|
|
cancelReason: value.value, |
|
|
|
@ -2708,14 +2654,11 @@ export default {
|
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
console.log('关闭弹窗'); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
return |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
for (let i = 0; i < this.form.stockArticleList.length; i++) { |
|
|
|
|
if ( |
|
|
|
|
!this.form.stockArticleList[i].reservationNum |
|
|
|
|
) { |
|
|
|
|
if (!this.form.stockArticleList[i].reservationNum) { |
|
|
|
|
ElMessageBox.confirm( |
|
|
|
|
`订单自编号:${this.form.stockArticleList[i].orderCode}没有选择包件是否移除!`, |
|
|
|
|
'提示', |
|
|
|
@ -2729,19 +2672,17 @@ export default {
|
|
|
|
|
this.renderOrderData.splice(i, 1); |
|
|
|
|
this.form.stockArticleList.splice(i, 1); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
.catch(() => {}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 开启提交按钮loading |
|
|
|
|
this.loadingObj.submitBtnLoading = true; |
|
|
|
|
this.reservationloading = true; //开启全屏加载 |
|
|
|
|
this.form.id = this.reservationId; |
|
|
|
|
console.log(this.form,'this.form'); |
|
|
|
|
console.log(this.form, 'this.form'); |
|
|
|
|
const res = await update(this.form); |
|
|
|
|
console.log('res :>> ', res); |
|
|
|
|
if (res.data.code !== 200) return; |
|
|
|
@ -2751,10 +2692,10 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
this.back(); |
|
|
|
|
} else { |
|
|
|
|
if (!this.renderInventoryData.length && !this.renderOrderData.length) { |
|
|
|
|
if (!this.renderInventoryData.length && !this.renderOrderData.length) { |
|
|
|
|
this.$message.warning('无效计划'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 开启提交按钮loading |
|
|
|
|
this.loadingObj.submitBtnLoading = true; |
|
|
|
|
this.reservationloading = true; //开启全屏加载 |
|
|
|
@ -3062,64 +3003,18 @@ export default {
|
|
|
|
|
this.zeroOrderShow = false; |
|
|
|
|
console.log('-------------->', this.zeroOrderData); |
|
|
|
|
}, |
|
|
|
|
// 提交零担数量 |
|
|
|
|
onSubmitZeroOrder() { |
|
|
|
|
if (this.isrReservationEntry) { |
|
|
|
|
//零担预约数量录入 |
|
|
|
|
this.orderData.forEach(item => { |
|
|
|
|
if (this.obj.id === item.id) { |
|
|
|
|
item.parcelNumberVOS = this.zeroOrderData; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
//在库数量录入 |
|
|
|
|
let a = this.zeroOrderData; |
|
|
|
|
if (a.length > 0) { |
|
|
|
|
let n = 0; |
|
|
|
|
a.forEach(item => { |
|
|
|
|
n += item.number; |
|
|
|
|
}); |
|
|
|
|
if (n > this.obj.handQuantity) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '录入数量超过订单在库数量!', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let b = a.every(item => { |
|
|
|
|
console.log( |
|
|
|
|
'最大数量-------------->', |
|
|
|
|
item.handQuantity + item.outboundQuantity + item.deliveryQuantity + item.number |
|
|
|
|
); |
|
|
|
|
if ( |
|
|
|
|
item.handQuantity + item.outboundQuantity + item.deliveryQuantity + item.number > |
|
|
|
|
item.quantity |
|
|
|
|
) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
}); |
|
|
|
|
console.log('----------------->', b); |
|
|
|
|
if (!b) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'error', |
|
|
|
|
message: '请输入正确数量!', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
entryNum(this.zeroOrderData).then(res => { |
|
|
|
|
if (res) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log('this.zeroOrderData------------->', this.zeroOrderData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.zeroOrderShow = false; |
|
|
|
|
let _renderOrderData = this.renderOrderData.find(item => item.id === this.obj.id); |
|
|
|
|
_renderOrderData.parcelNumberVOS = this.zeroOrderData; |
|
|
|
|
// 操作数量求和 |
|
|
|
|
let totalReservationNum = this.zeroOrderData.reduce((sum, item) => { |
|
|
|
|
return sum + (item.reservationNum || 0); // 确保 reservationNum 存在 |
|
|
|
|
}, 0); |
|
|
|
|
_renderOrderData.reservationNum = totalReservationNum; |
|
|
|
|
this.zeroOrderShow = false; //关闭弹窗 |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 增加库存品 |
|
|
|
|
onSubmitInventory() { |
|
|
|
|
if (this.inventoryList.length === 0) { |
|
|
|
@ -3600,6 +3495,5 @@ input[type='number'] {
|
|
|
|
|
span { |
|
|
|
|
width: 100px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|