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. 175
      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>) => { export const replaceLocation = async (data: Array<ItemAccountsVO>) => {
return await request.post({url: `/eam/item-accounts/replaceLocation `, data }); 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'}" :style="{height:'600px'}"
> >
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" :key="dialogFormKey"> <el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" :key="dialogFormKey">
<el-form-item label="文件上传"> <el-form-item label="文件选择">
<UploadFile v-model="fileDialogUploadData.filePathList" :limit="20" /> <UploadFile v-model="fileDialogUploadData.filePathList" :limit="20" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button type="primary" @click="dialogUploadFile">点击修改</el-button> <el-button type="primary" @click="dialogUploadFile">提交</el-button>
</Dialog> </Dialog>
<!-- dialog表单弹窗添加/修改 --> <!-- dialog表单弹窗添加/修改 -->
<BasicForm <BasicForm
@ -896,6 +896,15 @@ const buttonMilestoneClick = async (val, row) => {
} }
const submitDialogForm = async (type, 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) await props.diaLogApiUpdate(row)
dialogFormRef.value.dialogVisible = false dialogFormRef.value.dialogVisible = false
await getList() await getList()
@ -936,6 +945,7 @@ function dialogUploadFile() {
props.uploadImage(data).then((res) => { props.uploadImage(data).then((res) => {
message.success('修改成功') message.success('修改成功')
getImage() 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 searchTableRef = ref()
/** 绑定备件操作 */ /** 绑定备件操作 */
const openItem = async (number : String) => { const openItem = async (number : String) => {

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

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

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

@ -3,8 +3,36 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const DeviceInternalAuditRules = reactive({ export const DeviceInternalAuditRules = reactive({
number: [required], personer: [
personer: [required], { 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[]>([ export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
@ -19,7 +47,7 @@ export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'left' fixed: 'left'
}, },
}, },
{ {
label: '人员', label: '人员',
field: 'personer', field: 'personer',
@ -30,92 +58,207 @@ export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
label: '装配', label: '装配',
field: 'fitOut', field: 'fitOut',
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '涂装', label: '涂装',
field: 'coating', field: 'coating',
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '注塑', label: '注塑',
field: 'injectionMolding', field: 'injectionMolding',
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '商务', label: '商务',
field: 'business', field: 'business',
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '实验室', label: '实验室',
field: 'laboratory', field: 'laboratory',
sort: 'custom', sort: 'custom',
isSearch: false,
table: { table: {
width: 150, width: 150
}, },
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: 'IT', label: 'IT',
field: 'it', field: 'it',
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '质量保障部', label: '质量保障部',
field: 'qualityDepartment', field: 'qualityDepartment',
sort: 'custom', sort: 'custom',
isSearch: false,
table: { table: {
width: 180, width: 150
}, },
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '物流', label: '物流',
field: 'materialFlow', field: 'materialFlow',
sort: 'custom', sort: 'custom',
isSearch: false, table: {
width: 150
},
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: {
min: 0,
max: 200,
precision: 0
}
},
tableForm: {
type: 'InputNumber',
min: 0,
max: 200,
precision: 0
} }
}, },
{ {
label: '模具前期', label: '模具前期',
field: 'moldPre', field: 'moldPre',
sort: 'custom', sort: 'custom',
isSearch: false,
table: { table: {
width: 150, width: 150
}, },
form: { form: {
component: 'InputNumber', 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: '描述', label: '描述',
field: 'describes', field: 'describes',
@ -166,7 +309,7 @@ export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false, isForm: false,
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -142,8 +142,8 @@
wantId1.value = wantId wantId1.value = wantId
searchTableRef.value.open( searchTableRef.value.open(
'选择备件', '选择备件',
Item.allSchemas, Item.allSchemas,
getDeviceItemList, ItemApi.getItemPage,
null, null,
Item.allSchemas.searchSchema, Item.allSchemas.searchSchema,
true, true,
@ -153,13 +153,11 @@
null null
) )
} }
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => { const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({ const deviceItemRelList = selections.map((element) => ({
id: wantId1.value, id: wantId1.value,
locationNumber: locationNumber.value, locationNumber: locationNumber.value,
itemNumber: element.number, itemNumber: element.number,
})) }))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => { ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
message.success(t('更换成功')) 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 basicFormRef = ref()
const openForm = (type : string, row ?: any) => { 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', field: 'milestoneStage',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: true isForm: true,
form: {
component: 'Select',
componentProps: {
disabled: true
}
},
}, },
{ {
label: '里程碑日期', label: '里程碑日期',

Loading…
Cancel
Save