Browse Source

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

master_hella_20240701
yufei0306 7 months ago
parent
commit
c333fd62e8
  1. 23
      src/api/qms/inspectionPlan/index.ts
  2. 23
      src/api/qms/inspectionScheme/index.ts
  3. 4
      src/api/qms/samplingProcess/index.ts
  4. 0
      src/views/qms/basicDataManage/inspectionScheme/addForm.vue
  5. 22
      src/views/qms/basicDataManage/inspectionScheme/index.vue
  6. 2
      src/views/qms/basicDataManage/inspectionScheme/inspectionScheme.data.ts
  7. 57
      src/views/qms/samplingProcess/index.vue
  8. 9
      src/views/qms/samplingProcess/samplingProcess.data.ts

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

@ -1,23 +0,0 @@
import request from '@/config/axios'
// 新增
export const inspectionPlanCreat = async (data) => {
return await request.post({ url: `/qms/type-template/create`,data})
}
// 编辑
export const inspectionPlanUpdate = async (data) => {
return await request.put({ url: `/qms/type-template/update`,data})
}
// 删除
export const inspectionPlanDelete = async (id) => {
return await request.delete({ url: `/qms/type-template/delete?id=`+id})
}
// 列表
export const inspectionPlanPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/qms/type-template/senior', data })
} else {
return await request.get({ url: `/qms/type-template/page`, params })
}
}

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

@ -0,0 +1,23 @@
import request from '@/config/axios'
// 新增
export const InspectionSchemeCreat = async (data) => {
return await request.post({ url: `/qms/inspection-scheme/create`,data})
}
// 编辑
export const InspectionSchemeUpdate = async (data) => {
return await request.put({ url: `/qms/inspection-scheme/update`,data})
}
// 删除
export const InspectionSchemeDelete = async (id) => {
return await request.delete({ url: `/qms/inspection-scheme/delete?id=`+id})
}
// 列表
export const InspectionSchemePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/qms/inspection-scheme/senior', data })
} else {
return await request.get({ url: `/qms/inspection-scheme/page`, params })
}
}

4
src/api/qms/samplingProcess/index.ts

@ -51,3 +51,7 @@ export const exportSamplingProcess = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/sampling-process/get-import-template' }) return request.download({ url: '/qms/sampling-process/get-import-template' })
} }
export const getSamplingScheme = async () => {
return await request.get({ url: `/qms/sampling-scheme/get-available-list`})
}

0
src/views/qms/basicDataManage/inspectionPlan/addForm.vue → src/views/qms/basicDataManage/inspectionScheme/addForm.vue

22
src/views/qms/basicDataManage/inspectionPlan/index.vue → src/views/qms/basicDataManage/inspectionScheme/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="InspectionPlanMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="InspectionSchemeMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -11,7 +11,7 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="InspectionPlanMain.allSchemas" :allSchemas="InspectionSchemeMain.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -52,16 +52,16 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {InspectionPlanMain } from './inspectionPlan.data' import {InspectionSchemeMain } from './inspectionScheme.data'
import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../inspectionTemplate/inspectionTemplate.data' import { InspectionTemplateMain,InspectionTemplateProcess,InspectionTemplateFeatures,InspectionTemplateRules } from '../inspectionTemplate/inspectionTemplate.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons' 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 InspectionPlanApi from '@/api/qms/inspectionPlan' import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
defineOptions({ name: 'AgvLocationrelation' }) defineOptions({ name: 'InspectionScheme' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -69,7 +69,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(InspectionPlanMain.allSchemas.tableColumns) const tableColumns = ref(InspectionSchemeMain.allSchemas.tableColumns)
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
@ -77,7 +77,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: InspectionPlanApi.inspectionPlanPage // getListApi: InspectionSchemeApi.InspectionSchemePage //
}) })
// //
@ -143,7 +143,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const submitForm = async (formType,data) => { const submitForm = async (formType,data) => {
var isHave =InspectionPlanMain.allSchemas.formSchema.some(function (item) { var isHave =InspectionSchemeMain.allSchemas.formSchema.some(function (item) {
return item.field === 'effectiveDate' || item.field === 'expirationDate'; return item.field === 'effectiveDate' || item.field === 'expirationDate';
}); });
if(isHave){ if(isHave){
@ -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 InspectionPlanApi.inspectionPlanCreat(data1) await InspectionSchemeApi.inspectionSchemeCreat(data1)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await InspectionPlanApi.inspectionPlanUpdate(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 InspectionPlanApi.inspectionPlanDelete(id) await InspectionSchemeApi.inspectionSchemeDelete(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

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

@ -68,7 +68,7 @@ export const InspectionTemplateRules = reactive({
{ required: true, message: '请输入选择集编码', trigger: 'blur' } { required: true, message: '请输入选择集编码', trigger: 'blur' }
], ],
}) })
export const InspectionPlanMain = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',

57
src/views/qms/samplingProcess/index.vue

@ -48,6 +48,7 @@
:apiCreate="SamplingProcessApi.createSamplingProcess" :apiCreate="SamplingProcessApi.createSamplingProcess"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
@onChange="onChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -65,6 +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 ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import {getSamplingScheme} from "@/api/qms/samplingProcess";
defineOptions({ name: 'SamplingProcess' }) defineOptions({ name: 'SamplingProcess' })
@ -226,6 +228,61 @@ const importSuccess = () => {
getList() getList()
} }
const onChange =async (field,value)=>{
if(field == 'sampleType'&& value == '1'){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.label='样品量'
item.component = 'Input'
item.componentProps.disabled = true
}
if(item.field == "sampleProgCode"){
item.componentProps.disabled = true
}
})
}else if(field == 'sampleType'&& value == '2'){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.label='样品量(%)'
item.component = 'Input'
item.componentProps.disabled = false
}
if(item.field == "sampleProgCode"){
item.componentProps.disabled = true
}
})
}else if(field == 'sampleType'&& value == '3'){
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.label='样品量'
item.component = 'Input'
item.componentProps.disabled = false
}
if(item.field == "sampleProgCode"){
item.componentProps.disabled = true
}
})
}else if(field == 'sampleType'&& value == '4'){
const data = await SamplingProcessApi.getSamplingScheme()
const options = data.map(item=>{
return{
value:item.code,
label:item.description,
}
})
SamplingProcess.allSchemas.formSchema.forEach(item=>{
if(item.field == "sampleSize"){
item.componentProps.disabled = true
}
if(item.field == "sampleProgCode"){
item.component = 'Select'
item.componentProps.disabled = false
item.componentProps.options = options
}
})
}
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {

9
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -38,7 +38,7 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
}, },
{ {
@ -48,7 +48,7 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.EVALUATION_MODE, dictType: DICT_TYPE.EVALUATION_MODE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
}, },
{ {
@ -60,6 +60,9 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
label: '采样方案编码', label: '采样方案编码',
field: 'sampleProgCode', field: 'sampleProgCode',
sort: 'custom', sort: 'custom',
form: {
component: 'Select'
},
}, },
{ {
label: '是否可用', label: '是否可用',
@ -68,7 +71,7 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
}, },
{ {

Loading…
Cancel
Save