Browse Source

检验记录,发布和使用决策,检验任务验证

master_hella_20240701
zhang_li 8 months ago
parent
commit
aa9df7d4e0
  1. 4
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  2. 3
      src/locales/en-US.ts
  3. 3
      src/locales/zh-CN.ts
  4. 13
      src/utils/disposition/defaultButtons.ts
  5. 2
      src/views/qms/basicDataManage/inspectionPlan/addForm.vue
  6. 61
      src/views/qms/inspection/inspectionJob/addForm.vue
  7. 41
      src/views/qms/inspection/inspectionRecord/index.vue
  8. 35
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

4
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -63,3 +63,7 @@ export const exportInspectionRecordMain = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/inspection-record-main/get-import-template' }) return request.download({ url: '/qms/inspection-record-main/get-import-template' })
} }
// 发布
export const publishInspectionRecordMain = async (data ) => {
return await request.put({ url: `/qms/inspection-record-main/publish`, data })
}

3
src/locales/en-US.ts

@ -313,7 +313,8 @@ export default {
dataUpdate: 'Dict Data Eidt', dataUpdate: 'Dict Data Eidt',
fileUpload: 'File Upload', fileUpload: 'File Upload',
createLabel: 'create label', createLabel: 'create label',
viewDetail:'Detailed list' viewDetail:'Detailed list',
updataRecode:'Updata recode'
}, },
dialog: { dialog: {
dialog: 'Dialog', dialog: 'Dialog',

3
src/locales/zh-CN.ts

@ -312,7 +312,8 @@ export default {
dataCreate: '字典数据新增', dataCreate: '字典数据新增',
dataUpdate: '字典数据编辑', dataUpdate: '字典数据编辑',
createLabel: '创建标签', createLabel: '创建标签',
viewDetail:'明细列表' viewDetail:'明细列表',
updataRecode:'更新记录'
}, },
dialog: { dialog: {
dialog: '弹窗', dialog: '弹窗',

13
src/utils/disposition/defaultButtons.ts

@ -811,7 +811,18 @@ export function mainThawRequesttBtn(option:any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-更新检验记录
export function mainUpdataRecodeBtn(option:any) {
return __defaultBtnOption(option,{
label: '更新检验记录',
name: 'updataRecode',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){
return { return {

2
src/views/qms/basicDataManage/inspectionPlan/addForm.vue

@ -886,8 +886,6 @@ const validateForm = (formRef) => {
const submitForm = async () => { const submitForm = async () => {
try { try {
const validateForm1 = await validateForm(formProcessRef.value) const validateForm1 = await validateForm(formProcessRef.value)
console.log(validateForm1)
console.log(data.value)
await formMainRef.value.validate() await formMainRef.value.validate()
if (!data.value.process || data.value.process.length == 0) { if (!data.value.process || data.value.process.length == 0) {
message.error(`请添加工序`) message.error(`请添加工序`)

61
src/views/qms/inspection/inspectionJob/addForm.vue

@ -515,11 +515,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
for (let i = 0; i < data.value.sampleTotalAmount; i++) { item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
for (let i = 0; i < parseInt(data.value.sampleTotalAmount); i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
@ -530,17 +530,17 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
}) })
} }
} else { } else {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [ // item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
{ // inspectionValue: '', //
inspectionValue: '', // // qualitativeCode: '', //
qualitativeCode: '', // // estimateCode: '', //
estimateCode: '', // // defectLevel: '', //
defectLevel: '', // // qualifiedQuantity: '', //
qualifiedQuantity: '', // // unqualifiedQuantity: '' //
unqualifiedQuantity: '' // // }
} // )
]
} }
// //
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
@ -700,10 +700,11 @@ const submitForm = async () => {
return return
} }
// //
let arrBol = data.value.subList.map((item, index) => { let arrBol = []
let arr1 = [] let isOutweigh = []//
data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arr1.push( arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity return !cur.qualifiedQuantity || !cur.unqualifiedQuantity
@ -712,7 +713,7 @@ const submitForm = async () => {
) )
} }
if (item.samplingProcessRespVO.evaluationMode == 1) { if (item.samplingProcessRespVO.evaluationMode == 1) {
arr1.push( arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return !cur.estimateCode || !cur.defectLevel return !cur.estimateCode || !cur.defectLevel
@ -721,7 +722,7 @@ const submitForm = async () => {
) )
} }
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arr1.push( arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return !cur.inspectionValue return !cur.inspectionValue
@ -730,7 +731,7 @@ const submitForm = async () => {
) )
} }
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) {
arr1.push( arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return !cur.qualitativeCode return !cur.qualitativeCode
@ -738,17 +739,21 @@ const submitForm = async () => {
) )
) )
} }
return arr1 //
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
}
}) })
// console.log(arrBol) let isEmpty1 = arrBol.some(item=>item == true)
// let isEmpty1 = arrBol.filter(item=>item == true) if(isEmpty1){
// arrBol.forEach(item=>{ message.error('检验工序和检验特性有字段未填写完全')
// console.log('1q1q') return;
// console.log(typeof item) }
// }) if(isOutweigh.length>0){
// setTimeout(()=>{ message.error('检验特性中有开始时间大于结束时间')
// console.log(arrBol.includes(true)) return;
// },2000) }
return;
if (formType.value == 'create') { if (formType.value == 'create') {
// //
emit('submitForm', formType.value, data.value) emit('submitForm', formType.value, data.value)

41
src/views/qms/inspection/inspectionRecord/index.vue

@ -58,7 +58,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data' import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data'
import { InspectionJobPackage} from './inspectionJobMain.data' import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data'
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -171,8 +171,9 @@
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // // defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
// defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), // // defaultButtons.mainListDeleteBtn(null), //
defaultButtons.mainListOrderPubBtn(null), //
] ]
} }
@ -180,13 +181,28 @@
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
// 1使
if(row.estimateCode == 1){
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) =>{
if(itemColumn.field == "useDecision"){
itemColumn.componentProps.options=itemColumn.componentProps.options?.filter(item=>item.value==1)
}
})
}else if(row.estimateCode == 2){
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) =>{
if(itemColumn.field == "useDecision"){
itemColumn.componentProps.options=itemColumn.componentProps.options?.filter(item=>item.value!=1)
}
})
}
openForm('update', row) openForm('update', row)
}else if (val == 'mainPackage') { // }else if (val == 'mainPackage') { //
const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id) const list = await InspectionJobPackageApi.getInspectionJobPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list) listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list)
} }else if (val == 'delete') { //
else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'mainOrderPub') { //
handleOrderPub(row)
} }
} }
@ -215,6 +231,20 @@
await getList() await getList()
} catch { } } catch { }
} }
/** 发布按钮操作 */
const handleOrderPub = async (row : object) => {
try {
//
await message.confirm('是否发布所选数据')
//
await InspectionRecordMainApi.publishInspectionRecordMain(row)
message.success('发布成功')
//
await getList()
} catch { }
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) // const exportLoading = ref(false) //
@ -257,7 +287,7 @@
if (formType === 'create') { if (formType === 'create') {
await InspectionRecordMainApi.createInspectionRecordMain(data) await InspectionRecordMainApi.createInspectionRecordMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { }else {
await InspectionRecordMainApi.updateInspectionRecordMain(data) await InspectionRecordMainApi.updateInspectionRecordMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
@ -298,6 +328,5 @@
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await InspectionRecordMainApi.importTemplate()
}) })
</script> </script>

