|
|
@@ -60,9 +60,14 @@
|
|
|
@include("customer.project.part._two")
|
|
|
</div>
|
|
|
<div v-if="base == 'three'">
|
|
|
- @include("customer.project.part._three")
|
|
|
+ <div v-show="isLoad">@include("customer.project.part._three")</div>
|
|
|
+ <div class="row justify-content-center text-secondary" style="min-height: 200px;margin-left: -25%" v-show="!isLoad">
|
|
|
+ <div class="align-self-center h1">
|
|
|
+ <i class="fa fa-spinner fa-pulse"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="row mt-3">
|
|
|
+ <div class="row mt-3" v-if="base != 'three' || isLoad">
|
|
|
<div class="pull-right offset-7">
|
|
|
<button type="button" class="btn btn-info ml-1 text-white" v-show="base !== 'one'" @click="back()">上一步</button>
|
|
|
<button type="button" class="btn btn-info ml-1 text-white" v-show="base !== 'three'" @click="next()">下一步</button>
|
|
|
@@ -191,9 +196,11 @@
|
|
|
searchResult:[],//查询结果
|
|
|
searchResultMapping:{},//查询结果映射
|
|
|
selectedResult:"",
|
|
|
+ searchItem:{},//搜索子项集
|
|
|
+ searchBase:5,//搜索基数
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.ownerTemp = this.owner;
|
|
|
+ this.ownerTemp = JSON.parse(JSON.stringify(this.owner));
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
$("#container").removeClass("d-none");
|
|
|
},
|
|
|
@@ -216,9 +223,9 @@
|
|
|
},
|
|
|
//切换选项
|
|
|
switchBase(base){
|
|
|
- if (!this.ownerTemp.id)return;
|
|
|
- if (base === 'three') this._loadStorage();
|
|
|
+ if (!this.owner.id)return;
|
|
|
if (base === this.base)return;
|
|
|
+ if (base === 'three') this._loadStorage();
|
|
|
this.base = base;
|
|
|
},
|
|
|
//切换类型
|
|
|
@@ -303,7 +310,7 @@
|
|
|
}
|
|
|
if (this.owner.name !== this.ownerTemp.name || this.owner.code !== this.ownerTemp.code){
|
|
|
let url = "{{url('maintenance/owner/apiStore')}}";
|
|
|
- let params = {name:this.owner.name,code:this.owner.code,id:this.ownerTemp.id};
|
|
|
+ let params = {name:this.owner.name,code:this.owner.code,id:this.owner.id};
|
|
|
let result = undefined;
|
|
|
window.tempTip.postBasicRequest(url,params,res=>{
|
|
|
if (res.errors){
|
|
|
@@ -314,7 +321,6 @@
|
|
|
}
|
|
|
this.errors = [];
|
|
|
this.owner.id = res.id;
|
|
|
- this.ownerTemp.id = res.id;
|
|
|
this.ownerTemp.name = res.name;
|
|
|
this.ownerTemp.code = res.code;
|
|
|
result = true;
|
|
|
@@ -388,39 +394,52 @@
|
|
|
let url = "{{url('customer/project/getPriceModel')}}";
|
|
|
let params = {id:this.ownerTemp.id};
|
|
|
window.tempTip.postBasicRequest(url,params,res=>{
|
|
|
+ this._getOwners();
|
|
|
+ this._getUnits();
|
|
|
+ this._getCars();
|
|
|
+ this._getCities();
|
|
|
+ this._getLogistics();
|
|
|
+ this._getProvinces();
|
|
|
+ setTimeout(()=> {
|
|
|
+ $(".selectpicker").selectpicker('refresh');
|
|
|
+ },500);
|
|
|
if (res.owner_storage_price_models.length>0)this.selectedModel.storage = res.owner_storage_price_models;
|
|
|
if (res.owner_price_operations.length>0)this.selectedModel.operation = res.owner_price_operations;
|
|
|
if (res.owner_price_expresses.length>0){
|
|
|
- this._loadExpress();
|
|
|
res.owner_price_expresses.forEach((express,i)=>{
|
|
|
express.logistics.forEach((logistic,j)=>{
|
|
|
express.logistics[j] = logistic.id;
|
|
|
});
|
|
|
res.owner_price_expresses[i] = JSON.parse(JSON.stringify(express).replace(/details/g,"items"));
|
|
|
+ this.upList['express-item-'+i] = true;
|
|
|
});
|
|
|
this.selectedModel.express = res.owner_price_expresses;
|
|
|
}
|
|
|
if (res.owner_price_logistics.length>0){
|
|
|
- this._loadLogistic();
|
|
|
res.owner_price_logistics.forEach((logistic,i)=>{
|
|
|
logistic.logistics.forEach((l,j)=>{
|
|
|
logistic.logistics[j] = l.id;
|
|
|
});
|
|
|
res.owner_price_logistics[i] = JSON.parse(JSON.stringify(logistic).replace(/details/g,"items"));
|
|
|
+ this.upList['logistic-item-'+i] = true;
|
|
|
});
|
|
|
this.selectedModel.logistic = res.owner_price_logistics;
|
|
|
}
|
|
|
if (res.owner_price_direct_logistics.length>0){
|
|
|
- this._loadDirectLogistic();
|
|
|
+ this.upList["directLogistic-item"] = true;
|
|
|
this.selectedModel.directLogistic = JSON.parse(JSON.stringify(res.owner_price_direct_logistics[0]).replace(/details/g,"items"));
|
|
|
}
|
|
|
+ setTimeout(()=> {
|
|
|
+ $(".up").slideUp();
|
|
|
+ this.isLoad = true;
|
|
|
+ },0)
|
|
|
});
|
|
|
- this.isLoad = true;
|
|
|
},
|
|
|
//加载仓储所需基础信息
|
|
|
_loadStorage(){
|
|
|
if (!this.pool.units)this._getUnits();
|
|
|
if (!this.isLoad && this.ownerTemp.id)this._loadPriceModel();//计费模型未被加载且项目ID存在时
|
|
|
+ if (!this.isLoad && !this.ownerTemp.id) this.isLoad = true;
|
|
|
},
|
|
|
//加载作业
|
|
|
_loadOperation(){
|
|
|
@@ -733,12 +752,12 @@
|
|
|
window.tempTip.postBasicRequest(url,params,res=>{
|
|
|
if (res && res.errors){
|
|
|
this.errors = res.errors;
|
|
|
+ window.tempTip.show("检查您的子项详情列表是否完整");
|
|
|
return;
|
|
|
}
|
|
|
this.model.logistic.items.forEach((item,i)=>{
|
|
|
item.id = res.details[i].id;
|
|
|
});
|
|
|
- console.log(this.model.logistic);
|
|
|
if (this.model.logistic.id) this.selectedModel.logistic[this.model.logistic.index] = this.model.logistic;
|
|
|
else {
|
|
|
this.model.logistic.id = res.id;
|
|
|
@@ -982,22 +1001,20 @@
|
|
|
},
|
|
|
//新增物流详情
|
|
|
addLogisticDetail(){
|
|
|
- this.model.logistic.items.unshift({
|
|
|
-
|
|
|
- });
|
|
|
+ this.model.logistic.items.unshift({});
|
|
|
},
|
|
|
//导入物流详情
|
|
|
importLogistic(e){
|
|
|
- tempTip.setIndex(1099);
|
|
|
+ window.tempTip.setIndex(1099);
|
|
|
let file=e.target.files[0];
|
|
|
if (!file){
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.show("未选择文件");
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show("未选择文件");
|
|
|
return;
|
|
|
}
|
|
|
let formData = new FormData();
|
|
|
formData.append("file",file);
|
|
|
- axios.post('{{url('maintenance/priceModel/logistic/import')}}',formData,{
|
|
|
+ window.axios.post('{{url('maintenance/priceModel/logistic/import')}}',formData,{
|
|
|
'Content-Type':'multipart/form-data'
|
|
|
}).then(res=>{
|
|
|
if (res.data.success) {
|
|
|
@@ -1020,15 +1037,15 @@
|
|
|
}
|
|
|
});
|
|
|
this.importError = res.data.errors;
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.showSuccess("导入成功!");
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.showSuccess("导入成功!");
|
|
|
return;
|
|
|
}
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.show(res.data.data);
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show(res.data.data);
|
|
|
}).catch(err=> {
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.show("网络错误:"+err);
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show("网络错误:"+err);
|
|
|
})
|
|
|
},
|
|
|
//删除物流子项
|
|
|
@@ -1416,6 +1433,8 @@
|
|
|
editLogistic(index){
|
|
|
this.switchType("logistic");
|
|
|
this.model.logistic = JSON.parse(JSON.stringify(this.selectedModel.logistic[index]));
|
|
|
+ this.model.logistic.ranges = this.model.logistic.unit_range.split(",");
|
|
|
+ this.model.logistic.other_ranges = this.model.logistic.other_unit_range.split(",");
|
|
|
this.model.logistic.index = index;
|
|
|
},
|
|
|
//编辑直发车
|
|
|
@@ -1423,6 +1442,49 @@
|
|
|
this.switchType("directLogistic");
|
|
|
this.model.directLogistic = JSON.parse(JSON.stringify(this.selectedModel.directLogistic));
|
|
|
},
|
|
|
+ //搜索快递子项
|
|
|
+ searchExpress(e){
|
|
|
+ let val = e.target.value;
|
|
|
+ if (!val){
|
|
|
+ this.$set(this.searchItem,'express',null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let items = [];
|
|
|
+ this.model.express.items.forEach((item,i)=>{
|
|
|
+ if (this.poolMapping.provinces[item.province_id].indexOf(val) !== -1)items.push(i);
|
|
|
+ });
|
|
|
+ this.$set(this.searchItem,'express',items);
|
|
|
+ },
|
|
|
+ //搜索直发子项
|
|
|
+ searchDirectLogistic(e){
|
|
|
+ let val = e.target.value;
|
|
|
+ if (!val){
|
|
|
+ this.$set(this.searchItem,'directLogistic',null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let items = [];
|
|
|
+ this.model.directLogistic.items.forEach((item,i)=>{
|
|
|
+ if (this.poolMapping.cars[item.car_type_id].indexOf(val) !== -1)items.push(i);
|
|
|
+ });
|
|
|
+ this.$set(this.searchItem,'directLogistic',items);
|
|
|
+ },
|
|
|
+ //搜索物流子项
|
|
|
+ searchLogistic(e){
|
|
|
+ let val = e.target.value;
|
|
|
+ if (!val){
|
|
|
+ this.$set(this.searchItem,'logistic',null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let items = [];
|
|
|
+ this.model.logistic.items.forEach((item,i)=>{
|
|
|
+ if (item.unit_id || item.province_id || item.city_id){
|
|
|
+ if ((item.unit_id && this.poolMapping.units[item.unit_id].indexOf(val) !== -1) ||
|
|
|
+ (item.province_id && this.poolMapping.provinces[item.province_id].indexOf(val) !== -1) ||
|
|
|
+ (item.city_id && this.poolMapping.cities[item.city_id].indexOf(val) !== -1))items.push(i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$set(this.searchItem,'logistic',items);
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
</script>
|