Browse Source

Revert "BUG修改"

This reverts commit e7ee5ce90d.
master
parent
commit
1dc5f27023
  1. 10
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  2. 10
      src/views/eam/basic/inspection/inspection.data.ts
  3. 11
      src/views/eam/basic/item/item.data.ts
  4. 11
      src/views/eam/basic/location/location.data.ts
  5. 10
      src/views/eam/basic/locationArea/locationArea.data.ts
  6. 10
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts
  7. 11
      src/views/eam/basic/supplier/supplier.data.ts
  8. 24
      src/views/eam/item/adjustRecord/adjustRecord.data.ts
  9. 16
      src/views/eam/item/applicationRecord/applicationRecordMain.data.ts
  10. 24
      src/views/eam/item/countRecord/countRecord.data.ts
  11. 12
      src/views/eam/item/countadjustWork/countadjustWork.data.ts
  12. 246
      src/views/eam/item/itemAccounts/index.vue
  13. 6
      src/views/eam/item/itemApplyMain/index.vue
  14. 20
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

10
src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts

@ -174,16 +174,6 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '操作',
field: 'action',

10
src/views/eam/basic/inspection/inspection.data.ts

@ -144,16 +144,6 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '操作',
field: 'action',

11
src/views/eam/basic/item/item.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemRules = reactive({
@ -244,16 +243,6 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '描述',
field: 'describes',

11
src/views/eam/basic/location/location.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import { LocationArea } from '../locationArea/locationArea.data'
@ -122,16 +121,6 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '描述',
field: 'description',

10
src/views/eam/basic/locationArea/locationArea.data.ts

@ -68,16 +68,6 @@ export const LocationArea = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '描述',

10
src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts

@ -147,16 +147,6 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '操作',
field: 'action',

11
src/views/eam/basic/supplier/supplier.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/validator'
// 表单校验
@ -78,16 +77,6 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
table: {
width: 170
},
},
{
label: '备注',
field: 'remark',

24
src/views/eam/item/adjustRecord/adjustRecord.data.ts

@ -107,18 +107,6 @@ export const AdjustRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '盘点数量',
@ -129,18 +117,6 @@ export const AdjustRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '操作',

16
src/views/eam/item/applicationRecord/applicationRecordMain.data.ts

@ -188,14 +188,14 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
min: 1,
precision: 6
}
},
{
@ -208,14 +208,14 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
min: 1,
precision: 6
}
},

24
src/views/eam/item/countRecord/countRecord.data.ts

@ -147,18 +147,6 @@ export const CountRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '盘点数量',
@ -169,18 +157,6 @@ export const CountRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '操作',

12
src/views/eam/item/countadjustWork/countadjustWork.data.ts

@ -118,18 +118,6 @@ export const CountJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '操作',

246
src/views/eam/item/itemAccounts/index.vue

@ -5,15 +5,28 @@
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="ItemAccounts.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemAccounts.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>
@ -26,68 +39,74 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ItemAccountsRules"
:formAllSchemas="ItemAccounts.allSchemas" :apiUpdate="ItemAccountsApi.updateItemAccounts"
:apiCreate="ItemAccountsApi.createItemAccounts" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemAccountsRules"
:formAllSchemas="ItemAccounts.allSchemas"
:apiUpdate="ItemAccountsApi.updateItemAccounts"
:apiCreate="ItemAccountsApi.createItemAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemAccounts.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemAccounts, ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
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: 'ItemAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const wantId1 = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
import download from '@/utils/download'
import { ItemAccounts,ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
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: 'ItemAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const wantId1 = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.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: ItemAccountsApi.getItemAccountsPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'eam:itemAccounts:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'eam:itemAccounts:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam:itemAccounts:export' }), //
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:itemAccounts:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:itemAccounts:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:itemAccounts:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -99,10 +118,10 @@
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
@ -115,31 +134,31 @@
} else { //
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({ hasPermi: 'eam:itemAccounts:update' }), //
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:itemAccounts:update'}), //
defaultButtons.replaceLocation(null), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:itemAccounts:delete' }), //
]
defaultButtons.mainListDeleteBtn({hasPermi:'eam:itemAccounts:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'replaceLocation') {
openItem(row.locationNumber, row.id)
}
openItem(row.locationNumber,row.id)
}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number : String, wantId : number) => {
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String,wantId: number) => {
locationNumber.value = number
wantId1.value = wantId
wantId1.value= wantId
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
@ -152,9 +171,9 @@
null,
null
)
}
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: wantId1.value,
locationNumber: locationNumber.value,
@ -166,13 +185,13 @@
//
getList()
})
}
}
const getItemWithOutBind = async () => {
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema,
available: "TRUE"
available:"TRUE"
})
if (res.list?.length > 0) {
@ -191,10 +210,10 @@
console.error(error)
throw error //
}
}
}
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
tableObject.loading = true
try {
const res = await getItemWithOutBind()
@ -208,27 +227,27 @@
} finally {
tableObject.loading = false
}
}
}
/** 添加/修改操作 */
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 = ItemAccounts.allSchemas.formSchema.some(function (item) {
// form
const formsSuccess = async (formType,data) => {
var isHave =ItemAccounts.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 ItemAccountsApi.createItemAccounts(data)
message.success(t('common.createSuccess'))
@ -238,16 +257,16 @@
}
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, 'basicItemAccounts')
}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
@ -256,12 +275,12 @@
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()
@ -273,35 +292,36 @@
} finally {
exportLoading.value = false
}
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
})
//
const importSuccess = () => {
getList()
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemAccountsApi.importTemplate()
})
})
</script>

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

@ -261,12 +261,6 @@
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
for (let item of tableData.value) {
if (item.qty > item.currentQty) {
message.error('要货计划数量不得大于订单数量-已计划数量')
return false;
}
}
if (formType === 'create') {
await ItemApplyMainApi.createItemApplyMain(data)
message.success(t('common.createSuccess'))

20
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -111,14 +111,14 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '备件信息',
searchTitle: '库区信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
}
]
},
},
@ -174,14 +174,14 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
min: 1,
precision: 6
}
},
{
@ -194,14 +194,14 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
min: 1,
precision: 6
}
},

Loading…
Cancel
Save