Browse Source

备品备件功能优化

master
ljlong_2630 3 months ago
parent
commit
b3c7a7524b
  1. 4
      src/api/eam/basic/moldInspection/index.ts
  2. 14
      src/views/eam/basic/assetsAccountControlsHistory/assetsAccountControlsHistory.data.ts
  3. 14
      src/views/eam/basic/fixedAssetsControlsHistory/fixedAssetsControlsHistory.data.ts
  4. 13
      src/views/eam/basic/inspection/inspection.data.ts
  5. 7
      src/views/eam/basic/item/index.vue
  6. 42
      src/views/eam/basic/item/item.data.ts
  7. 103
      src/views/eam/basic/moldInspection/index.vue
  8. 16
      src/views/eam/basic/moldInspection/moldInspection.data.ts
  9. 16
      src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts
  10. 10
      src/views/eam/item/itemAccounts/itemAccounts.data.ts

4
src/api/eam/basic/moldInspection/index.ts

@ -51,8 +51,8 @@ export const updateMoldItems = async (data: DeviceMoldItemsVO) => {
}
// 删除项记录表(设备 模具 保养 维修 巡检点检)
export const deleteDeviceMoldItems = async (id: number) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id })
export const deleteDeviceMoldItems = async (id: number, remark: string) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id + `&remark=` + remark })
}
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel

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

