|
|
@ -27,13 +27,13 @@ |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
|
<template #planMaserCode="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.planMaserCode)"> |
|
|
|
<template #schedulingCode="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '工单详情', row.schedulingCode)"> |
|
|
|
<span>{{ row.planMaserCode }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -81,6 +81,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from './components/Detail.vue' |
|
|
|
import { async } from '@antv/x6/lib/registry/marker/async' |
|
|
|
|
|
|
|
defineOptions({ name: 'MesWorkScheduling' }) |
|
|
|
|
|
|
@ -100,7 +101,15 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
//console.log('row',row) |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -115,9 +124,9 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:workScheduling:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:workScheduling:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:workScheduling:export'}), // 导出 |
|
|
|
//defaultButtons.defaultAddBtn({hasPermi:'mes:workScheduling:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'mes:workScheduling:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'mes:workScheduling:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -146,19 +155,36 @@ const buttonBaseClick = (val, item) => { |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// ONERROR("-3", "异常"), |
|
|
|
// TERMINALE("-2", "已终止"), |
|
|
|
// WAITBEGIN("-1", "待齐套"), |
|
|
|
// READYTODO("0", "待开工"), |
|
|
|
// WORKING("1", "生产中"), |
|
|
|
// WAITMATERIAL("2", "待配料"), |
|
|
|
// PAUSE("3", "已暂停"), |
|
|
|
// WAITREPORT("4", "待报工"), |
|
|
|
// WAITFCHECK("5", "待质检"), |
|
|
|
// FINISHED("9", "已完成"); |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:workScheduling:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:workScheduling:delete'}), // 删除 |
|
|
|
] |
|
|
|
const butttondata=(row) =>{ return [ |
|
|
|
defaultButtons.mainListEditBtn({label:"调序",hasPermi:'mes:workScheduling:update'}), // 编辑 |
|
|
|
//defaultButtons.mainListDeleteBtn({hasPermi:'mes:workScheduling:delete'}), // 删除 |
|
|
|
defaultButtons.mainListHandleBtn({label:"终止",name:'terminate',hide: isShowMainButton(row,['-1','0']),hasPermi:'mes:workScheduling:update'}), // |
|
|
|
defaultButtons.mainListHandleBtn({label:"暂停",name:'pause',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}), |
|
|
|
defaultButtons.mainListHandleBtn({label:"恢复",name:'resume',hide: isShowMainButton(row,['3']),hasPermi:'mes:workScheduling:update'}), |
|
|
|
//defaultButtons.mainListHandleBtn({label:"变更",name:'change', hasPermi:'mes:workScheduling:update'}), // |
|
|
|
]} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'terminate') { // 终止 |
|
|
|
changeBillStatus(row,"-2") |
|
|
|
}else if (val == 'pause') { // 暂停 |
|
|
|
changeBillStatus(row,"3") |
|
|
|
}else if (val == 'resume') { // 恢复 |
|
|
|
changeBillStatus(row,"0") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -197,18 +223,15 @@ const detailRef = ref() |
|
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkScheduling') |
|
|
|
} |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
try { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
// 发起删除 |
|
|
|
await WorkSchedulingApi.deleteWorkScheduling(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
// 改变工单状态 |
|
|
|
const changeBillStatus=async(row,status)=>{ |
|
|
|
///message.alertWarning("暂不支持该功能") |
|
|
|
let data={ |
|
|
|
id:row.id, |
|
|
|
status:status |
|
|
|
} |
|
|
|
WorkSchedulingApi.updateWorkSchedulingStatus(data); |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|