Browse Source

2024.9.14 一、物料成本信息维护(第一版)

二、加工中心功能改造
三、标准工序(第一版)
四、商品组 - 标准工序(第一版)
java8
yuejiayang 1 year ago
parent
commit
bcf870b58e
  1. 3
      src/api/fanucGroup/fanuc.js
  2. 7
      src/api/part/partCostInformation.js
  3. 10
      src/api/part/partProductGroupStdProcess.js
  4. 26
      src/api/part/standardRoutingOperation.js
  5. 1
      src/views/modules/common/Chooselist_eam.vue
  6. 147
      src/views/modules/fanuc/fanuc.vue
  7. 715
      src/views/modules/part/partCostInformation.vue
  8. 437
      src/views/modules/part/partProductGroupInformation.vue
  9. 893
      src/views/modules/part/standardRoutingOperation.vue

3
src/api/fanucGroup/fanuc.js

@ -23,6 +23,9 @@ export const deleteByCost= data => createAPI(`/cost/delete`,'post',data)
//成本查询(绑定人工等级) //成本查询(绑定人工等级)
export const queryCostByLabor= data => createAPI(`/cost/queryByLabor`,'post',data) export const queryCostByLabor= data => createAPI(`/cost/queryByLabor`,'post',data)
// 机台查询
export const queryResourceInfo= data => createAPI(`/fanuc/queryResourceInfo`,'post',data)

7
src/api/part/partCostInformation.js

@ -0,0 +1,7 @@
import { createAPI } from "@/utils/httpRequest.js";
// partCostInformationSearch 物料成本信息列表查询
export const partCostInformationSearch = data => createAPI(`/part/partCostInformation/partCostInformationSearch`,'post',data)
// partCostInformationEdit 物料成本信息编辑
export const partCostInformationEdit = data => createAPI(`/part/partCostInformation/partCostInformationEdit`,'post',data)

10
src/api/part/partProductGroupStdProcess.js

@ -0,0 +1,10 @@
import { createAPI } from "@/utils/httpRequest.js";
//查询
export const searchProductGroupStdProcess= data => createAPI(`/plm/partProductGroupInformation/searchProductGroupStdProcess`,'post',data)
//新增
export const saveStdProcessData= data => createAPI(`/plm/partProductGroupInformation/saveStdProcessData`,'post',data)
// 删除
export const delProductGroupStdProcess= data => createAPI(`/plm/partProductGroupInformation/delProductGroupStdProcess`,'post',data)

26
src/api/part/standardRoutingOperation.js

@ -0,0 +1,26 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* 分类信息列表查询
* @param data
* @returns {*}
*/
export const searchStandardRoutingOperationList = data => createAPI(`/part/standardRoutingOperation/searchStandardRoutingOperationList`,'post',data)
/**
* 分类信息新增
* @param data
* @returns {*}
*/
export const saveStandardRoutingOperation = data => createAPI(`/part/standardRoutingOperation/saveStandardRoutingOperation`,'post',data)
/**
* 分类信息编辑
* @param data
* @returns {*}
*/
export const updateStandardRoutingOperation = data => createAPI(`/part/standardRoutingOperation/updateStandardRoutingOperation`,'post',data)
/**
* 分类信息删除
* @param data
* @returns {*}
*/
export const deleteStandardRoutingOperation = data => createAPI(`/part/standardRoutingOperation/deleteStandardRoutingOperation`,'post',data)

1
src/views/modules/common/Chooselist_eam.vue

@ -241,6 +241,7 @@ export default {
this.param6 = '' this.param6 = ''
this.param7 = this.$store.state.user.name this.param7 = this.$store.state.user.name
this.param = '' this.param = ''
this.dataList = []
} }
} }
} }

147
src/views/modules/fanuc/fanuc.vue