@ -114,14 +114,12 @@ export const AssetsAccountControlsHistory = useCrudSchemas(reactive<CrudSchema[]
field: 'user',
sort: 'custom',
},
// {
// label: '状态',
// field: 'status',
// sort: 'custom',
// form: {
// component: 'Radio'
// },
// },
{
label: '状态',
field: 'status',
sort: 'custom',
isForm: false,
},
{
label: '操作时间',
field: 'createTime',

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

@ -118,14 +118,12 @@ export const FixedAssetsControlsHistory = useCrudSchemas(reactive<CrudSchema[]>(
field: 'user',
sort: 'custom',
},
// {
// label: '状态',
// field: 'status',
// sort: 'custom',
// form: {
// component: 'Radio'
// },
// },
{
label: '状态',
field: 'status',
sort: 'custom',
isForm: false,
},
{
label: '操作时间',
field: 'createTime',

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

@ -144,6 +144,19 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '是否点检',
field: 'isNeedInspection',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
// {
// label: '是否可用',
// field: 'available',

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

@ -248,9 +248,10 @@
}
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
data.filePathList = []
for (let i = 0; i < data.filePathListView.length; i++) {
data.filePathList.push(data.filePathListView[i].url)
data.fileInfoList = []
for (let i = 0; i < data.attachmentFileList.length; i++) {
data.filePathList.push(data.attachmentFileList[i].url)
data.fileInfoList.push(data.attachmentFileList[i])
}
if (formType === 'create') {
await ItemApi.createItem(data)

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

@ -134,11 +134,11 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
type: 'Select'
}
},
// {
// label: '单价',
// field: 'singlePrice',
// sort: 'custom',
// },
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
},
{
label: '重采购点',
field: 'reprocurement',
@ -279,25 +279,25 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'upload',
isTable: true,
},
// {
// label: '文件',
// field: 'filePathListView',
// sort: 'custom',
// isTable: false,
// table: {
// },
// form: {
// component: 'UploadFile',
// componentProps: {
// }
// }
// },
{
label: '文件',
field: 'filePathListView',
sort: 'custom',
isTable: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},
{
label: '文件',
field: 'filePathList',
field: 'attachmentFileList',
sort: 'custom',
isTable: false,
isForm: false,
isForm: true,
table: {
},
form: {
@ -312,7 +312,7 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action',
isForm: false,
table: {
width: 180,
width: 200,
fixed: 'right'
}
}

103
src/views/eam/basic/moldInspection/index.vue

@ -52,7 +52,32 @@
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItems.allSchemas" />
<Dialog
ref="updateDialog"
title="本次修改修改描述"
v-model="dialogVisible"
:width="600"
:maxHeight="700"
:style="{height:'450px'}"
:before-close="handleBeforeClose"
>
<el-form :model="updateFormValue" class="demo-form-inline">
<el-form-item label="备注">
<el-input
type="textarea"
v-model="updateFormValue.remark"
placeholder="请对本次修改内容添加备注"
clearable
:rows="12"
/>
</el-form-item>
</el-form>
<template #footer>
<div style="text-align: center;">
<el-button type="primary" @click="onSubmit">提交</el-button>
</div>
</template>
</Dialog>
</template>
<script setup lang="ts">
@ -72,7 +97,15 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeviceMoldItems.allSchemas.tableColumns)
const updateDialog = ref()
const dialogVisible = ref(false)
const updateData = ref()
const updateFormValue = reactive({
remark: '',
})
const openDataOld = ref()
const openDataNew = ref()
const operatType = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
@ -134,8 +167,11 @@ const butttondata = [
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
operatType.value = 'edit'
openForm('update', row)
} else if (val == 'delete') { //
operatType.value = 'delete'
updateData.value = row
handleDelete(row.id)
}
}
@ -143,6 +179,8 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
openDataOld.value = row
updateFormValue.remark = ''
basicFormRef.value.open(type, row)
}
@ -163,8 +201,14 @@ const formsSuccess = async (formType,data) => {
await DeviceMoldItemsApi.creatMoldItems(data)
message.success(t('common.createSuccess'))
} else {
await DeviceMoldItemsApi.updateMoldItems(data)
message.success(t('common.updateSuccess'))
openDataNew.value = data
if(judgeSame()){
basicFormRef.value.dialogVisible = false
getList()
}else{
updateData.value = data
dialogVisible.value = true
}
}
basicFormRef.value.dialogVisible = false
getList()
@ -181,11 +225,8 @@ const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeviceMoldItemsApi.deleteDeviceMoldItems(id)
message.success(t('common.delSuccess'))
//
await getList()
dialogVisible.value = true
} catch {}
}
@ -230,6 +271,50 @@ const searchFormClick = (searchData) => {
getList() //
}
const onSubmit = async () => {
console.log('submit!');
updateData.value.remark = updateFormValue.remark
try {
if(operatType.value == 'edit'){
await DeviceMoldItemsApi.updateMoldItems(updateData.value);
message.success(t('common.updateSuccess'));
// ""
basicFormRef.value.dialogVisible = false; // basicFormRef
dialogVisible.value = false; // updateDialog
}else if(operatType.value == 'delete'){
//
await DeviceMoldItemsApi.deleteDeviceMoldItems(updateData.value.id,updateData.value.remark)
message.success(t('common.delSuccess'))
dialogVisible.value = false;
}
//
await getList()
} catch (error) {
console.error(error);
// basicFormRef
// updateDialog
message.error(t('common.updateFailed'));
}
};
const handleBeforeClose = async(done)=>{
basicFormRef.value.formLoading = false
done()
}
//
const judgeSame = () => {
// openDataOld.value
const keys = Object.keys(openDataOld.value);
// 使every()
const isSame = keys.every(key => {
// openDataNew.value
return openDataNew.value.hasOwnProperty(key) && openDataOld.value[key] === openDataNew.value[key];
});
//
return isSame;
};
/** 初始化 **/
onMounted(async () => {
getList()

16
src/views/eam/basic/moldInspection/moldInspection.data.ts

@ -76,7 +76,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
label: '模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: false,
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
@ -143,7 +143,19 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
value: false,
}
},
{
label: '是否点检',
field: 'isNeedInspection',
sort: 'custom',
isSearch: false,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueOrFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value: false,
}
},
// {
// label: '是否可用',
// field: 'available',

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

@ -182,6 +182,22 @@ export const MoldMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '保养所需时间(分钟)',
field: 'estimatedMinutes',
sort: 'custom',
isSearch: false,
table: {
width: 200,
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 0
}
},
},
// {
// label: '是否可用',
// field: 'available',

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

@ -59,6 +59,16 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
width: 110
},
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
},
{
label: '总价',
field: 'totalPrice',
sort: 'custom',
},
{
label: '是否账内库',
field: 'isInAccount',

Loading…
Cancel
Save