|
|
|
|
@ -49,6 +49,48 @@
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:family_product_lines>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Product Lines:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addRow">Add</el-button>
|
|
|
|
|
<xy-table style="width:850px" :list="form.family_product_lines" :isPage="false" :height="350"
|
|
|
|
|
:table-item="detail_item">
|
|
|
|
|
<template v-slot:product_category_id>
|
|
|
|
|
<el-table-column align='left' label="Product Line" width="340">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select style="width:100%" @change="(e)=>{changeKey(e,scope.row)}" v-model="scope.row.product_category_id"
|
|
|
|
|
placeholder="Please Select">
|
|
|
|
|
<el-option v-for="(pvalue,index) in productPhaseList" :key="index" :label="pvalue.name"
|
|
|
|
|
:value="pvalue.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:sort>
|
|
|
|
|
<el-table-column align='left' label="Sort" width="340">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input placeholder="Please Input" style="width:100%" v-model="scope.row.sort"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' label="operate" width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px"
|
|
|
|
|
@confirm="delRow(scope.$index)" title="Are you sure to delete it?">
|
|
|
|
|
<el-button type="danger" size="small" slot="reference">delete</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:description>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
@ -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: ''
|
|
|
|
|
}
|
|
|
|
|
|