|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button type="primary" size="mini" @click="editBtn">编 辑</el-button>
|
|
|
- <el-drawer title="编辑商品组" :visible.sync="drawer" size="40%" direction="rtl" append-to-body @close="onCancel">
|
|
|
+ <el-drawer title="编辑商品组" :visible.sync="drawer" size="30%" direction="rtl" append-to-body>
|
|
|
<div class="drawer__panel">
|
|
|
<el-row :gutter="20">
|
|
|
<el-form :model="form" :rules="rules" ref="form" size="small" label-position="right" label-width="100px">
|
|
@@ -12,7 +12,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="品牌:" prop="sa_brandid">
|
|
|
- <el-select v-model="form.sa_brandid" placeholder="请选择品牌" style="width: 100%" :disabled="true">
|
|
|
+ <el-select v-model="form.sa_brandid" placeholder="请选择品牌" style="width: 100%">
|
|
|
<el-option v-for="item in brandList" :key="item.sa_brandid" :label="item.brandname"
|
|
|
:value="item.sa_brandid" size="small">
|
|
|
</el-option>
|
|
@@ -20,15 +20,17 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="序号:" prop="sequence">
|
|
|
- <el-input type="text" size="small" v-model="form.sequence"></el-input>
|
|
|
+ <el-form-item label="默认商品:" prop="sequence">
|
|
|
+ <selectProduct ref="product" @selectRow="productChange" :productData="tableData">
|
|
|
+ <el-input v-model="form.itemname" :disabled="tableData.length == 0" readonly type="text" slot="input" size="small" @focus="$refs.product.tableData=tableData,$refs.product.visible=true"></el-input>
|
|
|
+ </selectProduct>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
- <el-button size="small" @click="onCancel" class="normal-btn-width">取 消</el-button>
|
|
|
+ <el-button size="small" @click="drawer=false" class="normal-btn-width">取 消</el-button>
|
|
|
<el-button size="small" type="primary" @click="submit" class="normal-btn-width">确 定</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
@@ -36,8 +38,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import selectProduct from '@/template/selectProduct/index.vue'
|
|
|
export default {
|
|
|
props: ['data', 'type'],
|
|
|
+ components:{selectProduct},
|
|
|
data () {
|
|
|
return {
|
|
|
drawer:false,
|
|
@@ -72,26 +76,6 @@ export default {
|
|
|
this.drawer=true
|
|
|
this.form = Object.assign({},this.form,this.data)
|
|
|
},
|
|
|
- onCancel(){
|
|
|
- this.drawer = false
|
|
|
- this.form={
|
|
|
- sa_brandid: '',
|
|
|
- groupname: '',
|
|
|
- itemno: '',
|
|
|
- tag: []
|
|
|
- },
|
|
|
- this.tableData = []
|
|
|
- },
|
|
|
- addProduct (row) {
|
|
|
- this.tableData.push(row)
|
|
|
- const res = new Map();
|
|
|
- this.tableData = this.tableData.filter((item) => !res.has(item['itemid']) && res.set(item['itemid'], 1));
|
|
|
- },
|
|
|
- deleteProduct (row) {
|
|
|
- this.tableData = this.tableData.filter(e=>{
|
|
|
- return e.itemid !== row.itemid
|
|
|
- })
|
|
|
- },
|
|
|
async submit() {
|
|
|
const res = await this.$api.requested({
|
|
|
"id": "20220922164303",
|
|
@@ -102,6 +86,11 @@ export default {
|
|
|
this.drawer = false
|
|
|
})
|
|
|
},
|
|
|
+ productChange (data) {
|
|
|
+ this.form.itemno = data.itemno
|
|
|
+ this.form.itemname = data.itemname
|
|
|
+ this.$refs.product.visible = false
|
|
|
+ },
|
|
|
/* 可选择的品牌列表 */
|
|
|
async getBrandList() {
|
|
|
let res = await this.$api.requested({
|
|
@@ -114,6 +103,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ let res2 = await this.$api.requested({
|
|
|
+ "id": "20220923101603",
|
|
|
+ "version":1,
|
|
|
+ "content": {
|
|
|
+ "sa_itemgroupid":this.$route.query.id,
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":20
|
|
|
+ }
|
|
|
+ },)
|
|
|
+ this.tableData = res2.data
|
|
|
this.brandList = res.data
|
|
|
console.log(this.brandList,'品牌');
|
|
|
},
|