Browse Source

质量通知

master_hella_20240701
zhang_li 8 months ago
parent
commit
310ae7f999
  1. 4
      src/api/qms/qualityNotice/index.ts
  2. 113
      src/views/qms/qualityNotice/addForm.vue
  3. 10
      src/views/qms/qualityNotice/components/notaicType.vue
  4. 14
      src/views/qms/qualityNotice/components/qualityBatch.vue
  5. 7
      src/views/qms/qualityNotice/components/qualityNotice.vue
  6. 29
      src/views/qms/qualityNotice/index.vue

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

@ -25,3 +25,7 @@ export const qualityNoticeDelete = async (id) => {
export const qualityNoticeDetail = async (id) => { export const qualityNoticeDetail = async (id) => {
return await request.get({ url: `/basic/quality-notice/get?id=`+id}) return await request.get({ url: `/basic/quality-notice/get?id=`+id})
} }
// 详情
export const qualityNoticePublish = async (id) => {
return await request.put({ url: `/basic/quality-notice/release?id=`+id})
}

113
src/views/qms/qualityNotice/addForm.vue

@ -13,9 +13,9 @@
<el-step title="质量通知" /> <el-step title="质量通知" />
<el-step title="质量物料批次" /> <el-step title="质量物料批次" />
</el-steps> </el-steps>
<NotaicType v-show="active == 0" ref="notaicTypeFrom" :data='data' /> <NotaicType v-show="active == 0" ref="notaicTypeFrom" :data='data' :disabled='disabled'/>
<qualityNotice v-show="active == 1" ref="qualityNoticeFrom" :data='data' :type="notaicTypeFrom?.type||1"/> <qualityNotice v-show="active == 1" ref="qualityNoticeFrom" :data='data' :type="notaicTypeFrom?.type||1"/>
<qualityBatch v-show="active == 2" ref="qualityBatchFrom" :subListData='data.subList'/> <qualityBatch v-show="active == 2" ref="qualityBatchFrom" :subListData='data.subList' :number='data.number'/>
</div> </div>
<template #footer> <template #footer>
<el-button @click="prov" type="primary" v-if="active != 0">上一步</el-button> <el-button @click="prov" type="primary" v-if="active != 0">上一步</el-button>
@ -126,7 +126,7 @@ if (props.basicFormWidth) {
const rules = ref({ const rules = ref({
...props.rules ...props.rules
}) })
const disabled = ref(false)
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
if (titleName) { if (titleName) {
@ -134,6 +134,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} else { } else {
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
} }
//
disabled.value=false
if(type == 'detail'){
disabled.value = true
}
formType.value = type formType.value = type
active.value =0 active.value =0
if (row) { if (row) {
@ -195,7 +200,6 @@ const submitForm = async () => {
} }
console.log(data.value)
data.value.subList = qualityBatchFrom.value.subList data.value.subList = qualityBatchFrom.value.subList
if(data.value.subList.length==0){ if(data.value.subList.length==0){
message.error('请填写质量物料批次') message.error('请填写质量物料批次')
@ -310,50 +314,7 @@ const opensearchTable = (
// //
// val row // val row
const searchTableSuccess = async (formField, searchField, val, type, row) => { const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (type == 'features') {
row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code
if (formField == 'inspectionMethodCode') {
row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description
} else if (formField == 'dynamicUpdateCode') {
row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description
} else if (formField == 'inspectionMethod') {
row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description
}
} else if (type == 'main') {
data.value[formField] = val[0].code
if (formField == 'itemCode') {
data.value.itemName = val[0].name
} else if (formField == 'testTypeCode') {
data.value.testTypeName = val[0].description
} else if (formField == 'programmeTemplateCode') {
data.value.programmeTemplateName = val[0].description
}
if (formField == 'programmeTemplateCode') {
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
//
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
}
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required =
false
}
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
}
})
data.value.subList = list
}
}
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
} }
@ -362,34 +323,41 @@ const next = () => {
if (active.value == 2) return if (active.value == 2) return
if (active.value == 0) { if (active.value == 0) {
if (notaicTypeFrom.value.type == 1) { if (notaicTypeFrom.value.type == 1) {
notaicTypeFrom.value.formRef1.validate((valid) => { if(!props.disabled){
if (valid) { notaicTypeFrom.value.formRef1.validate((valid) => {
active.value++ if (valid) {
} else { active.value++
console.log('error submit!') } else {
return false console.log('error submit!')
} return false
}) }
})
}
} else if (notaicTypeFrom.value.type == 2) { } else if (notaicTypeFrom.value.type == 2) {
notaicTypeFrom.value.formRef2.validate((valid) => { if(!props.disabled){
if (valid) { notaicTypeFrom.value.formRef2.validate((valid) => {
active.value++ if (valid) {
} else { active.value++
return false } else {
} return false
}) }
})
}
} else if (notaicTypeFrom.value.type == 3) { } else if (notaicTypeFrom.value.type == 3) {
notaicTypeFrom.value.formRef3.validate((valid) => { if(!props.disabled){
if (valid) { notaicTypeFrom.value.formRef3.validate((valid) => {
active.value++ if (valid) {
} else { active.value++
console.log('error submit!') } else {
return false console.log('error submit!')
} return false
}) }
})
}
} }
}else if (active.value == 1) { }else if (active.value == 1) {
qualityNoticeFrom.value.formRef.validate((valid) => { if(!props.disabled){
qualityNoticeFrom.value.formRef.validate((valid) => {
if (valid) { if (valid) {
// //
if (qualityNoticeFrom.value.form.requestStartTime > qualityNoticeFrom.value.form.requestEndTime) { if (qualityNoticeFrom.value.form.requestStartTime > qualityNoticeFrom.value.form.requestEndTime) {
@ -413,6 +381,7 @@ const next = () => {
return false return false
} }
}) })
}
} }
} }
// //

10
src/views/qms/qualityNotice/components/notaicType.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="content"> <div class="content">
<div class="type"> <div class="type">
<el-radio-group v-model="type" @change="changeType"> <el-radio-group v-model="type" @change="changeType" :disabled='disabled'>
<el-radio <el-radio
:label="cur.value" :label="cur.value"
v-for="cur in getIntDictOptions(DICT_TYPE.QUALITY_NOTIFICATION_TYPE)" v-for="cur in getIntDictOptions(DICT_TYPE.QUALITY_NOTIFICATION_TYPE)"
@ -17,6 +17,7 @@
ref="formRef1" ref="formRef1"
v-show="type == 1" v-show="type == 1"
:rules="rules1" :rules="rules1"
:disabled='disabled'
> >
<!-- Q1客户投诉表单 --> <!-- Q1客户投诉表单 -->
<el-row :gutter="20"> <el-row :gutter="20">
@ -58,6 +59,7 @@
ref="formRef2" ref="formRef2"
:rules="rules2" :rules="rules2"
v-show="type == 2" v-show="type == 2"
:disabled='disabled'
> >
<!-- Q2供应商投诉表单 --> <!-- Q2供应商投诉表单 -->
<el-row :gutter="20"> <el-row :gutter="20">
@ -99,6 +101,7 @@
ref="formRef3" ref="formRef3"
:rules="rules3" :rules="rules3"
v-show="type == 3" v-show="type == 3"
:disabled='disabled'
> >
<!-- Q3内部质量参考通知 --> <!-- Q3内部质量参考通知 -->
<el-row :gutter="20"> <el-row :gutter="20">
@ -158,6 +161,11 @@ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: null default: null
},
//
disabled:{
type:Boolean,
default: false
} }
}) })
type.vlaue = props.data?.type ? props.data.type : 1 type.vlaue = props.data?.type ? props.data.type : 1

