Merge branch 'hcb' of SH-Arbitrate/Mediation-Frontend into dev

This commit was merged in pull request #38.
This commit is contained in:
2024-02-06 15:50:48 +08:00
committed by Gitea
4 changed files with 226 additions and 83 deletions
+10 -2
View File
@@ -78,7 +78,7 @@ export function updateTemplate(data) {
return request({ return request({
url: '/deptIdentify/updateTemplate', url: '/deptIdentify/updateTemplate',
method: 'post', method: 'post',
params: data data: data
}) })
} }
// 删除模板 // 删除模板
@@ -200,4 +200,12 @@ export function getTemplateInfoById(data) {
method: 'get', method: 'get',
params: data params: data
}) })
} }
// 查询模板详情
export function getTemplateDetail(data) {
return request({
url: '/deptIdentify/getTemplateDetail',
method: 'get',
params: data
})
}
@@ -6,12 +6,12 @@
<el-form-item label="模板名称" prop="temName"> <el-form-item label="模板名称" prop="temName">
<el-input v-model="ruleForm.temName"></el-input> <el-input v-model="ruleForm.temName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="模板类型" prop="temType"> <!-- <el-form-item label="模板类型" prop="temType">
<el-select v-model="ruleForm.temType" placeholder="请选择"> <el-select v-model="ruleForm.temType" placeholder="请选择">
<el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option> :value="dict.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="机构名称" prop="identifyId"> <el-form-item label="机构名称" prop="identifyId">
<el-select v-model="ruleForm.identifyId" placeholder="请选择"> <el-select v-model="ruleForm.identifyId" placeholder="请选择">
<el-option v-for="item in tempList" :key="item.id" :label="item.identifyName" :value="item.id"> <el-option v-for="item in tempList" :key="item.id" :label="item.identifyName" :value="item.id">
@@ -19,10 +19,20 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-upload class="avatar-uploader" :before-upload="beforeUpload" :on-success="handleSuccess" ref="upload" <el-upload class="avatar-uploader" :on-success="handleSuccess" ref="upload" :action="UploadUrl()"
:action="UploadUrl()" :headers="headers" :data="filedata" :on-remove="handleRemove" :headers="headers" :data="filedata" :on-remove="handleRemove" :on-change="handleChange" accept=".doc,.docx"
:on-change="handleChange" accept=".doc,.docx" :file-list="fileList" :auto-upload="false"> :file-list="fileList" :limit="1">
<el-button size="small" type="primary">选择模板文件</el-button> <el-button size="small" type="primary">选择调解申请书模板</el-button>
</el-upload>
<el-upload class="avatar-uploader" :on-success="handleSuccessA" ref="uploadA" :action="UploadUrl()"
:headers="headers" :data="filedataA" :on-remove="handleRemoveA" :on-change="handleChangeA"
accept=".doc,.docx" :file-list="fileListA" :limit="1">
<el-button size="small" type="primary">选择和解协议模板</el-button>
</el-upload>
<el-upload class="avatar-uploader" :on-success="handleSuccessB" ref="upload" :action="UploadUrl()"
:headers="headers" :data="filedataB" :on-remove="handleRemoveB" :on-change="handleChangeB"
accept=".doc,.docx" :file-list="fileListB" :limit="1">
<el-button size="small" type="primary">选择调解书模板</el-button>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel" class="endbutton"><span>取 消</span></el-button> <el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
@@ -35,6 +45,7 @@
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { import {
deptIdentifyList, deptIdentifyList,
insertTemplate
} from "@/api/officialSeal/officialSeal.js"; } from "@/api/officialSeal/officialSeal.js";
export default { export default {
props: ["uploadVisable", "uploadData", "queryParams"], props: ["uploadVisable", "uploadData", "queryParams"],
@@ -42,25 +53,38 @@ export default {
data() { data() {
return { return {
fileList: [], fileList: [],
fileListA: [],
fileListB: [],
data: [], data: [],
tempList: [], tempList: [],
isImg:false, isImg: false,
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
filedata: {}, filedata: {
annexType: 1
},
filedataA: {
annexType: 2
},
filedataB: {
annexType: 3
},
flagBtn: false, flagBtn: false,
ruleForm: {}, ruleForm: {},
rules: { rules: {
temName: [ temName: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }, { required: true, message: '请输入模板名称', trigger: 'blur' },
], ],
temType: [ // temType: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }, // { required: true, message: '请输入模板名称', trigger: 'blur' },
], // ],
identifyId: [ identifyId: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }, { required: true, message: '请输入模板名称', trigger: 'blur' },
] ]
},
submitForm: {
annexIds: []
} }
}; };
}, },
@@ -89,35 +113,67 @@ export default {
this.isImg = file.type === '.doc' || '.docx' this.isImg = file.type === '.doc' || '.docx'
}, },
UploadUrl() { UploadUrl() {
return window.location.origin + "/API/deptIdentify/insertTemplate"; return window.location.origin + "/API/deptIdentify/upload";
},
submitUpload() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.filedata.identifyId = this.ruleForm.identifyId;
this.filedata.temName = this.ruleForm.temName;
if (this.isImg) {
this.$refs.upload.submit();
}else{
this.$message.error('只能上传doc,docx格式的文件')
}
}
});
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList); console.log(file, fileList);
}, },
beforeUpload(file) { handleSuccess(res) {
// debugger
// this.isImg = file.type === '.doc' || '.docx'
},
handleSuccess() {
this.$message.success('上传成功'); this.$message.success('上传成功');
this.$emit("cancelUpload"); console.log(res, "OOOOOOOOOOOOOOOOO");
this.$emit('getList', this.queryParams); this.submitForm.annexIds.push(res.annexId)
} },
handleChangeA(file, fileList) {
this.isImg = file.type === '.doc' || '.docx'
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/upload";
},
handleRemoveA(file, fileList) {
console.log(file, fileList);
},
handleSuccessA(res) {
this.$message.success('上传成功');
this.submitForm.annexIds.push(res.annexId)
},
handleChangeB(file, fileList) {
this.isImg = file.type === '.doc' || '.docx'
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/upload";
},
handleRemoveB(file, fileList) {
console.log(file, fileList);
},
handleSuccessB(res) {
this.$message.success('上传成功');
this.submitForm.annexIds.push(res.annexId)
},
submitUpload() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
if(this.submitForm.annexIds.length < 3){
this.$message.error('三种类型模板必须上传');
return
}
this.submitForm.identifyId = this.ruleForm.identifyId;
this.submitForm.temName = this.ruleForm.temName;
insertTemplate(this.submitForm).then(res => {
this.$message.success('新增成功');
this.$emit("cancelUpload");
this.$emit('getList', this.queryParams);
})
}
});
},
}, },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.avatar-uploader {
margin-bottom: 20px;
}
</style>
@@ -6,21 +6,44 @@
<el-form-item label="模板名称" prop="temName"> <el-form-item label="模板名称" prop="temName">
<el-input v-model="ruleForm.temName"></el-input> <el-input v-model="ruleForm.temName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="模板类型" prop="temType"> <!-- <el-form-item label="模板类型" prop="temType">
<el-select v-model="ruleForm.temType" placeholder="请选择"> <el-select v-model="ruleForm.temType" placeholder="请选择">
<el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.template_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option> :value="dict.value"></el-option>
</el-select> </el-select>
</el-form-item> -->
<el-form-item label="调节申请书模板" v-if="ruleForm.applicationFile.fileName">
<span style="color: #0e5ce3;cursor:pointer" @click="openUrl(ruleForm.applicationFile.temOrigPath)">{{
ruleForm.applicationFile.fileName ? ruleForm.applicationFile.fileName : ""
}}</span>
</el-form-item> </el-form-item>
<el-form-item label="当前模板"> <el-form-item label="和解协议模板" v-if="ruleForm.agreementFile.fileName">
<span style="color: #0e5ce3;cursor:pointer" @click="openUrl(editData.temOrigPath)">{{ editData.fileName <!-- <span style="color: #0e5ce3;cursor:pointer" @click="openUrl(editData.temOrigPath)">{{ editData.fileName
}}</span> -->
<span style="color: #0e5ce3;cursor:pointer" @click="openUrl(ruleForm.agreementFile.temOrigPath)">{{
ruleForm.agreementFile.fileName ? ruleForm.agreementFile.fileName : ""
}}</span>
</el-form-item>
<el-form-item label="调解书模板" v-if="ruleForm.bookFile.fileName">
<span style="color: #0e5ce3;cursor:pointer" @click="openUrl(ruleForm.bookFile.temOrigPath)">{{
ruleForm.bookFile.fileName ? ruleForm.bookFile.fileName : ""
}}</span> }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-upload class="avatar-uploader" :before-upload="beforeUpload" :on-success="handleSuccess" ref="upload" <el-upload class="avatar-uploader" :on-success="handleSuccess" ref="upload" :action="UploadUrl()"
:action="UploadUrl()" :headers="headers" :data="filedata" :on-remove="handleRemove" :headers="headers" :data="filedata" :on-remove="handleRemove" :on-change="handleChange" accept=".doc,.docx"
:on-change="handleChange" accept=".doc,.docx" :file-list="fileList" :auto-upload="false"> :file-list="fileList" :limit="1">
<el-button size="small" type="primary">选择模板文件</el-button> <el-button size="small" type="primary">选择调解申请书模板</el-button>
</el-upload>
<el-upload class="avatar-uploader" :on-success="handleSuccessA" ref="uploadA" :action="UploadUrl()"
:headers="headers" :data="filedataA" :on-remove="handleRemoveA" :on-change="handleChangeA"
accept=".doc,.docx" :file-list="fileListA" :limit="1">
<el-button size="small" type="primary">选择和解协议模板</el-button>
</el-upload>
<el-upload class="avatar-uploader" :on-success="handleSuccessB" ref="upload" :action="UploadUrl()"
:headers="headers" :data="filedataB" :on-remove="handleRemoveB" :on-change="handleChangeB"
accept=".doc,.docx" :file-list="fileListB" :limit="1">
<el-button size="small" type="primary">选择调解书模板</el-button>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel" class="endbutton"><span>取 消</span></el-button> <el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
@@ -31,37 +54,54 @@
</template> </template>
<script> <script>
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { updateTemplate } from "@/api/officialSeal/officialSeal" import { updateTemplate, getTemplateDetail } from "@/api/officialSeal/officialSeal"
export default { export default {
props: ["editVisable", "editData", "queryParams"], props: ["editVisable", "editData", "queryParams"],
dicts: ["template_type"], dicts: ["template_type"],
data() { data() {
return { return {
fileList: [], fileList: [],
fileListA: [],
fileListB: [],
data: [], data: [],
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
isImg: true, isImg: true,
filedata: {}, filedata: {
annexType: 1
},
filedataA: {
annexType: 2
},
filedataB: {
annexType: 3
},
flagBtn: false, flagBtn: false,
ruleForm: {}, ruleForm: {
agreementFile:{},
applicationFile:{},
bookFile:{}
},
rules: { rules: {
temName: [ temName: [
{ required: true, message: '请输入模板名称', trigger: 'blur' }, { required: true, message: '请输入模板名称', trigger: 'blur' },
], ],
temType: [ },
{ required: true, message: '请输入模板名称', trigger: 'blur' }, submitForm: {
], annexIds: []
} }
}; };
}, },
watch: { watch: {
editData(val) { editData(val) {
if (val) { if (val) {
this.ruleForm = val;
this.fileList = []; this.fileList = [];
this.ruleForm.temType = this.ruleForm.temType + ''; }
},
editVisable(val){
if(val){
this.getTemplateDetailFn({ id: this.editData.id })
} }
} }
}, },
@@ -77,51 +117,90 @@ export default {
cancel() { cancel() {
this.$emit("cancelEdit"); this.$emit("cancelEdit");
}, },
handleChange(file, fileList) {
this.isImg = file.type === '.doc' || '.docx';
this.fileList = fileList;
},
UploadUrl() { UploadUrl() {
return window.location.origin + "/API/deptIdentify/updateTemplate"; return window.location.origin + "/API/deptIdentify/updateTemplate";
}, },
/**根据id查看详情*/
getTemplateDetailFn(data) {
getTemplateDetail(data).then(res => {
this.ruleForm = res;
this.submitForm.annexIds = [this.ruleForm.agreementFile.fileId,this.ruleForm.applicationFile.fileId,this.ruleForm.bookFile.fileId]
console.log(this.submitForm.annexIds,"PPPPPPPPPPPPPPPPPPPPPPPP");
})
},
submitUpload() { submitUpload() {
let that = this;
this.$refs['ruleForm'].validate((valid) => { this.$refs['ruleForm'].validate((valid) => {
if (valid) { if (valid) {
if (that.fileList.length > 0) { this.$refs['ruleForm'].validate((valid) => {
that.filedata.id = that.editData.id; if (valid) {
that.filedata.temName = that.ruleForm.temName; this.submitForm.identifyId = this.ruleForm.identifyId;
if (that.isImg) { this.submitForm.temName = this.ruleForm.temName;
that.$refs.upload.submit(); this.submitForm.id = this.ruleForm.id;
} else { console.log(this.submitForm.annexIds,'ooooooooooooooooooooooooooooo');
that.$message.error('只能上传doc,docx格式的文件') updateTemplate(this.submitForm).then(res => {
this.$message.success('修改成功');
this.$emit("cancelEdit");
this.$emit('getList', this.queryParams);
})
} }
} else { });
updateTemplate({
id: that.editData.id,
temName: that.ruleForm.temName
}).then(res => {
that.$message.success('修改成功');
that.$emit("cancelEdit");
that.$emit('getList', that.queryParams);
})
}
} }
}); });
}, },
handleChange(file, fileList) {
this.isImg = file.type === '.doc' || '.docx'
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/upload";
},
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList); console.log(file, fileList);
}, },
beforeUpload(file) { handleSuccess(res) {
// this.isImg = file.type === '.doc' || '.docx' this.$message.success('上传成功');
// this.submitForm.annexIds.push(res.annexId);
this.submitForm.annexIds[1] = res.annexId;
}, },
handleSuccess() {
this.$message.success('修改成功'); handleChangeA(file, fileList) {
this.$emit("cancelEdit"); this.isImg = file.type === '.doc' || '.docx'
this.$emit('getList', this.queryParams); },
} UploadUrl() {
return window.location.origin + "/API/deptIdentify/upload";
},
handleRemoveA(file, fileList) {
console.log(file, fileList);
},
handleSuccessA(res) {
this.$message.success('上传成功');
// this.submitForm.annexIds.push(res.annexId);
this.submitForm.annexIds[0] = res.annexId;
},
handleChangeB(file, fileList) {
this.isImg = file.type === '.doc' || '.docx'
},
UploadUrl() {
return window.location.origin + "/API/deptIdentify/upload";
},
handleRemoveB(file, fileList) {
console.log(file, fileList);
},
handleSuccessB(res) {
this.$message.success('上传成功');
// this.submitForm.annexIds.push(res.annexId);
this.submitForm.annexIds[3] = res.annexId;
},
// handleSuccess() {
// this.$message.success('修改成功');
// this.$emit("cancelEdit");
// this.$emit('getList', this.queryParams);
// }
}, },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.avatar-uploader {
margin-bottom: 20px;
}</style>
+2 -2
View File
@@ -12,9 +12,9 @@ const name = process.env.VUE_APP_TITLE || '调解系统' // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口
// const API = 'http://121.40.189.20:9001' //生产 // const API = 'http://121.40.189.20:9001' //生产
const API = 'http://121.40.189.20:6001' //测试 // const API = 'http://121.40.189.20:6001' //测试
// const API = 'http://192.168.3.18:6001' //B // const API = 'http://192.168.3.18:6001' //B
// const API = 'http://192.168.3.77:6001' //Q const API = 'http://172.16.0.237:6001' //Q
// const API = 'http://172.16.1.17:6001' //w // const API = 'http://172.16.1.17:6001' //w
// vue.config.js 配置说明 // vue.config.js 配置说明