Browse Source

模板

master
zhang_li 10 months ago
parent
commit
d693ab094d
  1. 17
      src/components/Detail/src/Detail.vue
  2. 67
      src/views/eam/basic/factoryArea/index.vue

17
src/components/Detail/src/Detail.vue

@ -98,23 +98,20 @@
</template>
</DetailTable>
</ContentWrap>
<ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 -->
<!-- <ContentWrap class="w-[27%] ml-16px">
<Annex
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
/>
<!-- 备注组件 -->
<Remarks
:remarksData="remarksData"
class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess"
/>
<!-- 变更记录组件 -->
<ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" />
</ContentWrap>
</ContentWrap> -->
</div>
</el-drawer>
<!-- 表单弹窗添加/修改 -->
@ -139,12 +136,12 @@
</template>
<script lang="ts" setup>
import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
// import Annex from '@/components/Annex/src/Annex.vue'
// import Remarks from '@/components/Remarks/src/Remarks.vue'
// import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import Tabs from '@/components/Tabs/src/Tabs.vue'
import * as RemarkApi from '@/api/wms/remark'
import * as FileApi from '@/api/wms/file'
// import * as RemarkApi from '@/api/wms/remark'
// import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue'

67
src/views/eam/basic/factoryArea/index.vue

@ -41,10 +41,9 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="FactoryAreaRules"
:formAllSchemas="FactoryArea.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="FactoryAreaApi.updateFactoryArea"
:apiCreate="FactoryAreaApi.createFactoryArea"
@searchTableSuccess="searchTableSuccess"
@ -77,21 +76,20 @@ const routeName = ref()
routeName.value = route.name
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) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: FactoryAreaApi.getFactoryAreaPage //
})
@ -101,9 +99,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:factoryArea:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:factoryArea:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:factoryArea:export'}), //
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -135,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:factoryArea:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:factoryArea:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
@ -154,13 +152,28 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
// form
const formsSuccess = async (formType,data) => {
var isHave =FactoryArea.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 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()
//
exportLoading.value = true
const data = await FactoryAreaApi.exportFactoryArea(setSearchParams)
download.excel(data, '厂区.xls')
const data = await FactoryAreaApi.exportFactoryArea(tableObject.params)
download.excel(data, '厂区.xlsx')
} catch {
} finally {
exportLoading.value = false
@ -206,7 +219,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '厂区导入模版.xls'
templateTitle: '厂区导入模版.xlsx'
})
//
const importSuccess = () => {

Loading…
Cancel
Save