diff --git a/view/admin/src/views/product/productExamine/index.vue b/view/admin/src/views/product/productExamine/index.vue
index b49d0e1..6a16959 100644
--- a/view/admin/src/views/product/productExamine/index.vue
+++ b/view/admin/src/views/product/productExamine/index.vue
@@ -192,6 +192,22 @@
+
+
+
+
{{item.desc}}
+
+ 成本价
+
+
+
+ 价格
+
+
+
+
+
+
@@ -317,6 +333,7 @@ export default {
},
data() {
return {
+ attrValue:[],
props: {
emitPath: false
},
@@ -367,7 +384,8 @@ export default {
store_name: '',
rank: '',
us_status: '',
- star: ''
+ star: '',
+ attrValue:[]
},
productStatusList: [
{ label: "上架显示", value: 1 },
@@ -535,6 +553,23 @@ export default {
this.checkboxGroup = [];
productDetailApi(id).then(res => {
const info = res.data
+ this.attrValue = []
+ info.attrValue.forEach(item=>{
+ let obj = {
+ desc:'',
+ value_id:item.value_id,
+ cost:item.cost,
+ price:item.price
+
+ }
+ if(item.detail instanceof Object){
+ Object.keys(item.detail).forEach(i=>{
+ obj.desc += i+item.detail[i]+";"
+ })
+ }
+
+ this.attrValue.push(obj)
+ })
this.formValidate = {
is_hot: info.is_hot,
is_best: info.is_best,
@@ -545,7 +580,8 @@ export default {
content: info.content,
store_name: info.store_name,
rank: info.rank,
- star: info.star
+ star: info.star,
+ attrValue:this.attrValue
}
if(info.is_benefit === 1) this.checkboxGroup.push('is_benefit')
if(info.is_hot === 1) this.checkboxGroup.push('is_hot')
@@ -568,10 +604,15 @@ export default {
},
// 提交
handleSubmit(name) {
- console.log(this.formValidate)
+
+ let formParams=JSON.parse(JSON.stringify(this.formValidate))
+ formParams.attrValue.forEach(item=>{
+ this.$delete(item,'desc')
+ })
+ console.log(formParams)
this.$refs[name].validate((valid) => {
if(valid) {
- productUpdateApi(this.productId, this.formValidate).then(async res => {
+ productUpdateApi(this.productId, formParams).then(async res => {
this.fullscreenLoading = false
this.$message.success(res.message)
this.dialogVisible = false
@@ -794,5 +835,12 @@ table .el-image {
.el-icon-arrow-down {
font-size: 12px;
}
-
+.attrItem{
+ display: flex;
+ align-items: center;
+ margin:5px 0;
+ .priceContainer{
+ margin:0 20px;
+ }
+}