Browse Source

2025/7/2

master
Aoi_Tori 6 months ago
parent
commit
82cf68a7ec
  1. 26
      src/api/part/abcClassInformation.js
  2. 26
      src/api/part/assetClassInformation.js
  3. 26
      src/api/part/countryInformation.js
  4. 26
      src/api/part/customsStatInformation.js
  5. 26
      src/api/part/partCostGroupInformation.js
  6. 26
      src/api/part/partStatusInformation.js
  7. 26
      src/api/part/planningMethodInformation.js
  8. 26
      src/api/part/regionInformation.js
  9. 26
      src/api/part/safetyCodeInformation.js
  10. 488
      src/views/modules/part/abcClassInformation.vue
  11. 488
      src/views/modules/part/assetClassInformation.vue
  12. 488
      src/views/modules/part/countryInformation.vue
  13. 525
      src/views/modules/part/customsStatInformation.vue
  14. 488
      src/views/modules/part/partCostGroupInformation.vue
  15. 488
      src/views/modules/part/partStatusInformation.vue
  16. 488
      src/views/modules/part/planningMethodInformation.vue
  17. 488
      src/views/modules/part/regionInformation.vue
  18. 488
      src/views/modules/part/safetyCodeInformation.vue

26
src/api/part/abcClassInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* ABC类信息列表查询
* @param data
* @returns {*}
*/
export const abcClassInformationSearch = data => createAPI(`/plm/abcClassInformation/abcClassInformationSearch`,'post',data)
/**
* ABC类信息新增
* @param data
* @returns {*}
*/
export const abcClassInformationSave = data => createAPI(`/plm/abcClassInformation/abcClassInformationSave`,'post',data)
/**
* ABC类信息编辑
* @param data
* @returns {*}
*/
export const abcClassInformationEdit = data => createAPI(`/plm/abcClassInformation/abcClassInformationEdit`,'post',data)
/**
* ABC类信息删除
* @param data
* @returns {*}
*/
export const abcClassInformationDelete = data => createAPI(`/plm/abcClassInformation/abcClassInformationDelete`,'post',data)

26
src/api/part/assetClassInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 资产等级信息列表查询
* @param data
* @returns {*}
*/
export const assetClassInformationSearch = data => createAPI(`/plm/assetClassInformation/assetClassInformationSearch`,'post',data)
/**
* 资产等级信息新增
* @param data
* @returns {*}
*/
export const assetClassInformationSave = data => createAPI(`/plm/assetClassInformation/assetClassInformationSave`,'post',data)
/**
* 资产等级信息编辑
* @param data
* @returns {*}
*/
export const assetClassInformationEdit = data => createAPI(`/plm/assetClassInformation/assetClassInformationEdit`,'post',data)
/**
* 资产等级信息删除
* @param data
* @returns {*}
*/
export const assetClassInformationDelete = data => createAPI(`/plm/assetClassInformation/assetClassInformationDelete`,'post',data)

26
src/api/part/countryInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 来源国家信息列表查询
* @param data
* @returns {*}
*/
export const countryInformationSearch = data => createAPI(`/plm/countryInformation/countryInformationSearch`,'post',data)
/**
* 来源国家信息新增
* @param data
* @returns {*}
*/
export const countryInformationSave = data => createAPI(`/plm/countryInformation/countryInformationSave`,'post',data)
/**
* 来源国家信息编辑
* @param data
* @returns {*}
*/
export const countryInformationEdit = data => createAPI(`/plm/countryInformation/countryInformationEdit`,'post',data)
/**
* 来源国家信息删除
* @param data
* @returns {*}
*/
export const countryInformationDelete = data => createAPI(`/plm/countryInformation/countryInformationDelete`,'post',data)

26
src/api/part/customsStatInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 海关统计信息列表查询
* @param data
* @returns {*}
*/
export const customsStatInformationSearch = data => createAPI(`/plm/customsStatInformation/customsStatInformationSearch`,'post',data)
/**
* 海关统计信息新增
* @param data
* @returns {*}
*/
export const customsStatInformationSave = data => createAPI(`/plm/customsStatInformation/customsStatInformationSave`,'post',data)
/**
* 海关统计信息编辑
* @param data
* @returns {*}
*/
export const customsStatInformationEdit = data => createAPI(`/plm/customsStatInformation/customsStatInformationEdit`,'post',data)
/**
* 海关统计信息删除
* @param data
* @returns {*}
*/
export const customsStatInformationDelete = data => createAPI(`/plm/customsStatInformation/customsStatInformationDelete`,'post',data)

