Browse Source

使用决策,把第一个设为默认选择,使用决策,宽度减小,只输入不合格数量,自动算出合格数量,检验方案,新增,选择物料编码,显示编码

master_hella_20240701
zhang_li 7 months ago
parent
commit
060d2260c1
  1. 2
      src/components/TableForm/src/TableForm.vue
  2. 3
      src/views/qms/basicDataManage/inspectionScheme/addForm.vue
  3. 8
      src/views/qms/inspection/inspectionJob/addForm.vue
  4. 34
      src/views/qms/inspection/inspectionRecord/addForm.vue
  5. 30
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
  6. 10
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

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

@ -65,7 +65,7 @@
:placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label" :placeholder="headerItem?.tableForm?.placeholder || '请输入' + headerItem.label"
:disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false" :disabled="headerItem?.tableForm?.disabled ? true: headerItem?.tableForm?.isInpuFocusShow ? true : false"
style="flex:1" style="flex:1"
@blur="inputStringBlur(headerItem.field, $event, row)" @blur="inputStringBlur(headerItem.field, row[headerItem.field], row)"
/> />
<el-button :key="headerItem.field+$index+'button'" v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button> <el-button :key="headerItem.field+$index+'button'" v-if="headerItem?.tableForm?.isInpuFocusShow" @click="inpuFocus(headerItem,row,index)"><Icon icon="ep:search" size="14"/></el-button>
</el-form-item> </el-form-item>

3
src/views/qms/basicDataManage/inspectionScheme/addForm.vue

