203 lines
7.8 KiB
Java
203 lines
7.8 KiB
Java
<template>
|
|
<a-spin :spinning="confirmLoading">
|
|
<j-form-container :disabled="formDisabled">
|
|
<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="sgNo">
|
|
<a-input v-model="model.sgNo" placeholder="请输入送货入厂需求编号" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col> -->
|
|
<a-col :span="8">
|
|
<a-form-model-item label="预约人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="artName">
|
|
<a-input v-model="model.artName" placeholder="请输入实际预约人姓名" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="预约人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="artTel">
|
|
<a-input v-model="model.artTel" placeholder="请输入实际预约人电话" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="预约人邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="artEmail">
|
|
<a-input v-model="model.artEmail" placeholder="请输入实际预约人邮箱" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="对接人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cpName">
|
|
<a-input v-model="model.cpName" placeholder="请输入入厂对接人姓名" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="对接人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cpTel">
|
|
<a-input v-model="model.cpTel" placeholder="请输入入厂对接人电话" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="对接人邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cpEmail">
|
|
<a-input v-model="model.cpEmail" placeholder="请输入入厂对接人邮箱" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="紧急情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="urgency">
|
|
<!-- <a-input v-model="model.urgency" placeholder="请输入紧急" ></a-input> -->
|
|
<j-dict-select-tag type="list" v-model="model.urgency" dictCode="urgency" placeholder="请选择紧急情况" />
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<!-- <a-col :span="8">
|
|
<a-form-model-item label="产品标签" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productLabel">
|
|
<a-input v-model="model.productLabel" placeholder="请输入产品标签" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col> -->
|
|
<a-col :span="8">
|
|
<a-form-model-item label="备注信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
|
|
<a-input v-model="model.notes" placeholder="请输入备注信息" ></a-input>
|
|
</a-form-model-item>
|
|
</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-form-model-item>
|
|
</a-col>
|
|
<!-- <a-col :span="8">
|
|
<a-form-model-item label="料号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pn">
|
|
<a-input v-model="model.pn" placeholder="请输入料号" ></a-input>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planQty">
|
|
<a-input-number v-model="model.planQty" placeholder="请输入数量" style="width: 100%" />
|
|
</a-form-model-item>
|
|
</a-col>
|
|
<a-col :span="8">
|
|
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit">
|
|
<j-dict-select-tag type="list" v-model="model.unit" dictCode="unit" placeholder="请选择单位" />
|
|
</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: 25%;">料号</th>
|
|
<th style="width: 25%;">数量</th>
|
|
<th style="width: 25%;">单位</th>
|
|
<th style="width: 25%;">供应商</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="(item,index) in poList" align="center" :key="index">
|
|
<td style="width: 25%;">{{ item.pn }}</td>
|
|
<td style="width: 25%;"><input type="number" v-model="item.planQty" min="0" :max="item.planQty" style="width: 100%;"></td>
|
|
<td style="width: 25%;">{{ item.unit }}</td>
|
|
<td style="width: 25%;">{{ item.supplier }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</a-spin>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
export default {
|
|
name: 'DeliveryPlanForm',
|
|
components: {
|
|
},
|
|
props: {
|
|
//表单禁用
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
required: false
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
model:{
|
|
},
|
|
poList: [],
|
|
labelCol: {
|
|
xs: { span: 24 },
|
|
sm: { span: 7 },
|
|
},
|
|
wrapperCol: {
|
|
xs: { span: 24 },
|
|
sm: { span: 16 },
|
|
},
|
|
confirmLoading: false,
|
|
validatorRules: {
|
|
},
|
|
url: {
|
|
add: "/deliveryplan/deliveryPlan/add",
|
|
edit: "/deliveryplan/deliveryPlan/edit",
|
|
queryById: "/deliveryplan/deliveryPlan/queryById",
|
|
getByPo: "/deliveryplan/deliveryPlan/getByPo"
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
formDisabled(){
|
|
return this.disabled
|
|
},
|
|
},
|
|
created () {
|
|
//备份model原始值
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
const userInfo = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value
|
|
this.modelDefault.artName = userInfo.realname
|
|
this.modelDefault.artTel = userInfo.phone
|
|
this.modelDefault.artEmail = userInfo.email
|
|
},
|
|
methods: {
|
|
add () {
|
|
this.edit(this.modelDefault);
|
|
},
|
|
edit (record) {
|
|
this.model = Object.assign({}, record);
|
|
this.visible = true;
|
|
this.getByPo();
|
|
},
|
|
submitForm () {
|
|
const that = this;
|
|
// 触发表单验证
|
|
this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
that.confirmLoading = true;
|
|
let httpurl = '';
|
|
let method = '';
|
|
if(!this.model.id){
|
|
httpurl+=this.url.add;
|
|
method = 'post';
|
|
}else{
|
|
httpurl+=this.url.edit;
|
|
method = 'put';
|
|
}
|
|
this.model.deliveryPlanDetailList = this.poList;
|
|
httpAction(httpurl,this.model,method).then((res)=>{
|
|
if(res.success){
|
|
that.$message.success(res.message);
|
|
that.$emit('ok');
|
|
}else{
|
|
that.$message.warning(res.message);
|
|
}
|
|
}).finally(() => {
|
|
that.confirmLoading = false;
|
|
})
|
|
}
|
|
|
|
})
|
|
},
|
|
getByPo(){
|
|
getAction(this.url.getByPo,{po: this.model.ffectivePo}).then(res => {
|
|
if(res.success){
|
|
this.poList = res.result;
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script> |