gaojs
3 months ago
32 changed files with 121 additions and 6213 deletions
File diff suppressed because it is too large
@ -1,194 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading"> |
|||
<template #header> |
|||
<div class="font-size-18px"> |
|||
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> |
|||
</div> |
|||
</template> |
|||
<ContentWrap v-if="!isBasic"> |
|||
<Descriptions :data="data" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="allSchemas.detailSchema" :columns="2" width="200px" /> |
|||
</ContentWrap> |
|||
<ContentWrap> |
|||
<el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false"> |
|||
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name"> |
|||
<div class="small-title">检验工序</div> |
|||
<el-form :model="item" label-width="auto" ref="formProcessRef"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码" prop="processCode"> |
|||
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="processDescribe"> |
|||
<el-input v-model="item.processDescribe" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="顺序号" prop="sequenceCode"> |
|||
<el-input v-model="item.sequenceCode" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="small-title">检验特性</div> |
|||
<el-form :model="item" label-width="auto" ref="formFeaturesRef"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.number" placeholder="根据系统生成" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName" disabled placeholder="请选择检验方法" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsRespVO.samplingProcessCode"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="12"> |
|||
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入每份样品量" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate"> |
|||
<el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"> |
|||
<el-select v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event,item)" disabled> |
|||
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType"> |
|||
<el-select v-model="item.inspectionJobCharacteristicsRespVO.featureType" placeholder="请选择特征类型" @change="changeFeatureType" disabled> |
|||
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</ContentWrap> |
|||
</el-drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail' |
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
|
|||
defineOptions({ name: 'Detail' }) |
|||
|
|||
const editableTabsValue = ref('1') |
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const updateKey = ref(0) |
|||
|
|||
const props = defineProps({ |
|||
// 表单,列表 相关信息 |
|||
allSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 明细列表相关信息 |
|||
detailAllSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 详情列表扩展操作按钮 |
|||
buttondataTable: { |
|||
type: Array, |
|||
required: false, |
|||
default: ()=>{ |
|||
return [] |
|||
} |
|||
}, |
|||
}) |
|||
const isShowDrawer = ref(false) |
|||
const detailLoading = ref(false) |
|||
const data = ref({ |
|||
code: '', |
|||
itemCode: '', |
|||
version: '', |
|||
testTypeCode: '', |
|||
programmeTemplateCode: '', |
|||
splitRule: '', |
|||
aql: '', |
|||
inspectionLevel: '', |
|||
effectiveDate: '', |
|||
expirationDate: '', |
|||
available: 'TRUE', |
|||
subList: [] |
|||
}) |
|||
|
|||
/** 打开弹窗 */ |
|||
const formRef = ref() |
|||
const titleNameRef = ref() |
|||
const titleValueRef = ref() |
|||
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|||
titleNameRef.value = titleName |
|||
titleValueRef.value = titleValue |
|||
|
|||
isShowDrawer.value = true |
|||
if (row) { |
|||
detailLoading.value = true |
|||
try { |
|||
data.value = row |
|||
let list = [] |
|||
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id) |
|||
list.forEach((item, index) => { |
|||
editableTabsValue.value = index + 1 |
|||
item.name = index + 1 |
|||
}) |
|||
data.value.subList = list |
|||
} finally { |
|||
detailLoading.value = false |
|||
} |
|||
} |
|||
} |
|||
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
|
|||
</script> |
|||
<style lang="scss"> |
|||
.el-drawer__body { |
|||
background: #f5f5f5 !important; |
|||
} |
|||
|
|||
::v-deep(.label-class-name) { |
|||
color: #dedede; |
|||
} |
|||
</style> |
|||
<style scoped lang="scss"></style> |
@ -1,442 +0,0 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search |
|||
:schema="InspectionJobMain.allSchemas.searchSchema" |
|||
@search="setSearchParams" |
|||
@reset="setSearchParams({ |
|||
available: true, |
|||
inspectionType: '4' |
|||
})" |
|||
/> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="InspectionJobMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table v-clientTable |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{ row }"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="butttondata(row)" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<AddForm |
|||
ref="formRef" |
|||
basicFormWidth="80" |
|||
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas" |
|||
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas" |
|||
:formAllSchemasMain="InspectionTemplateMain.allSchemas" |
|||
:tableAllSchemas="InspectionJobPackage.allSchemas" |
|||
:tableFormRules="InspectionJobPackageRules" |
|||
:rules="InspectionJobMainRules" |
|||
:formAllSchemas="InspectionJobMain.allSchemas" |
|||
@submitForm="submitForm" |
|||
/> |
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="InspectionJobMain.allSchemas" |
|||
:detailAllSchemas="InspectionJobDetail.allSchemas" |
|||
:detailAllSchemasRules="InspectionJobDetailRules" |
|||
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail" |
|||
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail" |
|||
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage" |
|||
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" |
|||
@searchTableSuccessDetail="searchTableSuccessDetail" |
|||
:isShowAddBtn="false" |
|||
:detailButtonIsShow="true" |
|||
/> |
|||
<!-- 包装信息 --> |
|||
<ListTable |
|||
ref="listTableRef" |
|||
titleName="包装信息" |
|||
:allSchemas="InspectionJobMain.allSchemas" |
|||
:detailAllSchemas="InspectionJobPackage.allSchemas" |
|||
:detailAllSchemasRules="InspectionJobPackageRules" |
|||
:list="list" |
|||
/> |
|||
<el-dialog |
|||
v-model="showQualityReport" |
|||
:title="t('质检明细')" |
|||
:append-to-body="false" |
|||
destroy-on-close |
|||
fullscreen |
|||
> |
|||
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { |
|||
InspectionJobMain, |
|||
InspectionJobMainRules, |
|||
InspectionJobDetail, |
|||
InspectionJobDetailRules, |
|||
InspectionJobPackage, |
|||
InspectionJobPackageRules |
|||
} from './inspectionJobMain.data' |
|||
import { |
|||
InspectionTemplateMain, |
|||
InspectionTemplateProcess, |
|||
InspectionTemplateFeatures, |
|||
InspectionTemplateRules |
|||
} from '../inspectionTemplate/inspectionTemplate.data' |
|||
|
|||
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage' |
|||
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain' |
|||
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import ListTable from '@/components/ListTable/src/ListTable.vue' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import AddForm from './addForm.vue' |
|||
import Detail from './detail.vue' |
|||
import { getReportUrl } from '@/utils/systemParam' |
|||
|
|||
// 采购订单 |
|||
defineOptions({ name: 'inspectionJobMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|||
nextTick(async () => { |
|||
if (type == 'tableForm') { |
|||
// 明细查询页赋值 |
|||
row[formField] = val[0][searchField] |
|||
// row['itemNumber'] = val[0]['number'] |
|||
// row['itemName'] = val[0]['name'] |
|||
// row['uom'] = val[0]['uom'] |
|||
// row['isRadeIn'] = val[0]['isRadeIn'] |
|||
// row['available'] = val[0]['available'] |
|||
} else { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
// 查询页面返回——详情 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|||
nextTick(async () => { |
|||
const setV = {} |
|||
// if(formField == 'itemCode'){ |
|||
// await ItembasicApi.getItembasicPage({ |
|||
// code: setV['itemCode'] |
|||
// }).then(res => { |
|||
// setV['uom'] = res.list[0].uom |
|||
// setV[formField] = val[0][searchField] |
|||
// }) |
|||
// } |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 子表新增的时候选择表格之后需要会显得字段 |
|||
const Echo = [] |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: InspectionJobMainApi.getInspectionJobMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn(null), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null) // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { |
|||
// 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { |
|||
// 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { |
|||
// 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { |
|||
// 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { |
|||
// 筛选 |
|||
} else { |
|||
// 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton2 = (row, val) => { |
|||
if (val.indexOf(row.isStaging) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return [ |
|||
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']), |
|||
hasPermi: 'qms:inspection-job-main:abandon' |
|||
}), // 放弃 |
|||
defaultButtons.mainListJobExeBtn({ |
|||
hide: isShowMainButton(row, ['2']), |
|||
hasPermi: 'qms:inspection-job-main:execute' |
|||
}), // 执行 |
|||
defaultButtons.mainListOrderPubBtn({ |
|||
hide: isShowMainButton2(row, ['TRUE']), |
|||
hasPermi: 'qms:inspection-job-main:execute' |
|||
}), // 发布 |
|||
defaultButtons.mainListPackageBtn(null), // 包装 |
|||
defaultButtons.mainListPlanCheckQualityReportBtn({}) // 查看质检报告 |
|||
] |
|||
} |
|||
const listTableRef = ref() |
|||
const list = ref([]) |
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'mainJobExe') { |
|||
// 执行 |
|||
execute('execute', row) |
|||
} else if (val == 'mainPackage') { |
|||
// 包装 |
|||
|
|||
list.value = await InspectionJobPackageApi.getInspectionJobPackageList(row.id) |
|||
// row.status = '1' |
|||
listTableRef.value.openPackage(row, '包装信息', InspectionJobPackage.allSchemas.tableColumns) |
|||
} else if (val == 'mainJobAba') { |
|||
// 放弃 |
|||
handleAbandon(row.id) |
|||
} else if (val == 'mainJobClo') { |
|||
// 关闭 |
|||
handleClose(row.id) |
|||
} else if (val == 'mainOrderPub') { |
|||
// 发布 |
|||
handleRelease(row.id) |
|||
} else if (val == 'mainPlanCheckQualityReport') { |
|||
// 查看质检报告 |
|||
checkQualityReport(row) |
|||
} else if (val == 'mainJobAcc') { |
|||
// 承接 |
|||
handleAccept(row.id) |
|||
} |
|||
} |
|||
|
|||
// 查看质检报告 |
|||
// 查看质检报告 |
|||
const reportHeight = ref(window.innerHeight - 120) |
|||
const showQualityReport = ref(false) |
|||
const qualityReport = ref('') |
|||
const checkQualityReport = async (row) => { |
|||
showQualityReport.value = true |
|||
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}` |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
// const formRef = ref() |
|||
// const openForm = async (type : string, row ?: number) => { |
|||
// tableData.value = [] // 重置明细数据 |
|||
// formRef.value.open(type, row) |
|||
// } |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') |
|||
} |
|||
//执行 |
|||
|
|||
const formRef = ref() |
|||
const execute = async (type: string, row?: number) => { |
|||
formRef.value.open(type, row) |
|||
} |
|||
/** 关闭按钮操作 */ |
|||
const handleClose = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.confirm(t('common.confirmColse')) |
|||
// 发起删除 |
|||
await InspectionJobMainApi.closeInspectionJobMain(id) |
|||
message.success(t('common.closeSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
/** 发布按钮操作 */ |
|||
const handleRelease = async (id: number) => { |
|||
try { |
|||
// 发布的二次确认 |
|||
await message.confirm('确认发布吗?') |
|||
// 发起发布 |
|||
await InspectionJobMainApi.releaseInspectionJobMain(id) |
|||
message.success('发布成功!') |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
// 承接 |
|||
const handleAccept = async (id: number) => { |
|||
try { |
|||
// 承接的二次确认 |
|||
await message.confirm(t('common.confirmAccept')) |
|||
// 发起承接 |
|||
await InspectionJobMainApi.acceptInspectionJobMain(id) |
|||
message.success(t('common.acceptSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
// 放弃任务 |
|||
const handleAbandon = async (id: number) => { |
|||
try { |
|||
// 放弃的二次确认 |
|||
await message.confirm(t('common.confirmGiveup')) |
|||
// 发起放弃 |
|||
await InspectionJobMainApi.abandonInspectionJobMain(id) |
|||
message.success(t('common.giveupSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await InspectionJobMainApi.exportInspectionJobMain(tableObject.params) |
|||
download.excel(data, '检验任务.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* tableForm方法 |
|||
*/ |
|||
const tableFormKeys = {} |
|||
InspectionJobDetail.allSchemas.tableFormColumns.forEach((item) => { |
|||
tableFormKeys[item.field] = item.default ? item.default : '' |
|||
}) |
|||
const tableData = ref([]) |
|||
|
|||
// 主子数据 提交 |
|||
const submitForm = async (formType, data) => { |
|||
// return |
|||
try { |
|||
formRef.value.formLoading = true |
|||
if (formType === 'create') { |
|||
await InspectionJobMainApi.createInspectionJobMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else if (formType === 'execute') { |
|||
await InspectionJobMainApi.executeInspectionJobMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
formRef.value.dialogVisible = false |
|||
formRef.value.formLoading = false |
|||
// 刷新当前列表 |
|||
getList() |
|||
} finally { |
|||
formRef.value.formLoading = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
searchData.filters.push({ |
|||
action: "==", |
|||
column: "inspectionType", |
|||
value: "4" |
|||
}) |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
tableObject.params = { |
|||
available: true, |
|||
inspectionType: '4' |
|||
} |
|||
getList() |
|||
// importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() |
|||
}) |
|||
</script> |
@ -1,885 +0,0 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter2 } from '@/utils/formatTime' |
|||
import { validateHanset, validateEmail } from '@/utils/validator' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { validateTwoNum, validateSixNum } from '@/utils/validator' |
|||
const { t } = useI18n() // 国际化
|
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY) |
|||
const featureTypeList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE) |
|||
const isCanUpdateList = [ |
|||
{ |
|||
label: '是', |
|||
value: true |
|||
}, |
|||
{ |
|||
label: '否', |
|||
value: false |
|||
} |
|||
] |
|||
|
|||
/** |
|||
* @returns {Array} 检验任务主表 |
|||
*/ |
|||
export const InspectionJobMain = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'left' |
|||
} |
|||
}, |
|||
{ |
|||
label: '申请单号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商编码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 175 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料编码', |
|||
field: 'itemCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料名称', |
|||
field: 'itemName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 175 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考订单号', |
|||
field: 'referenceOrderCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考订单行', |
|||
field: 'referenceOrderRow', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考凭证号', |
|||
field: 'referenceCertificateCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考凭证行', |
|||
field: 'referenceCertificateRow', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验方案编码', |
|||
field: 'inspectionSchemeCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'inspectionBatch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isDetail: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商批次', |
|||
field: 'supplierBatch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isDetail: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验批数量', |
|||
field: 'inspectionBatchAmount', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '采样总数量',
|
|||
// field: 'sampleTotalAmount',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// form: {
|
|||
// componentProps:{
|
|||
// disabled:true
|
|||
// }
|
|||
// },
|
|||
// table: {
|
|||
// width: 150
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '检验类型', |
|||
field: 'inspectionType', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.INSPECTION_TYPE, |
|||
dictClass: 'string', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '完成人', |
|||
field: 'completeUser', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|||
isTable: false, |
|||
isDetail: false, |
|||
isSearch: true, |
|||
isTableForm: false, |
|||
isForm: false |
|||
}, |
|||
// {
|
|||
// label: '检验批来源',
|
|||
// field: 'inspectionBatchSource',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
|
|||
// dictClass: 'string',
|
|||
// form:{
|
|||
// componentProps:{
|
|||
// disabled:true
|
|||
// }
|
|||
// },
|
|||
// table: {
|
|||
// width: 150
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '检验阶段', |
|||
field: 'inspectionStage', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验严格性', |
|||
field: 'inspectionStringency', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
dictType: DICT_TYPE.INSPECTION_SEVERITY, |
|||
dictClass: 'string', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计划开始时间', |
|||
field: 'planStartTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x', |
|||
disabled: true |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计划结束时间', |
|||
field: 'planEndTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x', |
|||
disabled: true |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验水平', |
|||
field: 'inspectionLevel', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
dictType: DICT_TYPE.INSPECTION_LEVEL, |
|||
dictClass: 'string', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'AQL值', |
|||
field: 'aqlValue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
dictType: DICT_TYPE.BASIC_AQL, |
|||
dictClass: 'string', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '使用决策',
|
|||
// field: 'usageDecision',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// dictType: DICT_TYPE.USAGE_DECISION,
|
|||
// form:{
|
|||
// componentProps:{
|
|||
// }
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// label: '是否可用',
|
|||
// field: 'available',
|
|||
// dictType: DICT_TYPE.TRUE_FALSE,
|
|||
// dictClass: 'string',
|
|||
// isTable: true,
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// form: {
|
|||
// component: 'Switch',
|
|||
// value: 'TRUE',
|
|||
// componentProps: {
|
|||
// inactiveValue: 'FALSE',
|
|||
// activeValue: 'TRUE',
|
|||
// disabled:true
|
|||
// }
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '承接人', |
|||
field: 'acceptUserName', |
|||
table: { |
|||
width: 130 |
|||
}, |
|||
isForm: false, |
|||
isTable: false, |
|||
isDetail: true |
|||
}, |
|||
{ |
|||
label: '承接时间', |
|||
field: 'acceptTime', |
|||
isForm: false, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isTable: false, |
|||
isDetail: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '收货时间', |
|||
field: 'deliveryTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '完成人', |
|||
field: 'completeUserName', |
|||
table: { |
|||
width: 130 |
|||
}, |
|||
isForm: false, |
|||
isTable: true, |
|||
isDetail: true |
|||
}, |
|||
{ |
|||
label: '完成时间', |
|||
field: 'completeTime', |
|||
isForm: false, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
dictType: DICT_TYPE.JOB_STATUS, |
|||
dictClass: 'string', |
|||
isForm: false, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|||
search: { |
|||
value: 'TRUE' |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 110 |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装号', |
|||
field: 'packageCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isTable: false, |
|||
isForm: false, |
|||
tableForm: { |
|||
disabled: false |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
isForm: false, |
|||
isTable: true, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
table: { |
|||
width: 130 |
|||
}, |
|||
isForm: false, |
|||
isTable: true |
|||
}, |
|||
{ |
|||
label: '最后更新时间', |
|||
field: 'updateTime', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isTable: false, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '最后更新者', |
|||
field: 'updater', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isTable: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
isDetail: false, |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
|
|||
//表单校验
|
|||
export const InspectionJobMainRules = reactive({ |
|||
// usageDecision: [required],
|
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 检验任务子表 |
|||
*/ |
|||
export const InspectionJobDetail = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '检验方案模板编码', |
|||
field: 'inspectionCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'processDescribe', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '顺序号', |
|||
field: 'sequenceCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验特性编号', |
|||
field: 'inspectionCharCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '检验特性编码', |
|||
field: 'inspectionJobCharacteristicsRespVO.number', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '检验特性描述', |
|||
field: 'inspectionJobCharacteristicsRespVO.description', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '检验方法', |
|||
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '采样过程编码', |
|||
field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '动态修改规则编码', |
|||
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '是否允许修改特征值', |
|||
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate', |
|||
sort: 'custom', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return isCanUpdateList.find((account) => account.value == cellValue)?.label |
|||
} |
|||
}, |
|||
{ |
|||
label: '结果录入方式', |
|||
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod', |
|||
sort: 'custom', |
|||
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
|
|||
// dictClass: 'string',
|
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return resultEntryMethodList.find((account) => account.value == cellValue)?.label |
|||
} |
|||
}, |
|||
{ |
|||
label: '特征类型', |
|||
field: 'inspectionJobCharacteristicsRespVO.featureType', |
|||
sort: 'custom', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return featureTypeList.find((account) => account.value == cellValue)?.label |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
|
|||
//表单校验
|
|||
export const InspectionJobDetailRules = reactive({ |
|||
taskCode: [required], |
|||
processCode: [required], |
|||
sequenceCode: [required], |
|||
available: [required] |
|||
}) |
|||
/** |
|||
* @returns {Array} 检验任务包装 |
|||
*/ |
|||
export const InspectionJobPackage = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装号', |
|||
field: 'packageCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装规格', |
|||
field: 'packageSpecificationCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'amount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计量单位', |
|||
field: 'measuringUnit', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '采样数量', |
|||
field: 'sampleAmount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isTable: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
//表单校验
|
|||
export const InspectionJobPackageRules = reactive({ |
|||
sampleAmount: [required, { validator: validateSixNum, trigger: 'blur' }] |
|||
}) |
File diff suppressed because it is too large
@ -1,194 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading"> |
|||
<template #header> |
|||
<div class="font-size-18px"> |
|||
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> |
|||
</div> |
|||
</template> |
|||
<ContentWrap v-if="!isBasic"> |
|||
<Descriptions :data="data" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="allSchemas.detailSchema" :columns="2" width="200px" /> |
|||
</ContentWrap> |
|||
<ContentWrap> |
|||
<el-tabs v-model="editableTabsValue" class="demo-tabs" type="border-card" tab-position="left" :stretch="false"> |
|||
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name"> |
|||
<div class="small-title">检验工序</div> |
|||
<el-form :model="item" label-width="auto" ref="formProcessRef"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码" prop="processCode"> |
|||
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="processDescribe"> |
|||
<el-input v-model="item.processDescribe" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="顺序号" prop="sequenceCode"> |
|||
<el-input v-model="item.sequenceCode" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="small-title">检验特性</div> |
|||
<el-form :model="item" label-width="auto" ref="formFeaturesRef"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item label="编码"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.number" placeholder="根据系统生成" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="描述" prop="inspectionJobCharacteristicsRespVO.description"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.description" :disabled="true" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="检验方法" prop="inspectionJobCharacteristicsRespVO.inspectionMethodCode"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.inspectionMethodName" disabled placeholder="请选择检验方法" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="采样过程编码" prop="inspectionJobCharacteristicsRespVO.samplingProcessCode"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplingProcessName" disabled placeholder="请选择采样过程编码" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsRespVO.sampleQty"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.sampleQty" disabled placeholder="请输入样品份数" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="12"> |
|||
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsRespVO.samplePieceSize"> |
|||
<div style="display: flex; width: 100%"> |
|||
<el-input v-model="item.inspectionJobCharacteristicsRespVO.samplePieceSize" disabled placeholder="请输入每份样品量" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsRespVO.isCanUpdate"> |
|||
<el-switch v-model="item.inspectionJobCharacteristicsRespVO.isCanUpdate" disabled /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="结果录入方式" prop="inspectionJobCharacteristicsRespVO.resultEntryMethod"> |
|||
<el-select v-model="item.inspectionJobCharacteristicsRespVO.resultEntryMethod" placeholder="请选择结果录入方式" @change="resultEntryMethodChange($event,item)" disabled> |
|||
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsRespVO.featureType"> |
|||
<el-select v-model="item.inspectionJobCharacteristicsRespVO.featureType" placeholder="请选择特征类型" @change="changeFeatureType" disabled> |
|||
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</ContentWrap> |
|||
</el-drawer> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail' |
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
|
|||
defineOptions({ name: 'Detail' }) |
|||
|
|||
const editableTabsValue = ref('1') |
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const updateKey = ref(0) |
|||
|
|||
const props = defineProps({ |
|||
// 表单,列表 相关信息 |
|||
allSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 明细列表相关信息 |
|||
detailAllSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 详情列表扩展操作按钮 |
|||
buttondataTable: { |
|||
type: Array, |
|||
required: false, |
|||
default: ()=>{ |
|||
return [] |
|||
} |
|||
}, |
|||
}) |
|||
const isShowDrawer = ref(false) |
|||
const detailLoading = ref(false) |
|||
const data = ref({ |
|||
code: '', |
|||
itemCode: '', |
|||
version: '', |
|||
testTypeCode: '', |
|||
programmeTemplateCode: '', |
|||
splitRule: '', |
|||
aql: '', |
|||
inspectionLevel: '', |
|||
effectiveDate: '', |
|||
expirationDate: '', |
|||
available: 'TRUE', |
|||
subList: [] |
|||
}) |
|||
|
|||
/** 打开弹窗 */ |
|||
const formRef = ref() |
|||
const titleNameRef = ref() |
|||
const titleValueRef = ref() |
|||
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|||
titleNameRef.value = titleName |
|||
titleValueRef.value = titleValue |
|||
|
|||
isShowDrawer.value = true |
|||
if (row) { |
|||
detailLoading.value = true |
|||
try { |
|||
data.value = row |
|||
let list = [] |
|||
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id) |
|||
list.forEach((item, index) => { |
|||
editableTabsValue.value = index + 1 |
|||
item.name = index + 1 |
|||
}) |
|||
data.value.subList = list |
|||
} finally { |
|||
detailLoading.value = false |
|||
} |
|||
} |
|||
} |
|||
defineExpose({ openDetail }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
|
|||
</script> |
|||
<style lang="scss"> |
|||
.el-drawer__body { |
|||
background: #f5f5f5 !important; |
|||
} |
|||
|
|||
::v-deep(.label-class-name) { |
|||
color: #dedede; |
|||
} |
|||
</style> |
|||
<style scoped lang="scss"></style> |
@ -1,442 +0,0 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search |
|||
:schema="InspectionJobMain.allSchemas.searchSchema" |
|||
@search="setSearchParams" |
|||
@reset="setSearchParams({ |
|||
available: true, |
|||
inspectionType: '1' |
|||
})" |
|||
/> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="InspectionJobMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table v-clientTable |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{ row }"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="butttondata(row)" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<AddForm |
|||
ref="formRef" |
|||
basicFormWidth="80" |
|||
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas" |
|||
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas" |
|||
:formAllSchemasMain="InspectionTemplateMain.allSchemas" |
|||
:tableAllSchemas="InspectionJobPackage.allSchemas" |
|||
:tableFormRules="InspectionJobPackageRules" |
|||
:rules="InspectionJobMainRules" |
|||
:formAllSchemas="InspectionJobMain.allSchemas" |
|||
@submitForm="submitForm" |
|||
/> |
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="InspectionJobMain.allSchemas" |
|||
:detailAllSchemas="InspectionJobDetail.allSchemas" |
|||
:detailAllSchemasRules="InspectionJobDetailRules" |
|||
:apiCreate="InspectionJobDetailApi.createInspectionJobDetail" |
|||
:apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail" |
|||
:apiPage="InspectionJobDetailApi.getInspectionJobDetailPage" |
|||
:apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" |
|||
@searchTableSuccessDetail="searchTableSuccessDetail" |
|||
:isShowAddBtn="false" |
|||
:detailButtonIsShow="true" |
|||
/> |
|||
<!-- 包装信息 --> |
|||
<ListTable |
|||
ref="listTableRef" |
|||
titleName="包装信息" |
|||
:allSchemas="InspectionJobMain.allSchemas" |
|||
:detailAllSchemas="InspectionJobPackage.allSchemas" |
|||
:detailAllSchemasRules="InspectionJobPackageRules" |
|||
:list="list" |
|||
/> |
|||
<el-dialog |
|||
v-model="showQualityReport" |
|||
:title="t('质检明细')" |
|||
:append-to-body="false" |
|||
destroy-on-close |
|||
fullscreen |
|||
> |
|||
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { |
|||
InspectionJobMain, |
|||
InspectionJobMainRules, |
|||
InspectionJobDetail, |
|||
InspectionJobDetailRules, |
|||
InspectionJobPackage, |
|||
InspectionJobPackageRules |
|||
} from './inspectionJobMain.data' |
|||
import { |
|||
InspectionTemplateMain, |
|||
InspectionTemplateProcess, |
|||
InspectionTemplateFeatures, |
|||
InspectionTemplateRules |
|||
} from '../inspectionTemplate/inspectionTemplate.data' |
|||
|
|||
import * as InspectionJobPackageApi from '@/api/qms/inspectionJob/InspectionJobPackage/InspectionJobPackage' |
|||
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain' |
|||
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import ListTable from '@/components/ListTable/src/ListTable.vue' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import AddForm from './addForm.vue' |
|||
import Detail from './detail.vue' |
|||
import { getReportUrl } from '@/utils/systemParam' |
|||
|
|||
// 采购订单 |
|||
defineOptions({ name: 'inspectionJobMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(InspectionJobMain.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|||
nextTick(async () => { |
|||
if (type == 'tableForm') { |
|||
// 明细查询页赋值 |
|||
row[formField] = val[0][searchField] |
|||
// row['itemNumber'] = val[0]['number'] |
|||
// row['itemName'] = val[0]['name'] |
|||
// row['uom'] = val[0]['uom'] |
|||
// row['isRadeIn'] = val[0]['isRadeIn'] |
|||
// row['available'] = val[0]['available'] |
|||
} else { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
// 查询页面返回——详情 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|||
nextTick(async () => { |
|||
const setV = {} |
|||
// if(formField == 'itemCode'){ |
|||
// await ItembasicApi.getItembasicPage({ |
|||
// code: setV['itemCode'] |
|||
// }).then(res => { |
|||
// setV['uom'] = res.list[0].uom |
|||
// setV[formField] = val[0][searchField] |
|||
// }) |
|||
// } |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 子表新增的时候选择表格之后需要会显得字段 |
|||
const Echo = [] |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: InspectionJobMainApi.getInspectionJobMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn(null), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null) // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { |
|||
// 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { |
|||
// 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { |
|||
// 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { |
|||
// 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { |
|||
// 筛选 |
|||
} else { |
|||
// 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton2 = (row, val) => { |
|||
if (val.indexOf(row.isStaging) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return [ |
|||
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']), |
|||
hasPermi: 'qms:inspection-job-main:abandon' |
|||
}), // 放弃 |
|||
defaultButtons.mainListJobExeBtn({ |
|||
hide: isShowMainButton(row, ['2']), |
|||
hasPermi: 'qms:inspection-job-main:execute' |
|||
}), // 执行 |
|||
defaultButtons.mainListOrderPubBtn({ |
|||
hide: isShowMainButton2(row, ['TRUE']), |
|||
hasPermi: 'qms:inspection-job-main:execute' |
|||
}), // 发布 |
|||
defaultButtons.mainListPackageBtn(null), // 包装 |
|||
defaultButtons.mainListPlanCheckQualityReportBtn({}) // 查看质检报告 |
|||
] |
|||
} |
|||
const listTableRef = ref() |
|||
const list = ref([]) |
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'mainJobExe') { |
|||
// 执行 |
|||
execute('execute', row) |
|||
} else if (val == 'mainPackage') { |
|||
// 包装 |
|||
|
|||
list.value = await InspectionJobPackageApi.getInspectionJobPackageList(row.id) |
|||
// row.status = '1' |
|||
listTableRef.value.openPackage(row, '包装信息', InspectionJobPackage.allSchemas.tableColumns) |
|||
} else if (val == 'mainJobAba') { |
|||
// 放弃 |
|||
handleAbandon(row.id) |
|||
} else if (val == 'mainJobClo') { |
|||
// 关闭 |
|||
handleClose(row.id) |
|||
} else if (val == 'mainOrderPub') { |
|||
// 发布 |
|||
handleRelease(row.id) |
|||
} else if (val == 'mainPlanCheckQualityReport') { |
|||
// 查看质检报告 |
|||
checkQualityReport(row) |
|||
} else if (val == 'mainJobAcc') { |
|||
// 承接 |
|||
handleAccept(row.id) |
|||
} |
|||
} |
|||
|
|||
// 查看质检报告 |
|||
// 查看质检报告 |
|||
const reportHeight = ref(window.innerHeight - 120) |
|||
const showQualityReport = ref(false) |
|||
const qualityReport = ref('') |
|||
const checkQualityReport = async (row) => { |
|||
showQualityReport.value = true |
|||
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}` |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
// const formRef = ref() |
|||
// const openForm = async (type : string, row ?: number) => { |
|||
// tableData.value = [] // 重置明细数据 |
|||
// formRef.value.open(type, row) |
|||
// } |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') |
|||
} |
|||
//执行 |
|||
|
|||
const formRef = ref() |
|||
const execute = async (type: string, row?: number) => { |
|||
formRef.value.open(type, row) |
|||
} |
|||
/** 关闭按钮操作 */ |
|||
const handleClose = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.confirm(t('common.confirmColse')) |
|||
// 发起删除 |
|||
await InspectionJobMainApi.closeInspectionJobMain(id) |
|||
message.success(t('common.closeSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
/** 发布按钮操作 */ |
|||
const handleRelease = async (id: number) => { |
|||
try { |
|||
// 发布的二次确认 |
|||
await message.confirm('确认发布吗?') |
|||
// 发起发布 |
|||
await InspectionJobMainApi.releaseInspectionJobMain(id) |
|||
message.success('发布成功!') |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
// 承接 |
|||
const handleAccept = async (id: number) => { |
|||
try { |
|||
// 承接的二次确认 |
|||
await message.confirm(t('common.confirmAccept')) |
|||
// 发起承接 |
|||
await InspectionJobMainApi.acceptInspectionJobMain(id) |
|||
message.success(t('common.acceptSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
// 放弃任务 |
|||
const handleAbandon = async (id: number) => { |
|||
try { |
|||
// 放弃的二次确认 |
|||
await message.confirm(t('common.confirmGiveup')) |
|||
// 发起放弃 |
|||
await InspectionJobMainApi.abandonInspectionJobMain(id) |
|||
message.success(t('common.giveupSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await InspectionJobMainApi.exportInspectionJobMain(tableObject.params) |
|||
download.excel(data, '检验任务.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* tableForm方法 |
|||
*/ |
|||
const tableFormKeys = {} |
|||
InspectionJobDetail.allSchemas.tableFormColumns.forEach((item) => { |
|||
tableFormKeys[item.field] = item.default ? item.default : '' |
|||
}) |
|||
const tableData = ref([]) |
|||
|
|||
// 主子数据 提交 |
|||
const submitForm = async (formType, data) => { |
|||
// return |
|||
try { |
|||
formRef.value.formLoading = true |
|||
if (formType === 'create') { |
|||
await InspectionJobMainApi.createInspectionJobMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else if (formType === 'execute') { |
|||
await InspectionJobMainApi.executeInspectionJobMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
formRef.value.dialogVisible = false |
|||
formRef.value.formLoading = false |
|||
// 刷新当前列表 |
|||
getList() |
|||
} finally { |
|||
formRef.value.formLoading = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
searchData.filters.push({ |
|||
action: "==", |
|||
column: "inspectionType", |
|||
value: "1" |
|||
}) |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
tableObject.params = { |
|||
available: true, |
|||
inspectionType: '1' |
|||
} |
|||
getList() |
|||
// importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() |
|||
}) |
|||
</script> |
@ -1,885 +0,0 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter2 } from '@/utils/formatTime' |
|||
import { validateHanset, validateEmail } from '@/utils/validator' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { validateTwoNum, validateSixNum } from '@/utils/validator' |
|||
const { t } = useI18n() // 国际化
|
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY) |
|||
const featureTypeList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE) |
|||
const isCanUpdateList = [ |
|||
{ |
|||
label: '是', |
|||
value: true |
|||
}, |
|||
{ |
|||
label: '否', |
|||
value: false |
|||
} |
|||
] |
|||
|
|||
/** |
|||
* @returns {Array} 检验任务主表 |
|||
*/ |
|||
export const InspectionJobMain = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'left' |
|||
} |
|||
}, |
|||
{ |
|||
label: '申请单号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商编码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 175 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料编码', |
|||
field: 'itemCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料名称', |
|||
field: 'itemName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 175 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考订单号', |
|||
field: 'referenceOrderCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考订单行', |
|||
field: 'referenceOrderRow', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考凭证号', |
|||
field: 'referenceCertificateCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '参考凭证行', |
|||
field: 'referenceCertificateRow', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验方案编码', |
|||
field: 'inspectionSchemeCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'inspectionBatch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isDetail: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商批次', |
|||
field: 'supplierBatch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isDetail: true, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验批数量', |
|||
field: 'inspectionBatchAmount', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '采样总数量',
|
|||
// field: 'sampleTotalAmount',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// form: {
|
|||
// componentProps:{
|
|||
// disabled:true
|
|||
// }
|
|||
// },
|
|||
// table: {
|
|||
// width: 150
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '检验类型', |
|||
field: 'inspectionType', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.INSPECTION_TYPE, |
|||
dictClass: 'string', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '完成人', |
|||
field: 'completeUser', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|||
isTable: false, |
|||
isDetail: false, |
|||
isSearch: true, |
|||
isTableForm: false, |
|||
isForm: false |
|||
}, |
|||
// {
|
|||
// label: '检验批来源',
|
|||
// field: 'inspectionBatchSource',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
|
|||
// dictClass: 'string',
|
|||
// form:{
|
|||
// componentProps:{
|
|||
// disabled:true
|
|||
// }
|
|||
// },
|
|||
// table: {
|
|||
// width: 150
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '检验阶段', |
|||
field: 'inspectionStage', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验严格性', |
|||
field: 'inspectionStringency', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
dictType: DICT_TYPE.INSPECTION_SEVERITY, |
|||
dictClass: 'string', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计划开始时间', |
|||
field: 'planStartTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x', |
|||
disabled: true |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计划结束时间', |
|||
field: 'planEndTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x', |
|||
disabled: true |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验水平', |
|||
field: 'inspectionLevel', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
dictType: DICT_TYPE.INSPECTION_LEVEL, |
|||
dictClass: 'string', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'AQL值', |
|||
field: 'aqlValue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
dictType: DICT_TYPE.BASIC_AQL, |
|||
dictClass: 'string', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '使用决策',
|
|||
// field: 'usageDecision',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// dictType: DICT_TYPE.USAGE_DECISION,
|
|||
// form:{
|
|||
// componentProps:{
|
|||
// }
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// label: '是否可用',
|
|||
// field: 'available',
|
|||
// dictType: DICT_TYPE.TRUE_FALSE,
|
|||
// dictClass: 'string',
|
|||
// isTable: true,
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// form: {
|
|||
// component: 'Switch',
|
|||
// value: 'TRUE',
|
|||
// componentProps: {
|
|||
// inactiveValue: 'FALSE',
|
|||
// activeValue: 'TRUE',
|
|||
// disabled:true
|
|||
// }
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '承接人', |
|||
field: 'acceptUserName', |
|||
table: { |
|||
width: 130 |
|||
}, |
|||
isForm: false, |
|||
isTable: false, |
|||
isDetail: true |
|||
}, |
|||
{ |
|||
label: '承接时间', |
|||
field: 'acceptTime', |
|||
isForm: false, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isTable: false, |
|||
isDetail: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '收货时间', |
|||
field: 'deliveryTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 175 |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '完成人', |
|||
field: 'completeUserName', |
|||
table: { |
|||
width: 130 |
|||
}, |
|||
isForm: false, |
|||
isTable: true, |
|||
isDetail: true |
|||
}, |
|||
{ |
|||
label: '完成时间', |
|||
field: 'completeTime', |
|||
isForm: false, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
dictType: DICT_TYPE.JOB_STATUS, |
|||
dictClass: 'string', |
|||
isForm: false, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|||
search: { |
|||
value: 'TRUE' |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 110 |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装号', |
|||
field: 'packageCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isTable: false, |
|||
isForm: false, |
|||
tableForm: { |
|||
disabled: false |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
isForm: false, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
isTable: true, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
table: { |
|||
width: 130 |
|||
}, |
|||
isForm: false, |
|||
isTable: true |
|||
}, |
|||
{ |
|||
label: '最后更新时间', |
|||
field: 'updateTime', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isTable: false, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: { width: '100%' }, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '最后更新者', |
|||
field: 'updater', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isTable: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
isDetail: false, |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
|
|||
//表单校验
|
|||
export const InspectionJobMainRules = reactive({ |
|||
// usageDecision: [required],
|
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 检验任务子表 |
|||
*/ |
|||
export const InspectionJobDetail = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '检验方案模板编码', |
|||
field: 'inspectionCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'processDescribe', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '顺序号', |
|||
field: 'sequenceCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检验特性编号', |
|||
field: 'inspectionCharCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '检验特性编码', |
|||
field: 'inspectionJobCharacteristicsRespVO.number', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '检验特性描述', |
|||
field: 'inspectionJobCharacteristicsRespVO.description', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '检验方法', |
|||
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '采样过程编码', |
|||
field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '动态修改规则编码', |
|||
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode', |
|||
sort: 'custom' |
|||
}, |
|||
{ |
|||
label: '是否允许修改特征值', |
|||
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate', |
|||
sort: 'custom', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return isCanUpdateList.find((account) => account.value == cellValue)?.label |
|||
} |
|||
}, |
|||
{ |
|||
label: '结果录入方式', |
|||
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod', |
|||
sort: 'custom', |
|||
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
|
|||
// dictClass: 'string',
|
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return resultEntryMethodList.find((account) => account.value == cellValue)?.label |
|||
} |
|||
}, |
|||
{ |
|||
label: '特征类型', |
|||
field: 'inspectionJobCharacteristicsRespVO.featureType', |
|||
sort: 'custom', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return featureTypeList.find((account) => account.value == cellValue)?.label |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
|
|||
//表单校验
|
|||
export const InspectionJobDetailRules = reactive({ |
|||
taskCode: [required], |
|||
processCode: [required], |
|||
sequenceCode: [required], |
|||
available: [required] |
|||
}) |
|||
/** |
|||
* @returns {Array} 检验任务包装 |
|||
*/ |
|||
export const InspectionJobPackage = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '编码', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装号', |
|||
field: 'packageCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装规格', |
|||
field: 'packageSpecificationCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'amount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计量单位', |
|||
field: 'measuringUnit', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '采样数量', |
|||
field: 'sampleAmount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isTable: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
//表单校验
|
|||
export const InspectionJobPackageRules = reactive({ |
|||
sampleAmount: [required, { validator: validateSixNum, trigger: 'blur' }] |
|||
}) |
Loading…
Reference in new issue