协议合并

This commit is contained in:
hongchao 2024-12-18 10:34:37 +08:00
parent 02d0428a15
commit ecd0f2e9e7
3 changed files with 367 additions and 96 deletions

View File

@ -609,6 +609,74 @@ const onCartSubmit = async () => {
const wordUrl = ref('')
const settleWordTitle = ref('')
const dialogFormVisibleSettleWord: any = ref(false)
//
// const handleViewWord = async (index: any) => {
// //
// const { companyName, companyId } = cardList.value[index].companyPersonPhoneKey
// let cost = 0
// let detailsList: any = []
// const isSelect = cardList.value[index].devInfoVoList.some((e: any) => e.isChecked == true)
// if (!isSelect) {
// ElMessage({
// showClose: false,
// message: '...',
// type: 'error',
// })
// return
// }
// cardList.value[index].devInfoVoList.map((e: any) => {
// if (e.isChecked) {
// detailsList.push({
// rentBeginTime: e.rentBeginTime,
// rentEndTime: e.rentEndTime,
// 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,
// }
// console.log('', queryParams)
// const res: any = await getBookCarAgreementApi(queryParams)
// bookCarAgreement.value = res.msg
// dialogFormVisibleSettleWord.value = true
// // settleWordTitle.value = ''
// // // const orderId = row.orderId
// // // const res: any = await getContractDetailApi({ orderId })
// // //
// // wordUrl.value = 'http://127.0.0.1:29300/statics/2024/12/16/test_20241216154423A003.docx'
// // dialogFormVisibleSettleWord.value = true
// // setTimeout(() => {
// // const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
// // //
// // myDocxPreviewer
// // .preview(wordUrl.value)
// // .then((res) => {
// // console.log('')
// // })
// // .catch((e) => {
// // console.log('1111', wordUrl.value)
// // console.log('', e)
// // })
// // }, 1000)
// }
//
const handleViewWord = async (index: any) => {
//
@ -653,28 +721,25 @@ const handleViewWord = async (index: any) => {
console.log('查询参数', queryParams)
const res: any = await getBookCarAgreementApi(queryParams)
bookCarAgreement.value = res.msg
wordUrl.value = res.data.url
dialogFormVisibleSettleWord.value = true
// settleWordTitle.value = ''
// // const orderId = row.orderId
// // const res: any = await getContractDetailApi({ orderId })
// //
// wordUrl.value = 'http://127.0.0.1:29300/statics/2024/12/16/test_20241216154423A003.docx'
// dialogFormVisibleSettleWord.value = true
// setTimeout(() => {
// const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
// //
// myDocxPreviewer
// .preview(wordUrl.value)
// .then((res) => {
// console.log('')
// })
// .catch((e) => {
// console.log('1111', wordUrl.value)
// console.log('', e)
// })
// }, 1000)
settleWordTitle.value = '租赁服务合同'
setTimeout(() => {
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById("mmm"));
//
myDocxPreviewer
.preview(
wordUrl.value
)
.then((res) => {
console.log("预览完成");
})
.catch((e) => {
console.log('1111', wordUrl.value)
console.log("预览失败", e);
});
}, 1000);
}
//
@ -825,4 +890,8 @@ getReceiptGoodsAddress()
.address-item:hover {
background-color: #c9e7e5;
}
#mmm {
width: 100%;
height: 500px;
}
</style>

View File

