Browse Source

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

master_hella_20240701
zhaoxuebing 6 months ago
parent
commit
2a7b7cd7c2
  1. 23
      src/api/qms/inspectionPlan/index.ts
  2. 4
      src/utils/dict.ts
  3. 141
      src/views/qms/basicDataManage/inspectionPlan/addForm.vue
  4. 10
      src/views/qms/basicDataManage/inspectionPlan/index.vue
  5. 18
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
  6. 10
      src/views/qms/inspection/inspectionJob/index.vue

23
src/api/qms/inspectionPlan/index.ts

@ -1,30 +1,23 @@
import request from '@/config/axios' import request from '@/config/axios'
// 查询采样过程列表
export const getListByTempleteCode = async (code) => {
return await request.get({ url: `/qms/inspection-process/getListByTempleteCode?code=`+code})
}
// 新增 // 新增
export const inspectionTemplateCreat = async (data) => { export const inspectionPlanCreat = async (data) => {
return await request.post({ url: `/qms/programme-template/create`,data}) return await request.post({ url: `/qms/type-template/create`,data})
} }
// 编辑 // 编辑
export const inspectionTemplateUpdate = async (data) => { export const inspectionPlanUpdate = async (data) => {
return await request.put({ url: `/qms/programme-template/update`,data}) return await request.put({ url: `/qms/type-template/update`,data})
} }
// 删除 // 删除
export const inspectionTemplateDelete = async (id) => { export const inspectionPlanDelete = async (id) => {
return await request.delete({ url: `/qms/programme-template/delete?id=`+id}) return await request.delete({ url: `/qms/type-template/delete?id=`+id})
} }
// 列表 // 列表
export const inspectionTemplatePage = async (params) => { export const inspectionPlanPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return request.post({ url: '/wms/accountcalendar/senior', data }) return request.post({ url: '/wms/accountcalendar/senior', data })
} else { } else {
return await request.get({ url: `/qms/programme-template/page`, params }) return await request.get({ url: `/qms/type-template/page`, params })
} }
} }

4
src/utils/dict.ts

