|
@@ -401,58 +401,57 @@ export default {
|
|
|
},
|
|
|
// +新增产品
|
|
|
handleProductsOk (con) {
|
|
|
- const chooseProductsList = []
|
|
|
const _this = this
|
|
|
- con.forEach(item => {
|
|
|
- getNewScopeSn({}).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- const newData = {
|
|
|
- productScopeSn: res.data,
|
|
|
- dataSourceOrigin: '1',
|
|
|
- productTypeArr: [],
|
|
|
- productTypeList: [],
|
|
|
- productBrandArr: [{ brandSn: item.productBrandSn, brandName: item.productBrandName }],
|
|
|
- productBrandList: [{ brandSn: item.productBrandSn }],
|
|
|
- productThisList: [{
|
|
|
- productSn: item.productSn,
|
|
|
- productCode: item.code
|
|
|
- }],
|
|
|
- provincePrice: item.provincePrice,
|
|
|
- cityPrice: item.cityPrice,
|
|
|
- specialPrice: item.specialPrice,
|
|
|
- provinceDiscountPrice: item.provinceDiscountPriceText,
|
|
|
- cityDiscountPrice: item.cityDiscountPriceText,
|
|
|
- specialDiscountPrice: item.specialDiscountPriceText,
|
|
|
- unitType: 'SL',
|
|
|
- unitQty: 1
|
|
|
- }
|
|
|
- const obj = {}
|
|
|
- if (item.productTypeSn1) {
|
|
|
- obj.productType1 = item.productTypeSn1
|
|
|
- }
|
|
|
- if (item.productTypeSn2) {
|
|
|
- obj.productType2 = item.productTypeSn2
|
|
|
- }
|
|
|
- if (item.productTypeSn3) {
|
|
|
- obj.productType3 = item.productTypeSn3
|
|
|
- }
|
|
|
- const newObj = { ...obj, ...{} }
|
|
|
- if (Object.keys(obj).length == 1) {
|
|
|
- newObj.title = item.productTypeName1
|
|
|
- newObj.id = item.productTypeSn1
|
|
|
- } else if (Object.keys(obj).length == 2) {
|
|
|
- newObj.title = item.productTypeName1 + '/' + item.productTypeName2
|
|
|
- newObj.id = item.productTypeSn2
|
|
|
- } else {
|
|
|
- newObj.title = item.productTypeName1 + '/' + item.productTypeName2 + '/' + item.productTypeName3
|
|
|
- newObj.id = item.productTypeSn3
|
|
|
- }
|
|
|
- newData.productTypeList[0] = obj
|
|
|
- newData.productTypeArr[0] = newObj
|
|
|
- chooseProductsList.push(newData)
|
|
|
- _this.$refs.specialProduct.setSourceData(chooseProductsList)
|
|
|
+ con.forEach(async (item) => {
|
|
|
+ const chooseProductsList = []
|
|
|
+ const getSn = await getNewScopeSn({})
|
|
|
+ if (getSn.status == 200) {
|
|
|
+ const newData = {
|
|
|
+ productScopeSn: getSn.data,
|
|
|
+ dataSourceOrigin: '1',
|
|
|
+ productTypeArr: [],
|
|
|
+ productTypeList: [],
|
|
|
+ productBrandArr: [{ brandSn: item.productBrandSn, brandName: item.productBrandName }],
|
|
|
+ productBrandList: [{ brandSn: item.productBrandSn }],
|
|
|
+ productThisList: [{
|
|
|
+ productSn: item.productSn,
|
|
|
+ productCode: item.code
|
|
|
+ }],
|
|
|
+ provincePrice: item.provincePrice,
|
|
|
+ cityPrice: item.cityPrice,
|
|
|
+ specialPrice: item.specialPrice,
|
|
|
+ provinceDiscountPrice: item.provinceDiscountPriceText,
|
|
|
+ cityDiscountPrice: item.cityDiscountPriceText,
|
|
|
+ specialDiscountPrice: item.specialDiscountPriceText,
|
|
|
+ unitType: 'SL',
|
|
|
+ unitQty: 1
|
|
|
}
|
|
|
- })
|
|
|
+ const obj = {}
|
|
|
+ if (item.productTypeSn1) {
|
|
|
+ obj.productType1 = item.productTypeSn1
|
|
|
+ }
|
|
|
+ if (item.productTypeSn2) {
|
|
|
+ obj.productType2 = item.productTypeSn2
|
|
|
+ }
|
|
|
+ if (item.productTypeSn3) {
|
|
|
+ obj.productType3 = item.productTypeSn3
|
|
|
+ }
|
|
|
+ const newObj = { ...obj, ...{} }
|
|
|
+ if (Object.keys(obj).length == 1) {
|
|
|
+ newObj.title = item.productTypeName1
|
|
|
+ newObj.id = item.productTypeSn1
|
|
|
+ } else if (Object.keys(obj).length == 2) {
|
|
|
+ newObj.title = item.productTypeName1 + '/' + item.productTypeName2
|
|
|
+ newObj.id = item.productTypeSn2
|
|
|
+ } else {
|
|
|
+ newObj.title = item.productTypeName1 + '/' + item.productTypeName2 + '/' + item.productTypeName3
|
|
|
+ newObj.id = item.productTypeSn3
|
|
|
+ }
|
|
|
+ newData.productTypeList[0] = obj
|
|
|
+ newData.productTypeArr[0] = newObj
|
|
|
+ chooseProductsList.push(newData)
|
|
|
+ }
|
|
|
+ _this.$refs.specialProduct.setSourceData(chooseProductsList)
|
|
|
})
|
|
|
}
|
|
|
},
|