排产代码提交

dev-scheduling
zhangdi 7 days ago
parent 9404311f68
commit 0e1b713742
  1. 23
      src/api/productionSchedulingPlan/scheduling.js
  2. 11
      src/axios.js
  3. 438
      src/views/productionSchedulingPlan/schedulingDashboard/index.vue
  4. 834
      src/views/productionSchedulingPlan/schedulingException/index.vue

@ -0,0 +1,23 @@
import request from '@/axios';
// 排产看板数据
export const getData = row => {
return request({
url: '/blade-scheduling/workOrder/schedulingBoard',
method: 'post',
data: row,
});
};
// 排产异常数据
export const getYieldOrderList = (current, size, params) => {
return request({
url: '/blade-scheduling/yieldOrder/page',
method: 'get',
params: {
...params,
current,
size,
},
});
};

@ -25,7 +25,7 @@ let isErrorShown = false;
let isRefreshing = false; // 标记当前是否正在刷新token let isRefreshing = false; // 标记当前是否正在刷新token
let refreshTokenPromise = null; // 刷新token的Promise,避免重复请求 let refreshTokenPromise = null; // 刷新token的Promise,避免重复请求
axios.defaults.timeout = 10000; axios.defaults.timeout = 60000;
//返回其他状态码 //返回其他状态码
axios.defaults.validateStatus = function (status) { axios.defaults.validateStatus = function (status) {
return status >= 200 && status <= 500; // 默认的 return status >= 200 && status <= 500; // 默认的
@ -40,6 +40,7 @@ NProgress.configure({
//http request拦截 //http request拦截
axios.interceptors.request.use( axios.interceptors.request.use(
config => { config => {
console.log('请求拦截器',config)
// start progress bar // start progress bar
NProgress.start(); NProgress.start();
// 初始化错误提示状态 // 初始化错误提示状态
@ -49,7 +50,7 @@ axios.interceptors.request.use(
config.url = baseUrl + config.url; config.url = baseUrl + config.url;
} }
//安全请求header //安全请求header
config.headers['Blade-Requested-With'] = 'BladeHttpRequest'; // config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
//headers判断是否需要 //headers判断是否需要
const authorization = config.authorization === false; const authorization = config.authorization === false;
if (!authorization) { if (!authorization) {
@ -86,9 +87,9 @@ axios.interceptors.request.use(
config.headers['Content-Type'] = 'text/plain'; config.headers['Content-Type'] = 'text/plain';
} }
//headers中配置serialize为true开启序列化 //headers中配置serialize为true开启序列化
if (config.method === 'post' && meta.isSerialize === true) { // if (config.method === 'post' && meta.isSerialize === true) {
config.data = serialize(config.data); // config.data = serialize(config.data);
} // }
return config; return config;
}, },
error => { error => {

@ -1,11 +1,50 @@
<template> <template>
<basic-container> <!-- <basic-container> -->
<avue-form :option="option" @submit="submit" @error="error"> <div>
<template #menu-form> <el-form label-width="80px" :model="formLabelAlign">
<el-button type="primary" icon="el-icon-search" @click="handleSubmit"> 搜索 </el-button> <el-row>
<el-button icon="el-icon-delete" @click="handleSubmit"> 清空 </el-button> <el-col :span="6">
</template> <el-form-item label="维度:">
</avue-form> <el-select v-model="formLabelAlign.type" placeholder="请选择">
<el-option label="车间订单" value="1"> </el-option>
<el-option label="班组" value="2"> </el-option>
<el-option label="设备" value="3"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formLabelAlign.type == '1'">
<el-form-item label="车间订单号:" label-width="120px">
<el-input v-model="formLabelAlign.woCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formLabelAlign.type == '2'">
<el-form-item label="班组:">
<el-select v-model="formLabelAlign.teamame" placeholder="请选择">
<el-option label="班组1" value="1"> </el-option>
<el-option label="班组2" value="2"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formLabelAlign.type == '3'">
<el-form-item label="设备:">
<el-select v-model="formLabelAlign.equipName" placeholder="请选择">
<el-option label="设备1" value="1"> </el-option>
<el-option label="设备2" value="2"> </el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="时间:">
<el-date-picker v-model="formLabelAlign.startTime" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-button type="primary" icon="el-icon-search" @click="handleSubmit"> 搜索 </el-button>
<el-button icon="el-icon-delete" @click="handleSubmit"> 清空 </el-button>
</el-col>
</el-row>
</el-form>
<div class="gantt-container"> <div class="gantt-container">
<!-- 头部标题和图例 --> <!-- 头部标题和图例 -->
@ -31,12 +70,33 @@
<div class="gantt-wrapper"> <div class="gantt-wrapper">
<!-- 左侧设备列表 --> <!-- 左侧设备列表 -->
<div class="device-list"> <div class="device-list">
<div class="device-item device-item-title" :style="{ height: '36px' }">设备</div> <div
v-if="searchType == '1'"
class="device-item device-item-title"
:style="{ height: '36px' }"
>
车间订单号
</div>
<div
v-if="searchType == '2'"
class="device-item device-item-title"
:style="{ height: '36px' }"
>
班组
</div>
<div
v-if="searchType == '3'"
class="device-item device-item-title"
:style="{ height: '36px' }"
>
设备
</div>
<div <div
v-for="(device, index) in devices" v-for="(device, index) in devices"
:key="index" :key="index"
class="device-item" class="device-item"
:style="{ height: rowHeight + 'px' }" :style="{ height: rowHeight + 'px' }"
:title="device"
> >
{{ device }} {{ device }}
</div> </div>
@ -123,14 +183,16 @@
:key="taskIndex" :key="taskIndex"
class="task-bar" class="task-bar"
:style="{ :style="{
left: `${getPositionPercent(task.start)}%`, left: `${getPositionPercent(task.startTime)}%`,
width: `${getWidthPercent(task.start, task.end)}%`, width: `${getWidthPercent(task.startTime, task.endTime)}%`,
backgroundColor: getStatusColor(task.status), backgroundColor: getStatusColor(task.status),
}" }"
@mouseenter="showTooltip($event, task, device)" @mouseenter="showTooltip($event, task, device)"
@mouseleave="hideTooltip()" @mouseleave="hideTooltip()"
> >
<span class="task-label">{{ task.task }}</span> <span class="task-label" v-if="searchType == '1'">{{ task.processName }}</span>
<span class="task-label" v-if="searchType == '2'">{{ task.woCode }}</span>
<span class="task-label" v-if="searchType == '3'">{{ task.woCode }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -148,200 +210,86 @@
}" }"
> >
<div class="tooltip-content"> <div class="tooltip-content">
<div><strong>设备</strong>{{ tooltipData.device }}</div> <!-- 工单标题 -->
<div><strong>任务</strong>{{ tooltipData.task }}</div> <div class="wo-code-title" v-if="searchType=='1'">{{ tooltipData.woCode }}</div>
<div><strong>时间</strong>{{ tooltipData.start }} - {{ tooltipData.end }}</div> <div class="wo-code-title" v-if="searchType=='2'">{{ tooltipData.teamName }}</div>
<div><strong>状态</strong>{{ tooltipData.status }}</div> <div class="wo-code-title" v-if="searchType=='3'">{{ tooltipData.equipName }}</div>
<!-- 详情列表 -->
<ul class="detail-list">
<li class="detail-item" v-if="searchType=='1'">
<span class="label">工序</span>
<span class="value">{{ tooltipData.processName || '-' }}</span>
</li>
<li class="detail-item" v-if="searchType=='1'">
<span class="label">班组</span>
<span class="value">{{ tooltipData.teamName || '-' }}</span>
</li>
<li class="detail-item" v-if="searchType=='2'||searchType=='3'">
<span class="label">车间订单号</span>
<span class="value">{{ tooltipData.woCode || '-' }}</span>
</li>
<li class="detail-item">
<span class="label">计划开始时间</span>
<span class="value">{{tooltipData.planStartTime || '-' }}</span>
</li>
<li class="detail-item">
<span class="label">实际开始时间</span>
<span class="value">{{ tooltipData.factStartTime || '-' }}</span>
</li>
<li class="detail-item">
<span class="label">计划完成时间</span>
<span class="value">{{tooltipData.planEndTime || '-' }}</span>
</li>
<li class="detail-item">
<span class="label">实际完成时间</span>
<span class="value">{{ tooltipData.factEndTime || '-' }}</span>
</li>
<li class="detail-item">
<span class="label">状态</span>
<span class="value">
<el-tag :type="tooltipData.status">{{
tooltipData.status || '未知'
}}</el-tag>
</span>
</li>
</ul>
</div> </div>
</div> </div>
</div> </div>
</basic-container> </div>
<!-- </basic-container> -->
</template> </template>
<script> <script>
import { getData } from '@/api/productionSchedulingPlan/scheduling';
export default { export default {
name: 'GanttChart', name: 'GanttChart',
data() { data() {
return { return {
searchType: '',
formLabelAlign: {
type: '1', //
startTime: '', //
teamName: '', //
equipName: '', //
woCode: '', //
},
rowHeight: 36, rowHeight: 36,
zoomLevel: 1, // (1-4) zoomLevel: 1, // (1-4)
minZoom: 1, minZoom: 1,
maxZoom: 4, maxZoom: 4,
// //
devices: [ devices: [],
'铜合金零件化学镀镍线(9652248)',
'铜合金化学镀镍烤箱(9652248-01)',
'铜合金化学镀镍烤箱(9652248-02)',
'铜合金化学镀镍烤箱(9652248-03)',
'铝合金化学镀镍生产线(9653582)',
'铝合金化学镀镍烤箱(9653582-01)',
'铝合金化学镀镍烤箱(9653582-02)',
'铝合金化学镀镍烤箱(9653582-03)',
'铝合金化学镀镍烤箱(9653582-04)',
'镀金生产线(9652249)',
'热表线烘箱(9652249-01)',
'热表线烘箱(9652249-02)',
'热表线烘箱(9652249-03)',
'热表线烘箱(9652249-04)',
'喷漆生产线(965396)',
'喷码机(9652055)',
'喷漆生产线(965396)',
'喷码机(9652055)',
],
// //
taskData: [ taskData: [],
{
device: '铜合金零件化学镀镍线(9652248)',
task: 'WO-N261026761',
start: '00:15',
end: '08:45',
status: '已完成',
},
{
device: '铜合金零件化学镀镍线(9652248)',
task: 'WO-N261026762',
start: '09:30',
end: '12:15',
status: '已完成',
},
{
device: '铜合金零件化学镀镍线(9652248)',
task: 'WO-N261026764',
start: '13:20',
end: '16:50',
status: '已完成',
},
{
device: '铜合金零件化学镀镍线(9652248)',
task: 'WO-N261026763',
start: '16:00',
end: '18:30',
status: '进行中',
},
{
device: '铜合金零件化学镀镍线(9652248)',
task: 'WO-N2610287265',
start: '19:10',
end: '23:45',
status: '未开始',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N261026727',
start: '09:15',
end: '11:30',
status: '已完成',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N261026729',
start: '12:20',
end: '14:40',
status: '已完成',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N261026721',
start: '15:50',
end: '17:20',
status: '进行中',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N2610287244',
start: '18:10',
end: '20:30',
status: '未开始',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N261026778',
start: '21:25',
end: '23:55',
status: '未开始',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N2610287244',
start: '18:10',
end: '20:30',
status: '未开始',
},
{
device: '铜合金化学镀镍烤箱(9652248-01)',
task: 'WO-N261026778',
start: '21:25',
end: '23:55',
status: '未开始',
},
],
// //
tooltipVisible: false, tooltipVisible: false,
tooltipData: {}, tooltipData: {},
tooltipX: 0, tooltipX: 0,
tooltipY: 0, tooltipY: 0,
option: {
menuSpan: 4,
submitBtn: false,
emptyBtn: false,
menuPosition: 'right',
column: [
{
label: '设备',
prop: 'name',
span: 5,
type: 'select',
dicData: [
{
label: '车间订单',
value: 1,
},
{
label: '设备',
value: 2,
},
{
label: '班组',
value: 3,
},
],
},
{
label: '车间订单号',
prop: 'name',
span: 5,
},
{
label: '班组',
prop: 'name',
span: 5,
type: 'select',
dicData: [
{
label: '班组1',
value: 1,
},
{
label: '班组2',
value: 2,
},
{
label: '班组3',
value: 3,
},
],
},
{
label: '时间',
prop: 'name',
span: 5,
type: 'date',
},
],
},
}; };
}, },
computed: { computed: {
@ -363,10 +311,102 @@ export default {
return labels; return labels;
}, },
}, },
mounted() {
this.searchType = this.formLabelAlign.type;
this.getData();
},
methods: { methods: {
getData() {
getData(this.formLabelAlign).then(res => {
console.log(99999, res.data.data);
this.processData(res.data.data);
});
},
processData(rawData) {
const tasks = [];
const workOrders = Object.keys(rawData);
//
workOrders.forEach(woCode => {
const woTasks = rawData[woCode] || [];
woTasks.forEach(task => {
tasks.push({
...task,
status: this.calcTaskStatus(task.startTime, task.endTime),
});
});
});
this.devices = workOrders;
this.taskData = tasks;
},
// //
calcTaskStatus(startTime, endTime) {
const now = new Date();
const current = now.getHours() * 60 + now.getMinutes();
const start = this.timeToMinutes(startTime);
let end = this.timeToMinutes(endTime);
//
if (end < start) {
end += 24 * 60;
}
if (current >= end) {
return '已完成';
} else if (current >= start) {
return '进行中';
} else {
return '未开始';
}
},
//
getTaskStatus(startTime, endTime) {
const now = new Date();
const currentHours = now.getHours();
const currentMinutes = now.getMinutes();
const currentTotal = currentHours * 60 + currentMinutes;
const startTotal = this.timeToMinutes(startTime);
const endTotal = this.timeToMinutes(endTime);
//
if (endTotal < startTotal) {
// [start, 24:00)[00:00, end)
if (currentTotal >= startTotal || currentTotal < endTotal) {
return '进行中';
} else if (currentTotal >= endTotal) {
return '已完成';
} else {
return '未开始';
}
} else {
//
if (currentTotal >= endTotal) {
return '已完成';
} else if (currentTotal >= startTotal) {
return '进行中';
} else {
return '未开始';
}
}
},
handleSubmit() {
this.searchType = this.formLabelAlign.type;
this.devices = [];
this.taskData = [];
this.getData();
},
// //
getDeviceTasks(device) { getDeviceTasks(device) {
return this.taskData.filter(task => task.device === device); if (this.searchType == '1') {
return this.taskData.filter(task => task.woCode === device);
}
if (this.searchType == '2') {
return this.taskData.filter(task => task.teamName === device);
}
if (this.searchType == '3') {
return this.taskData.filter(task => task.equipName === device);
}
}, },
// //
@ -738,4 +778,36 @@ export default {
.tooltip-content div { .tooltip-content div {
margin: 3px 0; margin: 3px 0;
} }
.wo-code-title {
font-size: 18px;
font-weight: bold;
color: #1f2d3d;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #e6e6e6;
}
.detail-list {
list-style: none;
padding: 0;
margin: 0;
.detail-item {
display: flex;
align-items: center;
margin-bottom: 12px;
line-height: 24px;
.label {
width: 100px;
color: #666;
font-weight: 500;
}
.value {
flex: 1;
color: #333;
}
}
}
</style> </style>

@ -1,561 +1,303 @@
<template> <template>
<basic-container> <basic-container>
<div class="search_box"> <div class="search_box"></div>
<avue-crud
</div> :option="option"
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" :table-loading="loading"
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" :data="data"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" v-model="form"
@refresh-change="refreshChange" @on-load="onLoad"> v-model:page="page"
<template #menu-left> ref="crud"
<!-- <el-button type="danger" @click="batchDel()">删除</el-button> --> @search-change="searchChange"
</template> @search-reset="searchReset"
<template #menu-right> @selection-change="selectionChange"
<!-- <el-button type="primary" @click="batchDel()">导入</el-button> --> @current-change="currentChange"
</template> @size-change="sizeChange"
<template #menu="{ row }"> @refresh-change="refreshChange"
@on-load="onLoad"
</template> >
<template #heatTreat="scope">
<!-- <el-tag v-if="scope.row.afterPlating" type="success"></el-tag>
<el-tag v-else type="warning"></el-tag> -->
</template>
</avue-crud> </avue-crud>
</basic-container>
</basic-container>
</template> </template>
<script> <script>
import { getYieldOrderList } from '@/api/productionSchedulingPlan/scheduling';
import {
add,
getRole,
getRoleAlias,
getRoleTreeById,
grant,
grantTree,
remove,
update,
} from '@/api/system/role';
import { mapGetters } from 'vuex';
import { validatenull } from '@/utils/validate';
export default { export default {
components: { components: {},
}, data() {
data() { return {
return { inBatchesOpen: false,
inBatchesOpen: false, platingSmallOpen: false,
platingSmallOpen: false, planOrderArr: [],
planOrderArr: [], isOpen: false,
isOpen: false, rowItem: {},
rowItem: {}, poId: null,
poId: null, form: {},
form: {}, box: false,
box: false, props: {
props: { label: 'title',
label: 'title', value: 'key',
value: 'key', },
}, menuGrantList: [],
menuGrantList: [], dataScopeGrantList: [],
dataScopeGrantList: [], apiScopeGrantList: [],
apiScopeGrantList: [], apiGrantList: [],
apiGrantList: [], menuTreeObj: [],
menuTreeObj: [], dataScopeTreeObj: [],
dataScopeTreeObj: [], apiScopeTreeObj: [],
apiScopeTreeObj: [], selectionList: [],
selectionList: [], query: {},
query: {}, loading: true,
loading: true, page: {
page: { pageSize: 10,
pageSize: 10, currentPage: 1,
currentPage: 1, total: 0,
total: 0, },
}, option: {
option: { columnSort: true,
columnSort: true, tip: false,
tip: false, height: 'auto',
height: 'auto', calcHeight: 32,
calcHeight: 32, simplePage: false,
simplePage: false, searchShow: true,
searchShow: true, searchMenuSpan: 6,
searchMenuSpan: 6, searchIcon: true,
searchIcon: true, searchIndex: 3,
searchIndex: 3, tree: false,
tree: false, border: true,
border: true, index: true,
index: true, selection: false,
selection: false, addBtn: false,
addBtn: false, editBtn: false,
editBtn: false, viewBtn: false,
viewBtn: false, delBtn: false,
delBtn: false, editBtnText: '修改',
editBtnText: '修改', labelWidth: 120,
labelWidth: 120, menuWidth: 80,
menuWidth: 80, dialogWidth: 900,
dialogWidth: 900, dialogClickModal: false,
dialogClickModal: false, searchEnter: true,
searchEnter: true, excelBtn: false,
excelBtn: false, filterBtn: true,
filterBtn: true, searchShowBtn: false,
searchShowBtn: false, excelBtn: true,
excelBtn: true, showOverflowTooltip: true,
showOverflowTooltip: true, addBtnIcon: ' ',
addBtnIcon: ' ', viewBtnIcon: ' ',
viewBtnIcon: ' ', delBtnIcon: ' ',
delBtnIcon: ' ', editBtnIcon: ' ',
editBtnIcon: ' ', gridBtn: false,
gridBtn: false, searchLabelPosition: 'left',
searchLabelPosition: 'left', searchGutter: 24,
searchGutter: 24, searchSpan: 6,
searchSpan: 6, menuAlign: 'left',
menuAlign: 'left', gridBtn: false,
gridBtn: false, searchMenuPosition: 'right',
searchMenuPosition: 'right', align: 'center',
align: 'center', menu: false,
column: [ column: [
{ {
label: '异常原因', label: '异常原因',
prop: 'partCode', prop: 'errorInfo',
search: false, search: false,
sortable: true, sortable: true,
width: 150, width: 150,
span: 12, span: 12,
},
}, // {
{ // label: '',
label: '处理方式', // prop: 'partName',
prop: 'partName', // search: false,
search: false, // sortable: true,
sortable: true, // width: 150,
width: 150, // span: 12,
span: 12, // },
}, {
{ label: '调度员',
label: '调度员', prop: 'planUser',
prop: 'cycle', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
}, {
{ label: '生产单号',
label: '生产单号', prop: 'yoCode',
prop: 'material', search: true,
search: true, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, display: false,
display: false, },
}, {
{ label: '计划单号',
label: '计划单号', prop: 'ypCode',
prop: 'plate', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, display: false,
display: false, },
}, {
{ label: '订单优先级',
label: '订单优先级', prop: 'priority',
prop: 'craftWay', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, display: false,
display: false, },
}, {
{ label: '零件号',
label: '零件号', prop: 'partCode',
prop: 'chlidPart', search: true,
search: true, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
}, {
{ label: '零件名称',
label: '零件名称', prop: 'partName',
prop: 'remindContent', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
}, {
{ label: '产品型号',
label: '产品型号', prop: 'productType',
prop: 'parameter', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
}, {
{ label: '批次号',
label: '批次号', prop: 'batchNo',
prop: 'metalsTest', search: true,
search: true, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
}, {
{ label: '流程卡号',
label: '流程卡号', prop: 'cardNo',
prop: 'silverTest', search: true,
search: true, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, display: false,
display: false, },
}, {
{ label: '流转编码',
label: '流转编码', prop: 'roamNo',
prop: 'heatTreat', search: true,
search: true, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
type: 'switch', {
label: '镀种',
}, prop: 'plate',
{ search: false,
label: '镀种', sortable: true,
prop: 'afterPlating', width: 150,
search: false, span: 12,
sortable: true, },
width: 150, {
span: 12, label: '生产标识',
prop: 'productIdent',
}, search: false,
{ sortable: true,
label: '生产标识', width: 150,
prop: 'afterPlating', span: 12,
search: false, },
sortable: true, {
width: 150, label: '生产数量',
span: 12, prop: 'ypQty',
search: false,
}, sortable: true,
{ width: 150,
label: '生产数量', span: 12,
prop: 'afterPlating', },
search: false, {
sortable: true, label: '面积(d㎡)',
width: 150, prop: 'ypArea',
span: 12, search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '需求交期',
prop: 'demandDate',
search: false,
sortable: true,
width: 150,
span: 12,
},
}, {
{ label: '计划下达时间',
label: '面积(d㎡)', prop: 'releaseDate',
prop: 'afterPlating', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
}, {
{ label: '备注',
label: '需求交期', prop: 'memo',
prop: 'afterPlating', search: false,
search: false, sortable: true,
sortable: true, width: 150,
width: 150, span: 12,
span: 12, },
],
},
}, data: [],
isRushOpen: false, //
{ isBatchOpen: false, //
label: '计划下达时间', };
prop: 'afterPlating', },
search: false, methods: {
sortable: true, searchReset() {
width: 150, this.query = {};
span: 12, this.onLoad(this.page);
},
}, searchChange(params, done) {
this.query = params;
{ this.page.currentPage = 1;
label: '备注', this.onLoad(this.page, params);
prop: 'afterPlating', done();
search: false, },
sortable: true, currentChange(currentPage) {
width: 150, this.page.currentPage = currentPage;
span: 12, },
sizeChange(pageSize) {
}, this.page.pageSize = pageSize;
},
], refreshChange() {
}, this.onLoad(this.page, this.query);
data: [],
isRushOpen: false,//
isBatchOpen: false,//
};
}, },
methods: {
//
batchReceiving() {
this.$confirm('确定将选择数据批量接收?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
// return remove(row.id);
})
.then(() => {
// this.onLoad(this.page);
// this.$message({
// type: 'success',
// message: '!',
// });
});
},
//
batchDel() {
this.$confirm('确定将选择数据批量删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
// return remove(row.id);
})
.then(() => {
// this.onLoad(this.page);
// this.$message({
// type: 'success',
// message: '!',
// });
});
},
//
rushFn() {
this.isRushOpen = true
},
closeDialog() {
this.isRushOpen = false
this.isBatchOpen = false
},
inBatchesFn(row) {
this.rowItem = row;
this.isBatchOpen = true;
},
subclass() {
this.platingSmallOpen = true;
},
lookProcessRoute(row) {
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();
},
error => {
window.console.log(error);
loading();
}
);
},
rowUpdate(row, index, done, loading) {
update(row).then(
() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!',
});
done();
},
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: '操作成功!',
});
});
},
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: '操作成功!',
});
},
onLoad(page, params = {}) {
this.loading = true;
this.data = [
] onLoad(page, params = {}) {
this.page.total = this.data.length this.loading = true;
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { this.data = [];
// this.data = res.data.data.records; getYieldOrderList(
this.loading = false; page.currentPage,
// this.page.total = res.data.data.total page.pageSize,
// this.selectionClear(); Object.assign(params, this.query, { status: 6 })
// }); ).then(res => {
}, this.data = res.data.data.records;
this.loading = false;
this.page.total = res.data.data.total;
});
}, },
mounted() { },
}
}; };
</script> </script>

Loading…
Cancel
Save