Browse Source

保养子工单添加人数和预计完成时间提交前解决冲突并固定资产代码

master
ljlong_2630 9 months ago
parent
commit
f1b61347a4
  1. 61
      src/api/eam/basic/fixedAssets/index.ts
  2. 59
      src/api/eam/device/deviceInternalAudit/index.ts
  3. 1
      src/api/eam/device/deviceMaintenanceMain/index.ts
  4. 1
      src/api/eam/device/deviceRepair/index.ts
  5. 2
      src/components/BasicForm/src/BasicForm.vue
  6. 1
      src/components/Detail/src/DetailDeviceLedger.vue
  7. 20
      src/components/UploadFile/src/UploadFile.vue
  8. 2
      src/utils/dict.ts
  9. 30
      src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts
  10. 108
      src/views/eam/basic/fixedAssets/fixedAssets.data.ts
  11. 244
      src/views/eam/basic/fixedAssets/index.vue
  12. 13
      src/views/eam/basic/item/item.data.ts
  13. 20
      src/views/eam/basic/location/location.data.ts
  14. 7
      src/views/eam/basic/locationArea/locationArea.data.ts
  15. 14
      src/views/eam/basic/supplier/supplier.data.ts
  16. 179
      src/views/eam/device/deviceInternalAudit/deviceInternalAudit.data.ts
  17. 244
      src/views/eam/device/deviceInternalAudit/index.vue
  18. 37
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  19. 2
      src/views/eam/device/deviceRepair/index.vue
  20. 31
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  21. 9
      src/views/eam/device/problemSolving/index.vue
  22. 3
      src/views/eam/device/problemSolving/problemSolving.data.ts
  23. 3
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  24. 125
      src/views/eam/item/itemOrderMain/itemOrderMain.data.ts
  25. 39
      src/views/eam/mold/moldRepair/index.vue
  26. 25
      src/views/eam/mold/moldmaintenancejob/index.vue

