中航光电热表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.

968 lines
26 KiB

<template>
5 months ago
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
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"
>
<template #menu-left>
<el-button type="primary" @click="batchClose()">批量关闭</el-button>
<!-- <el-upload :auto-upload="false" :show-file-list="false" action="action" :on-change="handleChange"
style="float: right;margin-left: 12px;">
<el-button type="primary">导入</el-button>
</el-upload> -->
5 months ago
</template>
<template #menu-right> </template>
5 months ago
<template #poCode="{ row }">
<el-text type="primary">{{ row.poCode }}</el-text>
</template>
<template #prodIdent="{ row }">
<el-tag>{{ row.prodIdent }}</el-tag>
</template>
<template #menu="{ row }">
<el-button
type="primary"
text
plain
style="border: 0; background-color: transparent !important"
@click="lookProcessRoute(row)"
>工艺路线
</el-button>
5 months ago
<!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important"
@click.stop="glassDisc(row)">下发玻璃饼
</el-button> -->
5 months ago
<!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important"
@click.stop="rushFn(row)">加急
</el-button> -->
5 months ago
<!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important"
@click.stop="batchClose(row)">关闭
</el-button> -->
5 months ago
<!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important"
@click="inBatchesFn(row)">模具下发
</el-button> -->
5 months ago
</template>
</avue-crud>
<!-- 加急 -->
<rushDialog :showDialog="isRushOpen" v-if="isRushOpen" @closeDialog="closeDialog"></rushDialog>
<!-- 导入 -->
<basic-import
v-if="isShowImport"
title="导入"
:isShow="isShowImport"
5 months ago
templateUrl="/blade-desk/QA/CycleTestItem/download-excel-template"
templateName="试验项目模板.xlsx"
importUrl="/blade-desk/QA/CycleTestItem/import-excel"
@closeDialog="closeDialog"
></basic-import>
4 months ago
<!-- 工艺路线弹窗 -->
<lookProcess
:is-open="isOpen"
v-if="isOpen"
@cancel="closeDialog"
:rowData="rowItem"
sourceId="sinTerOrder"
:id="id"
></lookProcess>
5 months ago
</basic-container>
</template>
<script>
import { getList, closeBatchs } from '@/api/orderManagement/sinTerPlanOrder';
5 months ago
import rushDialog from './components/rushDialog.vue';
import basicImport from '@/components/basic-import/main.vue';
import lookProcess from './components/lookProcess.vue';
import {
5 months ago
add,
getRole,
getRoleAlias,
getRoleTreeById,
grant,
grantTree,
remove,
update,
} from '@/api/system/role';
import { mapGetters } from 'vuex';
import { validatenull } from '@/utils/validate';
export default {
5 months ago
components: {
rushDialog,
4 months ago
basicImport,
lookProcess,
5 months ago
},
data() {
return {
id: null,
isShowImport: false,
5 months ago
inBatchesOpen: false,
platingSmallOpen: false,
planOrderArr: [],
isOpen: false,
rowItem: {},
poId: null,
form: {},
box: false,
props: {
label: 'title',
value: 'key',
},
menuGrantList: [],
dataScopeGrantList: [],
apiScopeGrantList: [],
apiGrantList: [],
menuTreeObj: [],
dataScopeTreeObj: [],
apiScopeTreeObj: [],
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
columnSort: true,
tip: false,
height: 'auto',
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: false,
selection: true,
viewBtn: false,
addBtn: false,
delBtn: false,
editBtn: false,
editBtnText: '修改',
labelWidth: 120,
// searchLabelWidth: 120,
4 months ago
menuWidth: 150,
5 months ago
dialogWidth: 900,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
excelBtn: true,
showOverflowTooltip: true,
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
gridBtn: false,
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
align: 'center',
5 months ago
column: [
// {
// label: '是否确认',
// prop: 'poCode',
// search: true,
// sortable: true,
// width: 150,
// span: 12,
// headerAlign: 'center',
// align: 'center',
// rules: [
// {
// required: true,
// message: '请输入角色名称',
// trigger: 'blur',
// },
// ],
// },
{
label: '计划单号',
prop: 'ypCode',
5 months ago
search: true,
sortable: true,
width: 150,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '零件号',
prop: 'partCode',
search: true,
sortable: true,
width: 180,
span: 12,
headerAlign: 'center',
align: 'center',
5 months ago
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '产品型号',
prop: 'productType',
search: false,
sortable: true,
disabled: true,
width: 120,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: false,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '产品名称',
prop: 'productName',
5 months ago
search: false,
sortable: true,
disabled: true,
span: 12,
width: 150,
headerAlign: 'center',
align: 'left',
rules: [
{
required: false,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '生产标识',
prop: 'productIdent',
5 months ago
search: false,
sortable: true,
width: 120,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '使用部门',
prop: 'useDept',
search: false,
sortable: true,
disabled: true,
width: 120,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '生产数量',
prop: 'ypQty',
5 months ago
search: false,
sortable: true,
width: 120,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
5 months ago
// {
// label: '镀种',
// prop: 'plate',
// search: false,
// sortable: true,
// disabled: true,
// span: 12,
// headerAlign: 'center',
// align: 'center',
// rules: [
// {
// required: false,
// message: '请输入角色名称',
// trigger: 'blur',
// },
// ],
// },
// {
// label: '镀种小类',
// prop: 'plate',
// search: false,
// sortable: true,
// width: 120,
// display: false,
// span: 12,
// headerAlign: 'center',
// align: 'center',
// rules: [
// {
// required: true,
// message: '请输入角色名称',
// trigger: 'blur',
// },
// ],
// },
{
label: '面积(d㎡)',
prop: 'ypArea',
5 months ago
search: false,
sortable: true,
width: 120,
span: 12,
disabled: true,
headerAlign: 'center',
align: 'center',
rules: [
{
required: false,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
5 months ago
{
label: '需求交期',
prop: 'demandDate',
search: false,
sortable: true,
width: 150,
span: 12,
headerAlign: 'center',
align: 'center',
5 months ago
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '备注',
prop: 'memo',
search: false,
sortable: true,
span: 24,
type: 'textarea',
width: 150,
headerAlign: 'center',
align: 'left',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
5 months ago
{
label: '计划员',
prop: 'planUser',
search: false,
sortable: true,
width: 120,
span: 12,
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
5 months ago
{
label: '计划下达时间',
prop: 'releaseDate',
search: false,
sortable: true,
searchLabelWidth: 100,
width: 170,
span: 12,
type: 'date',
headerAlign: 'center',
align: 'center',
rules: [
{
required: true,
message: '请输入角色名称',
trigger: 'blur',
},
],
},
{
label: '订单状态',
prop: 'curStatusText',
search: true,
sortable: true,
span: 12,
display: false,
type: 'select',
width: '140',
headerAlign: 'center',
align: 'center',
dicData: [
{
value: 2,
label: '已退回',
},
{
value: 4,
label: '已派工',
},
{
value: 5,
label: '加工中',
},
{
value: 15,
label: '已完工',
},
{
value: 21,
label: '已关闭',
},
],
},
{
label: '已交付数量',
prop: 'deliveryQty',
5 months ago
search: false,
sortable: true,
span: 12,
headerAlign: 'center',
align: 'center',
width: 170,
},
{
label: '未交付数量',
4 months ago
prop: 'undeliveredQty',
5 months ago
search: false,
sortable: true,
span: 12,
headerAlign: 'center',
align: 'center',
width: 170,
},
// {
// label: '异常类型',
// prop: 'createName',
// search: false,
// sortable: true,
// hide: true,
// span: 12,
// headerAlign: 'center',
// align: 'center',
5 months ago
// },
],
},
5 months ago
data: [],
isRushOpen: false,
};
},
computed: {
...mapGetters(['userInfo', 'permission']),
permissionList() {
return {
addBtn: this.validData(this.permission.role_add, false),
viewBtn: this.validData(this.permission.role_view, false),
delBtn: this.validData(this.permission.role_delete, false),
editBtn: this.validData(this.permission.role_edit, false),
};
},
5 months ago
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(',');
},
5 months ago
idsArray() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids;
},
5 months ago
},
watch: {
'form.currentAlias'() {
const alias = this.form.currentAlias;
if (!validatenull(alias)) {
this.form.roleAlias = alias;
}
},
},
methods: {
// 点击导入按钮
handleImport() {
this.isShowImport = true;
5 months ago
},
glassDisc() {
this.$confirm('确定是否下达玻璃饼?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
// return remove(row.id);
})
.then(() => {
// this.onLoad(this.page);
// this.$message({
// type: 'success',
// message: '操作成功!',
// });
});
},
// 批量关闭
batchClose() {
// 检查是否选择了数据
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据批量关闭?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const ids = this.selectionList.map(item => item.id).join(',');
closeBatchs({ ...{ ids }, ...this.approveForm }).then(res => {
if (res.code === 200) {
this.$message.success('审核成功');
4 months ago
}
});
this.$refs.crud.toggleSelection();
this.onLoad(this.page); // return remove(row.id);
})
.catch(() => {
// this.onLoad(this.page);
// this.$message({
// type: 'success',
// message: '操作成功!',
// });
});
},
5 months ago
// 加急
rushFn() {
this.isRushOpen = true;
},
closeDialog() {
this.isRushOpen = false;
this.isBatchOpen = false;
this.isOpen = false;
5 months ago
},
inBatchesFn(row) {
this.rowItem = row;
this.inBatchesOpen = true;
},
subclass() {
this.platingSmallOpen = true;
},
lookProcessRoute(row) {
this.id = row.id;
5 months ago
this.isOpen = true;
this.rowItem = row;
},
cancel(refresh) {
if (refresh) {
this.$refs.myTable.load();
}
this.inBatchesOpen = false;
this.isOpen = false;
this.planFormOpen = false;
this.platingSmallOpen = false;
},
initData(roleId) {
getRoleTreeById(roleId).then(res => {
const column = this.findObject(this.option.column, 'parentId');
column.dicData = res.data.data;
});
},
submit() {
const menuList = this.$refs.treeMenu.getCheckedKeys();
const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
this.box = false;
this.$message({
type: 'success',
message: '操作成功!',
});
this.selectionList = [];
this.onLoad(this.page);
});
},
rowSave(row, done, loading) {
add(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
5 months ago
error => {
window.console.log(error);
loading();
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
5 months ago
error => {
window.console.log(error);
loading();
}
);
},
rowDel(row) {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
});
},
5 months ago
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
beforeOpen(done, type) {
if (['add', 'edit'].includes(type)) {
this.initData(this.form.id);
}
if (['edit', 'view'].includes(type)) {
if (this.form.parentId === '0') {
this.form.parentId = '';
}
}
getRoleAlias().then(res => {
const column = this.findObject(this.option.column, 'currentAlias');
column.dicData = res.data.data;
});
done();
},
handleRole() {
if (this.selectionList.length !== 1) {
this.$message.warning('只能选择一条数据');
return;
}
this.menuTreeObj = [];
this.dataScopeTreeObj = [];
this.apiScopeTreeObj = [];
grantTree().then(res => {
this.menuGrantList = res.data.data.menu;
this.dataScopeGrantList = res.data.data.dataScope;
this.apiScopeGrantList = res.data.data.apiScope;
getRole(this.ids).then(res => {
this.menuTreeObj = res.data.data.menu;
this.dataScopeTreeObj = res.data.data.dataScope;
this.apiScopeTreeObj = res.data.data.apiScope;
this.box = true;
});
});
},
handleRowRole(row) {
this.menuTreeObj = [];
this.dataScopeTreeObj = [];
this.apiScopeTreeObj = [];
grantTree().then(res => {
this.menuGrantList = res.data.data.menu;
this.dataScopeGrantList = res.data.data.dataScope;
this.apiScopeGrantList = res.data.data.apiScope;
getRole(row.id).then(res => {
this.menuTreeObj = res.data.data.menu;
this.dataScopeTreeObj = res.data.data.dataScope;
this.apiScopeTreeObj = res.data.data.apiScope;
this.selectionList.push(row);
this.box = true;
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
this.$refs.crud.toggleSelection();
});
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
handleChange(file, fileList) {
// proxy.$Export.xlsx(file.raw).then((data) => {
// data.value = data.results;
// });
this.$message({
type: 'success',
message: '操作成功!',
});
},
async onLoad(page, params = {}) {
5 months ago
this.loading = true;
this.data = [
{
4 months ago
id: 1,
5 months ago
alreadyBranchQty: 104.0,
bsPlatingSmall: null,
bsProcedureQua: null,
closeMan: null,
closeTime: null,
curStatus: 4,
curStatusText: '已派工',
custodian: null,
deliveryQty: 0.0,
demandDate: '2025-03-13 00:00:00',
dominantDept: '3400',
dsPart: null,
keyValue: 43933,
memo: '最多三个批次0159BKFX',
partCode: '21E6-575-1710_003-H14-C-N',
partName: '09-J599_25烧结插座',
planType: 2,
planUser: '0300009',
plate: 'Ep.Ni3b',
poArea: 0.0,
4 months ago
createName: '0300009',
5 months ago
poCode: 'WO-2211134240',
poId: 43933,
poQty: 104,
primaryCraft: '4(封接、表、涂色带)-库2',
priority: 1,
prodIdent: 'JHT',
prodLine: null,
productType: 'JY599',
releaseDate: '2022-11-24 11:59:21',
roamNo: 'B5199029',
routeNo: 'LX08-05-002',
sureType: null,
sureTypeTitle: '未确认',
syncTime: '2023-02-10 20:58:11',
undeliveredQty: 104.0,
useDept: '3502',
wcName: null,
},
5 months ago
{
id: 2,
5 months ago
alreadyBranchQty: 104.0,
bsPlatingSmall: null,
bsProcedureQua: null,
closeMan: null,
closeTime: null,
curStatus: 4,
curStatusText: '已派工',
custodian: null,
deliveryQty: 0.0,
demandDate: '2025-03-13 00:00:00',
dominantDept: '3400',
dsPart: null,
keyValue: 43948,
memo: '最多三个批次0159BKFX',
partCode: '21E6-575-1710_003-H14-C-N',
partName: '09-J599_25烧结插座',
planType: 2,
planUser: '0300009',
plate: 'Ep.Ni3b',
poArea: 0.0,
poCode: 'WO-2211134240',
poId: 43948,
poQty: 104,
primaryCraft: '4(封接、表、涂色带)-库2',
priority: 1,
prodIdent: 'JHT',
prodLine: null,
productType: 'JY599',
releaseDate: '2022-11-24 11:59:21',
roamNo: null,
routeNo: 'LX08-05-002',
sureType: null,
sureTypeTitle: '未确认',
syncTime: '2023-02-10 20:58:11',
undeliveredQty: 104.0,
useDept: '3502',
wcName: null,
},
5 months ago
{
id: 3,
5 months ago
alreadyBranchQty: 19.0,
bsPlatingSmall: null,
bsProcedureQua: null,
closeMan: null,
closeTime: null,
curStatus: 4,
curStatusText: '已派工',
custodian: null,
deliveryQty: 0.0,
demandDate: '2025-02-23 00:00:00',
dominantDept: '3400',
dsPart: null,
keyValue: 43932,
memo: '最多三个批次0159BKFX',
partCode: '21E6-575-1710_002-H14-N-N',
partName: '09-J599_25烧结插座',
planType: 2,
planUser: '0300009',
plate: 'Ep.Ni3b',
poArea: 0.0,
poCode: 'WO-2211134211',
poId: 43932,
poQty: 19,
primaryCraft: '4(封接、表、涂色带)-库2',
priority: 1,
prodIdent: 'JHT',
prodLine: null,
productType: 'JY599',
releaseDate: '2022-11-24 11:59:21',
roamNo: null,
routeNo: 'LX08-05-002',
sureType: null,
sureTypeTitle: '未确认',
syncTime: '2023-02-10 20:58:11',
undeliveredQty: 19.0,
useDept: '3502',
wcName: null,
},
5 months ago
];
this.page.total = this.data.length;
this.query.sureType = '';
try {
const res = await getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
);
if (res.code) {
this.data = res.data.data.records;
this.page.total = res.data.data.total;
this.selectionClear();
}
} catch (err) {
console.log(err);
}
5 months ago
this.loading = false;
},
5 months ago
},
mounted() {},
};
</script>