|
@@ -49,36 +49,14 @@
|
|
placeholder="请输入辅助单位(最多30个字符)"
|
|
placeholder="请输入辅助单位(最多30个字符)"
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="产品品牌" prop="contactPhone">
|
|
|
|
- <a-select placeholder="请选择" :disabled="isEdit" allowClear v-model="form.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
|
|
|
|
- <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
|
|
|
|
+ <a-form-model-item label="产品品牌" prop="productBrand">
|
|
|
|
+ <a-select placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增" :disabled="isEdit" allowClear v-model="form.productBrand" :showSearch="true" option-filter-prop="children" :filter-option="filterOption" style="width: 90%;">
|
|
|
|
+ <a-select-option v-for="item in productBrandList" :key="item.id" :value="item.id">{{ item.productBrandName }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
|
|
+ <a-button @click="openModal=true" icon="plus" size="small" id="productInfoEdit-add-btn" style="margin-left: 5px;"></a-button>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="产品类别" required style="margin: 0;">
|
|
|
|
- <a-row :gutter="15">
|
|
|
|
- <!-- 产品类别 -->
|
|
|
|
- <a-col span="8">
|
|
|
|
- <a-form-model-item prop="provinceCode">
|
|
|
|
- <a-select id="productInfoEdit-provinceCode" :disabled="isEdit" @change="getCityList" v-model="form.provinceCode" placeholder="一级分类">
|
|
|
|
- <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col span="8">
|
|
|
|
- <a-form-model-item prop="cityCode">
|
|
|
|
- <a-select id="productInfoEdit-cityCode" :disabled="isEdit" @change="getAreaList" v-model="form.cityCode" placeholder="二级分类">
|
|
|
|
- <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col span="8">
|
|
|
|
- <a-form-model-item prop="districtCode">
|
|
|
|
- <a-select id="productInfoEdit-districtCode" :disabled="isEdit" @change="areaCharged" v-model="form.districtCode" placeholder="三级分类">
|
|
|
|
- <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </a-form-model-item>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
|
|
+ <a-form-model-item label="产品类别" prop="productType">
|
|
|
|
+ <a-cascader @change="changeProductType" :options="productTypeList" :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }" id="productInfoEdit-productType" placeholder="请选择产品类别" allowClear v-model="form.productType" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
<a-form-model-item label="经销批发价" prop="name">
|
|
<a-form-model-item label="经销批发价" prop="name">
|
|
<a-input-number
|
|
<a-input-number
|
|
@@ -118,15 +96,20 @@
|
|
<a-button @click="goBack" style="margin-left: 15px" id="productInfoEdit-btn-back">返回列表</a-button>
|
|
<a-button @click="goBack" style="margin-left: 15px" id="productInfoEdit-btn-back">返回列表</a-button>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
|
|
+ <!-- 新增/编辑产品品牌 -->
|
|
|
|
+ <product-brand-edit-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
|
|
+import productBrandEditModal from '../productBrand/editModal.vue'
|
|
|
|
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
|
+import { dealerProductTypeQuery } from '@/api/dealerProductType'
|
|
// import { goodsSave, goodsFind } from '@/api/goods'
|
|
// import { goodsSave, goodsFind } from '@/api/goods'
|
|
export default {
|
|
export default {
|
|
name: 'productInfoEdit',
|
|
name: 'productInfoEdit',
|
|
- components: { STable, VSelect },
|
|
|
|
|
|
+ components: { STable, VSelect, productBrandEditModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
formItemLayout: {
|
|
formItemLayout: {
|
|
@@ -135,17 +118,7 @@ export default {
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
name: '', // 供应商名称
|
|
name: '', // 供应商名称
|
|
- provinceCode: undefined, // 省
|
|
|
|
- provinceName: '',
|
|
|
|
- cityCode: undefined, // 市
|
|
|
|
- cityName: '',
|
|
|
|
- districtCode: undefined, // 区
|
|
|
|
- districtName: '',
|
|
|
|
- address: '', // 详细地址
|
|
|
|
- contactName: '', // 联系人
|
|
|
|
- contactPhone: '', // 联系电话
|
|
|
|
- remarks: '', // 主营内容
|
|
|
|
- state: 0 // 启禁用
|
|
|
|
|
|
+ productType: undefined, // 产品类别
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
name: [
|
|
name: [
|
|
@@ -176,7 +149,9 @@ export default {
|
|
addrProvinceList: [], // 省下拉
|
|
addrProvinceList: [], // 省下拉
|
|
addrCityList: [], // 市下拉
|
|
addrCityList: [], // 市下拉
|
|
addrDistrictList: [], // 区下拉
|
|
addrDistrictList: [], // 区下拉
|
|
- brandData: [], // 下拉数据
|
|
|
|
|
|
+ productBrandList: [], // 品牌下拉数据
|
|
|
|
+ productTypeList: [], // 类别下拉数据
|
|
|
|
+ openModal: false, // 新增编辑 弹框
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -217,6 +192,14 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ changeProductType(val, opt){
|
|
|
|
+ console.log(val, opt)
|
|
|
|
+ console.log(this.form.productType)
|
|
|
|
+ },
|
|
|
|
+ // 新增品牌 成功
|
|
|
|
+ handleOk(){
|
|
|
|
+ // 获取品牌数据列表,并赋值
|
|
|
|
+ },
|
|
filterOption(input, option) {
|
|
filterOption(input, option) {
|
|
return (
|
|
return (
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
@@ -226,63 +209,31 @@ export default {
|
|
goBack () {
|
|
goBack () {
|
|
this.$router.push({ path: '/productManagement/productInfo/list' })
|
|
this.$router.push({ path: '/productManagement/productInfo/list' })
|
|
},
|
|
},
|
|
- // 获取省列表'
|
|
|
|
- getProvinceList () {
|
|
|
|
- getProvince().then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.addrProvinceList = res.data || []
|
|
|
|
- } else {
|
|
|
|
- this.addrProvinceList = []
|
|
|
|
|
|
+ // 产品品牌 列表
|
|
|
|
+ getProductBrand(){
|
|
|
|
+ dealerProductBrandQuery({}).then(res => {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ this.productBrandList = res.data
|
|
|
|
+ }else{
|
|
|
|
+ this.productBrandList = []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 获取城市列表
|
|
|
|
- getCityList (val) {
|
|
|
|
- this.addrCityList = []
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- this.form.cityCode = undefined
|
|
|
|
- this.form.districtCode = undefined
|
|
|
|
- this.form.address = ''
|
|
|
|
- this.getCityListRequest(val)
|
|
|
|
- },
|
|
|
|
- getCityListRequest (val) {
|
|
|
|
- getCityByPro({
|
|
|
|
- id: val
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.addrCityList = res.data || []
|
|
|
|
- } else {
|
|
|
|
- this.addrCityList = []
|
|
|
|
|
|
+ // 产品类别 列表
|
|
|
|
+ getProductType(){
|
|
|
|
+ dealerProductTypeQuery({}).then(res => {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ this.productTypeList = res.data
|
|
|
|
+ }else{
|
|
|
|
+ this.productTypeList = []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 获取区县列表
|
|
|
|
- getAreaList (val) {
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- this.form.districtCode = undefined
|
|
|
|
- this.form.address = ''
|
|
|
|
- this.getAreaListRequest(val)
|
|
|
|
- },
|
|
|
|
- getAreaListRequest (val) {
|
|
|
|
- getDistrictByCity({
|
|
|
|
- id: val
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.addrDistrictList = res.data || []
|
|
|
|
- } else {
|
|
|
|
- this.addrDistrictList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 区县变更
|
|
|
|
- areaCharged (val) {
|
|
|
|
- this.form.address = ''
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
- // vm.getGoodsType()
|
|
|
|
- // vm.getPartnerQueryList()
|
|
|
|
|
|
+ vm.getProductBrand()
|
|
|
|
+ vm.getProductType()
|
|
vm.$refs.ruleForm.resetFields()
|
|
vm.$refs.ruleForm.resetFields()
|
|
if (vm.isEdit) { // 编辑页
|
|
if (vm.isEdit) { // 编辑页
|
|
vm.getGoodsDetail()
|
|
vm.getGoodsDetail()
|