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. 64
      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. 516
      src/views/eam/item/itemAccounts/index.vue
  13. 6
      src/views/eam/item/itemApplyMain/index.vue
  14. 214
      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: '操作', label: '操作',
field: 'action', 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: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const ItemRules = reactive({ 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: '描述', label: '描述',
field: 'describes', field: 'describes',

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

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationAreaApi from '@/api/eam/basic/locationArea' import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import { LocationArea } from '../locationArea/locationArea.data' 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: '描述', label: '描述',
field: 'description', 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: '描述', 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: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {validateHanset,validateFax,validatePostCode,validateYS} from '@/utils/validator' 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: '备注', label: '备注',
field: 'remark', field: 'remark',

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

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

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

@ -63,16 +63,16 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true disabled: true
} }
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false, isDetail: false,
isForm: false, isForm: false,
table: { table: {
width: 200, width: 200,
fixed: 'right' fixed: 'right'
} }
} }
])) ]))
//表单校验 //表单校验
@ -164,17 +164,17 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择单号', searchListPlaceholder: '请选择单号',
searchField: 'number', searchField: 'number',
searchTitle: '单号信息', searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: "TRUE", value: "TRUE",
isMainValue: false isMainValue: false
}, { }, {
key: 'type', key: 'type',
value: "type", value: "type",
isMainValue: true isMainValue: true
} }
] ]
}, },
}, },
@ -188,14 +188,14 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, min: 1,
precision: 2 precision: 6
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
min: 0, min: 1,
precision: 2 precision: 6
} }
}, },
{ {
@ -205,18 +205,18 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
min: 0, min: 1,
precision: 2 precision: 6
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
min: 0, min: 1,
precision: 2 precision: 6
} }
}, },

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

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

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

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

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

@ -4,16 +4,29 @@
<Search :schema="ItemAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="ItemAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" <TableHead
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="ItemAccounts.allSchemas" /> :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemAccounts.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ <Table
: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:sort="tableObject.sort"> v-model:pageSize="tableObject.pageSize"
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>
@ -26,282 +39,289 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ItemAccountsRules" <BasicForm
:formAllSchemas="ItemAccounts.allSchemas" :apiUpdate="ItemAccountsApi.updateItemAccounts" ref="basicFormRef"
:apiCreate="ItemAccountsApi.createItemAccounts" @searchTableSuccess="searchTableSuccess" :isBusiness="false" /> @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" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="ItemAccounts.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ItemAccounts, ItemAccountsRules } from './itemAccounts.data' import { ItemAccounts,ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import { Item } from '@/views/eam/basic/item/item.data' import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
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: '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)
})
}
// defineOptions({ name: 'ItemAccounts' })
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({ const message = useMessage() //
getListApi: ItemAccountsApi.getItemAccountsPage // 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 { getList, setSearchParams } = tableMethods const updataTableColumns = (val) => {
tableColumns.value = val
// }
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), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// - const { tableObject, tableMethods } = useTable({
const butttondata = [ getListApi: ItemAccountsApi.getItemAccountsPage //
defaultButtons.mainListEditBtn({ hasPermi: 'eam:itemAccounts:update' }), // })
defaultButtons.replaceLocation(null), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:itemAccounts:delete' }), // //
] const { getList, setSearchParams } = tableMethods
// -
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)
}
}
const searchTableRef = ref() //
/** 绑定备件操作 */ const HeadButttondata = [
const openItem = async (number : String, wantId : number) => { defaultButtons.defaultAddBtn({hasPermi:'eam:itemAccounts:create'}), //
locationNumber.value = number defaultButtons.defaultImportBtn({hasPermi:'eam:itemAccounts:import'}), //
wantId1.value = wantId defaultButtons.defaultExportBtn({hasPermi:'eam:itemAccounts:export'}), //
searchTableRef.value.open( defaultButtons.defaultFreshBtn(null), //
'选择备件', defaultButtons.defaultFilterBtn(null), //
Item.allSchemas, defaultButtons.defaultSetBtn(null), //
getDeviceItemList, // {
null, // label: '',
Item.allSchemas.searchSchema, // name: 'zdy',
true, // hide: false,
null, // type: 'primary',
null, // icon: 'Select',
null, // color: ''
null // },
) ]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
} }
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => { // -
const deviceItemRelList = selections.map((element) => ({ const butttondata = [
id: wantId1.value, defaultButtons.mainListEditBtn({hasPermi:'eam:itemAccounts:update'}), //
locationNumber: locationNumber.value, defaultButtons.replaceLocation(null), //
itemNumber: element.number, defaultButtons.mainListDeleteBtn({hasPermi:'eam:itemAccounts:delete'}), //
]
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => { // -
message.success(t('更换成功')) const buttonTableClick = async (val, row) => {
// if (val == 'edit') { //
getList() openForm('update', row)
}) } else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'replaceLocation') {
openItem(row.locationNumber,row.id)
} }
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String,wantId: number) => {
locationNumber.value = number
wantId1.value= wantId
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
getDeviceItemList,
null,
Item.allSchemas.searchSchema,
true,
null,
null,
null,
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: wantId1.value,
locationNumber: locationNumber.value,
itemNumber: element.number,
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
message.success(t('更换成功'))
//
getList()
})
}
const getItemWithOutBind = async () => { const getItemWithOutBind = async () => {
try { try {
const res = await ItemApi.getItemPage({ const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema, ...Item.allSchemas.searchSchema,
available: "TRUE" available:"TRUE"
}) })
if (res.list?.length > 0) { if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema); // const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => { // const filteredList = res.list.filter(item => {
// return !response.list?.some(element => { // return !response.list?.some(element => {
// return item.number === element.itemNumber // return item.number === element.itemNumber
// }); // });
// }); // });
// console.log('filteredList',filteredList); // console.log('filteredList',filteredList);
const filteredList = res.list const filteredList = res.list
return filteredList // return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
} }
return [] //
} catch (error) {
console.error(error)
throw error //
} }
}
// getListApi getItemWithOutBind // getListApi getItemWithOutBind
const getDeviceItemList = async () => { const getDeviceItemList = async () => {
tableObject.loading = true tableObject.loading = true
try { try {
const res = await getItemWithOutBind() const res = await getItemWithOutBind()
let result = { let result = {
list: res, list: res,
total: res.length total: res.length
}
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
} }
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
} }
}
/** 添加/修改操作 */ /** 添加/修改操作 */
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 = ItemAccounts.allSchemas.formSchema.some(function (item) { var isHave =ItemAccounts.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.expireTime == 0) data.expireTime = null;
if (formType === 'create') {
await ItemAccountsApi.createItemAccounts(data)
message.success(t('common.createSuccess'))
} else {
await ItemAccountsApi.updateItemAccounts(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} }
if(data.activeTime==0)data.activeTime = null;
/** 详情操作 */ if(data.expireTime==0)data.expireTime = null;
const detailRef = ref() if (formType === 'create') {
const openDetail = (row : any, titleName : any, titleValue : any) => { await ItemAccountsApi.createItemAccounts(data)
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemAccounts') message.success(t('common.createSuccess'))
} else {
await ItemAccountsApi.updateItemAccounts(data)
message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false
getList()
}
/** 删除按钮操作 */ /** 详情操作 */
const handleDelete = async (id : number) => { const detailRef = ref()
try { const openDetail = (row: any, titleName: any, titleValue: any) => {
// detailRef.value.openDetail(row, titleName, titleValue, 'basicItemAccounts')
await message.delConfirm() }
//
await ItemAccountsApi.deleteItemAccounts(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */ /** 删除按钮操作 */
const exportLoading = ref(false) // const handleDelete = async (id: number) => {
const handleExport = async () => { try {
try { //
// await message.delConfirm()
await message.exportConfirm() //
// await ItemAccountsApi.deleteItemAccounts(id)
exportLoading.value = true message.success(t('common.delSuccess'))
const data = await ItemAccountsApi.exportItemAccounts(tableObject.params) //
download.excel(data, '备件台账.xlsx') await getList()
} catch { } catch {}
} finally { }
exportLoading.value = false
}
}
/** 导入 */ /** 导出按钮操作 */
const importFormRef = ref() const exportLoading = ref(false) //
const handleImport = () => { const handleExport = async () => {
importFormRef.value.open() try {
} //
// await message.exportConfirm()
const importTemplateData = reactive({ //
templateUrl: '', exportLoading.value = true
templateTitle: '备件台账导入模版.xlsx' const data = await ItemAccountsApi.exportItemAccounts(tableObject.params)
}) download.excel(data, '备件台账.xlsx')
// } catch {
const importSuccess = () => { } finally {
getList() exportLoading.value = false
} }
}
// /** 导入 */
const searchFormClick = (searchData) => { const importFormRef = ref()
tableObject.params = { const handleImport = () => {
isSearch: true, importFormRef.value.open()
filters: searchData.filters }
} //
getList() // const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
} }
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemAccountsApi.importTemplate()
})
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemAccountsApi.importTemplate()
})
</script> </script>

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

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

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

