md
This commit is contained in:
parent
2635f6b887
commit
fe46614af9
@ -1,194 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-cascader
|
|
||||||
ref="selectRef"
|
|
||||||
:size="size"
|
|
||||||
:props="props"
|
|
||||||
:key="resetCascader"
|
|
||||||
v-model="svalue"
|
|
||||||
style="width: 100%"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
@click.native="onClick"
|
|
||||||
@clear="onClear"
|
|
||||||
@blur="onBlur"
|
|
||||||
@change="onChange"
|
|
||||||
></el-cascader>
|
|
||||||
</template>
|
|
||||||
<!-- @input.native="searchFilter" -->
|
|
||||||
<!-- filterable -->
|
|
||||||
<!-- :before-filter="beforeFilter"
|
|
||||||
@input.native="searchFilter" -->
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import { listSimpleEmisTransLine } from "@/api/emis/emisTransLine";
|
|
||||||
import { listSimpleEmisTransProduct } from "@/api/emis/emisTransProduct";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "TransProductCasPicker",
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: [String, Number,Array],
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
countryCode: {
|
|
||||||
type: String,
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
size:{
|
|
||||||
type: String,
|
|
||||||
required: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
resetCascader:0,
|
|
||||||
svalue: this.value,
|
|
||||||
isInit: true,
|
|
||||||
lineCode:null,
|
|
||||||
prodCode:null,
|
|
||||||
searchVal:null,
|
|
||||||
props: {
|
|
||||||
// checkStrictly: true,
|
|
||||||
lazy: true,
|
|
||||||
lazyLoad: (node, resolve) => {
|
|
||||||
const nodes = [];
|
|
||||||
// level: 层级
|
|
||||||
// node 节点数据
|
|
||||||
// 一级菜单数据
|
|
||||||
let level = node.level;
|
|
||||||
// level==0 ? "1" : node.value;
|
|
||||||
let parentCode = node.value;
|
|
||||||
this.queryData(level,parentCode)
|
|
||||||
.then((res) => {
|
|
||||||
res.rows.map((item) => {
|
|
||||||
if(level==0){
|
|
||||||
let obj = {
|
|
||||||
value: item.lineCode,
|
|
||||||
label: item.lineName,
|
|
||||||
leaf: false,
|
|
||||||
};
|
|
||||||
nodes.push(obj);
|
|
||||||
}
|
|
||||||
else if(level==1){
|
|
||||||
let obj = {
|
|
||||||
value: item.prodCode,
|
|
||||||
label: item.prodName+"("+item.agingDesc+")",
|
|
||||||
leaf: true,
|
|
||||||
};
|
|
||||||
nodes.push(obj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// resolve 节点返回
|
|
||||||
resolve(nodes);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
// console.log(error);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
value(newVal) {
|
|
||||||
this.svalue = newVal;
|
|
||||||
if(this.svalue!=null && this.svalue.length==2 && this.isInit) {
|
|
||||||
this.lineCode=this.svalue[0];
|
|
||||||
this.prodCode=this.svalue[1];
|
|
||||||
this.resetCascader++
|
|
||||||
}else{
|
|
||||||
this.$refs.selectRef.handleClear()
|
|
||||||
this.lineCode=null;
|
|
||||||
this.prodCode=null;
|
|
||||||
this.resetCascader++
|
|
||||||
}
|
|
||||||
},
|
|
||||||
countryCode(newVal) {
|
|
||||||
this.resetCascader++
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
beforeFilter (val) {
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
searchFilter(el){
|
|
||||||
let val = el.target.value;
|
|
||||||
this.searchVal = val;
|
|
||||||
},
|
|
||||||
onClear(){
|
|
||||||
console.log("=======333=>"+this.svalue)
|
|
||||||
this.svalue = null;
|
|
||||||
this.$emit("input", this.svalue);
|
|
||||||
this.$emit("onChange", this.svalue);
|
|
||||||
},
|
|
||||||
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,val) {
|
|
||||||
// 第1级是线路
|
|
||||||
if(level == 0){
|
|
||||||
let queryParams={
|
|
||||||
pageNum:1,
|
|
||||||
pageSize:500,
|
|
||||||
country:this.countryCode,
|
|
||||||
lineCode:this.lineCode,
|
|
||||||
lineName:val
|
|
||||||
};
|
|
||||||
let res=await listSimpleEmisTransLine(queryParams);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
// 产品
|
|
||||||
if(level == 1){
|
|
||||||
let queryParams={
|
|
||||||
pageNum:1,
|
|
||||||
pageSize:500,
|
|
||||||
transLineCode:parentCode,
|
|
||||||
prodCode:this.prodCode,
|
|
||||||
prodName:val,
|
|
||||||
status:1
|
|
||||||
};
|
|
||||||
let res=await listSimpleEmisTransProduct(queryParams);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.con {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-radio__inner {
|
|
||||||
border-radius: 0;
|
|
||||||
border: 0;
|
|
||||||
width: 170px;
|
|
||||||
height: 34px;
|
|
||||||
background-color: transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
box-sizing: border-box;
|
|
||||||
position: absolute;
|
|
||||||
top: -18px;
|
|
||||||
left: -19px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-radio__input.is-checked .el-radio__inner {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -1,22 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-cascader
|
<el-cascader
|
||||||
:key="resetCascader"
|
|
||||||
ref="selectRef"
|
ref="selectRef"
|
||||||
:size="size"
|
:size="size"
|
||||||
:props="props"
|
:props="props"
|
||||||
|
:key="resetCascader"
|
||||||
v-model="svalue"
|
v-model="svalue"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
|
:filter-method="dataFilter"
|
||||||
@click.native="onClick"
|
@click.native="onClick"
|
||||||
@clear="onClear"
|
@clear="onClear"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
:debounce="200"
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</template>
|
</template>
|
||||||
<!-- :append-to-body="false" -->
|
|
||||||
<!-- :before-filter="beforeFilter" -->
|
|
||||||
<!-- :filter-method="dataFilter" -->
|
|
||||||
<!-- @input.native="searchFilter" -->
|
<!-- @input.native="searchFilter" -->
|
||||||
<!-- filterable -->
|
<!-- filterable -->
|
||||||
<!-- :before-filter="beforeFilter"
|
<!-- :before-filter="beforeFilter"
|
||||||
@ -51,7 +50,8 @@ export default {
|
|||||||
prodCode:null,
|
prodCode:null,
|
||||||
searchVal:null,
|
searchVal:null,
|
||||||
props: {
|
props: {
|
||||||
// checkStrictly: true,
|
checkStrictly: true,
|
||||||
|
emitPath: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
lazyLoad: (node, resolve) => {
|
lazyLoad: (node, resolve) => {
|
||||||
const nodes = [];
|
const nodes = [];
|
||||||
@ -68,6 +68,8 @@ export default {
|
|||||||
let obj = {
|
let obj = {
|
||||||
value: item.lineCode,
|
value: item.lineCode,
|
||||||
label: item.lineName,
|
label: item.lineName,
|
||||||
|
// disabled:true,
|
||||||
|
children:[],
|
||||||
leaf: false,
|
leaf: false,
|
||||||
};
|
};
|
||||||
nodes.push(obj);
|
nodes.push(obj);
|
||||||
@ -114,29 +116,18 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// beforeFilter (val) {
|
beforeFilter (val) {
|
||||||
// return false;
|
return false;
|
||||||
// },
|
},
|
||||||
// beforeFilter(value) {
|
|
||||||
// console.log("=======beforeFilter=>"+value)
|
|
||||||
// this.searchVal = value?.trim()
|
|
||||||
// console.log(this.searchVal)
|
|
||||||
// // 手动筛选
|
|
||||||
// data.options2 = data.options2.filter(v => v.label.indexOf(data.keyWord) > -1)
|
|
||||||
// // 空的时候显示默认的筛选无结果面板
|
|
||||||
// if (data.options2.length === 0) {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// // 懒加载时默认筛选无效 直接禁用它 让组件加载我们手动筛选的数据
|
|
||||||
// return false
|
|
||||||
// },
|
|
||||||
searchFilter(el){
|
searchFilter(el){
|
||||||
let val = el.target.value;
|
let val = el.target.value;
|
||||||
this.searchVal = val;
|
this.searchVal = val;
|
||||||
setTimeout(() => {
|
},
|
||||||
this.resetCascader++;
|
regionMenuChange(boolean){
|
||||||
},1000);
|
if(boolean){
|
||||||
|
this.$refs.selectRef.$refs.panel.activePath=[];
|
||||||
|
this.queryData(0,0);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onClear(){
|
onClear(){
|
||||||
console.log("=======333=>"+this.svalue)
|
console.log("=======333=>"+this.svalue)
|
||||||
@ -160,7 +151,7 @@ export default {
|
|||||||
},
|
},
|
||||||
dataFilter(node, val) {
|
dataFilter(node, val) {
|
||||||
console.log('val', val, 'node', node)
|
console.log('val', val, 'node', node)
|
||||||
if (!!~node.text.indexOf(val) || !!~node.text.toUpperCase().indexOf(val.toUpperCase())) {
|
if (!!~node.label.indexOf(val) || !!~node.label.toUpperCase().indexOf(val.toUpperCase())) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -184,7 +175,6 @@ export default {
|
|||||||
pageSize:500,
|
pageSize:500,
|
||||||
transLineCode:parentCode,
|
transLineCode:parentCode,
|
||||||
prodCode:this.prodCode,
|
prodCode:this.prodCode,
|
||||||
prodName:this.searchVal,
|
|
||||||
status:1
|
status:1
|
||||||
};
|
};
|
||||||
let res=await listSimpleEmisTransProduct(queryParams);
|
let res=await listSimpleEmisTransProduct(queryParams);
|
||||||
@ -195,7 +185,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
.con {
|
.con {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -217,4 +207,27 @@ export default {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-cascader-panel [id^="cascader-menu-"][id$="-1"] div .el-radio {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 10;
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
right: 30px;
|
||||||
|
}
|
||||||
|
.el-cascader-panel [id^="cascader-menu-"][id$="-2"] div .el-radio {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 10;
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
right: 30px;
|
||||||
|
}
|
||||||
|
.el-cascader-panel .el-radio__input {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
.el-cascader-panel [id^="cascader-menu-"][id$="-0"] div .el-radio__input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
:showPagination="false"
|
:showPagination="false"
|
||||||
:showOperateButton="false"
|
:showOperateButton="false"
|
||||||
:showCustomizeTpl="false"
|
:showCustomizeTpl="false"
|
||||||
:default-sort="{prop: 'scanDate', order: 'descending'}"
|
:default-sort="{prop: 'scanDate', order: 'ascending'}"
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" align="center" min-width="60">
|
<el-table-column label="序号" align="center" min-width="60">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -17,7 +17,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column :label="$t('扫描时间')" align="center" prop="scanDate" :sortable="true" :sort-method="sortByScanDate" min-width="170" >
|
<el-table-column :label="$t('扫描时间')" align="center" prop="scanDate" :sortable="true" :sort-method="sortByScanDate" min-width="170" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
<span>{{ parseTime(scope.row.scanDate) }}</span>
|
||||||
|
|||||||
@ -1548,7 +1548,7 @@ methods: {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
startTimer(){
|
startTimer(){
|
||||||
if(this.action=='add' || action=='preAdd'){
|
if(this.action=='add' || this.action=='preAdd'){
|
||||||
this.sendDate=parseTime(new Date());
|
this.sendDate=parseTime(new Date());
|
||||||
this.timer = setTimeout(this.startTimer, 1000);
|
this.timer = setTimeout(this.startTimer, 1000);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user