|
@@ -100,6 +100,7 @@
|
|
import { STable } from '@/components'
|
|
import { STable } from '@/components'
|
|
import { productBrandQuery } from '@/api/productBrand'
|
|
import { productBrandQuery } from '@/api/productBrand'
|
|
import { productTypeQuery } from '@/api/productType'
|
|
import { productTypeQuery } from '@/api/productType'
|
|
|
|
+import { dealerScopeValidProduct } from '@/api/dealerScope'
|
|
import { productList } from '@/api/product'
|
|
import { productList } from '@/api/product'
|
|
export default {
|
|
export default {
|
|
name: 'ChooseProductsModal',
|
|
name: 'ChooseProductsModal',
|
|
@@ -118,6 +119,10 @@ export default {
|
|
type: { // 类型,经销权设置dealership
|
|
type: { // 类型,经销权设置dealership
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
|
|
+ },
|
|
|
|
+ dealerSn: {
|
|
|
|
+ type: String || Number,
|
|
|
|
+ default: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -168,7 +173,45 @@ export default {
|
|
const _this = this
|
|
const _this = this
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- _this.getProductList(1)
|
|
|
|
|
|
+ if (_this.type == 'dealership') { // 设置经销权时选择产品
|
|
|
|
+ // 校验产品是否被包含在品牌分类中
|
|
|
|
+ const params = []
|
|
|
|
+ if (_this.queryParam.productBrandSn) {
|
|
|
|
+ params.push({
|
|
|
|
+ dealerSn: _this.dealerSn,
|
|
|
|
+ goodsType: 'BRAND',
|
|
|
|
+ goodsSn: _this.queryParam.productBrandSn
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (_this.queryParam.productTypeSn1) {
|
|
|
|
+ params.push({
|
|
|
|
+ dealerSn: _this.dealerSn,
|
|
|
|
+ goodsType: 'CATEGORY',
|
|
|
|
+ goodsSn: _this.queryParam.productTypeSn1
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (_this.queryParam.productTypeSn2) {
|
|
|
|
+ params.push({
|
|
|
|
+ dealerSn: _this.dealerSn,
|
|
|
|
+ goodsType: 'CATEGORY',
|
|
|
|
+ goodsSn: _this.queryParam.productTypeSn2
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (_this.queryParam.productTypeSn3) {
|
|
|
|
+ params.push({
|
|
|
|
+ dealerSn: _this.dealerSn,
|
|
|
|
+ goodsType: 'CATEGORY',
|
|
|
|
+ goodsSn: _this.queryParam.productTypeSn3
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ dealerScopeValidProduct(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.getProductList(1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ _this.getProductList(1)
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
return false
|
|
return false
|
|
}
|
|
}
|