@ -55,7 +55,7 @@
:height="height" :height="height"
:data="dataList" :data="dataList"
@row-click="changeData" @row-click="changeData"
:row-style="rowStyle"
border border
style="width: 100%;"> style="width: 100%;">
<el-table-column <el-table-column
@ -190,6 +190,31 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="机台" name="resource">
<el-table
:data="dataList3"
:height="height + 25"
border
style="width: 100%; ">
<el-table-column
v-for="(item,index) in columnList3" :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>
</el-tab-pane>
</el-tabs> </el-tabs>
@ -287,6 +312,7 @@ import {
queryByCost, // queryByCost, //
amendByCost,// amendByCost,//
deleteByCost,// deleteByCost,//
queryResourceInfo,//
} from "@/api/fanucGroup/fanuc.js" } from "@/api/fanucGroup/fanuc.js"
import {getSiteAndBuByUserName} from "@/api/eam/eam.js" import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
@ -342,6 +368,7 @@ export default {
dataList: [], dataList: [],
dataList1: [], dataList1: [],
dataList2: [], dataList2: [],
dataList3: [],
dataListLoading: false, dataListLoading: false,
modalFlag: false, modalFlag: false,
modalDisableFlag: false, modalDisableFlag: false,
@ -496,6 +523,24 @@ export default {
status: true, status: true,
fixed: '', fixed: '',
}, },
{
userId: this.$store.state.user.name,
functionId: 501002,
serialNumber: '501002TableResourceCount',
tableId: "501002Table",
tableName: "状态",
columnWidth: 60,
columnProp: 'resourceCount',
headerAlign: 'center',
align: "center",
columnLabel: '机台数',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 501002, functionId: 501002,
@ -951,6 +996,80 @@ export default {
fixed: '', fixed: '',
}, },
], ],
columnList3: [
{
userId: this.$store.state.user.name,
functionId: 501002,
serialNumber: '501002TableResourceId',
tableId: "501002Table",
tableName: "机台编码",
columnWidth: 130,
columnProp: 'resourceId',
headerAlign: 'center',
align: "left",
columnLabel: '机台编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 501002,
serialNumber: '501002TableResourceDesc',
tableId: "501002Table",
tableName: "机台名称",
columnWidth: 130,
columnProp: 'resourceDesc',
headerAlign: 'center',
align: "left",
columnLabel: '机台名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 501002,
serialNumber: '501002TableCreationDate',
tableId: "501002Table",
tableName: "创建时间",
columnWidth: 130,
columnProp: 'creationDate',
headerAlign: 'center',
align: "center",
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 501002,
serialNumber: '501002TableCreatedBy',
tableId: "501002Table",
tableName: "创建人",
columnWidth: 130,
columnProp: 'createdBy',
headerAlign: 'center',
align: "left",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
rules: { rules: {
prodLineNo: [ prodLineNo: [
{ {
@ -1075,6 +1194,10 @@ export default {
this.pageSize = data.page.pageSize this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
} }
if (this.dataList.length > 0) {
this.currentRow = this.dataList[0]
this.refreshCurrentTabTable()
}
}) })
}, },
@ -1098,6 +1221,8 @@ export default {
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
} else if (this.activeName == 'cost') { } else if (this.activeName == 'cost') {
this.refreshCurrentTabTable2() this.refreshCurrentTabTable2()
} else if (this.activeName == 'resource') {
this.refreshCurrentTabTable3()
} }
}, },
@ -1109,8 +1234,17 @@ export default {
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
} else if (this.activeName == 'cost') { } else if (this.activeName == 'cost') {
this.refreshCurrentTabTable2() this.refreshCurrentTabTable2()
} else if (this.activeName == 'resource') {
this.refreshCurrentTabTable3()
} }
}, },
rowStyle ({row}) {
if (this.currentRow.workCenterNo === row.workCenterNo) {
return { 'background-color': '#E8F7F6', cursor: 'pointer' };
}
},
refreshCurrentTabTable () { refreshCurrentTabTable () {
findFanuc(this.currentRow).then(({data}) => { findFanuc(this.currentRow).then(({data}) => {
@ -1136,6 +1270,17 @@ export default {
}); });
}, },
refreshCurrentTabTable3 () {
queryResourceInfo(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList3 = data.rows
} else {
this.dataList3 = [];
}
});
},
// //
addModal () { addModal () {
this.modalData1 = { this.modalData1 = {

715
src/views/modules/part/partCostInformation.vue

@ -0,0 +1,715 @@
<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.partNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="getDataList">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
ref="mainTable"
border
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="60"
label="操作">
<template slot-scope="scope">
<el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 编辑模态框 -->
<el-dialog title="物料成本信息 - 修改" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="566px">
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
<el-form :inline="true" label-position="top" :model="modalData">
<el-form-item label="物料编码" prop="partNo">
<el-input v-model="modalData.partNo" disabled style="width: 128px"></el-input>
</el-form-item>
<el-form-item label="物料描述" prop="partDesc">
<el-input v-model="modalData.partDesc" disabled style="width: 330px"></el-input>
</el-form-item>
<el-form-item label="计量单位">
<el-input v-model="modalData.umId" disabled style="width: 50px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
<el-form-item label="物料分类编码" prop="familyID">
<el-input v-model="modalData.familyID" disabled style="width: 128px"></el-input>
</el-form-item>
<el-form-item label="物料分类描述" prop="familyName">
<el-input v-model="modalData.familyName" disabled style="width: 330px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
<el-form-item label="产品组编码" prop="otherGroup1">
<el-input v-model="modalData.otherGroup1" disabled style="width: 128px"></el-input>
</el-form-item>
<el-form-item label="产品组描述" prop="otherGroupName1">
<el-input v-model="modalData.otherGroupName1" disabled style="width: 330px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;">
<el-form-item label="单位标准成本" prop="standardCost">
<el-input v-model="modalData.standardCost" class="inlineNumber numInput" style="width: 107px"></el-input>
</el-form-item>
<el-form-item label="标准成本币种" prop="standardCostCurrency" :show-message="false">
<span slot="label">
<a @click="getBaseList(512)">实际成本币种</a>
</span>
<el-input v-model="modalData.standardCostCurrency" disabled style="width: 108px"></el-input>
</el-form-item>
<el-form-item label="单位实际成本" prop="actualCost">
<el-input v-model="modalData.actualCost" class="inlineNumber numInput" style="width: 107px"></el-input>
</el-form-item>
<el-form-item label="实际成本币种" prop="actualCostCurrency" :show-message="false">
<span slot="label">
<a @click="getBaseList(513)">实际成本币种</a>
</span>
<el-input v-model="modalData.actualCostCurrency" disabled style="width: 108px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 0px;">
<el-form-item label="备注" style="height: 80px">
<el-input v-model="modalData.remark" style="width: 535px"></el-input>
</el-form-item>
</el-form>
</el-form>
<el-footer style="height:35px;margin-top: -25px;text-align:center">
<el-button type="primary" @click="saveData">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</el-footer>
</el-dialog>
<choose-list-eam ref="baseList" @getBaseData="getBaseData"></choose-list-eam>
</div>
</template>
<script>
import {partCostInformationSearch,partCostInformationEdit} from "@/api/part/partCostInformation";
import Chooselist from "../common/Chooselist.vue";
import {getSiteAndBuByUserName} from "../../../api/qc/qc";
import ChooseListEam from "../common/Chooselist_eam.vue";
export default {
components: {
ChooseListEam,
Chooselist
},
data() {
return {
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: '',
userName: this.$store.state.user.name,
partNo: '',
partDesc: '',
page: 1,
limit: 10
},
modalData: {
id: null,
partId: null,
bu: '',
site: this.$store.state.user.site,
buNo: '',
partNo: '',
partDesc: '',
umId: '',
umName: '',
familyId: '',
familyName: '',
otherGroup1: '',
otherGroupName1: '',
standardCost: '',
standardCostCurrency: '',
actualCost: '',
actualCostCurrency: '',
remark: '',
createBy: '',
createDate: '',
updateBy: '',
updateDate: ''
},
originalData: {},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1PartNo',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'partNo',
headerAlign: 'center',
align: 'center',
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1PartDesc',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1UmId',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'umId',
headerAlign: 'center',
align: 'center',
columnLabel: '计量单位',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1PartType',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'partType',
headerAlign: 'center',
align: 'center',
columnLabel: '零件类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1FamilyId',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'familyId',
headerAlign: 'center',
align: 'center',
columnLabel: '物料分类编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1FamilyName',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'familyName',
headerAlign: 'center',
align: 'center',
columnLabel: '物料分类描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1OtherGroup1',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'otherGroup1',
headerAlign: 'center',
align: 'center',
columnLabel: '产品组编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1OtherGroupName1',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'otherGroupName1',
headerAlign: 'center',
align: 'center',
columnLabel: '产品组描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1StandardCost',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'standardCost',
headerAlign: 'center',
align: 'right',
columnLabel: '单位标准成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1StandardCostCurrency',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'standardCostCurrency',
headerAlign: 'center',
align: 'center',
columnLabel: '标准成本币种',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1ActualCost',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'actualCost',
headerAlign: 'center',
align: 'right',
columnLabel: '单位实际成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1ActualCostCurrency',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'actualCostCurrency',
headerAlign: 'center',
align: 'center',
columnLabel: '实际成本币种',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1Remark',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1CreateDate',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1CreateBy',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1UpdateDate',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'updateDate',
headerAlign: 'center',
align: 'center',
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 6010011,
serialNumber: '6010011Table1UpdateBy',
tableId: '6010011Table1',
tableName: '物料成本表',
columnProp: 'updateBy',
headerAlign: 'center',
align: 'center',
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}
],
// ======== ========
authSearch: false,
authSave: false,
authUpdate: false,
authDelete: false,
modalFlag: false,
modalDisableFlag: false,
menuId: this.$route.meta.menuId,
tagNo:undefined,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
//
this.getButtonAuthData()
// site bu
this.getSiteAndBuByUserName()
//
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
if (!this.authSearch) {
//
this.getDataList()
}
},
methods: {
getBaseList(val){
this.tagNo = val
this.$nextTick(()=>{
let strVal = ''
if (val === 512) {
strVal = this.modalData.standardCostCurrency ? this.modalData.standardCostCurrency : ''
this.$refs.baseList.init(val, strVal)
}
if (val === 513) {
strVal = this.modalData.actualCostCurrency ? this.modalData.actualCostCurrency : ''
this.$refs.baseList.init(val, strVal)
}
})
},
getBaseData(val){
if (this.tagNo === 512){
this.modalData.standardCostCurrency = val.Currency
}
if (this.tagNo === 513){
this.modalData.actualCostCurrency = val.Currency
}
},
// bu
getSiteAndBuByUserName () {
let tempData = {
username: this.$store.state.user.name,
}
getSiteAndBuByUserName(tempData).then(({data}) => {
if (data.code === 0) {
this.userBuList = data.rows
}
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId+":search")
let saveFlag = this.isAuth(this.menuId+":save")
let updateFlag = this.isAuth(this.menuId+":update")
let deleteFlag = this.isAuth(this.menuId+":delete")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
},
// ======== ========
/**
* 获取数据列表
*/
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
partCostInformationSearch(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
//
if (this.totalPage > 0) {
//
this.$refs.mainTable.setCurrentRow(this.dataList[0])
}
}
})
},
updateModal (row) {
this.modalData = {
id: row.id,
partId: row.partId,
bu: row.bu,
site: row.site,
buNo: row.buNo,
partNo: row.partNo,
partDesc: row.partDesc,
umId: row.umId,
umName: row.umName,
familyId: row.familyId,
familyName: row.familyName,
otherGroup1: row.otherGroup1,
otherGroupName1: row.otherGroupName1,
standardCost: row.standardCost,
standardCostCurrency: row.standardCostCurrency,
actualCost: row.actualCost,
actualCostCurrency: row.actualCostCurrency,
remark: row.remark,
createBy: row.createBy,
createDate: row.createDate,
}
this.originalData = JSON.parse(JSON.stringify(this.modalData))
this.modalFlag = true
},
saveData () {
if (JSON.stringify(this.modalData) === JSON.stringify(this.originalData)) {
this.closeDialog()
return
}
let inData = {
id: this.modalData.id,
partId: this.modalData.partId,
bu: this.modalData.bu,
site: this.modalData.site,
buNo: this.modalData.buNo,
standardCost: this.modalData.standardCost,
standardCostCurrency: this.modalData.standardCostCurrency,
actualCost: this.modalData.actualCost,
actualCostCurrency: this.modalData.actualCostCurrency,
remark: this.modalData.remark,
updateBy: this.$store.state.user.name,
updateDate:''
}
this.$confirm('确定保存吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
partCostInformationEdit(inData).then(({data}) => {
if (data.code === 0) {
this.$message({
message: '保存成功',
type: 'success'
})
this.getDataList()
this.closeDialog()
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
})
})
},
closeDialog () {
this.modalData = {
flag: '',
title: '',
bu: '',
site: this.$store.state.user.site,
buNo: '',
partNo: '',
partDesc: '',
umId: '',
umName: '',
familyId: '',
familyName: '',
otherGroup1: '',
otherGroupName1: '',
standardCost: '',
standardCostCurrency: '',
actualCost: '',
actualCostCurrency: '',
remark: '',
}
this.modalFlag = false
},
}
}
</script>
<style scoped>
.numInput /deep/ .el-input__inner{
text-align: right;
}
/deep/ .inlineNumber input::-webkit-outer-spin-button,
/deep/ .inlineNumber input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
/deep/ .inlineNumber input[type="number"]{
-moz-appearance: textfield;
padding-right: 5px !important;
}
</style>
```

437
src/views/modules/part/partProductGroupInformation.vue

@ -75,11 +75,13 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="160"
width="230"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link> <el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link v-if="!authDelete" style="cursor: pointer" @click="delModal(scope.row)">删除</el-link> <el-link v-if="!authDelete" style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
<el-link v-if="scope.row.type === '1'" style="cursor: pointer" @click="stdProcessModal(scope.row)">标准工序</el-link>
<el-link v-if="scope.row.type === '1'" style="cursor: pointer" @click="delModal(scope.row)">ProcessTimeMatrix</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -138,6 +140,90 @@
<el-button type="primary" @click="modalFlag = false">关闭</el-button> <el-button type="primary" @click="modalFlag = false">关闭</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog :title="'商品组:' + productGroupCurrentRow.productGroupName + ' - 标准工序'" :close-on-click-modal="false" v-drag :visible.sync="stdProcessFlag" @close="closeStdProcessDialog" width="1200px">
<el-form :inline="true" label-position="top" :model="searchData1" @keyup.enter.native="searchProductGroupStdProcess">
<el-form-item :label="'工序号'">
<el-input v-model="searchData1.operationNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'工序名称'">
<el-input v-model="searchData1.operationName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="searchProductGroupStdProcess">查询</el-button>
<el-button type="primary" @click="addStdProcessModal">新增</el-button>
</el-form-item>
</el-form>
<el-table
:height="height - 200"
:data="stdProcessList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in stdProcessColumnList" :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="70"
label="操作">
<template slot-scope="scope">
<el-link v-if="!authDelete" style="cursor: pointer" @click="delProductGroupStdProcessModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<el-footer style="height:30px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="stdProcessFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="商品组 - 标准工序(新增)" :close-on-click-modal="false" v-drag :visible.sync="stdProcessFlag1" @close="closeStdProcess1Dialog" width="1100px">
<el-table
:height="height - 200"
:data="stdProcessList1"
border
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in stdProcessColumnList" :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>
<el-footer style="height:30px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveStdProcessData">确定</el-button>
<el-button type="primary" @click="stdProcessFlag1 = false">关闭</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>
@ -149,9 +235,11 @@ import {
productGroupInformationEdit, // productGroupInformationEdit, //
productGroupInformationDelete // productGroupInformationDelete //
} from '@/api/part/partProductGroupInformation.js' } from '@/api/part/partProductGroupInformation.js'
import {searchProductGroupStdProcess,saveStdProcessData,delProductGroupStdProcess} from '@/api/part/partProductGroupStdProcess.js'
import {getSiteAndBuByUserName} from "@/api/eam/eam.js" import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
import {searchStandardRoutingOperationList} from "../../../api/part/standardRoutingOperation";
export default { export default {
components: { components: {
Chooselist Chooselist
@ -179,6 +267,11 @@ export default {
exportFooter: [], exportFooter: [],
resultList: [], resultList: [],
userBuList: [], userBuList: [],
stdProcessList: [],
stdProcessList1: [],
productGroupCurrentRow: {},
//
stdProcessList1Selections: [],
// ======== ======== // ======== ========
height: 200, height: 200,
// ======== ======== // ======== ========
@ -194,6 +287,28 @@ export default {
productGroupName: '', productGroupName: '',
active: '', active: '',
type: '', type: '',
operationNo: '',
operationName: '',
page: 1,
limit: 10
},
searchData1: {
site: '',
userName: this.$store.state.user.name,
buNo: '',
productGroupId: '',
productGroupName: '',
active: '',
type: '',
operationNo: '',
operationName: '',
page: 1,
limit: 10
},
searchData2: {
site: '',
userName: this.$store.state.user.name,
buNo: '',
page: 1, page: 1,
limit: 10 limit: 10
}, },
@ -355,6 +470,204 @@ export default {
columnWidth: 100 columnWidth: 100
}, },
], ],
stdProcessColumnList: [
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1BuDesc',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'buDesc',
headerAlign: "center",
align: "center",
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1OperationNo',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'operationNo',
headerAlign: "center",
align: "left",
columnLabel: '工序号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1OperationName',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'operationName',
headerAlign: "center",
align: "left",
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
functionId: 6010012,
serialNumber: '6010012Table1WorkCenterNo',
tableId: '6010012Table1',
tableName: '标准工序表',
columnProp: 'workCenterNo',
headerAlign: 'center',
align: 'center',
columnLabel: '加工中心编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
functionId: 6010012,
serialNumber: '6010012Table1WorkCenterDesc',
tableId: '6010012Table1',
tableName: '标准工序表',
columnProp: 'workCenterDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '加工中心名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1LaborClassDesc',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'laborClassDesc',
headerAlign: "center",
align: "center",
columnLabel: '人员等级',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1SetupLaborClassDesc',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'setupLaborClassDesc',
headerAlign: "center",
align: "center",
columnLabel: '调机时人员等级',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1CreateDate',
tableId: '6010012Table1',
tableName: '标准工序表',
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,
functionId: 6010012,
serialNumber: '6010012Table1CreateBy',
tableId: "6010012Table1",
tableName: "标准工序表",
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,
functionId: 6010012,
serialNumber: '6010012Table1UpdateDate',
tableId: "6010012Table1",
tableName: "标准工序表",
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,
functionId: 6010012,
serialNumber: '6010012Table1UpdateBy',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules: { rules: {
bu: [ bu: [
{ {
@ -398,6 +711,8 @@ export default {
authUpdate: false, authUpdate: false,
authDelete: false, authDelete: false,
modalFlag: false, modalFlag: false,
stdProcessFlag: false,
stdProcessFlag1: false,
modalDisableFlag: false, modalDisableFlag: false,
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
} }
@ -621,6 +936,126 @@ export default {
}) })
}, },
stdProcessModal (row) {
this.productGroupCurrentRow = JSON.parse(JSON.stringify(row));
this.searchProductGroupStdProcess()
this.stdProcessFlag = true
},
addStdProcessModal () {
this.searchData2.limit = -1
this.searchData2.page = 1
this.searchData2.buNo = this.productGroupCurrentRow.buNo
this.searchData2.site = this.productGroupCurrentRow.site
searchStandardRoutingOperationList(this.searchData2).then(({data}) => {
if (data.code === 0) {
let operationIds = []
this.stdProcessList.forEach((item) => {
operationIds.push(item.operationId)
})
data.page.list.forEach((item) => {
if (!operationIds.includes(item.id)) {
this.stdProcessList1.push(item)
}
})
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
})
this.stdProcessFlag1 = true
},
closeStdProcessDialog () {
this.searchData1 = {
site: '',
userName: this.$store.state.user.name,
buDesc: '',
productGroupId: '',
productGroupName: '',
active: '',
type: '',
operationNo: '',
operationName: '',
page: 1,
limit: 10
}
this.stdProcessList = []
},
closeStdProcess1Dialog () {
this.stdProcessList1 = []
},
//
selectionChangeHandle (val) {
this.stdProcessList1Selections = val
},
searchProductGroupStdProcess () {
this.productGroupCurrentRow.userName = this.$store.state.user.name
this.productGroupCurrentRow.operationNo = this.searchData1.operationNo
this.productGroupCurrentRow.operationName = this.searchData1.operationName
searchProductGroupStdProcess(this.productGroupCurrentRow).then(({data}) => {
if (data.code === 0) {
this.stdProcessList = data.rows
}
})
},
saveStdProcessData () {
if (this.stdProcessList1Selections.length === 0) {
this.$message.warning('请选择工序!')
return
}
let tempData = {
productGroupId: this.productGroupCurrentRow.productGroupId,
stdProcessAddList: this.stdProcessList1Selections,
createBy: this.$store.state.user.name
}
saveStdProcessData(tempData).then(({data}) => {
if (data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.searchProductGroupStdProcess()
this.stdProcessFlag1 = false
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
delProductGroupStdProcessModal (row) {
this.$confirm(`是否删除这条标准工序信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delProductGroupStdProcess(row).then(({data}) => {
if (data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.searchProductGroupStdProcess()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// //
async getTableUserColumn(tableId, columnId) { async getTableUserColumn(tableId, columnId) {
let queryTableUser = { let queryTableUser = {

893
src/views/modules/part/standardRoutingOperation.vue

@ -0,0 +1,893 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
<el-form-item :label="'BU'">
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 130px">
<el-option
v-for = "i in userBuList"
:key = "i.buNo"
:label = "i.buDesc"
:value = "i.buNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'工序号'">
<el-input v-model="searchData.operationNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'工序名称'">
<el-input v-model="searchData.operationName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button v-if="!authSearch" @click="getDataList">查询</el-button>
<el-button v-if="!authSave" 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
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 v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link>
<el-link v-if="!authDelete" style="cursor: pointer" @click="delModal(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="577px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="工序号" prop="operationNo" :rules="rules.operationNo">
<el-input v-model="modalData.operationNo" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="工序名称" prop="operationName" :rules="rules.operationName">
<el-input v-model="modalData.operationName" style="width: 302px"></el-input>
</el-form-item>
<el-form-item label="BU" prop="bu" :rules="rules.bu">
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 70px">
<el-option
v-for = "i in userBuList"
:key = "i.buNo"
:label = "i.buDesc"
:value = "i.buNo">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item prop="workCenterNo">
<span style="cursor: pointer" slot="label" @click="getBaseList(216)"><a herf="#">加工中心编码</a></span>
<el-input v-model="modalData.workCenterNo" @blur="workCenterBlur(216)" style="width: 140px"></el-input>
</el-form-item>
<el-form-item :label="'加工中心名称'" prop="workCenterDesc" :rules="rules.workCenterDesc">
<el-input v-model="modalData.workCenterDesc" disabled 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 prop="laborClassNo" :rules="rules.laborClassNo">
<span style="cursor: pointer" slot="label" @click="getBaseList(217, 1)"><a herf="#">人员等级编码</a></span>
<el-input v-model="modalData.laborClassNo" @blur="laborClassBlur(217)" style="width: 140px"></el-input>
</el-form-item>
<el-form-item :label="'人员等级'" prop="laborClassDesc" :rules="rules.laborClassDesc">
<el-input v-model="modalData.laborClassDesc" disabled 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 prop="setupLaborClassNo" :rules="rules.setupLaborClassNo">
<span style="cursor: pointer" slot="label" @click="getBaseList(217, 2)"><a herf="#">调机时人员等级编码</a></span>
<el-input v-model="modalData.setupLaborClassNo" @blur="setupLaborClassBlur(217)" style="width: 140px"></el-input>
</el-form-item>
<el-form-item :label="'调机时人员等级'" prop="setupLaborClassDesc" :rules="rules.setupLaborClassDesc">
<el-input v-model="modalData.setupLaborClassDesc" disabled style="width: 302px"></el-input>
</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 {
searchStandardRoutingOperationList, //
saveStandardRoutingOperation, //
updateStandardRoutingOperation, //
deleteStandardRoutingOperation //
} from '@/api/part/standardRoutingOperation.js'
import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import {verifyData} from "../../../api/part/partInformation";
import ChooseList from '@/views/modules/common/Chooselist_eam'
export default {
//
components: {
ChooseList
},
data () {
return {
//
exportData: [],
exportName: '物料分类' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['物料分类'],
exportFooter: [],
resultList: [],
userBuList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
//
searchData: {
site: '',
userName: this.$store.state.user.name,
buNo: '',
operationNo: '',
operationName: '',
page: 1,
limit: 10
},
modalData: {
flag: '',
title: '',
bu: '',
site: this.$store.state.user.site,
buNo: '',
operationNo: '',
operationName: '',
workCenterNo: '',
workCenterDesc: '',
laborClassNo: '',
laborClassDesc: '',
setupLaborClassNo: '',
setupLaborClassDesc: '',
},
// ======== ========
dataList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1BuDesc',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'buDesc',
headerAlign: "center",
align: "center",
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1OperationNo',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'operationNo',
headerAlign: "center",
align: "left",
columnLabel: '工序号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1OperationName',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'operationName',
headerAlign: "center",
align: "left",
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
functionId: 6010012,
serialNumber: '6010012Table1WorkCenterNo',
tableId: '6010012Table1',
tableName: '标准工序表',
columnProp: 'workCenterNo',
headerAlign: 'center',
align: 'center',
columnLabel: '加工中心编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
functionId: 6010012,
serialNumber: '6010012Table1WorkCenterDesc',
tableId: '6010012Table1',
tableName: '标准工序表',
columnProp: 'workCenterDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '加工中心名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1LaborClassDesc',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'laborClassDesc',
headerAlign: "center",
align: "center",
columnLabel: '人员等级',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1SetupLaborClassDesc',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'setupLaborClassDesc',
headerAlign: "center",
align: "center",
columnLabel: '调机时人员等级',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6010012,
serialNumber: '6010012Table1CreateDate',
tableId: '6010012Table1',
tableName: '标准工序表',
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,
functionId: 6010012,
serialNumber: '6010012Table1CreateBy',
tableId: "6010012Table1",
tableName: "标准工序表",
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,
functionId: 6010012,
serialNumber: '6010012Table1UpdateDate',
tableId: "6010012Table1",
tableName: "标准工序表",
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,
functionId: 6010012,
serialNumber: '6010012Table1UpdateBy',
tableId: "6010012Table1",
tableName: "标准工序表",
columnProp: 'updateBy',
headerAlign: "center",
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
rules: {
bu: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
operationNo: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
operationName: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
workCenterNo: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
workCenterDesc: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
laborClassNo: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
laborClassDesc: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
setupLaborClassNo: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
setupLaborClassDesc: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
},
// ======== ========
authSearch: false,
authSave: false,
authUpdate: false,
authDelete: false,
modalFlag: false,
modalDisableFlag: false,
menuId: this.$route.meta.menuId,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
//
this.getButtonAuthData()
// site bu
this.getSiteAndBuByUserName()
//
this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
if (!this.authSearch) {
//
this.getDataList()
}
},
methods: {
// bu
getSiteAndBuByUserName () {
let tempData = {
username: this.$store.state.user.name,
}
getSiteAndBuByUserName(tempData).then(({data}) => {
if (data.code === 0) {
this.userBuList = data.rows
}
})
},
//
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 searchStandardRoutingOperationList(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
},
// ======== chooseList ========
/**
* 获取基础数据列表S
* @param val
* @param type
*/
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
if (val === 217) {
if(type === 1) {
strVal = this.modalData.laborClassNo
} else if (type === 2) {
strVal = this.modalData.setupLaborClassNo
}
}
if (val === 216) {
strVal = this.modalData.workCenterNo
}
this.$refs.baseList.init(val, strVal)
})
},
/**
* 列表方法的回调
* @param val
*/
getBaseData (val) {
if (this.tagNo === 217) {
if (this.tagNo1 === 1) {
this.modalData.laborClassNo = val.class_no
this.modalData.laborClassDesc = val.class_desc
} else if (this.tagNo1 === 2) {
this.modalData.setupLaborClassNo = val.class_no
this.modalData.setupLaborClassDesc = val.class_desc
}
}
if (this.tagNo === 216) {
this.modalData.workCenterNo = val.work_center_no
this.modalData.workCenterDesc = val.work_center_desc
}
},
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchStandardRoutingOperationList(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
}
})
},
addModal () {
this.modalData = {
flag: '1',
title: '标准工序新增',
bu: this.userBuList[0].buNo,
buNo: '',
site: '',
operationNo: '',
operationName: '',
workCenterNo: '',
workCenterDesc: '',
laborClassNo: '',
laborClassDesc: '',
setupLaborClassNo: '',
setupLaborClassDesc: '',
createBy: this.$store.state.user.name,
}
this.modalDisableFlag = false
this.modalFlag = true
},
/**
* 分类信息编辑模态框
* @param row
*/
updateModal (row) {
this.modalData = {
flag: '2',
title: '标准工序编辑',
site: row.site,
bu: row.site + '_' + row.buNo,
buNo: row.buNo,
operationNo: row.operationNo,
operationName: row.operationName,
workCenterNo: row.workCenterNo,
updateBy: this.$store.state.user.name,
}
this.modalDisableFlag = true
this.modalFlag = true
},
// ======== // ========
/**
* 分类信息新增/编辑
*/
saveData () {
if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!')
return
}
if (this.modalData.operationNo === '' || this.modalData.operationNo == null) {
this.$message.warning('请填写工序号!')
return
}
if (this.modalData.operationName === '' || this.modalData.operationName == null) {
this.$message.warning('请填写工序名称!')
return
}
if (this.modalData.workCenterNo === '' || this.modalData.workCenterNo == null) {
this.$message.warning('请填写加工中心编码!')
return
}
if (this.modalData.workCenterDesc === '' || this.modalData.workCenterDesc == null) {
this.$message.warning('请填写加工中心名称!')
return
}
if (this.modalData.laborClassNo === '' || this.modalData.laborClassNo == null) {
this.$message.warning('请填写人员等级编码!')
return
}
if (this.modalData.laborClassDesc === '' || this.modalData.laborClassDesc == null) {
this.$message.warning('请填写人员等级!')
return
}
if (this.modalData.setupLaborClassNo === '' || this.modalData.setupLaborClassNo == null) {
this.$message.warning('请填写调机时人员等级编码!')
return
}
if (this.modalData.setupLaborClassDesc === '' || this.modalData.setupLaborClassDesc == null) {
this.$message.warning('请填写调机时人员等级!')
return
}
if (this.modalData.flag === '1') {
saveStandardRoutingOperation(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 {
updateStandardRoutingOperation(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(() => {
deleteStandardRoutingOperation(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(() => {
})
},
//
workCenterBlur (tagNo) {
if (this.modalData.workCenterNo != null && this.modalData.workCenterNo !== '') {
let tempData = {
tagno: tagNo,
conditionSql: " and work_center_no = '" + this.modalData.workCenterNo + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'"
}
verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.workCenterNo = data.baseListData[0].work_center_no
this.modalData.workCenterDesc = data.baseListData[0].work_center_desc
} else {
this.$message.warning('该加工中心不存在!')
this.modalData.workCenterDesc = ''
}
} else {
this.$message.warning(data.msg)
this.modalData.workCenterDesc = ''
}
})
}
},
//
setupLaborClassBlur (tagNo) {
if (this.modalData.setupLaborClassNo != null && this.modalData.setupLaborClassNo !== '') {
let tempData = {
tagno: tagNo,
conditionSql: " and class_no = '" + this.modalData.setupLaborClassNo + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'"
}
verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.setupLaborClassNo = data.baseListData[0].class_no
this.modalData.setupLaborClassDesc = data.baseListData[0].class_desc
} else {
this.$message.warning('该人员等级不存在!')
this.modalData.setupLaborClassDesc = ''
}
} else {
this.$message.warning(data.msg)
this.modalData.setupLaborClassDesc = ''
}
})
}
},
//
laborClassBlur (tagNo) {
if (this.modalData.laborClassNo != null && this.modalData.laborClassNo !== '') {
let tempData = {
tagno: tagNo,
conditionSql: " and class_no = '" + this.modalData.laborClassNo + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'"
}
verifyData(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.baseListData.length > 0) {
this.modalData.laborClassNo = data.baseListData[0].class_no
this.modalData.laborClassDesc = data.baseListData[0].class_desc
} else {
this.$message.warning('该人员等级不存在!')
this.modalData.laborClassDesc = ''
}
} else {
this.$message.warning(data.msg)
this.modalData.laborClassDesc = ''
}
})
}
},
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList (tableId, columnId) {
let queryTable= {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length === 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
}
}
})
},
//
getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId+":search")
let saveFlag = this.isAuth(this.menuId+":save")
let updateFlag = this.isAuth(this.menuId+":update")
let deleteFlag = this.isAuth(this.menuId+":delete")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
},
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
height: 459px;
}
</style>
Loading…
Cancel
Save