Browse Source

2023.11.14 分组分类的增删改查

master
yuejiayang 2 years ago
parent
commit
007ebfd87c
  1. 26
      src/api/part/manufacturerInformation.js
  2. 26
      src/api/part/partFamilyInformation.js
  3. 26
      src/api/part/partGroupInformation.js
  4. 26
      src/api/part/productGroupInformation.js
  5. 8
      src/views/modules/base/propertiesItem/propertiesItem.vue
  6. 504
      src/views/modules/part/manufacturerInformation.vue
  7. 504
      src/views/modules/part/partFamilyInformation.vue
  8. 504
      src/views/modules/part/partGroupInformation.vue
  9. 504
      src/views/modules/part/productGroupInformation.vue
  10. 150
      src/views/modules/part/umInformation.vue

26
src/api/part/manufacturerInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 制造商信息列表查询
* @param data
* @returns {*}
*/
export const manufacturerInformationSearch = data => createAPI(`/plm/manufacturerInformation/manufacturerInformationSearch`,'post',data)
/**
* 制造商信息新增
* @param data
* @returns {*}
*/
export const manufacturerInformationSave = data => createAPI(`/plm/manufacturerInformation/manufacturerInformationSave`,'post',data)
/**
* 制造商信息编辑
* @param data
* @returns {*}
*/
export const manufacturerInformationEdit = data => createAPI(`/plm/manufacturerInformation/manufacturerInformationEdit`,'post',data)
/**
* 制造商信息删除
* @param data
* @returns {*}
*/
export const manufacturerInformationDelete = data => createAPI(`/plm/manufacturerInformation/manufacturerInformationDelete`,'post',data)

26
src/api/part/partFamilyInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 分类信息列表查询
* @param data
* @returns {*}
*/
export const partFamilyInformationSearch = data => createAPI(`/plm/partFamilyInformation/partFamilyInformationSearch`,'post',data)
/**
* 分类信息新增
* @param data
* @returns {*}
*/
export const partFamilyInformationSave = data => createAPI(`/plm/partFamilyInformation/partFamilyInformationSave`,'post',data)
/**
* 分类信息编辑
* @param data
* @returns {*}
*/
export const partFamilyInformationEdit = data => createAPI(`/plm/partFamilyInformation/partFamilyInformationEdit`,'post',data)
/**
* 分类信息删除
* @param data
* @returns {*}
*/
export const partFamilyInformationDelete = data => createAPI(`/plm/partFamilyInformation/partFamilyInformationDelete`,'post',data)

26
src/api/part/partGroupInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 分组信息列表查询
* @param data
* @returns {*}
*/
export const partGroupInformationSearch = data => createAPI(`/plm/partGroupInformation/partGroupInformationSearch`,'post',data)
/**
* 分组信息新增
* @param data
* @returns {*}
*/
export const partGroupInformationSave = data => createAPI(`/plm/partGroupInformation/partGroupInformationSave`,'post',data)
/**
* 分组信息编辑
* @param data
* @returns {*}
*/
export const partGroupInformationEdit = data => createAPI(`/plm/partGroupInformation/partGroupInformationEdit`,'post',data)
/**
* 分组信息删除
* @param data
* @returns {*}
*/
export const partGroupInformationDelete = data => createAPI(`/plm/partGroupInformation/partGroupInformationDelete`,'post',data)

26
src/api/part/productGroupInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 商品信息列表查询
* @param data
* @returns {*}
*/
export const productGroupInformationSearch = data => createAPI(`/plm/productGroupInformation/productGroupInformationSearch`,'post',data)
/**
* 商品信息新增
* @param data
* @returns {*}
*/
export const productGroupInformationSave = data => createAPI(`/plm/productGroupInformation/productGroupInformationSave`,'post',data)
/**
* 商品信息编辑
* @param data
* @returns {*}
*/
export const productGroupInformationEdit = data => createAPI(`/plm/productGroupInformation/productGroupInformationEdit`,'post',data)
/**
* 商品信息删除
* @param data
* @returns {*}
*/
export const productGroupInformationDelete = data => createAPI(`/plm/productGroupInformation/productGroupInformationDelete`,'post',data)

