|
@@ -1,77 +1,61 @@
|
|
|
<template>
|
|
|
- <div class="inline-16">
|
|
|
+ <div >
|
|
|
<el-button size="mini" @click="editBtn">编 辑</el-button>
|
|
|
- <el-dialog title="编辑产品组" append-to-body :visible.sync="dialogTableVisible" width="30%">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="产品组名称" prop="groupname">
|
|
|
- <el-input v-model="form.groupname" placeholder="请输入商品组名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="品牌" prop="sa_brandid">
|
|
|
- <el-select disabled v-model="form.sa_brandid" placeholder="请选择品牌">
|
|
|
- <el-option
|
|
|
- v-for="item in brandList()"
|
|
|
- :key="item.sa_brandid"
|
|
|
- :label="item.brandname"
|
|
|
- :value="item.sa_brandid"
|
|
|
- size="small">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <!-- <el-col :span="24">
|
|
|
- <el-form-item label="商品" prop="itemno">
|
|
|
- <el-select v-model="form.itemno" placeholder="请选择商品">
|
|
|
- <el-option
|
|
|
- v-for="item in productList()"
|
|
|
- :key="item.itemno"
|
|
|
- :label="item.itemname"
|
|
|
- :value="item.itemno"
|
|
|
- size="small">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col> -->
|
|
|
- <!-- <el-col :span="24">
|
|
|
- <el-form-item label="自定义标签" prop="tag" style="margin-bottom:0px; !important">
|
|
|
- <el-tag
|
|
|
- :key="tag"
|
|
|
- v-for="tag in form.tag"
|
|
|
- closable
|
|
|
- :disable-transitions="false"
|
|
|
- @close="handleClose(tag)">
|
|
|
- {{tag}}
|
|
|
- </el-tag>
|
|
|
- <el-input
|
|
|
- class="input-new-tag"
|
|
|
- v-if="inputVisible"
|
|
|
- v-model="inputValue"
|
|
|
- ref="saveTagInput"
|
|
|
- size="small"
|
|
|
- @keyup.enter.native="handleInputConfirm"
|
|
|
- @blur="handleInputConfirm"
|
|
|
- >
|
|
|
+ <el-drawer title="编辑商品组" :visible.sync="dialogTableVisible" size="40%" 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">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="商品组名称:" prop="groupname">
|
|
|
+ <el-input v-model="form.groupname" placeholder="请输入商品组名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="品牌:" prop="sa_brandid">
|
|
|
+ <el-select v-model="form.sa_brandid" placeholder="请选择品牌" @change="getProductList(params.content.pageNumber = 1,$refs.table.allArr=[])" 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>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" style="margin-bottom: 20px">
|
|
|
+ <label class="inline-16">可选商品</label>
|
|
|
+ <el-input placeholder="请输入搜索内容" suffix-icon="el-icon-search" v-model="search" @keyup.native.enter="queryClick" @clear="clearData()" style="width:260px" size="small" class="input-with-select inline-16" clearable>
|
|
|
</el-input>
|
|
|
- <el-button v-else class="button-new-tag" size="small" @click="showInput">+ New 标签</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col> -->
|
|
|
- </el-form>
|
|
|
- </el-row>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <div>
|
|
|
- <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submit" size="small">确 定</el-button>
|
|
|
- </div>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <Table ref="table" v-model="form.itemno" :layout="tablecols" :data="productList" :custom="false" height="500px" @upDateData="upDateData">
|
|
|
+ </Table>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ style="text-align:right"
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="params.content.pageNumber"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="dialogTableVisible = false" class="normal-btn-width">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="submit" class="normal-btn-width">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import Table from './table'
|
|
|
export default {
|
|
|
+ components:{Table},
|
|
|
data () {
|
|
|
return {
|
|
|
dialogTableVisible:false,
|
|
@@ -79,6 +63,10 @@ export default {
|
|
|
seleteGroup:'',
|
|
|
inputVisible: false,
|
|
|
inputValue: '',
|
|
|
+ productList:[],
|
|
|
+ tablecols:[],
|
|
|
+ total:0,
|
|
|
+ search:'',
|
|
|
form:{
|
|
|
sa_brandid:'',
|
|
|
groupname:'',
|
|
@@ -95,6 +83,19 @@ export default {
|
|
|
itemno: [
|
|
|
{ required: true, message: '请选择商品', trigger: 'blur' },
|
|
|
]
|
|
|
+ },
|
|
|
+ params: {
|
|
|
+ "id": "20220923112503",
|
|
|
+ "version":1,
|
|
|
+ "content": {
|
|
|
+ "nocache":true,
|
|
|
+ "sa_itemgroupid":"",
|
|
|
+ "pageNumber":1,
|
|
|
+ "pageSize":20,
|
|
|
+ "where":{
|
|
|
+ "condition":""
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -103,8 +104,14 @@ export default {
|
|
|
watch: {
|
|
|
|
|
|
},
|
|
|
- created() {
|
|
|
-
|
|
|
+ created () {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name)['addProductTable'].tablecols
|
|
|
+ if (this.brandList()) {
|
|
|
+ this.form.sa_brandid = this.brandList()[0].sa_brandid
|
|
|
+ }
|
|
|
+ console.log(this.brandList());
|
|
|
+
|
|
|
+ this.getProductList()
|
|
|
},
|
|
|
methods: {
|
|
|
submit() {
|
|
@@ -158,6 +165,38 @@ export default {
|
|
|
}
|
|
|
this.inputVisible = false;
|
|
|
this.inputValue = '';
|
|
|
+ },
|
|
|
+ upDateData (data) {
|
|
|
+ if (data.length == 0) {
|
|
|
+ this.form.itemno = ''
|
|
|
+ } {
|
|
|
+ this.form.itemno = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 可选择的商品列表 */
|
|
|
+ async getProductList() {
|
|
|
+ this.params.content.sa_brandid = this.form.sa_brandid
|
|
|
+ let res = await this.$api.requested(this.params)
|
|
|
+ this.productList = res.data
|
|
|
+ this.total = res.total
|
|
|
+ console.log(this.productList,'商品');
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.params.content.pageSize = val
|
|
|
+ this.getProductList()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.params.content.pageNumber = val
|
|
|
+ this.getProductList()
|
|
|
+ },
|
|
|
+ clearData(){
|
|
|
+ this.search = ""
|
|
|
+ },
|
|
|
+ queryClick(){
|
|
|
+ this.params.content.where.condition = this.search
|
|
|
+ this.getProductList()
|
|
|
}
|
|
|
}
|
|
|
}
|