中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

917 lines
27 KiB

<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
v-model:search="searchForm"
ref="crud"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
:row-class-name="rowCLassName"
@sort-change="sortChange"
>
<template #menu-left>
<!-- <el-button type="primary" @click="materialFormPrint">领料单打印</el-button> -->
</template>
<template #menu-right="{ size }">
<!-- 加工中 -->
<el-button type="warning" @click="filterFun('3')" plain v-if="permission.oemOrder_processing"
>加工中</el-button
>
<!-- 检验中 -->
<el-button type="danger" @click="filterFun('4')" plain v-if="permission.oemOrder_inspection"
>检验中</el-button
>
<!-- 已下达 -->
<el-button type="success" @click="filterFun('2')" plain v-if="permission.oemOrder_issued"
>已下达</el-button
>
<!-- 已完成 -->
<el-button type="success" plain @click="filterFun('15')" v-if="permission.oemOrder_completed"
>已完成</el-button
>
<!-- 全部 -->
<el-button type="primary" @click="filterFun()" plain v-if="permission.oemOrder_all"
>全部</el-button
>
</template>
<template #menu="scope">
<el-button type="primary" link @click="clickProduction(scope.row)">生产监控</el-button>
<!-- <el-button type="primary" link @click="memoDialogFun(scope.row)">关闭</el-button> -->
<!-- <template v-if="scope.row.approvalStatus == 2"> -->
<!-- <el-button type="primary" link @click="takeBack(scope.row)"
>领料单打印</el-button
> -->
<el-button type="primary" link @click="changeFn(scope.row)" v-if="permission.oemOrder_change_factiry">厂家更改</el-button>
<!-- </template> -->
<template
v-if="scope.row.approvalStatus != 2 && scope.row.runStatus < 15"
>
<el-button type="text" @click="takeBack(scope.row)" v-if="permission.oemOrder_takeBack">收回</el-button>
<el-button type="text" v-if="scope.row.oemStatus == 1 && permission.oemOrder_turnFacInner" @click="turnFacInner(scope.row)" >转厂内</el-button>
<el-button type="text" @click="inBatches(scope.row)" v-if="permission.oemOrder_batch">分批</el-button>
</template>
<template
v-if="scope.row.approvalStatus != 2 && scope.row.runStatus >= 15">
<!-- <span style="color: red">订单{{ scope.row.runStatusTitle }}</span> -->
<el-button type="text" @click="qualityRecords(scope.row)" v-if="permission.oemOrder_quality">质量记录</el-button>
<el-button type="text" @click="certificate(scope.row)" v-if="permission.oemOrder_certificate">合格证</el-button>
</template>
</template>
<!-- <template #virtualMac="scope">
<span>
{{ scope.row.virtualMac ? "是" : "否" }}
</span>
</template>
<template #virtualMac-form="{ type, disabled }">
<el-checkbox v-model="form.virtualMac">虚拟设备</el-checkbox>
</template>
<template #virtualMac-label="{ type, disabled }">
<span></span>
</template> -->
<!-- <template #name="{ row }">
<i :class="row.source" style="margin-right: 5px" />
<span>{{ row.name }}</span>
</template>
<template #source="{ row }">
<div style="text-align: center">
<i :class="row.source" />
</div>
</template> -->
</avue-crud>
<!-- 关闭 -->
<memoDialog
:memoDialogOpen="memoDialogOpen"
v-if="memoDialogOpen"
@memoDialogCancel="memoDialogCancel"
>
</memoDialog>
<!-- 收回 -->
<takeBack
:wor-id="worId"
:take-back-open="takeBackOpen"
v-if="takeBackOpen"
@cancel="cancel"
></takeBack>
<!-- 转厂内 -->
<turn-fac-inner
:row-item="rowItem"
:turn-fac-inner-open="turnFacInnerOpen"
v-if="turnFacInnerOpen"
@cancel="cancel"
/>
<!-- 厂家更改 -->
<manufacturerChange
@cancel="cancel"
:takeBackOpen="changeOpen"
v-if="changeOpen"
:wor-id="worId"
></manufacturerChange>
<!-- 领料单打印 -->
<materialPrint v-if="showPrint" :showPrint="showPrint" @cancel="cancel"></materialPrint>
<!-- 分批处理 -->
<batch-dialog v-if="showBatch" :showBatch="showBatch" :checkRow="checkRow" @cancel="cancel"></batch-dialog>
<!-- 生产监控 -->
<workRate
v-if="isWorkRateOpen"
:showDialog="isWorkRateOpen"
@closeDialog="closeDialog"
:rowItem="rowItem"
></workRate>
</basic-container>
</template>
<script>
import {getList,oemBack,turnQuality,turnCertificate} from "@/api/outsourcingManagement/oemOrder"
import { mapGetters } from "vuex";
import memoDialog from "./memoDialog.vue";
import takeBack from "./takeBack.vue";
import turnFacInner from "./turnFacInner.vue";
import manufacturerChange from "./manufacturerChange.vue";
import materialPrint from "./materialPrint.vue"
import batchDialog from "./batchDialog.vue";
import workRate from '@/views/workRate/index.vue';
export default {
components: {
memoDialog,
takeBack,
turnFacInner,
manufacturerChange,
materialPrint,
batchDialog,
workRate
// setCraftAbility
},
data() {
return {
isWorkRateOpen:false,
showPrint:false,
turnFacInnerOpen: false,
rowItem: {},
takeBackOpen: false,
worId: "",
showBatch:false,
memoDialogOpen: false,
parameter: {},
ocId: "89889",
setCraftAbilityOpen: false,
showIp: false,
ecId: "89889",
bcId: "89889",
searchForm:{},
setCrewOpen: false,
form: {},
query: {},
loading: true,
query:{},
selectionList: [],
parentId: "",
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
columnSort: true,
tip: false,
height: "auto",
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
dialogWidth: "60%",
border: true,
selection: false,
index: true,
menuWidth: 270,
dialogClickModal: false,
excelBtn: true,
viewBtn: false,
addBtn: false,
delBtn: false,
editBtn: false,
editBtnText: "编辑",
searchShowBtn: false,
filterBtn: true,
searchIndex: 3,
searchIcon: true,
searchLabelPosition: "left",
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
align: "center",
column: [
{
label: "计划单号",
prop: "planNumber",
// bind: "prWorkOrder.pjYieldOrder.poCode",
search: false,
sortable: 'custom',
overHidden: true,
width: 170,
},
{
label: "订单单号",
prop: "woCode",
sortable: 'custom',
search: true,
overHidden: true,
width: 190,
},
{
label: "零件号",
prop: "partCode",
// bind: "prWorkOrder.pjYieldOrder.partCode",
sortable: 'custom',
search: true,
overHidden: true,
hide: false,
width: 170,
searchLabelWidth: 60,
},
{
label: "计划下达时间",
prop: "planIssuanceTime",
// bind: "prWorkOrder.pjYieldOrder.failureTime",
sortable: 'custom',
search: true,
overHidden: true,
width: 170,
searchLabelWidth: 100,
type: "date",
searchRange: true,
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD",
startPlaceholder: "开始时间",
endPlaceholder: "结束时间",
},
{
label: "镀后入库时间",
prop: "postPlatingStorageTime",
// bind: "prWorkOrder.putStoreTime",
sortable: 'custom',
search: true,
overHidden: true,
width: 150,
searchLabelWidth: 110,
type: "date",
searchRange: true,
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD",
startPlaceholder: "开始时间",
endPlaceholder: "结束时间",
},
{
label: "订单状态",
prop: "orderStatus",
// bind: 'prWorkOrder.runStatus',
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
type: "select",
multiple: true,
searchOrder: 20,
hide: true,
searchValue: ['3', '2'],
dicUrl:"/api/blade-system/dict/dictionary?code=order_run_status",
props:{
label:"dictValue",
value:"dictKey"
}
// dicData: [
// {
// value: 2,
// label: "已下达",
// },
// {
// value: 3,
// label: "加工中",
// },
// {
// value: 4,
// label: "检验中",
// },
// {
// value: 13,
// label: "审理中",
// },
// {
// value: 14,
// label: "返工中",
// },
// {
// value: 15,
// label: "已完工",
// },
// {
// value: 21,
// label: "已作废",
// },
// ],
},
{
label: "外协状态",
prop: "oemStatusList",
type:"select",
// bind: 'prWorkOrder.runStatus',
sortable: 'custom',
hide: true,
search: true,
dicData:[
{label:"待外协",value:'1'},
{label:"外协中",value:'2'},
{label:"已完成",value:'3'},
]
},
{
label: "订单状态",
prop: "runStatusName",
// bind: 'prWorkOrder.runStatus',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
type: "select",
// dicUrl:"/api/blade-system/dict/dictionary?code=order_run_status",
// props:{
// label:"dictValue",
// value:"dictKey"
// }
// dicData: [
// {
// value: 2,
// label: "已下达",
// },
// {
// value: 3,
// label: "加工中",
// },
// {
// value: 4,
// label: "检验中",
// },
// {
// value: 13,
// label: "审理中",
// },
// {
// value: 14,
// label: "返工中",
// },
// {
// value: 15,
// label: "已完工",
// },
// {
// value: 21,
// label: "已作废",
// },
// ],
},
{
label:'外协状态',
prop:"oemStatusTitle",
search:false,
width:100,
sortable: 'custom',
},
{
label: "批次号",
prop: "batchNo",
// bind: "prWorkOrder.batchNo",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
searchLabelWidth: 60,
},
{
label: "产品名称",
prop: "partName",
// bind: "prWorkOrder.pjYieldOrder.partName",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
headerAlign: "center",
// align: "left",
},
{
label: "流程卡号",
prop: "cardNo",
// bind: "prWorkOrder.cardNo",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
},
{
label: "MES流程卡号",
prop: "mesCardNo",
// bind: "prWorkOrder.mesCardNo",
display: true,
search: false,
sortable: 'custom',
overHidden: true,
width: 120,
},
{
label: "镀种信息",
prop: "plate",
// bind: "prWorkOrder.pjYieldOrder.plate",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
},
{
label: "生产标识",
prop: "productIdent",
// bind: "prWorkOrder.pjYieldOrder.prodIdent",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
},
{
label: "优先级",
prop: "priority",
// bind: "prWorkOrder.priority",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
type: "select",
headerAlign: "center",
// align: "left",
dicUrl:"/api/blade-system/dict/dictionary?code=orderPriority",
props:{
label:"dictValue",
value:"dictKey"
}
// dicData: [
// {
// value: 1,
// label: "正常-白色",
// },
// {
// value: 2,
// label: "项目要求日期急件-橙色",
// },
// {
// value: 3,
// label: "合同急件-黄色",
// },
// {
// value: 4,
// label: "绩效零件-青色",
// },
// {
// value: 5,
// label: "调度标注急件-蓝色",
// },
// ],
},
{
label: "使用部门",
prop: "deptName",
// bind: "prWorkOrder.pjYieldOrder.useDept",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
headerAlign: "center",
align: "left",
},
{
label: "数量",
prop: "makeQty",
// bind: "prWorkOrder.makeQty",
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
},
{
label: "面积(d㎡)",
prop: "totalArea",
// bind: "prWorkOrder.pjYieldOrder.poArea",
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
},
{
label: "单批次面积",
prop: "area",
// bind: "prWorkOrder.batchArea",
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
},
{
label: "需求交期",
prop: "demandDate",
// bind: "prWorkOrder.demandDate",
sortable: 'custom',
search: true,
type: "date",
format: "YYYY-MM-DD",
valueFormat: "YYYY-MM-DD",
overHidden: true,
width: 120,
searchRange: true,
},
{
label: "外协代码/简称",
prop: "oemCode",
// bind: "inCustomer.codeAndName",
sortable: 'custom',
search: true,
overHidden: true,
width: 150,
searchLabelWidth: 110,
},
{
label: "计划员",
prop: "planner",
// bind: "prWorkOrder.pjYieldOrder.planUser",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
},
{
label: "调度员",
prop: "dispatcher",
// bind: "prWorkOrder.dispatcher.userName",
sortable: 'custom',
search: true,
overHidden: true,
width: 120,
},
// {
// label: '备注',
// prop: 'memo',
// sortable: 'custom',
// search: false,
// width: 120,
// },
{
label: "已交件数量",
prop: "submittedNum",
// bind: 'prWorkOrder.inventoryQty',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
},
{
label: "未交件数量",
prop: "unsubmittedNum",
// bind: 'notInQty',
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
},
{
label: "工艺路线",
prop: "craftWay",
sortable: 'custom',
search: false,
overHidden: true,
width: 120,
},
],
},
data: [],
changeOpen: false,
checkRow:{},
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.validData(this.permission.menu_add, false),
viewBtn: this.validData(this.permission.menu_view, false),
delBtn: this.validData(this.permission.menu_delete, false),
editBtn: this.validData(this.permission.menu_edit, false),
};
},
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
},
},
created(){
this.searchForm.orderStatus = ['3','2']
this.query = {
...this.searchForm,
orderStatus:this.searchForm.orderStatus && this.searchForm.orderStatus.length != 0 && this.searchForm.orderStatus.join(",")
};
},
methods: {
// 生产监控
clickProduction(row) {
this.rowItem = row;
this.isWorkRateOpen = true;
},
// 表格排序
sortChange({ prop, order }) {
console.log('prop----------',prop)
console.log('order----------',order)
this.query.ascs = undefined;
this.query.descs = undefined;
const orderByFieldKey = order === 'ascending' ? 'ascs' : 'descs';
const orderByField = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
this.query[orderByFieldKey] = orderByField;
// // 重新加载数据
this.onLoad(this.page, this.query);
},
// 厂家修改
changeFn(row) {
this.worId = row.woId
this.changeOpen = true;
},
turnFacInner(row) {
this.turnFacInnerOpen = true;
this.rowItem = row;
},
takeBack(row) {
this.takeBackOpen = true;
this.worId = row.id;
},
memoDialogFun(woId, status) {
this.closeObj = { woId, status };
this.memoDialogOpen = true;
},
qualityRecords(row){
turnQuality({key:row.deliverKey}).then(res =>{
window.open(res.data.msg)
})
},
certificate(row){
turnCertificate({key:row.deliverKey}).then(res =>{
window.open(res.data.msg)
})
},
// 备注填写关闭
memoDialogCancel(flag, memo) {
this.memoDialogOpen = false;
if (flag) {
// this.updateStatus(this.closeObj.woId, this.closeObj.status, memo);
}
},
rowCLassName({ row, rowIndex }) {
if (row.priority === 2) {
return "priority-2-row";
} else if (row.priority === 3) {
return "priority-3-row";
} else if (row.priority === 4) {
return "priority-4-row";
} else if (row.priority === 5) {
return "priority-5-row";
}
},
filterFun(curStatus) {
this.searchForm.orderStatus = curStatus ? [curStatus] : null;
this.query.orderStatus = curStatus
console.log('sear---------',this.searchForm)
this.onLoad();
},
// 设置班组、工序、工艺能力
setCraftAbility(ocId) {
this.ocId = ocId;
this.setCraftAbilityOpen = true;
},
changePWD(ecId) {
this.ecId = ecId;
this.showIp = true;
},
inBatches(row){
this.checkRow = row
this.showBatch = true
},
cancel(isRefresh) {
this.showPrint = false
this.workRateOpen = false;
this.isOpen = false;
this.turnOemOpen = false;
this.retGoodsOpen = false;
this.turnFacInnerOpen = false;
this.takeBackOpen = false;
this.updateMakeQtyOpen = false;
this.memoDialogOpen = false;
this.changeOpen = false;
this.showBatch = false
if (isRefresh) {
this.refresh();
}
},
// 设置班组人员
setCrew(bcId) {
console.log(9999, bcId);
this.bcId = bcId;
this.setCrewOpen = true;
},
// 设置班组人员弹框关闭
setCrewOpeSancel(isRefresh) {
if (isRefresh) {
this.$refs.myTable.load();
}
this.setCrewOpen = false;
},
initData() {
// getMenuTree().then(res => {
// const column = this.findObject(this.option.column, 'parentId');
// column.dicData = res.data.data;
// });
},
handleAdd(row) {
this.parentId = row.id;
const column = this.findObject(this.option.column, "parentId");
column.value = row.id;
column.addDisabled = true;
this.$refs.crud.rowAdd();
},
// 保存
rowSave(row, done, loading) {
// add(row).then(
// res => {
// // 获取新增数据的相关字段
// const data = res.data.data;
// row.id = data.id;
// this.$message({
// type: 'success',
// message: '操作成功!',
// });
// // 数据回调进行刷新
// done(row);
// },
// error => {
// window.console.log(error);
// loading();
// }
// );
},
// 修改
rowUpdate(row, index, done, loading) {
// update(row).then(
// () => {
// this.$message({
// type: 'success',
// message: '操作成功!',
// });
// // 数据回调进行刷新
// done(row);
// },
// error => {
// window.console.log(error);
// loading();
// }
// );
},
rowDel(row, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
// return remove(row.id);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!",
});
// 数据回调进行刷新
done(row);
});
},
// 重置
searchReset() {
this.query = {};
this.parentId = 0;
this.searchForm = {
orderStatus: ['3','2'],
}
this.onLoad(this.page);
},
// 搜索
searchChange(params, done) {
this.query = {
...params,
orderStatus: params.orderStatus && params.orderStatus.length != 0 && params.orderStatus.join(","),
};
this.parentId = "";
this.page.currentPage = 1;
this.onLoad();
done();
},
// 选中表格数据
selectionChange(list) {
this.selectionList = list;
},
//
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
// 打开弹框 前操作 打开表单前会执行beforeOpen方法
beforeOpen(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
// getMenu(this.form.id).then(res => {
// this.form = Object.assign(res.data.data, {
// hasChildren: this.form.hasChildren,
// });
// if (this.form.parentId === '0') {
// this.form.parentId = '';
// }
// });
}
done();
},
materialFormPrint(){
this.showPrint = true
},
// 关闭 弹框 关闭表单前会执行beforeClose方法,
beforeClose(done) {
this.parentId = "";
const column = this.findObject(this.option.column, "parentId");
column.value = "";
column.addDisabled = false;
done();
},
// 切换 页码
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
// 切换页面 数量
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
// 加载页面数据
onLoad(page, params = {}) {
this.loading = true;
let searchParams = {
...this.query,
planIssuanceTimeStart:this.query.planIssuanceTime && this.query.planIssuanceTime.length != 0 && this.query.planIssuanceTime[0],
planIssuanceTimeEnd:this.query.planIssuanceTime && this.query.planIssuanceTime.length != 0 && this.query.planIssuanceTime[1],
demandDateStart:this.query.demandDate && this.query.demandDate.length != 0 && this.query.demandDate[0],
demandDateEnd:this.query.demandDate && this.query.demandDate.length != 0 && this.query.demandDate[1],
postPlatingStorageTimeStart:this.query.postPlatingStorageTime && this.query.postPlatingStorageTime.length != 0 && this.query.postPlatingStorageTime[0],
postPlatingStorageTimeEnd:this.query.postPlatingStorageTime && this.query.postPlatingStorageTime.length != 0 && this.query.postPlatingStorageTime[1],
}
const {planIssuanceTime,demandDate,postPlatingStorageTime,...searchData} = searchParams
getList({
current:this.page.currentPage,
size:this.page.pageSize,
...searchData
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false;
}).catch(err=>{
this.loading = false;
})
},
},
};
</script>
<style lang="scss"></style>