61
src/api/eam/basic/fixedAssets/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface FixedAssetsVO {
number: string
name: string
accountingUnit: string
specifications: string
locationNumber: string
purchaseDate: Date
purchaseDept: string
supplierNumber: string
productionDate: Date
purchasePrice: number
manageDept: string
unit: string
qty: number
siteId: string
available: string
concurrencyStamp: number
}
// 查询固定资产列表
export const getFixedAssetsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/fixed-assets/senior', data })
} else {
return await request.get({ url: `/eam/fixed-assets/page`, params })
}
}
// 查询固定资产详情
export const getFixedAssets = async (id: number) => {
return await request.get({ url: `/eam/fixed-assets/get?id=` + id })
}
// 新增固定资产
export const createFixedAssets = async (data: FixedAssetsVO) => {
return await request.post({ url: `/eam/fixed-assets/create`, data })
}
// 修改固定资产
export const updateFixedAssets = async (data: FixedAssetsVO) => {
return await request.put({ url: `/eam/fixed-assets/update`, data })
}
// 删除固定资产
export const deleteFixedAssets = async (id: number) => {
return await request.delete({ url: `/eam/fixed-assets/delete?id=` + id })
}
// 导出固定资产 Excel
export const exportFixedAssets = async (params) => {
return await request.download({ url: `/eam/fixed-assets/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/fixed-assets/get-import-template' })
}

59
src/api/eam/device/deviceInternalAudit/index.ts

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface DeviceInternalAuditVO {
id: number
number: string
describes: string
personer: string
fitOut: number
coating: number
injectionMolding: number
business: number
laboratory: number
it: number
qualityDepartment: number
materialFlow: number
moldPre: number
available: string
}
// 查询设备内审业务说明列表
export const getDeviceInternalAuditPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/device-internal-audit/senior', data })
} else {
return await request.get({ url: `/eam/device-internal-audit/page`, params })
}
}
// 查询设备内审业务说明详情
export const getDeviceInternalAudit = async (id: number) => {
return await request.get({ url: `/eam/device-internal-audit/get?id=` + id })
}
// 新增设备内审业务说明
export const createDeviceInternalAudit = async (data: DeviceInternalAuditVO) => {
return await request.post({ url: `/eam/device-internal-audit/create`, data })
}
// 修改设备内审业务说明
export const updateDeviceInternalAudit = async (data: DeviceInternalAuditVO) => {
return await request.put({ url: `/eam/device-internal-audit/update`, data })
}
// 删除设备内审业务说明
export const deleteDeviceInternalAudit = async (id: number) => {
return await request.delete({ url: `/eam/device-internal-audit/delete?id=` + id })
}
// 导出设备内审业务说明 Excel
export const exportDeviceInternalAudit = async (params) => {
return await request.download({ url: `/eam/device-internal-audit/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/device-internal-audit/get-import-template' })
}

1
src/api/eam/device/deviceMaintenanceMain/index.ts

@ -18,7 +18,6 @@ export interface DeviceMaintenanceMainVO {
// 查询维修工单主列表
export const getDeviceMaintenanceMainPage = async (params) => {
params.type = 'DEVICE'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

1
src/api/eam/device/deviceRepair/index.ts

@ -17,7 +17,6 @@ export interface DeviceRepairVO {
// 查询报修申请列表
export const getDeviceRepairPage = async (params) => {
params.type = 'DEVICE'
if (params.isSearch) {
delete params.isSearch
const data = { ...params }

2
src/components/BasicForm/src/BasicForm.vue

@ -380,8 +380,10 @@ const open = async (type: string, row?: any, masterParmas?: any) => {
formLoading.value = true
try {
nextTick(() => {
console.log('row11',row)
formRef.value.setValues(row)
})
} finally {
formLoading.value = false
}

1
src/components/Detail/src/DetailDeviceLedger.vue

@ -594,6 +594,7 @@ const getImage = () => {
if (imageParmas.value.funcCode == 'device_mould_picture') {
imageFormData.value.filePathList = res
} else {
console.log(444,res)
fileFormData.value.filePathList = res
formKey.value += 1
}

20
src/components/UploadFile/src/UploadFile.vue

@ -6,7 +6,7 @@
name="file"
v-model="valueRef"
v-model:file-list="fileList"
:show-file-list="true"
:show-file-list="isShowFileList"
:auto-upload="autoUpload"
:action="updateUrl"
:headers="uploadHeaders"
@ -28,6 +28,7 @@
<div style="font-size: 8px;line-height: initial;">
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件
</div>
<Preview1 :fileList="fileList" v-if="!isShowFile"/>
</template>
<template v-if="!isShowFile" #file >
<div>
@ -42,6 +43,7 @@ import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
import { getAccessToken, getTenantId } from '@/utils/auth'
import type { UploadInstance, UploadUserFile, UploadProps, UploadRawFile } from 'element-plus'
import Preview1 from '@/components/UploadFile/src/Preview.vue'
defineOptions({ name: 'UploadFile' })
@ -63,19 +65,25 @@ const props = defineProps({
drag: propTypes.bool.def(false), //
isShowTip: propTypes.bool.def(true), //
isShowFile: propTypes.bool.def(true), //
// isShowFileList: propTypes.bool.def(true), //
})
// ========== ==========
// setTimeout(()=>{
// console.log('props.modelValue',props.modelValue)
// },2000)
const valueRef = ref(props.modelValue)
const uploadRef = ref<UploadInstance>()
const uploadList = ref<UploadUserFile[]>([])
console.log('88',props.modelValue)
const fileList = props.modelValue && props.modelValue.length > 0 ? ref<UploadUserFile[]>(props.modelValue) : ref<UploadUserFile[]>([])
const uploadNumber = ref<number>(0)
const uploadHeaders = ref({
Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId()
})
//
const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
if (fileList.value.length >= props.limit) {
@ -149,6 +157,14 @@ const listToString = (list: UploadUserFile[], separator?: string) => {
}
return strs != '' ? strs.substr(0, strs.length - 1) : ''
}
watch(
() => props.modelValue,
(val) => {
// if (val === unref(colorVal)) return
valueRef.value = val
fileList.value = val && val.length > 0 ?val:[]
}
)
</script>
<style scoped lang="scss">
.upload-file-uploader {

2
src/utils/dict.ts

@ -297,7 +297,7 @@ export enum DICT_TYPE {
DEPT_GROUP = 'dept_group', //部门分组
POWER_RANGE = 'power_range', //功率范围
ADJUST_STATUS = 'adjust_status', //盘点调整状态
APP_DEVICE_MOLD_TYPE = 'app_device_mold_type', //设备/模具/工艺:类型

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

@ -100,7 +100,7 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '保养类型',
label: '保养周期',
field: 'executionCycle',
dictType: DICT_TYPE.EXECUTION_CYCLE,
dictClass: 'string',
@ -110,6 +110,32 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select'
},
},
{
label: '人数',
field: 'peopleNum',
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
form: {
component: 'InputNumber',
}
},
{
label: '保养所需时间(h)',
field: 'maintenanceTime',
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
form: {
component: 'InputNumber',
}
},
{
label: '是否可用',
field: 'available',
@ -144,4 +170,4 @@ export const DeviceMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'right'
}
}
]))
]))

108
src/views/eam/basic/fixedAssets/fixedAssets.data.ts

@ -0,0 +1,108 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const FixedAssetsRules = reactive({
name: [required],
locationNumber: [required],
supplierNumber: [required],
purchasePrice: [required],
qty: [required]
})
export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号唯一标识',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '资产名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '会计单位',
field: 'accountingUnit',
sort: 'custom'
},
{
label: '规格型号',
field: 'specifications',
sort: 'custom'
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true
},
{
label: '购买时间',
field: 'purchaseDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '采购部门',
field: 'purchaseDept',
sort: 'custom'
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom'
},
{
label: '出厂日期',
field: 'productionDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '购买价格',
field: 'purchasePrice',
sort: 'custom'
},
{
label: '管理部门',
field: 'manageDept',
sort: 'custom'
},
{
label: '单位',
field: 'unit',
sort: 'custom'
},
{
label: '数量',
field: 'qty',
sort: 'custom'
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/basic/fixedAssets/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="FixedAssets.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="FixedAssets.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<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"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="FixedAssetsRules"
:formAllSchemas="FixedAssets.allSchemas"
:apiUpdate="FixedAssetsApi.updateFixedAssets"
:apiCreate="FixedAssetsApi.createFixedAssets"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="FixedAssets.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/fixed-assets/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { FixedAssets,FixedAssetsRules } from './fixedAssets.data'
import * as FixedAssetsApi from '@/api/eam/basic/fixedAssets'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'FixedAssets' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(FixedAssets.allSchemas.tableColumns)
//
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: FixedAssetsApi.getFixedAssetsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(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 == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:fixedAssets:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:fixedAssets:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =FixedAssets.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;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await FixedAssetsApi.createFixedAssets(data)
message.success(t('common.createSuccess'))
} else {
await FixedAssetsApi.updateFixedAssets(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicFixedAssets')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await FixedAssetsApi.deleteFixedAssets(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 FixedAssetsApi.exportFixedAssets(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() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await FixedAssetsApi.importTemplate()
})
</script>

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

@ -2,10 +2,10 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const ItemRules = reactive({
number: [required],
name: [required],
uom: [required],
concurrencyStamp: [required],
name: [
{ required: true, message: '请输入备件名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
export const Item = useCrudSchemas(reactive<CrudSchema[]>([
@ -188,6 +188,11 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '描述',
field: 'describes',
sort: 'custom',
},
{
label: '操作',
field: 'action',

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

@ -5,10 +5,14 @@ import { LocationArea } from '../locationArea/locationArea.data'
// 表单校验
export const LocationRules = reactive({
number: [required],
name: [required],
areaNumber: [required],
concurrencyStamp: [required],
name: [
{ required: true, message: '请输入库位名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
areaNumber: [
{ required: true, message: '请选择库区编号', trigger: 'blur' },
],
})
export const Location = useCrudSchemas(reactive<CrudSchema[]>([
@ -58,7 +62,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.LOCATION_AREA_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Select'
},
@ -68,7 +72,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
field: 'isInAccount',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {
@ -93,7 +97,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {
@ -130,4 +134,4 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'right'
}
}
]))
]))

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

@ -3,9 +3,10 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const LocationAreaRules = reactive({
number: [required],
name: [required],
concurrencyStamp: [required],
name: [
{ required: true, message: '请输入库区名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
export const LocationArea = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -2,8 +2,10 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const SupplierRules = reactive({
number: [required],
name: [required],
name: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
@ -28,7 +30,7 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
label: '简称',
field: 'shortName',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '联系人',
@ -39,14 +41,14 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
label: '联系电话',
field: 'phone',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '状态',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {
@ -80,4 +82,4 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'right'
}
}
]))
]))

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

@ -0,0 +1,179 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DeviceInternalAuditRules = reactive({
number: [required],
personer: [required],
})
export const DeviceInternalAudit = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '内审编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '人员',
field: 'personer',
sort: 'custom',
isSearch: false,
},
{
label: '装配',
field: 'fitOut',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
}
},
{
label: '涂装',
field: 'coating',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
}
},
{
label: '注塑',
field: 'injectionMolding',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
}
},
{
label: '商务',
field: 'business',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
}
},
{
label: '实验室',
field: 'laboratory',
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
form: {
component: 'InputNumber',
}
},
{
label: 'IT',
field: 'it',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
}
},
{
label: '质量保障部',
field: 'qualityDepartment',
sort: 'custom',
isSearch: false,
table: {
width: 180,
},
form: {
component: 'InputNumber',
}
},
{
label: '物流',
field: 'materialFlow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
}
},
{
label: '模具前期',
field: 'moldPre',
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
form: {
component: 'InputNumber',
}
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
table: {
width: 150,
},
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/device/deviceInternalAudit/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeviceInternalAudit.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeviceInternalAudit.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<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"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DeviceInternalAuditRules"
:formAllSchemas="DeviceInternalAudit.allSchemas"
:apiUpdate="DeviceInternalAuditApi.updateDeviceInternalAudit"
:apiCreate="DeviceInternalAuditApi.createDeviceInternalAudit"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceInternalAudit.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/record/device-internal-audit/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeviceInternalAudit,DeviceInternalAuditRules } from './deviceInternalAudit.data'
import * as DeviceInternalAuditApi from '@/api/eam/device/deviceInternalAudit'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'DeviceInternalAudit' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceInternalAudit.allSchemas.tableColumns)
//
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: DeviceInternalAuditApi.getDeviceInternalAuditPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({hasPermi:'eam:deviceInternalAudit:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:deviceInternalAudit: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 butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =DeviceInternalAudit.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;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await DeviceInternalAuditApi.createDeviceInternalAudit(data)
message.success(t('common.createSuccess'))
} else {
await DeviceInternalAuditApi.updateDeviceInternalAudit(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceInternalAudit')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceInternalAuditApi.deleteDeviceInternalAudit(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 DeviceInternalAuditApi.exportDeviceInternalAudit(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() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeviceInternalAuditApi.importTemplate()
})
</script>

37
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -2,11 +2,13 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
// 邮箱账号的列表
const factoryList = await selectAllFactoryArea()
const deviceList = ref([]);
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({})
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验
export const DeviceRepairRules = reactive({
number: [required],
@ -110,6 +112,39 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
},
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
},
},
form: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
placeholder: "请选择设备"
}
},
},
{
label: '报修人电话',
field: 'declarerPhone',

2
src/views/eam/device/deviceRepair/index.vue

@ -66,6 +66,7 @@ import { DeviceRepair, DeviceRepairRules } from './deviceRepair.data'
import * as DeviceRepairApi from '@/api/eam/device/deviceRepair'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts'
import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
@ -200,7 +201,6 @@ const formsSuccess = async (formType, data) => {
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.type = 'DEVICE';
data.result = 'PENDING';
data.filePathList = data.upload.map((item: any) => {
return item.url

31
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -5,10 +5,13 @@ import { useUserStore } from '@/store/modules/user'
import { selecUserByType } from '@/api/system/dept'
import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const userStore = useUserStore()
const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 })
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验
export const DeviceMaintenanceMainRules = reactive({
number: [required],
@ -140,19 +143,31 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: '150',
},
isSearch: false,
isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
},
},
form: {
component: 'Select',
componentProps: {
disabled: true,
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
placeholder: "请选择设备"
}
},
search: {
value: 'DEVICE'
}
},
{
label: '班次',

9
src/views/eam/device/problemSolving/index.vue

@ -125,7 +125,14 @@
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
const openForm = (type : string, row ?: any) => {
// console.log(99,row)
row.filePathListView = row.filePathList.map(item=>{
return {
name:item,
url:item
}
})
basicFormRef.value.open(type, row)
}

3
src/views/eam/device/problemSolving/problemSolving.data.ts

@ -45,7 +45,6 @@ export const ProblemSolving = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'UploadFile',
componentProps: {
}
}
},
@ -60,7 +59,7 @@ export const ProblemSolving = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'UploadFile',
componentProps: {
}
}
},

