master
xy 3 years ago
parent ccd65788c0
commit af0ad7dac6

@ -268,6 +268,7 @@ import {save, getInfo} from '@/api/customer'
import {save as orderSave} from '@/api/order' import {save as orderSave} from '@/api/order'
import {getList as productList} from "@/api/product"; import {getList as productList} from "@/api/product";
import {getBirth,getSex,getAgeByIdcard} from '@/utils' import {getBirth,getSex,getAgeByIdcard} from '@/utils'
import {getAuthAreas} from "@/utils/auth"
import moment from "moment"; import moment from "moment";
export default { export default {
@ -339,6 +340,7 @@ export default {
type: '', type: '',
isShow: false, isShow: false,
addressInput: '',// addressInput: '',//
areas:[],
addressTable: [ addressTable: [
{ {
@ -587,6 +589,9 @@ export default {
} }
}, },
methods: { methods: {
getAreas(){
this.areas = getAuthAreas(this)
},
init(){ init(){
this.form = { this.form = {
name: '', name: '',
@ -825,9 +830,11 @@ export default {
}, },
productFilter(){ productFilter(){
if(this.form.product_type_customer_links.length === 0) return this.products if(this.form.product_type_customer_links.length === 0) return this.products
console.log(this.form.product_type_customer_links)
let ids = this.form.product_type_customer_links.map(item => item.product_type_id) let ids = this.form.product_type_customer_links.map(item => item.product_type_id)
let areaIds = this.areas.map(item => item.id)
return this.products.filter(item => { return this.products.filter(item => {
return ids.indexOf(item.product_type_id) !== -1 return (ids.indexOf(item.product_type_id) !== -1) && (areaIds.indexOf(item.area_id) !== -1)
}) })
} }
}, },
@ -861,6 +868,9 @@ export default {
}, },
mounted() { mounted() {
this.getProducts() this.getProducts()
},
created() {
this.getAreas()
} }
} }
</script> </script>

@ -368,7 +368,7 @@ export default {
.pop-confirm { .pop-confirm {
z-index: 3000 !important; z-index: 3000 !important;
} }
.avue-dialog{ .avue-dialog {
z-index:9999 !important; z-index:9999 !important;
} }
</style> </style>

Loading…
Cancel
Save