ljlong_2630 3 months ago
parent
commit
37c335db3e
  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. 2
      src/views/eam/basic/taskLog/index.vue
  11. 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) => { export const deleteDeviceMoldItems = async (id: number, remark: string) => {
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id }) return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id + `&remark=` + remark })
} }
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel // 导出项记录表(设备 模具 保养 维修 巡检点检) Excel

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

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

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

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

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

@ -248,9 +248,10 @@
} }
if (data.activeTime == 0) data.activeTime = null if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null if (data.expireTime == 0) data.expireTime = null
data.filePathList = [] data.fileInfoList = []
for (let i = 0; i < data.filePathListView.length; i++) { for (let i = 0; i < data.attachmentFileList.length; i++) {
data.filePathList.push(data.filePathListView[i].url) data.filePathList.push(data.attachmentFileList[i].url)
data.fileInfoList.push(data.attachmentFileList[i])
} }
if (formType === 'create') { if (formType === 'create') {
await ItemApi.createItem(data) 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' type: 'Select'
} }
}, },
// { {
// label: '单价', label: '单价',
// field: 'singlePrice', field: 'singlePrice',
// sort: 'custom', sort: 'custom',
// }, },
{ {
label: '重采购点', label: '重采购点',
field: 'reprocurement', field: 'reprocurement',
@ -279,25 +279,25 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'upload', field: 'upload',
isTable: true, isTable: true,
}, },
// {
// label: '文件',
// field: 'filePathListView',
// sort: 'custom',
// isTable: false,
// table: {
// },
// form: {
// component: 'UploadFile',
// componentProps: {
// }
// }
// },
{ {
label: '文件', label: '文件',
field: 'filePathListView', field: 'attachmentFileList',
sort: 'custom',
isTable: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},
{
label: '文件',
field: 'filePathList',
sort: 'custom', sort: 'custom',
isTable: false, isTable: false,
isForm: false, isForm: true,
table: { table: {
}, },
form: { form: {
@ -312,7 +312,7 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 180, width: 200,
fixed: 'right' fixed: 'right'
} }
} }

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

@ -52,7 +52,32 @@
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItems.allSchemas" /> <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> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -72,7 +97,15 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DeviceMoldItems.allSchemas.tableColumns) 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) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
@ -134,8 +167,11 @@ const butttondata = [
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
operatType.value = 'edit'
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
operatType.value = 'delete'
updateData.value = row
handleDelete(row.id) handleDelete(row.id)
} }
} }
@ -143,6 +179,8 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
openDataOld.value = row
updateFormValue.remark = ''
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -163,8 +201,14 @@ const formsSuccess = async (formType,data) => {
await DeviceMoldItemsApi.creatMoldItems(data) await DeviceMoldItemsApi.creatMoldItems(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await DeviceMoldItemsApi.updateMoldItems(data) openDataNew.value = data
message.success(t('common.updateSuccess')) if(judgeSame()){
basicFormRef.value.dialogVisible = false
getList()
}else{
updateData.value = data
dialogVisible.value = true
}
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
@ -181,11 +225,8 @@ const handleDelete = async (id: number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
// dialogVisible.value = true
await DeviceMoldItemsApi.deleteDeviceMoldItems(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {} } catch {}
} }
@ -230,6 +271,50 @@ const searchFormClick = (searchData) => {
getList() // 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 () => { onMounted(async () => {
getList() getList()

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

@ -76,7 +76,7 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
label: '模具编号', label: '模具编号',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: true,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
@ -143,7 +143,19 @@ export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([
value: false, 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: '是否可用', // label: '是否可用',
// field: 'available', // 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: '是否可用', // label: '是否可用',
// field: 'available', // field: 'available',

2
src/views/eam/basic/taskLog/index.vue

@ -100,7 +100,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:task-log:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'eam:task-log:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:task-log:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'eam:task-log:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:task-log:export'}), // // defaultButtons.defaultExportBtn({hasPermi:'eam:task-log:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //

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

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

Loading…
Cancel
Save