|
|
<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: 200px"></el-input> </el-form-item> <el-form-item :label="'工艺类型'"> <el-select v-model="searchData.routingType" clearable style="width: 120px"> <el-option label="Manufacturing" value="Manufacturing"></el-option> <el-option label="Repair" value="Repair"></el-option> <el-option label="Prototype" value="Prototype"></el-option> </el-select> </el-form-item> <el-form-item :label="'Routing版本号'"> <el-input-number :controls="false" :step="0" v-model="searchData.routingRevision" style="width: 100px"></el-input-number> </el-form-item> <el-form-item :label="'替代编码'"> <el-input v-model="searchData.alternativeNo" style="width: 100px"></el-input> </el-form-item> <el-form-item :label="'替代名称'"> <el-input v-model="searchData.alternativeDescription" style="width: 150px"></el-input> </el-form-item> <el-form-item :label="'工序编码'"> <el-input v-model="searchData.operationNo" style="width: 100px"></el-input> </el-form-item> <el-form-item :label="'工序名称'"> <el-input v-model="searchData.operationName" style="width: 150px"></el-input> </el-form-item> <el-form-item :label="' '"> <el-button :loading="queryLoading" @click="getDataList()">查询</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>
<!-- bom列表 --> <el-table :height="height" :data="dataList" border ref="routingAlternativeTable" @row-click="alternativeClickRow" @current-change="changeCurrentRow" 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>
<!-- 分页插件 --> <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-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab"> <!-- Graphical Structure页签 --> <el-tab-pane label="Work Guidelines" name="WorkGuidelines"> <el-form label-position="top" style="margin-top: 0px"><!-- <el-form-item>--> <el-button type="primary" @click="saveWorkGuidelineModal()" style="margin-left: 2px">新增</el-button> <el-button type="primary" @click="deleteModal()">删除</el-button><!-- </el-form-item>--> </el-form> <el-table :height="secondHeight-68" :data="workGuidelineList" border @selection-change="selectionWorkGuideline" style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50"> </el-table-column> <el-table-column v-for="(item,index) in workGuidelineColumnList" :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="100" label="操作"> <template slot-scope="scope"> <a type="text" size="small" @click="updateWorkGuidelineModal(scope.row)">编辑</a> </template> </el-table-column> </el-table> </el-tab-pane> </el-tabs>
<!-- workGuideline 新增模态框 --> <el-dialog title="替代" :close-on-click-modal="false" v-drag :visible.sync="workGuidelineModal" width="664px"> <el-form :inline="true" label-position="top" :model="workGuidelineData" :rules="guidelineRules" style="margin-left: 5px"> <el-form-item :label="'序号'" prop="guidelineSeq" :rules="guidelineRules.guidelineSeq"> <el-input-number :controls="false" :step="0" v-model="workGuidelineData.guidelineSeq" style="width: 60px"></el-input-number> </el-form-item> <el-form-item :label="'工艺指导名称'" prop="guidelineDesc" :rules="guidelineRules.guidelineDesc"> <el-input v-model="workGuidelineData.guidelineDesc" style="width: 126px"></el-input> </el-form-item> <el-form-item :label="'工艺指导描述'"> <el-input v-model="workGuidelineData.guidelineText" style="width: 413px"></el-input> </el-form-item> </el-form> <el-form :inline="true" label-position="top" :model="workGuidelineData" :rules="guidelineRules" style="margin-left: 5px"> <el-form-item :label="'工艺指导类型'" prop="guidelineType" :rules="guidelineRules.guidelineType"> <el-select v-model="workGuidelineData.guidelineType" style="width: 200px"> <el-option label="Subtask" value="Subtask"></el-option> <el-option label="Instruction" value="Instruction"></el-option> </el-select> </el-form-item> <el-form-item :label="'签字'" prop="signOffRequired" :rules="guidelineRules.signOffRequired"> <el-select v-model="workGuidelineData.signOffRequired" style="width: 200px"> <el-option label="Required to Close Operation" value="Required to Close Operation"></el-option> <el-option label="Not Required" value="Not Required"></el-option> </el-select> </el-form-item> <el-form-item :label="'检验签字'" prop="inspectionSignOffRequired" :rules="guidelineRules.inspectionSignOffRequired"> <el-select v-model="workGuidelineData.inspectionSignOffRequired" style="width: 200px"> <el-option label="Required to Shop Order" value="Required to Shop Order"></el-option> <el-option label="Required to Close Operation" value="Required to Close Operation"></el-option> <el-option label="Not Required" value="Not Required"></el-option> </el-select> </el-form-item> </el-form> <el-footer style="height:35px;margin-top:25px;text-align:center"> <el-button type="primary" @click="workGuidelineCommit()">保存</el-button> <el-button type="primary" @click="workGuidelineModal = false">关闭</el-button> </el-footer> </el-dialog>
<!-- chooseList模态框 --> <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> </div></template>
<script>import { routingSearchAlternative, // routing 替代列表查询
getRoutingWorkGuideline, // 获取 workGuideline
getGuidelineSeq, // 获取 guidelineSeq
workGuidelineSave, // 新增 workGuideline
workGuidelineEdit, // 编辑 workGuideline
deleteWorkGuideline, // 删除 workGuideline
} from '@/api/part/routingOperationWorkGuidelines.js'import ChooseList from '@/views/modules/common/Chooselist'
export default { // 组件
components: { ChooseList }, // 监听
watch: { searchData: { deep: true, handler: function (newV, oldV) { this.searchData.partNo = this.searchData.partNo.toUpperCase() } } }, // 对象
data () { return { // 导出
exportData: [], exportName: 'bom查询' + this.dayjs().format('YYYYMMDDHHmmss'), exportHeader: ['bom查询'], exportFooter: [], resultList: [], // ======== 行高 ========
height: 200, secondHeight: 200, leftWidth: 300, rightWidth: '', // ======== 分页 ========
pageIndex: 1, pageSize: 50, totalPage: 0, // 条件查询
searchData: { site: this.$store.state.user.site, partNo: '', partDesc: '', routingType: '', routingRevision: '', alternativeNo: '', alternativeDescription: '', operationNo: '', operationName: '', page: 1, limit: 10 }, // loading
queryLoading: false, // 初始页签
activeTable: 'WorkGuidelines', // ======== 数据对象 ========
alternativeData: { site: '', partNo: '', partDesc: '', bomType: '', engChgLevel: '', alternativeNo: '', alternativeDescription: '', minLotQty: '', noteText: '', status: '', }, workGuidelineData: { flag: '', id: '', site: this.$store.state.user.site, partNo: '', partDesc: '', routingRevision: '', routingType: '', alternativeNo: '', alternativeDescription: '', operationNo: '', operationName: '', guidelineSeq: '', guidelineDesc: '', guidelineText: '', guidelineType: '', signOffRequired: '', inspectionSignOffRequired: '', createBy: '', updateBy: '' }, // ======== 选中的当前行数据 ========
alternativeCurrentRow: {}, // ======== 数据列表 ========
dataList: [], workGuidelineList: [], // ======== 列表表头 ========
columnList: [ { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1PartNo', tableId: '104010Table1', tableName: 'Routing表', 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: 104010, serialNumber: '104010Table1PartDesc', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'partDesc', 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: 104010, serialNumber: '104010Table1RoutingType', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'routingType', 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: 104010, serialNumber: '104010Table1RoutingRevision', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'routingRevision', headerAlign: 'center', align: 'center', columnLabel: 'Routing版本号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1AlternativeNo', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'alternativeNo', 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: 104010, serialNumber: '104010Table1AlternativeDescription', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'alternativeDescription', 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: 104010, serialNumber: '104010Table1OperationNo', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'operationNo', 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: 104010, serialNumber: '104010Table1OperationName', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'operationName', 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: 104010, serialNumber: '104010Table1MachineNo', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'machineNo', 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: 104010, serialNumber: '104010Table1WorkCenterNo', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'workCenterNo', 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: 104010, serialNumber: '104010Table1MachRunFactor', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'machRunFactor', headerAlign: 'center', align: 'right', columnLabel: '机器运行速度', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1LaborSetupTime', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'laborSetupTime', headerAlign: 'center', align: 'right', columnLabel: '人工生产速度', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1MachSetupTime', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'machSetupTime', headerAlign: 'center', align: 'right', columnLabel: '调机时长', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1RunTimeCode', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'runTimeCode', 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: 104010, serialNumber: '104010Table1SetupCrewSize', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'setupCrewSize', headerAlign: 'center', align: 'right', columnLabel: '调机过程中人数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1CrewSize', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'crewSize', headerAlign: 'center', align: 'right', columnLabel: '生产过程中人数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1EfficiencyFactor', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'efficiencyFactor', headerAlign: 'center', align: 'right', columnLabel: '机器效率', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1LaborRunFactor', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'laborRunFactor', headerAlign: 'center', align: 'right', columnLabel: '人工效率', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1LaborClassNo', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'laborClassNo', 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: 104010, serialNumber: '104010Table1SetupLaborClassNo', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'setupLaborClassNo', 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: 104010, serialNumber: '104010Table1OutsideOpItem', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'outsideOpItem', 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: 104010, serialNumber: '104010Table1CreateDate', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'createDate', headerAlign: 'center', align: 'center', columnLabel: '创建时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 130 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1CreateBy', tableId: '104010Table1', tableName: 'Routing表', 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: 104010, serialNumber: '104010Table1UpdateDate', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', columnLabel: '更新时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 130 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table1UpdateBy', tableId: '104010Table1', tableName: 'Routing表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', columnLabel: '更新人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 } ], workGuidelineColumnList: [ { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table2GuidelineSeq', tableId: '104010Table2', tableName: 'workGuideline表', columnProp: 'guidelineSeq', headerAlign: 'center', align: 'right', columnLabel: '序号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 60 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table2GuidelineDesc', tableId: '104010Table2', tableName: 'workGuideline表', columnProp: 'guidelineDesc', 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: 104010, serialNumber: '104010Table2GuidelineText', tableId: '104010Table2', tableName: 'workGuideline表', columnProp: 'guidelineText', 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: 104010, serialNumber: '104010Table2GuidelineType', tableId: '104010Table2', tableName: 'workGuideline表', columnProp: 'guidelineType', 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: 104010, serialNumber: '104010Table2SignOffRequired', tableId: '104010Table2', tableName: 'workGuideline表', columnProp: 'signOffRequired', 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: 104010, serialNumber: '104010Table2InspectionSignOffRequired', tableId: '104010Table2', tableName: 'workGuideline表', columnProp: 'inspectionSignOffRequired', 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: 104010, serialNumber: '104010Table2CreateDate', tableId: '104010Table2', tableName: 'BOM信息表', columnProp: 'createDate', headerAlign: 'center', align: 'center', columnLabel: '创建时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 130 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table2CreateBy', tableId: '104010Table2', tableName: 'BOM信息表', 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: 104010, serialNumber: '104010Table2UpdateDate', tableId: '104010Table2', tableName: 'BOM信息表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', columnLabel: '更新时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 130 }, { userId: this.$store.state.user.name, functionId: 104010, serialNumber: '104010Table2UpdateBy', tableId: '104010Table2', tableName: 'BOM信息表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', columnLabel: '更新人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 } ], // ======== 必填规则 ========
guidelineRules: { guidelineSeq: [ { required: true, message: ' ', trigger: 'change' } ], guidelineDesc: [ { required: true, message: ' ', trigger: 'change' } ], guidelineType: [ { required: true, message: ' ', trigger: 'change' } ], signOffRequired: [ { required: true, message: ' ', trigger: 'change' } ], inspectionSignOffRequired: [ { required: true, message: ' ', trigger: 'change' } ] }, // ======== 复选数据集 ========
workGuidelineSelections: [], // ======== 模态框开关控制 ========
workGuidelineModal: false, workGuidelineDisableModal: false } },
mounted () { this.$nextTick(() => { this.height = window.innerHeight / 2 - 240 /*第二个表格高度的动态调整*/ this.secondHeight = window.innerHeight - this.height - 175 this.rightWidth = window.innerWidth - this.leftWidth - 275 }) },
created () { this.getDataList() }, // js
methods: { // ======== 分页相关方法 ========
/** * 每页数 * @param val */ sizeChangeHandle (val) { this.pageSize = val this.pageIndex = 1 this.getDataList() },
/** * 当前页 * @param val */ currentChangeHandle (val) { this.pageIndex = val this.getDataList() },
// ======== 列表数据操作方法 ========
/** * 获取数据列表 */ getDataList () { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex this.queryLoading = true routingSearchAlternative(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.dataList.length > 0) { // 设置选中行
this.$refs.routingAlternativeTable.setCurrentRow(this.dataList[0]) this.alternativeClickRow(this.dataList[0]) } else { this.alternativeCurrentRow = {} } // 加载当前的页签的table
this.refreshCurrentTabTable() } this.queryLoading = false }) },
/** * 获取 workGuideline */ getRoutingWorkGuideline () { getRoutingWorkGuideline(this.alternativeCurrentRow).then(({data}) => { if (data && data.code === 0) { this.workGuidelineList = data.rows } else { this.workGuidelineList = [] } }) },
/** * 单机选中信息 * @param row */ alternativeClickRow (row) { this.$refs.routingAlternativeTable.toggleRowSelection(row) this.alternativeCurrentRow = JSON.parse(JSON.stringify(row)) },
/** * 复选列表信息 * @param val */ selectionWorkGuideline (val) { this.workGuidelineSelections = val },
// ======== 新增/编辑模态框 ========
/** * workGuideline 新增模态框 */ saveWorkGuidelineModal () { this.workGuidelineData = { flag: '1', id: '', site: this.$store.state.user.site, partNo: this.alternativeCurrentRow.partNo, partDesc: this.alternativeCurrentRow.partDesc, routingRevision: this.alternativeCurrentRow.routingRevision, routingType: this.alternativeCurrentRow.routingType, alternativeNo: this.alternativeCurrentRow.alternativeNo, alternativeDescription: this.alternativeCurrentRow.alternativeDescription, operationNo: this.alternativeCurrentRow.operationNo, operationName: this.alternativeCurrentRow.operationName, guidelineSeq: '', guidelineDesc: '', guidelineText: '', guidelineType: '', signOffRequired: '', inspectionSignOffRequired: '', createBy: this.$store.state.user.name, updateBy: '' } // 查询seq
getGuidelineSeq(this.alternativeCurrentRow).then(({data}) => { if (data && data.code === 0) { this.workGuidelineData.guidelineSeq = data.guidelineSeq } }) // 开启模态框
this.workGuidelineModal = true this.workGuidelineDisableModal = false },
/** * workGuideline 编辑模态框 */ updateWorkGuidelineModal (row) { this.workGuidelineData = { flag: '2', id: row.id, site: row.site, partNo: row.partNo, partDesc: row.partDesc, routingRevision: row.routingRevision, routingType: row.routingType, alternativeNo: row.alternativeNo, alternativeDescription: row.alternativeDescription, operationNo: row.operationNo, operationName: row.operationName, guidelineSeq: row.guidelineSeq, guidelineDesc: row.guidelineDesc, guidelineText: row.guidelineText, guidelineType: row.guidelineType, signOffRequired: row.signOffRequired, inspectionSignOffRequired: row.inspectionSignOffRequired, createBy: '', updateBy: this.$store.state.user.name } // 开启模态框
this.workGuidelineModal = true this.workGuidelineDisableModal = true },
// ======== 新增/编辑/删除方法 ========
/** * workGuideline 新增方法 */ workGuidelineCommit () { if (this.workGuidelineData.guidelineSeq === '' || this.workGuidelineData.guidelineSeq == null) { this.$message.warning('请输入序号!') return } if (this.workGuidelineData.guidelineDesc === '' || this.workGuidelineData.guidelineDesc == null) { this.$message.warning('请输入工艺指导名称!') return } if (this.workGuidelineData.guidelineType === '' || this.workGuidelineData.guidelineType == null) { this.$message.warning('请选择工艺指导类型!') return } if (this.workGuidelineData.signOffRequired === '' || this.workGuidelineData.signOffRequired == null) { this.$message.warning('请选择签字!') return } if (this.workGuidelineData.inspectionSignOffRequired === '' || this.workGuidelineData.inspectionSignOffRequired == null) { this.$message.warning('请选择检验签字!') return } if (this.workGuidelineData.flag === '1') { workGuidelineSave(this.workGuidelineData).then(({data}) => { if (data && data.code === 0) { this.getRoutingWorkGuideline() this.workGuidelineModal = false this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) } else { workGuidelineEdit(this.workGuidelineData).then(({data}) => { if (data && data.code === 0) { this.getRoutingWorkGuideline() this.workGuidelineModal = false this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) } },
/** * 删除 workGuideline */ deleteModal () { if(this.workGuidelineSelections.length === 0){ this.$message.warning('请勾选要删除的工艺指导!') return } this.$confirm(`是否删除这 `+ this.workGuidelineSelections.length +` 条工艺指导?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let tempData = { informationList: this.workGuidelineSelections } deleteWorkGuideline(tempData).then(({data}) => { if (data && data.code === 0) { this.getDataList() this.workGuidelineSelections = [] this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }).catch(() => { }) },
// ======== 页签切换相关方法 ========
/** * 列表表格选择替换 * @param tab * @param event */ tabClick (tab, event) { // 刷新列表数据
this.refreshCurrentTabTable() },
/** * 当前值发生变化的时候修改 * @param row * @param oldRow */ changeCurrentRow (row, oldRow) { // 判断是否是获取焦点的事件
if (row) { this.alternativeCurrentRow = JSON.parse(JSON.stringify(row)) //刷新当前页表
this.refreshCurrentTabTable() } },
/** * 刷新页签的table数据 */ refreshCurrentTabTable () { if (this.activeTable === 'WorkGuidelines') { // 获取workGuideline
this.getRoutingWorkGuideline() } },
// ======== chooseList相关方法 ========
/** * 获取基础数据列表S * @param val * @param type */ getBaseList (val, type) { this.tagNo = val this.$nextTick(() => { let strVal = '' if (val === 117) { strVal = this.componentData.issueToLoc } this.$refs.baseList.init(val, strVal) }) }, /** * 列表方法的回调 * @param val */ getBaseData (val) { if (this.tagNo === 117) { this.componentData.issueToLoc = val.location_id this.componentData.issueToLocName = val.location_name } },
// ======== 导出相关方法 ========
/** * 导出excel */ async createExportData () { this.searchData.limit = -1 this.searchData.page = 1 await routingSearchAlternative(this.searchData).then(({data}) => { this.resultList = data.page.list }) return this.resultList }, 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 }, /** * 未知 * @returns {boolean} */ selectFlag () { return true }, }}</script>
<style scoped lang="scss">.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;}/deep/ .el-tabs--border-card>.el-tabs__content{ padding: 5px;}</style>
|