zhang_li 8 months ago
parent
commit
e5964bcdeb
  1. 6
      src/api/eam/item/itemAccounts/index.ts
  2. 14
      src/components/Detail/src/DetailDeviceLedger.vue
  3. 7
      src/views/eam/basic/item/index.vue
  4. 831
      src/views/eam/device/deviceAccounts/index.vue
  5. 171
      src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts
  6. 29
      src/views/eam/item/itemAccounts/index.vue
  7. 8
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts

6
src/api/eam/item/itemAccounts/index.ts

@ -55,3 +55,9 @@ export const importTemplate = () => {
export const replaceLocation = async (data: Array<ItemAccountsVO>) => {
return await request.post({url: `/eam/item-accounts/replaceLocation `, data });
};
// 备件不分页
export const getItemAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/item-accounts/noPage`, params })
}

14
src/components/Detail/src/DetailDeviceLedger.vue

@ -196,11 +196,11 @@
:style="{height:'600px'}"
>
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" :key="dialogFormKey">
<el-form-item label="文件上传">
<el-form-item label="文件选择">
<UploadFile v-model="fileDialogUploadData.filePathList" :limit="20" />
</el-form-item>
</el-form>
<el-button type="primary" @click="dialogUploadFile">点击修改</el-button>
<el-button type="primary" @click="dialogUploadFile">提交</el-button>
</Dialog>
<!-- dialog表单弹窗添加/修改 -->
<BasicForm
@ -896,6 +896,15 @@ const buttonMilestoneClick = async (val, row) => {
}
const submitDialogForm = async (type, row) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage, //
defaultParams : props.defaultParams
})
detailAllSchemasRef.value = props.detailAllSchemas
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
tableObjectRef.value.tableList = []
const { getList } = tableMethods
await props.diaLogApiUpdate(row)
dialogFormRef.value.dialogVisible = false
await getList()
@ -936,6 +945,7 @@ function dialogUploadFile() {
props.uploadImage(data).then((res) => {
message.success('修改成功')
getImage()
dialogUploadVisible.value = false
})
}

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

@ -122,13 +122,6 @@
}
}
/** 添加设备操作 */
// const searchTableRef = ref()
// const openItem = (number : String) => {
// itemNumber.value = number;
// searchTableRef.value.open('', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null);
// }
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number : String) => {

831
src/views/eam/device/deviceAccounts/index.vue

@ -1,36 +1,20 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="DeviceAccounts.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
<Search :schema="DeviceAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceAccounts.allSchemas"
/>
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="DeviceAccounts.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 #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '编号', row.number)">
<span>{{ row.number }}</span>
@ -43,446 +27,421 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DeviceAccountsRules"
:formAllSchemas="DeviceAccounts.allSchemas"
:apiUpdate="DeviceAccountsApi.updateDeviceAccounts"
:apiCreate="DeviceAccountsApi.createDeviceAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="DeviceAccountsRules"
:formAllSchemas="DeviceAccounts.allSchemas" :apiUpdate="DeviceAccountsApi.updateDeviceAccounts"
:apiCreate="DeviceAccountsApi.createDeviceAccounts" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<SearchTable ref="searchTableRef" @onMountedCallBack="onMountedCallBack" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<DetailDeviceLedger
ref="detailRef"
:tabs="DeviceLedgerTabsList"
:subTabs="DeviceLedgerSubTabsList"
:isBasic="true"
:allSchemas="allSchemas"
@changeTabs="changeTabs"
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabName="tabName"
:tableObjectExtend="tableObjectExtend"
:getImageApi="uploadApi.getImage"
:uploadImage="uploadApi.uploadImage"
:defaultParams="defaultParams"
:dialogApiPage="dialogApiPage"
:dialogAllSchemas="dialogAllSchemas"
/>
<DetailDeviceLedger ref="detailRef" :tabs="DeviceLedgerTabsList" :subTabs="DeviceLedgerSubTabsList" :isBasic="true"
:allSchemas="allSchemas" @changeTabs="changeTabs" :detailAllSchemas="detailAllSchemas" :apiPage="apiPage"
:tabsExtend="tabsExtend" :tabName="tabName" :tableObjectExtend="tableObjectExtend" :getImageApi="uploadApi.getImage"
:uploadImage="uploadApi.uploadImage" :defaultParams="defaultParams" :dialogApiPage="dialogApiPage"
:dialogAllSchemas="dialogAllSchemas" />
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/device-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<ImportForm ref="importFormRef" url="/eam/device-accounts/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
DeviceAccounts,
DeviceAccountsRules,
} from './deviceAccounts.data'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { createDeviceItemBatch, getDeviceItemPage,getDeviceItemNoPage } from '@/api/eam/basic/rel'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { DeviceLedgerTabsList } from '@/utils/disposition/tabsList'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import DetailDeviceLedger from '@/components/Detail/src/DetailDeviceLedger.vue'
import { DeviceRepair } from '@/views/eam/device/deviceRepair/deviceRepair.data'
import { DeviceItem } from '@/views/eam/basic/deviceItem/deviceItem.data'
import * as deviceRepairApi from '@/api/eam/device/deviceRepair'
import * as uploadApi from '@/api/eam/upload'
import * as DeviceMaintainOrderMainApi from '@/api/eam/device/deviceMaintainOrderMain'
import * as DeviceMaintainOrderDetailApi from '@/api/eam/device/deviceMaintainOrderDetail'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import * as deviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceDetail'
import { getAccessToken } from '@/utils/auth'
import {
DeviceMaintainOrderMain,
DeviceMaintainOrderDetail,
} from '../devicemaintainjob/deviceMaintainOrderMain.data'
import {
DeviceMaintenanceMain,
DeviceMaintenanceDetail
} from '../devicemaintenancejob/deviceMaintenanceMain.data'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'DeviceAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const deviceNumber = ref()
routeName.value = route.name
const tableColumns = ref(DeviceAccounts.allSchemas.tableColumns)
const allSchemas = ref(DeviceAccounts.allSchemas)
const detailAllSchemas = ref()
const apiPage = ref()
const itemCodeRow = ref()
const tableObjectExtend = ref()
const defaultParams = ref({})
const dialogApiPage = ref()
const dialogAllSchemas = ref()
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken())
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DeviceAccountsApi.getDeviceAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.selectQrCodeBatchBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 == 'qrCodeBatch') {
//
qrCodeBatch(val, item)
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
import download from '@/utils/download'
import {
DeviceAccounts,
DeviceAccountsRules,
} from './deviceAccounts.data'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { createDeviceItemBatch, getDeviceItemPage, getDeviceItemNoPage } from '@/api/eam/basic/rel'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { DeviceLedgerTabsList } from '@/utils/disposition/tabsList'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import DetailDeviceLedger from '@/components/Detail/src/DetailDeviceLedger.vue'
import { DeviceRepair } from '@/views/eam/device/deviceRepair/deviceRepair.data'
import { DeviceItem } from '@/views/eam/basic/deviceItem/deviceItem.data'
import * as deviceRepairApi from '@/api/eam/device/deviceRepair'
import * as uploadApi from '@/api/eam/upload'
import * as DeviceMaintainOrderMainApi from '@/api/eam/device/deviceMaintainOrderMain'
import * as DeviceMaintainOrderDetailApi from '@/api/eam/device/deviceMaintainOrderDetail'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import * as deviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceDetail'
import { getAccessToken } from '@/utils/auth'
import {
DeviceMaintainOrderMain,
DeviceMaintainOrderDetail,
} from '../devicemaintainjob/deviceMaintainOrderMain.data'
import {
DeviceMaintenanceMain,
DeviceMaintenanceDetail
} from '../devicemaintenancejob/deviceMaintenanceMain.data'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
defineOptions({ name: 'DeviceAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const deviceNumber = ref()
routeName.value = route.name
const tableColumns = ref(DeviceAccounts.allSchemas.tableColumns)
const allSchemas = ref(DeviceAccounts.allSchemas)
const detailAllSchemas = ref()
const apiPage = ref()
const itemCodeRow = ref()
const tableObjectExtend = ref()
const defaultParams = ref({})
const dialogApiPage = ref()
const dialogAllSchemas = ref()
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken())
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
defaultButtons.selectQrCodeBtn(null), //
defaultButtons.selectItemBtn(null) //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'selectQrCode') {
//
openQrCode(row.number)
} else if (val == 'selectItem') {
openItem(row.number)
} else if (val == 'qrCode') {
window.open(src.value + "&number='" + row.number + "'")
} else {
//
console.log('其他按钮', val, row)
const { tableObject, tableMethods } = useTable({
getListApi: DeviceAccountsApi.getDeviceAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.selectQrCodeBatchBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
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 == 'qrCodeBatch') {
//
qrCodeBatch(val, item)
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
defaultButtons.selectQrCodeBtn(null), //
defaultButtons.selectItemBtn(null) //
]
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
var isHave = DeviceAccounts.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
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'selectQrCode') {
//
openQrCode(row.number)
} else if (val == 'selectItem') {
openItem(row.number)
} else if (val == 'qrCode') {
window.open(src.value + "&number='" + row.number + "'")
} else {
//
console.log('其他按钮', val, row)
}
}
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await DeviceAccountsApi.createDeviceAccounts(data)
message.success(t('common.createSuccess'))
} else {
await DeviceAccountsApi.updateDeviceAccounts(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
itemCodeRow.value = row.number
tabsExtend.value = 1
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceAccountsApi.deleteDeviceAccounts(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeviceAccountsApi.exportDeviceAccounts(tableObject.params)
download.excel(data, '设备台账.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备台账导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
basicFormRef.value.open(type, row)
}
getList() //
}
const DeviceLedgerSubTabsList = getStrDictOptions(DICT_TYPE.DEVICE_DOC_TYPE)
const tabsExtend = ref()
const tabName = ref()
const funcCode = ref('device_mould_picture')
// tabs
const changeTabs = (item) => {
if (item.prop == 'Image') {
tabsExtend.value = 1
tabName.value = item.label
funcCode.value = 'device_mould_picture'
// apiPage.value = CustomeritemApi.getCustomeritemPage
// detailAllSchemas.value = Customeritem.allSchemas
} else if (item.prop == 'Word') {
tabsExtend.value = 2
tabName.value = item.label
funcCode.value = 'device_mould_attachment'
// apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
// detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
// form
const formsSuccess = async (formType, data) => {
var isHave = DeviceAccounts.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
}
}
apiPage.value = getDeviceItemPage
detailAllSchemas.value = DeviceItem.allSchemas
} else if (item.prop == 'DeviceReportRecord') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await DeviceAccountsApi.createDeviceAccounts(data)
message.success(t('common.createSuccess'))
} else {
await DeviceAccountsApi.updateDeviceAccounts(data)
message.success(t('common.updateSuccess'))
}
apiPage.value = deviceRepairApi.getDeviceRepairPage
detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
itemCodeRow.value = row.number
tabsExtend.value = 1
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await DeviceAccountsApi.deleteDeviceAccounts(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeviceAccountsApi.exportDeviceAccounts(tableObject.params)
download.excel(data, '设备台账.xlsx')
} catch {
} finally {
exportLoading.value = false
}
apiPage.value = DeviceMaintenanceMainApi.getDeviceMaintenanceMainPage
detailAllSchemas.value = DeviceMaintenanceMain.allSchemas
dialogApiPage.value = deviceMaintenanceDetailApi.getDeviceMaintenanceDetailPage
dialogAllSchemas.value = DeviceMaintenanceDetail.allSchemas
} else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '设备台账导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
apiPage.value = DeviceMaintainOrderMainApi.getDeviceMaintainOrderMainPage
detailAllSchemas.value = DeviceMaintainOrderMain.allSchemas
dialogApiPage.value = DeviceMaintainOrderDetailApi.getDeviceMaintainOrderDetailPage
dialogAllSchemas.value = DeviceMaintainOrderDetail.allSchemas
getList() //
}
// detailAllSchemas.value.tableColumns.map((item, index) => {
// if (item.field == 'action') {
// detailAllSchemas.value.tableColumns.splice(index, 1)
// }
// })
//
tableObjectExtend.value = [
{
key: 'itemCode',
value: itemCodeRow.value
const DeviceLedgerSubTabsList = getStrDictOptions(DICT_TYPE.DEVICE_DOC_TYPE)
const tabsExtend = ref()
const tabName = ref()
const funcCode = ref('device_mould_picture')
// tabs
const changeTabs = (item) => {
if (item.prop == 'Image') {
tabsExtend.value = 1
tabName.value = item.label
funcCode.value = 'device_mould_picture'
// apiPage.value = CustomeritemApi.getCustomeritemPage
// detailAllSchemas.value = Customeritem.allSchemas
} else if (item.prop == 'Word') {
tabsExtend.value = 2
tabName.value = item.label
funcCode.value = 'device_mould_attachment'
// apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
// detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
apiPage.value = getDeviceItemPage
detailAllSchemas.value = DeviceItem.allSchemas
} else if (item.prop == 'DeviceReportRecord') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
apiPage.value = deviceRepairApi.getDeviceRepairPage
detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
apiPage.value = DeviceMaintenanceMainApi.getDeviceMaintenanceMainPage
detailAllSchemas.value = DeviceMaintenanceMain.allSchemas
dialogApiPage.value = deviceMaintenanceDetailApi.getDeviceMaintenanceDetailPage
dialogAllSchemas.value = DeviceMaintenanceDetail.allSchemas
} else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
apiPage.value = DeviceMaintainOrderMainApi.getDeviceMaintainOrderMainPage
detailAllSchemas.value = DeviceMaintainOrderMain.allSchemas
dialogApiPage.value = DeviceMaintainOrderDetailApi.getDeviceMaintainOrderDetailPage
dialogAllSchemas.value = DeviceMaintainOrderDetail.allSchemas
}
]
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceAccountsApi.importTemplate()
})
/** 二维码 */
const openQrCode = async (number: String) => {
// const data = await DeviceAccountsApi.getQrCode(number)
// const url = window.URL.createObjectURL(new Blob([data]))
// const link = document.createElement('a')
// link.style.display = 'none'
// link.href = url
// link.setAttribute('download', '.png')
// document.body.appendChild(link)
// link.click()
// try {
// //
// await message.delConfirm()
// //
// await DeviceAccountsApi.deleteDeviceAccounts(id)
// message.success(t('common.delSuccess'))
// //
// await getList()
// } catch {}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String) => {
deviceNumber.value = number
await CallBack1()
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
null,
null,
null,
null,
searchTableSelections.value
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
deviceNumber: deviceNumber.value,
itemNumber: element.number
}))
createDeviceItemBatch(deviceItemRelList).then((res) => {
console.log('res', res)
// detailAllSchemas.value.tableColumns.map((item, index) => {
// if (item.field == 'action') {
// detailAllSchemas.value.tableColumns.splice(index, 1)
// }
// })
//
tableObjectExtend.value = [
{
key: 'itemCode',
value: itemCodeRow.value
}
]
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceAccountsApi.importTemplate()
})
console.log('deviceItemRelList', deviceItemRelList)
}
const getDeviceItemBindData = async (params) => {
const response = await getDeviceItemPage(params);
return response?.data;
}
const qrCodeBatch = async (val,item) => {
const qrCodeList = tableObject.tableList.map(item => `'${item?.number}'`).join(', ')
window.open(src.value + "&number=" + qrCodeList)
}
const searchTableSelections = ref([])
const CallBack1 = async () => {
await getDeviceItemNoPage({ deviceNumber: deviceNumber.value }).then(async(res) => {
await ItemApi.getItemNoPage().then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.number == item.itemNumber) {
flag = true;
}
/** 二维码 */
const openQrCode = async (number : String) => {
// const data = await DeviceAccountsApi.getQrCode(number)
// const url = window.URL.createObjectURL(new Blob([data]))
// const link = document.createElement('a')
// link.style.display = 'none'
// link.href = url
// link.setAttribute('download', '.png')
// document.body.appendChild(link)
// link.click()
// try {
// //
// await message.delConfirm()
// //
// await DeviceAccountsApi.deleteDeviceAccounts(id)
// message.success(t('common.delSuccess'))
// //
// await getList()
// } catch {}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number : String) => {
deviceNumber.value = number
await CallBack1()
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
null,
null,
null,
null,
searchTableSelections.value
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
deviceNumber: deviceNumber.value,
itemNumber: element.number
}))
createDeviceItemBatch(deviceItemRelList).then((res) => {
console.log('res', res)
})
console.log('deviceItemRelList', deviceItemRelList)
}
const getDeviceItemBindData = async (params) => {
const response = await getDeviceItemPage(params);
return response?.data;
}
const qrCodeBatch = async (val, item) => {
const qrCodeList = tableObject.tableList.map(item => `'${item?.number}'`).join(', ')
window.open(src.value + "&number=" + qrCodeList)
}
const searchTableSelections = ref([])
const CallBack1 = async () => {
await getDeviceItemNoPage({ deviceNumber: deviceNumber.value }).then(async (res) => {
await ItemApi.getItemNoPage().then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.number == item.itemNumber) {
flag = true;
}
});
return flag;
});
return flag;
});
});
});
};
};
</script>

171
src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts

@ -3,8 +3,36 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceInternalAuditRules = reactive({
number: [required],
personer: [required],
personer: [
{ required: true, message: '请输入人员', trigger: 'blur' },
],
fitOut: [
{ required: true, message: '请输入装配', trigger: 'blur' },
],
coating: [
{ required: true, message: '请输入涂装', trigger: 'blur' },
],
injectionMolding: [
{ required: true, message: '请输入注塑', trigger: 'blur' },
],
business: [
{ required: true, message: '请输入商务', trigger: 'blur' },
],
laboratory: [
{ required: true, message: '请输入实验室', trigger: 'blur' },
],
it: [
{ required: true, message: '请输入IT', trigger: 'blur' },
],
qualityDepartment: [
{ required: true, message: '请输入质量保障部', trigger: 'blur' },
],
materialFlow: [
{ required: true, message: '请输入物流', trigger: 'blur' },
],
moldPre: [
{ required: true, message: '请输入模具前期', trigger: 'blur' },
],
})
export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
@ -30,92 +58,207 @@ export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
label: '装配',
field: 'fitOut',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '涂装',
field: 'coating',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '注塑',
field: 'injectionMolding',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '商务',
field: 'business',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '实验室',
field: 'laboratory',
sort: 'custom',
isSearch: false,
table: {
width: 150,
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: 'IT',
field: 'it',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '质量保障部',
field: 'qualityDepartment',
sort: 'custom',
isSearch: false,
table: {
width: 180,
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '物流',
field: 'materialFlow',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '模具前期',
field: 'moldPre',
sort: 'custom',
isSearch: false,
table: {
width: 150,
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
}
},
{
label: '平均分',
field: 'average',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '描述',
field: 'describes',

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

@ -142,8 +142,8 @@
wantId1.value = wantId
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
getDeviceItemList,
Item.allSchemas,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
@ -153,13 +153,11 @@
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: wantId1.value,
locationNumber: locationNumber.value,
itemNumber: element.number,
id: wantId1.value,
locationNumber: locationNumber.value,
itemNumber: element.number,
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
message.success(t('更换成功'))
@ -193,23 +191,6 @@
}
}
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
tableObject.loading = true
try {
const res = await getItemWithOutBind()
let result = {
list: res,
total: res.length
}
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {

8
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -253,7 +253,13 @@ export const MoldMilestone = useCrudSchemas(reactive<CrudSchema[]>([
field: 'milestoneStage',
sort: 'custom',
isSearch: true,
isForm: true
isForm: true,
form: {
component: 'Select',
componentProps: {
disabled: true
}
},
},
{
label: '里程碑日期',

Loading…
Cancel
Save