8
src/views/modules/base/propertiesItem/propertiesItem.vue

@ -414,11 +414,11 @@
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableValueChooseFlag',
tableId: "100002001Table",
tableName: "属性表",
tableId: '100002001Table',
tableName: '属性表',
columnProp: 'createdDate',
headerAlign: "center",
align: "center",
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,

504
src/views/modules/part/manufacturerInformation.vue

@ -0,0 +1,504 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'制造商编码'">
<el-input v-model="searchData.manufacturerId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'制造商名称'">
<el-input v-model="searchData.manufacturerName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'是否在用'">
<el-select clearable v-model="searchData.active" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="delModal(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<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="manufacturerId" :rules="rules.manufacturerId">
<el-input v-model="modalData.manufacturerId" :disabled="modalDisableFlag" style="width: 221px"></el-input>
</el-form-item>
<el-form-item label="制造商名称" prop="manufacturerName" :rules="rules.manufacturerName">
<el-input v-model="modalData.manufacturerName" 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;">
<el-form-item label="是否在用" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" style="width: 221px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
</el-footer>
</el-dialog>
<!-- chooseList模态框 -->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
manufacturerInformationSearch, //
manufacturerInformationSave, //
manufacturerInformationEdit, //
manufacturerInformationDelete //
} from '@/api/part/manufacturerInformation.js'
import Chooselist from '@/views/modules/common/Chooselist'
import manufacturerInformation from './manufacturerInformation'
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.manufacturerId = this.searchData.manufacturerId.toUpperCase()
}
}
},
data () {
return {
//
exportData: [],
exportName: '制造商制造商' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['制造商制造商'],
exportFooter: [],
resultList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: this.$store.state.user.site,
manufacturerId: '',
manufacturerName: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
manufacturerId: '',
manufacturerName: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100006,
serialNumber: '100006Table1ManufacturerId',
tableId: "100006Table1",
tableName: "制造商信息表",
columnProp: 'manufacturerId',
headerAlign: "center",
align: "center",
columnLabel: '制造商编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100006,
serialNumber: '100006Table1ManufacturerName',
tableId: "100006Table1",
tableName: "制造商表",
columnProp: 'manufacturerName',
headerAlign: "center",
align: "center",
columnLabel: '制造商名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
functionId: 100006,
serialNumber: '100006Table1Active',
tableId: '100006Table1',
tableName: '制造商信息表',
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 100006,
serialNumber: '100006Table1CreateDate',
tableId: '100006Table1',
tableName: '制造商表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100006,
serialNumber: '100006Table1CreateBy',
tableId: "100006Table1",
tableName: "制造商表",
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100006,
serialNumber: '100006Table1UpdateDate',
tableId: "100006Table1",
tableName: "制造商表",
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100006,
serialNumber: '100006Table1UpdateBy',
tableId: "100006Table1",
tableName: "制造商表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
rules:{
manufacturerId:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
manufacturerName:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
this.getDataList()
},
methods: {
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await manufacturerInformationSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
manufacturerInformationSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
addModal(){
this.modalData = {
flag: '1',
title: '制造商新增',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
manufacturerId: '',
manufacturerName: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 制造商信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '制造商编辑',
site: row.site,
manufacturerId: row.manufacturerId,
manufacturerName: row.manufacturerName,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 制造商信息新增/编辑
*/
saveData () {
if (this.modalData.manufacturerId === '' || this.modalData.manufacturerId == null) {
this.$message.warning('请填写制造商编码!')
return
}
if (this.modalData.manufacturerName === '' || this.modalData.manufacturerName == null) {
this.$message.warning('请填写制造商名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
manufacturerInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
manufacturerInformationEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
/**
* 制造商信息删除
*/
delModal (row) {
this.$confirm(`是否删除这条制造商信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
manufacturerInformationDelete(row).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.partSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
height: 459px;
}
</style>

504
src/views/modules/part/partFamilyInformation.vue

@ -0,0 +1,504 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'分类编码'">
<el-input v-model="searchData.familyId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'分类名称'">
<el-input v-model="searchData.familyName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'是否在用'">
<el-select clearable v-model="searchData.active" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="delModal(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<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="familyId" :rules="rules.familyId">
<el-input v-model="modalData.familyId" :disabled="modalDisableFlag" style="width: 221px"></el-input>
</el-form-item>
<el-form-item label="分类名称" prop="familyName" :rules="rules.familyName">
<el-input v-model="modalData.familyName" 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;">
<el-form-item label="是否在用" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" style="width: 221px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
</el-footer>
</el-dialog>
<!-- chooseList模态框 -->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
partFamilyInformationSearch, //
partFamilyInformationSave, //
partFamilyInformationEdit, //
partFamilyInformationDelete //
} from '@/api/part/partFamilyInformation.js'
import Chooselist from '@/views/modules/common/Chooselist'
import partFamilyInformation from './partFamilyInformation'
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.familyId = this.searchData.familyId.toUpperCase()
}
}
},
data () {
return {
//
exportData: [],
exportName: '分类分类' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['分类分类'],
exportFooter: [],
resultList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: this.$store.state.user.site,
familyId: '',
familyName: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
familyId: '',
familyName: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100004,
serialNumber: '100004Table1familyId',
tableId: "100004Table1",
tableName: "分类信息表",
columnProp: 'familyId',
headerAlign: "center",
align: "center",
columnLabel: '分类编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100004,
serialNumber: '100004Table1familyName',
tableId: "100004Table1",
tableName: "分类表",
columnProp: 'familyName',
headerAlign: "center",
align: "center",
columnLabel: '分类名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
functionId: 100004,
serialNumber: '100004Table1Active',
tableId: '100004Table1',
tableName: '分类信息表',
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 100004,
serialNumber: '100004Table1CreateDate',
tableId: '100004Table1',
tableName: '分类表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100004,
serialNumber: '100004Table1CreateBy',
tableId: "100004Table1",
tableName: "分类表",
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100004,
serialNumber: '100004Table1UpdateDate',
tableId: "100004Table1",
tableName: "分类表",
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100004,
serialNumber: '100004Table1UpdateBy',
tableId: "100004Table1",
tableName: "分类表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
rules:{
familyId:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
familyName:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
this.getDataList()
},
methods: {
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await partFamilyInformationSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
partFamilyInformationSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
addModal(){
this.modalData = {
flag: '1',
title: '分类新增',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
familyId: '',
familyName: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 分类信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '分类编辑',
site: row.site,
familyId: row.familyId,
familyName: row.familyName,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 分类信息新增/编辑
*/
saveData () {
if (this.modalData.familyId === '' || this.modalData.familyId == null) {
this.$message.warning('请填写分类编码!')
return
}
if (this.modalData.familyName === '' || this.modalData.familyName == null) {
this.$message.warning('请填写分类名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
partFamilyInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
partFamilyInformationEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
/**
* 分类信息删除
*/
delModal (row) {
this.$confirm(`是否删除这条分类信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
partFamilyInformationDelete(row).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.partSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
height: 459px;
}
</style>

504
src/views/modules/part/partGroupInformation.vue

@ -0,0 +1,504 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'分组编码'">
<el-input v-model="searchData.groupId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'分组名称'">
<el-input v-model="searchData.groupName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'是否在用'">
<el-select clearable v-model="searchData.active" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="delModal(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<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="groupId" :rules="rules.groupId">
<el-input v-model="modalData.groupId" :disabled="modalDisableFlag" style="width: 221px"></el-input>
</el-form-item>
<el-form-item label="分组名称" prop="groupName" :rules="rules.groupName">
<el-input v-model="modalData.groupName" 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;">
<el-form-item label="是否在用" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" style="width: 221px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
</el-footer>
</el-dialog>
<!-- chooseList模态框 -->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
partGroupInformationSearch, //
partGroupInformationSave, //
partGroupInformationEdit, //
partGroupInformationDelete //
} from '@/api/part/partGroupInformation.js'
import Chooselist from '@/views/modules/common/Chooselist'
import partGroupInformation from './partGroupInformation'
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.groupId = this.searchData.groupId.toUpperCase()
}
}
},
data () {
return {
//
exportData: [],
exportName: '分组分组' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['分组分组'],
exportFooter: [],
resultList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: this.$store.state.user.site,
groupId: '',
groupName: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
groupId: '',
groupName: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100005,
serialNumber: '100005Table1groupId',
tableId: "100005Table1",
tableName: "分组信息表",
columnProp: 'groupId',
headerAlign: "center",
align: "center",
columnLabel: '分组编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100005,
serialNumber: '100005Table1groupName',
tableId: "100005Table1",
tableName: "分组表",
columnProp: 'groupName',
headerAlign: "center",
align: "center",
columnLabel: '分组名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
functionId: 100005,
serialNumber: '100005Table1Active',
tableId: '100005Table1',
tableName: '分组信息表',
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 100005,
serialNumber: '100005Table1CreateDate',
tableId: '100005Table1',
tableName: '分组表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100005,
serialNumber: '100005Table1CreateBy',
tableId: "100005Table1",
tableName: "分组表",
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100005,
serialNumber: '100005Table1UpdateDate',
tableId: "100005Table1",
tableName: "分组表",
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100005,
serialNumber: '100005Table1UpdateBy',
tableId: "100005Table1",
tableName: "分组表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
rules:{
groupId:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
groupName:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
this.getDataList()
},
methods: {
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await partGroupInformationSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
partGroupInformationSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
addModal(){
this.modalData = {
flag: '1',
title: '分组新增',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
groupId: '',
groupName: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 分组信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '分组编辑',
site: row.site,
groupId: row.groupId,
groupName: row.groupName,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 分组信息新增/编辑
*/
saveData () {
if (this.modalData.groupId === '' || this.modalData.groupId == null) {
this.$message.warning('请填写分组编码!')
return
}
if (this.modalData.groupName === '' || this.modalData.groupName == null) {
this.$message.warning('请填写分组名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
partGroupInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
partGroupInformationEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
/**
* 分组信息删除
*/
delModal (row) {
this.$confirm(`是否删除这条分组信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
partGroupInformationDelete(row).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.partSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
height: 459px;
}
</style>

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

@ -0,0 +1,504 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'商品编码'">
<el-input v-model="searchData.productGroupId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'商品名称'">
<el-input v-model="searchData.productGroupName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'是否在用'">
<el-select clearable v-model="searchData.active" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="delModal(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<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-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-input v-model="modalData.productGroupName" 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;">
<el-form-item label="是否在用" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" style="width: 221px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></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>
</el-footer>
</el-dialog>
<!-- chooseList模态框 -->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
productGroupInformationSearch, //
productGroupInformationSave, //
productGroupInformationEdit, //
productGroupInformationDelete //
} from '@/api/part/productGroupInformation.js'
import Chooselist from '@/views/modules/common/Chooselist'
import productGroupInformation from './productGroupInformation'
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.productGroupId = this.searchData.productGroupId.toUpperCase()
}
}
},
data () {
return {
//
exportData: [],
exportName: '商品组' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['商品'],
exportFooter: [],
resultList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: this.$store.state.user.site,
productGroupId: '',
productGroupName: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
productGroupId: '',
productGroupName: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 100007,
serialNumber: '100007Table1ProductGroupId',
tableId: "100007Table1",
tableName: "商品信息表",
columnProp: 'productGroupId',
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: '100007Table1ProductGroupName',
tableId: "100007Table1",
tableName: "商品表",
columnProp: 'productGroupName',
headerAlign: "center",
align: "center",
columnLabel: '商品名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
functionId: 100007,
serialNumber: '100007Table1Active',
tableId: '100007Table1',
tableName: '商品信息表',
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 100007,
serialNumber: '100007Table1CreateDate',
tableId: '100007Table1',
tableName: '商品表',
columnProp: 'createDate',
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: '100007Table1CreateBy',
tableId: "100007Table1",
tableName: "商品表",
columnProp: 'createBy',
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: '100007Table1UpdateDate',
tableId: "100007Table1",
tableName: "商品表",
columnProp: 'updateDate',
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: '100007Table1UpdateBy',
tableId: "100007Table1",
tableName: "商品表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
rules:{
productGroupId:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
productGroupName:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
this.getDataList()
},
methods: {
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await productGroupInformationSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
productGroupInformationSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
addModal(){
this.modalData = {
flag: '1',
title: '商品新增',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
productGroupId: '',
productGroupName: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 商品信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '商品编辑',
site: row.site,
productGroupId: row.productGroupId,
productGroupName: row.productGroupName,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 商品信息新增/编辑
*/
saveData () {
if (this.modalData.productGroupId === '' || this.modalData.productGroupId == null) {
this.$message.warning('请填写商品编码!')
return
}
if (this.modalData.productGroupName === '' || this.modalData.productGroupName == null) {
this.$message.warning('请填写商品名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
productGroupInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
productGroupInformationEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
/**
* 商品信息删除
*/
delModal (row) {
this.$confirm(`是否删除这条商品信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
productGroupInformationDelete(row).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.partSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
height: 459px;
}
</style>

150
src/views/modules/part/umInformation.vue

@ -34,7 +34,7 @@
</el-form-item>
</el-form>
<!-- 材料列表 -->
<!-- 单位列表 -->
<el-table
:height="height"
:data="dataList"
@ -80,7 +80,7 @@
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 材料新增/编辑模态框 -->
<!-- 单位新增/编辑模态框 -->
<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="umId" :rules="rules.umId">
@ -161,7 +161,9 @@
site: this.$store.state.user.site,
umId: '',
umName: '',
active: ''
active: '',
createBy: '',
updateBy: ''
},
// ======== ========
dataList: [],
@ -221,6 +223,74 @@
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 100003,
serialNumber: '100003Table1CreateDate',
tableId: '100003Table1',
tableName: '单位信息表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100003,
serialNumber: '100003Table1CreatedBy',
tableId: "100003Table1",
tableName: "单位信息表",
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100003,
serialNumber: '100003Table1UpdateDate',
tableId: "100003Table1",
tableName: "单位信息表",
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100003,
serialNumber: '100003Table1UpdateBy',
tableId: "100003Table1",
tableName: "单位信息表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
// ======== ========
rules: {
@ -278,7 +348,6 @@
this.pageIndex = val
this.getDataList()
},
// ======== ========
/**
* 获取数据列表
@ -300,13 +369,14 @@
// ======== / ========
/**
* 材料信息新增模态框
* 单位信息新增模态框
*/
addModal () {
this.modalData = {
flag: '1',
title: '单位新增',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
umId: '',
umName: '',
active: 'Y',
@ -315,7 +385,7 @@
this.modalFlag = true
},
/**
* 材料信息编辑模态框
* 单位信息编辑模态框
* @param row
*/
updateModal (row) {
@ -325,7 +395,8 @@
site: row.site,
umId: row.umId,
umName: row.umName,
active: row.active
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
@ -333,7 +404,7 @@
// ======== // ========
/**
* 材料信息新增/编辑
* 单位信息新增/编辑
*/
saveData () {
if (this.modalData.umId === '' || this.modalData.umId == null) {
@ -385,10 +456,10 @@
}
},
/**
* 材料信息删除
* 单位信息删除
*/
delModal (row) {
this.$confirm(`是否删除这条材料信息?`, '提示', {
this.$confirm(`是否删除这条单位信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -413,64 +484,7 @@
})
},
// ======== chooseList ========
/**
* 获取基础数据列表S
* @param val
* @param type
*/
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
if (val === 107) {
if(type === 1) {
strVal = this.modalData.umId
}
}
if (val === 108) {
if(type === 1) {
strVal = this.modalData.familyId
}
}
if (val === 109) {
if(type === 1) {
strVal = this.modalData.groupId
}
}
if (val === 110) {
if(type === 1) {
strVal = this.modalData.otherGroup1
}
}
this.$refs.baseList.init(val, strVal)
})
},
/**
* 列表方法的回调
* @param val
*/
getBaseData (val) {
if (this.tagNo === 107) {
if(this.tagNo1 === 1) {
this.modalData.umId = val.um_id
this.modalData.umName = val.um_name
}
}
if (this.tagNo === 108) {
if(this.tagNo1 === 1) {
this.modalData.familyId = val.family_id
this.modalData.familyName = val.family_name
}
}
if (this.tagNo === 109) {
if(this.tagNo1 === 1) {
this.modalData.groupId = val.group_id
this.modalData.groupName = val.group_name
}
}
},
// ======== ========
/**

Loading…
Cancel
Save