md
This commit is contained in:
parent
8999e81a03
commit
dd3b50d40d
@ -164,7 +164,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
debugger;
|
||||
this.datetimeRange = newVal;
|
||||
},
|
||||
datetimeRange(newVal, oldVal) {
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
||||
},
|
||||
remoteDebounce(val,key){
|
||||
debounce(this.queryData(val,key),1500);
|
||||
debounce(this.queryData(val,key),1000);
|
||||
},
|
||||
queryData(val,key) {
|
||||
this.optionItems=[];
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
<template>
|
||||
<el-select
|
||||
:loading="loading"
|
||||
filterable
|
||||
clearable
|
||||
v-model="svalue"
|
||||
:placeholder="placeholder"
|
||||
:filter-method="dataFilter"
|
||||
style="width: 100%;"
|
||||
:disabled="disabled"
|
||||
@change="onChange">
|
||||
style="width:100%"
|
||||
filterable
|
||||
clearable
|
||||
v-model="svalue"
|
||||
|
||||
no-data-text=""
|
||||
:placeholder="placeholder"
|
||||
@change="onChange"
|
||||
@click.native="onClick"
|
||||
|
||||
>
|
||||
<el-option v-for="item in optionItems" :key="item.destCode" :label="item.destName" :value="item.destCode" ></el-option>
|
||||
</el-select>
|
||||
|
||||
@ -48,69 +50,70 @@
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
bakOptionItems:[],
|
||||
optionItems: [],
|
||||
svalue: this.value,
|
||||
optionDefault:null,
|
||||
dataMap:new Map(),
|
||||
optionItems: [],
|
||||
// 缺省值
|
||||
defaultItems: null,
|
||||
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
this.svalue = newVal;
|
||||
},
|
||||
value(newVal,oldVal) {
|
||||
if(this.value!=null ){
|
||||
this.svalue=this.value;
|
||||
// 判断默认值中是否存在,若存在则不继续查询
|
||||
if(this.optionItems){
|
||||
let selItem = this.optionItems.find(item => item.destCode == this.svalue);
|
||||
if(selItem){
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
countryCode(newVal, oldVal) {
|
||||
this.initData();
|
||||
if(newVal!=oldVal){
|
||||
this.defaultItems=null;
|
||||
}
|
||||
},
|
||||
// lineCode(newVal, oldVal) {
|
||||
// this.initData();
|
||||
// },
|
||||
},
|
||||
created() {
|
||||
// if(this.isInitiated || this.svalue){
|
||||
|
||||
// }
|
||||
this.initData();
|
||||
if(this.svalue!=null){
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClick(){
|
||||
// 第一次点击时需要初始化
|
||||
if(!this.defaultItems){
|
||||
this.queryData(null,null);
|
||||
}else{
|
||||
this.optionItems = [...this.defaultItems];
|
||||
}
|
||||
},
|
||||
onChange() {
|
||||
this.$emit("input", this.svalue);
|
||||
let itemData ={};
|
||||
this.optionItems.forEach(item=>{
|
||||
if(item.destCode === this.svalue){
|
||||
itemData = item;
|
||||
}
|
||||
});
|
||||
let itemData=this.optionItems.find(item=> item.destCode === this.svalue);
|
||||
this.$emit("onChange",itemData);
|
||||
this.optionItems = this.bakOptionItems;
|
||||
},
|
||||
|
||||
initData() {
|
||||
queryData(val,key) {
|
||||
this.loading = true;
|
||||
// ,lineCode:this.lineCode
|
||||
let queryParams = {pageNumber:1,pageSize:150,country:this.countryCode};
|
||||
this.bakOptionItems=[];
|
||||
this.optionItems=[];
|
||||
let queryParams = {
|
||||
pageNum:1,
|
||||
pageSize:150,
|
||||
country:this.countryCode
|
||||
};
|
||||
|
||||
this.optionItems=[];
|
||||
listSimpleEmisDestination(queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.bakOptionItems = response.rows;
|
||||
this.optionItems =this.bakOptionItems;
|
||||
this.optionItems =response.rows;
|
||||
// 初始值存储
|
||||
if(key==null && val==null){
|
||||
this.defaultItems=[...this.optionItems]
|
||||
}
|
||||
});
|
||||
},
|
||||
dataFilter(val) {
|
||||
this.optionDefault = val
|
||||
|
||||
if (val) {
|
||||
let searchVal = val.toLowerCase();
|
||||
this.optionItems = this.bakOptionItems.filter(item => {
|
||||
if (item.destCode.indexOf(searchVal) != -1 || item.destName.toLowerCase().indexOf(searchVal) != -1 ) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.optionItems = this.bakOptionItems;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
ref="inputValue"
|
||||
:value="slable"
|
||||
:placeholder="placeholder"
|
||||
@input="handleInput"
|
||||
@focus="onFocus"
|
||||
@input="onInput"
|
||||
@click.native="onClick"
|
||||
@blur="onBlur"
|
||||
@clear="onClear"
|
||||
clearable
|
||||
@ -102,6 +102,8 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
|
||||
isInputing: false,
|
||||
|
||||
isInit:true,
|
||||
|
||||
queryParams:{
|
||||
pageNum:1,
|
||||
pageSize:5,
|
||||
@ -114,7 +116,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
},
|
||||
watch: {
|
||||
value(newVal,oldVal) {
|
||||
if(this.value!=null){
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
@ -133,12 +135,14 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
this.createdId = String(new Date().getTime())
|
||||
},
|
||||
created() {
|
||||
if(this.svalue!=null){
|
||||
this.queryData(null,this.svalue);
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onFocus(){
|
||||
onClick(){
|
||||
this.isInit=false;
|
||||
// 第一次点击时需要初始化
|
||||
if(!this.defaultItems){
|
||||
this.queryParams.pageNum=1;
|
||||
@ -149,7 +153,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
}
|
||||
// this.$refs.popoverRef.doShow();
|
||||
},
|
||||
handleInput(val) {
|
||||
onInput(val) {
|
||||
if(val == null ) return;
|
||||
|
||||
this.isInputing = true;
|
||||
@ -176,10 +180,6 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
};
|
||||
}
|
||||
},
|
||||
changePage(cur) {
|
||||
this.queryParams.pageNum = cur
|
||||
this.queryData()
|
||||
},
|
||||
onClear(el){
|
||||
this.slable = null;
|
||||
this.svalue = null;
|
||||
@ -196,6 +196,10 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
changePage(cur) {
|
||||
this.queryParams.pageNum = cur
|
||||
this.queryData()
|
||||
},
|
||||
queryData(val,key) {
|
||||
this.loading = true;
|
||||
|
||||
|
||||
@ -7,14 +7,14 @@
|
||||
style="width: 100%"
|
||||
clearable
|
||||
filterable
|
||||
@focus="onFocus"
|
||||
@click.native="onClick"
|
||||
@clear="onClear"
|
||||
@change="handleChange"
|
||||
@blur="onBlur"
|
||||
@change="onChange"
|
||||
></el-cascader>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
// import { listSimpleEmisCountry} from "@/api/emis/emisCountry";
|
||||
import { listSimpleEmisTransLine } from "@/api/emis/emisTransLine";
|
||||
import { listSimpleEmisTransProduct } from "@/api/emis/emisTransProduct";
|
||||
|
||||
@ -38,6 +38,7 @@ export default {
|
||||
return {
|
||||
resetCascader:0,
|
||||
svalue: this.value,
|
||||
isInit: true,
|
||||
lineCode:null,
|
||||
prodCode:null,
|
||||
props: {
|
||||
@ -55,12 +56,10 @@ export default {
|
||||
let parentCode = node.value;
|
||||
this.queryData(level,parentCode)
|
||||
.then((res) => {
|
||||
// console.log(res);
|
||||
if (res.code != 200) {
|
||||
return;
|
||||
}
|
||||
res.rows.map((item) => {
|
||||
|
||||
if(level==0){
|
||||
let obj = {
|
||||
value: item.lineCode,
|
||||
@ -77,7 +76,6 @@ export default {
|
||||
};
|
||||
nodes.push(obj);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// resolve 节点返回
|
||||
@ -93,20 +91,18 @@ export default {
|
||||
watch: {
|
||||
value(newVal) {
|
||||
this.svalue = newVal;
|
||||
if(this.svalue!=null) {
|
||||
if(this.svalue!=null && this.isInit) {
|
||||
this.lineCode=this.svalue[0];
|
||||
this.prodCode=this.svalue[1];
|
||||
this.resetCascader++
|
||||
}
|
||||
},
|
||||
countryCode(newVal) {
|
||||
this.queryData(0,0);
|
||||
this.resetCascader++
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(this.lineCode == null || this.prodCode != null || this.countryCode!= null){
|
||||
this.queryData(0,0);
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
onClear(){
|
||||
@ -114,25 +110,37 @@ export default {
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange", this.svalue);
|
||||
},
|
||||
onFocus(){
|
||||
onBlur(){
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange", this.svalue);
|
||||
},
|
||||
onClick(){
|
||||
this.isInit = false;
|
||||
this.lineCode=null;
|
||||
this.prodCode=null;
|
||||
this.queryData(0,0);
|
||||
},
|
||||
onChange(value) {
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange", this.svalue);
|
||||
},
|
||||
async queryData(level,parentCode) {
|
||||
// 第1级是线路
|
||||
if(level == 0){
|
||||
let queryParams={
|
||||
pageNum:1,
|
||||
pageSize:30,
|
||||
country:this.countryCode,
|
||||
lineCode:this.lineCode,
|
||||
};
|
||||
let res=await listSimpleEmisTransLine(queryParams);
|
||||
return res;
|
||||
}
|
||||
|
||||
// 产品
|
||||
if(level == 1){
|
||||
let queryParams={
|
||||
pageNum:1,
|
||||
pageSize:30,
|
||||
transLineCode:parentCode,
|
||||
prodCode:this.prodCode,
|
||||
status:1
|
||||
@ -140,12 +148,8 @@ export default {
|
||||
let res=await listSimpleEmisTransProduct(queryParams);
|
||||
return res;
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
handleChange(value) {
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange", this.svalue);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -724,16 +724,16 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.queryOrderType="1";
|
||||
this.queryOrderDateType="1";
|
||||
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setHours(0,0,0,0)
|
||||
end.setHours(23,59,59,0)
|
||||
this.dateTimeRange=[start,end];
|
||||
|
||||
this.getList();
|
||||
this.queryOrderType="1";
|
||||
this.queryOrderDateType="1";
|
||||
|
||||
// 调整表格的高度,不允许滚动
|
||||
this.$nextTick(function() {
|
||||
let queryFormEl = this.$refs.queryForm.$el;
|
||||
@ -741,6 +741,13 @@ export default {
|
||||
this.tableHeight = window.innerHeight - tableH;
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setHours(0,0,0,0)
|
||||
end.setHours(23,59,59,0)
|
||||
this.dateTimeRange=[start,end];
|
||||
},
|
||||
methods: {
|
||||
/** 查询运单列表列表 */
|
||||
getList() {
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
</template>
|
||||
<div>
|
||||
|
||||
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
|
||||
|
||||
@ -296,7 +295,7 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="国家地区" prop="reciever.province">
|
||||
<div style="display:inline-flex">
|
||||
<country-picker2 v-model="form.reciever.country" ></country-picker2>
|
||||
<country-picker2 v-model="form.reciever.country" ></country-picker2>
|
||||
<ProvincePicker2 v-model="form.reciever.province" :countryCode="form.reciever.country" style="margin-left:5px" @onChange="handleCalcDestSite" ></ProvincePicker2>
|
||||
<city-picker2 v-model="form.reciever.city" :parentCode="form.reciever.province" style="margin-left:5px"></city-picker2>
|
||||
<district-picker2 v-model="form.reciever.county" :parentCode="form.reciever.city" style="margin-left:5px"></district-picker2>
|
||||
@ -775,6 +774,7 @@ import PdfUtils from '@/utils/pdfUtils'
|
||||
|
||||
|
||||
export default {
|
||||
// name: "WaybillRecord",
|
||||
name: "WaybillModify",
|
||||
// props:{
|
||||
// billCode:{
|
||||
@ -844,7 +844,7 @@ data() {
|
||||
],
|
||||
reciever:{
|
||||
name: [
|
||||
{ required: true, message: "收货人名不能为空", trigger: "blur" }
|
||||
{ required: true, message: "收货人名不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "收货人手机号不能为空", trigger: "blur" }
|
||||
@ -870,7 +870,7 @@ data() {
|
||||
},
|
||||
sender:{
|
||||
name: [
|
||||
{ required: true, message: "寄件人名不能为空", trigger: "blur" }
|
||||
{ required: true, message: "寄件人名不能为空", trigger: ["blur",'change'] }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "寄件人手机号不能为空", trigger: "blur" }
|
||||
@ -1394,27 +1394,41 @@ methods: {
|
||||
this.form.reciever.address=value.address;
|
||||
this.form.reciever.company=value.company;
|
||||
|
||||
this.handleCalcDestSite();
|
||||
|
||||
},
|
||||
// 计算目的站点
|
||||
handleCalcDestSite(){
|
||||
// 初始化不计算
|
||||
// if(!this.isNeedSave){
|
||||
// return;
|
||||
// }
|
||||
console.log("1111=>"+this.form.reciever.province)
|
||||
|
||||
if(this.form.reciever.country != this.form.destinationCountry){
|
||||
this.$confirm('收件国和目的国不一致,请调整!', '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '返回',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.calcDestSite();
|
||||
}).catch(() => {
|
||||
})
|
||||
}else{
|
||||
this.calcDestSite();
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
calcDestSite(){
|
||||
let queryParams = {
|
||||
province:this.form.reciever.province
|
||||
province:this.form.reciever.province
|
||||
};
|
||||
|
||||
if(this.form.reciever.province){
|
||||
getDestSite(queryParams).then(response => {
|
||||
console.log(response);
|
||||
this.form.destinationCode = response.data.destCode+'';
|
||||
this.form.dispatchUnderlingSiteCode= response.data.siteCode;
|
||||
this.form.dispatchSiteCode= response.data.siteCode;
|
||||
this.form.dispatchSite = response.data.siteName;
|
||||
|
||||
this.form.dispatchUnderlingSiteCode= response.data.siteCode;
|
||||
this.form.dispatchUnderlingSite= response.data.siteName;
|
||||
this.form.dispatchSite= response.data.siteName;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="国家地区" prop="reciever.province">
|
||||
<div style="display:inline-flex">
|
||||
<country-picker2 v-model="form.reciever.country" ></country-picker2>
|
||||
<country-picker2 v-model="form.reciever.country" ></country-picker2>
|
||||
<ProvincePicker2 v-model="form.reciever.province" :countryCode="form.reciever.country" style="margin-left:5px" @onChange="handleCalcDestSite" ></ProvincePicker2>
|
||||
<city-picker2 v-model="form.reciever.city" :parentCode="form.reciever.province" style="margin-left:5px"></city-picker2>
|
||||
<district-picker2 v-model="form.reciever.county" :parentCode="form.reciever.city" style="margin-left:5px"></district-picker2>
|
||||
@ -1395,27 +1395,41 @@ methods: {
|
||||
this.form.reciever.address=value.address;
|
||||
this.form.reciever.company=value.company;
|
||||
|
||||
this.handleCalcDestSite();
|
||||
|
||||
},
|
||||
// 计算目的站点
|
||||
handleCalcDestSite(){
|
||||
// 初始化不计算
|
||||
// if(!this.isNeedSave){
|
||||
// return;
|
||||
// }
|
||||
console.log("1111=>"+this.form.reciever.province)
|
||||
|
||||
if(this.form.reciever.country != this.form.destinationCountry){
|
||||
this.$confirm('收件国和目的国不一致,请调整!', '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '返回',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.calcDestSite();
|
||||
}).catch(() => {
|
||||
})
|
||||
}else{
|
||||
this.calcDestSite();
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
calcDestSite(){
|
||||
let queryParams = {
|
||||
province:this.form.reciever.province
|
||||
province:this.form.reciever.province
|
||||
};
|
||||
|
||||
if(this.form.reciever.province){
|
||||
getDestSite(queryParams).then(response => {
|
||||
console.log(response);
|
||||
this.form.destinationCode = response.data.destCode+'';
|
||||
this.form.dispatchUnderlingSiteCode= response.data.siteCode;
|
||||
this.form.dispatchSiteCode= response.data.siteCode;
|
||||
this.form.dispatchSite = response.data.siteName;
|
||||
|
||||
this.form.dispatchUnderlingSiteCode= response.data.siteCode;
|
||||
this.form.dispatchUnderlingSite= response.data.siteName;
|
||||
this.form.dispatchSite= response.data.siteName;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user