35
src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

@ -13,72 +13,84 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false
}, },
{ {
label: '申请编码', label: '申请编码',
field: 'applicationCode', field: 'applicationCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false
}, },
{ {
label: '任务编码', label: '任务编码',
field: 'taskCode', field: 'taskCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '供应商编码', label: '供应商编码',
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '物料编码', label: '物料编码',
field: 'materialCode', field: 'materialCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '批次', label: '批次',
field: 'batch', field: 'batch',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '检验方案编码', label: '检验方案编码',
field: 'inspectionSchemeCode', field: 'inspectionSchemeCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '检验方案Json', label: '检验方案Json',
field: 'inspectionSchemeJson', field: 'inspectionSchemeJson',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '检验批次', label: '检验批次',
field: 'inspectionBatch', field: 'inspectionBatch',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '检验批数量', label: '检验批数量',
field: 'inspectionBatchAmount', field: 'inspectionBatchAmount',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '采样总数量', label: '采样总数量',
field: 'sampleTatalAmount', field: 'sampleTatalAmount',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '检验类型', label: '检验类型',
field: 'inspectionType', field: 'inspectionType',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
form: { form: {
component: 'Select' component: 'Select'
}, },
@ -88,18 +100,21 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionBatchSource', field: 'inspectionBatchSource',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '订单号', label: '订单号',
field: 'orderCode', field: 'orderCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '订单行', label: '订单行',
field: 'orderRow', field: 'orderRow',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -110,12 +125,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'certificateCode', field: 'certificateCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '凭证行', label: '凭证行',
field: 'certificateRow', field: 'certificateRow',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -126,6 +143,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStage', field: 'inspectionStage',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
@ -136,12 +154,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionStringency', field: 'inspectionStringency',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
}, },
{ {
label: '使用决策', label: '使用决策',
field: 'useDecision', field: 'useDecision',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false
}, },
{ {
label: '计划开始时间', label: '计划开始时间',
@ -149,6 +169,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -171,6 +192,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -193,6 +215,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -215,6 +238,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -236,18 +260,29 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inspectionLevel', field: 'inspectionLevel',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
}, },
{ {
label: 'AQL值', label: 'AQL值',
field: 'aqlValue', field: 'aqlValue',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
}, },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false,
},
{
label: '使用决策',
field: 'useDecision',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.USAGE_DECISION,
}, },
{ {
label: '创建时间', label: '创建时间',

Loading…
Cancel
Save