Browse Source

QMS 新增Q1 Q2 Q3通知单功能

hella_online_20240829
parent
commit
a411613e27
  1. 5
      src/api/qms/inspectionQ1/index.ts
  2. 5
      src/api/qms/inspectionQ2/index.ts
  3. 5
      src/api/qms/inspectionQ3/index.ts
  4. 7
      src/utils/dict.ts
  5. 44
      src/views/qms/inspectionQ1/index.vue
  6. 24
      src/views/qms/inspectionQ1/inspectionQ1.data.ts
  7. 44
      src/views/qms/inspectionQ2/index.vue
  8. 16
      src/views/qms/inspectionQ2/inspectionQ2.data.ts
  9. 46
      src/views/qms/inspectionQ3/index.vue
  10. 93
      src/views/qms/inspectionQ3/inspectionQ3.data.ts

5
src/api/qms/inspectionQ1/index.ts

@ -65,3 +65,8 @@ export const exportQ1 = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/inspectionQ1/get-import-template' })
}
// 完成
export const finishQ1 = async (id: number) => {
return await request.get({ url: `/qms/inspectionQ1/finish?id=` + id })
}

5
src/api/qms/inspectionQ2/index.ts

@ -66,3 +66,8 @@ export const exportQ2 = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/inspectionQ2/get-import-template' })
}
// 完成
export const finishQ2 = async (id: number) => {
return await request.get({ url: `/qms/inspectionQ2/finish?id=` + id })
}

5
src/api/qms/inspectionQ3/index.ts

@ -66,3 +66,8 @@ export const exportQ3 = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/qms/inspectionQ3/get-import-template' })
}
// 完成
export const finishQ3 = async (id: number) => {
return await request.get({ url: `/qms/inspectionQ3/finish?id=` + id })
}

7
src/utils/dict.ts

