|
|
@ -2,27 +2,47 @@ |
|
|
|
<div> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="InspectionMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="InspectionMain.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
|
:allSchemas="InspectionMain.allSchemas" /> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="InspectionMain.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|
|
|
<Table |
|
|
|
v-clientTable |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
|
:pagination="{ |
|
|
|
total: tableObject.total |
|
|
|
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort"> |
|
|
|
}" |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
|
<template #number="{ row }"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata(row)" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -48,20 +68,34 @@ |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="InspectionMain.allSchemas" /> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" /> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/request/inspection-main/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
/> |
|
|
|
<!-- 包装信息 --> |
|
|
|
<ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionMain.allSchemas" |
|
|
|
:detailAllSchemas="InspectionRequestPackage.allSchemas" :detailAllSchemasRules="InspectionRequestPackageRules" |
|
|
|
:list="list" @ListTableSubmit='ListTableSubmit'/> |
|
|
|
<ListTable |
|
|
|
ref="listTableRef" |
|
|
|
titleName="包装信息" |
|
|
|
:allSchemas="InspectionMain.allSchemas" |
|
|
|
:detailAllSchemas="InspectionRequestPackage.allSchemas" |
|
|
|
:detailAllSchemasRules="InspectionRequestPackageRules" |
|
|
|
:list="list" |
|
|
|
@ListTableSubmit="ListTableSubmit" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { InspectionMain, InspectionMainRules,InspectionRequestPackage,InspectionRequestPackageRules } from './inspectionRequestMain.data' |
|
|
|
import { |
|
|
|
InspectionMain, |
|
|
|
InspectionMainRules, |
|
|
|
InspectionRequestPackage, |
|
|
|
InspectionRequestPackageRules |
|
|
|
} from './inspectionRequestMain.data' |
|
|
|
import * as InspectionMainApi from '@/api/qms/inspectionRequest' |
|
|
|
import * as InspectionRequestPackageApi from '@/api/qms/inspectionRequest/InspectionRequestPackage' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
@ -117,7 +151,7 @@ |
|
|
|
// defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
@ -130,18 +164,24 @@ |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
openForm('create') |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
} else if (val == 'import') { |
|
|
|
// 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
} else if (val == 'export') { |
|
|
|
// 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
tableObject.params.isSearch = false |
|
|
|
tableObject.params.filters = '' |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
@ -157,38 +197,68 @@ |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), hasPermi: 'qms:inspection-request-main:close' }), // 关闭 |
|
|
|
defaultButtons.mainListCloseBtn({ |
|
|
|
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), |
|
|
|
hasPermi: 'qms:inspection-request-main:close' |
|
|
|
}), // 关闭 |
|
|
|
// defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['5']), hasPermi: 'qms:inspection-request-main:reAdd' }), //重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'qms:inspection-request-main:submit' }), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:refused' }), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']), hasPermi: 'qms:inspection-request-main:agree' }), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']), hasPermi: 'qms:inspection-request-main:handle' }), // 处理 |
|
|
|
defaultButtons.mainListSubmitBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'qms:inspection-request-main:submit' |
|
|
|
}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({ |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
hasPermi: 'qms:inspection-request-main:refused' |
|
|
|
}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({ |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
hasPermi: 'qms:inspection-request-main:agree' |
|
|
|
}), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({ |
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
hasPermi: 'qms:inspection-request-main:handle' |
|
|
|
}), // 处理 |
|
|
|
defaultButtons.mainListPackageBtn(null), // 包装 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-request-main:edit'}), // 编辑 |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'qms:inspection-request-main:edit' |
|
|
|
}) // 编辑 |
|
|
|
] |
|
|
|
} |
|
|
|
const listTableRef = ref() |
|
|
|
const list = ref([]) |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
if (val == 'mainClose') { |
|
|
|
// 关闭 |
|
|
|
handleClose(row.id) |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
} else if (val == 'mainReAdd') { |
|
|
|
// 重新添加 |
|
|
|
handleReAdd(row.id) |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
} else if (val == 'mainSubmit') { |
|
|
|
// 提交审批 |
|
|
|
handleSubmit(row.id) |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
} else if (val == 'mainTurnDown') { |
|
|
|
// 驳回 |
|
|
|
handleRefused(row.id) |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
} else if (val == 'mainApprove') { |
|
|
|
// 审批通过 |
|
|
|
handleAgree(row.id) |
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
} else if (val == 'mainHandle') { |
|
|
|
// 处理 |
|
|
|
handleHandle(row.id) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
} else if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
}else if (val == 'mainPackage') { // 包装 |
|
|
|
} else if (val == 'mainPackage') { |
|
|
|
// 包装 |
|
|
|
list.value = await InspectionRequestPackageApi.getInspectionRequestPackageList(row.id) |
|
|
|
// row.status = '1' |
|
|
|
listTableRef.value.openPackage(row,'包装信息',InspectionRequestPackage.allSchemas.tableColumns) |
|
|
|
listTableRef.value.openPackage( |
|
|
|
row, |
|
|
|
'包装信息', |
|
|
|
InspectionRequestPackage.allSchemas.tableColumns |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -200,10 +270,10 @@ const list = ref([]) |
|
|
|
await InspectionMainApi.closeInspectRequestMain(id) |
|
|
|
message.success(t('common.closeSuccess')) |
|
|
|
await getList() |
|
|
|
}catch{}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 重新添加按钮操作 */ |
|
|
@ -214,7 +284,8 @@ const list = ref([]) |
|
|
|
await InspectionMainApi.reAddInspectRequestMain(id) |
|
|
|
message.success(t('common.reAddSuccess')) |
|
|
|
await getList() |
|
|
|
}catch{}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -227,7 +298,8 @@ const list = ref([]) |
|
|
|
await InspectionMainApi.agreeInspectRequestMain(id) |
|
|
|
message.success(t('common.agreeSuccess')) |
|
|
|
await getList() |
|
|
|
}catch{}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -240,7 +312,8 @@ const list = ref([]) |
|
|
|
await InspectionMainApi.refusedInspectRequestMain(id) |
|
|
|
message.success(t('common.refusedSuccess')) |
|
|
|
await getList() |
|
|
|
}catch{}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -253,7 +326,8 @@ const list = ref([]) |
|
|
|
await InspectionMainApi.handleInspectRequestMain(id) |
|
|
|
message.success(t('common.dealwithSuccess')) |
|
|
|
await getList() |
|
|
|
}catch{}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -266,7 +340,8 @@ const list = ref([]) |
|
|
|
await InspectionMainApi.submitInspectRequestMain(id) |
|
|
|
message.success(t('common.submitSuccess')) |
|
|
|
await getList() |
|
|
|
}catch{}finally{ |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
@ -281,18 +356,23 @@ const list = ref([]) |
|
|
|
// form表单提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
var isHave = InspectionMain.allSchemas.formSchema.some(function (item) { |
|
|
|
return item.field === 'requestStartTime' || item.field === 'requestEndTime'; |
|
|
|
}); |
|
|
|
return item.field === 'requestStartTime' || item.field === 'requestEndTime' |
|
|
|
}) |
|
|
|
if (isHave) { |
|
|
|
if (data.requestStartTime && data.requestEndTime && data.requestStartTime >= data.requestEndTime) { |
|
|
|
if ( |
|
|
|
data.requestStartTime && |
|
|
|
data.requestEndTime && |
|
|
|
data.requestStartTime >= data.requestEndTime |
|
|
|
) { |
|
|
|
message.error('要求结束时间要大于要求开始时间') |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (data.requestStartTime == 0) data.requestStartTime = null; |
|
|
|
if (data.requestEndTime == 0) data.requestEndTime = null; |
|
|
|
if (data.requestStartTime == 0) data.requestStartTime = null |
|
|
|
if (data.requestEndTime == 0) data.requestEndTime = null |
|
|
|
data.inspectionRequestPackageCreateReqVO = tableData.value // 拼接子表数据参数 |
|
|
|
try { |
|
|
|
formRef.value.formLoading = true |
|
|
|
if (formType === 'create') { |
|
|
|
await InspectionMainApi.createInspectionMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -301,6 +381,7 @@ const list = ref([]) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
formRef.value.formLoading = false |
|
|
|
getList() |
|
|
|
} finally { |
|
|
|
formRef.value.formLoading = false |
|
|
@ -369,7 +450,7 @@ const list = ref([]) |
|
|
|
* tableForm方法 |
|
|
|
*/ |
|
|
|
const tableFormKeys = {} |
|
|
|
InspectionRequestPackage.allSchemas.tableFormColumns.forEach(item => { |
|
|
|
InspectionRequestPackage.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
const tableData = ref([]) |
|
|
@ -398,9 +479,9 @@ console.log(formType,data) |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
tableObject.params = { |
|
|
|
available: true |
|
|
|
} |
|
|
|
tableObject.params = { |
|
|
|
available: true |
|
|
|
} |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await InspectionMainApi.importTemplate() |
|
|
|
}) |
|
|
|