|
@ -27,43 +27,47 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #code="{row}"> |
|
|
<template #number="{row}"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<span>{{ row.code }}</span> |
|
|
<span>{{ row.number }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="basicFormRef" |
|
|
ref="formRef" |
|
|
@success="formsSuccess" |
|
|
@success="getList" |
|
|
:rules="StockupMainRecordRules" |
|
|
:rules="StockupMainRecordRules" |
|
|
:formAllSchemas="StockupMainRecord.allSchemas" |
|
|
:formAllSchemas="StockupMainRecord.allSchemas" |
|
|
:apiUpdate="StockupMainRecordApi.updateStockupMainRecord" |
|
|
:tableAllSchemas="StockupDetailRecord.allSchemas" |
|
|
:apiCreate="StockupMainRecordApi.createStockupMainRecord" |
|
|
:tableFormRules="StockupDetailRecordRules" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:isBusiness="true" |
|
|
:isBusiness="false" |
|
|
|
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainRecord.allSchemas" /> |
|
|
<Detail |
|
|
|
|
|
ref="detailRef" |
|
|
|
|
|
:isBasic="false" |
|
|
|
|
|
:allSchemas="StockupMainRecord.allSchemas" |
|
|
|
|
|
:detailAllSchemas="StockupDetailRecord.allSchemas" |
|
|
|
|
|
:detailAllSchemasRules="StockupDetailRecordRules" |
|
|
|
|
|
:apiPage="StockupDetailRecordApi.getStockupDetailRecordPage" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { StockupMainRecord,StockupMainRecordRules } from './stockupMainRecord.data' |
|
|
import { StockupMainRecord,StockupMainRecordRules,StockupDetailRecord,StockupDetailRecordRules } from './stockupMainRecord.data' |
|
|
import * as StockupMainRecordApi from '@/api/wms/stockupMainRecord' |
|
|
import * as StockupMainRecordApi from '@/api/wms/stockupMainRecord' |
|
|
|
|
|
import * as StockupDetailRecordApi from '@/api/wms/stockupDetailRecord' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 备货记录主 |
|
|
defineOptions({ name: 'StockupMainRecord' }) |
|
|
defineOptions({ name: 'StockupMainRecord' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
@ -74,15 +78,6 @@ const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(StockupMainRecord.allSchemas.tableColumns) |
|
|
const tableColumns = ref(StockupMainRecord.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
formRef.setValues(setV) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
@ -97,8 +92,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainRecord:create'}), // 新增 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:deliver-record-main:export'}), // 导出 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainRecord:export'}), // 导出 |
|
|
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
@ -114,12 +108,16 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'export') { // 导出 |
|
|
openForm('create') |
|
|
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
getList() |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
|
|
|
searchFormClick({ |
|
|
|
|
|
filters: tableObject.params.filters |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else { // 其他按钮 |
|
|
} else { // 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
@ -127,67 +125,18 @@ const buttonBaseClick = (val, item) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = (row) => { |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:stockupMainRecord:update'}), // 编辑 |
|
|
return [] |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainRecord:delete'}), // 删除 |
|
|
} |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
|
|
|
openForm('update', row) |
|
|
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
|
|
handleDelete(row.id) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
|
|
const basicFormRef = ref() |
|
|
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
|
|
const formsSuccess = async (formType,data) => { |
|
|
|
|
|
var isHave =StockupMainRecord.allSchemas.formSchema.some(function (item) { |
|
|
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
|
|
}); |
|
|
|
|
|
if(isHave){ |
|
|
|
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
|
|
|
message.error('失效时间要大于生效时间') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
|
|
if (formType === 'create') { |
|
|
|
|
|
await StockupMainRecordApi.createStockupMainRecord(data) |
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
} else { |
|
|
|
|
|
await StockupMainRecordApi.updateStockupMainRecord(data) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicStockupMainRecord') |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'recordDeliverMain') |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
// 删除的二次确认 |
|
|
|
|
|
await message.delConfirm() |
|
|
|
|
|
// 发起删除 |
|
|
|
|
|
await StockupMainRecordApi.deleteStockupMainRecord(id) |
|
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
@ -206,7 +155,6 @@ const handleExport = async () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 筛选提交 |
|
|
// 筛选提交 |
|
|
const searchFormClick = (searchData) => { |
|
|
const searchFormClick = (searchData) => { |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
@ -220,5 +168,4 @@ const searchFormClick = (searchData) => { |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|