26
src/api/part/partCostGroupInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 零件成本组信息列表查询
* @param data
* @returns {*}
*/
export const partCostGroupInformationSearch = data => createAPI(`/plm/partCostGroupInformation/partCostGroupInformationSearch`,'post',data)
/**
* 零件成本组信息新增
* @param data
* @returns {*}
*/
export const partCostGroupInformationSave = data => createAPI(`/plm/partCostGroupInformation/partCostGroupInformationSave`,'post',data)
/**
* 零件成本组信息编辑
* @param data
* @returns {*}
*/
export const partCostGroupInformationEdit = data => createAPI(`/plm/partCostGroupInformation/partCostGroupInformationEdit`,'post',data)
/**
* 零件成本组信息删除
* @param data
* @returns {*}
*/
export const partCostGroupInformationDelete = data => createAPI(`/plm/partCostGroupInformation/partCostGroupInformationDelete`,'post',data)

26
src/api/part/partStatusInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 零件状态信息列表查询
* @param data
* @returns {*}
*/
export const partStatusInformationSearch = data => createAPI(`/plm/partStatusInformation/partStatusInformationSearch`,'post',data)
/**
* 零件状态信息新增
* @param data
* @returns {*}
*/
export const partStatusInformationSave = data => createAPI(`/plm/partStatusInformation/partStatusInformationSave`,'post',data)
/**
* 零件状态信息编辑
* @param data
* @returns {*}
*/
export const partStatusInformationEdit = data => createAPI(`/plm/partStatusInformation/partStatusInformationEdit`,'post',data)
/**
* 零件状态信息删除
* @param data
* @returns {*}
*/
export const partStatusInformationDelete = data => createAPI(`/plm/partStatusInformation/partStatusInformationDelete`,'post',data)

26
src/api/part/planningMethodInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 计划方法信息列表查询
* @param data
* @returns {*}
*/
export const planningMethodInformationSearch = data => createAPI(`/plm/planningMethodInformation/planningMethodInformationSearch`,'post',data)
/**
* 计划方法信息新增
* @param data
* @returns {*}
*/
export const planningMethodInformationSave = data => createAPI(`/plm/planningMethodInformation/planningMethodInformationSave`,'post',data)
/**
* 计划方法信息编辑
* @param data
* @returns {*}
*/
export const planningMethodInformationEdit = data => createAPI(`/plm/planningMethodInformation/planningMethodInformationEdit`,'post',data)
/**
* 计划方法信息删除
* @param data
* @returns {*}
*/
export const planningMethodInformationDelete = data => createAPI(`/plm/planningMethodInformation/planningMethodInformationDelete`,'post',data)

26
src/api/part/regionInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 区域信息列表查询
* @param data
* @returns {*}
*/
export const regionInformationSearch = data => createAPI(`/plm/regionInformation/regionInformationSearch`,'post',data)
/**
* 区域信息新增
* @param data
* @returns {*}
*/
export const regionInformationSave = data => createAPI(`/plm/regionInformation/regionInformationSave`,'post',data)
/**
* 区域信息编辑
* @param data
* @returns {*}
*/
export const regionInformationEdit = data => createAPI(`/plm/regionInformation/regionInformationEdit`,'post',data)
/**
* 区域信息删除
* @param data
* @returns {*}
*/
export const regionInformationDelete = data => createAPI(`/plm/regionInformation/regionInformationDelete`,'post',data)

26
src/api/part/safetyCodeInformation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 安全代码信息列表查询
* @param data
* @returns {*}
*/
export const safetyCodeInformationSearch = data => createAPI(`/plm/safetyCodeInformation/safetyCodeInformationSearch`,'post',data)
/**
* 安全代码信息新增
* @param data
* @returns {*}
*/
export const safetyCodeInformationSave = data => createAPI(`/plm/safetyCodeInformation/safetyCodeInformationSave`,'post',data)
/**
* 安全代码信息编辑
* @param data
* @returns {*}
*/
export const safetyCodeInformationEdit = data => createAPI(`/plm/safetyCodeInformation/safetyCodeInformationEdit`,'post',data)
/**
* 安全代码信息删除
* @param data
* @returns {*}
*/
export const safetyCodeInformationDelete = data => createAPI(`/plm/safetyCodeInformation/safetyCodeInformationDelete`,'post',data)

