Browse Source

质量通知

master_hella_20240701
zhang_li 8 months ago
parent
commit
310ae7f999
  1. 4
      src/api/qms/qualityNotice/index.ts
  2. 65
      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. 27
      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) => {
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})
}

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

@ -13,9 +13,9 @@
<el-step title="质量通知" />
<el-step title="质量物料批次" />
</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"/>
<qualityBatch v-show="active == 2" ref="qualityBatchFrom" :subListData='data.subList'/>
<qualityBatch v-show="active == 2" ref="qualityBatchFrom" :subListData='data.subList' :number='data.number'/>
</div>
<template #footer>
<el-button @click="prov" type="primary" v-if="active != 0">上一步</el-button>
@ -126,7 +126,7 @@ if (props.basicFormWidth) {
const rules = ref({
...props.rules
})
const disabled = ref(false)
/** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
if (titleName) {
@ -134,6 +134,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} else {
dialogTitle.value = t('action.' + type)
}
//
disabled.value=false
if(type == 'detail'){
disabled.value = true
}
formType.value = type
active.value =0
if (row) {
@ -195,7 +200,6 @@ const submitForm = async () => {
}
console.log(data.value)
data.value.subList = qualityBatchFrom.value.subList
if(data.value.subList.length==0){
message.error('请填写质量物料批次')
@ -310,50 +314,7 @@ const opensearchTable = (
//
// val 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)
}
@ -362,6 +323,7 @@ const next = () => {
if (active.value == 2) return
if (active.value == 0) {
if (notaicTypeFrom.value.type == 1) {
if(!props.disabled){
notaicTypeFrom.value.formRef1.validate((valid) => {
if (valid) {
active.value++
@ -370,7 +332,9 @@ const next = () => {
return false
}
})
}
} else if (notaicTypeFrom.value.type == 2) {
if(!props.disabled){
notaicTypeFrom.value.formRef2.validate((valid) => {
if (valid) {
active.value++
@ -378,7 +342,9 @@ const next = () => {
return false
}
})
}
} else if (notaicTypeFrom.value.type == 3) {
if(!props.disabled){
notaicTypeFrom.value.formRef3.validate((valid) => {
if (valid) {
active.value++
@ -388,7 +354,9 @@ const next = () => {
}
})
}
}
}else if (active.value == 1) {
if(!props.disabled){
qualityNoticeFrom.value.formRef.validate((valid) => {
if (valid) {
//
@ -414,6 +382,7 @@ const next = () => {
}
})
}
}
}
//
const prov = () => {

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

@ -1,7 +1,7 @@
<template>
<div class="content">
<div class="type">
<el-radio-group v-model="type" @change="changeType">
<el-radio-group v-model="type" @change="changeType" :disabled='disabled'>
<el-radio
:label="cur.value"
v-for="cur in getIntDictOptions(DICT_TYPE.QUALITY_NOTIFICATION_TYPE)"
@ -17,6 +17,7 @@
ref="formRef1"
v-show="type == 1"
:rules="rules1"
:disabled='disabled'
>
<!-- Q1客户投诉表单 -->
<el-row :gutter="20">
@ -58,6 +59,7 @@
ref="formRef2"
:rules="rules2"
v-show="type == 2"
:disabled='disabled'
>
<!-- Q2供应商投诉表单 -->
<el-row :gutter="20">
@ -99,6 +101,7 @@
ref="formRef3"
:rules="rules3"
v-show="type == 3"
:disabled='disabled'
>
<!-- Q3内部质量参考通知 -->
<el-row :gutter="20">
@ -158,6 +161,11 @@ const props = defineProps({
data: {
type: Object,
default: null
},
//
disabled:{
type:Boolean,
default: false
}
})
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-input 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-form-item>
</el-col>
@ -360,7 +360,11 @@ const props = defineProps({
subListData: {
type: Array,
default: null
}
},
number: {
type: String,
default: ''
},
})
const editableTabsValue = ref('1')
const dialogVisible = ref(false)//
@ -386,6 +390,7 @@ const nameForm = ref({
name: ''
})//
const subList = ref([])
const statusList = ref()
//
nextTick(()=>{
subList.value =props.subListData
@ -393,6 +398,11 @@ nextTick(()=>{
editableTabsValue.value = 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"
:rules="rules"
ref="formRef"
:disabled='disabled'
>
<!-- 质量通知表单 -->
<el-row :gutter="20">
@ -148,12 +149,18 @@ const props = defineProps({
data: {
type: Object,
default: null
},
//
disabled:{
type:Boolean,
default: false
}
})
const statusList = ref()
//
nextTick(()=>{
form.value = props.data ? props.data: {}
form.value.status = 1
if(form.value.number){
statusList.value = getIntDictOptions(DICT_TYPE.QUALITY_NOTICE_STATUS)
}else{

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

@ -151,13 +151,9 @@
// -
const butttondata = (row) => {
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.mainListOrderPubBtn({ hide: isShowMainButton(row,'pub'),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), //
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row,['1']),hasPermi:'qms:quality-notice:pub'}), //
]
}
const listTableRef = ref()
@ -167,8 +163,8 @@
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if(val == 'agree'){
handleAgree(row.id)
} else if (val == 'mainOrderPub') { //
handleOrderPub(row)
}
}
/** 添加/修改操作 */
@ -180,7 +176,8 @@
/** 详情操作 */
const detailRef = ref()
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
}
}
/** 发布按钮操作 */
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()

Loading…
Cancel
Save