@ -92,7 +92,7 @@
></el-switch>
</template>
</el-table-column>
<!-- <el-table-column align="center" prop="qcTime" label="合同附件">
<el-table-column align="center" prop="qcTime" label="合同附件">
<template #default="{ row }">
<a
:href="row.bmFileInfoList.length>0 ? row.bmFileInfoList[0].fileUrl:null"
@ -101,7 +101,7 @@
>查看</a
>
</template>
</el-table-column> -->
</el-table-column>
<el-table-column align="center" prop="createTime" label="创建时间" />
<el-table-column align="center" prop="updateTime" label="更新时间" />
<el-table-column align="center" label="操作" :width="220">
@ -124,7 +124,7 @@
/>
<!-- 新增和修改弹框 -->
<el-dialog
<!-- <el-dialog
v-model="dialogVisibleSettlein"
:title="settleinTitle"
width="40%"
@ -184,10 +184,10 @@
</el-button>
</div>
</template>
</el-dialog>
</el-dialog> -->
<!-- 新增和修改弹框 -->
<el-dialog
<!-- <el-dialog
v-model="dialogVisibleSettleinEdit"
v-if="dialogVisibleSettleinEdit"
:title="settleinTitle"
@ -215,14 +215,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="内容" prop="content">
<!-- <QuillEditor
v-model="addAndEditForm.content"
class="editor"
:options="editorOption"
@ready="onEditorReady($event)"
></QuillEditor> -->
<EditorModel v-model:modelValue="addAndEditForm.content" />
<EditorModel v-model:modelValue="addAndEditForm.content" />
</el-form-item>
</el-col>
</el-row>
@ -240,7 +233,88 @@
</el-button>
</div>
</template>
</el-dialog>
</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-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">
<UploadComponentNew
: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>
</UploadComponentNew>
</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>
@ -298,11 +372,19 @@ const queryParams: any = reactive({
pageNum: 1,
})
// const addAndEditForm = ref<any>({
// id: '',
// contractName: '',
// content: '',
// contentId: '',
// })
const addAndEditForm = ref<any>({
id: '',
contractName: '',
content: '',
contentId: '',
fileInfoList: [],
fileInfoTempList: [],
bmFileInfoList: [],
})
//
@ -357,20 +439,26 @@ const dialogVisibleSettlein: any = ref(false)
const dialogVisibleSettleinEdit: any = ref(false)
const contractList: any = ref([])
//
const addContract = async () => {
settleinTitle.value = '合同新建'
contractList.value = []
const res: any = await getContractSelectList()
if (res.data.length > 0) {
res.data.forEach((item: any) => {
contractList.value.push({
id: item.id,
templateName: item.templateName,
content: item.content,
})
})
}
dialogVisibleSettlein.value = true
// const addContract = async () => {
// settleinTitle.value = ''
// contractList.value = []
// const res: any = await getContractSelectList()
// if (res.data.length > 0) {
// res.data.forEach((item: any) => {
// contractList.value.push({
// id: item.id,
// templateName: item.templateName,
// content: item.content,
// })
// })
// }
// dialogVisibleSettlein.value = true
// }
//
const addContract = () => {
settleinTitle.value = '合同新建'
dialogVisibleSettlein.value = true;
}
const handleSelectChange = (selectedId: number) => {
@ -384,16 +472,25 @@ const handleSelectChange = (selectedId: number) => {
console.log('2222', selectedContract)
addAndEditForm.value.content = selectedContract
}
// //
// const onContract = (row: any) => {
// console.log(row, '')
// addAndEditForm.value.id = row.id
// addAndEditForm.value.contractName = row.contractName
// // modelValue.value = row.content
// addAndEditForm.value.content = row.content
// console.log('2222', addAndEditForm.value.content)
// settleinTitle.value = ''
// dialogVisibleSettleinEdit.value = true
// }
//
const onContract = (row: any) => {
console.log(row, '详情')
addAndEditForm.value.id = row.id
addAndEditForm.value.contractName = row.contractName
// modelValue.value = row.content
addAndEditForm.value.content = row.content
console.log('2222', addAndEditForm.value.content)
console.log('2222',addAndEditForm.value.contractName)
settleinTitle.value = '合同修改'
dialogVisibleSettleinEdit.value = true
dialogVisibleSettlein.value = true
}
const onDialogClose = () => {
@ -407,34 +504,89 @@ const onDialogClose = () => {
const onDialogClose_2 = () => {}
// const addAndEditFormRules = reactive({
// contractName: [{ required: true, message: '', trigger: 'blur' }],
// contentId: [{ required: true, message: '', trigger: 'blur' }],
// })
//
const onFileChange = (fileList: any) => {
addAndEditForm.value.fileInfoTempList = []
const fileListTemp = fileList.map((e: any) => {
return {
fileName: e.name,
fileUrl: e.url,
}
})
addAndEditForm.value.fileInfoTempList.push(...fileListTemp)
}
const addAndEditFormRules = reactive({
contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
contentId: [{ required: true, message: '请选择合同模板', trigger: 'blur' }],
fileInfoList: [{ required: true, message: '请上传合同附件', trigger: 'blur' }],
})
//
// const onSubmit = () => {
// addAndEditFormRef.value.validate(async (valid: any) => {
// if (valid) {
// addAndEditForm.value.content = addAndEditForm.value.content.replace(/&nbsp;/gi, '\xa0')
// addAndEditForm.value.content = addAndEditForm.value.content.replace(/\$/g, '&#36')
// addAndEditForm.value.content = encodeURIComponent(addAndEditForm.value.content)
// const SEN_API = settleinTitle.value === '' ? editContractApi : addContractApi
// const res: any = await SEN_API(addAndEditForm.value)
// if (res.code === 200) {
// ElMessage({
// type: 'success',
// message: '',
// })
// // dialogVisibleSettlein.value = false
// dialogVisibleSettleinEdit.value = false
// getContractListData()
// }
// }
// })
// }
const onSubmit = () => {
addAndEditForm.value.fileInfoList = addAndEditForm.value.fileInfoTempList
addAndEditFormRef.value.validate(async (valid: any) => {
if (valid) {
addAndEditForm.value.content = addAndEditForm.value.content.replace(/&nbsp;/gi, '\xa0')
addAndEditForm.value.content = addAndEditForm.value.content.replace(/\$/g, '&#36')
addAndEditForm.value.content = encodeURIComponent(addAndEditForm.value.content)
const SEN_API = settleinTitle.value === '合同修改' ? editContractApi : addContractApi
addAndEditForm.value.bmFileInfoList = addAndEditForm.value.fileInfoList
const res: any = await SEN_API(addAndEditForm.value)
if (res.code === 200) {
ElMessage({
type: 'success',
message: '提交成功',
})
// dialogVisibleSettlein.value = false
dialogVisibleSettleinEdit.value = false
dialogVisibleSettlein.value = false
getContractListData()
}
}
})
}
//
// const onDelete = async (id: any) => {
// const res: any = await delContractApi({ id })
// if (res.code === 200) {
// ElMessage({
// type: 'success',
// message: '',
// })
// getContractListData()
// }
// }
//
// const onCancel = () => {
// dialogVisibleSettlein.value = false
// }
//
const onDelete = async (id: any) => {
const res: any = await delContractApi({ id })
@ -447,11 +599,13 @@ const onDelete = async (id: any) => {
}
}
//
const onCancel = () => {
dialogVisibleSettlein.value = false
}
const myQuillEditor = ref()
//

View File

@ -617,39 +617,72 @@ const handleViewRepair = (item: any) => {
const settleWordTitle = ref('')
const dialogFormVisibleSettleWord: any = ref(false)
//
const handleViewWord = async (index: Number, row: any) => {
// const handleViewWord = async (index: Number, row: any) => {
// settleWordTitle.value = ''
// // moneyParams1.value = {
// // /* */
// // maStatus: 15,
// // detectionList: [],
// // insureList: [],
// // picList: [],
// // }
// // const orderId = row.orderId
// const res: any = await getContractDetailApi({ orderId: row.orderId })
// leaseAgreement.value = res.msg
// // console.log(res, '')
// // leaseAgreement.value = res.
// // cardList.value = res.rows
// //
// dialogFormVisibleSettleWord.value = true
// // wordUrl.value = res.data.url
// // dialogFormVisibleSettleWord.value = true
// // setTimeout(() => {
// // const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
// // //
// // myDocxPreviewer
// // .preview(wordUrl.value)
// // .then((res) => {
// // console.log('')
// // })
// // .catch((e) => {
// // console.log('1111', wordUrl.value)
// // console.log('', e)
// // })
// // }, 1000)
// }
//
const handleViewWord = async(index: Number, row: any) => {
settleWordTitle.value = '租赁协议'
// moneyParams1.value = {
// /* */
// maStatus: 15,
// detectionList: [],
// insureList: [],
// picList: [],
// }
// const orderId = row.orderId
const res: any = await getContractDetailApi({ orderId: row.orderId })
leaseAgreement.value = res.msg
// console.log(res, '')
// leaseAgreement.value = res.
moneyParams1.value = {
/* 设备状态 */
maStatus: 15,
detectionList: [],
insureList: [],
picList: [],
}
const orderId = row.orderId
const res: any = await getContractDetailApi({ orderId })
// cardList.value = res.rows
//
wordUrl.value = res.data.url
dialogFormVisibleSettleWord.value = true
// wordUrl.value = res.data.url
// dialogFormVisibleSettleWord.value = true
// setTimeout(() => {
// const myDocxPreviewer = jsPreviewDocx.init(document.getElementById('mmm'))
// //
// myDocxPreviewer
// .preview(wordUrl.value)
// .then((res) => {
// console.log('')
// })
// .catch((e) => {
// console.log('1111', wordUrl.value)
// console.log('', e)
// })
// }, 1000)
setTimeout(() => {
const myDocxPreviewer = jsPreviewDocx.init(document.getElementById("mmm"));
//
myDocxPreviewer
.preview(
wordUrl.value
)
.then((res) => {
console.log("预览完成");
})
.catch((e) => {
console.log('1111', wordUrl.value)
console.log("预览失败", e);
});
}, 1000);
}
const contract = ref({
@ -1881,6 +1914,26 @@ const wordUrl = ref('')
</el-dialog>
<!-- 租赁协议 -->
<!-- <el-dialog
v-model="dialogFormVisibleSettleWord"
:title="settleWordTitle"
width="50%"
align-center
destroy-on-close
:close-on-click-modal="false"
>
<div v-html="leaseAgreement"></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="downloadContract" type="success"> 下载 </el-button>
</span>
</div>
<div id="mmm" style="height: 600px"></div>
</el-dialog> -->
<el-dialog
v-model="dialogFormVisibleSettleWord"
:title="settleWordTitle"
@ -1889,11 +1942,6 @@ const wordUrl = ref('')
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="leaseAgreement"></div>
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
<span class="dialog-footer">
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"