|
@ -124,6 +124,32 @@ |
|
|
</template> |
|
|
</template> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
|
|
|
|
|
|
|
|
|
<Dialog |
|
|
|
|
|
title="照片上传" |
|
|
|
|
|
v-model="dialogUploadVisible" |
|
|
|
|
|
:width="600" |
|
|
|
|
|
:maxHeight="900" |
|
|
|
|
|
:style="{height:'600px'}" |
|
|
|
|
|
:key="dialogFormKey" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" > |
|
|
|
|
|
<el-form-item label=""> |
|
|
|
|
|
<UploadImgs v-model="fileDialogUploadData.filePathList" :limit="20" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<el-button type="primary" @click="dialogUploadFile">提交</el-button> |
|
|
|
|
|
</Dialog> |
|
|
|
|
|
|
|
|
|
|
|
<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> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -141,6 +167,8 @@ import { useUserStore } from '@/store/modules/user' |
|
|
import * as UserApi from '@/api/system/user' |
|
|
import * as UserApi from '@/api/system/user' |
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
import * as uploadApi from '@/api/eam/upload' |
|
|
|
|
|
import * as fileApi from '@/api/infra/file' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'DeviceMaintainOrderMain' }) |
|
|
defineOptions({ name: 'DeviceMaintainOrderMain' }) |
|
@ -155,6 +183,7 @@ const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
const dialogVisible = ref(false) |
|
|
const dialogVisible = ref(false) |
|
|
const dialogRowData = ref() |
|
|
const dialogRowData = ref() |
|
|
|
|
|
const dialogUploadVisible = ref(false) |
|
|
const updateFormValue = ref({ |
|
|
const updateFormValue = ref({ |
|
|
verifyContent:'' |
|
|
verifyContent:'' |
|
|
}) |
|
|
}) |
|
@ -164,6 +193,15 @@ const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAcces |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
|
} |
|
|
} |
|
|
|
|
|
const fileDialogUploadData = ref({ |
|
|
|
|
|
filePathList: [] |
|
|
|
|
|
}) |
|
|
|
|
|
const dialogUploadNumber = ref() |
|
|
|
|
|
const dialogFormKey = ref(0) |
|
|
|
|
|
const showView = ref(false) |
|
|
|
|
|
const viewTitle = ref('图片预览') |
|
|
|
|
|
const urls = ref([]) |
|
|
|
|
|
const viewKey = ref(0) |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -280,8 +318,14 @@ const butttondata = (row) => { |
|
|
defaultButtons.orderPrintBtn({ |
|
|
defaultButtons.orderPrintBtn({ |
|
|
hasPermi:'eam:device-maintain-job-main:print', |
|
|
hasPermi:'eam:device-maintain-job-main:print', |
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED')) |
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED')) |
|
|
}) // 打印 |
|
|
}), // 打印 |
|
|
|
|
|
defaultButtons.uploadImgsBtn({ |
|
|
|
|
|
hasPermi: 'eam:device-maintain-job-main:upload', |
|
|
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) |
|
|
|
|
|
}), //上传 |
|
|
|
|
|
defaultButtons.pictureBtn({ |
|
|
|
|
|
hide: !(row.filePathList != null && row.filePathList.length > 0 && row.status != 'PECEIVED') |
|
|
|
|
|
}) // 预览报修图片 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
const onChange = (field, cur, item) => { |
|
|
const onChange = (field, cur, item) => { |
|
@ -313,6 +357,12 @@ const buttonTableClick = async (val, row) => { |
|
|
finishOrder(row) |
|
|
finishOrder(row) |
|
|
} else if (val == 'orderPrint') { |
|
|
} else if (val == 'orderPrint') { |
|
|
orderPrint(row) |
|
|
orderPrint(row) |
|
|
|
|
|
} else if (val == 'uploadImgs') { |
|
|
|
|
|
openDialogUpload(row) |
|
|
|
|
|
} else if (val == 'picture') { |
|
|
|
|
|
showView.value = true |
|
|
|
|
|
urls.value = row.filePathList |
|
|
|
|
|
viewKey.value += 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -654,6 +704,55 @@ const onSubmit = () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const openDialogUpload = (row) => { |
|
|
|
|
|
dialogUploadNumber.value = row.number |
|
|
|
|
|
uploadApi.getImage({ |
|
|
|
|
|
number: row.number, |
|
|
|
|
|
funcCode: "maintenance" |
|
|
|
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
fileApi.selectList().then(response=>{ |
|
|
|
|
|
fileDialogUploadData.value.filePathList = res.map(item=>{ |
|
|
|
|
|
response.forEach(element=>{ |
|
|
|
|
|
if(item.url == element.url){ |
|
|
|
|
|
item.name = element.name |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return item |
|
|
|
|
|
}) |
|
|
|
|
|
dialogUploadVisible.value = true |
|
|
|
|
|
dialogFormKey.value += 1 |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function dialogUploadFile() { |
|
|
|
|
|
let data = { |
|
|
|
|
|
number: dialogUploadNumber.value, |
|
|
|
|
|
fileInfoList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList:[], |
|
|
|
|
|
funcCode: "maintenance", |
|
|
|
|
|
} |
|
|
|
|
|
uploadApi.uploadImage(data).then((res) => { |
|
|
|
|
|
message.success(t('common.submitSuccess')) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getImage = () => { |
|
|
|
|
|
uploadApi.getImage({ |
|
|
|
|
|
number: dialogUploadNumber.value, |
|
|
|
|
|
funcCode: "maintenance", |
|
|
|
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
fileDialogUploadData.value.filePathList = res |
|
|
|
|
|
dialogFormKey.value += 1 |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const orderPrint = (row) => { |
|
|
const orderPrint = (row) => { |
|
|
window.open(src.value + "&id=" + row.id) |
|
|
window.open(src.value + "&id=" + row.id) |
|
|
} |
|
|
} |
|
|