@ -318,6 +318,13 @@ export enum DICT_TYPE {
QUALITY_NOTIFICATION_TYPE = 'quality_notification_type', // 质量通知类型
QUALITY_NOTICE_STATUS = 'quality_notice_status', // 质量通知状态
QUALITY_TASK_STATUS = 'quality_task_status', // 质量通知任务状态
QUALITY_NOTIFICATION_PRIORITY = 'quality_notification_priority', // 质量通知优先级
CLAIM_REASON = 'claim_Reason', // 质量通知索赔原因
QMS_CODE = 'qms_code', // 质量通知代码
DEFECT_LOCATION = 'defect_location', // 质量通知缺陷位置
DEFECT_TYPE = 'defect_type', // 质量通知缺陷类型
PROBLEM_REASON = 'problem_reason', // 质量通知问题原因
// ========== 业务 - mes -gaojs ==========
QUALIFY_STATUS = 'qualify_status', //质检状态

44
src/views/qms/inspectionQ1/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -66,6 +66,9 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
defineOptions({ name: 'InspectionQ1' })
const message = useMessage() //
@ -105,9 +108,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'wms:q1:import'}), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultAddBtn({hasPermi:'qms:Q1:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q1:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q1:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -137,11 +140,22 @@ const buttonBaseClick = (val, item) => {
}
}
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:q1:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:q1:delete'}), //
]
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:delete'}), //
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q1:finish'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
@ -149,9 +163,20 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}else if (val == 'finish') { //
handleFinish(row.id)
}
}
const handleFinish = async (id: number) => {
try {
await Q1Api.finishQ1(id)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
@ -159,7 +184,8 @@ const openForm = (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id
var isHave =Q1.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});

24
src/views/qms/inspectionQ1/inspectionQ1.data.ts

@ -10,6 +10,9 @@ import { Customeritem } from '@/views/wms/basicDataManage/customerManage/custome
import * as QadCostcentreApi from '@/api/wms/qadCostcentre'
import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
// 表单校验
export const Q1Rules = reactive({
customerCode: [required],
@ -32,10 +35,10 @@ export const Q1 = useCrudSchemas(
sort: 'custom',
isForm: false,
isSearch: true,
table: {
table: {
width: 150,
fixed: 'left'
},
}
},
{
label: '状态',
@ -164,7 +167,7 @@ export const Q1 = useCrudSchemas(
label: '编码',
field: 'code',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.QMS_CODE,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -176,7 +179,7 @@ export const Q1 = useCrudSchemas(
label: '优先级',
field: 'priority',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -188,7 +191,14 @@ export const Q1 = useCrudSchemas(
label: '负责用户',
field: 'responUser',
sort: 'custom',
isSearch: false
isSearch: false,
isForm: true,
form: {
componentProps: {
value: userStore.getUser.nickname,
disabled: true
}
}
},
{
label: '索赔金额',
@ -232,7 +242,7 @@ export const Q1 = useCrudSchemas(
label: '索赔原因',
field: 'claimReason',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.CLAIM_REASON,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -281,7 +291,7 @@ export const Q1 = useCrudSchemas(
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
valueFormat: 'x',
}
}
},

44
src/views/qms/inspectionQ2/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -66,6 +66,9 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
defineOptions({ name: 'InspectionQ2' })
const message = useMessage() //
@ -113,9 +116,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'wms:q2:import'}), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultAddBtn({hasPermi:'qms:Q2:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q2:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q2:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -145,11 +148,22 @@ const buttonBaseClick = (val, item) => {
}
}
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:q2:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:q2:delete'}), //
]
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:delete'}), //
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:finish'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
@ -157,9 +171,20 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}else if (val == 'finish') { //
handleFinish(row.id)
}
}
const handleFinish = async (id: number) => {
try {
await Q2Api.finishQ2(id)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
@ -167,7 +192,8 @@ const openForm = (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id
var isHave =Q2.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});

16
src/views/qms/inspectionQ2/inspectionQ2.data.ts

@ -16,6 +16,9 @@ import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/su
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import { PurchasereceiptRecordMain1 } from '@/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
// 表单校验
export const Q2Rules = reactive({
number: [required],
@ -232,7 +235,7 @@ export const Q2 = useCrudSchemas(
label: '编码',
field: 'code',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.QMS_CODE,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -245,7 +248,7 @@ export const Q2 = useCrudSchemas(
label: '优先级',
field: 'priority',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -257,7 +260,14 @@ export const Q2 = useCrudSchemas(
label: '负责用户',
field: 'responUser',
sort: 'custom',
isSearch: false
isSearch: false,
isForm: true,
form: {
componentProps: {
value: userStore.getUser.nickname,
disabled: true
}
}
},
{
label: '索赔金额',

46
src/views/qms/inspectionQ3/index.vue

@ -33,7 +33,7 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
@ -66,6 +66,9 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
defineOptions({ name: 'InspectionQ3' })
const message = useMessage() //
@ -82,7 +85,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
const setV = {}
if(formField == 'itemCode'){
console.log(val);
setV['uom'] = val[0]['customerUom']
setV['uom'] = val[0]['uom']
}
if (formField == 'q1Number') {
console.log(123)
@ -107,9 +110,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'wms:q3:import'}), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultAddBtn({hasPermi:'qms:Q3:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:Q3:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'qms:Q3:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -139,11 +142,22 @@ const buttonBaseClick = (val, item) => {
}
}
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:q3:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:q3:delete'}), //
]
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:delete'}), //
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q3:finish'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
@ -151,9 +165,20 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}else if (val == 'finish') { //
handleFinish(row.id)
}
}
const handleFinish = async (id: number) => {
try {
await Q3Api.finishQ3(id)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
@ -161,7 +186,8 @@ const openForm = (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
const formsSuccess = async (formType, data) => {
data.responUser = userStore.getUser.id
var isHave =Q3.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});

93
src/views/qms/inspectionQ3/inspectionQ3.data.ts

@ -7,8 +7,11 @@ import { Q1 } from '@/views/qms/inspectionQ1/inspectionQ1.data'
import * as QadCostcentreApi from '@/api/wms/qadCostcentre'
import { QadCostcentre } from '@/views/wms/basicDataManage/subject/qadCostcentre/qadCostcentre.data'
import * as CustomeritemApi from '@/api/wms/customeritem'
import { Customeritem } from '@/views/wms/basicDataManage/customerManage/customeritem/customeritem.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
// 表单校验
export const Q3Rules = reactive({
@ -93,40 +96,37 @@ export const Q3 = useCrudSchemas(
table: {
width: 150
},
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '客户物料信息', // 查询弹窗标题
searchAllSchemas: Customeritem.allSchemas, // 查询弹窗所需类
searchPage: CustomeritemApi.getCustomeritemPage, // 查询弹窗所需分页方法
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode',
message: '请填写客户代码!',
isMainValue: true
}
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
]
}
}
},
@ -165,7 +165,7 @@ export const Q3 = useCrudSchemas(
label: '编码',
field: 'code',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.QMS_CODE,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -173,36 +173,47 @@ export const Q3 = useCrudSchemas(
type: 'Select'
}
},
{
label: '缺陷位置',
field: 'defectLocation',
sort: 'custom',
dictType: DICT_TYPE.DEFECT_LOCATION,
dictClass: 'string',
isSearch: false,
isTable: false
isTable: true,
tableForm: {
type: 'Select'
}
},
{
label: '缺陷类型',
field: 'defectType',
sort: 'custom',
dictType: DICT_TYPE.DEFECT_TYPE,
dictClass: 'string',
isSearch: false,
isTable: false,
form: {
component: 'SelectV2'
isTable: true,
tableForm: {
type: 'Select'
}
},
{
label: '问题原因',
field: 'problemReason',
sort: 'custom',
dictType: DICT_TYPE.PROBLEM_REASON,
dictClass: 'string',
isSearch: false,
isTable: false
isTable: true,
tableForm: {
type: 'Select'
}
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictType: DICT_TYPE.QUALITY_NOTIFICATION_PRIORITY,
dictClass: 'string',
isSearch: false,
isTable: true,
@ -214,7 +225,14 @@ export const Q3 = useCrudSchemas(
label: '负责用户',
field: 'responUser',
sort: 'custom',
isSearch: false
isSearch: false,
isForm: true,
form: {
componentProps: {
value: userStore.getUser.nickname,
disabled: true
}
}
},
{
label: '金额',
@ -235,12 +253,12 @@ export const Q3 = useCrudSchemas(
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isForm: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchListPlaceholder: '请选择成本中心', // 输入框占位文本
searchField: 'costcentreCode', // 查询弹窗赋值字段
searchTitle: '成本中心信息', // 查询弹窗标题
searchAllSchemas: QadCostcentre.allSchemas, // 查询弹窗所需类
@ -297,7 +315,8 @@ export const Q3 = useCrudSchemas(
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: false
isSearch: false,
isForm: false
},
{
label: '创建时间',

Loading…
Cancel
Save