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 = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:deviceMoldItems:update'}), // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:deviceMoldItems:delete'}), // defaultButtons.mainListDeleteBtn(null), //
] ]
// - // -

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save