Merge branch 'hongchao-dev'
This commit is contained in:
commit
43d8bc3ec0
|
|
@ -214,19 +214,18 @@
|
|||
ref="addAndEditFormRef"
|
||||
label-position="right"
|
||||
:model="addAndEditForm"
|
||||
:rules="addAndEditFormRules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同模板名称" prop="xwbt">
|
||||
<el-input v-model="dataForm.xwbt" placeholder="请输入合同模板名称"></el-input>
|
||||
<el-form-item label="合同模板名称" prop="contractName">
|
||||
<el-input v-model="addAndEditForm.contractName" placeholder="请输入合同模板名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="内容" prop="nr" class="form-item-content">
|
||||
<quill-editor v-model="dataForm.nr" class="editor" :options="editorOption" ></quill-editor>
|
||||
<el-form-item label="内容" prop="content" >
|
||||
<QuillEditor v-model="addAndEditForm.content" class="editor" :options="editorOption" @ready="onEditorReady($event)"></QuillEditor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -300,9 +299,6 @@ const addAndEditForm = ref<any>({
|
|||
contractName: '',
|
||||
content:'',
|
||||
contentId:'',
|
||||
fileInfoList: [],
|
||||
fileInfoTempList: [],
|
||||
bmFileInfoList: [],
|
||||
})
|
||||
|
||||
// 获取列表
|
||||
|
|
@ -389,7 +385,8 @@ const handleSelectChange = (selectedId:number) => {
|
|||
const onContract = (row: any) => {
|
||||
addAndEditForm.value.id = row.id
|
||||
addAndEditForm.value.contractName = row.contractName
|
||||
console.log('2222',addAndEditForm.value.contractName)
|
||||
addAndEditForm.value.content = row.content
|
||||
console.log('2222',addAndEditForm.value.content)
|
||||
settleinTitle.value = '合同修改'
|
||||
dialogVisibleSettleinEdit.value = true
|
||||
}
|
||||
|
|
@ -403,18 +400,6 @@ const onDialogClose = () => {
|
|||
addAndEditForm.value.contractName = ''
|
||||
}
|
||||
|
||||
// 自定义事件
|
||||
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' }],
|
||||
|
|
@ -423,6 +408,7 @@ const addAndEditFormRules = reactive({
|
|||
|
||||
// 提交
|
||||
const onSubmit = () => {
|
||||
console.log('sad',addAndEditForm.value)
|
||||
addAndEditFormRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
const SEN_API = settleinTitle.value === '合同修改' ? editContractApi : addContractApi
|
||||
|
|
@ -483,7 +469,7 @@ const toolbarOptions = ref<any>([
|
|||
|
||||
const editorOption = ref<any>({ // 编辑框操作事件
|
||||
theme: 'snow', // or 'bubble'
|
||||
// placeholder: '请输入资讯内容...',
|
||||
placeholder: '请输入资讯内容...',
|
||||
modules: {
|
||||
toolbar: {
|
||||
container: toolbarOptions,
|
||||
|
|
@ -497,6 +483,15 @@ const dataForm = ref<any>( {
|
|||
nr: '222222',
|
||||
flag: '',
|
||||
})
|
||||
|
||||
const editorInstance = ref(null);
|
||||
const onEditorReady = (editor) => {
|
||||
editorInstance.value = editor;
|
||||
// 如果 addAndEditForm.content 已经有值,手动设置编辑器内容
|
||||
if (addAndEditForm.content) {
|
||||
editorInstance.value.setContents(addAndEditForm.content);
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
getContractListData()
|
||||
// getEquipmentTypeApi().then((res: any) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue