|
@ -8,7 +8,7 @@ |
|
|
<TableForm ref="tableFormRef" style="width:100%;" :maxHeight = "490" :tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules" :tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" /> |
|
|
<TableForm ref="tableFormRef" style="width:100%;" :maxHeight = "490" :tableFields="tableAllSchemas.tableFormColumns" :tableFormRules="tableFormRules" :tableData="data.packageList" :isShowButton="false" :isShowReduceButton="false" /> |
|
|
</div> |
|
|
</div> |
|
|
<el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card" tab-position="left" :stretch="false"> |
|
|
<el-tabs v-model="editableTabsValue" class="demo-tabs" @edit="handleTabsEdit" type="border-card" tab-position="left" :stretch="false"> |
|
|
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processCode" :name="item.name"> |
|
|
<el-tab-pane v-for="item in data.subList" :key="item.name" :label="item.processDescribe" :name="item.name"> |
|
|
<div class="small-title">检验工序</div> |
|
|
<div class="small-title">检验工序</div> |
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|
|
<el-row :gutter="20"> |
|
|
<el-row :gutter="20"> |
|
@ -64,10 +64,17 @@ |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty"> |
|
|
<el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.sampleQty"> |
|
|
<div style="display: flex; width: 100%"> |
|
|
<div style="display: flex; width: 100%"> |
|
|
<el-input v-model=" item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled placeholder="请输入样品份数" /> |
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.sampleQty" disabled placeholder="请输入样品份数" /> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="每份样品量" prop="inspectionJobCharacteristicsUpdateReqVO.samplePieceSize"> |
|
|
|
|
|
<div style="display: flex; width: 100%"> |
|
|
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize" disabled placeholder="请输入样品份数" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"> |
|
|
<el-form-item label="是否允许修改特征值" prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"> |
|
@ -316,7 +323,7 @@ const rules = ref({ |
|
|
], |
|
|
], |
|
|
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] |
|
|
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] |
|
|
}) |
|
|
}) |
|
|
|
|
|
const allSamplePieceSize = ref(0) |
|
|
/** 打开弹窗 */ |
|
|
/** 打开弹窗 */ |
|
|
let tabIndex = 1 |
|
|
let tabIndex = 1 |
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|
@ -326,6 +333,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
dialogTitle.value = t('action.' + type) |
|
|
dialogTitle.value = t('action.' + type) |
|
|
} |
|
|
} |
|
|
formType.value = type |
|
|
formType.value = type |
|
|
|
|
|
allSamplePieceSize.value =0//打开时候归0 |
|
|
if (row) { |
|
|
if (row) { |
|
|
data.value = JSON.parse(JSON.stringify(row)) |
|
|
data.value = JSON.parse(JSON.stringify(row)) |
|
|
// console.log(data.value)// 发起承接 |
|
|
// console.log(data.value)// 发起承接 |
|
@ -337,6 +345,9 @@ 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 |
|
|
|
|
|
|
|
|
|
|
|
// 总数量值是 样品份数 乘 每份样品量 |
|
|
|
|
|
allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(2)) |
|
|
// 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 |
|
@ -384,8 +395,25 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false |
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
console.log(22,allSamplePieceSize.value ) |
|
|
data.value.subList = list |
|
|
data.value.subList = list |
|
|
|
|
|
/** |
|
|
|
|
|
设置采样数量,默认第一个包装采样数量<总数量,显示数量字段,第二个包装和剩下的总数量对比,以此类推, |
|
|
|
|
|
第一个包装采样数量>总数量 则显示总数量 |
|
|
|
|
|
*/ |
|
|
|
|
|
for(let i = 0; i<data.value.packageList.length;i++){ |
|
|
|
|
|
if(allSamplePieceSize.value>data.value.packageList[i].amount){ |
|
|
|
|
|
data.value.packageList[i].sampleAmount = data.value.packageList[i].amount |
|
|
|
|
|
allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2)) |
|
|
|
|
|
}else{ |
|
|
|
|
|
data.value.packageList[i].sampleAmount = allSamplePieceSize.value |
|
|
|
|
|
allSamplePieceSize.value=0 |
|
|
|
|
|
// return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// data.value.packageList.forEach(item=>{ |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
dialogVisible.value = true |
|
|
dialogVisible.value = true |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
formMainRef.value.setValues(row) |
|
|
formMainRef.value.setValues(row) |
|
@ -522,7 +550,12 @@ const submitForm = async () => { |
|
|
console.log(11,data.value.packageList) |
|
|
console.log(11,data.value.packageList) |
|
|
if(data.value.packageList?.length>0){ |
|
|
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 isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount)) |
|
|
|
|
|
if(isPass){ |
|
|
|
|
|
message.error(`采样数量不能大于数量`) |
|
|
|
|
|
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) |
|
|