3
src/views/eam/item/itemAccounts/itemAccounts.data.ts

@ -88,7 +88,6 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'itemDO.isConstant',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
@ -119,7 +118,6 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
@ -171,7 +169,6 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'itemDO.isRadeIn',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {

125
src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

@ -16,30 +16,125 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
isSearch: true,
table: {
width: 180,
width: 150,
fixed: 'left'
},
},
{
label: '申领人',
field: 'applyId',
label: '日期',
field: 'date',
sort: 'custom',
isForm: false,
isSearch: false,
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '审批人',
field: 'approveId',
label: '电话',
field: 'phone',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '出库人',
field: 'outId',
label: '传真',
field: 'fax',
sort: 'custom',
isForm: false,
},
{
label: '采购员',
field: 'purchaser',
sort: 'custom',
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom',
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
},
{
label: '供应商地址',
field: 'supplierAddress',
sort: 'custom',
},
{
label: '发货至',
field: 'shipTo',
sort: 'custom',
},
{
label: '开票至',
field: 'invoiceTo',
sort: 'custom',
},
{
label: '联系人',
field: 'contacts',
sort: 'custom',
},
{
label: '联系电话',
field: 'contactsPhone',
sort: 'custom',
},
{
label: '付款方式',
field: 'paymentType',
sort: 'custom',
form: {
component: 'Select'
},
},
{
label: '注册地',
field: 'registLocation',
sort: 'custom',
},
{
label: '开户行',
field: 'bank',
sort: 'custom',
},
{
label: '账号',
field: 'account',
sort: 'custom',
},
{
label: '税号',
field: 'dutyParagraph',
sort: 'custom',
},
{
label: '是否关闭',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '状态',
@ -51,6 +146,12 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: true,
tableForm: {
type: 'Select'
},
form: {
value: 'INCOMPLETE',
componentProps: {
disabled: true,
}
}
},
{

39
src/views/eam/mold/moldRepair/index.vue

@ -19,6 +19,9 @@
<span>{{ row.code }}</span>
</el-button>
</template>
<template #upload="{ row }">
<ButtonBase v-if="row.filePathList != null && row.filePathList.length != 0" :Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
@ -41,6 +44,16 @@
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="MoldRepair.allSchemas" />
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/mold-repair/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
@ -60,6 +73,10 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
routeName.value = route.name
const tableColumns = ref(MoldRepair.allSchemas.tableColumns)
@ -138,13 +155,21 @@ const buttonTableClick = async (val, row) => {
handleDelete(row.id)
} else if (val == 'backout') { //
handleBackout(row)
} else if (val == 'view') { //
openForm('view', row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
@ -160,8 +185,11 @@ const formsSuccess = async (formType, data) => {
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.type = 'DEVICE';
data.type = 'MOLD';
data.result = 'PENDING';
data.filePathList = data.upload.map((item: any) => {
return item.url
})
if (formType === 'create') {
await MoldRepairApi.createMoldRepair(data)
message.success(t('common.createSuccess'))
@ -249,6 +277,13 @@ function handleBackout(row) {
}
// -
const butttondataView = (row) => {
return [
defaultButtons.viewBtn(null),
]
}
/** 初始化 **/
onMounted(async () => {
getList()

25
src/views/eam/mold/moldmaintenancejob/index.vue

@ -91,6 +91,18 @@
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
</template>
<script setup lang="ts">
@ -113,6 +125,10 @@ const userStore = useUserStore() // 用户信息
const route = useRoute() //
const routeName = ref()
const formRef = ref()
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
routeName.value = route.name
const tableColumns = ref(MoldMaintenanceMain.allSchemas.tableColumns)
@ -242,7 +258,10 @@ const butttondata = (row) => {
}), //
defaultButtons.finishOrderBtn({
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}) //
}), //
defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0)
}) //
]
}
const onChange = (field, cur, item) => {
@ -270,6 +289,10 @@ const buttonTableClick = async (val, row) => {
acceptOrder(row)
} else if (val == 'turnOrder') {
openForm('turnOrder', row)
}else if (val == 'picture') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
}
}

Loading…
Cancel
Save