Browse Source

首件检验记录导出编辑

hella_online_20240829
zhang_li 4 months ago
parent
commit
62f5ab1071
  1. 6
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  2. 16
      src/views/qms/inspectionRecord/detail.vue
  3. 19
      src/views/qms/inspectionRecordFirst/addForm.vue
  4. 21
      src/views/qms/inspectionRecordFirst/detail.vue
  5. 4
      src/views/qms/inspectionRecordFirst/index.vue
  6. 13
      src/views/qms/inspectionRecordFirst/inspectionRecordFirstMain.data.ts

6
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -56,7 +56,12 @@ export const deleteInspectionRecordMain = async (id: number) => {
// 导出检验申请 Excel
export const exportInspectionRecordMain = async (params) => {
if (params.isSearch) {
const data = { ...params }
return await request.downloadPost({ url: `/qms/inspection-record-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/qms/inspection-record-main/export-excel`, params })
}
}
// 下载用户导入模板
@ -67,3 +72,4 @@ export const importTemplate = () => {
export const publishInspectionRecordMain = async (id) => {
return await request.put({ url: `/qms/inspection-record-main/publish?id=`+id })
}

16
src/views/qms/inspectionRecord/detail.vue

@ -256,7 +256,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-col :span="24" v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1">
@ -276,7 +276,18 @@
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'">
<el-form-item label="选定集">
<el-input v-model="cur.number" placeholder="" type="number" disabled/>
<el-select
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
disabled
>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" >
@ -367,6 +378,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList = item.inspectionRecordCharacteristicsRespVO.featureType == 1 ? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList : item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
})
data.value.subList = list
} finally {

19
src/views/qms/inspectionRecordFirst/addForm.vue

@ -76,7 +76,14 @@
</el-col>
<el-col :span="12">
<el-form-item label="检验时间" prop="inspectionTime">
<el-input v-model="data.inspectionTime" placeholder="请填写检验时间" />
<!-- <el-input v-model="data.inspectionTime" placeholder="请填写检验时间" /> -->
<el-date-picker
v-model="data.inspectionTime"
type="datetime"
placeholder="请选择检验时间"
style="width: 100%"
value-format="x"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -729,9 +736,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
allSamplePieceSize.value = 0 //0
if (row) {
data.value = JSON.parse(JSON.stringify(row))
// nextTick(() => {
// formMainRef.value.setValues(row)
// })
let list = await InspectionRecordDetail.getInspectionRecordDetailList(data.value.id)
await processList( data.value,list)
} else {
@ -758,7 +762,7 @@ const processList =async (InspectionSchemeObj,list) => {
editableTabsValue.value = 1
list.forEach((item, index) => {
item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionRecordCharacteristicsRespVO
item.isPass = '' //
//
allSamplePieceSize.value += parseFloat(
@ -768,6 +772,8 @@ const processList =async (InspectionSchemeObj,list) => {
).toFixed(6)
)
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1 ? item.inspectionJobCharacteristicsUpdateReqVO.qualitativeRespVOList : item.inspectionJobCharacteristicsUpdateReqVO.quantifyRespVOList
if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) {
//
if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) {
@ -933,14 +939,13 @@ const validateForm = (formRef) => {
}
const submitForm = async () => {
try {
await formMainRef.value.validate()
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
return
}
debugger
//
let arrBol = []
let isOutweigh = [] //

21
src/views/qms/inspectionRecordFirst/detail.vue

@ -256,7 +256,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-col :span="24" v-for="(cur, i) in item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList" :key="i" style="border: 1px solid #dedede; border-radius: 4px; padding-top: 16px; margin-bottom: 10px;">
<el-row>
<!-- 汇总录入的时候显示 -->
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.resultEntryMethod == 1">
@ -276,7 +276,18 @@
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'">
<el-form-item label="选定集">
<el-input v-model="cur.number" placeholder="" type="number" disabled/>
<el-select
v-model="cur.qualitativeCode"
placeholder="请选择选定集"
disabled
>
<el-option
v-for="dict in item.selectedProjectRespVOList"
:key="dict.dictionaryValue"
:label="dict.dictionaryLabel"
:value="dict.dictionaryValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionRecordCharacteristicsRespVO.featureType == '1'" >
@ -286,6 +297,11 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注">
<el-input v-model="cur.remark" placeholder="" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-col>
</el-row>
@ -367,6 +383,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionRecordCharacteristicsRespVO.recordInspectionQuantifyList = item.inspectionRecordCharacteristicsRespVO.featureType == 1 ? item.inspectionRecordCharacteristicsRespVO.qualitativeRespVOList : item.inspectionRecordCharacteristicsRespVO.quantifyRespVOList
})
data.value.subList = list
} finally {

4
src/views/qms/inspectionRecordFirst/index.vue

@ -238,11 +238,11 @@ const buttonBaseClick = (val, item) => {
await InspectionRecordMainApi.updateInspectionRecordMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
basicFormRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
basicFormRef.value.formLoading = false
}
}
//

13
src/views/qms/inspectionRecordFirst/inspectionRecordFirstMain.data.ts

@ -105,11 +105,10 @@ export const InspectionRecordMain = useCrudSchemas(
},
{
label: '检验时间',
field: 'updateTime',
field: 'inspectionTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
@ -127,16 +126,6 @@ export const InspectionRecordMain = useCrudSchemas(
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '操作',
field: 'action',

Loading…
Cancel
Save