@ -21,7 +21,7 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'left' fixed: 'left'
}, },
}, },
{ {
label: '申领人', label: '申领人',
field: 'applyName', field: 'applyName',
sort: 'custom', sort: 'custom',
@ -111,135 +111,135 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号', searchListPlaceholder: '请选择备件编号',
searchField: 'number', searchField: 'number',
searchTitle: '备件信息', searchTitle: '库区信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}, }
] ]
}, },
}, },
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 150 width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
}, },
tableForm: {
type: 'Select',
disabled: false
}
},
{ {
label: '设备/模具编号', label: '设备/模具编号',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm: { tableForm: {
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择单号', searchListPlaceholder: '请选择单号',
searchField: 'number', searchField: 'number',
searchTitle: '单号信息', searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: "TRUE", value: "TRUE",
isMainValue: false isMainValue: false
}, { }, {
key: 'type', key: 'type',
value: "type", value: "type",
isMainValue: true isMainValue: true
} }
] ]
}, },
},
{
label: '申领数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
}, },
form: { {
component: 'InputNumber', label: '申领数量',
componentProps: { field: 'qty',
min: 0, sort: 'custom',
precision: 2 table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
} }
}, },
tableForm: { {
type: 'InputNumber', label: '库存数量',
min: 0, field: 'currentQty',
precision: 2 sort: 'custom',
} table: {
}, width: 150
{ },
label: '库存数量', form: {
field: 'currentQty', component: 'InputNumber',
sort: 'custom', componentProps: {
table: { min: 1,
width: 150 precision: 6
}, }
form: { },
component: 'InputNumber', tableForm: {
componentProps: { type: 'InputNumber',
min: 0, min: 1,
precision: 2 precision: 6
} }
}, },
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 150 width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
}, },
tableForm: {
type: 'Select',
disabled: true
}
},
{ {
label: '是否以旧换新', label: '是否以旧换新',
field: 'isRadeIn', field: 'isRadeIn',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 150 width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
}, },
tableForm: {
type: 'Select',
disabled: true
}
},
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',

Loading…
Cancel
Save