|
@@ -7,35 +7,48 @@
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
- :label-position="left"
|
|
|
label-width="80px"
|
|
|
- >
|
|
|
+ >
|
|
|
<el-form-item label="发货单位">
|
|
|
- <el-input v-model="supplierName" placeholder="必填" disabled>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
|
|
|
+ <el-autocomplete
|
|
|
+ class="inline-input"
|
|
|
+ v-model="stateSupplier"
|
|
|
+ :fetch-suggestions="querySearchSupplier"
|
|
|
+ placeholder="请输入发货单位名称"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ @select="handleSelectSupplier"
|
|
|
+ @input="oninputSupplier"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ item }">
|
|
|
+ <div class="name">{{ item.supplierName }}</div>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
- :label-position="left"
|
|
|
label-width="80px"
|
|
|
- >
|
|
|
+ >
|
|
|
<el-form-item label="收货单位">
|
|
|
- <el-input v-model="receiveName" placeholder="必填" disabled>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
|
|
|
+ <el-autocomplete
|
|
|
+ class="inline-input"
|
|
|
+ v-model="stateConsignee"
|
|
|
+ :fetch-suggestions="querySearchConsignee"
|
|
|
+ placeholder="请输入收货单位名称"
|
|
|
+ :trigger-on-focus="false"
|
|
|
+ @select="handleSelectConsignee"
|
|
|
+ @input="oninputConsignee"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ item }">
|
|
|
+ <div class="name">{{ item.consigneeCompanyName }}</div>
|
|
|
+ </template>
|
|
|
+ </el-autocomplete>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
- :label-position="left"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
<el-form-item label="流向">
|
|
@@ -53,7 +66,6 @@
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
- :label-position="left"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
<el-form-item label="选择路线">
|
|
@@ -67,21 +79,20 @@
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
- :label-position="left"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
<el-form-item label="选择承运商">
|
|
|
<el-autocomplete
|
|
|
class="inline-input"
|
|
|
- v-model="state2"
|
|
|
- :fetch-suggestions="querySearch"
|
|
|
+ v-model="stateCarrier"
|
|
|
+ :fetch-suggestions="querySearchCarrier"
|
|
|
placeholder="请输入承运商名称"
|
|
|
:trigger-on-focus="false"
|
|
|
- @select="handleSelect"
|
|
|
- @input="oninput"
|
|
|
+ @select="handleSelectCarrier"
|
|
|
+ @input="oninputCarrier"
|
|
|
>
|
|
|
<template slot-scope="{ item }">
|
|
|
- <div class="name">{{ item.value }}</div>
|
|
|
+ <div class="name">{{ item.carrierName }}</div>
|
|
|
</template>
|
|
|
</el-autocomplete>
|
|
|
</el-form-item>
|
|
@@ -89,7 +100,6 @@
|
|
|
<el-form
|
|
|
:inline="true"
|
|
|
class="demo-form-inline"
|
|
|
- :label-position="left"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
<el-form-item label="选择物资">
|
|
@@ -122,7 +132,6 @@
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 物资表格 -->
|
|
|
<div class="truckListTable">
|
|
|
<div class="selectionTable">
|
|
@@ -236,12 +245,6 @@
|
|
|
@radio-change="currentRadioChange2"
|
|
|
></dilTable>
|
|
|
</div>
|
|
|
- <div v-show="a == 3">
|
|
|
- <dilTable
|
|
|
- v-bind.sync="third"
|
|
|
- @selection-change="currentRadioChange3"
|
|
|
- ></dilTable>
|
|
|
- </div>
|
|
|
<div v-show="a == 5">
|
|
|
<dilTable
|
|
|
v-bind.sync="line"
|
|
@@ -258,15 +261,19 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import PageTitle from "@/components/Page/Title";
|
|
|
-import { Checkbox } from 'element-ui';
|
|
|
-
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
+ options: [],
|
|
|
+ value: '',
|
|
|
receiveName:'',
|
|
|
- state2:null,
|
|
|
- restaurants: [],
|
|
|
+ stateCarrier:null,
|
|
|
+ stateSupplier:null,
|
|
|
+ stateConsignee:null,
|
|
|
+ restaurantsConsignee:null,
|
|
|
+ restaurantsSupplier:null,
|
|
|
+ restaurantsCarrier: [],
|
|
|
orderTypeList:[
|
|
|
{
|
|
|
value:12,
|
|
@@ -276,6 +283,7 @@ export default {
|
|
|
label:'出厂'
|
|
|
}
|
|
|
],
|
|
|
+ likeCarrierLike:'',
|
|
|
orderType:12,
|
|
|
// 线路名称
|
|
|
lineName: "",
|
|
@@ -346,12 +354,6 @@ export default {
|
|
|
"/api/v1/uc/selectAllMaterialName?apiId=395",
|
|
|
selectionType: "select",
|
|
|
},
|
|
|
- secend: {
|
|
|
- requestUrl:
|
|
|
- "/api/v1/uc/querySupplierByLike?apiId=247",
|
|
|
- selectionType: "radio",
|
|
|
- mapList2: [],
|
|
|
- },
|
|
|
receiveOptions:{
|
|
|
requestUrl:
|
|
|
"/api/v1/uc/queryConsigneeByLike?apiId=396",
|
|
@@ -392,40 +394,85 @@ export default {
|
|
|
this.selectionList1 = []
|
|
|
this.table = true
|
|
|
},
|
|
|
- handleSelect(item){
|
|
|
- this.carrierId = item.carrierId
|
|
|
- item.carrierName = this.state2
|
|
|
+ //收货单位弹出层
|
|
|
+ handleSelectConsignee(item){
|
|
|
+ console.log(this.consigneeId)
|
|
|
+ this.consigneeId = item.consigneeId
|
|
|
+ item.consigneeCompanyName = this.consigneeCompanyName
|
|
|
+ console.log(this.consigneeId)
|
|
|
+ console.log('这是选中的收货单位')
|
|
|
},
|
|
|
- oninput(){
|
|
|
- this.axios.post('/api/v1/uc/getCarrierMesByLike?index='+this.state2).then((res)=>{
|
|
|
+ //以下是发货单位边输边查搜索
|
|
|
+ querySearchConsignee(queryString, cb) {
|
|
|
+ this.axios.post('/api/v1/uc/getConsigneeByLike?index='+queryString).then((res)=>{
|
|
|
if(res.data.code == "200"){
|
|
|
console.log(res)
|
|
|
- this.restaurants = res.data.data
|
|
|
+ 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);
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //以上是返回单位边输边查搜索
|
|
|
+ //发货单位弹出层
|
|
|
+ handleSelectSupplier(item){
|
|
|
+ this.supplierId = item.supplierId
|
|
|
+ item.supplierName = this.supplierName
|
|
|
},
|
|
|
- //搜索
|
|
|
- querySearch(queryString, cb) {
|
|
|
- var restaurants = this.restaurants;
|
|
|
- console.log(this.restaurants,"this.restaurants");
|
|
|
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) :restaurants;
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- console.log(results,"results");
|
|
|
- cb(results);
|
|
|
+ //以下是发货单位边输边查搜索
|
|
|
+ querySearchSupplier(queryString, cb) {
|
|
|
+ this.axios.post('/api/v1/uc/getSupplierMesByLike?index='+this.stateSupplier).then((res)=>{
|
|
|
+ if(res.data.code == "200"){
|
|
|
+ var restaurantsSupplier = res.data.data
|
|
|
+ var results = queryString ? restaurantsSupplier.filter(this.createFilterSupplier(queryString)) :restaurantsSupplier;
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ cb(results);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- createFilter(queryString) {
|
|
|
- return (restaurants) => {
|
|
|
- return (restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
|
|
|
+ createFilterSupplier(queryString) {
|
|
|
+ return (restaurantsSupplier) => {
|
|
|
+ return (restaurantsSupplier.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
};
|
|
|
},
|
|
|
+ //以上是返回单位边输边查搜索
|
|
|
+ //承运商弹出层
|
|
|
+ handleSelectCarrier(item){
|
|
|
+ this.carrierId = item.carrierId
|
|
|
+ item.carrierName = this.stateCarrier
|
|
|
+ },
|
|
|
+ //以下是承运商边输边查搜索
|
|
|
+ querySearchCarrier(queryString, cb) {
|
|
|
+ this.axios.post('/api/v1/uc/getCarrierMesByLike?index='+queryString).then((res)=>{
|
|
|
+ if(res.data.code == "200"){
|
|
|
+ var restaurantsCarrier = res.data.data
|
|
|
+ console.log(restaurantsCarrier,"restaurantsCarrier");
|
|
|
+ var results = queryString ? restaurantsCarrier.filter(this.createFilterCarrier(queryString)) :restaurantsCarrier;
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ cb(results);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ createFilterCarrier(queryString) {
|
|
|
+ return (restaurantsCarrier) => {
|
|
|
+ return (restaurantsCarrier.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //以上是承运商边输边查搜索
|
|
|
//删除行
|
|
|
deleteRow(index, rows) {
|
|
|
rows.splice(index, 1);
|
|
|
},
|
|
|
// 返回主界面
|
|
|
makeSure1() {
|
|
|
- console.log(this.selectionList1)
|
|
|
- debugger
|
|
|
+ console.log(this.selectionList1)
|
|
|
this.selectionList1.forEach((e) => {
|
|
|
var addmap = {
|
|
|
materialCode: e.materialCode,
|
|
@@ -433,7 +480,7 @@ export default {
|
|
|
Specification: e.materialSpecification+e.materialModel,
|
|
|
orderMaterialWeight: null,
|
|
|
materialId: e.materialId,
|
|
|
- materialPriority:e.materialPriority,
|
|
|
+ materialPriority:null,
|
|
|
};
|
|
|
this.tableData.push(addmap);
|
|
|
});
|
|
@@ -515,18 +562,39 @@ export default {
|
|
|
},
|
|
|
// 确认
|
|
|
makeSure() {
|
|
|
- console.log(this.tableData)
|
|
|
+ console.log(this.supplierId,"this.supplierId")
|
|
|
+ console.log(this.consigneeId,"this.consigneeId")
|
|
|
+ console.log(this.carrierId,"this.carrierId")
|
|
|
+ console.log(this.lineId,"this.lineId")
|
|
|
+ console.log(this.tableData)
|
|
|
+ if(this.supplierId==null||this.lineId==null||this.carrierId==null||this.consigneeId==null){
|
|
|
+ this.$alert('存在空值')
|
|
|
+ return
|
|
|
+ }else if(this.tableData.length == 0){
|
|
|
+ this.$alert('请点击浏览勾选物资')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.tableData.forEach((e) => {
|
|
|
+ if(e.materialPriority == null){
|
|
|
+ this.$alert('装卸货优先级未填写')
|
|
|
+ return
|
|
|
+ }else if(e.orderMaterialWeight == null){
|
|
|
+ this.$alert('物资重量未填写')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return
|
|
|
+ })
|
|
|
+ console.log(this.tableData)
|
|
|
+ debugger
|
|
|
let amsOrder = {
|
|
|
supplierId:this.supplierId,
|
|
|
- unloadPointId:this.unloadPointId,
|
|
|
lineId:this.lineId,
|
|
|
orderType:this.orderType,
|
|
|
carrierId: this.carrierId,
|
|
|
- receiveId: this.receiveId,
|
|
|
+ receiveId: this.consigneeId,
|
|
|
mapList: this.tableData,
|
|
|
};
|
|
|
- console.log(amsOrder);
|
|
|
-
|
|
|
+ console.log(amsOrder);
|
|
|
this.axios.post("/api/v1/ams/addSporadicOrders", amsOrder).then((res) => {
|
|
|
if (res.data.code == "200") {
|
|
|
this.$router.go(-1)
|
|
@@ -580,7 +648,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.button-box {
|
|
|
- margin-left: 25px !important;
|
|
|
+ margin-left: 45% ;
|
|
|
}
|
|
|
}
|
|
|
</style>
|