排产代码提交

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

@ -1,11 +1,50 @@
<template>
<basic-container>
<avue-form :option="option" @submit="submit" @error="error">
<template #menu-form>
<el-button type="primary" icon="el-icon-search" @click="handleSubmit"> 搜索 </el-button>
<el-button icon="el-icon-delete" @click="handleSubmit"> 清空 </el-button>
</template>
</avue-form>
<!-- <basic-container> -->
<div>
<el-form label-width="80px" :model="formLabelAlign">
<el-row>
<el-col :span="6">
<el-form-item label="维度:">
<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">
<!-- 头部标题和图例 -->
@ -31,12 +70,33 @@
<div class="gantt-wrapper">
<!-- 左侧设备列表 -->
<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
v-for="(device, index) in devices"
:key="index"
class="device-item"
:style="{ height: rowHeight + 'px' }"
:title="device"
>
{{ device }}
</div>
@ -123,14 +183,16 @@
:key="taskIndex"
class="task-bar"
:style="{
left: `${getPositionPercent(task.start)}%`,
width: `${getWidthPercent(task.start, task.end)}%`,
left: `${getPositionPercent(task.startTime)}%`,
width: `${getWidthPercent(task.startTime, task.endTime)}%`,
backgroundColor: getStatusColor(task.status),
}"
@mouseenter="showTooltip($event, task, device)"
@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>
@ -148,200 +210,86 @@
}"
>
<div class="tooltip-content">
<div><strong>设备</strong>{{ tooltipData.device }}</div>
<div><strong>任务</strong>{{ tooltipData.task }}</div>
<div><strong>时间</strong>{{ tooltipData.start }} - {{ tooltipData.end }}</div>
<div><strong>状态</strong>{{ tooltipData.status }}</div>
<!-- 工单标题 -->
<div class="wo-code-title" v-if="searchType=='1'">{{ tooltipData.woCode }}</div>
<div class="wo-code-title" v-if="searchType=='2'">{{ tooltipData.teamName }}</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>
</basic-container>
</div>
<!-- </basic-container> -->
</template>
<script>
import { getData } from '@/api/productionSchedulingPlan/scheduling';
export default {
name: 'GanttChart',
data() {
return {
searchType: '',
formLabelAlign: {
type: '1', //
startTime: '', //
teamName: '', //
equipName: '', //
woCode: '', //
},
rowHeight: 36,
zoomLevel: 1, // (1-4)
minZoom: 1,
maxZoom: 4,
//
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)',
],
devices: [],
//
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: '未开始',
},
],
taskData: [],
//
tooltipVisible: false,
tooltipData: {},
tooltipX: 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: {
@ -363,10 +311,102 @@ export default {
return labels;
},
},
mounted() {
this.searchType = this.formLabelAlign.type;
this.getData();
},
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) {
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 {
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>

@ -1,561 +1,303 @@
<template>
<basic-container>
<div class="search_box">
</div>
<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="danger" @click="batchDel()">删除</el-button> -->
</template>
<template #menu-right>
<!-- <el-button type="primary" @click="batchDel()">导入</el-button> -->
</template>
<template #menu="{ row }">
</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>
</basic-container>
<basic-container>
<div class="search_box"></div>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
</avue-crud>
</basic-container>
</template>
<script>
import {
add,
getRole,
getRoleAlias,
getRoleTreeById,
grant,
grantTree,
remove,
update,
} from '@/api/system/role';
import { mapGetters } from 'vuex';
import { validatenull } from '@/utils/validate';
import { getYieldOrderList } from '@/api/productionSchedulingPlan/scheduling';
export default {
components: {
},
data() {
return {
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: true,
selection: false,
addBtn: false,
editBtn: false,
viewBtn: false,
delBtn: false,
editBtnText: '修改',
labelWidth: 120,
menuWidth: 80,
dialogWidth: 900,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
excelBtn: true,
showOverflowTooltip: true,
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
gridBtn: false,
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
align: 'center',
column: [
{
label: '异常原因',
prop: 'partCode',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '处理方式',
prop: 'partName',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '调度员',
prop: 'cycle',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '生产单号',
prop: 'material',
search: true,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '计划单号',
prop: 'plate',
search: false,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '订单优先级',
prop: 'craftWay',
search: false,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '零件号',
prop: 'chlidPart',
search: true,
sortable: true,
width: 150,
span: 12,
},
{
label: '零件名称',
prop: 'remindContent',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '产品型号',
prop: 'parameter',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '批次号',
prop: 'metalsTest',
search: true,
sortable: true,
width: 150,
span: 12,
},
{
label: '流程卡号',
prop: 'silverTest',
search: true,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '流转编码',
prop: 'heatTreat',
search: true,
sortable: true,
width: 150,
span: 12,
type: 'switch',
},
{
label: '镀种',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '生产标识',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '生产数量',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '面积(d㎡)',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '需求交期',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '计划下达时间',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '备注',
prop: 'afterPlating',
search: false,
sortable: true,
width: 150,
span: 12,
},
],
},
components: {},
data() {
return {
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: true,
selection: false,
addBtn: false,
editBtn: false,
viewBtn: false,
delBtn: false,
editBtnText: '修改',
labelWidth: 120,
menuWidth: 80,
dialogWidth: 900,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
excelBtn: true,
showOverflowTooltip: true,
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
gridBtn: false,
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
align: 'center',
menu: false,
column: [
{
label: '异常原因',
prop: 'errorInfo',
search: false,
sortable: true,
width: 150,
span: 12,
},
// {
// label: '',
// prop: 'partName',
// search: false,
// sortable: true,
// width: 150,
// span: 12,
// },
{
label: '调度员',
prop: 'planUser',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '生产单号',
prop: 'yoCode',
search: true,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '计划单号',
prop: 'ypCode',
search: false,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '订单优先级',
prop: 'priority',
search: false,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '零件号',
prop: 'partCode',
search: true,
sortable: true,
width: 150,
span: 12,
},
{
label: '零件名称',
prop: 'partName',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '产品型号',
prop: 'productType',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '批次号',
prop: 'batchNo',
search: true,
sortable: true,
width: 150,
span: 12,
},
{
label: '流程卡号',
prop: 'cardNo',
search: true,
sortable: true,
width: 150,
span: 12,
display: false,
},
{
label: '流转编码',
prop: 'roamNo',
search: true,
sortable: true,
width: 150,
span: 12,
},
{
label: '镀种',
prop: 'plate',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '生产标识',
prop: 'productIdent',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '生产数量',
prop: 'ypQty',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '面积(d㎡)',
prop: 'ypArea',
search: false,
sortable: true,
width: 150,
span: 12,
},
{
label: '需求交期',
prop: 'demandDate',
search: false,
sortable: true,
width: 150,
span: 12,
},
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: '操作成功!',
});
});
},
{
label: '计划下达时间',
prop: 'releaseDate',
search: false,
sortable: true,
width: 150,
span: 12,
},
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: '操作成功!',
});
},
{
label: '备注',
prop: 'memo',
search: false,
sortable: true,
width: 150,
span: 12,
},
],
},
onLoad(page, params = {}) {
this.loading = true;
this.data = [
data: [],
isRushOpen: false, //
isBatchOpen: false, //
};
},
methods: {
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
]
this.page.total = this.data.length
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// this.data = res.data.data.records;
this.loading = false;
// this.page.total = res.data.data.total
// this.selectionClear();
// });
},
onLoad(page, params = {}) {
this.loading = true;
this.data = [];
getYieldOrderList(
page.currentPage,
page.pageSize,
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>

Loading…
Cancel
Save