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 = () => {
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',
fileUpload: 'File Upload',
createLabel: 'create label',
viewDetail:'Detailed list'
viewDetail:'Detailed list',
updataRecode:'Updata recode'
},
dialog: {
dialog: 'Dialog',

3
src/locales/zh-CN.ts

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

13
src/utils/disposition/defaultButtons.ts

@ -811,7 +811,18 @@ export function mainThawRequesttBtn(option:any) {
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){
return {

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

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

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

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

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

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

Loading…
Cancel
Save