|
|
@ -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'; |
|
|
|
}); |
|
|
|