Browse Source

检验任务执行和接单合并

linshi20240813
zhang_li 3 months ago
parent
commit
c75b3b76b3
  1. 58
      src/views/qms/inspectionJob/index.vue

58
src/views/qms/inspectionJob/index.vue

@ -4,10 +4,12 @@
<Search <Search
:schema="InspectionJobMain.allSchemas.searchSchema" :schema="InspectionJobMain.allSchemas.searchSchema"
@search="setSearchParams" @search="setSearchParams"
@reset="setSearchParams({ @reset="
setSearchParams({
available: true, available: true,
excludeInspectionType: '1,4' excludeInspectionType: '1,4'
})" })
"
/> />
</ContentWrap> </ContentWrap>
@ -23,7 +25,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -60,6 +63,7 @@
:rules="InspectionJobMainRules" :rules="InspectionJobMainRules"
:formAllSchemas="InspectionJobMain.allSchemas" :formAllSchemas="InspectionJobMain.allSchemas"
@submitForm="submitForm" @submitForm="submitForm"
@close="getList"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
@ -122,6 +126,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import Detail from './detail.vue' import Detail from './detail.vue'
import { getReportUrl } from '@/utils/systemParam' import { getReportUrl } from '@/utils/systemParam'
import { useUserStore } from '@/store/modules/user'
// //
defineOptions({ name: 'inspectionJobMain' }) defineOptions({ name: 'inspectionJobMain' })
@ -132,7 +137,7 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns) const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns)
const userStore = useUserStore()
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = 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) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListJobAccBtn({ // defaultButtons.mainListJobAccBtn({
hide: isShowMainButton(row, ['1']), // hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-job-main:accept' // hasPermi: 'qms:inspection-job-main:accept'
}), // // }), //
defaultButtons.mainListJobCloBtn({ defaultButtons.mainListJobCloBtn({
hide: isShowMainButton(row, ['1']), hide: isShowMainButton(row, ['1']),
hasPermi: 'qms:inspection-job-main:close' hasPermi: 'qms:inspection-job-main:close'
}), // }), //
defaultButtons.mainListJobAbaBtn({ defaultButtons.mainListJobAbaBtn({
hide: isShowMainButton(row, ['2']), hide: isShowMainButton1(row, ['2']),
hasPermi: 'qms:inspection-job-main:abandon' hasPermi: 'qms:inspection-job-main:abandon'
}), // }), //
defaultButtons.mainListJobExeBtn({ defaultButtons.mainListJobExeBtn({
hide: isShowMainButton(row, ['2']), hide: isShowMainButton(row, ['1', '2']),
hasPermi: 'qms:inspection-job-main:execute' hasPermi: 'qms:inspection-job-main:execute'
}), // }), //
defaultButtons.mainListOrderPubBtn({ defaultButtons.mainListOrderPubBtn({
@ -299,9 +316,10 @@ const showQualityReport = ref(false)
const qualityReport = ref('') const qualityReport = ref('')
const checkQualityReport = async (row) => { const checkQualityReport = async (row) => {
showQualityReport.value = true showQualityReport.value = true
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}` qualityReport.value =getReportUrl()+'purchasereceiptReport?asnNumber=' + row.asnNumber
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
// const formRef = ref() // const formRef = ref()
// const openForm = async (type : string, row ?: number) => { // const openForm = async (type : string, row ?: number) => {
@ -317,8 +335,18 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
// //
const formRef = ref() 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) 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) => { const handleClose = async (id: number) => {
@ -348,12 +376,12 @@ const handleRelease = async (id: number) => {
const handleAccept = async (id: number) => { const handleAccept = async (id: number) => {
try { try {
// //
await message.confirm(t('common.confirmAccept')) // await message.confirm(t('common.confirmAccept'))
// //
await InspectionJobMainApi.acceptInspectionJobMain(id) await InspectionJobMainApi.acceptInspectionJobMain(id)
message.success(t('common.acceptSuccess')) // message.success(t('common.acceptSuccess'))
// (TB) // (TB)
buttonBaseClick('refresh',null) // buttonBaseClick('refresh', null)
} catch {} } catch {}
} }
// //

Loading…
Cancel
Save