|
@ -1,27 +1,47 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="InspectionRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="InspectionRecordMain.allSchemas.searchSchema" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
<TableHead |
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
:HeadButttondata="HeadButttondata" |
|
|
:allSchemas="InspectionRecordMain.allSchemas" /> |
|
|
@button-base-click="buttonBaseClick" |
|
|
|
|
|
:routeName="routeName" |
|
|
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
|
|
:allSchemas="InspectionRecordMain.allSchemas" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<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 |
|
|
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 }"> |
|
|
<template #number="{ row }"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<span>{{ row.number }}</span> |
|
|
<span>{{ row.number }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase |
|
|
|
|
|
:Butttondata="butttondata(row)" |
|
|
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -46,27 +66,45 @@ |
|
|
:tableFormRules="InspectionJobPackageRules" |
|
|
:tableFormRules="InspectionJobPackageRules" |
|
|
:rules="InspectionTemplateRules" |
|
|
:rules="InspectionTemplateRules" |
|
|
@submitForm="submitFormExecute" |
|
|
@submitForm="submitFormExecute" |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<Detail |
|
|
<Detail |
|
|
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" |
|
|
ref="detailRef" |
|
|
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules" |
|
|
:isBasic="false" |
|
|
|
|
|
:allSchemas="InspectionRecordMain.allSchemas" |
|
|
|
|
|
:detailAllSchemas="InspectionRecordDetail.allSchemas" |
|
|
|
|
|
:detailAllSchemasRules="InspectionRecordDetailRules" |
|
|
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail" |
|
|
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail" |
|
|
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail" |
|
|
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail" |
|
|
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage" |
|
|
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage" |
|
|
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" @searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" |
|
|
:isShowAddBtn="false" :detailButtonIsShow="true" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
:isShowAddBtn="false" |
|
|
|
|
|
:detailButtonIsShow="true" |
|
|
/> |
|
|
/> |
|
|
<!-- 包装信息 --> |
|
|
<!-- 包装信息 --> |
|
|
<ListTable ref="listTableRef" titleName="包装信息" :allSchemas="InspectionRecordMain.allSchemas" |
|
|
<ListTable |
|
|
:detailAllSchemas="InspectionRecordPackage.allSchemas" :detailAllSchemasRules="InspectionRecordPackageRules" |
|
|
ref="listTableRef" |
|
|
:list="list"/> |
|
|
titleName="包装信息" |
|
|
|
|
|
:allSchemas="InspectionRecordMain.allSchemas" |
|
|
|
|
|
:detailAllSchemas="InspectionRecordPackage.allSchemas" |
|
|
|
|
|
:detailAllSchemasRules="InspectionRecordPackageRules" |
|
|
|
|
|
:list="list" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules,InspectionRecordPackage, InspectionRecordPackageRules,InspectionRecordUser,InspectionRecordUserRules} from './inspectionRecordMain.data' |
|
|
import { |
|
|
|
|
|
InspectionRecordMain, |
|
|
|
|
|
InspectionRecordMainRules, |
|
|
|
|
|
InspectionRecordDetail, |
|
|
|
|
|
InspectionRecordDetailRules, |
|
|
|
|
|
InspectionRecordPackage, |
|
|
|
|
|
InspectionRecordPackageRules, |
|
|
|
|
|
InspectionRecordUser, |
|
|
|
|
|
InspectionRecordUserRules |
|
|
|
|
|
} from './inspectionRecordMain.data' |
|
|
// import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data' |
|
|
// import { InspectionJobPackage,InspectionJobPackageRules} from '../inspectionJob/inspectionJobMain.data' |
|
|
import * as InspectionRecordPackageApi from '@/api/qms/inspectionRecord/InspectionRecordPackage/InspectionRecordPackage' |
|
|
import * as InspectionRecordPackageApi from '@/api/qms/inspectionRecord/InspectionRecordPackage/InspectionRecordPackage' |
|
|
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' |
|
|
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' |
|
@ -100,14 +138,14 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns) |
|
|
const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns) |
|
|
if (routeName.value == 'InspectRecordMain') { |
|
|
if (routeName.value == 'InspectRecordMain') { |
|
|
tableColumns.value = tableColumns.value.filter(item=>{ |
|
|
tableColumns.value = tableColumns.value.filter((item) => { |
|
|
return item.label != '操作' |
|
|
return item.label != '操作' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
if (routeName.value == 'InspectRecordMain') { |
|
|
if (routeName.value == 'InspectRecordMain') { |
|
|
tableColumns.value = val.filter(item=>{ |
|
|
tableColumns.value = val.filter((item) => { |
|
|
return item.label != '操作' |
|
|
return item.label != '操作' |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
@ -115,8 +153,6 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 子表新增的时候选择表格之后需要会显得字段 |
|
|
// 子表新增的时候选择表格之后需要会显得字段 |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage // 分页接口 |
|
|
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage // 分页接口 |
|
@ -130,29 +166,35 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
// defaultButtons.defaultExportBtn(null), // 导出 |
|
|
// defaultButtons.defaultExportBtn(null), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
|
|
|
// 刷新 |
|
|
getList() |
|
|
getList() |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const isShowMainButton = (row, val) => { |
|
|
const isShowMainButton = (row, val) => { |
|
|
if(!row.callbackRequestNumber) {//callbackRequestNumber为空是手工创建订单,不需要使用决策和发布 |
|
|
if (!row.callbackRequestNumber) { |
|
|
return true; |
|
|
//callbackRequestNumber为空是手工创建订单,不需要使用决策和发布 |
|
|
|
|
|
return true |
|
|
} |
|
|
} |
|
|
if (row.useDecision) { |
|
|
if (row.useDecision) { |
|
|
return row.isPublished |
|
|
return row.isPublished |
|
@ -178,15 +220,21 @@ const buttonBaseClick = (val, item) => { |
|
|
const butttondata = (row) => { |
|
|
const butttondata = (row) => { |
|
|
return [ |
|
|
return [ |
|
|
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // 完成 |
|
|
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // 完成 |
|
|
defaultButtons.mainApplyDecisionBtn({ hide: isShowMainButton(row, null), hasPermi:'qms:inspection-recode-main:edit'}), // 使用决策 |
|
|
defaultButtons.mainApplyDecisionBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, null), |
|
|
|
|
|
hasPermi: 'qms:inspection-recode-main:edit' |
|
|
|
|
|
}), // 使用决策 |
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, 'publish'), hasPermi:'qms:inspection-recode-main:pub'}), // 发布 |
|
|
defaultButtons.mainListOrderPubBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, 'publish'), |
|
|
|
|
|
hasPermi: 'qms:inspection-recode-main:pub' |
|
|
|
|
|
}), // 发布 |
|
|
defaultButtons.mainListPackageBtn({ hide: isShowPackageBtn(row, ['11']) }), // 包装 |
|
|
defaultButtons.mainListPackageBtn({ hide: isShowPackageBtn(row, ['11']) }), // 包装 |
|
|
// defaultButtons.mainListJobExeBtn({ |
|
|
// defaultButtons.mainListJobExeBtn({ |
|
|
// hide:row.useDecision, |
|
|
// hide:row.useDecision, |
|
|
// hasPermi: 'qms:inspection-recode-main:execute', |
|
|
// hasPermi: 'qms:inspection-recode-main:execute', |
|
|
// }), // 执行 |
|
|
// }), // 执行 |
|
|
defaultButtons.mainListEditBtn({ hide:isShowEditBtn(row,['11'])}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({ hide: isShowEditBtn(row, ['11']) }) // 编辑 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -196,25 +244,27 @@ const buttonBaseClick = (val, item) => { |
|
|
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision") |
|
|
// const useDecisionList = InspectionRecordMain.allSchemas.formSchema.filter(item=>item.field == "useDecision") |
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'applyDecision') { // 编辑 |
|
|
if (val == 'applyDecision') { |
|
|
|
|
|
// 编辑 |
|
|
// 评估代码值是1,接收时候,使用决策下拉列表是全部合格 |
|
|
// 评估代码值是1,接收时候,使用决策下拉列表是全部合格 |
|
|
if (row.estimateCode == 1) { |
|
|
if (row.estimateCode == 1) { |
|
|
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) => { |
|
|
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) => { |
|
|
if(itemColumn.field == "useDecision"){ |
|
|
if (itemColumn.field == 'useDecision') { |
|
|
itemColumn.componentProps.options=useDecisionList?.filter(item=>item.value==1) |
|
|
itemColumn.componentProps.options = useDecisionList?.filter((item) => item.value == 1) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else if (row.estimateCode == 2) { |
|
|
} else if (row.estimateCode == 2) { |
|
|
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) => { |
|
|
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) => { |
|
|
if(itemColumn.field == "useDecision"){ |
|
|
if (itemColumn.field == 'useDecision') { |
|
|
itemColumn.componentProps.options=useDecisionList?.filter(item=>item.value!=1) |
|
|
itemColumn.componentProps.options = useDecisionList?.filter((item) => item.value != 1) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
openUseForm('update', row) |
|
|
openUseForm('update', row) |
|
|
}else if (val == 'mainPackage') { // 包装 |
|
|
} else if (val == 'mainPackage') { |
|
|
|
|
|
// 包装 |
|
|
list.value = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id) |
|
|
list.value = await InspectionRecordPackageApi.getInspectionRecordPackageList(row.id) |
|
|
list.value.forEach(item=>{ |
|
|
list.value.forEach((item) => { |
|
|
item.qualifiedAmount = item.qualifiedAmount ? item.qualifiedAmount : 0 |
|
|
item.qualifiedAmount = item.qualifiedAmount ? item.qualifiedAmount : 0 |
|
|
item.noQualifiedAmount = item.noQualifiedAmount ? item.noQualifiedAmount : 0 |
|
|
item.noQualifiedAmount = item.noQualifiedAmount ? item.noQualifiedAmount : 0 |
|
|
item.destroyAmount = item.destroyAmount ? item.destroyAmount : 0 |
|
|
item.destroyAmount = item.destroyAmount ? item.destroyAmount : 0 |
|
@ -222,11 +272,14 @@ const buttonBaseClick = (val, item) => { |
|
|
}) |
|
|
}) |
|
|
// row.status = '1' |
|
|
// row.status = '1' |
|
|
listTableRef.value.openPackage(row, '包装信息', InspectionRecordPackage.allSchemas.tableColumns) |
|
|
listTableRef.value.openPackage(row, '包装信息', InspectionRecordPackage.allSchemas.tableColumns) |
|
|
}else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
}else if (val == 'mainOrderPub') { //发布 |
|
|
} else if (val == 'mainOrderPub') { |
|
|
|
|
|
//发布 |
|
|
handleOrderPub(row) |
|
|
handleOrderPub(row) |
|
|
}else if (val == 'edit') { //修改 |
|
|
} else if (val == 'edit') { |
|
|
|
|
|
//修改 |
|
|
// 执行 |
|
|
// 执行 |
|
|
execute('execute', row) |
|
|
execute('execute', row) |
|
|
} |
|
|
} |
|
@ -275,7 +328,6 @@ const buttonBaseClick = (val, item) => { |
|
|
} catch {} |
|
|
} catch {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//执行 |
|
|
//执行 |
|
|
|
|
|
|
|
|
const execute = async (type: string, row?: number) => { |
|
|
const execute = async (type: string, row?: number) => { |
|
@ -301,7 +353,7 @@ const execute = async (type: string, row?: number) => { |
|
|
* tableForm方法 |
|
|
* tableForm方法 |
|
|
*/ |
|
|
*/ |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
InspectionRecordDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
InspectionRecordDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
@ -349,6 +401,14 @@ const submitFormExecute = async (formType, data) => { |
|
|
|
|
|
|
|
|
// 筛选提交 |
|
|
// 筛选提交 |
|
|
const searchFormClick = (searchData) => { |
|
|
const searchFormClick = (searchData) => { |
|
|
|
|
|
let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') |
|
|
|
|
|
if (!isHave) { |
|
|
|
|
|
searchData.filters.push({ |
|
|
|
|
|
action: '!=', |
|
|
|
|
|
column: 'inspectionType', |
|
|
|
|
|
value: '11' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
filters: searchData.filters |
|
|
filters: searchData.filters |
|
@ -359,7 +419,8 @@ const submitFormExecute = async (formType, data) => { |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
available: true |
|
|
available: true, |
|
|
|
|
|
excludeInspectionType: '11' |
|
|
} |
|
|
} |
|
|
getList() |
|
|
getList() |
|
|
}) |
|
|
}) |
|
|