Browse Source

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

master_hella_20240701
liuchen864 7 months ago
parent
commit
f70c50b79b
  1. 12
      src/views/qms/basicDataManage/inspectionScheme/addForm.vue
  2. 8
      src/views/qms/basicDataManage/inspectionScheme/index.vue
  3. 2
      src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts
  4. 9
      src/views/qms/inspection/inspectionJob/addForm.vue
  5. 18
      src/views/qms/inspection/inspectionJob/index.vue
  6. 309
      src/views/qms/inspection/inspectionRecord/addForm.vue
  7. 62
      src/views/qms/inspection/inspectionRecord/index.vue
  8. 139
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

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

@ -52,7 +52,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验类型" prop="testTypeCode"> <el-form-item label="检验类型" prop="inspectionType">
<!-- <div style="display: flex; width: 100%"> <!-- <div style="display: flex; width: 100%">
<el-input v-model="data.testTypeName" disabled placeholder="请选择检验类型" /> <el-input v-model="data.testTypeName" disabled placeholder="请选择检验类型" />
<el-button <el-button
@ -75,7 +75,7 @@
><Icon icon="ep:search" /> ><Icon icon="ep:search" />
</el-button> </el-button>
</div> --> </div> -->
<el-select v-model="data.testTypeCode" placeholder="请选择检验类型"> <el-select v-model="data.inspectionType" placeholder="请选择检验类型">
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_TYPE)" v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_TYPE)"
:key="dict.value" :key="dict.value"
@ -691,7 +691,7 @@ const data = ref({
code: '', code: '',
itemCode: '', itemCode: '',
version: '', version: '',
testTypeCode: '', inspectionType:'',
programmeTemplateCode: '', programmeTemplateCode: '',
splitRule: '', splitRule: '',
aql: '', aql: '',
@ -717,7 +717,7 @@ if (props.basicFormWidth) {
const rules = ref({ const rules = ref({
itemCode: [{ required: true, message: '请选择物料', trigger: 'blur' }], itemCode: [{ required: true, message: '请选择物料', trigger: 'blur' }],
version: [{ required: true, message: '请填写版本', trigger: 'blur' }], version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
testTypeCode: [{ required: true, message: '请选择检验类型', trigger: ['blur', 'change'] }], inspectionType: [{ required: true, message: '请选择检验类型', trigger: ['blur', 'change'] }],
programmeTemplateCode: [ programmeTemplateCode: [
{ required: true, message: '请选择检验模板', trigger: ['blur', 'change'] } { required: true, message: '请选择检验模板', trigger: ['blur', 'change'] }
], ],
@ -811,7 +811,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
code: '', code: '',
itemCode: '', itemCode: '',
version: '', version: '',
testTypeCode: '', inspectionType: '',
programmeTemplateCode: '', programmeTemplateCode: '',
splitRule: '', splitRule: '',
aql: '', aql: '',
@ -1081,7 +1081,7 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
data.value[formField] = val[0].code data.value[formField] = val[0].code
if (formField == 'itemCode') { if (formField == 'itemCode') {
data.value.itemName = val[0].name data.value.itemName = val[0].name
} else if (formField == 'testTypeCode') { } else if (formField == 'inspectionType') {
data.value.testTypeName = val[0].description data.value.testTypeName = val[0].description
} else if (formField == 'programmeTemplateCode') { } else if (formField == 'programmeTemplateCode') {
data.value.programmeTemplateName = val[0].description data.value.programmeTemplateName = val[0].description

8
src/views/qms/basicDataManage/inspectionScheme/index.vue

@ -159,7 +159,7 @@ const submitForm = async (formType,data) => {
description: data.description, description: data.description,
itemCode: data.itemCode, itemCode: data.itemCode,
version: data.version, version: data.version,
testTypeCode: data.testTypeCode, inspectionType: data.inspectionType,
programmeTemplateCode: data.programmeTemplateCode, programmeTemplateCode: data.programmeTemplateCode,
splitRule: data.splitRule, splitRule: data.splitRule,
aql: data.aql, aql: data.aql,
@ -170,10 +170,10 @@ const submitForm = async (formType,data) => {
content:JSON.stringify(data.process) content:JSON.stringify(data.process)
} }
if (formType === 'create') { if (formType === 'create') {
await InspectionSchemeApi.inspectionSchemeCreat(data1) await InspectionSchemeApi.InspectionSchemeCreat(data1)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await InspectionSchemeApi.inspectionSchemeUpdate(data1) await InspectionSchemeApi.InspectionSchemeUpdate(data1)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -192,7 +192,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await InspectionSchemeApi.inspectionSchemeDelete(id) await InspectionSchemeApi.InspectionSchemeDelete(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

2
src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts

@ -115,7 +115,7 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
},{ },{
label: '检验类型编码', label: '检验类型编码',
field: 'testTypeCode', field: 'inspectionType',
dictType: DICT_TYPE.INSPECTION_TYPE, dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string', dictClass: 'string',
sort: 'custom', sort: 'custom',

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

@ -26,7 +26,7 @@
:maxHeight = "490" :maxHeight = "490"
:tableFields="tableAllSchemas.tableFormColumns" :tableFields="tableAllSchemas.tableFormColumns"
:tableFormRules="tableFormRules" :tableFormRules="tableFormRules"
:tableData="data.packageVOList" :tableData="data.packageList"
:isShowButton="false" :isShowButton="false"
:isShowReduceButton="false" :isShowReduceButton="false"
/> />
@ -312,7 +312,6 @@
</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.samplingProcessRespVO.evaluationMode == 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>
@ -359,7 +358,6 @@
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getCurrentInstance } from 'vue' import { getCurrentInstance } from 'vue'
@ -538,7 +536,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
console.log(data.value) console.log(data.value)
let list = [] let list = []
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id) list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
data.value.packageVOList = await InspectionJobMainApi.getInspectionJobPackageList(row.id) data.value.packageList = await InspectionJobMainApi.getInspectionJobPackageList(row.id)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
@ -617,7 +615,6 @@ import type { TabPaneName } from 'element-plus'
const editableTabsValue = ref('1') const editableTabsValue = ref('1')
// const editableTabs = ref([]) // const editableTabs = ref([])
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => { const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => {
if (action === 'add') { if (action === 'add') {
nameForm.value.name = '' nameForm.value.name = ''
@ -724,7 +721,7 @@ const submitForm = async () => {
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.packageVOList.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){

18
src/views/qms/inspection/inspectionJob/index.vue

@ -28,7 +28,7 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<AddForm <AddForm
ref="basicFormRef" ref="formRef"
basicFormWidth="80" basicFormWidth="80"
:formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas" :formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas"
:formAllSchemasProcess="InspectionTemplateProcess.allSchemas" :formAllSchemasProcess="InspectionTemplateProcess.allSchemas"
@ -165,7 +165,7 @@
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPackageBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPackageBtn(null), //
] ]
} }
const listTableRef = ref() const listTableRef = ref()
@ -183,11 +183,11 @@ const listTableRef = ref()
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() // const formRef = ref()
const openForm = async (type : string, row ?: number) => { // const openForm = async (type : string, row ?: number) => {
tableData.value = [] // // tableData.value = [] //
formRef.value.open(type, row) // formRef.value.open(type, row)
} // }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
@ -196,9 +196,9 @@ const listTableRef = ref()
} }
// //
const basicFormRef = ref() const formRef = ref()
const execute = async (type : string, row ?: number) => { const execute = async (type : string, row ?: number) => {
basicFormRef.value.open(type, row) formRef.value.open(type, row)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id : number) => { const handleDelete = async (id : number) => {

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

@ -0,0 +1,309 @@
<template>
<div>
<Dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:close-on-click-modal="false"
:vLoading="formLoading"
>
<div style="max-height: 80vh; overflow-y: auto; padding: 0px 20px">
<Form
ref="formMainRef"
:rules="rules"
:schema="formSchema"
:is-col="true"
@onChange="onChange"
/>
<div class="small-title">包装列表</div>
<div style="border:1px solid #dedede;margin-bottom:20px;display: flex;">
<TableForm
ref="tableFormRef"
style="width:100%;"
:maxHeight = "490"
:tableFields="tableSchemas.tableFormColumns"
:tableFormRules="tableFormRules"
:tableData="data.packageList"
:isShowButton="false"
:isShowReduceButton="false"
/>
</div>
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template>
</Dialog>
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</div>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getCurrentInstance } from 'vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import { SearchTable } from '@/components/SearchTable'
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data'
// import { InspectionTemplateMain } from '@/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data'
// import * as InspectionTemplateApi from '@/api/qms/inspectionTemplate'
// import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// import * as ItemBasicApi from '@/api/wms/itembasic'
import * as SamplingProcessApi from '@/api/qms/samplingProcess' //
import * as InspectionMethodApi from '@/api/qms/inspectionMethod' //
import { InspectionMethod } from '@/views/qms/inspectionMethod/inspectionMethod.data' //
import * as DynamicRuleApi from '@/api/qms/dynamicRule' //
import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule.data' //
import * as SelectedSetApi from '@/api/qms/selectedSet' //
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
const { proxy } = getCurrentInstance()
const message = useMessage() //
const props = defineProps({
//
basicFormWidth: {
type: String,
default: ''
},
//
footButttondata: {
type: Array,
required: false,
default: null
},
//
formAllSchemas: {
type: Object,
required: true,
default: null
},
// rules
rules: {
type: Object,
required: true,
default: null
},
//
tableAllSchemas: {
type: Array,
required: true,
default: null
},
tableFormRules: {
type: Array,
required: true,
default: null
},
})
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const dialogWidth = ref()
const formSchema = ref(props.formAllSchemas?.formSchema)
const tableSchemas = ref(props.tableAllSchemas)
const tableFormRules = ref(props.tableFormRules)
const formMainRef = ref()
const data = ref({
code: '',
itemCode: '',
version: '',
testTypeCode: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
inspectionLevel: '',
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
subList: []
})
const dialogVisibleName = ref(false)
const nameForm = ref({
name: ''
})
const nameRef = ref()
if (props.basicFormWidth) {
dialogWidth.value = props.basicFormWidth + '%'
} else {
dialogWidth.value = props.isBusiness ? '60%' : '40%'
}
/** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
formType.value = type
if (row) {
data.value = JSON.parse(JSON.stringify(row))
data.value.packageList = await InspectionJobMainApi.getInspectionJobPackageList(row.id)
data.value.packageList.forEach(item=>{
item.qualifiedAmount =0
item.noQualifiedAmount =0
item.destroyAmount =0
item.frozenAmount =0
})
dialogVisible.value = true
tableSchemas.value.tableFormColumns.map(item=>{
item.tableForm.disabled = true
})
// ==
if(row.useDecision == 1){
data.value.packageList.forEach(item=>{
item.qualifiedAmount = item.amount
})
}
//
else if(row.useDecision == 2 || row.useDecision == 6){
tableSchemas.value.tableFormColumns.map(item=>{
if(item.field == 'qualifiedAmount' ||item.field == 'noQualifiedAmount'){
item.tableForm.disabled = false
}else{
item.tableForm.disabled = true
}
})
}
//
else if(row.useDecision == 3){
data.value.packageList.forEach(item=>{
item.noQualifiedAmount = item.amount
})
}
else if(row.useDecision == 4){
data.value.packageList.forEach(item=>{
item.frozenAmount = item.amount
})
}
nextTick(() => {
formMainRef.value.setValues(row)
})
}
dialogVisible.value = true
}
defineExpose({ open, dialogVisible, formLoading }) // open
// console.log(11,tableAllSchemas.value.tableFormColumns)
//
const emit = defineEmits([
'onChange',
'submitForm'
])
/** 弹窗按钮 */
let Butttondata: any = []
if (props.footButttondata) {
Butttondata = props.footButttondata
} else {
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
}
const onChange = (field, cur)=>{
if(field=='useDecision'){
tableSchemas.value.tableFormColumns.map(item=>{
item.tableForm.disabled = true
})
data.value.packageList.forEach(item=>{
item.qualifiedAmount =0
item.noQualifiedAmount =0
item.destroyAmount =0
item.frozenAmount =0
})
// ==
if(cur == 1){
data.value.packageList.forEach(item=>{
item.qualifiedAmount = item.amount
})
}
//
else if(cur == 2 || cur == 6){
tableSchemas.value.tableFormColumns.map(item=>{
if(item.field == 'qualifiedAmount' ||item.field == 'noQualifiedAmount'){
item.tableForm.disabled = false
}else{
item.tableForm.disabled = true
}
})
}
//
else if(cur == 3){
data.value.packageList.forEach(item=>{
item.noQualifiedAmount = item.amount
})
}
else if(cur == 4){
data.value.packageList.forEach(item=>{
item.frozenAmount = item.amount
})
}
}
}
const buttonBaseClick = (val) => {
//
if (val == 'save') {
submitForm()
}
//
else if (val == 'close') {
dialogVisible.value = false
}
}
const tableFormRef = ref()
const submitForm = async () => {
try {
const elForm = unref(formMainRef)?.getElFormRef()
//
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
//
const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
const data1 = unref(formMainRef)?.formModel
console.log(33,data1)
if(data1.useDecision == 2 || data1.useDecision == 6){
let isBol = data.value.packageList.filter(cur=>parseFloat(cur.qualifiedAmount)+parseFloat(cur.noQualifiedAmount)>parseFloat(cur.amount))
console.log(isBol)
if(isBol&&isBol.length>0){
message.error(`合格数量和不合格数量总和不可以大于数量`)
return
}
}
if (formType.value == 'create') {
//
emit('submitForm', formType.value, data.value)
} else {
// /
emit('submitForm', formType.value, data.value)
}
} catch {
console.log(111)
}
}
</script>
<style scoped>
.small-title {
font-weight: bold;
padding: 0px 10px 10px;
color: #1a8bfc;
font-size: 16px;
}
</style>
<style>
.el-tabs--left .el-tabs__header.is-left {
min-height: 700px !important;
min-width: 150px !important;
}
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left {
min-width: 120px !important;
}
</style>

62
src/views/qms/inspection/inspectionRecord/index.vue

@ -27,21 +27,30 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="InspectionRecordMainRules" <!-- <BasicForm ref="formRef"
:formAllSchemas="InspectionRecordMain.allSchemas" :tableAllSchemas="InspectionRecordDetail.allSchemas" @success="getList"
:tableFormRules="InspectionRecordDetailRules" :tableData="tableData" :rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas"
:tableData="tableData"
:tableAllSchemas="InspectionJobPackage.allSchemas"
:tableFormRules="InspectionJobPackageRules"
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain" :apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain"
:apiCreate="InspectionRecordMainApi.createInspectionRecordMain" :isBusiness="true" @handleAddTable="handleAddTable" :apiCreate="InspectionRecordMainApi.createInspectionRecordMain"
@handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 --> @handleAddTable="handleAddTable"
<!-- <Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" @handleDeleteTable="handleDeleteTable"
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules" @searchTableSuccess="searchTableSuccess"
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail" @submitForm="submitForm" /> -->
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail" <AddForm
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage" ref="formRef"
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" basicFormWidth="80"
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" /> --> :tableAllSchemas="InspectionRecordPackage.allSchemas"
:tableFormRules="InspectionRecordPackageRules"
:rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas"
@submitForm="submitForm"
@onChange='onChange'
/>
<Detail <Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules" :detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules"
@ -57,13 +66,14 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data' import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules,InspectionRecordPackage, InspectionRecordPackageRules} from './inspectionRecordMain.data'
import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data' // import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data'
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue' import listTable from '@/components/listTable/src/listTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue'
import Detail from './detail.vue' import Detail from './detail.vue'
// //
@ -173,6 +183,7 @@
defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), // // defaultButtons.mainListDeleteBtn(null), //
defaultButtons.mainListOrderPubBtn(null), // defaultButtons.mainListOrderPubBtn(null), //
defaultButtons.mainListPackageBtn(null), //
] ]
} }
@ -197,7 +208,7 @@
openForm('update', row) openForm('update', row)
}else if (val == 'mainPackage') { // }else if (val == 'mainPackage') { //
const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id) const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list) listTableRef.value.openPackage(row,'包装信息',InspectionRecordPackage.allSchemas.tableColumns,list)
}else if (val == 'delete') { // }else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
}else if (val == 'mainOrderPub') { // }else if (val == 'mainOrderPub') { //
@ -278,8 +289,23 @@
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
const count = ref(0)
// const onChange = (field, cur)=>{
console.log(field, cur)
// if(field=='useDecision'){
// if(cur == 1){
// InspectionRecordPackage.allSchemas.tableFormColumns.forEach(item=>{
// if(item.field == 'qualifiedAmount'){
// console.log(item.disabled)
// item.disabled = true
// console.log(item.disabled)
// }
// })
// }
// }
console.log(InspectionRecordPackage.allSchemas.tableFormColumns)
}
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
try { try {

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

@ -2,6 +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'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
/** /**
@ -387,25 +388,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验 //表单校验
export const InspectionRecordMainRules = reactive({ export const InspectionRecordMainRules = reactive({
number: [required],
applicationCode: [required],
taskCode: [required],
supplierCode: [required],
materialCode: [required],
batch: [required],
inspectionSchemeCode: [required],
inspectionBatch: [required],
inspectionBatchAmount: [required],
sampleTatalAmount: [required],
inspectionType: [required],
inspectionBatchSource: [required],
orderCode: [required],
orderRow: [required],
inspectionStage: [required],
inspectionStringency: [required],
useDecision: [required], useDecision: [required],
inspectionLevel: [required],
available: [required],
}) })
@ -558,3 +541,123 @@ export const InspectionRecordDetailRules = reactive({
isDestroyInspection: [required], isDestroyInspection: [required],
available: [required], available: [required],
}) })
/**
* @returns {Array}
*/
export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm:{
disabled:true
}
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '采样数量',
field: 'sampleAmount',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '合格数量',
field: 'qualifiedAmount',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '不合格数量',
field: 'noQualifiedAmount',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '破坏数量',
field: 'destroyAmount',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
},
{
label: '冻结数量',
field: 'frozenAmount',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
}
}
]))
//表单校验
export const InspectionRecordPackageRules = reactive({
qualifiedAmount: [
required,
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
],
frozenAmount: [
required,
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
],
destroyAmount: [
required,
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
],
noQualifiedAmount: [
required,
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}
],
})
Loading…
Cancel
Save