Browse Source

备件易损件更换指导书

master
zhang_li 8 months ago
parent
commit
f114197761
  1. 1
      src/components/UploadFile/src/UploadImg.vue
  2. 11
      src/views/eam/device/problemSolving/index.vue
  3. 11
      src/views/eam/item/replaceItemDes/index.vue
  4. 17
      src/views/eam/item/replaceItemDes/replaceItemDes.data.ts

1
src/components/UploadFile/src/UploadImg.vue

@ -84,6 +84,7 @@ const props = defineProps({
width: propTypes.string.def('150px'), // ==> 150px width: propTypes.string.def('150px'), // ==> 150px
borderradius: propTypes.string.def('8px') // ==> 8px borderradius: propTypes.string.def('8px') // ==> 8px
}) })
debugger
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
// id // id

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

@ -176,17 +176,6 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
var isHave = ProblemSolving.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
data.filePathList = [] data.filePathList = []
for (let i = 0; i < data.filePathListView.length; i++) { for (let i = 0; i < data.filePathListView.length; i++) {
data.filePathList.push(data.filePathListView[i].url) data.filePathList.push(data.filePathListView[i].url)

11
src/views/eam/item/replaceItemDes/index.vue

@ -124,13 +124,20 @@
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type : string, row ?: any) => { const openForm = (type : string, row ?: any) => {
if (row&&row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name: item,
url: item
}
})
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form // form
const formsSuccess = async (formType, data) => { const formsSuccess = async (formType, data) => {
if (data.expireTime == 0) data.expireTime = null; data.filePathList = data.filePathListView.map(item=>item.url)
data.filePathList = data.filePathList.map(item=>item.url)
if (formType === 'create') { if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data) await ReplaceItemDesApi.createReplaceItemDes(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

17
src/views/eam/item/replaceItemDes/replaceItemDes.data.ts

@ -7,7 +7,7 @@ import * as ItemApi from '@/api/eam/basic/item'
// 表单校验 // 表单校验
export const ReplaceItemDesRules = reactive({ export const ReplaceItemDesRules = reactive({
number: [required], number: [required],
filePathList: [required], filePathListView: [required],
}) })
export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([ export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([
@ -34,16 +34,31 @@ export const ReplaceItemDes = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '文件',
field: 'filePathListView',
sort: 'custom',
isTable: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},
{ {
label: '文件', label: '文件',
field: 'filePathList', field: 'filePathList',
sort: 'custom', sort: 'custom',
isTable: false, isTable: false,
isForm: false,
table: { table: {
}, },
form: { form: {
component: 'UploadFile', component: 'UploadFile',
componentProps: { componentProps: {
} }
} }
}, },

Loading…
Cancel
Save