@ -293,7 +293,9 @@ export enum DICT_TYPE {
INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型 INSPECTION_CHARACTERISTICS_FEATURE_TYPE = "inspection_characteristics_feature_type", // 特征类型
INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式 INSPECTION_CHARACTERISTICS_RESULT_ENTRY = "inspection_characteristics_result_entry", // 结果录入方式
INSPECTION_SEVERITY = 'inspection_severity',//检验严重性 INSPECTION_SEVERITY = 'inspection_severity',//检验严重性
SPLIT_RULES = "split_rules", // 拆分规则
INSPECTION_LEVEL = "inspection_level", // 检验水平字典
BASIC_AQL = "basic_aql", // aql
// ========== 业务 - mes -gaojs ========== // ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status',//质检状态 QUALIFY_STATUS = 'qualify_status',//质检状态

141
src/views/qms/basicDataManage/inspectionPlan/addForm.vue

@ -7,9 +7,8 @@
:vLoading="formLoading" :vLoading="formLoading"
> >
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px"> <div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> <el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
<el-row> <el-row gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" /> <el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" />
@ -25,6 +24,103 @@
<el-input v-model="data.version" placeholder="请填写版本" /> <el-input v-model="data.version" placeholder="请填写版本" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="检验类型编码" prop="testTypeCode" >
<div style="display: flex; width: 100%">
<el-input
v-model="data.testTypeCode"
disabled
placeholder="请选择检验类型编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="opensearchTable('testTypeCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApi.getSamplingProcessPage,null,false,null,item)"
><Icon icon="ep:search"/>
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验模板编码" prop="programmeTemplateCode" >
<div style="display: flex; width: 100%">
<el-input
v-model="data.testTypeCode"
disabled
placeholder="请选择检验模板编码"
/>
<el-button
type="info"
plain
style="width: 40px"
@click="opensearchTable('programmeTemplateCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApigetSamplingProcessPage,null,false,null,item)"
><Icon icon="ep:search"/>
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="拆分规则" prop="splitRule">
<el-select v-model="data.splitRule" placeholder="请选择拆分规则" >
<el-option
v-for="dict in getStrDictOptions( DICT_TYPE.SPLIT_RULES )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="aql" prop="aql">
<el-select v-model="data.aql" placeholder="请选择aql" >
<el-option
v-for="dict in getStrDictOptions( DICT_TYPE.BASIC_AQL )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验水平" prop="inspectionLevel">
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平" >
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_LEVEL )"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效时间" prop="effectiveDate">
<el-date-picker
v-model="data.effectiveDate"
type="datetime"
placeholder="请选择生效时间"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="失效时间" prop="expirationDate">
<el-date-picker
v-model="data.expirationDate"
type="datetime"
placeholder="请选择失效时间"
style="width:100%"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-switch v-model="data.available" />
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-tabs <el-tabs
@ -43,13 +139,6 @@
:name="item.name" :name="item.name"
> >
<div class="small-title">检验工序</div> <div class="small-title">检验工序</div>
<!-- <Form
:ref="`formRefProcess`+index"
:schema="formAllSchemasProcess"
:is-col="true"
labelWidth="150px"
:rules="rules"
/> -->
<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">
<el-col :span="12"> <el-col :span="12">
@ -483,6 +572,7 @@ const data = ref({
code: '', code: '',
description: '', description: '',
version: '', version: '',
available:true,
process: [] process: []
}) })
const isYesList = [ const isYesList = [
@ -576,10 +666,28 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type formType.value = type
if (row) { if (row) {
data.value = row data.value = row
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
//
if(item.quantifyIsCapping){
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if(item.quantifyIsLowlimit){
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if(item.quantifyIsTarget){
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}else{
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
}) })
data.value.process = list data.value.process = list
} else { } else {
@ -587,6 +695,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
code: '', code: '',
description: '', description: '',
version: '', version: '',
available:true,
process: [] process: []
} }
} }
@ -645,6 +754,7 @@ const buttonBaseClick1 = (val) => {
featureType: '', featureType: '',
quantifyIsCapping: '', quantifyIsCapping: '',
quantifyIsLowlimit: '', quantifyIsLowlimit: '',
quantifyIsTarget: '',
quantifyTarget: '', quantifyTarget: '',
quantifyCapping: '', quantifyCapping: '',
quantifyLowlimit: '', quantifyLowlimit: '',
@ -691,6 +801,7 @@ const validateForm = (formRef) => {
return false return false
}) })
} }
const submitForm = async () => { const submitForm = async () => {
try { try {
const validateForm1 = await validateForm(formProcessRef.value) const validateForm1 = await validateForm(formProcessRef.value)
@ -706,6 +817,13 @@ const submitForm = async () => {
message.error(`模板中有检验工序和检验特性未填写完全`) message.error(`模板中有检验工序和检验特性未填写完全`)
return; return;
} }
const arr = data.value.process.filter(item=>(!item.inspectionCharacteristicsBaseVO.quantifyIsCapping&&!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit&&!item.inspectionCharacteristicsBaseVO.quantifyIsTarget&&item.inspectionCharacteristicsBaseVO.featureType == 0))
console.log(arr)
if(arr&&arr.length>0){
const str = arr.map(item=>item.description).join(',')
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
return;
}
if (formType.value == 'create') { if (formType.value == 'create') {
// //
emit('submitForm', formType.value, data) emit('submitForm', formType.value, data)
@ -730,6 +848,11 @@ if (props.footButttondata) {
// //
const changeFeatureType = (e) => { const changeFeatureType = (e) => {
console.log(e) console.log(e)
// if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// }
} }
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = ( const opensearchTable = (

10
src/views/qms/basicDataManage/inspectionPlan/index.vue

@ -66,7 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import * as InspectionProcessPageApi from '@/api/qms/inspectionPlan' import * as InspectionPlanApi from '@/api/qms/inspectionPlan'
defineOptions({ name: 'AgvLocationrelation' }) defineOptions({ name: 'AgvLocationrelation' })
@ -84,7 +84,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: InspectionProcessPageApi.inspectionTemplatePage // getListApi: InspectionPlanApi.inspectionPlanPage //
}) })
// //
@ -149,10 +149,10 @@ const openForm = (type: string, row?: any) => {
const submitForm = async (formType,data) => { const submitForm = async (formType,data) => {
console.log(data.value) console.log(data.value)
if (formType === 'create') { if (formType === 'create') {
await InspectionProcessPageApi.inspectionTemplateCreat(data.value) await InspectionPlanApi.inspectionPlanCreat(data.value)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await InspectionProcessPageApi.inspectionTemplateUpdate(data.value) await InspectionPlanApi.inspectionPlanUpdate(data.value)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -171,7 +171,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await InspectionProcessPageApi.inspectionTemplateDelete(id) await InspectionPlanApi.inspectionPlanDelete(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

18
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -8,7 +8,7 @@
> >
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px"> <div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px">
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> --> <!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> -->
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> <el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef" gutter="20">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
@ -266,7 +266,9 @@
label="是否设定上限" label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-select
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
placeholder="请选择是否设定上限" placeholder="请选择是否设定上限"
@change="changeIsCapping" @change="changeIsCapping"
@ -277,7 +279,7 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -295,7 +297,8 @@
label="是否设定下限" label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-select <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
placeholder="请选择是否设定下限" placeholder="请选择是否设定下限"
@change="changeLowlimit" @change="changeLowlimit"
@ -306,7 +309,7 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -324,7 +327,8 @@
label="是否设定目标值" label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-select <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget"/>
<!-- <el-select
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
placeholder="请选择是否设定目标值" placeholder="请选择是否设定目标值"
@change="changeIsTarget" @change="changeIsTarget"
@ -335,7 +339,7 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">

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

@ -78,11 +78,11 @@
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number'] // row['itemNumber'] = val[0]['number']
row['itemName'] = val[0]['name'] // row['itemName'] = val[0]['name']
row['uom'] = val[0]['uom'] // row['uom'] = val[0]['uom']
row['isRadeIn'] = val[0]['isRadeIn'] // row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available'] // row['available'] = val[0]['available']
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]

Loading…
Cancel
Save