|
@@ -62,15 +62,21 @@
|
|
|
|
|
|
<!-- 承运商 -->
|
|
<!-- 承运商 -->
|
|
<template v-if="item.prop == 'carrierName'">
|
|
<template v-if="item.prop == 'carrierName'">
|
|
- <el-select v-model="scope.row.carrierName" placeholder="请选择"
|
|
|
|
- @change="batchUpdateValue(scope.row,scope.$index)">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in carrierNameOptions[scope.$index]"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value">
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-autocomplete
|
|
|
|
+ class="inline-input"
|
|
|
|
+ v-model="scope.row.carrierName"
|
|
|
|
+ :fetch-suggestions="querySearch1"
|
|
|
|
+ placeholder="请输入承运商名称"
|
|
|
|
+ :trigger-on-focus="false"
|
|
|
|
+ @change="batchUpdateValue(scope.row,scope.$index)"
|
|
|
|
+ @select="handleSelect1"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{ item }">
|
|
|
|
+ <div class="name" v-if="item.carrierName">
|
|
|
|
+ {{ item.carrierName }}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-autocomplete>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<!-- 物资件数 -->
|
|
<!-- 物资件数 -->
|
|
@@ -163,6 +169,8 @@ export default {
|
|
pos:0,
|
|
pos:0,
|
|
//加载
|
|
//加载
|
|
selectLineLoading:false,
|
|
selectLineLoading:false,
|
|
|
|
+ //所有选中承运商Id和承运商名称暂存
|
|
|
|
+ carrierIdAndName: [],
|
|
//承运商下拉框中的值
|
|
//承运商下拉框中的值
|
|
carrierNameOptions:[],
|
|
carrierNameOptions:[],
|
|
//当前车序号物资
|
|
//当前车序号物资
|
|
@@ -299,12 +307,8 @@ export default {
|
|
saleDateOfReceipt: e.receiptDate,
|
|
saleDateOfReceipt: e.receiptDate,
|
|
saleOrderConsignee: e.saleOrderConsignee,
|
|
saleOrderConsignee: e.saleOrderConsignee,
|
|
saleOrderConsigneeTel: e.saleOrderConsigneeTel,
|
|
saleOrderConsigneeTel: e.saleOrderConsigneeTel,
|
|
- priceValue: null,
|
|
|
|
- priceId: null,
|
|
|
|
};
|
|
};
|
|
this.selectionList.push(addmap);
|
|
this.selectionList.push(addmap);
|
|
- //填充承运商下拉框
|
|
|
|
- this.carrierNameOptions.push(e.carrierAndPriceList);
|
|
|
|
//调用记录每一行的合并数的方法
|
|
//调用记录每一行的合并数的方法
|
|
this.getSpanArr(this.selectionList);
|
|
this.getSpanArr(this.selectionList);
|
|
//初始化每个车的线路
|
|
//初始化每个车的线路
|
|
@@ -312,6 +316,40 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ //承运商弹出层
|
|
|
|
+ handleSelect1(item) {
|
|
|
|
+ let carrierIdAndNameItem = {
|
|
|
|
+ carrierId : item.carrierId,
|
|
|
|
+ carrierName : item.carrierName
|
|
|
|
+ }
|
|
|
|
+ this.carrierIdAndName.push(carrierIdAndNameItem);
|
|
|
|
+ },
|
|
|
|
+ //以下是承运商边输边查搜索
|
|
|
|
+ querySearch1(queryString, cb) {
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.data.code == "200") {
|
|
|
|
+ var restaurants = res.data.data;
|
|
|
|
+ var results = queryString
|
|
|
|
+ ? restaurants.filter(this.createFilter1(queryString))
|
|
|
|
+ : restaurants;
|
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
|
+ cb(results);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ createFilter1(queryString) {
|
|
|
|
+ return (restaurants) => {
|
|
|
|
+ return (
|
|
|
|
+ restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
|
|
|
|
+ -1
|
|
|
|
+ );
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ //以上是承运商边输边查搜索
|
|
|
|
+
|
|
onInput(val){
|
|
onInput(val){
|
|
if(!isNumber(val)){
|
|
if(!isNumber(val)){
|
|
this.$message.warning('重量/电话号码请输入数字')
|
|
this.$message.warning('重量/电话号码请输入数字')
|
|
@@ -359,7 +397,7 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {this.$message({ type: "info", message: "已取消删除",});});
|
|
.catch(() => {this.$message({ type: "info", message: "已取消删除",});});
|
|
},
|
|
},
|
|
- //失焦事件后确定车牌号与承运商是否有绑定关系
|
|
|
|
|
|
+ //确定车牌号与承运商是否有绑定关系
|
|
checkRelationship(index){
|
|
checkRelationship(index){
|
|
if(this.selectionList[index].carrierId!=null){
|
|
if(this.selectionList[index].carrierId!=null){
|
|
//暂存车牌号
|
|
//暂存车牌号
|
|
@@ -388,19 +426,7 @@ export default {
|
|
},
|
|
},
|
|
//车牌号弹出层
|
|
//车牌号弹出层
|
|
handleSelect(item) {
|
|
handleSelect(item) {
|
|
- console.log("item")
|
|
|
|
- // let mapValue = {
|
|
|
|
- // capacityNumber:item.capacityNumber,
|
|
|
|
- // carrierId:this.receiveCarrierId,
|
|
|
|
- // carrierName:this.receiveCarrierName
|
|
|
|
- // }
|
|
|
|
- // this.axios
|
|
|
|
- // .post("/api/v1/uc/isInCapacityCarrier", mapValue)
|
|
|
|
- // .then((res)=>{
|
|
|
|
- // if(res.data.code=="201"){
|
|
|
|
- // this.bindRelationship(mapValue);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
|
|
+ console.log("获取下拉值!")
|
|
},
|
|
},
|
|
|
|
|
|
//以下是车牌号边输边查搜索
|
|
//以下是车牌号边输边查搜索
|
|
@@ -453,7 +479,13 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
var mapList = [];
|
|
var mapList = [];
|
|
for(var i=0;i<this.spanArr.length;i++){
|
|
for(var i=0;i<this.spanArr.length;i++){
|
|
- if(this.spanArr[i]>0){
|
|
|
|
|
|
+ if(this.spanArr[i]>0){
|
|
|
|
+ //从所有选中承运商Id和承运商名称暂存中取出当前行的承运商Id
|
|
|
|
+ this.carrierIdAndName.forEach((item) => {
|
|
|
|
+ if(this.selectionList[i].carrierName==item.carrierName){
|
|
|
|
+ this.selectionList[i].carrierId = item.carrierId;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
var mapItem = {
|
|
var mapItem = {
|
|
//车牌号
|
|
//车牌号
|
|
capacityNumber : null,
|
|
capacityNumber : null,
|
|
@@ -463,14 +495,11 @@ export default {
|
|
carrierId : 0,
|
|
carrierId : 0,
|
|
//线路Id
|
|
//线路Id
|
|
lineId : 0,
|
|
lineId : 0,
|
|
- //运输单价Id
|
|
|
|
- priceId : 0
|
|
|
|
}
|
|
}
|
|
mapItem.capacityNumber = this.selectionList[i].capacityNumber,
|
|
mapItem.capacityNumber = this.selectionList[i].capacityNumber,
|
|
mapItem.saleOrderMaterialId = this.selectionList[i].saleOrderMaterialId,
|
|
mapItem.saleOrderMaterialId = this.selectionList[i].saleOrderMaterialId,
|
|
mapItem.carrierId = this.selectionList[i].carrierId,
|
|
mapItem.carrierId = this.selectionList[i].carrierId,
|
|
mapItem.lineId = this.selectionList[i].lineId,
|
|
mapItem.lineId = this.selectionList[i].lineId,
|
|
- mapItem.priceId = this.selectionList[i].priceId
|
|
|
|
mapList.push(mapItem);
|
|
mapList.push(mapItem);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -494,23 +523,9 @@ export default {
|
|
|
|
|
|
//批量修改内层值
|
|
//批量修改内层值
|
|
batchUpdateValue(row,index){
|
|
batchUpdateValue(row,index){
|
|
- //单价以及单价Id
|
|
|
|
- var priceValue = null;
|
|
|
|
- var priceId = null;
|
|
|
|
- var carrierName = null;
|
|
|
|
- this.carrierNameOptions[index].forEach((e) => {
|
|
|
|
- if (row.carrierName == e.value) {
|
|
|
|
- priceValue = e.priceValue;
|
|
|
|
- priceId = e.priceId;
|
|
|
|
- carrierName = e.label;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
for(var i=index;i<this.spanArr[index]+index;i++){
|
|
for(var i=index;i<this.spanArr[index]+index;i++){
|
|
this.selectionList[i].capacityNumber=row.capacityNumber;
|
|
this.selectionList[i].capacityNumber=row.capacityNumber;
|
|
- this.selectionList[i].carrierId=row.carrierName;
|
|
|
|
- this.selectionList[i].carrierName=carrierName;
|
|
|
|
- this.selectionList[i].priceValue=priceValue;
|
|
|
|
- this.selectionList[i].priceId=priceId;
|
|
|
|
|
|
+ this.selectionList[i].carrierName=row.carrierName;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//初始化线路
|
|
//初始化线路
|