@@ -82,7 +124,11 @@
import {
save,
show
- } from "@/api/family"
+ } from "@/api/family"
+ import {
+ index,
+ destroy
+ } from "@/api/product/category.js"
import {
getToken
} from '@/utils/auth'
@@ -101,13 +147,29 @@
},
showWang: false,
action: `${process.env.VUE_APP_UPLOAD_API}`,
- pictureList: [],
+ pictureList: [],
+ productPhaseList:[],
+ detail_item: [{
+ type: 'index',
+ width: 50,
+ }, {
+ prop: 'product_category_id',
+ label: 'Product Line',
+ align: 'left',
+ width: 620
+ }, {
+ prop: 'sort',
+ label: 'Sort',
+ align: 'left',
+ width: 620
+ }],
form: {
title: '',
sort: 0,
is_visible: 1,
- file_ids: [],
+ file_ids: [],
+ family_product_lines:[],
description: '',
content: ''
},
@@ -120,9 +182,22 @@
}
},
created() {
- this.uploadOther.token = getToken();
+ this.uploadOther.token = getToken();
+ this.getList()
},
- methods: {
+ methods: {
+ async getList() {
+ const res = await index({
+ page_size: 999,
+ page: 1,
+ type:2,
+ sort_type: 'asc',
+ sort_name: 'sort',
+ is_visible: 1,
+ // family_id:this.select.family_id
+ })
+ this.productPhaseList = res.data
+ },
handleRemoveP(file, fileList) {
this.pictureList = fileList
},
@@ -137,6 +212,18 @@
changeEditor(e, type) {
this.form[type] = e
+ },
+ addRow() {
+ this.form.family_product_lines.push({
+ product_category_id: '',
+ sort: 0
+ })
+ },
+ delRow(index) {
+ this.form.family_product_lines.splice(index, 1)
+ },
+ changeKey(e, row) {
+ console.log(e,row)
},
submit() {
if (this.id) {
@@ -174,11 +261,17 @@
getDetail() {
show({
id: this.id,
- // show_relation: ['picture'],
+ show_relation: ['familyProductLines'],
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.description = res.description ? res.description : ''
- this.form.content = res.content ? res.content : ''
+ this.form.content = res.content ? res.content : ''
+ this.form.family_product_lines = res.family_product_lines?res.family_product_lines:[]
+ if(this.form.family_product_lines.length>0){
+ this.form.family_product_lines.sort((a,b)=>{
+ return a.sort - b.sort
+ })
+ }
this.form.is_visible = res.is_visible ? res.is_visible : 0
this.form.sort = res.sort ? res.sort : 0
this.showWang = true
@@ -213,8 +306,8 @@
title: '',
sort: 0,
is_visible: 1,
-
- file_ids: '',
+ file_ids: [],
+ family_product_lines:[],
description: '',
content: ''
}
diff --git a/src/views/product/components/addPhase.vue b/src/views/product/components/addPhase.vue
index bcdab71..686ff50 100644
--- a/src/views/product/components/addPhase.vue
+++ b/src/views/product/components/addPhase.vue
@@ -2,7 +2,7 @@
-
+
@@ -440,7 +440,7 @@
width: 340
}],
form: {
- family_ids:[],
+ // family_ids:[],
product_category_links_by_sub: [],
name: '',
time:'',
@@ -834,7 +834,7 @@
show_relation: ['productCategoryApplications', 'picture'],
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
- this.form.family_ids = res.family_ids?res.family_ids:[]
+ // this.form.family_ids = res.family_ids?res.family_ids:[]
this.form.description = res.description ? res.description : ''
this.form.introduction = res.introduction ? res.introduction : ''
@@ -954,7 +954,7 @@
this.showProgress = false
this.uploadProgress = 0
this.form = {
- family_ids:[],
+ // family_ids:[],
product_category_links_by_sub: [],
name: '',
time:'',
@@ -996,7 +996,7 @@
::v-deep .application_note_desc,
::v-deep .packing,
::v-deep .character,
- ::v-deep .family_ids
+ // ::v-deep .family_ids
{
flex-basis: 100%;
}
diff --git a/src/views/product/phase.vue b/src/views/product/phase.vue
index 4609eeb..6dc762a 100644
--- a/src/views/product/phase.vue
+++ b/src/views/product/phase.vue
@@ -9,12 +9,12 @@
-
+
@@ -49,7 +49,7 @@
-
+
@@ -104,7 +104,7 @@
return {
select: {
name: '',
- family_id:'',
+ // family_id:'',
is_recommend:'',
is_visible:'',
type:2,
@@ -118,12 +118,14 @@
type: 'index',
align: 'center',
width: 50
- }, {
- prop: 'family_ids',
- label: 'Product Family',
- align: 'left',
- width:120,
- }, {
+ },
+ // {
+ // prop: 'family_ids',
+ // label: 'Product Family',
+ // align: 'left',
+ // width:120,
+ // },
+ {
prop: 'product_category_links_by_sub',
label: 'Product Category',
align: 'left',
@@ -162,7 +164,7 @@
}
},
created() {
- this.getFamilyList()
+ // this.getFamilyList()
this.getList()
},
methods: {
@@ -202,7 +204,7 @@
name:this.select.name,
is_recommend:this.select.is_recommend,
is_visible:this.select.is_visible,
- family_id:this.select.family_id
+ // family_id:this.select.family_id
})
this.list = res.data
this.total = res.total
@@ -212,7 +214,7 @@
this.select.name = ''
this.select.is_recommend = ''
this.select.is_visible=''
- this.select.family_id = ''
+ // this.select.family_id = ''
this.select.type = 2
this.getList()
},