发货需求

This commit is contained in:
王帅 2025-06-09 14:18:47 +08:00
parent a1298819d5
commit a75b06fc74
5 changed files with 183 additions and 69 deletions

View File

@ -207,7 +207,7 @@
dataIndex: 'kilometers'
},
{
title:'',
title:'运输类',
align:"center",
dataIndex: 'carType'
},
@ -254,16 +254,18 @@
{
title:'生效日期',
align:"center",
dataIndex: 'effectiveDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'effectiveDate'
},
{
title:'时效',
align:"center",
dataIndex: 'validity'
},
{
title:'失效日期',
align:"center",
dataIndex: 'failureTime'
},
{
title: '操作',
dataIndex: 'action',

View File

@ -143,7 +143,7 @@
}
},
{
title:'',
title:'运输类',
align:"center",
dataIndex: 'carType'
},

View File

@ -56,7 +56,12 @@
</a-col>
<a-col :span="8">
<a-form-model-item label="PO" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ffectivePo">
<a-input v-model="model.ffectivePo" placeholder="请输入PO" @keyup.enter.native="getByPo"></a-input>
<!-- <a-input v-model="model.ffectivePo" placeholder="请输入PO" @keyup.enter.native="getByPo"></a-input> -->
<a-select placeholder="请选择PO" v-model="model.ffectivePo" showSearch @change="getByPo">
<a-select-option v-for="item in ffectivePoList"
:key="item" :value="item" :label="item">
{{item}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<!-- <a-col :span="8">
@ -120,6 +125,7 @@
model:{
},
poList: [],
ffectivePoList: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 },
@ -135,7 +141,9 @@
add: "/deliveryplan/deliveryPlan/add",
edit: "/deliveryplan/deliveryPlan/edit",
queryById: "/deliveryplan/deliveryPlan/queryById",
getByPo: "/deliveryplan/deliveryPlan/getByPo"
getByPo: "/deliveryplan/deliveryPlan/getByPo",
getPo: "/deliveryplan/deliveryPlan/getPo",
getByDeliveryPlanId: "/deliveryplandetail/deliveryPlanDetail/getByDeliveryPlanId"
}
}
},
@ -151,6 +159,7 @@
this.modelDefault.artName = userInfo.realname
this.modelDefault.artTel = userInfo.phone
this.modelDefault.artEmail = userInfo.email
this.getPo()
},
methods: {
add () {
@ -159,7 +168,7 @@
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
this.getByPo();
this.getByDeliveryPlanId();
},
submitForm () {
const that = this;
@ -197,6 +206,23 @@
this.poList = res.result;
}
})
},
getPo(){
getAction(this.url.getPo).then(res => {
if(res.success){
this.ffectivePoList = res.result;
}
})
},
getByDeliveryPlanId(){
if(!this.model.id){
return
}
getAction(this.url.getByDeliveryPlanId,{id: this.model.id}).then(res => {
if(res.success){
this.poList = res.result;
}
})
}
}
}

View File