488
src/views/modules/part/abcClassInformation.vue

@ -0,0 +1,488 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'ABC类编码'">
<el-input v-model="searchData.abcClass" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'ABC类名称'">
<el-input v-model="searchData.abcClassDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="ABC类编码" prop="abcClass" :rules="rules.abcClass">
<el-input v-model="modalData.abcClass" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="ABC类名称" prop="abcClassDesc" :rules="rules.abcClassDesc">
<el-input v-model="modalData.abcClassDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
abcClassInformationDelete,
abcClassInformationEdit,
abcClassInformationSave,
abcClassInformationSearch
} from "../../../api/part/abcClassInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.abcClass = this.searchData.abcClass.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.abcClass = this.modalData.abcClass.toUpperCase()
}
}
},
data () {
return {
//
exportData: [],
exportName: 'ABC类ABC类' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['ABC类ABC类'],
exportFooter: [],
resultList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: this.$store.state.user.site,
abcClass: '',
abcClassDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
abcClass: '',
abcClassDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'abcClass',
headerAlign: "center",
align: "center",
columnLabel: 'ABC类编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'abcClassDesc',
headerAlign: "center",
align: "left",
columnLabel: 'ABC类名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
abcClass:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
abcClassDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 abcClassInformationSearch(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
abcClassInformationSearch(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: 'ABC类新增',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
abcClass: '',
abcClassDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* ABC类信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: 'ABC类编辑',
site: row.site,
abcClass: row.abcClass,
abcClassDesc: row.abcClassDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* ABC类信息新增/编辑
*/
saveData () {
if (this.modalData.abcClass === '' || this.modalData.abcClass == null) {
this.$message.warning('请填写ABC类编码!')
return
}
if (this.modalData.abcClassDesc === '' || this.modalData.abcClassDesc == null) {
this.$message.warning('请填写ABC类名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
abcClassInformationSave(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 {
abcClassInformationEdit(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: '确定'
})
}
})
}
},
/**
* ABC类信息删除
*/
delModal (row) {
this.$confirm(`是否删除这条ABC类信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
abcClassInformationDelete(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>

488
src/views/modules/part/assetClassInformation.vue

@ -0,0 +1,488 @@
<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.assetClass" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'资产等级名称'">
<el-input v-model="searchData.assetClassDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="assetClass" :rules="rules.assetClass">
<el-input v-model="modalData.assetClass" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="资产等级名称" prop="assetClassDesc" :rules="rules.assetClassDesc">
<el-input v-model="modalData.assetClassDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
assetClassInformationDelete,
assetClassInformationEdit,
assetClassInformationSave,
assetClassInformationSearch
} from "../../../api/part/assetClassInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.assetClass = this.searchData.assetClass.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.assetClass = this.modalData.assetClass.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,
assetClass: '',
assetClassDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
assetClass: '',
assetClassDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'assetClass',
headerAlign: "center",
align: "center",
columnLabel: '资产等级编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'assetClassDesc',
headerAlign: "center",
align: "left",
columnLabel: '资产等级名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
assetClass:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
assetClassDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 assetClassInformationSearch(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
assetClassInformationSearch(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,
assetClass: '',
assetClassDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 资产等级信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '资产等级编辑',
site: row.site,
assetClass: row.assetClass,
assetClassDesc: row.assetClassDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 资产等级信息新增/编辑
*/
saveData () {
if (this.modalData.assetClass === '' || this.modalData.assetClass == null) {
this.$message.warning('请填写资产等级编码!')
return
}
if (this.modalData.assetClassDesc === '' || this.modalData.assetClassDesc == null) {
this.$message.warning('请填写资产等级名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
assetClassInformationSave(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 {
assetClassInformationEdit(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(() => {
assetClassInformationDelete(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>

488
src/views/modules/part/countryInformation.vue

@ -0,0 +1,488 @@
<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.countryOfOrigin" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'国家名称'">
<el-input v-model="searchData.countryOfOriginDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="countryOfOrigin" :rules="rules.countryOfOrigin">
<el-input v-model="modalData.countryOfOrigin" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="国家名称" prop="countryOfOriginDesc" :rules="rules.countryOfOriginDesc">
<el-input v-model="modalData.countryOfOriginDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
countryInformationDelete,
countryInformationEdit,
countryInformationSave,
countryInformationSearch
} from "../../../api/part/countryInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.countryOfOrigin = this.searchData.countryOfOrigin.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.countryOfOrigin = this.modalData.countryOfOrigin.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,
countryOfOrigin: '',
countryOfOriginDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
countryOfOrigin: '',
countryOfOriginDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'countryOfOrigin',
headerAlign: "center",
align: "center",
columnLabel: '国家编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'countryOfOriginDesc',
headerAlign: "center",
align: "left",
columnLabel: '国家名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
countryOfOrigin:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
countryOfOriginDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 countryInformationSearch(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
countryInformationSearch(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,
countryOfOrigin: '',
countryOfOriginDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 国家信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '国家编辑',
site: row.site,
countryOfOrigin: row.countryOfOrigin,
countryOfOriginDesc: row.countryOfOriginDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 国家信息新增/编辑
*/
saveData () {
if (this.modalData.countryOfOrigin === '' || this.modalData.countryOfOrigin == null) {
this.$message.warning('请填写国家编码!')
return
}
if (this.modalData.countryOfOriginDesc === '' || this.modalData.countryOfOriginDesc == null) {
this.$message.warning('请填写国家名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
countryInformationSave(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 {
countryInformationEdit(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(() => {
countryInformationDelete(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>

525
src/views/modules/part/customsStatInformation.vue

@ -0,0 +1,525 @@
<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.customsStatNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'海关统计名称'">
<el-input v-model="searchData.customsStatDesc" clearable style="width: 210px"></el-input>
</el-form-item>
<el-form-item :label="'单位名称'">
<el-input v-model="searchData.umDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="customsStatNo" :rules="rules.customsStatNo">
<el-input v-model="modalData.customsStatNo" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="海关统计名称" prop="customsStatDesc" :rules="rules.customsStatDesc">
<el-input v-model="modalData.customsStatDesc" style="width: 302px"></el-input>
</el-form-item>
<el-form-item label="海关统计名称" prop="umDesc" :rules="rules.umDesc">
<el-input v-model="modalData.umDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
assetClassInformationDelete,
assetClassInformationEdit,
assetClassInformationSave,
assetClassInformationSearch
} from "../../../api/part/assetClassInformation";
import {
customsStatInformationDelete,
customsStatInformationEdit,
customsStatInformationSave,
customsStatInformationSearch
} from "../../../api/part/customsStatInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.customsStatNo = this.searchData.customsStatNo.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.customsStatNo = this.modalData.customsStatNo.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,
customsStatNo: '',
customsStatDesc: '',
umDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
customsStatNo: '',
customsStatDesc: '',
umDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'customsStatNo',
headerAlign: "center",
align: "center",
columnLabel: '海关统计编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'customsStatDesc',
headerAlign: "center",
align: "left",
columnLabel: '海关统计名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'umDesc',
headerAlign: "center",
align: "left",
columnLabel: '单位名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
customsStatNo:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
customsStatDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
umDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 customsStatInformationSearch(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
customsStatInformationSearch(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,
customsStatNo: '',
customsStatDesc: '',
umDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 海关统计信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '海关统计编辑',
site: row.site,
customsStatNo: row.customsStatNo,
customsStatDesc: row.customsStatDesc,
umDesc: row.umDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 海关统计信息新增/编辑
*/
saveData () {
if (this.modalData.customsStatNo === '' || this.modalData.customsStatNo == null) {
this.$message.warning('请填写海关统计编码!')
return
}
if (this.modalData.customsStatDesc === '' || this.modalData.customsStatDesc == null) {
this.$message.warning('请填写海关统计名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
customsStatInformationSave(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 {
customsStatInformationEdit(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(() => {
customsStatInformationDelete(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>

488
src/views/modules/part/partCostGroupInformation.vue

@ -0,0 +1,488 @@
<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.partCostGroupId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'零件成本组名称'">
<el-input v-model="searchData.partCostGroupDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="partCostGroupId" :rules="rules.partCostGroupId">
<el-input v-model="modalData.partCostGroupId" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="零件成本组名称" prop="partCostGroupDesc" :rules="rules.partCostGroupDesc">
<el-input v-model="modalData.partCostGroupDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
partCostGroupInformationDelete,
partCostGroupInformationEdit,
partCostGroupInformationSave,
partCostGroupInformationSearch
} from "../../../api/part/partCostGroupInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.partCostGroupId = this.searchData.partCostGroupId.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.partCostGroupId = this.modalData.partCostGroupId.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,
partCostGroupId: '',
partCostGroupDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
partCostGroupId: '',
partCostGroupDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'partCostGroupId',
headerAlign: "center",
align: "center",
columnLabel: '零件成本组编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'partCostGroupDesc',
headerAlign: "center",
align: "left",
columnLabel: '零件成本组名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
partCostGroupId:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
partCostGroupDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 partCostGroupInformationSearch(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
partCostGroupInformationSearch(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,
partCostGroupId: '',
partCostGroupDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 零件成本组信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '零件成本组编辑',
site: row.site,
partCostGroupId: row.partCostGroupId,
partCostGroupDesc: row.partCostGroupDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 零件成本组信息新增/编辑
*/
saveData () {
if (this.modalData.partCostGroupId === '' || this.modalData.partCostGroupId == null) {
this.$message.warning('请填写零件成本组编码!')
return
}
if (this.modalData.partCostGroupDesc === '' || this.modalData.partCostGroupDesc == null) {
this.$message.warning('请填写零件成本组名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
partCostGroupInformationSave(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 {
partCostGroupInformationEdit(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(() => {
partCostGroupInformationDelete(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>

488
src/views/modules/part/partStatusInformation.vue

@ -0,0 +1,488 @@
<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.partStatus" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'零件状态名称'">
<el-input v-model="searchData.partStatusDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="partStatus" :rules="rules.partStatus">
<el-input v-model="modalData.partStatus" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="零件状态名称" prop="partStatusDesc" :rules="rules.partStatusDesc">
<el-input v-model="modalData.partStatusDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
partStatusInformationDelete,
partStatusInformationEdit,
partStatusInformationSave,
partStatusInformationSearch
} from "../../../api/part/partStatusInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.partStatus = this.searchData.partStatus.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.partStatus = this.modalData.partStatus.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,
partStatus: '',
partStatusDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
partStatus: '',
partStatusDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'partStatus',
headerAlign: "center",
align: "center",
columnLabel: '零件状态编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'partStatusDesc',
headerAlign: "center",
align: "left",
columnLabel: '零件状态名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
partStatus:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
partStatusDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 partStatusInformationSearch(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
partStatusInformationSearch(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,
partStatus: '',
partStatusDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 零件状态信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '零件状态编辑',
site: row.site,
partStatus: row.partStatus,
partStatusDesc: row.partStatusDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 零件状态信息新增/编辑
*/
saveData () {
if (this.modalData.partStatus === '' || this.modalData.partStatus == null) {
this.$message.warning('请填写零件状态编码!')
return
}
if (this.modalData.partStatusDesc === '' || this.modalData.partStatusDesc == null) {
this.$message.warning('请填写零件状态名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
partStatusInformationSave(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 {
partStatusInformationEdit(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(() => {
partStatusInformationDelete(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>

488
src/views/modules/part/planningMethodInformation.vue

@ -0,0 +1,488 @@
<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.planningMethod" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'计划方法名称'">
<el-input v-model="searchData.planningMethodDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="planningMethod" :rules="rules.planningMethod">
<el-input v-model="modalData.planningMethod" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="计划方法名称" prop="planningMethodDesc" :rules="rules.planningMethodDesc">
<el-input v-model="modalData.planningMethodDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
planningMethodInformationDelete,
planningMethodInformationEdit,
planningMethodInformationSave,
planningMethodInformationSearch
} from "../../../api/part/planningMethodInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.planningMethod = this.searchData.planningMethod.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.planningMethod = this.modalData.planningMethod.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,
planningMethod: '',
planningMethodDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
planningMethod: '',
planningMethodDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'planningMethod',
headerAlign: "center",
align: "center",
columnLabel: '计划方法编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'planningMethodDesc',
headerAlign: "center",
align: "left",
columnLabel: '计划方法名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
planningMethod:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
planningMethodDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 planningMethodInformationSearch(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
planningMethodInformationSearch(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,
planningMethod: '',
planningMethodDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 计划方法信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '计划方法编辑',
site: row.site,
planningMethod: row.planningMethod,
planningMethodDesc: row.planningMethodDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 计划方法信息新增/编辑
*/
saveData () {
if (this.modalData.planningMethod === '' || this.modalData.planningMethod == null) {
this.$message.warning('请填写计划方法编码!')
return
}
if (this.modalData.planningMethodDesc === '' || this.modalData.planningMethodDesc == null) {
this.$message.warning('请填写计划方法名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
planningMethodInformationSave(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 {
planningMethodInformationEdit(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(() => {
planningMethodInformationDelete(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>

488
src/views/modules/part/regionInformation.vue

@ -0,0 +1,488 @@
<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.regionOfOrigin" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'区域名称'">
<el-input v-model="searchData.regionOfOriginDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="regionOfOrigin" :rules="rules.regionOfOrigin">
<el-input v-model="modalData.regionOfOrigin" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="区域名称" prop="regionOfOriginDesc" :rules="rules.regionOfOriginDesc">
<el-input v-model="modalData.regionOfOriginDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
regionInformationDelete,
regionInformationEdit,
regionInformationSave,
regionInformationSearch
} from "../../../api/part/regionInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.regionOfOrigin = this.searchData.regionOfOrigin.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.regionOfOrigin = this.modalData.regionOfOrigin.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,
regionOfOrigin: '',
regionOfOriginDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
regionOfOrigin: '',
regionOfOriginDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'regionOfOrigin',
headerAlign: "center",
align: "center",
columnLabel: '区域编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'regionOfOriginDesc',
headerAlign: "center",
align: "left",
columnLabel: '区域名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
regionOfOrigin:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
regionOfOriginDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 regionInformationSearch(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
regionInformationSearch(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,
regionOfOrigin: '',
regionOfOriginDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 区域信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '区域编辑',
site: row.site,
regionOfOrigin: row.regionOfOrigin,
regionOfOriginDesc: row.regionOfOriginDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 区域信息新增/编辑
*/
saveData () {
if (this.modalData.regionOfOrigin === '' || this.modalData.regionOfOrigin == null) {
this.$message.warning('请填写区域编码!')
return
}
if (this.modalData.regionOfOriginDesc === '' || this.modalData.regionOfOriginDesc == null) {
this.$message.warning('请填写区域名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
regionInformationSave(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 {
regionInformationEdit(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(() => {
regionInformationDelete(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>

488
src/views/modules/part/safetyCodeInformation.vue

@ -0,0 +1,488 @@
<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.hazardCode" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'安全代码名称'">
<el-input v-model="searchData.hazardDesc" clearable style="width: 210px"></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">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination style="margin-top: 0px"
@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="hazardCode" :rules="rules.hazardCode">
<el-input v-model="modalData.hazardCode" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="安全代码名称" prop="hazardDesc" :rules="rules.hazardDesc">
<el-input v-model="modalData.hazardDesc" style="width: 302px"></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: 140px">
<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 Chooselist from '@/views/modules/common/Chooselist'
import {
safetyCodeInformationDelete,
safetyCodeInformationEdit,
safetyCodeInformationSave,
safetyCodeInformationSearch
} from "../../../api/part/safetyCodeInformation";
export default {
components: {
Chooselist
},
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.hazardCode = this.searchData.hazardCode.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.hazardCode = this.modalData.hazardCode.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,
hazardCode: '',
hazardDesc: '',
active: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
hazardCode: '',
hazardDesc: '',
active: ''
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
columnProp: 'hazardCode',
headerAlign: "center",
align: "center",
columnLabel: '安全代码编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
columnProp: 'hazardDesc',
headerAlign: "center",
align: "left",
columnLabel: '安全代码名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
columnProp: 'active',
headerAlign: 'center',
align: 'center',
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'createBy',
headerAlign: "center",
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
columnProp: 'updateDate',
headerAlign: "center",
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 170
},
{
userId: this.$store.state.user.name,
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules:{
hazardCode:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
hazardDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
active:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
},
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 170
})
},
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 safetyCodeInformationSearch(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
safetyCodeInformationSearch(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,
hazardCode: '',
hazardDesc: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 安全代码信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '安全代码编辑',
site: row.site,
hazardCode: row.hazardCode,
hazardDesc: row.hazardDesc,
active: row.active,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 安全代码信息新增/编辑
*/
saveData () {
if (this.modalData.hazardCode === '' || this.modalData.hazardCode == null) {
this.$message.warning('请填写安全代码编码!')
return
}
if (this.modalData.hazardDesc === '' || this.modalData.hazardDesc == null) {
this.$message.warning('请填写安全代码名称!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否可用!')
return
}
if (this.modalData.flag === '1') {
safetyCodeInformationSave(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 {
safetyCodeInformationEdit(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(() => {
safetyCodeInformationDelete(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>
Loading…
Cancel
Save