|
|
@ -1,58 +1,96 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams" |
|
|
|
@reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="SupplierdeliverRequestMain.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|
|
|
:allSchemas="SupplierdeliverRequestMain.allSchemas" /> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|
|
|
<Table |
|
|
|
: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> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm ref="formRef" @success="getList" :rules="SupplierdeliverRequestMainRules" |
|
|
|
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" :tableAllSchemas="SupplierdeliverRequestDetail.allSchemas" |
|
|
|
:tableFormRules="SupplierdeliverRequestDetailRules" :tableData="tableData" |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
@success="getList" |
|
|
|
:rules="SupplierdeliverRequestMainRules" |
|
|
|
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
|
:tableAllSchemas="SupplierdeliverRequestDetail.allSchemas" |
|
|
|
:tableFormRules="SupplierdeliverRequestDetailRules" |
|
|
|
:tableData="tableData" |
|
|
|
:apiUpdate="SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain" |
|
|
|
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" :isBusiness="true" |
|
|
|
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" /> |
|
|
|
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" |
|
|
|
:isBusiness="true" |
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:allSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
|
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" |
|
|
|
:detailAllSchemasRules="SupplierdeliverRequestDetailRules" |
|
|
|
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail" |
|
|
|
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail" |
|
|
|
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage" |
|
|
|
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" :Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" /> |
|
|
|
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" |
|
|
|
:Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import" |
|
|
|
:importTemplateData="importTemplateData" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" |
|
|
|
:mode="2" /> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/wms/supplierdeliver-request-main/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
:updateIsDisable="true" |
|
|
|
:coverIsDisable="true" |
|
|
|
:mode="2" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 打印 --> |
|
|
|
<point ref='pointRef' :detailListTableColumns='detailListTableColumns' /> |
|
|
|
<point ref="pointRef" :detailListTableColumns="detailListTableColumns" /> |
|
|
|
<!-- <el-dialog v-model="dialogVisible" :title="dialogTitle" width="60%"> |
|
|
|
<Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading" :pagination="{ |
|
|
|
total: detatableData.total |
|
|
@ -72,7 +110,12 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { SupplierdeliverRequestMain, SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestMain, |
|
|
|
SupplierdeliverRequestMainRules, |
|
|
|
SupplierdeliverRequestDetail, |
|
|
|
SupplierdeliverRequestDetailRules |
|
|
|
} from './supplierdeliverRequestMain.data' |
|
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
|
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail' |
|
|
@ -143,7 +186,7 @@ |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
@ -156,15 +199,20 @@ |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
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') { |
|
|
|
// 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -185,7 +233,10 @@ |
|
|
|
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 |
|
|
|
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 |
|
|
|
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回按钮 |
|
|
|
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']),hasPermi: 'wms:supplierdeliver-request-main:update' }), // 编辑 |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:update' |
|
|
|
}), // 编辑 |
|
|
|
// defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), // 删除 |
|
|
|
{ |
|
|
|
label: '生成标签', |
|
|
@ -195,7 +246,7 @@ |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3']) }), // 标签打印 |
|
|
|
defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3']) }), // 单据打印 |
|
|
@ -208,34 +259,45 @@ |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
|
}, |
|
|
|
link: true // 文本展现按钮 |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainPurPlanOpe') { // 打开 |
|
|
|
if (val == 'mainPurPlanOpe') { |
|
|
|
// 打开 |
|
|
|
handleOpe(row.id) |
|
|
|
} else if (val == 'mainPurPlanClo') {// 关闭 |
|
|
|
} else if (val == 'mainPurPlanClo') { |
|
|
|
// 关闭 |
|
|
|
handleClo(row.id) |
|
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
|
} else if (val == 'mainPlanSub') { |
|
|
|
// 提交审批 |
|
|
|
handleSub(row.id) |
|
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
|
} else if (val == 'mainPlanApp') { |
|
|
|
// 审批通过 |
|
|
|
handleApp(row.id) |
|
|
|
} else if (val == 'mainPlanTur') { // 驳回按钮 |
|
|
|
} else if (val == 'mainPlanTur') { |
|
|
|
// 驳回按钮 |
|
|
|
handleTur(row.id) |
|
|
|
} else if (val == 'genRecords') { // 处理 |
|
|
|
} else if (val == 'genRecords') { |
|
|
|
// 处理 |
|
|
|
genRecords(row.id) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
} else if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'ssbq') { // 生成标签 |
|
|
|
} else if (val == 'ssbq') { |
|
|
|
// 生成标签 |
|
|
|
handlePoint(row) |
|
|
|
} else if (val == 'point') { // 标签打印 |
|
|
|
} else if (val == 'point') { |
|
|
|
// 标签打印 |
|
|
|
labelPrint(row) |
|
|
|
} else if (val == 'documentPrint') { // 单据打印 |
|
|
|
} else if (val == 'documentPrint') { |
|
|
|
// 单据打印 |
|
|
|
handleDocumentPrint(row.id) |
|
|
|
} |
|
|
|
} |
|
|
@ -351,7 +413,9 @@ |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams) |
|
|
|
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain( |
|
|
|
setSearchParams |
|
|
|
) |
|
|
|
download.excel(data, '供应商发货申请主.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
@ -360,7 +424,14 @@ |
|
|
|
} |
|
|
|
|
|
|
|
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns) |
|
|
|
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间') |
|
|
|
const detailListTableColumns = detailTableColumns.value.filter( |
|
|
|
(item) => |
|
|
|
item.label != '操作' && |
|
|
|
item.label != '创建者' && |
|
|
|
item.label != '创建时间' && |
|
|
|
item.label != '最后更新者' && |
|
|
|
item.label != '最后更新时间' |
|
|
|
) |
|
|
|
const dialogVisible = ref(false) |
|
|
|
const isShow = ref(false) |
|
|
|
const dialogTitle = ref('') |
|
|
@ -387,11 +458,10 @@ |
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/897700407827668992?token=' + getAccessToken()) |
|
|
|
|
|
|
|
const genLabelId = ref(); |
|
|
|
const genLabelId = ref() |
|
|
|
// 生成标签 |
|
|
|
const pointRef = ref() |
|
|
|
const handlePoint = async (row) => { |
|
|
|
|
|
|
|
pointRef.value.openPoint(row.id) |
|
|
|
} |
|
|
|
// 标签打印 |
|
|
@ -489,8 +559,7 @@ |
|
|
|
* tableForm方法 |
|
|
|
*/ |
|
|
|
const tableFormKeys = {} |
|
|
|
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
|
|
|
|
|
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
const tableData = ref([]) |
|
|
@ -507,6 +576,12 @@ |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
let isHave = data.subList.some((item) => item.produceDate > item.expireDate) |
|
|
|
if (isHave) { |
|
|
|
message.error('生产日期不可以大于过期日期') |
|
|
|
formRef.value.formLoading = false |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data) |
|
|
|