Commit 53a83095 authored by 邓春圆's avatar 邓春圆

修改商品报错,bug修复

parent 74c57922
...@@ -241,19 +241,20 @@ ...@@ -241,19 +241,20 @@
<script> <script>
import { import {
createProduct, createProduct,
updateProduct,
deleteProduct, deleteProduct,
exportProductExcel,
getProduct, getProduct,
getProductPage, getProductPage,
exportProductExcel, product_coupon_newProd,
product_coupon_newProd updateProduct
} from "@/api/ecw/product"; } from "@/api/ecw/product";
import { getProductAttrList } from "@/api/ecw/productAttr"; import {getProductAttrList} from "@/api/ecw/productAttr";
import { getProductTypeList } from "@/api/ecw/productType"; import {getProductTypeList} from "@/api/ecw/productType";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import {DICT_TYPE, getDictDatas} from '@/utils/dict';
import { CommonStatusEnum, AuditStatusEnum } from '@/utils/constants'; import {AuditStatusEnum, CommonStatusEnum} from '@/utils/constants';
import { uploadFile } from "@/api/infra/file"; import {uploadFile} from "@/api/infra/file";
import ImageUpload from '@/components/ImageUpload' import ImageUpload from '@/components/ImageUpload'
export default { export default {
name: "EcwProductIndex", name: "EcwProductIndex",
components: { components: {
...@@ -457,8 +458,6 @@ export default { ...@@ -457,8 +458,6 @@ export default {
needBook: 0, needBook: 0,
couponIds:[], couponIds:[],
}; };
let c = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
this.form.couponIds = c
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -477,6 +476,10 @@ export default { ...@@ -477,6 +476,10 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = this.$t("添加商品"); this.title = this.$t("添加商品");
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.form.couponIds = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
})
if (this.queryParams.typeId) { if (this.queryParams.typeId) {
this.form.typeId = this.queryParams.typeId; this.form.typeId = this.queryParams.typeId;
} }
...@@ -497,6 +500,11 @@ export default { ...@@ -497,6 +500,11 @@ export default {
}) })
this.open = true; this.open = true;
this.title = this.$t("修改商品"); this.title = this.$t("修改商品");
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.form.couponIds = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
// this.reset()
})
}); });
}, },
...@@ -628,16 +636,6 @@ export default { ...@@ -628,16 +636,6 @@ export default {
} }
} }
}, },
watch:{
open(val){
if(val){
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.reset()
})
}
}
}
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment