|
|
@ -4,10 +4,12 @@ |
|
|
|
<Search |
|
|
|
:schema="InspectionJobMain.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams({ |
|
|
|
@reset=" |
|
|
|
setSearchParams({ |
|
|
|
available: true, |
|
|
|
excludeInspectionType: '1,4' |
|
|
|
})" |
|
|
|
}) |
|
|
|
" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
@ -23,7 +25,8 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable |
|
|
|
<Table |
|
|
|
v-clientTable |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
@ -60,6 +63,7 @@ |
|
|
|
:rules="InspectionJobMainRules" |
|
|
|
:formAllSchemas="InspectionJobMain.allSchemas" |
|
|
|
@submitForm="submitForm" |
|
|
|
@close="getList" |
|
|
|
/> |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
@ -122,6 +126,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import AddForm from './addForm.vue' |
|
|
|
import Detail from './detail.vue' |
|
|
|
import { getReportUrl } from '@/utils/systemParam' |
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
|
|
|
|
// 采购订单 |
|
|
|
defineOptions({ name: 'inspectionJobMain' }) |
|
|
@ -132,7 +137,7 @@ const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
const userStore = useUserStore() |
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -235,23 +240,35 @@ const isShowMainButton2 = (row, val) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton1 = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
if (userStore.getUser.id == row.acceptUserId) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListJobAccBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'qms:inspection-job-main:accept' |
|
|
|
}), // 承接 |
|
|
|
// defaultButtons.mainListJobAccBtn({ |
|
|
|
// hide: isShowMainButton(row, ['1']), |
|
|
|
// hasPermi: 'qms:inspection-job-main:accept' |
|
|
|
// }), // 承接 |
|
|
|
defaultButtons.mainListJobCloBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'qms:inspection-job-main:close' |
|
|
|
}), // 关闭 |
|
|
|
defaultButtons.mainListJobAbaBtn({ |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
hide: isShowMainButton1(row, ['2']), |
|
|
|
hasPermi: 'qms:inspection-job-main:abandon' |
|
|
|
}), // 放弃 |
|
|
|
defaultButtons.mainListJobExeBtn({ |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
hide: isShowMainButton(row, ['1', '2']), |
|
|
|
hasPermi: 'qms:inspection-job-main:execute' |
|
|
|
}), // 执行 |
|
|
|
defaultButtons.mainListOrderPubBtn({ |
|
|
@ -299,9 +316,10 @@ const showQualityReport = ref(false) |
|
|
|
const qualityReport = ref('') |
|
|
|
const checkQualityReport = async (row) => { |
|
|
|
showQualityReport.value = true |
|
|
|
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}` |
|
|
|
qualityReport.value =getReportUrl()+'purchasereceiptReport?asnNumber=' + row.asnNumber |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
// const formRef = ref() |
|
|
|
// const openForm = async (type : string, row ?: number) => { |
|
|
@ -317,8 +335,18 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
//执行 |
|
|
|
|
|
|
|
const formRef = ref() |
|
|
|
const execute = async (type: string, row?: number) => { |
|
|
|
const execute = async (type: string, row?: any) => { |
|
|
|
if (row.status == '2') { |
|
|
|
if (userStore.getUser.id == row.acceptUserId) { |
|
|
|
formRef.value.open(type, row) |
|
|
|
} else { |
|
|
|
message.error('承接人与当前登录人不一致') |
|
|
|
} |
|
|
|
} else if (row.status == '1') { |
|
|
|
await handleAccept(row.id) |
|
|
|
formRef.value.open(type, row) |
|
|
|
await getList() |
|
|
|
} |
|
|
|
} |
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleClose = async (id: number) => { |
|
|
@ -348,12 +376,12 @@ const handleRelease = async (id: number) => { |
|
|
|
const handleAccept = async (id: number) => { |
|
|
|
try { |
|
|
|
// 承接的二次确认 |
|
|
|
await message.confirm(t('common.confirmAccept')) |
|
|
|
// await message.confirm(t('common.confirmAccept')) |
|
|
|
// 发起承接 |
|
|
|
await InspectionJobMainApi.acceptInspectionJobMain(id) |
|
|
|
message.success(t('common.acceptSuccess')) |
|
|
|
// message.success(t('common.acceptSuccess')) |
|
|
|
// 刷新列表(TB反馈,取消承接后刷新页面) |
|
|
|
buttonBaseClick('refresh',null) |
|
|
|
// buttonBaseClick('refresh', null) |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
// 放弃任务 |
|
|
|