14
src/views/qms/qualityNotice/components/qualityBatch.vue

@ -194,7 +194,7 @@
<el-form-item prop="status" label="状态" > <el-form-item prop="status" label="状态" >
<!-- <el-input v-model="taskForm.status" placeholder="请输入状态" /> --> <!-- <el-input v-model="taskForm.status" placeholder="请输入状态" /> -->
<el-select v-model="taskForm.status" placeholder="请选择状态"> <el-select v-model="taskForm.status" placeholder="请选择状态">
<el-option v-for="item in getIntDictOptions(DICT_TYPE.QUALITY_TASK_STATUS)" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -360,7 +360,11 @@ const props = defineProps({
subListData: { subListData: {
type: Array, type: Array,
default: null default: null
} },
number: {
type: String,
default: ''
},
}) })
const editableTabsValue = ref('1') const editableTabsValue = ref('1')
const dialogVisible = ref(false)// const dialogVisible = ref(false)//
@ -386,6 +390,7 @@ const nameForm = ref({
name: '' name: ''
})// })//
const subList = ref([]) const subList = ref([])
const statusList = ref()
// //
nextTick(()=>{ nextTick(()=>{
subList.value =props.subListData subList.value =props.subListData
@ -393,6 +398,11 @@ nextTick(()=>{
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
}) })
if(props.number){
statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS)
}else{
statusList.value =getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS).filter(item=>item.value == 1)
}
}) })
// //

7
src/views/qms/qualityNotice/components/qualityNotice.vue

@ -5,6 +5,7 @@
label-width="120px" label-width="120px"
:rules="rules" :rules="rules"
ref="formRef" ref="formRef"
:disabled='disabled'
> >
<!-- 质量通知表单 --> <!-- 质量通知表单 -->
<el-row :gutter="20"> <el-row :gutter="20">
@ -148,12 +149,18 @@ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: null default: null
},
//
disabled:{
type:Boolean,
default: false
} }
}) })
const statusList = ref() const statusList = ref()
// //
nextTick(()=>{ nextTick(()=>{
form.value = props.data ? props.data: {} form.value = props.data ? props.data: {}
form.value.status = 1
if(form.value.number){ if(form.value.number){
statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS) statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS)
}else{ }else{

29
src/views/qms/qualityNotice/index.vue

@ -151,13 +151,9 @@
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi:'qms:quality-notice:edit'}), // defaultButtons.mainListEditBtn({ hide: isShowMainButton(row,['1']),hasPermi:'qms:quality-notice:edit'}), //
// defaultButtons.mainListEditBtn({hasPermi:'qms:quality-notice:delete'}), // // defaultButtons.mainListEditBtn({hasPermi:'qms:quality-notice:delete'}), //
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row,'pub'),hasPermi:'qms:quality-notice:pub'}), // defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row,['1']),hasPermi:'qms:quality-notice:pub'}), //
// defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-job-main:close'}), //
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:abandon'}), //
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:execute'}), //
// defaultButtons.mainListPackageBtn(null), //
] ]
} }
const listTableRef = ref() const listTableRef = ref()
@ -167,9 +163,9 @@
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if(val == 'agree'){ } else if (val == 'mainOrderPub') { //
handleAgree(row.id) handleOrderPub(row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
@ -180,7 +176,8 @@
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain') // detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionJobMain')
openForm('detail',row)
} }
@ -203,6 +200,18 @@
formRef.value.formLoading = false formRef.value.formLoading = false
} }
} }
/** 发布按钮操作 */
const handleOrderPub = async (row : object) => {
try {
//
await message.confirm(t('common.confirmPublish'))
//
await qualityNoticeApi.qualityNoticePublish(row.id)
message.success(t('common.publishSuccess'))
//
await getList()
} catch { }
}
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()

Loading…
Cancel
Save