Browse Source

BUG修改

master_hella_20240701
parent
commit
615d0cc4bf
  1. 1
      src/utils/dict.ts
  2. 5
      src/views/qms/qualityNotice/addForm.vue
  3. 24
      src/views/qms/qualityNotice/components/notaicType.vue
  4. 21
      src/views/qms/qualityNotice/components/qualityBatch.vue
  5. 7
      src/views/qms/qualityNotice/components/qualityNotice.vue
  6. 166
      src/views/qms/qualityNotice/qualityNoticeMain.data.ts

1
src/utils/dict.ts

@ -188,6 +188,7 @@ export enum DICT_TYPE {
UOM = 'uom', // 计量单位 UOM = 'uom', // 计量单位
ABC_CLASS = 'abc_class', // ABC类 ABC_CLASS = 'abc_class', // ABC类
TRUE_FALSE = 'true_false', // 是否 TRUE_FALSE = 'true_false', // 是否
FALSE_OR_TRUE = 'false_or_true', // 是否2
ITEM_GROUP = 'item_group', // 物料分组 ITEM_GROUP = 'item_group', // 物料分组
ITEM_CATEGORY = 'Item_category', // 物料种类 ITEM_CATEGORY = 'Item_category', // 物料种类
ITEM_COLOR = 'item_color', // 物料颜色 ITEM_COLOR = 'item_color', // 物料颜色

5
src/views/qms/qualityNotice/addForm.vue

@ -374,10 +374,13 @@ const next = () => {
return; return;
} }
} }
console.log(33, data.value)
console.log(66,qualityNoticeFrom.value.form)
data.value = { data.value = {
...data.value, ...data.value,
...qualityNoticeFrom.value.form ...qualityNoticeFrom.value.form
} }
console.log( data.value)
active.value++ active.value++
} else { } else {
console.log('error submit!') console.log('error submit!')
@ -432,4 +435,4 @@ watch(
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left { .el-tabs--left.el-tabs--border-card .el-tabs__item.is-left {
min-width: 120px !important; min-width: 120px !important;
} }
</style> </style>

24
src/views/qms/qualityNotice/components/notaicType.vue

@ -23,7 +23,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="客户编码" prop="customerCode"> <el-form-item label="客户编码" prop="customerCode">
<el-input v-model="q1.customerCode" placeholder="请选择客户"/> <el-input v-model="q1.customerCode" placeholder="请输入客户"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -65,7 +65,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="供应商编码" prop="supplierCode"> <el-form-item label="供应商编码" prop="supplierCode">
<el-input v-model="q2.supplierCode" placeholder="请选择供应商"/> <el-input v-model="q2.supplierCode" placeholder="请输入供应商"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -107,7 +107,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="部门编码" prop="deptCode"> <el-form-item label="部门编码" prop="deptCode">
<el-input v-model="q3.deptCode" placeholder="请选择部门"/> <el-input v-model="q3.deptCode" placeholder="请输入部门"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -169,12 +169,16 @@ const props = defineProps({
default: false default: false
} }
}) })
type.vlaue = props.data?.type ? props.data.type : 1 nextTick(()=>{
// type.vlaue = props.data?.type ? props.data.type : 1
type.value = parseInt(props.data.type) //
q1.value = props.data?.q1 ? props.data?.q1 :{} type.value = parseInt(props.data.type)
q2.value = props.data?.q2 ? props.data?.q2 :{} q1.value = props.data?.q1 ? props.data?.q1 :{}
q3.value = props.data?.q3 ? props.data?.q3 :{} q2.value = props.data?.q2 ? props.data?.q2 :{}
q3.value = props.data?.q3 ? props.data?.q3 :{},
console.log(998,props.data)
})
// //
const rules1 =ref({ const rules1 =ref({
customerCode: [required], customerCode: [required],
@ -208,4 +212,4 @@ padding: 20px;
.type{ .type{
padding: 0px 20px 20px;} padding: 0px 20px 20px;}
} }
</style> </style>

21
src/views/qms/qualityNotice/components/qualityBatch.vue

@ -338,8 +338,8 @@
</el-row> </el-row>
</el-form> </el-form>
<el-form ref="nameRef" :model="nameForm" v-else> <el-form ref="nameRef" :model="nameForm" v-else>
<el-form-item :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]" prop="name"> <el-form-item :rules="[{ required: true, message: '请输入顺序号', trigger: 'blur' }]" prop="name">
<el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" /> <el-input v-model="nameForm.name" type="number" style="width: 240px" placeholder="请输入顺序号" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -493,7 +493,7 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
nameForm.value.name = '' nameForm.value.name = ''
source.value = '' source.value = ''
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = '添加物料批次名称' dialogTitle.value = '添加物料批次顺序号'
} else if (action === 'remove') { } else if (action === 'remove') {
const tabs =subList.value const tabs =subList.value
let activeName = editableTabsValue.value let activeName = editableTabsValue.value
@ -600,14 +600,23 @@ const buttonBaseClick1 = (val) => {
if (!nameRef.value) return if (!nameRef.value) return
nameRef.value.validate((valid, fields) => { nameRef.value.validate((valid, fields) => {
if (valid) { if (valid) {
console.log(subList.value)
console.log(nameForm.value.name)
const isRepeat = subList.value.some(item=>item.sequenceCode == nameForm.value.name) const isRepeat = subList.value.some(item=>item.sequenceCode == nameForm.value.name)
if(isRepeat){ if(isRepeat){
message.error('列表中已存在该顺序号') message.error('列表中已存在该顺序号')
return; return;
} }
const newTabName = `${++tabIndex}` const newTabName = `${++tabIndex}`
itemBatch.value = {
itemCode:'',
batch:'',
inspectionBatch:'',
itemDesc:'',
totalAmount:'',
uom:'',
packageList:[],
taskList:[],
defectList:[],
}
subList.value.push({ subList.value.push({
sequenceCode: nameForm.value.name, sequenceCode: nameForm.value.name,
name: newTabName, name: newTabName,
@ -665,4 +674,4 @@ defineExpose({qualityBatchFormRef, subList})
} }
} }
</style> </style>

7
src/views/qms/qualityNotice/components/qualityNotice.vue

@ -159,10 +159,9 @@ const props = defineProps({
const statusList = ref() const statusList = ref()
// //
nextTick(()=>{ nextTick(()=>{
form.value = props.data ? props.data: {} if(props.data.number){
form.value.status = 1
if(form.value.number){
statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS) statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS)
form.value = props.data
}else{ }else{
statusList.value =getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS).filter(item=>item.value == 1) statusList.value =getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS).filter(item=>item.value == 1)
} }
@ -195,4 +194,4 @@ padding: 20px;
.type{ .type{
padding: 0px 20px 20px;} padding: 0px 20px 20px;}
} }
</style> </style>

166
src/views/qms/qualityNotice/qualityNoticeMain.data.ts

@ -2,7 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime' import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator' import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {validateTwoNum } from '@/utils/validator' import { validateTwoNum } from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
/** /**
@ -14,7 +14,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, isForm: false,
table: { table: {
width: 150, width: 150,
fixed: 'left' fixed: 'left'
@ -23,9 +23,10 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
dictType: DICT_TYPE.QUALITY_NOTIFICATION_TYPE,
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
} }
@ -35,7 +36,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'description', field: 'description',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
} }
@ -45,22 +46,22 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'detail', field: 'detail',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
} }
},{ }, {
label: '优先级', label: '优先级',
field: 'priority', field: 'priority',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
}, },
form: { form: {
componentProps:{ componentProps: {
disabled:true disabled: true
} }
}, },
}, },
@ -69,13 +70,13 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
}, },
form: { form: {
componentProps:{ componentProps: {
disabled:true disabled: true
} }
}, },
}, },
@ -84,13 +85,13 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'reporter', field: 'reporter',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
}, },
form: { form: {
componentProps:{ componentProps: {
disabled:true disabled: true
} }
}, },
}, },
@ -98,8 +99,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '报告时间', label: '报告时间',
field: 'reportTime', field: 'reportTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: 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: { table: {
width: 150 width: 150
} }
@ -108,8 +128,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '要求开始时间', label: '要求开始时间',
field: 'requestStartTime', field: 'requestStartTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: 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: { table: {
width: 150 width: 150
} }
@ -118,8 +157,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '要求结束时间', label: '要求结束时间',
field: 'requestEndTime', field: 'requestEndTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: 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: { table: {
width: 150 width: 150
} }
@ -127,9 +185,10 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '是否造成停机', label: '是否造成停机',
field: 'whetherCausesMachineHalt', field: 'whetherCausesMachineHalt',
dictType: DICT_TYPE.FALSE_OR_TRUE,
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
} }
@ -138,8 +197,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '停机开始时间', label: '停机开始时间',
field: 'machineHaltStartTime', field: 'machineHaltStartTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: 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: { table: {
width: 150 width: 150
} }
@ -147,12 +225,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '停机结束时间', label: '停机结束时间',
field: 'machineHaltEndTime', field: 'machineHaltEndTime',
dictType: DICT_TYPE.INSPECTION_TYPE,
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: 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: { form: {
component: 'Select' component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
table: { table: {
width: 150 width: 150
@ -163,7 +256,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'coordinator', field: 'coordinator',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
} }
@ -173,7 +266,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'taskTemplateCode', field: 'taskTemplateCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
table: { table: {
width: 150 width: 150
} }
@ -182,8 +275,27 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '完成时间', label: '完成时间',
field: 'finishTime', field: 'finishTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter,
isSearch: false, isSearch: false,
isForm:false, isForm: 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: { table: {
width: 150 width: 150
} }
@ -194,7 +306,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'referenceNoticeCode', field: 'referenceNoticeCode',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false, isForm: false,
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0

Loading…
Cancel
Save