|
@@ -1,10 +1,32 @@
|
|
|
<template>
|
|
|
<!-- 添加收货客户信息 -->
|
|
|
- <div class="addWagonLoad">
|
|
|
+ <div class="addConsignee">
|
|
|
<PageTitle>返回</PageTitle>
|
|
|
<div class="form-box" style="margin-right: 10rem">
|
|
|
<dil-form :formId="367" v-model="form1" ref="from1"></dil-form>
|
|
|
</div>
|
|
|
+ <div class="f-box">
|
|
|
+ <el-form
|
|
|
+ :inline="true"
|
|
|
+ class="demo-form-inline"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="收货单位">
|
|
|
+ <el-autocomplete
|
|
|
+ class="inline-input"
|
|
|
+ v-model="stateConsignee"
|
|
|
+ :fetch-suggestions="querySearchConsignee"
|
|
|
+ placeholder="请输入收货单位名称"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ @select="handleSelectConsignee"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ item }">
|
|
|
+ <div class="name">{{ item.consigneeCompanyName }}</div>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
<div class="button-box">
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
<el-button type="primary" @click="makeSure">确定</el-button>
|
|
@@ -20,10 +42,39 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form1: {},
|
|
|
+ stateConsignee:null,
|
|
|
+ restaurantsConsignee:null,
|
|
|
};
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
+ //收货单位弹出层
|
|
|
+ handleSelectConsignee(item){
|
|
|
+ console.log(this.consigneeId)
|
|
|
+ this.consigneeId = item.consigneeId
|
|
|
+ item.consigneeCompanyName = this.consigneeCompanyName
|
|
|
+ console.log(this.consigneeId)
|
|
|
+ console.log('这是选中的收货单位')
|
|
|
+ },
|
|
|
+ //以下是发货单位边输边查搜索
|
|
|
+ querySearchConsignee(queryString, cb) {
|
|
|
+ this.axios.post('/api/v1/uc/getConsigneeByLike?index='+queryString).then((res)=>{
|
|
|
+ if(res.data.code == "200"){
|
|
|
+ console.log(res)
|
|
|
+ var restaurantsConsignee = res.data.data
|
|
|
+ var results = queryString ? restaurantsConsignee.filter(this.createFilterConsignee(queryString)) :restaurantsConsignee;
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ console.log(results,"results");
|
|
|
+ cb(results);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ createFilterConsignee(queryString) {
|
|
|
+ return (restaurantsConsignee) => {
|
|
|
+ return (restaurantsConsignee.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //以上是收货单位边输边查搜索
|
|
|
makeSure() {
|
|
|
console.log(this.form1)
|
|
|
let RmsConsignee={
|
|
@@ -34,16 +85,12 @@ export default {
|
|
|
consigneeRegistrationTime:this.form1.consigneeRegistrationTime,
|
|
|
consigneeContactName:this.form1.consigneeContactName,
|
|
|
consigneeContactTel:this.form1.consigneeContactTel,
|
|
|
+ consigneeFarId:this.consigneeId
|
|
|
};
|
|
|
- console.log("RmsConsignee",RmsConsignee)
|
|
|
+ console.log("RmsConsignee",RmsConsignee)
|
|
|
+
|
|
|
if(
|
|
|
- RmsConsignee.companyName == null ||
|
|
|
- RmsConsignee.consigneeAbbreviation==null ||
|
|
|
- RmsConsignee. consigneeRegisteredAddress ==null ||
|
|
|
- RmsConsignee.consigneeReceiveAddress == null ||
|
|
|
- RmsConsignee.consigneeRegistrationTime == null ||
|
|
|
- RmsConsignee.consigneeContactName == null ||
|
|
|
- RmsConsignee.consigneeContactTel == null
|
|
|
+ RmsConsignee.companyName == null
|
|
|
)this.$message.error("存在空值!");
|
|
|
else
|
|
|
this.axios
|
|
@@ -64,7 +111,6 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error("新增失败,可能有重复");
|
|
|
}
|
|
|
- // this.$refs['table'].resetField();
|
|
|
});
|
|
|
},
|
|
|
// 取消
|
|
@@ -75,6 +121,10 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style lang='scss' >
|
|
|
+ .addConsignee{
|
|
|
+ .f-box{
|
|
|
+ margin-left: 36%;
|
|
|
+ }
|
|
|
.button-box{
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
@@ -105,4 +155,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|