|
|
|
@ -1,10 +1,10 @@ |
|
|
|
<template> |
|
|
|
<div class="mod-config"> |
|
|
|
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()"> |
|
|
|
<el-form-item :label="'商品编码'"> |
|
|
|
<el-form-item :label="'商品组编码'"> |
|
|
|
<el-input v-model="searchData.productGroupId" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'商品名称'"> |
|
|
|
<el-form-item :label="'商品组名称'"> |
|
|
|
<el-input v-model="searchData.productGroupName" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'是否在用'"> |
|
|
|
@ -13,6 +13,14 @@ |
|
|
|
<el-option label="否" value="N"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'商品组'"> |
|
|
|
<el-select clearable v-model="searchData.type" style="width: 120px"> |
|
|
|
<el-option label="商品组1" value="1"></el-option> |
|
|
|
<el-option label="商品组2" value="2"></el-option> |
|
|
|
<el-option label="商品组3" value="3"></el-option> |
|
|
|
<el-option label="商品组4" value="4"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="getDataList()">查询</el-button> |
|
|
|
<el-button type="primary" @click="addModal()">新增</el-button> |
|
|
|
@ -80,10 +88,10 @@ |
|
|
|
|
|
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="商品编码" prop="productGroupId" :rules="rules.productGroupId"> |
|
|
|
<el-form-item label="商品组编码" prop="productGroupId" :rules="rules.productGroupId"> |
|
|
|
<el-input v-model="modalData.productGroupId" :disabled="modalDisableFlag" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="商品名称" prop="productGroupName" :rules="rules.productGroupName"> |
|
|
|
<el-form-item label="商品组名称" prop="productGroupName" :rules="rules.productGroupName"> |
|
|
|
<el-input v-model="modalData.productGroupName" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
@ -95,6 +103,16 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="商品组" prop="type" :rules="rules.type"> |
|
|
|
<el-select v-model="modalData.type" style="width: 221px"> |
|
|
|
<el-option label="商品组1" value="1"></el-option> |
|
|
|
<el-option label="商品组2" value="2"></el-option> |
|
|
|
<el-option label="商品组3" value="3"></el-option> |
|
|
|
<el-option label="商品组4" value="4"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:30px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="saveData()">保存</el-button> |
|
|
|
<el-button type="primary" @click="modalFlag = false">关闭</el-button> |
|
|
|
@ -149,6 +167,7 @@ export default { |
|
|
|
productGroupId: '', |
|
|
|
productGroupName: '', |
|
|
|
active: '', |
|
|
|
type: '', |
|
|
|
page: 1, |
|
|
|
limit: 10 |
|
|
|
}, |
|
|
|
@ -161,7 +180,8 @@ export default { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
productGroupId: '', |
|
|
|
productGroupName: '', |
|
|
|
active: '' |
|
|
|
active: '', |
|
|
|
type: '' |
|
|
|
}, |
|
|
|
// ======== 数据列表 ======== |
|
|
|
dataList: [], |
|
|
|
@ -172,11 +192,11 @@ export default { |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1ProductGroupId', |
|
|
|
tableId: "100007Table1", |
|
|
|
tableName: "商品信息表", |
|
|
|
tableName: "商品组信息表", |
|
|
|
columnProp: 'productGroupId', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '商品编码', |
|
|
|
columnLabel: '商品组编码', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
@ -189,11 +209,11 @@ export default { |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1ProductGroupName', |
|
|
|
tableId: "100007Table1", |
|
|
|
tableName: "商品表", |
|
|
|
tableName: "商品组信息表", |
|
|
|
columnProp: 'productGroupName', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '商品名称', |
|
|
|
columnLabel: '商品组名称', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
@ -205,7 +225,7 @@ export default { |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1Active', |
|
|
|
tableId: '100007Table1', |
|
|
|
tableName: '商品信息表', |
|
|
|
tableName: '商品组信息表', |
|
|
|
columnProp: 'active', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
@ -218,12 +238,29 @@ export default { |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1Type', |
|
|
|
tableId: "100007Table1", |
|
|
|
tableName: "商品组信息表", |
|
|
|
columnProp: 'type', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '商品组', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1CreateDate', |
|
|
|
tableId: '100007Table1', |
|
|
|
tableName: '商品表', |
|
|
|
tableName: '商品组信息表', |
|
|
|
columnProp: 'createDate', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
@ -240,7 +277,7 @@ export default { |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1CreateBy', |
|
|
|
tableId: "100007Table1", |
|
|
|
tableName: "商品表", |
|
|
|
tableName: "商品组信息表", |
|
|
|
columnProp: 'createBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
@ -257,7 +294,7 @@ export default { |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1UpdateDate', |
|
|
|
tableId: "100007Table1", |
|
|
|
tableName: "商品表", |
|
|
|
tableName: "商品组信息表", |
|
|
|
columnProp: 'updateDate', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
@ -274,7 +311,7 @@ export default { |
|
|
|
functionId: 100007, |
|
|
|
serialNumber: '100007Table1UpdateBy', |
|
|
|
tableId: "100007Table1", |
|
|
|
tableName: "商品表", |
|
|
|
tableName: "商品组信息表", |
|
|
|
columnProp: 'updateBy', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
@ -309,6 +346,13 @@ export default { |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
type:[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
}, |
|
|
|
// ======== 模态框开关控制 ======== |
|
|
|
modalFlag: false, |
|
|
|
@ -383,12 +427,13 @@ export default { |
|
|
|
addModal(){ |
|
|
|
this.modalData = { |
|
|
|
flag: '1', |
|
|
|
title: '商品新增', |
|
|
|
title: '商品组新增', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
productGroupId: '', |
|
|
|
productGroupName: '', |
|
|
|
active: 'Y', |
|
|
|
type: '' |
|
|
|
} |
|
|
|
this.modalDisableFlag = false |
|
|
|
this.modalFlag = true |
|
|
|
@ -400,11 +445,12 @@ export default { |
|
|
|
updateModal (row) { |
|
|
|
this.modalData = { |
|
|
|
flag: '2', |
|
|
|
title: '商品编辑', |
|
|
|
title: '商品组编辑', |
|
|
|
site: row.site, |
|
|
|
productGroupId: row.productGroupId, |
|
|
|
productGroupName: row.productGroupName, |
|
|
|
active: row.active, |
|
|
|
type: row.type, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
this.modalDisableFlag = true |
|
|
|
@ -417,17 +463,21 @@ export default { |
|
|
|
*/ |
|
|
|
saveData () { |
|
|
|
if (this.modalData.productGroupId === '' || this.modalData.productGroupId == null) { |
|
|
|
this.$message.warning('请填写商品编码!') |
|
|
|
this.$message.warning('请填写商品组编码!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.productGroupName === '' || this.modalData.productGroupName == null) { |
|
|
|
this.$message.warning('请填写商品名称!') |
|
|
|
this.$message.warning('请填写商品组名称!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.active === '' || this.modalData.active == null) { |
|
|
|
this.$message.warning('请选择是否可用!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.type === '' || this.modalData.type == null) { |
|
|
|
this.$message.warning('请选择商品组!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.modalData.flag === '1') { |
|
|
|
productGroupInformationSave(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -468,7 +518,7 @@ export default { |
|
|
|
* 商品信息删除 |
|
|
|
*/ |
|
|
|
delModal (row) { |
|
|
|
this.$confirm(`是否删除这条商品信息?`, '提示', { |
|
|
|
this.$confirm(`是否删除这条商品组信息?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
|