Browse Source

2023.11.14 商品组的增删改查

master
yuejiayang 2 years ago
parent
commit
012297a0af
  1. 81
      src/views/modules/part/partInformation.vue
  2. 88
      src/views/modules/part/productGroupInformation.vue

81
src/views/modules/part/partInformation.vue

@ -148,21 +148,21 @@
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item>
<span slot="label" @click="getBaseList(110,1)"><a herf="#">商品组1</a></span>
<el-input v-model="modalData.otherGroup1" style="width: 221px"></el-input>
<el-input v-model="modalData.pGroupName1" style="width: 221px"></el-input>
</el-form-item>
<el-form-item>
<span slot="label" @click="getBaseList(111,1)"><a herf="#">商品组2</a></span>
<el-input v-model="modalData.otherGroup2" style="width: 221px"></el-input>
<el-input v-model="modalData.pGroupName2" style="width: 221px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item>
<span slot="label" @click="getBaseList(112,1)"><a herf="#">商品组3</a></span>
<el-input v-model="modalData.otherGroup3" style="width: 221px"></el-input>
<el-input v-model="modalData.pGroupName3" style="width: 221px"></el-input>
</el-form-item>
<el-form-item>
<span slot="label" @click="getBaseList(113,1)"><a herf="#">商品组4</a></span>
<el-input v-model="modalData.otherGroup4" style="width: 221px"></el-input>
<el-input v-model="modalData.pGroupName4" style="width: 221px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
@ -298,10 +298,14 @@
remark: '',
supplierId: '',
supplierName: '',
otherGroup1: '',
otherGroup2: '',
otherGroup3: '',
otherGroup4: '',
pGroupId1: '',
pGroupName1: '',
pGroupId2: '',
pGroupName2: '',
pGroupId3: '',
pGroupName3: '',
pGroupId4: '',
pGroupName4: '',
erpPartNo: '',
codeNo: '',
codeDesc: '',
@ -449,7 +453,7 @@
serialNumber: '104001Table1OtherGroup1',
tableId: '104001Table1',
tableName: '材料信息表',
columnProp: 'otherGroup1',
columnProp: 'pGroupName1',
headerAlign: 'center',
align: 'center',
columnLabel: '商品组1',
@ -467,7 +471,7 @@
serialNumber: '104001Table1OtherGroup2',
tableId: '104001Table1',
tableName: '材料信息表',
columnProp: 'otherGroup2',
columnProp: 'pGroupName2',
headerAlign: 'center',
align: 'center',
columnLabel: '商品组2',
@ -485,7 +489,7 @@
serialNumber: '104001Table1OtherGroup3',
tableId: '104001Table1',
tableName: '材料信息表',
columnProp: 'otherGroup3',
columnProp: 'pGroupName3',
headerAlign: 'center',
align: 'center',
columnLabel: '商品组3',
@ -503,7 +507,7 @@
serialNumber: '104001Table1OtherGroup4',
tableId: '104001Table1',
tableName: '材料信息表',
columnProp: 'otherGroup4',
columnProp: 'pGroupName4',
headerAlign: 'center',
align: 'center',
columnLabel: '商品组4',
@ -867,10 +871,14 @@
remark: '',
supplierId: '',
supplierName: '',
otherGroup1: '',
otherGroup2: '',
otherGroup3: '',
otherGroup4: '',
pGroupId1: '',
pGroupName1: '',
pGroupId2: '',
pGroupName2: '',
pGroupId3: '',
pGroupName3: '',
pGroupId4: '',
pGroupName4: '',
erpPartNo: '',
codeNo: '',
manufacturerId: '',
@ -1150,7 +1158,22 @@
}
if (val === 110) {
if(type === 1) {
strVal = this.modalData.otherGroup1
strVal = this.modalData.pGroupId1
}
}
if (val === 111) {
if(type === 1) {
strVal = this.modalData.pGroupId2
}
}
if (val === 112) {
if(type === 1) {
strVal = this.modalData.pGroupId3
}
}
if (val === 113) {
if(type === 1) {
strVal = this.modalData.pGroupId4
}
}
this.$refs.baseList.init(val, strVal)
@ -1179,6 +1202,30 @@
this.modalData.groupName = val.group_name
}
}
if (this.tagNo === 110) {
if(this.tagNo1 === 1) {
this.modalData.pGroupId1 = val.product_group_id
this.modalData.pGroupName1 = val.product_group_name
}
}
if (this.tagNo === 111) {
if(this.tagNo1 === 1) {
this.modalData.pGroupId2 = val.product_group_id
this.modalData.pGroupName2 = val.product_group_name
}
}
if (this.tagNo === 112) {
if(this.tagNo1 === 1) {
this.modalData.pGroupId3 = val.product_group_id
this.modalData.pGroupName3 = val.product_group_name
}
}
if (this.tagNo === 113) {
if(this.tagNo1 === 1) {
this.modalData.pGroupId4 = val.product_group_id
this.modalData.pGroupName4 = val.product_group_name
}
}
},
// ======== ========

88
src/views/modules/part/productGroupInformation.vue

@ -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'

Loading…
Cancel
Save