@ -167,26 +167,26 @@
align:"center",
dataIndex: 'shipType_dictText'
},
{
title:'料号',
align:"center",
dataIndex: 'pn'
},
{
title:'规格',
align:"center",
dataIndex: 'spec'
},
// {
// title:'料号',
// align:"center",
// dataIndex: 'pn'
// },
// {
// title:'规格',
// align:"center",
// dataIndex: 'spec'
// },
{
title:'发货数量',
align:"center",
dataIndex: 'shipNumber'
},
{
title:'单位',
align:"center",
dataIndex: 'unit_dictText'
},
// {
// title:'单位',
// align:"center",
// dataIndex: 'unit_dictText'
// },
{
title:'预估托盘数',
align:"center",
@ -197,6 +197,11 @@
align:"center",
dataIndex: 'shipDate'
},
{
title:'到货日期',
align:"center",
dataIndex: 'deliveryDate'
},
{
title:'送货地点',
align:"center",
@ -207,16 +212,16 @@
align:"center",
dataIndex: 'pickUpHub'
},
{
title:'发货单',
align:"center",
dataIndex: 'invoice'
},
{
title:'销售人员',
align:"center",
dataIndex: 'salesperson'
},
// {
// title:'发货单',
// align:"center",
// dataIndex: 'invoice'
// },
// {
// title:'销售人员',
// align:"center",
// dataIndex: 'salesperson'
// },
{
title:'作业备注',
align:"center",

View File

@ -4,13 +4,12 @@
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="8">
<a-form-model-item label="发货类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipType">
<j-dict-select-tag v-model="model.shipType" dictCode="ship_type" placeholder="请选择发货类型" />
<a-form-model-item label="运输类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipType">
<j-dict-select-tag v-model="model.shipType" dictCode="ship_type" placeholder="请选择运输类型" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<!-- <a-col :span="8">
<a-form-model-item label="料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pn">
<!-- <a-input v-model.trim="model.pn" placeholder="请输入料号" @change="changeGetpalletsNum" ></a-input> -->
<a-auto-complete v-model="model.pn" placeholder="请输入料号" @select="pnSelect" @change="pnChange" :dataSource="pnList"></a-auto-complete>
</a-form-model-item>
</a-col>
@ -18,10 +17,10 @@
<a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spec">
<a-input v-model="model.spec" placeholder="请输入规格" disabled ></a-input>
</a-form-model-item>
</a-col>
</a-col> -->
<a-col :span="8">
<a-form-model-item label="发货数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipNumber">
<a-input-number v-model="model.shipNumber" :min="0" placeholder="请输入发货数量" style="width: 100%" @change="changeGetpalletsNum"/>
<a-input-number v-model="model.shipNumber" :min="0" placeholder="请输入发货数量" style="width: 100%"/>
</a-form-model-item>
</a-col>
<a-col :span="8">
@ -29,20 +28,20 @@
<a-input-number v-model="model.palletsNum" placeholder="请输入预估托盘数" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<!-- <a-col :span="8">
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit">
<j-dict-select-tag placeholder="请选择单位" v-model="model.unit" dictCode="unit"></j-dict-select-tag>
</a-form-model-item>
</a-col>
</a-col> -->
<a-col :span="8">
<a-form-model-item label="发货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipDate">
<j-date placeholder="请选择发货日期" v-model="model.shipDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="取货仓库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pickUpHub">
<a-form-model-item label="取货地点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pickUpHub">
<!-- <j-dict-select-tag placeholder="请选择取货仓库" v-model="model.pickUpHub" dictCode="tms_logistics_route,start_city,start_city"></j-dict-select-tag> -->
<a-auto-complete v-model="model.pickUpHub" placeholder="请输入取货仓库" @select="pickUpHubSelect" @change="pickUpHubChange" :dataSource="pickUpHubList"></a-auto-complete>
<a-auto-complete v-model="model.pickUpHub" placeholder="请输入取货地点" @select="pickUpHubSelect" @change="pickUpHubChange" :dataSource="pickUpHubList"></a-auto-complete>
</a-form-model-item>
</a-col>
<a-col :span="8">
@ -51,35 +50,69 @@
<a-input v-model="model.deliveryAddress" placeholder="请输入送货地点" disabled ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="到货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryDate">
<j-date placeholder="请选择到货日期" v-model="model.deliveryDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<!--
<a-col :span="8">
<a-form-model-item label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="salesperson">
<a-input v-model="model.salesperson" placeholder="请输入销售人员" ></a-input>
</a-form-model-item>
</a-col> -->
<a-col :span="8">
<a-form-model-item label="作业备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNotes">
<a-input v-model="model.workNotes" placeholder="请输入作业备注" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="8" v-if="model.id">
<a-form-model-item label="当前状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentStatus">
<j-dict-select-tag placeholder="请选择当前状态" v-model="model.currentStatus" dictCode="current_status" disabled></j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="发货单" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="invoice">
<!-- <a-input v-model="model.invoice" placeholder="请输入发货单" ></a-input> -->
<a-select placeholder="发货单" v-model="model.invoice" showSearch>
<a-select placeholder="发货单" v-model="model.invoice" showSearch @change="changeInvoice">
<a-select-option v-for="item in invoiceList"
:key="item" :value="item" :label="item">
{{item}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="销售人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="salesperson">
<a-input v-model="model.salesperson" placeholder="请输入销售人员" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="作业备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNotes">
<a-input v-model="model.workNotes" placeholder="请输入作业备注" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="当前状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentStatus">
<j-dict-select-tag placeholder="请选择当前状态" v-model="model.currentStatus" dictCode="current_status" disabled></j-dict-select-tag>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
<table style="width: 100%;">
<thead>
<tr align="center">
<th style="width: 5%;"></th>
<th style="width: 15%;">发货单</th>
<th style="width: 15%;">发货仓库</th>
<th style="width: 15%;">料号</th>
<th style="width: 15%;">品名</th>
<th style="width: 15%;">规格</th>
<th style="width: 10%;">数量</th>
<th style="width: 5%;">单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in deliveryDetailList" align="center" :key="index">
<a-checkbox v-model="item.selected"></a-checkbox>
<td style="width: 15%;">{{ item.invoice }}</td>
<td style="width: 15%;">{{ item.pickUpHub }}</td>
<td style="width: 15%;">{{ item.pn }}</td>
<td style="width: 15%;">{{ item.productName }}</td>
<td style="width: 15%;">{{ item.specName }}</td>
<td style="width: 10%;"><a-input-number v-model="item.shipNumber" :min="0" style="width: 100%;" @change="changeQty"/></td>
<td style="width: 5%;">{{ item.unit }}</td>
</tr>
</tbody>
</table>
<div align="center" style="margin-top: 20px;">
<!-- <a-button @click="addLine" type="primary">新增</a-button> -->
<a-button @click="batchDel" type="danger">删除选中</a-button>
</div>
</a-spin>
</template>
@ -88,6 +121,7 @@
import { httpAction, getAction,postAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { off } from 'codemirror'
import { h } from 'vue'
import { min } from 'xe-utils/methods'
export default {
@ -109,8 +143,11 @@ import { min } from 'xe-utils/methods'
pnSpecList:[],
pnList:[],
invoiceList:[],
deliveryDetailList:[],
model:{
},
shipNumber: 0,
palletsNum: 0
},
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
@ -125,6 +162,7 @@ import { min } from 'xe-utils/methods'
pn :[{required: true, message: '请输入料号!'}],
shipNumber :[{required: true, message: '请输入发货数量!'}],
shipDate :[{required: true, message: '请选择发货日期!'}],
deliveryDate :[{required: true, message: '请选择到货日期!'}],
deliveryAddress :[{required: true, message: '请选择送货地点!'}],
pickUpHub :[{required: true, message: '请选择取货仓库!'}],
spec: [{required: true, message: '请输入规格!'}],
@ -137,7 +175,9 @@ import { min } from 'xe-utils/methods'
getPalletsNum: "/deliverydemand/deliveryDemand/getPalletsNum",
getCity: "/logisticsroute/logisticsRoute/getCity",
getPnSpecList: "/vehicleproduct/tmsVehicleProduct/getPnSpecList",
getShip: "/deliverydemand/deliveryDemand/getShip"
getShip: "/deliverydemand/deliveryDemand/getShip",
getShipDetail: "/deliverydemand/deliveryDemand/getShipDetail",
queryByDeliveryDemandId: "/deliverydemanddetail/deliveryDemandDetail/queryByDeliveryDemandId"
}
}
},
@ -154,12 +194,12 @@ import { min } from 'xe-utils/methods'
this.getShip();
},
methods: {
// 计算托盘数
changeGetpalletsNum() {
if (!this.model.pn || !this.model.spec || !this.model.shipNumber) {
return
}
console.log("22222");
postAction(this.url.getPalletsNum, this.model).then(res => {
// if (!this.model.pn || !this.model.spec || !this.model.shipNumber) {
// return
// }
postAction(this.url.getPalletsNum, this.deliveryDetailList).then(res => {
if (res.success) {
this.model.palletsNum = res.result
}
@ -171,6 +211,7 @@ import { min } from 'xe-utils/methods'
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
this.queryByDeliveryDemandId();
},
submitForm () {
const that = this;
@ -187,6 +228,7 @@ import { min } from 'xe-utils/methods'
httpurl+=this.url.edit;
method = 'put';
}
this.model.deliveryDemandDetailList = this.deliveryDetailList
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
@ -243,7 +285,46 @@ import { min } from 'xe-utils/methods'
this.invoiceList = res.result
}
})
},
addLine(){
this.deliveryDetailList.push({selected: false,shipNumber: 0})
},
batchDel(){
this.deliveryDetailList = this.deliveryDetailList.filter(x => x.selected===false)
this.changeQty()
},
// 计算发货数量
changeQty(){
this.model.shipNumber = parseFloat(this.deliveryDetailList.reduce((sum, current) => sum + current.shipNumber, 0).toFixed(4));
console.log(this.model.shipNumber);
console.log(typeof this.model.shipNumber);
this.changeGetpalletsNum()
},
changeInvoice(value){
console.log(value);
let hasEven = this.deliveryDetailList.some((item) => {
return item.invoice == value;
});
if(hasEven){
this.$message.warning("列表中已存在"+value);
return;
}
getAction(this.url.getShipDetail, {invoice: value}).then(res => {
if(res.success){
this.deliveryDetailList.push(...res.result)
this.changeQty()
}
})
},
queryByDeliveryDemandId(){
getAction(this.url.queryByDeliveryDemandId, {deliveryDemandId: this.model.id}).then(res => {
if(res.success){
this.deliveryDetailList = res.result
}
})
}
}
}
</script>