|
|
<template> <div class="customer-css"> <!-- 菜单按钮区域 --> <fieldset class="customer-field" style="width: 675px; padding: 0.35em 0.75em 0.425em;"> <!-- 查询产品 --> <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;"> <el-form-item label="工站:"> <el-select v-model="searchData.itemNo"> <el-option value="-1" label="全部"></el-option> <el-option value="10" label="模切工站"></el-option> <el-option value="20" label="FQC工站"></el-option> </el-select> </el-form-item> <el-form-item label="工单号:"> <el-input v-model="searchData.orderNo" style="width: 120px" @keyup.enter.native="refreshPageTables"></el-input> </el-form-item> <el-form-item :label="' '" > <el-button type="primary" @click="refreshPageTables()" class="customer-bun-mid" style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.searchButton }} </el-button> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="dieCuttingReportModal" class="customer-bun-mid" :disabled="reportButton.dieCuttingButton" style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.dieCuttingButton }} </el-button> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="switchOperatorModal(1)" class="customer-bun-mid" :disabled="reportButton.fqcReportButton" style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.fqcReportButton }} </el-button> </el-form-item> </el-form> </fieldset>
<!-- 工单主表信息 --> <el-main style="margin-left: -20px; margin-top: -20px; width: 104%;"> <el-table @row-click="setCurrentRow" :height="height" highlight-current-row :data="produceScheduleList" 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> </el-main>
<!--列表的组件--> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 动态列 --> <column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column> <!-- 正常报工的组件 --> <comDieCuttingReport :close-on-click-modal="false" ref="comDieCuttingReport"> </comDieCuttingReport>
</div></template>
<script>
import { getProduceScheduleList, reportCheck, getUserSpecialSecurity, closeOrOpenProduceOrder, pauseOrOpenProduceOrder, costRollUpProduceOrder, manualProduceOrder, repairSOFlagProduceOrder, workbenchCancelallops, getShopOrder, getScheduleMultiReportSpecialAuth,/* 获取派工单的特殊权限 */} from '@/api/scheduleReport/produce_order.js'
/* 动态表头 */import { saveTableDefaultList, getTableDefaultListLanguage, getTableUserListLanguage, removerDefault, removerUser} from '@/api/table.js'
/* 引入组件 */import Chooselist from '@/views/modules/common/Chooselist'/* 列表组件 */import column from '@/views/modules/common/column'import comDieCuttingReport from './com_die_cutting_report' /* 模切报工的组件 */
var functionId = '600001';
export default { data() { return { height: 800, authEdit: false, authAdd: false, authDelete: false, menuId: this.$route.meta.menuId, menuShow: false, showOperatorFlag: false, showReportFlag: false, showSplitReportFlag: false, showDefault: false, visible: false, fqcShowReportFlag: false, reworkShowReportFlag: false, fqcRollShowReportFlag: false, showFinishScheduleFlag: false, changePackagingFlag: false, showPartStockFlag: false, searchData: { site: this.$store.state.user.site, itemNo: '', orderNo: '', status: 1, username: this.$store.state.user.name, searchFlag: true, exportFlag: "N", }, currentRow: {}, produceScheduleList: [], dataListLoading: false, columnList: [ { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceOrderNo', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'orderNo', headerAlign: 'center', align: 'center', columnLabel: '生产订单号', columnWidth: 120, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceItemNo', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'itemNo', headerAlign: 'center', align: 'center', columnLabel: '工序号', columnWidth: 80, columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceItemDesc', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'itemDesc', headerAlign: 'center', align: 'center', columnLabel: '工序描述', columnWidth: 80, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceQtyRequired', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'qtyRequired', headerAlign: 'center', align: 'center', columnLabel: '需求数量', columnWidth: 60, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceQtyReported', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'qtyReported', headerAlign: 'center', align: 'right', columnLabel: '已报告数量', columnWidth: 100, columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProducePartNo', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'partNo', headerAlign: 'center', align: 'center', columnLabel: '产品编码', columnWidth: 120, columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProducePartDesc', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'partDesc', headerAlign: 'center', align: 'center', columnLabel: '产品名称', columnWidth: 180, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceRemark', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'remark', headerAlign: 'center', align: 'center', columnLabel: '备注', columnWidth: 180, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceScheduledDate', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'scheduledDate', headerAlign: 'center', align: 'center', columnLabel: '排产日期', columnWidth: 120, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceShiftNo', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'shiftNo', headerAlign: 'center', align: 'center', columnLabel: '班次', columnWidth: 80, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, { userId: this.$store.state.user.name, functionId: functionId, serialNumber: '600001ProduceCustomerName', tableId: '600001Produce', tableName: '待生产工单', columnProp: 'customerName', headerAlign: 'center', align: 'center', columnLabel: '客户名称', columnWidth: 180, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' }, ], reportButton: { dieCuttingButton: true, fqcReportButton: true, }, queryTable: { userId: this.$store.state.user.name, functionId: this.$route.meta.menuId, tableId: '600001Produce', languageCode: this.$i18n.locale }, // 用户table 查询参数
userColumnList: [], buttons: { searchButton: '查询', dieCuttingButton: '模切工站', fqcReportButton: 'FQC报工', }, // 导出 start
exportList: [], exportName: "生产工单", exportHeader: [], exportFooter: [], exportDefaultValue: "", // 导出 end
} }, components: { Chooselist, /* 选择的组件 */ column,/* 动态列 */ comDieCuttingReport, /* 报工页面的组件 */ }, mounted() { this.$nextTick(() => { this.height = window.innerHeight - 190 }) }, methods: { /* 查询派工单 */ getProduceScheduleList() { // 开始真的查询;
this.searchData.searchFlag = true getProduceScheduleList(this.searchData).then(({data}) => { // 设置查询数据
this.produceScheduleList = data.rows }) },
/* 刷新页面table */ refreshPageTables() { this.currentRow = {} this.getProduceScheduleList() }, /* 设置选中行的参数 */ setCurrentRow(row, column, event) { this.currentRow = JSON.parse(JSON.stringify(row)); //区分当前的工序数据
if(10 === this.currentRow.itemNo){ this.reportButton.dieCuttingButton = false; this.reportButton.fqcReportButton = true; }else if(20 === this.currentRow.itemNo){ this.reportButton.dieCuttingButton = true; this.reportButton.fqcReportButton = false; } }, // 切换报工modal
dieCuttingReportModal() { // 首先判断是否选择好派工单
if (JSON.stringify(this.currentRow) == '{}') { this.$message.error('请先选择好工单!') return false } // 打开操作员切换功能
this.$nextTick(() => { this.$refs.comDieCuttingReport.init(this.currentRow.seqNo) }) },
// 打开分切报工的
showSplitOrderReportModal() { // 首先判断是否选择好派工单
if (JSON.stringify(this.currentRow) == '{}') { this.$message.error(this.labels.pleaseSelectSchedule) return false } this.$nextTick(() => { // 打开分切报工功能
this.showSplitReportFlag = true this.$refs.comSplitOrderReport.init(this.currentRow.seqNo, this.operatorData) }) },
// 打开结束派工单的modal
showFinishScheduleModal() { // 首先判断是否选择好派工单
if (JSON.stringify(this.currentRow) == '{}') { this.$message.error(this.labels.pleaseSelectSchedule) return false } // 打开操作员切换功能
this.showFinishScheduleFlag = true this.$nextTick(() => { this.$refs.comFinishSchedule.init(this.currentRow, this.operatorData) }) },
// 结束派工单后刷新页面
processFinishScheduleOperation() { // 刷新当前页面的数据
this.refreshPageTables() },
// 保存操作员的信息
saveOperatorData() { // 查询操作员信息
getOperatorData(this.operatorData).then(({data}) => { let operatorData = data.row let status = operatorData.status this.operatorData.operatorName = data.row.operatorName // 重置操作员信息状态
this.operatorData.status = status // 判断是否验证通过
if (status == 'N') { this.operatorFlag = false } else { this.operatorFlag = true } if (!this.operatorFlag) { this.$message.error(this.labels.operatorCantBeUsed) } }) // 判断是否检查通过--不通过不在继续
.then(() => { if (!this.operatorFlag) { return false } // 关闭操作员切换功能
this.operatorData.showFlag = false // 打开组件
this.showReportFlag = true // 打开报工操作页面
this.$nextTick(() => { this.$refs.comProduceReportNormal.init(this.currentRow.seqNo, this.operatorData) }) }) },
/* 列表方法的回调 */ getBaseData(val) { if (this.tagNo === 88) { this.searchData.resourceId = val.ResourceID } },
// 获取基础数据列表
getBaseList(val) { this.tagNo = val this.$nextTick(() => { let strVal = '' if (val === 88) { strVal = this.searchData.resourceId } this.$refs.baseList.init(val, strVal, " AND WorkCenterNo <> 'FQC'") }) },
// 打开页面设置
userSetting() { this.visible = true let queryTable = { userId: this.$store.state.user.name, functionId: this.$route.meta.menuId, tableId: '600001Produce', languageCode: this.$i18n.locale } this.$nextTick(() => { this.$refs.column.init(queryTable) }) }, // 获取 用户保存的 格式列
getTableUserColumn() { getTableUserListLanguage(this.queryTableUser).then(({data}) => { if (data && data.code == 0 && data.rows.length > 0) { // this.columnList = []
this.columnList = data.rows } else { this.getColumnList() } }) }, // 保存 默认配置 列
async saveColumnList() { // 删除所有的该页面下保存的数据
if (this.userColumnList) { // 删除 user自定义的数据
await removerUser(this.queryTable) } // 删除默认配置
await removerDefault(this.queryTable) // 保存页面 table属性
let sumColumnList = this.columnList// concat(this.columnList1);
sumColumnList = sumColumnList.map(item => { return item = { tableId: item.tableId, tableName: item.tableName, columnProp: item.columnProp, columnLabel: item.columnLabel, columnHidden: item.columnHidden, columnImage: item.columnImage, columnSortable: item.columnSortable, columnWidth: item.columnWidth, format: item.format, functionId: this.$route.meta.menuId, sortLv: item.sortLv, status: true, fixed: item.fixed, serialNumber: item.serialNumber, columnType: item.columnType, align: item.align } })
await saveTableDefaultList(sumColumnList) // 保存页面 button label title 属性
/* let buttons = this.buttonList.map(item => { return item = { functionId: this.$route.meta.menuId, languageValue: item.languageValue, objectId: item.objectId, objectType: item.objectType, tableId: item.tableId } }) await saveButtonList(buttons) */ this.getFunctionButtonList() this.getColumnList() }, // 获取 tableDefault 列
getColumnList() { getTableDefaultListLanguage(this.queryTable).then(({data}) => { if (data && data.code == 0) { // this.showDefault = false
this.columnList = data.rows } else { // this.showDefault = true
} }) },
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 },
//导出excel
async createExportData() { // 开始真的查询;
this.searchData.searchFlag = true; this.searchData.exportFlag = "Y"; await getProduceScheduleList(this.searchData).then(({data}) => { // 设置查询数据
this.exportList = data.rows }) //重置判断是否是导出的sql
this.searchData.exportFlag = "N"; return this.exportList; }, startDownload() { // this.exportData = this.dataList
}, finishDownload() {
},
}, created() { // 不查询
getProduceScheduleList(this.searchData).then(({data}) => { // 设置查询数据
this.searchData.searchFlag = false; this.searchData.exportFlag = 'N'; this.produceScheduleList = data.rows })
// 获取动态表头的信息
//this.getTableUserColumn()
}
}</script>
<style>.el-textarea__inner { padding: 5px 5px;}
</style>
<!--当前页面的标签样式--><style scoped lang="scss">
/*针对el-card*/.customer-card .el-form-item__content { margin-top: -15px;}
.customer-card .el-form-item { height: 22px;}
.customer-border .el-form-item__content { margin-top: -30px;}
/*全局年与日类型 宽度*/div.el-time-width { width: 110px !important;}
/* 全局时间右边框*/.customer-css input.el-input__inner { height: 22px !important; padding-right: 0px !important;}
/* 控制el-card标签的数据*/div.customer-el-card { margin-left: 110px; margin-top: -15px; height: 20px; width: 60px;}
/* 颜色控制 */div.customer-el-card-pink { background: #FF00FF;}
div.customer-el-card-orange { background: #FFD700;}
div.customer-el-card-blue { background: #0000CD;}
/*清掉样式*/.el-radio + .el-radio { margin-left: 0px;}
/*当前按钮的通用样式*/.customer-css .customer-bun-mid { width: 65px; text-align: center;}
/*当前按钮的通用样式*/.customer-css .el-button--medium { padding: 5px 5px;}
/*添加主菜单和明细菜单的样式*/.customer-css .customer-dropdown .el-button--primary { padding: 2px; font-size: 12px;}
.el-dropdown-menu--medium .el-dropdown-menu__item { line-height: 18px; padding: 0 17px; font-size: 12px;}
hr { margin-top: 0px;}
/*控制上下间距*/</style>
|