Browse Source

质量通知

master_hella_20240701
zhang_li 7 months ago
parent
commit
1090b0363c
  1. 156
      src/views/qms/qualityNotice/addForm.vue
  2. 100
      src/views/qms/qualityNotice/components/notaicType.vue
  3. 381
      src/views/qms/qualityNotice/components/qualityBatch.vue
  4. 82
      src/views/qms/qualityNotice/components/qualityNotice.vue
  5. 1
      src/views/qms/qualityNotice/index.vue

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

@ -7,31 +7,31 @@
:close-on-click-modal="false"
:vLoading="formLoading"
>
<div style="max-height: 80vh; overflow-y: auto; padding: 0px 20px">
<el-steps style="width: 100%;" :active="active" align-center>
<el-step title="选择质量通知类型"/>
<el-step title="质量通知"/>
<el-step title="质量物料批次" />
</el-steps>
<NotaicType v-show="active == 0"/>
<qualityNotice v-show="active == 1"/>
<qualityBatch v-show="active == 2"/>
<el-button style="margin-top: 12px" @click="prov" type="primary">上一步</el-button>
<el-button style="margin-top: 12px" @click="next" type="primary">下一步</el-button>
</div>
<template #footer>
<div style="max-height: 80vh; overflow-y: auto; padding: 0px 20px">
<el-steps style="width: 100%" :active="active" align-center>
<el-step title="选择质量通知类型" />
<el-step title="质量通知" />
<el-step title="质量物料批次" />
</el-steps>
<NotaicType v-show="active == 0" ref="notaicTypeFrom" />
<qualityNotice v-show="active == 1" ref="qualityNoticeFrom" :type="notaicTypeFrom.type"/>
<qualityBatch v-show="active == 2" ref="qualityBatchFrom" />
</div>
<template #footer>
<el-button @click="prov" type="primary" v-if="active != 0">上一步</el-button>
<el-button @click="next" type="primary" v-if="active != 2">下一步</el-button>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
</template>
</Dialog>
</Dialog>
</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 NotaicType from './components/notaicType.vue'
import qualityNotice from './components/qualityNotice.vue'
import qualityBatch from './components/qualityBatch.vue'
import NotaicType from './components/notaicType.vue'
import qualityNotice from './components/qualityNotice.vue'
import qualityBatch from './components/qualityBatch.vue'
const { proxy } = getCurrentInstance()
const message = useMessage() //
const props = defineProps({
@ -87,6 +87,10 @@ const props = defineProps({
required: true,
default: null
},
type: {
type: Number,
default: 0
}
})
const { t } = useI18n() //
@ -112,15 +116,12 @@ const data = ref({
available: 'TRUE',
subList: []
})
const active = ref(2)
const active = ref(0)
const notaicTypeFrom = ref('')
const qualityNoticeFrom = ref('')
const qualityBatchFrom = ref('')
const next = () => {
if (active.value++ > 2) return
console.log(active.value)
}
const prov = () => {
if (active.value-- < 0 ) return
}
const dialogVisibleName = ref(false)
const nameForm = ref({
name: ''
@ -146,8 +147,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type
if (row) {
data.value = JSON.parse(JSON.stringify(row))
dialogVisible.value = true
nextTick(() => {
formMainRef.value.setValues(row)
@ -279,21 +278,21 @@ const submitForm = async () => {
const valid = await elForm.validate()
if (!valid) return
//
console.log(11,data.value.packageList)
if(data.value.packageList?.length>0){
console.log(11, data.value.packageList)
if (data.value.packageList?.length > 0) {
const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
if (!validateForm1) return
let number = 0
data.value.packageList.forEach(cur=>{
data.value.packageList.forEach((cur) => {
number += parseFloat(cur.sampleAmount)
})
if(number != data.value.sampleTotalAmount){
if (number != data.value.sampleTotalAmount) {
message.error(`采样数量之和不等于总数量`)
return
}
}
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
@ -301,8 +300,8 @@ const submitForm = async () => {
}
//
let arrBol = []
let isOutweigh = []//
let numberList = []//
let isOutweigh = [] //
let numberList = [] //
data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push(
@ -341,7 +340,10 @@ const submitForm = async () => {
)
}
//
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
if (
item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >
item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime
) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
}
//
@ -349,26 +351,29 @@ const submitForm = async () => {
numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != data.value.sampleTotalAmount
return (
parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) !=
data.value.sampleTotalAmount
)
}
)
)
}
})
let isEmpty1 = arrBol.some(item=>item == true)
let isEmptyNumberList = numberList.some(item=>item == true)
if(isEmpty1){
let isEmpty1 = arrBol.some((item) => item == true)
let isEmptyNumberList = numberList.some((item) => item == true)
if (isEmpty1) {
message.error('检验工序和检验特性有字段未填写完全')
return;
return
}
if(isOutweigh?.length>0){
if (isOutweigh?.length > 0) {
message.error('检验特性中有开始时间大于结束时间')
return;
return
}
console.log(44,numberList)
if(isEmptyNumberList){
console.log(44, numberList)
if (isEmptyNumberList) {
message.error('合格数量和不合格数量之和不等于总数量')
return;
return
}
if (formType.value == 'create') {
//
@ -517,7 +522,62 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
}
//
const next = () => {
if (active.value == 2) return
if (active.value == 0) {
if (notaicTypeFrom.value.type == 1) {
notaicTypeFrom.value.formRef1.validate((valid) => {
if (valid) {
console.log('submit!')
console.log(notaicTypeFrom.value.formRef1)
active.value++
} else {
console.log('error submit!')
return false
}
})
} else if (notaicTypeFrom.value.type == 2) {
notaicTypeFrom.value.formRef2.validate((valid) => {
if (valid) {
console.log('submit!')
console.log(notaicTypeFrom.value.formRef1)
active.value++
} else {
console.log('error submit!')
return false
}
})
} else if (notaicTypeFrom.value.type == 3) {
notaicTypeFrom.value.formRef3.validate((valid) => {
if (valid) {
console.log('submit!')
console.log(notaicTypeFrom.value.formRef1)
active.value++
} else {
console.log('error submit!')
return false
}
})
}
console.log(notaicTypeFrom.value.form)
}else if (active.value == 1) {
qualityNoticeFrom.value.formRef.validate((valid) => {
if (valid) {
console.log(qualityNoticeFrom.value.form)
active.value++
} else {
console.log('error submit!')
return false
}
})
}
}
//
const prov = () => {
if (active.value == 0) return
active.value--
}
</script>
<style scoped>
.small-title {

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

@ -1,7 +1,7 @@
<template>
<div class="content">
<div class="type">
<el-radio-group v-model="type">
<el-radio-group v-model="type" @change="changeType">
<el-radio
:label="cur.value"
v-for="cur in getIntDictOptions(DICT_TYPE.QUALITY_NOTIFICATION_TYPE)"
@ -12,112 +12,129 @@
</div>
<el-form
:model="form"
:model="form1"
label-width="120px"
:rules="rules"
ref="formRef"
ref="formRef1"
v-show="type == 1"
:rules="rules1"
>
<!-- Q1客户投诉表单 -->
<el-row :gutter="20" v-if="type == 1">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="客户编码" prop="customerCode">
<el-input v-model="form.customerCode" placeholder="请选择客户"/>
<el-input v-model="form1.customerCode" placeholder="请选择客户"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售订单号" prop="soNumber">
<el-input v-model="form.soNumber" placeholder="请输入销售订单号"/>
<el-input v-model="form1.soNumber" placeholder="请输入销售订单号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售订单行" prop="soLine">
<el-input v-model="form.soLine" placeholder="请输入销售订单号"/>
<el-input v-model="form1.soLine" placeholder="请输入销售订单号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发货单号" prop="asnNumber">
<el-input v-model="form.asnNumber" placeholder="请输入发货单号"/>
<el-input v-model="form1.asnNumber" placeholder="请输入发货单号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发货单行" prop="asnLine">
<el-input v-model="form.asnLine" placeholder="请输入发货单行"/>
<el-input v-model="form1.asnLine" placeholder="请输入发货单行"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户联系人" prop="customerContact">
<el-input v-model="form.customerContact" placeholder="请输入客户联系人"/>
<el-input v-model="form1.customerContact" placeholder="请输入客户联系人"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form
:model="form2"
label-width="120px"
ref="formRef2"
:rules="rules2"
v-show="type == 2"
>
<!-- Q2供应商投诉表单 -->
<el-row :gutter="20" v-if="type == 2">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商编码" prop="supplierCode">
<el-input v-model="form.supplierCode" placeholder="请选择供应商"/>
<el-input v-model="form2.supplierCode" placeholder="请选择供应商"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购订单号" prop="poNumber">
<el-input v-model="form.poNumber" placeholder="请输入采购订单号"/>
<el-input v-model="form2.poNumber" placeholder="请输入采购订单号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购订单行" prop="poLine">
<el-input v-model="form.poLine" placeholder="请输入采购订单行"/>
<el-input v-model="form2.poLine" placeholder="请输入采购订单行"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收货单号" prop="recordNumber">
<el-input v-model="form.recordNumber" placeholder="请输入收货单号"/>
<el-input v-model="form2.recordNumber" placeholder="请输入收货单号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收货单行" prop="recordLine">
<el-input v-model="form.recordLine" placeholder="请输入收货单行"/>
<el-input v-model="form2.recordLine" placeholder="请输入收货单行"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商联系人" prop="customerContact">
<el-input v-model="form.customerContact" placeholder="请输入供应商联系人"/>
<el-input v-model="form2.customerContact" placeholder="请输入供应商联系人"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form
:model="form3"
label-width="120px"
ref="formRef3"
:rules="rules3"
v-show="type == 3"
>
<!-- Q3内部质量参考通知 -->
<el-row :gutter="20" v-if="type == 3">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="部门编码" prop="deptCode">
<el-input v-model="form.deptCode" placeholder="请选择部门"/>
<el-input v-model="form3.deptCode" placeholder="请选择部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产线编码" prop="productionLineCode">
<el-input v-model="form.productionLineCode" placeholder="请输入生产线编码"/>
<el-input v-model="form3.productionLineCode" placeholder="请输入生产线编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作中心编码" prop="workCenterCode">
<el-input v-model="form.workCenterCode" placeholder="请输入工作中心编码"/>
<el-input v-model="form3.workCenterCode" placeholder="请输入工作中心编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编码" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编码"/>
<el-input v-model="form3.deviceCode" placeholder="请输入设备编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产订单号" prop="woNumber">
<el-input v-model="form.woNumber" placeholder="请输入生产订单号"/>
<el-input v-model="form3.woNumber" placeholder="请输入生产订单号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产订单行" prop="woLine">
<el-input v-model="form.woLine" placeholder="请输入收货单行"/>
<el-input v-model="form3.woLine" placeholder="请输入收货单行"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产联系人" prop="woContact">
<el-input v-model="form.woContact" placeholder="请输入生产联系人"/>
<el-input v-model="form3.woContact" placeholder="请输入生产联系人"/>
</el-form-item>
</el-col>
</el-row>
@ -127,11 +144,38 @@
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const type = ref(1)//
//
const form1 = ref({})
const form2 = ref({})
const form3 = ref({})
const form = ref({})
const formRef = ref()
const formRef1 = ref()
const formRef2 = ref()
const formRef3 = ref()
//
const rules = ref({})
const rules1 =ref({
customerCode: [required],
customerContact: [required],
})
const rules2 =ref({
supplierCode: [required],
customerContact: [required],
})
const rules3 =ref({
deptCode: [required],
woContact: [required],
})
const changeType =(e)=>{
if(e == 1){
form.value = form1.value
}else if(e == 2){
form.value = form2.value
}else if(e == 2){
form.value = form3.value
}
}
defineExpose({type,formRef1,formRef2,formRef3,form})
</script>
<style scoped lang="scss">
.content{

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

@ -17,27 +17,305 @@
>
<el-form :model="item" label-width="auto" :rules="qualityBatchRules" ref="qualityBatchFormRef">
<el-row :gutter="20">
<el-col :span="12" v-if="item.code">
<el-form-item label="编码" prop="code">
<el-input v-model="item.code" placeholder="根据系统生成" :disabled="true" />
<el-col :span="12">
<el-form-item label="质量通知单号" prop="qualityNoticeNumber">
<el-input v-model="item.qualityNoticeNumber" placeholder="请输入质量通知单号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号" prop="sequenceCode">
<el-input v-model="item.sequenceCode" placeholder="请输入顺序号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料代码" prop="itemCode">
<el-input v-model="item.itemCode" placeholder="请输入物料代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次" prop="batch">
<el-input v-model="item.batch" placeholder="请输入批次" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验批次" prop="inspectionBatch">
<el-input v-model="item.inspectionBatch" placeholder="请输入检验批次" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料描述" prop="itemDesc">
<el-input v-model="item.itemDesc" placeholder="请输入物料描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总数量" prop="totalAmount">
<el-input v-model="item.totalAmount" placeholder="请输入总数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计量单位" prop="uom">
<el-input v-model="item.uom" placeholder="请输入计量单位" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="title-btn">
<div class="title">质量通知包装</div>
<el-button type="primary" plain @click="handleAdd('package')">添加包装</el-button>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="qualityNoticeNumber" label="质量通知单号" align="center"/>
<el-table-column prop="packageCode" label="包装编码" align="center"/>
<el-table-column prop="sequenceCode" label="顺序号" align="center"/>
<el-table-column prop="amount" label="数量" align="center"/>
<el-table-column prop="uom" label="计量单位" align="center"/>
<el-table-column prop="packUnit" label="包装规格" align="center"/>
</el-table>
<div class="title-btn">
<div class="title">质量通知任务</div>
<el-button type="primary" plain @click="handleAdd('task')">添加任务</el-button>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="qualityNoticeNumber" label="质量通知单号" align="center" width="150"/>
<el-table-column prop="code" label="编码" align="center" width="150"/>
<el-table-column prop="sequenceCode" label="顺序号" align="center" width="150"/>
<el-table-column prop="status" label="状态" align="center" width="150"/>
<el-table-column prop="type" label="类型" align="center" width="150"/>
<el-table-column prop="taskGroupCode" label="任务代码组" align="center" width="150"/>
<el-table-column prop="taskCode" label="任务代码" align="center" width="150"/>
<el-table-column prop="taskDesc" label="任务描述" align="center" width="150"/>
<el-table-column prop="taskDetail" label="任务详情" align="center" width="150"/>
<el-table-column prop="leaderType" label="负责人类型" align="center" width="150"/>
<el-table-column prop="leader" label="负责人" align="center"/>
<el-table-column prop="planStartTime" label="计划开始时间" align="center" width="150"/>
<el-table-column prop="planEndTime" label="计划结束时间" align="center" width="150"/>
<el-table-column prop="finishTime" label="完成时间" align="center" width="150"/>
<el-table-column prop="finishNumber" label="完成单据号" align="center" width="150"/>
</el-table>
<div class="title-btn">
<div class="title">质量通知缺陷</div>
<el-button type="primary" plain @click="handleAdd('defect')">添加缺陷</el-button>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="qualityNoticeNumber" label="质量通知单号" align="center" width="150"/>
<el-table-column prop="sequenceCode" label="顺序号" align="center" width="150"/>
<el-table-column prop="defectLocationCodeGroup" label="缺陷位置代码组" align="center" width="150"/>
<el-table-column prop="defectLocationCode" label="缺陷位置代码" align="center" width="150"/>
<el-table-column prop="defecTypeCodeGroup" label="缺陷类型代码组" align="center" width="150"/>
<el-table-column prop="defectTypeCode" label="缺陷类型代码" align="center" width="150"/>
<el-table-column prop="defectDesc" label="缺陷描述" align="center" width="150"/>
<el-table-column prop="defectSonItemCode" label="缺陷子物料代码" align="center" width="150"/>
<el-table-column prop="defectCount" label="缺陷数量" align="center" width="150"/>
<el-table-column prop="defectLevel" label="缺陷级别" align="center" width="150"/>
<el-table-column prop="sampleNumber" label="样本编号" align="center" width="150"/>
<el-table-column prop="inspectionRecordNumber" label="检验记录编号" align="center" width="150"/>
<el-table-column prop="reasonCodeGroup" label="原因代码组" align="center" width="150"/>
<el-table-column prop="reasonCode" label="原因代码" align="center" width="150"/>
<el-table-column prop="reasonDesc" label="原因描述" align="center" width="150"/>
</el-table>
</el-tab-pane>
</el-tabs>
<Dialog
title="修改名称"
v-model="dialogVisibleName"
width="500px"
:title="dialogTitle"
v-model="dialogVisible"
width="800px"
:close-on-click-modal="false"
>
<div style="padding: 0px 20px">
<el-form ref="nameRef" :model="nameForm">
<el-form-item
:rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"
prop="name"
>
<!-- 包装弹窗 -->
<el-form ref="packageFormRef" label-width="100px" :model="packageForm" :rules="packageRules" v-if="source == 'package'">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="qualityNoticeNumber" label="质量通知单号" >
<el-input v-model="packageForm.qualityNoticeNumber" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="packageCode" label="包装编码" >
<el-input v-model="packageForm.packageCode" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="sequenceCode" label="顺序号" >
<el-input v-model="packageForm.sequenceCode" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="amount" label="数量" >
<el-input v-model="packageForm.amount" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="uom" label="计量单位" >
<el-input v-model="packageForm.uom" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="packUnit" label="包装规格" >
<el-input v-model="packageForm.packUnit" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 任务弹窗 -->
<el-form ref="taskFormRef" label-width="100px" :model="taskForm" :rules="taskRules" v-else-if="source == 'task'">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="qualityNoticeNumber" label="质量通知单号" >
<el-input v-model="taskFormRef.qualityNoticeNumber" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="code" label="编码" >
<el-input v-model="taskFormRef.code" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="sequenceCode" label="顺序号" >
<el-input v-model="taskFormRef.sequenceCode" placeholder="请输入顺序号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="status" label="状态" >
<el-input v-model="taskFormRef.status" placeholder="请输入状态" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="type" label="类型" >
<el-input v-model="taskFormRef.type" placeholder="请输入类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="taskGroupCode" label="任务代码组" >
<el-input v-model="taskFormRef.taskGroupCode" placeholder="请输入任务代码组" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="taskCode" label="任务代码" >
<el-input v-model="taskFormRef.taskCode" placeholder="请输入任务代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="taskDesc" label="任务描述" >
<el-input v-model="taskFormRef.taskDesc" placeholder="请输入任务描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="taskDetail" label="任务详情" >
<el-input v-model="taskFormRef.taskDetail" placeholder="请输入任务详情" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="leaderType" label="负责人类型" >
<el-input v-model="taskFormRef.leaderType" placeholder="请输入负责人类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="leader" label="负责人" >
<el-input v-model="taskFormRef.leader" placeholder="请输入负责人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="planStartTime" label="计划开始时间" >
<el-input v-model="taskFormRef.planStartTime" placeholder="请选择计划开始时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="planEndTime" label="计划结束时间" >
<el-input v-model="taskFormRef.planEndTime" placeholder="请选择计划结束时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="finishTime" label="完成时间" >
<el-input v-model="taskFormRef.finishTime" placeholder="请输入完成时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="finishNumber" label="完成单据号" >
<el-input v-model="taskFormRef.finishNumber" placeholder="请输入完成单据号" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 缺陷弹窗 -->
<el-form ref="defectFormRef" label-width="100px" :model="defectForm" :rules="defectRules" v-else-if="source == 'defect'">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item prop="qualityNoticeNumber" label="质量通知单号" >
<el-input v-model="defectFormRef.qualityNoticeNumber" placeholder="请输入包装编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="sequenceCode" label="顺序号" >
<el-input v-model="defectFormRef.sequenceCode" placeholder="请输入顺序号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defectLocationCodeGroup" label="缺陷位置代码组" >
<el-input v-model="defectFormRef.defectLocationCodeGroup" placeholder="请输入缺陷位置代码组" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defectLocationCode" label="缺陷位置代码" >
<el-input v-model="defectFormRef.defectLocationCode" placeholder="请输入缺陷位置代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defecTypeCodeGroup" label="缺陷类型代码组" >
<el-input v-model="defectFormRef.defecTypeCodeGroup" placeholder="请输入缺陷类型代码组" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defectDesc" label="缺陷描述" >
<el-input v-model="defectFormRef.defectDesc" placeholder="请输入缺陷描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defectSonItemCode" label="缺陷子物料代码" >
<el-input v-model="defectFormRef.defectSonItemCode" placeholder="请输入缺陷子物料代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defectCount" label="缺陷数量" >
<el-input v-model="defectFormRef.defectCount" placeholder="请输入缺陷数量" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="defectLevel" label="缺陷级别" >
<el-input v-model="defectFormRef.defectLevel" placeholder="请输入缺陷级别" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="sampleNumber" label="样本编号" >
<el-input v-model="defectFormRef.sampleNumber" placeholder="请输入样本编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="inspectionRecordNumber" label="检验记录编号" >
<el-input v-model="defectFormRef.inspectionRecordNumber" placeholder="请输入检验记录编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="reasonCodeGroup" label="原因代码组" >
<el-input v-model="defectFormRef.reasonCodeGroup" placeholder="请输入原因代码组" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="reasonCodeGroup" label="原因代码" >
<el-input v-model="defectFormRef.reasonCodeGroup" placeholder="请输入原因代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="reasonDesc" label="原因描述" >
<el-input v-model="defectFormRef.reasonDesc" placeholder="请输入原因描述" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form ref="nameRef" :model="nameForm" v-else>
<el-form-item :rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]" prop="name">
<el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" />
</el-form-item>
</el-form>
@ -46,32 +324,56 @@
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick1" />
</template>
</Dialog>
</div>
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const editableTabsValue = ref('1')
const dialogVisibleName = ref(false)
const dialogVisible = ref(false)//
const dialogTitle = ref('')//
const nameRef = ref(false)
const qualityBatchFormRef = ref()//
const qualityBatchRules = ref({})//
//
const qualityBatchFormRef = ref()
const qualityBatchRules = ref({})
const nameForm = ref({
name: ''
})
})//
const data = ref({
process:[]
})
//
const packageFormRef = ref()
const packageRules = ref({})
const packageForm = ref({
packageCode:''
})
//
const taskFormRef = ref()
const taskRules = ref({})
const taskForm = ref()
//
const defectFormRef = ref()
const defectRules = ref({})
const defectForm = ref()
const source = ref('')//
const tableData = ref([])
/** 弹窗按钮 */
let Butttondata: any = []
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => {
if (action === 'add') {
nameForm.value.name = ''
dialogVisibleName.value = true
dialogVisible.value = true
dialogTitle.value = '添加物料批次名称'
} else if (action === 'remove') {
const tabs = data.value.process
let activeName = editableTabsValue.value
@ -89,6 +391,18 @@ const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' |
data.value.process = tabs.filter((tab) => tab.name !== targetName)
}
}
//
const handleAdd=(sourceArg)=>{
source.value = sourceArg
if(sourceArg == 'package'){
dialogTitle.value = '添加包装'
}else if(sourceArg == 'task'){
dialogTitle.value = '添加任务'
}else if(sourceArg == 'defec'){
dialogTitle.value = '添加缺陷'
}
dialogVisible.value = true
}
/** 修改名称时间 */
let tabIndex = 1
const buttonBaseClick1 = (val) => {
@ -126,7 +440,7 @@ const buttonBaseClick1 = (val) => {
})
editableTabsValue.value = newTabName
dialogVisibleName.value = false
dialogVisible.value = false
} else {
console.log('error submit!')
return false
@ -135,7 +449,7 @@ const buttonBaseClick1 = (val) => {
}
//
else if (val == 'close') {
dialogVisibleName.value = false
dialogVisible.value = false
}
}
</script>
@ -146,4 +460,29 @@ const buttonBaseClick1 = (val) => {
padding: 0px 20px 20px;
}
}
.title-btn{
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
margin-top: 10px;
}
.title{
font-weight: bold;
font-size: 16px;
position: relative;
padding-left: 12px;
line-height: 16px;
&::after{
content:'';
position: absolute;
left: 0px;
width: 4px;
height: 16px;
top: 50%;
transform: translateY(-50%);
background: #409eff;
}
}
</style>

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

@ -8,14 +8,17 @@
>
<!-- 质量通知表单 -->
<el-row :gutter="20">
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="编码" prop="number">
<el-input v-model="form.number" placeholder="请选择编码"/>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item label="类型" prop="type">
<el-input v-model="form.type" placeholder="请选择类型"/>
<!-- <el-input v-model="form.type" placeholder="请选择类型"/> -->
<el-select v-model="form.type" placeholder="请选择类型" disabled>
<el-option v-for="item in getIntDictOptions(DICT_TYPE.QUALITY_NOTIFICATION_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@ -30,7 +33,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="优先级" prop="priority">
<el-input v-model="form.priority" placeholder="请输入优先级"/>
<el-input-number v-model="form.priority" :precision="0" :step="1" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -45,32 +48,32 @@
</el-col>
<el-col :span="12">
<el-form-item label="报告时间" prop="reportTime">
<el-input v-model="form.reportTime" placeholder="请选择报告时间"/>
<el-date-picker v-model="form.reportTime" type="datetime" placeholder="请选择报告时间" style="width: 100%;" value-format="x"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="要求开始时间" prop="requestStartTime">
<el-input v-model="form.requestStartTime" placeholder="请选择要求开始时间"/>
<el-date-picker v-model="form.requestStartTime" type="datetime" placeholder="请选择要求开始时间" style="width: 100%;" value-format="x"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="要求结束时间" prop="requestEndTime">
<el-input v-model="form.requestEndTime" placeholder="请选择要求结束时间"/>
<el-date-picker v-model="form.requestEndTime" type="datetime" placeholder="请选择要求结束时间" style="width: 100%;" value-format="x"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否造成停机" prop="whetherCausesMachineHalt">
<el-input v-model="form.whetherCausesMachineHalt" placeholder="请选择是否造成停机"/>
<el-switch v-model="form.whetherCausesMachineHalt" @change="changeHalt"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停机开始时间" prop="machineHaltStartTime">
<el-input v-model="form.machineHaltStartTime" placeholder="请选择停机开始时间"/>
<el-date-picker v-model="form.machineHaltStartTime" type="datetime" placeholder="请选择停机开始时间" style="width: 100%;" value-format="x"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停机结束时间" prop="machineHaltEndTime">
<el-input v-model="form.machineHaltEndTime" placeholder="请选择停机结束时间"/>
<el-date-picker v-model="form.machineHaltEndTime" type="datetime" placeholder="请选择停机结束时间" style="width: 100%;" value-format="x"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -85,7 +88,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="完成时间" prop="finishTime">
<el-input v-model="form.finishTime" placeholder="请选择完成时间"/>
<el-date-picker v-model="form.finishTime" type="datetime" placeholder="请选择完成时间" style="width: 100%;" value-format="x"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -100,10 +103,63 @@
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
//
const form = ref({})
const form = ref({
description:'',
detail:'',
type:1,
priority:0,
status:'',
reporter:'',
reportTime:'',
requestStartTime:"",
requestEndTime:"",
whetherCausesMachineHalt:false,
machineHaltStartTime:"",
machineHaltEndTime:"",
coordinator:"",
taskTemplateCode:"",
finishTime:"",
referenceNoticeCode:""
})
const formRef = ref()
//
const rules = ref({})
const rules = ref({
priority: [required],
status: [required],
reporter: [required],
reportTime: [required],
requestStartTime: [required],
requestEndTime: [required],
machineHaltStartTime: [{ required: false , message: '该项为必填项', trigger: 'blur' }],
machineHaltEndTime: [{ required: false , message: '该项为必填项', trigger: 'blur' }],
coordinator: [required],
})
const props = defineProps({
//
type: {
type: Number,
default: 0
}
})
//
const changeHalt= (e)=>{
console.log(rules.value.machineHaltStartTime[0])
if(e){
rules.value.machineHaltStartTime[0].required = true
rules.value.machineHaltEndTime[0].required = true
}else{
rules.value.machineHaltStartTime[0].required = false
rules.value.machineHaltEndTime[0].required = false
}
}
watch(
() => props.type,
(val) => {
form.value.type = val
}
)
defineExpose({formRef,form})
</script>
<style scoped lang="scss">
.content{

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

@ -30,7 +30,6 @@
<AddForm
ref="formRef"
basicFormWidth="80"
@submitForm="submitForm"
/>
<!-- 详情 -->

Loading…
Cancel
Save