@ -18,7 +18,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物料编码" prop="itemCode"> <el-form-item label="物料编码" prop="itemCode">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model="data.itemName" disabled placeholder="请选择物料" /> <el-input v-model="data.itemCode" disabled placeholder="请选择物料编码" />
<el-button <el-button
type="info" type="info"
plain plain
@ -1088,6 +1088,7 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
data.value.programmeTemplateName = val[0].description data.value.programmeTemplateName = val[0].description
data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode
data.value.dynamicUpdateName = val[0].dynamicUpdateName data.value.dynamicUpdateName = val[0].dynamicUpdateName
console.log(val[0])
} }
if (formField == 'programmeTemplateCode') { if (formField == 'programmeTemplateCode') {

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

@ -62,9 +62,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验次数" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionQty"> <el-form-item label="样品份数" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionQty">
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input v-model=" item.inspectionJobCharacteristicsUpdateReqVO.inspectionQty" disabled placeholder="请输入检验次数" /> <el-input v-model=" item.inspectionJobCharacteristicsUpdateReqVO.inspectionQty" disabled placeholder="请输入样品份数" />
</div> </div>
</el-form-item> </el-form-item>
@ -318,7 +318,7 @@ const rules = ref({
{ required: true, message: '请选择评估代码', trigger: 'blur' } { required: true, message: '请选择评估代码', trigger: 'blur' }
], ],
'inspectionJobCharacteristicsUpdateReqVO.inspectionQty': [ 'inspectionJobCharacteristicsUpdateReqVO.inspectionQty': [
{ required: true, message: '请输入检验次数', trigger: 'blur' } { required: true, message: '请输入样品份数', trigger: 'blur' }
], ],
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }]
}) })
@ -620,7 +620,7 @@ const submitForm = async () => {
return; return;
} }
if(isEmptyNumberList){ if(isEmptyNumberList){
message.error('合格数量和不合格数量之和必须等于检验次数') message.error('合格数量和不合格数量之和必须等于样品份数')
return; return;
} }
if (formType.value == 'create') { if (formType.value == 'create') {

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

@ -26,6 +26,7 @@
:tableData="data.packageList" :tableData="data.packageList"
:isShowButton="false" :isShowButton="false"
:isShowReduceButton="false" :isShowReduceButton="false"
@inputStringBlur="tableFormBlur"
/> />
</div> </div>
</div> </div>
@ -126,10 +127,10 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
data.value = JSON.parse(JSON.stringify(row)) data.value = JSON.parse(JSON.stringify(row))
data.value.packageList = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id) data.value.packageList = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id)
data.value.packageList.forEach(item=>{ data.value.packageList.forEach(item=>{
item.qualifiedAmount =0 item.qualifiedAmount = item.qualifiedAmount?item.qualifiedAmount:0
item.noQualifiedAmount =0 item.noQualifiedAmount = item.noQualifiedAmount?item.noQualifiedAmount:0
item.destroyAmount =0 item.destroyAmount = item.destroyAmount?item.destroyAmount:0
item.frozenAmount =0 item.frozenAmount = item.frozenAmount?item.frozenAmount:0
}) })
dialogVisible.value = true dialogVisible.value = true
tableSchemas.value.tableFormColumns.map(item=>{ tableSchemas.value.tableFormColumns.map(item=>{
@ -141,10 +142,10 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
item.qualifiedAmount = item.amount item.qualifiedAmount = item.amount
}) })
} }
// //
else if(row.useDecision == 2 || row.useDecision == 6){ else if(row.useDecision == 2 || row.useDecision == 6){
tableSchemas.value.tableFormColumns.map(item=>{ tableSchemas.value.tableFormColumns.map(item=>{
if(item.field == 'qualifiedAmount' ||item.field == 'noQualifiedAmount'){ if(item.field == 'noQualifiedAmount'){
item.tableForm.disabled = false item.tableForm.disabled = false
}else{ }else{
item.tableForm.disabled = true item.tableForm.disabled = true
@ -162,8 +163,12 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
item.frozenAmount = item.amount item.frozenAmount = item.amount
}) })
} }
// 1使
if(row.estimateCode == 1){
data.value.useDecision = '1'
}
nextTick(() => { nextTick(() => {
formMainRef.value.setValues(row) formMainRef.value.setValues( data.value)
}) })
} }
dialogVisible.value = true dialogVisible.value = true
@ -205,8 +210,11 @@ const onChange = (field, cur)=>{
} }
// //
else if(cur == 2 || cur == 6){ else if(cur == 2 || cur == 6){
data.value.packageList.forEach(item=>{
item.qualifiedAmount = item.amount
})
tableSchemas.value.tableFormColumns.map(item=>{ tableSchemas.value.tableFormColumns.map(item=>{
if(item.field == 'qualifiedAmount' ||item.field == 'noQualifiedAmount'){ if(item.field == 'noQualifiedAmount'){
item.tableForm.disabled = false item.tableForm.disabled = false
}else{ }else{
item.tableForm.disabled = true item.tableForm.disabled = true
@ -226,6 +234,16 @@ const onChange = (field, cur)=>{
} }
} }
} }
//
const tableFormBlur = (field, val,row)=>{
if( row.amount < val){
row.noQualifiedAmount = row.amount
row.qualifiedAmount = 0
}else{
row.qualifiedAmount = row.amount - val
}
}
const buttonBaseClick = (val) => { const buttonBaseClick = (val) => {
// //
if (val == 'save') { if (val == 'save') {

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

@ -582,7 +582,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:200
}, },
table:{ table:{
width:150 width:150
@ -594,7 +595,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:160
}, },
table:{ table:{
width:150 width:150
@ -606,7 +608,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:150
}, },
table:{ table:{
width:150 width:150
@ -622,7 +625,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
value: 0 value: 0
}, },
tableForm:{ tableForm:{
disabled:true disabled:true,
width:120
}, },
table:{ table:{
width:150 width:150
@ -634,7 +638,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:120
}, },
table:{ table:{
width:150 width:150
@ -646,7 +651,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:100
}, },
table:{ table:{
width:150 width:150
@ -658,7 +664,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:100
}, },
table:{ table:{
width:150 width:150
@ -670,7 +677,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:100
}, },
table:{ table:{
width:150 width:150
@ -682,7 +690,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:100
}, },
table:{ table:{
width:150 width:150
@ -694,7 +703,8 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true,
width:100
}, },
table:{ table:{
width:150 width:150

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

@ -190,6 +190,11 @@ export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法 searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法
multiple:false, multiple:false,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
} }
}, },
@ -223,6 +228,11 @@ export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchPage: ItemApi.getItembasicPage, // 查询弹窗所需分页方法 searchPage: ItemApi.getItembasicPage, // 查询弹窗所需分页方法
multiple:false, multiple:false,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
} }
}, },

Loading…
Cancel
Save