Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
chenfang 7 months ago
parent
commit
a75c481354
  1. 2
      src/components/TableForm/src/TableForm.vue
  2. 34
      src/views/qms/inspection/inspectionJob/addForm.vue
  3. 2
      src/views/qms/inspection/inspectionRequest/index.vue
  4. 7
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

2
src/components/TableForm/src/TableForm.vue

@ -46,7 +46,7 @@
:label="headerItem.label" :prop="headerItem.field" :label="headerItem.label" :prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'" :align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || false" :sortable="headerItem?.tableForm?.sortable || false"
:width="headerItem?.tableForm?.width || '200'" :width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'"> :min-width="headerItem?.tableForm?.minWidth || 'auto'">
<el-form <el-form
ref="TableBaseForm_Ref" ref="TableBaseForm_Ref"

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

@ -312,7 +312,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1" > <el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1" >
<el-form-item label="缺陷级别" required> <el-form-item label="缺陷级别" required>
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> <el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option <el-option
@ -718,24 +718,30 @@ const submitForm = async () => {
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
// //
console.log(11,data.value.packageList)
if(data.value.packageList?.length>0){
const validateForm1 = await tableFormRef.value.validateForm() const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return if (!validateForm1) return
let number = 0 let number = 0
data.value.packageList.forEach(cur=>{ data.value.packageList.forEach(cur=>{
number += parseFloat(cur.sampleAmount) number += parseFloat(cur.sampleAmount)
}) })
if(number > data.value.sampleTotalAmount){ if(number != data.value.sampleTotalAmount){
message.error(`采样数量之和不可以大于总数量`) message.error(`采样数量之和不于总数量`)
return return
} }
}
const bol2 = await validateForm(formFeaturesRef.value) const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) { if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`) message.error(`模板中有检验工序和检验特性未填写完全`)
return return
} }
// //
let arrBol = [] let arrBol = []
let isOutweigh = []// let isOutweigh = []//
let numberList = []//
data.value.subList.forEach((item, index) => { data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push( arrBol.push(
@ -750,7 +756,7 @@ const submitForm = async () => {
arrBol.push( arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { (cur, key) => {
return !cur.estimateCode || !cur.defectLevel return !cur.estimateCode
} }
) )
) )
@ -777,16 +783,32 @@ const submitForm = async () => {
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
} }
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != data.value.sampleTotalAmount
}
)
)
}
}) })
let isEmpty1 = arrBol.some(item=>item == true) let isEmpty1 = arrBol.some(item=>item == true)
let isEmptyNumberList = numberList.some(item=>item == true)
if(isEmpty1){ if(isEmpty1){
message.error('检验工序和检验特性有字段未填写完全') message.error('检验工序和检验特性有字段未填写完全')
return; return;
} }
if(isOutweigh.length>0){ if(isOutweigh?.length>0){
message.error('检验特性中有开始时间大于结束时间') message.error('检验特性中有开始时间大于结束时间')
return; return;
} }
console.log(44,numberList)
if(isEmptyNumberList){
message.error('合格数量和不合格数量之和不等于总数量')
return;
}
if (formType.value == 'create') { if (formType.value == 'create') {
// //
emit('submitForm', formType.value, data.value) emit('submitForm', formType.value, data.value)

2
src/views/qms/inspection/inspectionRequest/index.vue

@ -220,7 +220,7 @@ const listTableRef = ref()
await message.confirm(t('common.confirmHandle')) await message.confirm(t('common.confirmHandle'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.handleInspectRequestMain(id) await InspectionMainApi.handleInspectRequestMain(id)
message.success(t('common.handleSuccess')) message.success(t('common.dealwithSuccess'))
await getList() await getList()
}catch{}finally{ }catch{}finally{
tableObject.loading = false tableObject.loading = false

7
src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

@ -365,11 +365,10 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
width:500,
disabled:true disabled:true
}, },
table:{ table:{
width:150 width:200
} }
}, },
{ {
@ -381,7 +380,7 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
disabled:true disabled:true
}, },
table:{ table:{
width:150 width:200
} }
}, },
{ {
@ -393,7 +392,7 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
disabled:true disabled:true
}, },
table:{ table:{
width:150 width:180
} }
}, },
{ {

Loading…
Cancel
Save