bug问题修复

This commit is contained in:
BianLzhaoMin 2024-12-31 14:53:40 +08:00
parent 300efe9835
commit 560ec46b02
11 changed files with 561 additions and 395 deletions

2
components.d.ts vendored
View File

@ -29,7 +29,6 @@ declare module 'vue' {
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
@ -37,7 +36,6 @@ declare module 'vue' {
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElProgress: typeof import('element-plus/es')['ElProgress']

4
env/.env.dev vendored
View File

@ -9,8 +9,8 @@ VITE_API_URL = '/proxyApi'
# VITE_proxyTarget = 'http://192.168.2.246:28080' # 马帅
# VITE_proxyTarget = 'http://192.168.2.122:28080' # 梁超
# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务
VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务
VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试服务
# VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务
# VITE_proxyTarget = 'http://192.168.2.75:28080' # 盛旭
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)

View File

@ -221,6 +221,7 @@ const beforeUpload = (file: any) => {
console.log(props.minLimit, '个数---')
const { name = '', size } = file
if (size > props.maxSize * 1024 * 1000) {
ElMessage({
type: 'warning',
@ -247,6 +248,13 @@ const beforeUpload = (file: any) => {
})
return false
}
const newFile = new File([file], file.name.replace(/#/g, '_'), {
type: file.type,
lastModified: file.lastModified,
})
return newFile
}
const handleExceed = (files: any, fileList: any) => {
ElMessage({

View File

@ -179,11 +179,10 @@
<div class="checkbox-container">
<el-checkbox v-model="item.protocolChecked">
我已阅读并同意签署
<a @click.stop="handleViewWord(index)">
{{ item.companyPersonPhoneKey.companyName }}租赁服务合同
</a>
</el-checkbox>
<a @click.stop="handleViewWord(index)">
{{ item.companyPersonPhoneKey.companyName }}租赁服务合同
</a>
</div>
</el-col>
</el-row>
@ -904,4 +903,14 @@ getReceiptGoodsAddress()
width: 100%;
height: 500px;
}
.checkbox-container {
display: flex;
align-items: center;
}
.checkbox-container a {
color: #ff4800;
text-decoration: underline;
cursor: pointer;
}
</style>

View File

@ -29,29 +29,32 @@ const selectOptionsValue = ref<string>('分类筛选')
const loopList = ref([swiper_2, swiper_4, swiper_3])
getCompanyList()
// getCompanyList()
// getGoodsClassList()
// if (userStore.companyList.length === 0) {
// getCompanyList()
// companyList.value = userStore.companyList
// } else {
// companyList.value = userStore.companyList
// }
if (userStore.goodsClassList.length === 0) {
getGoodsClassList().then(() => {
classList.value = userStore.goodsClassList
})
} else {
classList.value = userStore.goodsClassList
}
// //
// const getCompanyListData = async () => {
// const res: any = await getCompanyListApi()
// companyList.value = res.data
// console.log('res', res)
// if (userStore.goodsClassList.length === 0) {
// getGoodsClassList().then(() => {
// classList.value = userStore.goodsClassList
// })
// } else {
// classList.value = userStore.goodsClassList
// }
// getCompanyListData()
// //
const getCompanyListData = async () => {
const res: any = await getCompanyListApi()
const result: any = await getGoodsClassListApi()
companyList.value = res.data
classList.value = result.data
// console.log('res', res)
}
getCompanyListData()
//
const onSharedHall = (level: number, typeId: any, name: any) => {

View File

@ -189,8 +189,10 @@
<div class="checkbox-container">
<el-checkbox v-model="protocolChecked">
我已阅读并同意签署
<a href="#"> xxxx公司租赁服务合同 </a>
</el-checkbox>
<a @click.stop="handleViewWord()">
{{ orderList[0]?.companyName }}公司租赁服务合同
</a>
</div>
</el-col>
<el-col :span="3">
@ -222,6 +224,30 @@
</div>
</div>
<FooterInfo />
<!-- 租赁协议 -->
<el-dialog
v-model="dialogFormVisibleSettleWord"
:title="settleWordTitle"
width="50%"
align-center
destroy-on-close
:close-on-click-modal="false"
>
<!-- <div style="display: flex; justify-content: center"> -->
<!-- <img src="@/assets/img/zuLin.png" style="width: 100%; height: 600px" /> -->
<!-- </div> -->
<div v-html="bookCarAgreement"></div>
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
<span class="dialog-footer">
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
> </el-button
>
<el-button @click="submitBtn" type="success"> 下载 </el-button>
</span>
</div>
<div id="mmm" style="height: 600px"></div>
</el-dialog>
</div>
</template>
@ -230,12 +256,15 @@ import Header from '../../components/header/index.vue'
import FooterInfo from '../../components/FooterInfo/index.vue'
import { ElMessage } from 'element-plus'
import { getBookCarDetailByMaId, submitBookCarApi } from '../../http/api/order/index'
import { getBookCarAgreementApi } from 'http/api/cart/index'
import CustomDatePickerButton from '../cart/components/date-picker-button.vue'
import { getAddressListApi } from 'http/api/address-manage/index'
import { getDetail } from 'http/api/equip'
import moment from 'moment'
import { useRoute, useRouter } from 'vue-router'
import { useStore } from '../../store/user'
import jsPreviewDocx from '@js-preview/docx'
import '@js-preview/docx/lib/index.css'
const userStore = useStore()
const router = useRouter()
const route = useRoute()
@ -480,6 +509,68 @@ const onSelectAddress = (address: any) => {
}
getReceiptGoodsAddress()
const wordUrl = ref()
const dialogFormVisibleSettleWord = ref(false)
const settleWordTitle = ref('')
//
const handleViewWord = async (index: any) => {
//
const { companyName, companyId, personPhone } = orderList.value[0]
let cost = 0
let detailsList: any = []
if (orderList.value[0].days < 1) {
ElMessage({
showClose: false,
message: '请选择租期',
type: 'error',
})
return
}
orderList.value.map((e: any) => {
detailsList.push({
rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
rentEndTime: e.rentEndTime + ' ' + '23:59:59',
manageType: e.manageType,
days: e.days,
num: e.num,
costs: e.num * e.days * e.dayLeasePrice,
deviceName: e.deviceName,
dayLeasePrice: e.dayLeasePrice,
})
cost = cost + e.num * e.days * e.dayLeasePrice
})
const queryParams = {
companyName: localStorage.getItem('currentCompanyName'),
czcompanyName: companyName,
companyId,
cost,
detailsList,
personPhone,
}
console.log('查询参数', queryParams)
const res: any = await getBookCarAgreementApi(queryParams)
wordUrl.value = res.data.url
dialogFormVisibleSettleWord.value = true
settleWordTitle.value = '租赁服务合同'
setTimeout(() => {
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
//
myDocxPreviewer
.preview(wordUrl.value)
.then((res) => {})
.catch((e) => {})
}, 1000)
}
// Word
const submitBtn = () => {
window.location.href = wordUrl.value
}
</script>
<style lang="scss" scoped>
@ -589,10 +680,17 @@ getReceiptGoodsAddress()
background: #fff;
padding: 8px 12px;
margin: 10px;
// font-size: 13px;
.checkbox-container {
display: flex;
align-items: center;
}
.checkbox-container a {
color: #ff4800;
text-decoration: underline;
cursor: pointer;
}
}
}

View File

@ -173,6 +173,8 @@
@getList="getLeaseListData"
:pageSize="searchParams.pageSize"
:pageNumber="searchParams.pageNum"
v-model:page-num="searchParams.pageNum"
v-model:page-size="searchParams.pageSize"
:total="total"
/>
@ -416,8 +418,8 @@ const searchParams = reactive({
finishEndTime: '',
orderStartTime: '',
orderEndTime: '',
pageSize: 1,
pageNum: 10,
pageSize: 10,
pageNum: 1,
})
const addOrEditForm = ref<any>({
leaseName: '',

View File

@ -60,8 +60,16 @@
<el-button class="primary-lease" type="primary" @click="addContract"
>合同新建</el-button
>
<a href="/contract-template.docx" download="安徽省机械化装备共享平台-协议模板" >
<el-button class="primary-lease" type="primary" style="margin-left:20px">模板下载</el-button>
<a
href="/contract-template.docx"
download="安徽省机械化装备共享平台-协议模板"
>
<el-button
class="primary-lease"
type="primary"
style="margin-left: 20px"
>模板下载</el-button
>
</a>
</el-form-item>
</el-col>
@ -98,7 +106,7 @@
<el-table-column align="center" prop="qcTime" label="合同附件">
<template #default="{ row }">
<a
:href="row.bmFileInfoList.length>0 ? row.bmFileInfoList[0].fileUrl:null"
:href="row.bmFileInfoList.length > 0 ? row.bmFileInfoList[0].fileUrl : null"
target="_blank"
style="color: #00a288; text-decoration: underline"
>查看</a
@ -237,87 +245,87 @@
</div>
</template>
</el-dialog> -->
<!-- 新增和修改弹框 -->
<el-dialog
v-model="dialogVisibleSettlein"
:title="settleinTitle"
width="40%"
destroy-on-close
class="centered-dialog"
:close-on-click-modal="false"
@close="onDialogClose"
<!-- 新增和修改弹框 -->
<el-dialog
v-model="dialogVisibleSettlein"
:title="settleinTitle"
width="40%"
destroy-on-close
class="centered-dialog"
:close-on-click-modal="false"
@close="onDialogClose"
>
<el-form
label-width="140px"
ref="addAndEditFormRef"
label-position="right"
:model="addAndEditForm"
:rules="addAndEditFormRules"
>
<el-form
label-width="140px"
ref="addAndEditFormRef"
label-position="right"
:model="addAndEditForm"
:rules="addAndEditFormRules"
>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="合同模板名称:" prop="contractName">
<el-input
autocomplete="off"
style="width: 850px"
maxlength="30"
v-model="addAndEditForm.contractName"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="1" style="margin-bottom: 0" class="upload-tip">
支持格式word.单个文件大小不能超过2M最多可上传1张
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" >
<el-col :span="24">
<el-form-item label="附件" prop="fileInfoList">
<div style="flex: 1">
<UploadComponentNewTwo
:maxSize="10"
:max-limit="1"
width="100%"
height="100%"
:multiple="true"
:autoUpload="true"
:minLimit="addAndEditForm.fileInfoList.length"
:actionUrl="uploadUrl"
listType="text"
:justifyContent="`flex-start`"
@onFileChange="onFileChange"
:acceptTypeList="['.doc','.docx' ]"
>
<template v-slot:default>
<!-- <el-icon size="48" color="#aaa"><Plus /></el-icon> -->
<el-button
:icon="UploadFilled"
type="primary"
class="primary-lease"
>上传文件</el-button
>
</template>
</UploadComponentNewTwo>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" class="primary-lease" @click="onCancel"
>取消</el-button
>
<el-button class="primary-lease" type="primary" @click="onSubmit()">
提交
</el-button>
</div>
</template>
</el-dialog>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="合同模板名称:" prop="contractName">
<el-input
autocomplete="off"
style="width: 850px"
maxlength="30"
v-model="addAndEditForm.contractName"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="1" style="margin-bottom: 0" class="upload-tip">
支持格式word.单个文件大小不能超过2M最多可上传1个
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="附件" prop="fileInfoList">
<div style="flex: 1">
<UploadComponentNewTwo
:maxSize="2"
:max-limit="1"
width="100%"
height="100%"
:multiple="true"
:autoUpload="true"
:minLimit="addAndEditForm.fileInfoList.length"
:actionUrl="uploadUrl"
listType="text"
:justifyContent="`flex-start`"
@onFileChange="onFileChange"
:acceptTypeList="['.doc', '.docx']"
>
<template v-slot:default>
<!-- <el-icon size="48" color="#aaa"><Plus /></el-icon> -->
<el-button
:icon="UploadFilled"
type="primary"
class="primary-lease"
>上传文件</el-button
>
</template>
</UploadComponentNewTwo>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" class="primary-lease" @click="onCancel"
>取消</el-button
>
<el-button class="primary-lease" type="primary" @click="onSubmit()">
提交
</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@ -460,8 +468,8 @@ const contractList: any = ref([])
//
const addContract = () => {
settleinTitle.value = '合同新建'
dialogVisibleSettlein.value = true;
settleinTitle.value = '合同新建'
dialogVisibleSettlein.value = true
}
const handleSelectChange = (selectedId: number) => {
@ -491,7 +499,7 @@ const handleSelectChange = (selectedId: number) => {
const onContract = (row: any) => {
addAndEditForm.value.id = row.id
addAndEditForm.value.contractName = row.contractName
console.log('2222',addAndEditForm.value.contractName)
console.log('2222', addAndEditForm.value.contractName)
settleinTitle.value = '合同修改'
dialogVisibleSettlein.value = true
}
@ -536,18 +544,18 @@ const onDownload = async (row) => {
try {
const response = await axios.get(row.fileUrl, {
responseType: 'blob',
});
})
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', row.fileName);
document.body.appendChild(link);
link.click();
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a')
link.href = url
link.setAttribute('download', row.fileName)
document.body.appendChild(link)
link.click()
} catch (error) {
ElMessage.error('下载失败,请稍后重试');
ElMessage.error('下载失败,请稍后重试')
}
};
}
//
// const onSubmit = () => {
@ -572,7 +580,6 @@ const onDownload = async (row) => {
// })
// }
const onSubmit = () => {
addAndEditForm.value.fileInfoList = addAndEditForm.value.fileInfoTempList
addAndEditFormRef.value.validate(async (valid: any) => {
@ -621,13 +628,11 @@ const onDelete = async (id: any) => {
}
}
//
const onCancel = () => {
dialogVisibleSettlein.value = false
}
const myQuillEditor = ref()
//

View File

@ -13,7 +13,7 @@ import { useStore } from 'store/user'
const store = useStore()
import { mainStore } from 'store/main'
import { InfoFilled, UploadFilled } from '@element-plus/icons-vue'
import dayjs from 'dayjs';
import dayjs from 'dayjs'
const store2 = mainStore()
const isViewForm = ref(false)
@ -173,15 +173,13 @@ const equipmentDeployment = () => {
examinationPdf.value = []
//table
equipTableList.value = [],
//
dialogFormVisibleSettlein.value = true
;(equipTableList.value = []),
//
(dialogFormVisibleSettlein.value = true)
}
const isEditForm = ref(false)
const maId: any = ref('')
const warningDays:any = ref(0)
const warningDays: any = ref(0)
//
const editRowInfo = (row: any) => {
isAdd.value = false
@ -299,53 +297,55 @@ const getDetailData = async (row: any) => {
// warningDays.value = addAndEditForm.deviceTypeList[addAndEditForm.deviceTypeList.length-1].data.maintenanceAlarmDay
// warningDays.value = addAndEditForm.deviceTypeList.maintenanceAlarmDay
propertyNames.value = addAndEditForm.devInfoProperties
equipTableList.value = [];
if(isEditForm.value == true){
if(addAndEditForm.tableList!=null){
addAndEditForm.tableList.forEach((item:any) =>{
equipTableList.value.push({
id:item.id,
identifyCode: item.identifyCode,
name2: item.insurancePdf[0]?.fileUrl,
checkMan: item.checkMan,
checkDate: item.checkDate,
nextCheckDate: item.nextCheckDate,
name6: item.examinationPdf[0]?.fileUrl,
insurancePdf: item.insurancePdf,
examinationPdf: item.examinationPdf,
})
})
}else{
equipTableList.value = [{
id:'',
identifyCode: '',
name2: '',
checkMan: '',
checkDate: '',
nextCheckDate: '',
name6: '',
insurancePdf: [],
examinationPdf: [],
}]
}
}else{
if(addAndEditForm.tableList!=null){
addAndEditForm.tableList.forEach((item:any) =>{
equipTableList.value.push({
id:item.id,
identifyCode: item.identifyCode,
name2: item.insurancePdf[0]?.fileUrl,
checkMan: item.checkMan,
checkDate: item.checkDate,
nextCheckDate: item.nextCheckDate,
name6: item.examinationPdf[0]?.fileUrl,
insurancePdf: item.insurancePdf,
examinationPdf: item.examinationPdf,
})
})
}else{
equipTableList.value = []
}
equipTableList.value = []
if (isEditForm.value == true) {
if (addAndEditForm.tableList != null) {
addAndEditForm.tableList.forEach((item: any) => {
equipTableList.value.push({
id: item.id,
identifyCode: item.identifyCode,
name2: item.insurancePdf[0]?.fileUrl,
checkMan: item.checkMan,
checkDate: item.checkDate,
nextCheckDate: item.nextCheckDate,
name6: item.examinationPdf[0]?.fileUrl,
insurancePdf: item.insurancePdf,
examinationPdf: item.examinationPdf,
})
})
} else {
equipTableList.value = [
{
id: '',
identifyCode: '',
name2: '',
checkMan: '',
checkDate: '',
nextCheckDate: '',
name6: '',
insurancePdf: [],
examinationPdf: [],
},
]
}
} else {
if (addAndEditForm.tableList != null) {
addAndEditForm.tableList.forEach((item: any) => {
equipTableList.value.push({
id: item.id,
identifyCode: item.identifyCode,
name2: item.insurancePdf[0]?.fileUrl,
checkMan: item.checkMan,
checkDate: item.checkDate,
nextCheckDate: item.nextCheckDate,
name6: item.examinationPdf[0]?.fileUrl,
insurancePdf: item.insurancePdf,
examinationPdf: item.examinationPdf,
})
})
} else {
equipTableList.value = []
}
}
console.log('tt23123', equipTableList.value)
// addAndEditForm.deviceTypeList[0].data.propertyNames.forEach((item:any) =>{
@ -512,7 +512,6 @@ const dialogTypeChange = async () => {
})
}
//
const getCompanyList = async () => {
const res: any = await getCompanyListApi()
@ -696,14 +695,12 @@ const submitFun = (type: any) => {
// ...addAndEditForm.detailsFileTempList,
// ]
if (isAdd.value) {
addAndEditForm.mainFileList = Array.from(new Set([
...addAndEditForm.mainFileList,
...addAndEditForm.mainFileTempList,
]))
addAndEditForm.detailsFileList = Array.from(new Set([
...addAndEditForm.detailsFileList,
...addAndEditForm.detailsFileTempList,
]))
addAndEditForm.mainFileList = Array.from(
new Set([...addAndEditForm.mainFileList, ...addAndEditForm.mainFileTempList]),
)
addAndEditForm.detailsFileList = Array.from(
new Set([...addAndEditForm.detailsFileList, ...addAndEditForm.detailsFileTempList]),
)
}
addAndEditFormRef.value.validate(async (valid: any) => {
@ -745,55 +742,65 @@ const submitFun = (type: any) => {
// }
addAndEditForm.tableList = equipTableList.value
for (let i = 0; i < addAndEditForm.tableList.length; i++) {
const row = addAndEditForm.tableList[i];
const row = addAndEditForm.tableList[i]
for (const key in row) {
if (row.hasOwnProperty(key) && (row[key] === null || row[key] === '' || row[key]?.length ===0) && key !== 'name2' && key !== 'name6'&& key !== 'id') {
if(key=='identifyCode'){
if (
row.hasOwnProperty(key) &&
(row[key] === null || row[key] === '' || row[key]?.length === 0) &&
key !== 'name2' &&
key !== 'name6' &&
key !== 'id'
) {
if (key == 'identifyCode') {
ElMessage({
type: 'error',
message: `${i + 1} 行的 ${'唯一标识符'} 字段不能为空`,
});
}else if(key=='checkMan'){
type: 'error',
message: `${i + 1} 行的 ${'唯一标识符'} 字段不能为空`,
})
} else if (key == 'checkMan') {
ElMessage({
type: 'error',
message: `${i + 1} 行的 ${'检修人'} 字段不能为空`,
});
}else if(key=='checkDate'){
type: 'error',
message: `${i + 1} 行的 ${'检修人'} 字段不能为空`,
})
} else if (key == 'checkDate') {
ElMessage({
type: 'error',
message: `${i + 1} 行的 ${'检修日期'} 字段不能为空`,
});
}else if(key=='nextCheckDate'){
type: 'error',
message: `${i + 1} 行的 ${'检修日期'} 字段不能为空`,
})
} else if (key == 'nextCheckDate') {
ElMessage({
type: 'error',
message: `${i + 1} 行的 ${'下次检修日期'} 字段不能为空`,
});
}else if(key=='insurancePdf'){
type: 'error',
message: `${i + 1} 行的 ${'下次检修日期'} 字段不能为空`,
})
} else if (key == 'insurancePdf') {
ElMessage({
type: 'error',
message: `请上传第 ${i + 1} 行的合格证`,
});
}else{
type: 'error',
message: `请上传第 ${i + 1} 行的合格证`,
})
} else {
ElMessage({
type: 'error',
message: `请上传第 ${i + 1} 行的检测证明`,
});
}
return; //
type: 'error',
message: `请上传第 ${i + 1} 行的检测证明`,
})
}
return //
}
}
}
if (isDescription) return
addAndEditForm.mainFileList = Array.from(new Set([
...addAndEditForm.mainFileList,
...addAndEditForm.mainFileTempList,
]))
console.log('🚀 ~ submitFun ~ addAndEditForm.mainFileList:', addAndEditForm.mainFileList)
addAndEditForm.detailsFileList = Array.from(new Set([
...addAndEditForm.detailsFileList,
...addAndEditForm.detailsFileTempList,
]))
console.log('🚀 ~ submitFun ~ addAndEditForm.detailsFileList:', addAndEditForm.detailsFileList)
addAndEditForm.mainFileList = Array.from(
new Set([...addAndEditForm.mainFileList, ...addAndEditForm.mainFileTempList]),
)
console.log(
'🚀 ~ submitFun ~ addAndEditForm.mainFileList:',
addAndEditForm.mainFileList,
)
addAndEditForm.detailsFileList = Array.from(
new Set([...addAndEditForm.detailsFileList, ...addAndEditForm.detailsFileTempList]),
)
console.log(
'🚀 ~ submitFun ~ addAndEditForm.detailsFileList:',
addAndEditForm.detailsFileList,
)
addAndEditForm.devInfoProperties = propertyNames.value
addAndEditForm.typeId =
@ -1127,10 +1134,10 @@ const onExaminationPdfChange = (fileList: any, index: number) => {
descriptionFormList.value[index].examinationTempPdf.push(...fileListTemp)
}
const onFileChangeEquip = (fileList: any,row:any,index:number,type:number) => {
if(type == 1){
const onFileChangeEquip = (fileList: any, row: any, index: number, type: number) => {
if (type == 1) {
equipTableList.value[index].insurancePdf = []
}else{
} else {
equipTableList.value[index].examinationPdf = []
}
const fileListTemp = fileList.map((e: any) => {
@ -1139,18 +1146,16 @@ const onFileChangeEquip = (fileList: any,row:any,index:number,type:number) => {
fileUrl: e.url,
}
})
console.log('11111',fileListTemp[0].fileUrl)
if(type == 1){
console.log('11111', fileListTemp[0].fileUrl)
if (type == 1) {
equipTableList.value[index].name2 = fileListTemp[0].fileUrl
equipTableList.value[index].insurancePdf.push(fileListTemp[0])
}else{
} else {
equipTableList.value[index].name6 = fileListTemp[0].fileUrl
equipTableList.value[index].examinationPdf.push(fileListTemp[0])
}
}
// const onDeleteImgInDetails = () => {}
const onDeleteImgInMain = (index: any) => {
@ -1204,11 +1209,11 @@ const onPreviewImg = (fileUrl: any) => {
}
//
const chunkedItems = computed(() => {
let result = [];
for (let i = 0; i < propertyNames.value.length; i += 2) {
result.push(propertyNames.value.slice(i, i + 2));
}
return result;
let result = []
for (let i = 0; i < propertyNames.value.length; i += 2) {
result.push(propertyNames.value.slice(i, i + 2))
}
return result
})
const equipTableList = ref<any>([])
@ -1223,25 +1228,25 @@ const handleAddBack = () => {
name6: '',
insurancePdf: [],
examinationPdf: [],
};
equipTableList.value.push(obj);
}
equipTableList.value.push(obj)
}
const handleDeleteBack = (index:number) => {
equipTableList.value.splice(index, 1);
const handleDeleteBack = (index: number) => {
equipTableList.value.splice(index, 1)
}
const fileListEquip = ref<any>([])
const viewCertificate = (url:string) => {
window.open(url, '_blank');
};
const changeDate = (row:any,index:number) => {
console.log('3333', row);
const currentDate = new Date(row.checkDate);
console.log('1111', currentDate);
const viewCertificate = (url: string) => {
window.open(url, '_blank')
}
const changeDate = (row: any, index: number) => {
console.log('3333', row)
const currentDate = new Date(row.checkDate)
console.log('1111', currentDate)
console.log('🚀 ~ 告警时间 ~ warningDays.value:', warningDays.value)
currentDate.setDate(currentDate.getDate() + Number(warningDays.value));
equipTableList.value[index].nextCheckDate = dayjs(currentDate).format('YYYY-MM-DD');
currentDate.setDate(currentDate.getDate() + Number(warningDays.value))
equipTableList.value[index].nextCheckDate = dayjs(currentDate).format('YYYY-MM-DD')
// equipTableList.value = [...equipTableList.value];
}
</script>
@ -1403,7 +1408,7 @@ const changeDate = (row:any,index:number) => {
<el-table-column align="center" label="装备状态">
<template #default="{ row }">
<el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag>
<el-tag v-if="row.maStatus == 1" size="small" type="warning"></el-tag>
<el-tag v-if="row.maStatus == 1" size="small" type="warning">待上</el-tag>
<el-tag v-if="row.maStatus == 2" size="small" type="success">上架</el-tag>
<el-tag v-if="row.maStatus == 3" size="small" type="danger">在租</el-tag>
</template>
@ -1481,8 +1486,9 @@ const changeDate = (row:any,index:number) => {
class="primary-lease"
@click="saveTemp"
v-if="
!equipmentDeploymentParams.maStatus ||
equipmentDeploymentParams.maStatus == 0
(!equipmentDeploymentParams.maStatus ||
equipmentDeploymentParams.maStatus == 0) &&
!isViewForm
"
>
保存草稿
@ -1655,19 +1661,17 @@ const changeDate = (row:any,index:number) => {
</el-form-item>
</el-col>
</el-row> -->
<div
>
<div>
<el-row
v-for="(item, index) in chunkedItems"
:key="index"
:model="item"
class="dynamic-item"
:gutter="20"
style="display: flex ; margin-top: 10px; justify-content: left"
style="display: flex; margin-top: 10px; justify-content: left"
>
<el-col v-for="(itemTemp,indexTemp) in item" :key="indexTemp" :span="12" >
<el-form-item :label="itemTemp.propertyName+''" >
<el-col v-for="(itemTemp, indexTemp) in item" :key="indexTemp" :span="12">
<el-form-item :label="itemTemp.propertyName + ''">
<el-input
v-model="itemTemp.propertyValue"
placeholder="请输入"
@ -1697,7 +1701,10 @@ const changeDate = (row:any,index:number) => {
label="主展示图:"
prop="mainFileList"
>
<div class="img-list" v-if="addAndEditForm.mainFileList.length > 0 && !isAdd">
<div
class="img-list"
v-if="addAndEditForm.mainFileList.length > 0 && !isAdd"
>
<div
v-for="(j, i) in addAndEditForm.mainFileList"
:key="j.fileUrl"
@ -1705,7 +1712,7 @@ const changeDate = (row:any,index:number) => {
>
<img :src="j.fileUrl" alt="" />
<div class="mask-img" >
<div class="mask-img">
<div>
<el-icon
class="delete-icon"
@ -1763,7 +1770,10 @@ const changeDate = (row:any,index:number) => {
label="详情页展示图:"
prop="detailsFileList"
>
<div class="img-list" v-if="addAndEditForm.detailsFileList.length > 0 && !isAdd">
<div
class="img-list"
v-if="addAndEditForm.detailsFileList.length > 0 && !isAdd"
>
<div
v-for="(j, i) in addAndEditForm.detailsFileList"
:key="j.fileUrl"
@ -1771,7 +1781,7 @@ const changeDate = (row:any,index:number) => {
>
<img :src="j.fileUrl" alt="" />
<div class="mask-img" >
<div class="mask-img">
<div>
<el-icon
class="delete-icon"
@ -1812,9 +1822,17 @@ const changeDate = (row:any,index:number) => {
</el-form-item>
</el-col>
</el-row>
<div style="display: flex;align-items: center;">
<div style="display: flex; align-items: center">
<TitleTip :titleText="`装备证书`" />
<el-button size="mini" type="primary" @click="handleAddBack" style="margin-left: 20px;margin-top: 20px" :disabled="!addAndEditForm.deviceTypeList" v-if="settleinTitle=='新增装备'">添加</el-button>
<el-button
size="mini"
type="primary"
@click="handleAddBack"
style="margin-left: 20px; margin-top: 20px"
:disabled="!addAndEditForm.deviceTypeList"
v-if="settleinTitle == '新增装备'"
>添加</el-button
>
</div>
<!-- <el-row :gutter="20" v-if="!isEditForm && !isViewForm">
<el-col :span="24">
@ -1860,7 +1878,7 @@ const changeDate = (row:any,index:number) => {
</el-form-item>
</el-col>
</el-row> -->
<!-- <el-row :gutter="20">
<!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item
style="font-weight: bold"
@ -2000,29 +2018,29 @@ const changeDate = (row:any,index:number) => {
<el-table :data="equipTableList" width="100%" height="450px">
<el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column
label="唯一标识符"
prop="identifyCode"
align="center"
:show-overflow-tooltip="true"
label="唯一标识符"
prop="identifyCode"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{row,$index}">
<el-input
v-model="row.identifyCode"
style="width: 100%"
placeholder="请输入唯一标识符"
maxlength="20"
></el-input>
</template>
<template #default="{ row, $index }">
<el-input
v-model="row.identifyCode"
style="width: 100%"
placeholder="请输入唯一标识符"
maxlength="20"
></el-input>
</template>
</el-table-column>
<el-table-column
label="合格证"
prop="name2"
align="center"
:show-overflow-tooltip="true"
label="合格证"
prop="name2"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{row,$index}">
<div v-if="row.name2==''">
<UploadComponentNew
<template #default="{ row, $index }">
<div v-if="row.name2 == ''">
<UploadComponentNew
:maxSize="10"
:max-limit="1"
width="100%"
@ -2034,76 +2052,84 @@ const changeDate = (row:any,index:number) => {
listType="text"
:justifyContent="`flex-start`"
:acceptTypeList="['.jpg', '.png']"
@onFileChange="(fileList) =>onFileChangeEquip(fileList,row,$index,1)"
@onFileChange="
(fileList) => onFileChangeEquip(fileList, row, $index, 1)
"
>
<div style="display: flex; justify-content: center;align-items: center;">
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
>上传</el-button>
<div
style="
display: flex;
justify-content: center;
align-items: center;
"
>
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
>上传</el-button
>
</div>
</UploadComponentNew>
<!-- <el-button size="mini" type="primary" @click="uploadTestReport(row)">上传</el-button> -->
</div>
<div v-else>
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
@click="viewCertificate(row.insurancePdf[0].fileUrl)"
>查看</el-button
>
</div>
</template>
<!-- <el-button size="mini" type="primary" @click="uploadTestReport(row)">上传</el-button> -->
</div>
<div v-else>
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
@click="viewCertificate(row.insurancePdf[0].fileUrl)"
>查看</el-button
>
</div>
</template>
</el-table-column>
<el-table-column
label="检修人"
prop="checkMan"
align="center"
:show-overflow-tooltip="true"
label="检修人"
prop="checkMan"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{row,$index}">
<el-input
v-model="row.checkMan"
controls-position="right"
style="width: 100%"
placeholder="请输入检修人"
></el-input>
</template>
<template #default="{ row, $index }">
<el-input
v-model="row.checkMan"
controls-position="right"
style="width: 100%"
placeholder="请输入检修人"
></el-input>
</template>
</el-table-column>
<el-table-column
label="检修时间"
prop="checkDate"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{row,$index}">
<el-date-picker
v-model="row.checkDate"
value-format="YYYY-MM-DD"
type="date"
placeholder="请选择"
@change="changeDate(row,$index)"
style="width: 100%"
></el-date-picker>
</template>
</el-table-column>
label="检修时间"
prop="checkDate"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{ row, $index }">
<el-date-picker
v-model="row.checkDate"
value-format="YYYY-MM-DD"
type="date"
placeholder="请选择"
@change="changeDate(row, $index)"
style="width: 100%"
></el-date-picker>
</template>
</el-table-column>
<el-table-column
label="下次检测时间"
prop="nextCheckDate"
align="center"
:show-overflow-tooltip="true"
>
<template #default="{row,$index}">
<el-date-picker
v-model="row.nextCheckDate"
value-format="YYYY-MM-DD"
type="date"
placeholder="请选择"
style="width: 100%"
></el-date-picker>
</template>
>
<template #default="{ row, $index }">
<el-date-picker
v-model="row.nextCheckDate"
value-format="YYYY-MM-DD"
type="date"
placeholder="请选择"
style="width: 100%"
></el-date-picker>
</template>
</el-table-column>
<el-table-column
@ -2112,9 +2138,9 @@ const changeDate = (row:any,index:number) => {
align="center"
:show-overflow-tooltip="true"
>
<template #default="{row,$index}">
<div v-if="row.name6==''">
<UploadComponentNew
<template #default="{ row, $index }">
<div v-if="row.name6 == ''">
<UploadComponentNew
:maxSize="10"
:max-limit="1"
width="100%"
@ -2126,44 +2152,64 @@ const changeDate = (row:any,index:number) => {
listType="text"
:justifyContent="`flex-start`"
:acceptTypeList="['.jpg', '.png']"
@onFileChange="(fileList) =>onFileChangeEquip(fileList,row,$index,2)"
@onFileChange="
(fileList) => onFileChangeEquip(fileList, row, $index, 2)
"
>
<div style="display: flex; justify-content: center;align-items: center;">
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
>上传</el-button>
<div
style="
display: flex;
justify-content: center;
align-items: center;
"
>
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
>上传</el-button
>
</div>
</UploadComponentNew>
<!-- <el-button size="mini" type="primary" @click="uploadTestReport(row)">上传</el-button> -->
</div>
<div v-else>
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
@click="viewCertificate(row.examinationPdf[0].fileUrl)"
>查看</el-button
>
</div>
</template>
<!-- <el-button size="mini" type="primary" @click="uploadTestReport(row)">上传</el-button> -->
</div>
<div v-else>
<el-button
type="text"
style="color: #00a288; text-decoration: underline"
@click="viewCertificate(row.examinationPdf[0].fileUrl)"
>查看</el-button
>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150px" v-if="settleinTitle=='新增装备'">
<template #default="{row,$index}">
<div
style="
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
"
>
<el-button size="mini" type="danger" @click="handleDeleteBack($index)" v-show="$index!=0">删除</el-button>
</div>
</template>
<el-table-column
label="操作"
align="center"
width="150px"
v-if="settleinTitle == '新增装备'"
>
<template #default="{ row, $index }">
<div
style="
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
"
>
<el-button
size="mini"
type="danger"
@click="handleDeleteBack($index)"
v-show="$index != 0"
>删除</el-button
>
</div>
</template>
</el-table-column>
</el-table>
</el-table>
</el-dialog>
<!-- 图片查看弹窗 -->

View File

@ -108,13 +108,13 @@
<el-table-column align="center" label="操作" :width="280">
<template #default="{ row }">
<el-button
size="small"
type="primary"
class="primary-lease"
@click="onAddQualityRecord(row)"
size="small"
type="primary"
class="primary-lease"
@click="onAddQualityRecord(row)"
>
新建
</el-button>
新建
</el-button>
<el-button
size="small"
@ -379,7 +379,7 @@
}"
>
<el-table-column align="center" label="序号" type="index" width="80" />
<el-table-column align="center" prop="qcCode" label="维修保养编码" />
<el-table-column align="center" prop="qcCode" label="质检编码" />
<!-- <el-table-column align="center" prop="qcName" label="维修保养名称" /> -->
<el-table-column align="center" prop="qcTime" label="维修保养日期" />
<el-table-column align="center" prop="nickName" label="上传人" width="120" />
@ -455,7 +455,7 @@ import {
} from 'http/api/quality-manage'
import { InfoFilled } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import dayjs from 'dayjs';
import dayjs from 'dayjs'
const total = ref(0)
const totalInDialog = ref(0)
@ -613,7 +613,7 @@ const onResetInDialog = () => {
//
const onDelete = async (row: any) => {
console.log('🚀 ~ onDelete ~ row:', row)
const res: any = await qualityDeleteByIdApi({ fileId: row.fileId,maId: row.maId })
const res: any = await qualityDeleteByIdApi({ fileId: row.fileId, maId: row.maId })
if (res.code === 200) {
ElMessage({
type: 'success',
@ -685,7 +685,6 @@ const onAddQualityRecord = (row: any) => {
// }
}
//
const onFileChange = (fileList: any) => {
addOrEditForm.value.fileInfoTempList = []
@ -701,10 +700,9 @@ const onFileChange = (fileList: any) => {
const warningDays: any = ref(0)
const onQcChange = (value: any) => {
const currentDate = new Date(value);
currentDate.setDate(currentDate.getDate() + warningDays.value);
addOrEditForm.value.nextCheckTime = dayjs(currentDate).format('YYYY-MM-DD hh:mm:ss');
const currentDate = new Date(value)
currentDate.setDate(currentDate.getDate() + warningDays.value)
addOrEditForm.value.nextCheckTime = dayjs(currentDate).format('YYYY-MM-DD hh:mm:ss')
}
//
@ -717,7 +715,6 @@ const onClose = () => {
}
}
onMounted(() => {
getLeaseListData()
getAssociationListData()

View File

@ -84,7 +84,7 @@
</el-table-column>
<el-table-column align="center" prop="nickName" label="上传人" width="120" />
<el-table-column align="center" prop="createTime" label="上传时间" />
<!-- <el-table-column align="center" prop="updateTime" label="更新时间" />-->
<!-- <el-table-column align="center" prop="updateTime" label="更新时间" />-->
<el-table-column align="center" label="操作" :width="220">
<template #default="{ row }">
<el-button
@ -96,7 +96,7 @@
{{ row.fileInfoList && row.fileInfoList.length > 0 ? '编辑' : '上传' }}
</el-button>
<el-popconfirm
<!-- <el-popconfirm
width="220"
:icon="InfoFilled"
icon-color="#626AEF"
@ -119,7 +119,7 @@
确定
</el-button>
</template>
</el-popconfirm>
</el-popconfirm> -->
</template>
</el-table-column>
</el-table>