|
@ -1,7 +1,11 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="CountConfig.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="CountConfig.allSchemas.searchSchema" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -47,6 +51,7 @@ |
|
|
:apiUpdate="CountConfigApi.updateCountConfig" |
|
|
:apiUpdate="CountConfigApi.updateCountConfig" |
|
|
:apiCreate="CountConfigApi.createCountConfig" |
|
|
:apiCreate="CountConfigApi.createCountConfig" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
@clearSearchInput="clearSearchInput" |
|
|
:isBusiness="false" |
|
|
:isBusiness="false" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
@ -54,7 +59,8 @@ |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="CountConfig.allSchemas" /> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="CountConfig.allSchemas" /> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" |
|
|
<ImportForm |
|
|
|
|
|
ref="importFormRef" |
|
|
url="/wms/count-config/import" |
|
|
url="/wms/count-config/import" |
|
|
:importTemplateData="importTemplateData" |
|
|
:importTemplateData="importTemplateData" |
|
|
@success="importSuccess" |
|
|
@success="importSuccess" |
|
@ -95,7 +101,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
setV['uom'] = val[0].uom |
|
|
setV['uom'] = val[0].uom |
|
|
setV['packUnit'] = val[0].defaultPackUnit |
|
|
setV['packUnit'] = val[0].defaultPackUnit |
|
|
setV['packQty'] = val[0].defaultPackQty |
|
|
setV['packQty'] = val[0].defaultPackQty |
|
|
|
|
|
if (val[0].convertRate == null) { |
|
|
|
|
|
setV['conversionRate'] = 1.0 |
|
|
|
|
|
} else { |
|
|
|
|
|
setV['conversionRate'] = val[0].convertRate |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
@ -120,7 +130,7 @@ const HeadButttondata = [ |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-config:export' }), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-config:export' }), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -133,16 +143,22 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
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) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -150,14 +166,16 @@ const buttonBaseClick = (val, item) => { |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = [ |
|
|
const butttondata = [ |
|
|
defaultButtons.mainListEditBtn(), // 编辑 |
|
|
defaultButtons.mainListEditBtn(), // 编辑 |
|
|
defaultButtons.mainListDeleteBtn(), // 删除 |
|
|
defaultButtons.mainListDeleteBtn() // 删除 |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { |
|
|
|
|
|
// 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -166,15 +184,15 @@ const buttonTableClick = async (val, row) => { |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
if (type == 'create') { |
|
|
if (type == 'create') { |
|
|
CountConfig.allSchemas.formSchema.forEach(item =>{ |
|
|
CountConfig.allSchemas.formSchema.forEach((item) => { |
|
|
if(item.field == "itemCode"){ |
|
|
if (item.field == 'itemCode') { |
|
|
item.componentProps.isSearchList = true |
|
|
item.componentProps.isSearchList = true |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = false |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else if (type == 'update') { |
|
|
} else if (type == 'update') { |
|
|
CountConfig.allSchemas.formSchema.forEach(item =>{ |
|
|
CountConfig.allSchemas.formSchema.forEach((item) => { |
|
|
if(item.field == "itemCode"){ |
|
|
if (item.field == 'itemCode') { |
|
|
item.componentProps.isSearchList = false |
|
|
item.componentProps.isSearchList = false |
|
|
item.componentProps.disabled = true |
|
|
item.componentProps.disabled = true |
|
|
} |
|
|
} |
|
@ -186,16 +204,16 @@ const openForm = (type: string, row?: any) => { |
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType, data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
|
var isHave = CountConfig.allSchemas.formSchema.some(function (item) { |
|
|
var isHave = CountConfig.allSchemas.formSchema.some(function (item) { |
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
}); |
|
|
}) |
|
|
if (isHave) { |
|
|
if (isHave) { |
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
message.error('失效时间要大于生效时间') |
|
|
message.error('失效时间要大于生效时间') |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await CountConfigApi.createCountConfig(data) |
|
|
await CountConfigApi.createCountConfig(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -257,6 +275,21 @@ const importSuccess = () => { |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const clearSearchInput = (formField) => { |
|
|
|
|
|
if (formField == 'itemCode') { |
|
|
|
|
|
//车间 |
|
|
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
|
|
itemName: '', |
|
|
|
|
|
desc1: '', |
|
|
|
|
|
uom: '', |
|
|
|
|
|
packUnit: '', |
|
|
|
|
|
packQty: '', |
|
|
|
|
|
conversionRate: 1 |
|
|
|
|
|
}) |
|
|
|
|
|
// tableData.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 筛选提交 |
|
|
// 筛选提交 |
|
|
const searchFormClick = (searchData) => { |
|
|
const searchFormClick = (searchData) => { |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
@ -271,5 +304,4 @@ onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await CountConfigApi.importTemplate() |
|
|
importTemplateData.templateUrl = await CountConfigApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|