Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
2f1a3399c9
  1. 4
      src/views/eam/basic/deviceMoldItems/index.vue
  2. 180
      src/views/eam/basic/factoryArea/index.vue
  3. 6
      src/views/eam/basic/item/index.vue
  4. 6
      src/views/eam/basic/location/index.vue
  5. 204
      src/views/eam/basic/locationArea/index.vue
  6. 6
      src/views/eam/basic/supplier/index.vue
  7. 4
      src/views/eam/fixedAssets/index.vue

4
src/views/eam/basic/deviceMoldItems/index.vue

@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMoldItems:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMoldItems:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -

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

@ -5,28 +5,15 @@
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="FactoryArea.allSchemas"
/>
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="FactoryArea.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
@ -39,16 +26,9 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="FactoryAreaRules"
:formAllSchemas="FactoryArea.allSchemas"
:apiUpdate="FactoryAreaApi.updateFactoryArea"
:apiCreate="FactoryAreaApi.createFactoryArea"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="FactoryAreaRules"
:formAllSchemas="FactoryArea.allSchemas" :apiUpdate="FactoryAreaApi.updateFactoryArea"
:apiCreate="FactoryAreaApi.createFactoryArea" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="FactoryArea.allSchemas" />
@ -57,47 +37,47 @@
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { FactoryArea,FactoryAreaRules } from './factoryArea.data'
import * as FactoryAreaApi from '@/api/eam/basic/factoryArea'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'FactoryArea' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(FactoryArea.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
import download from '@/utils/download'
import { FactoryArea, FactoryAreaRules } from './factoryArea.data'
import * as FactoryAreaApi from '@/api/eam/basic/factoryArea'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'FactoryArea' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
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) => {
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: FactoryAreaApi.getFactoryAreaPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
@ -112,13 +92,13 @@ const HeadButttondata = [
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
}else if (val == 'export') { //
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
@ -126,42 +106,43 @@ const buttonBaseClick = (val, item) => {
} else { //
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
]
// -
const buttonTableClick = async (val, row) => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
console.log(row)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType,data) => {
var isHave =FactoryArea.allSchemas.formSchema.some(function (item) {
// 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){
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 (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'))
@ -171,16 +152,16 @@ const formsSuccess = async (formType,data) => {
}
basicFormRef.value.dialogVisible = false
getList()
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicFactoryArea')
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
@ -189,12 +170,12 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -206,20 +187,19 @@ const handleExport = async () => {
} finally {
exportLoading.value = false
}
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
})
})
</script>

6
src/views/eam/basic/item/index.vue

@ -119,8 +119,6 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
@ -133,8 +131,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:item:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:item:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -

6
src/views/eam/basic/location/index.vue

@ -119,8 +119,6 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
@ -133,8 +131,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:location:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:location:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -

204
src/views/eam/basic/locationArea/index.vue

@ -5,28 +5,15 @@
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="LocationArea.allSchemas"
/>
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="LocationArea.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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
@ -39,17 +26,10 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="LocationAreaRules"
:formAllSchemas="LocationArea.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="LocationAreaApi.updateLocationArea"
:apiCreate="LocationAreaApi.createLocationArea"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="LocationAreaRules"
:formAllSchemas="LocationArea.allSchemas" :searchTableParams="searchTableParams"
:apiUpdate="LocationAreaApi.updateLocationArea" :apiCreate="LocationAreaApi.createLocationArea"
@searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="LocationArea.allSchemas" />
@ -57,48 +37,48 @@
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { LocationArea,LocationAreaRules } from './locationArea.data'
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'LocationArea' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(LocationArea.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
import download from '@/utils/download'
import { LocationArea, LocationAreaRules } from './locationArea.data'
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'LocationArea' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(LocationArea.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: LocationAreaApi.getLocationAreaPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
@ -113,10 +93,10 @@ const HeadButttondata = [
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'export') { //
@ -127,42 +107,45 @@ const buttonBaseClick = (val, item) => {
} else { //
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
]
// -
const buttonTableClick = async (val, row) => {
// -
const buttonTableClick = (val, row) => {
console.log('11111111111111',val, row )
if (val == 'edit') { //
console.log('22222', row )
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
console.log('33333', row )
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType,data) => {
var isHave =LocationArea.allSchemas.formSchema.some(function (item) {
// form
const formsSuccess = async (formType, data) => {
var isHave = LocationArea.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.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 (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
if (formType === 'create') {
await LocationAreaApi.createLocationArea(data)
message.success(t('common.createSuccess'))
@ -172,25 +155,25 @@ const formsSuccess = async (formType,data) => {
}
basicFormRef.value.dialogVisible = false
getList()
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicLocationArea')
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
@ -199,12 +182,12 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -216,20 +199,19 @@ const handleExport = async () => {
} finally {
exportLoading.value = false
}
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
})
})
</script>

6
src/views/eam/basic/supplier/index.vue

@ -119,8 +119,6 @@ const HeadButttondata = [
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
@ -133,8 +131,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:supplier:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:supplier:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -

4
src/views/eam/fixedAssets/index.vue

@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:fixedAssets:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:fixedAssets:delete'}), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -

Loading…
Cancel
Save