|
@ -41,10 +41,9 @@ |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="basicFormRef" |
|
|
ref="basicFormRef" |
|
|
@success="getList" |
|
|
@success="formsSuccess" |
|
|
:rules="FactoryAreaRules" |
|
|
:rules="FactoryAreaRules" |
|
|
:formAllSchemas="FactoryArea.allSchemas" |
|
|
:formAllSchemas="FactoryArea.allSchemas" |
|
|
:searchTableParams="searchTableParams" |
|
|
|
|
|
:apiUpdate="FactoryAreaApi.updateFactoryArea" |
|
|
:apiUpdate="FactoryAreaApi.updateFactoryArea" |
|
|
:apiCreate="FactoryAreaApi.createFactoryArea" |
|
|
:apiCreate="FactoryAreaApi.createFactoryArea" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
@ -77,21 +76,20 @@ const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(FactoryArea.allSchemas.tableColumns) |
|
|
const tableColumns = ref(FactoryArea.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 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询列表页面参数设置 |
|
|
|
|
|
const searchTableParams = ref([ |
|
|
|
|
|
//{ |
|
|
|
|
|
// formField: 'productItemCode', |
|
|
|
|
|
// searchTableTitle: '物料信息', |
|
|
|
|
|
// searchTableAllSchemas: Itembasic.allSchemas, |
|
|
|
|
|
// searchTablePage: ItembasicApi.getItembasicPage |
|
|
|
|
|
//} |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: FactoryAreaApi.getFactoryAreaPage // 分页接口 |
|
|
getListApi: FactoryAreaApi.getFactoryAreaPage // 分页接口 |
|
|
}) |
|
|
}) |
|
@ -101,9 +99,9 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:factoryArea:create'}), // 新增 |
|
|
defaultButtons.defaultAddBtn(null), // 新增 |
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:factoryArea:import'}), // 导入 |
|
|
defaultButtons.defaultImportBtn(null), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:factoryArea:export'}), // 导出 |
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
@ -135,8 +133,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:factoryArea:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn(null), // 编辑 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:factoryArea:delete'}), // 删除 |
|
|
defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
@ -154,13 +152,28 @@ const openForm = (type: string, row?: any) => { |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// form表单提交 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const formsSuccess = async (formType,data) => { |
|
|
nextTick(() => { |
|
|
var isHave =FactoryArea.allSchemas.formSchema.some(function (item) { |
|
|
const setV = {} |
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
setV[formField] = val[0][searchField] |
|
|
}); |
|
|
formRef.setValues(setV) |
|
|
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 FactoryAreaApi.createFactoryArea(data) |
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
} else { |
|
|
|
|
|
await FactoryAreaApi.updateFactoryArea(data) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
|
|
getList() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
@ -190,8 +203,8 @@ const handleExport = async () => { |
|
|
await message.exportConfirm() |
|
|
await message.exportConfirm() |
|
|
// 发起导出 |
|
|
// 发起导出 |
|
|
exportLoading.value = true |
|
|
exportLoading.value = true |
|
|
const data = await FactoryAreaApi.exportFactoryArea(setSearchParams) |
|
|
const data = await FactoryAreaApi.exportFactoryArea(tableObject.params) |
|
|
download.excel(data, '厂区.xls') |
|
|
download.excel(data, '厂区.xlsx') |
|
|
} catch { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
|
exportLoading.value = false |
|
|
exportLoading.value = false |
|
@ -206,7 +219,7 @@ const handleImport = () => { |
|
|
// 导入附件弹窗所需的参数 |
|
|
// 导入附件弹窗所需的参数 |
|
|
const importTemplateData = reactive({ |
|
|
const importTemplateData = reactive({ |
|
|
templateUrl: '', |
|
|
templateUrl: '', |
|
|
templateTitle: '厂区导入模版.xls' |
|
|
templateTitle: '厂区导入模版.xlsx' |
|
|
}) |
|
|
}) |
|
|
// 导入成功之后 |
|
|
// 导入成功之后 |
|
|
const importSuccess = () => { |
|
|
const importSuccess = () => { |
|
|