作者 张晓杰
@@ -35,6 +35,15 @@ export function updateOrginfoCertificate(data) { @@ -35,6 +35,15 @@ export function updateOrginfoCertificate(data) {
35 }) 35 })
36 } 36 }
37 37
  38 +//根据单位编号查询对应的证照列表
  39 +export function selectByOrgnCode(orgcode){
  40 + return request({
  41 + url: '/compliancemanagement/orginfoCertificate/selectByOrgnCode',
  42 + method:'get',
  43 + params:{orgcode}
  44 + })
  45 +}
  46 +
38 // 删除单位证照表 47 // 删除单位证照表
39 export function delOrginfoCertificate(id) { 48 export function delOrginfoCertificate(id) {
40 return request({ 49 return request({
@@ -102,7 +102,7 @@ export const constantRoutes = [ @@ -102,7 +102,7 @@ export const constantRoutes = [
102 ] 102 ]
103 }, 103 },
104 { 104 {
105 - path: '/contract/compliancemanagement', 105 + path: '/contract/compliancemanagement/orginfoCertificate',
106 component: Layout, 106 component: Layout,
107 hidden: true, 107 hidden: true,
108 children: [ 108 children: [
@@ -114,7 +114,7 @@ export const constantRoutes = [ @@ -114,7 +114,7 @@ export const constantRoutes = [
114 } 114 }
115 ] 115 ]
116 } 116 }
117 - /contract/compliancemanagement/orginfoCertificate 117 + // /contract/compliancemanagement/orginfoCertificate
118 ] 118 ]
119 119
120 // 动态路由,基于用户权限动态去加载 120 // 动态路由,基于用户权限动态去加载
@@ -223,7 +223,7 @@ @@ -223,7 +223,7 @@
223 <!-- 添加或修改【请填写功能名称】对话框 --> 223 <!-- 添加或修改【请填写功能名称】对话框 -->
224 <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> 224 <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
225 <el-form ref="form" :model="form" :rules="rules" label-width="100px"> 225 <el-form ref="form" :model="form" :rules="rules" label-width="100px">
226 - <el-form-item label="合同编号" prop="contractno"> 226 + <!-- <el-form-item label="合同编号" prop="contractno">
227 <el-input v-model="form.contractno" placeholder="请输入合同编号" /> 227 <el-input v-model="form.contractno" placeholder="请输入合同编号" />
228 </el-form-item> 228 </el-form-item>
229 <el-form-item label="合同名称" prop="contractName"> 229 <el-form-item label="合同名称" prop="contractName">
@@ -273,6 +273,12 @@ @@ -273,6 +273,12 @@
273 </el-form-item> 273 </el-form-item>
274 <el-form-item label="附件" prop="attachments"> 274 <el-form-item label="附件" prop="attachments">
275 <el-input v-model="form.attachments" placeholder="请输入附件" /> 275 <el-input v-model="form.attachments" placeholder="请输入附件" />
  276 + </el-form-item> -->
  277 + <el-form-item label="变更原因" prop="reasonChange">
  278 + <el-input v-model="form.reasonChange" placeholder="请输入变更原因"/>
  279 + </el-form-item>
  280 + <el-form-item label="变更内容" prop="reasonText">
  281 + <el-input type="textarea" v-model="form.reasonText" placeholder="请输入变更内容" :row="3"/>
276 </el-form-item> 282 </el-form-item>
277 </el-form> 283 </el-form>
278 <div slot="footer" class="dialog-footer"> 284 <div slot="footer" class="dialog-footer">
@@ -337,6 +343,7 @@ export default { @@ -337,6 +343,7 @@ export default {
337 }, 343 },
338 // 表单参数 344 // 表单参数
339 form: {}, 345 form: {},
  346 + biangeng:[],
340 347
341 // 表单校验 348 // 表单校验
342 rules: { 349 rules: {
@@ -372,6 +379,12 @@ export default { @@ -372,6 +379,12 @@ export default {
372 attachments: [ 379 attachments: [
373 { required: true, message: "附件不能为空", trigger: "blur" }, 380 { required: true, message: "附件不能为空", trigger: "blur" },
374 ], 381 ],
  382 + reasonChange: [
  383 + {required: true ,message:'变更原因不能为空', trigger:'blur'}
  384 + ],
  385 + reasonText: [
  386 + {required: true ,message:'变更内容不能为空', trigger:'blur'}
  387 + ],
375 id: [{ required: true, message: "不能为空", trigger: "blur" }], 388 id: [{ required: true, message: "不能为空", trigger: "blur" }],
376 }, 389 },
377 }; 390 };
@@ -420,6 +433,8 @@ export default { @@ -420,6 +433,8 @@ export default {
420 signingDate: undefined, 433 signingDate: undefined,
421 subjectInformation: undefined, 434 subjectInformation: undefined,
422 attachments: undefined, 435 attachments: undefined,
  436 + reasonChange:undefined,
  437 + reasonText:undefined,
423 id: undefined, 438 id: undefined,
424 }; 439 };
425 this.resetForm("form"); 440 this.resetForm("form");
@@ -446,18 +461,20 @@ export default { @@ -446,18 +461,20 @@ export default {
446 // this.open = true; 461 // this.open = true;
447 // this.title = "添加"; 462 // this.title = "添加";
448 // }, 463 // },
449 - /** 修改按钮操作 */  
450 - // handleUpdate(row) {  
451 - // this.loading = true;  
452 - // this.reset();  
453 - // const id = row.id || this.ids  
454 - // getContract(id).then(response => {  
455 - // this.loading = false;  
456 - // this.form = response.data;  
457 - // this.open = true;  
458 - // this.title = "修改";  
459 - // });  
460 - // }, 464 + /** 合同变更按钮操作 */
  465 + handleEdit(row) {
  466 + this.loading = true;
  467 + this.reset();
  468 + this.biangeng=row
  469 + console.log("变更值:",this.biangeng)
  470 + const id = row.id || this.ids
  471 + getContract(id).then(response => {
  472 + this.loading = false;
  473 + this.form = response.data;
  474 + this.open = true;
  475 + this.title = "合同变更";
  476 + });
  477 + },
461 /** 提交按钮 */ 478 /** 提交按钮 */
462 submitForm() { 479 submitForm() {
463 this.$refs["form"].validate((valid) => { 480 this.$refs["form"].validate((valid) => {
@@ -466,9 +483,10 @@ export default { @@ -466,9 +483,10 @@ export default {
466 if (this.form.id != null) { 483 if (this.form.id != null) {
467 updateContract(this.form) 484 updateContract(this.form)
468 .then((response) => { 485 .then((response) => {
469 - this.$modal.msgSuccess("修改成功"); 486 + this.$modal.msgSuccess("合同变更成功,流程已启动");
470 this.open = false; 487 this.open = false;
471 this.getList(); 488 this.getList();
  489 + this.handleAgain(this.biangeng)
472 }) 490 })
473 .finally(() => { 491 .finally(() => {
474 this.buttonLoading = false; 492 this.buttonLoading = false;
@@ -536,6 +554,7 @@ export default { @@ -536,6 +554,7 @@ export default {
536 }); 554 });
537 }, 555 },
538 handleAgain(row) { 556 handleAgain(row) {
  557 + console.log(row)
539 this.$router.push({ 558 this.$router.push({
540 path: "/workflow/process/start/" + row.deployId, 559 path: "/workflow/process/start/" + row.deployId,
541 query: { 560 query: {
@@ -545,9 +564,6 @@ export default { @@ -545,9 +564,6 @@ export default {
545 }); 564 });
546 console.log(row); 565 console.log(row);
547 }, 566 },
548 - handleEdit(row){  
549 -  
550 - }  
551 }, 567 },
552 }; 568 };
553 </script> 569 </script>
@@ -150,6 +150,18 @@ @@ -150,6 +150,18 @@
150 </el-form-item> 150 </el-form-item>
151 </el-col> 151 </el-col>
152 <el-col :span="24"> 152 <el-col :span="24">
  153 + <el-form-item label="变更原因" prop="reasonChange">
  154 + <el-input v-model="formData.reasonChange" placeholder="请输入变更原因" clearable
  155 + :style="{ width: '50%' }"/>
  156 + </el-form-item>
  157 + </el-col>
  158 + <el-col :span="24">
  159 + <el-form-item label="变更内容" prop="reasonText">
  160 + <el-input type="textarea" v-model="formData.reasonText" placeholder="请输入变更内容" :row="3" clearable
  161 + :style="{ width: '50%' }"/>
  162 + </el-form-item>
  163 + </el-col>
  164 + <el-col :span="24">
153 <el-form-item label="附件" prop="attachments"> 165 <el-form-item label="附件" prop="attachments">
154 <!-- <el-input v-model="formData.attachments" placeholder="请输入附件" clearable :style="{width: '50%'}" /> --> 166 <!-- <el-input v-model="formData.attachments" placeholder="请输入附件" clearable :style="{width: '50%'}" /> -->
155 <el-upload 167 <el-upload
@@ -214,6 +226,7 @@ @@ -214,6 +226,7 @@
214 </transition-group> 226 </transition-group>
215 </el-form-item> 227 </el-form-item>
216 </el-col> 228 </el-col>
  229 +
217 <el-col :span="24"> 230 <el-col :span="24">
218 <el-form-item size="large"> 231 <el-form-item size="large">
219 <el-button type="primary" @click="submitForm">提交</el-button> 232 <el-button type="primary" @click="submitForm">提交</el-button>
@@ -285,6 +298,8 @@ export default { @@ -285,6 +298,8 @@ export default {
285 signingDate: null, 298 signingDate: null,
286 subjectInformation: undefined, 299 subjectInformation: undefined,
287 attachments: undefined, 300 attachments: undefined,
  301 + reasonChange:undefined,
  302 + reasonText:undefined
288 }, 303 },
289 rules: { 304 rules: {
290 contractno: [ 305 contractno: [
1 <template> 1 <template>
2 <div class="app-container"> 2 <div class="app-container">
3 <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> 3 <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4 - <el-form-item label="单位编号" prop="orgcode"> 4 + <!-- <el-form-item label="单位编号" prop="orgcode">
5 <el-input 5 <el-input
6 v-model="queryParams.orgcode" 6 v-model="queryParams.orgcode"
7 placeholder="请输入单位编号" 7 placeholder="请输入单位编号"
8 clearable 8 clearable
9 @keyup.enter.native="handleQuery" 9 @keyup.enter.native="handleQuery"
10 /> 10 />
11 - </el-form-item> 11 + </el-form-item> -->
12 <el-form-item label="证书编号" prop="certificateNo"> 12 <el-form-item label="证书编号" prop="certificateNo">
13 <el-input 13 <el-input
14 v-model="queryParams.certificateNo" 14 v-model="queryParams.certificateNo"
@@ -117,7 +117,12 @@ @@ -117,7 +117,12 @@
117 <span>{{ parseTime(scope.row.certificateValidityPeriod, '{y}-{m}-{d}') }}</span> 117 <span>{{ parseTime(scope.row.certificateValidityPeriod, '{y}-{m}-{d}') }}</span>
118 </template> 118 </template>
119 </el-table-column> 119 </el-table-column>
120 - <el-table-column label="证书附件" align="center" prop="certificateAttachment" /> 120 + <el-table-column label="证书附件" align="center" prop="certificateAttachment" >
  121 + <template slot-scope="scope">
  122 +
  123 + <img src="@/assets/images/PDF.png" @click="openFile(scope.row.certificateAttachment)" width="40px" height="auto" style="cursor: pointer"/>
  124 + </template>
  125 + </el-table-column>
121 <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> 126 <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
122 <template slot-scope="scope"> 127 <template slot-scope="scope">
123 <el-button 128 <el-button
@@ -150,7 +155,7 @@ @@ -150,7 +155,7 @@
150 <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> 155 <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
151 <el-form ref="form" :model="form" :rules="rules" label-width="80px"> 156 <el-form ref="form" :model="form" :rules="rules" label-width="80px">
152 <el-form-item label="单位编号" prop="orgcode"> 157 <el-form-item label="单位编号" prop="orgcode">
153 - <el-input v-model="form.orgcode" placeholder="请输入单位编号" /> 158 + <el-input v-model="this.orgcode" placeholder="请输入单位编号" :disabled="true"/>
154 </el-form-item> 159 </el-form-item>
155 <el-form-item label="证书编号" prop="certificateNo"> 160 <el-form-item label="证书编号" prop="certificateNo">
156 <el-input v-model="form.certificateNo" placeholder="请输入证书编号" /> 161 <el-input v-model="form.certificateNo" placeholder="请输入证书编号" />
@@ -161,21 +166,49 @@ @@ -161,21 +166,49 @@
161 <el-form-item label="发证时间" prop="issuanceDate"> 166 <el-form-item label="发证时间" prop="issuanceDate">
162 <el-date-picker clearable 167 <el-date-picker clearable
163 v-model="form.issuanceDate" 168 v-model="form.issuanceDate"
164 - type="datetime"  
165 - value-format="yyyy-MM-dd HH:mm:ss"  
166 placeholder="请选择发证时间"> 169 placeholder="请选择发证时间">
167 </el-date-picker> 170 </el-date-picker>
168 </el-form-item> 171 </el-form-item>
169 <el-form-item label="证书有效期" prop="certificateValidityPeriod"> 172 <el-form-item label="证书有效期" prop="certificateValidityPeriod">
170 <el-date-picker clearable 173 <el-date-picker clearable
171 v-model="form.certificateValidityPeriod" 174 v-model="form.certificateValidityPeriod"
172 - type="datetime"  
173 - value-format="yyyy-MM-dd HH:mm:ss"  
174 placeholder="请选择证书有效期"> 175 placeholder="请选择证书有效期">
175 </el-date-picker> 176 </el-date-picker>
176 </el-form-item> 177 </el-form-item>
177 <el-form-item label="证书附件" prop="certificateAttachment"> 178 <el-form-item label="证书附件" prop="certificateAttachment">
178 - <el-input v-model="form.certificateAttachment" placeholder="请输入证书附件" /> 179 + <el-upload
  180 + class="upload-demo"
  181 + ref="upload"
  182 + :accept="'application/pdf'"
  183 + :before-upload="beforeUpload"
  184 + :action="this.url"
  185 + :headers="this.headers"
  186 + :on-preview="handlePreview"
  187 + :on-remove="handleRemove"
  188 + :on-change="handleChange"
  189 + :file-list="this.fileList"
  190 + :auto-upload="false"
  191 + :limit="1"
  192 + :multiple="false"
  193 + :on-success="handleSuccess"
  194 + :before-remove="beforeRemove"
  195 + :on-exceed="handleExceed"
  196 + name="files"
  197 + >
  198 + <el-button slot="trigger" size="small" type="primary"
  199 + >选取文件</el-button
  200 + >
  201 + <el-button
  202 + style="margin-left: 10px"
  203 + size="small"
  204 + type="success"
  205 + @click="submitUpload"
  206 + >上传到服务器</el-button
  207 + >
  208 + <div slot="tip" class="el-upload__tip">
  209 + 只能上传大小不超过 5MB 的 PDF 文件
  210 + </div>
  211 + </el-upload>
179 </el-form-item> 212 </el-form-item>
180 </el-form> 213 </el-form>
181 <div slot="footer" class="dialog-footer"> 214 <div slot="footer" class="dialog-footer">
@@ -187,12 +220,21 @@ @@ -187,12 +220,21 @@
187 </template> 220 </template>
188 221
189 <script> 222 <script>
190 -import { listOrginfoCertificate, getOrginfoCertificate, delOrginfoCertificate, addOrginfoCertificate, updateOrginfoCertificate } from "@/api/compliancemanagement/orginfoCertificate";  
191 - 223 +import { listOrginfoCertificate, getOrginfoCertificate, delOrginfoCertificate, addOrginfoCertificate, updateOrginfoCertificate,selectByOrgnCode } from "@/api/compliancemanagement/orginfoCertificate";
  224 +import { getToken } from "@/utils/auth";
  225 +import VuePdf from 'vue-pdf';
192 export default { 226 export default {
193 name: "OrginfoCertificate", 227 name: "OrginfoCertificate",
194 data() { 228 data() {
195 return { 229 return {
  230 + // 设置上传的请求头部
  231 + headers: { Authorization: "Bearer " + getToken() },
  232 + // 上传的地址
  233 + url: process.env.VUE_APP_BASE_API + "/common/uploads",
  234 + // urlhead: "http://joycart.zgftlm.com",
  235 + urlhead:process.env.VUE_APP_BASE_API,
  236 + fileList: [],
  237 + file:[],
196 // 按钮loading 238 // 按钮loading
197 buttonLoading: false, 239 buttonLoading: false,
198 // 遮罩层 240 // 遮罩层
@@ -213,6 +255,7 @@ export default { @@ -213,6 +255,7 @@ export default {
213 title: "", 255 title: "",
214 // 是否显示弹出层 256 // 是否显示弹出层
215 open: false, 257 open: false,
  258 + orgcode:'',
216 // 查询参数 259 // 查询参数
217 queryParams: { 260 queryParams: {
218 pageNum: 1, 261 pageNum: 1,
@@ -253,12 +296,25 @@ export default { @@ -253,12 +296,25 @@ export default {
253 }; 296 };
254 }, 297 },
255 created() { 298 created() {
256 - this.getList(); 299 + // this.getList();
  300 + this.orgcode=this.$route.query.orgcode
  301 + this.getorgcode(this.orgcode);
  302 +
257 }, 303 },
258 methods: { 304 methods: {
  305 + //根据单位编号查询列表
  306 + getorgcode(orgcode){
  307 + console.log(orgcode)
  308 + selectByOrgnCode(orgcode).then(response =>{
  309 + console.log(response.data)
  310 + this.orginfoCertificateList = response.data
  311 + this.loading = false;
  312 + })
  313 + },
259 /** 查询单位证照表列表 */ 314 /** 查询单位证照表列表 */
260 getList() { 315 getList() {
261 this.loading = true; 316 this.loading = true;
  317 + this.queryParams.orgcode=this.orgcode
262 listOrginfoCertificate(this.queryParams).then(response => { 318 listOrginfoCertificate(this.queryParams).then(response => {
263 this.orginfoCertificateList = response.rows; 319 this.orginfoCertificateList = response.rows;
264 this.total = response.total; 320 this.total = response.total;
@@ -305,14 +361,18 @@ export default { @@ -305,14 +361,18 @@ export default {
305 }, 361 },
306 /** 新增按钮操作 */ 362 /** 新增按钮操作 */
307 handleAdd() { 363 handleAdd() {
  364 +
308 this.reset(); 365 this.reset();
  366 + this.form.orgcode=this.orgcode
309 this.open = true; 367 this.open = true;
310 this.title = "添加单位证照表"; 368 this.title = "添加单位证照表";
311 }, 369 },
312 /** 修改按钮操作 */ 370 /** 修改按钮操作 */
313 handleUpdate(row) { 371 handleUpdate(row) {
314 this.loading = true; 372 this.loading = true;
  373 +
315 this.reset(); 374 this.reset();
  375 + this.form.orgcode=this.orgcode
316 const id = row.id || this.ids 376 const id = row.id || this.ids
317 getOrginfoCertificate(id).then(response => { 377 getOrginfoCertificate(id).then(response => {
318 this.loading = false; 378 this.loading = false;
@@ -366,7 +426,70 @@ export default { @@ -366,7 +426,70 @@ export default {
366 this.download('compliancemanagement/orginfoCertificate/export', { 426 this.download('compliancemanagement/orginfoCertificate/export', {
367 ...this.queryParams 427 ...this.queryParams
368 }, `orginfoCertificate_${new Date().getTime()}.xlsx`) 428 }, `orginfoCertificate_${new Date().getTime()}.xlsx`)
  429 + },
  430 +
  431 + openFile(filePath) {
  432 +
  433 + this.currentFile = this.urlhead+filePath;
  434 + console.log(this.currentFile)
  435 + this.dialogVisible = true;
  436 +
  437 + },
  438 + beforeUpload(file) {
  439 + const isPDF = file.type === 'application/pdf';
  440 + const isLt5M = file.size / 1024 / 1024 < 5;
  441 +
  442 + if (!isPDF) {
  443 + this.$message.error('只能上传 PDF 文件');
  444 + return false;
  445 + }
  446 + if (!isLt5M) {
  447 + this.$message.error('上传文件大小不能超过 5MB');
  448 + return false;
369 } 449 }
  450 +
  451 + // 如果需要其他处理,可以在这里添加
  452 +
  453 + return true; // 返回 true 允许上传
  454 + },
  455 + handleChange(file, fileList) {
  456 + this.fileList = fileList;
  457 + },
  458 + handleSuccess(response, file, fileList) {
  459 + // response 是上传成功后的响应数据
  460 + // 可以从中获取文件地址或文件名
  461 + // 假设后端返回的数据结构中有一个字段 url 表示文件地址
  462 + const fileUrl = response.data.fileNames;
  463 + // 将文件地址或文件名赋值给表单的字段
  464 + this.form.certificateAttachment =fileUrl;
  465 + },
  466 + handleRemove(file, fileList) {
  467 + this.form.certificateAttachment=''
  468 + console.log(file, fileList);
  469 + },
  470 + handlePreview(file) {
  471 + console.log(file);
  472 + },
  473 + handleExceed(files, fileList) {
  474 + this.$message.warning(
  475 + `当前限制上传 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
  476 + files.length + fileList.length
  477 + } 个文件`
  478 + );
  479 + },
  480 + beforeRemove(file, fileList) {
  481 + this.fileList = fileList;
  482 + if (file && file.status==="success") {
  483 + return this.$confirm(`确定移除 ${file.name}?`);
  484 + }
  485 +
  486 + },
  487 + submitUpload() {
  488 + // 手动触发上传操作
  489 + // this.$refs.upload.submit()
  490 + // 构建 FormData 对象
  491 + this.$refs.upload.submit()
  492 + },
370 } 493 }
371 }; 494 };
372 </script> 495 </script>
@@ -199,7 +199,7 @@ export default { @@ -199,7 +199,7 @@ export default {
199 methods: { 199 methods: {
200 toOrginfoCertificateList(row){ 200 toOrginfoCertificateList(row){
201 console.log('row=====',row) 201 console.log('row=====',row)
202 - this.$router.push({ path: '/contract/compliancemanagement/orginfoCertificate', query: {orgcode: row.orgcode }}); 202 + this.$router.push({ path: '/contract/compliancemanagement/orginfoCertificate/orginfoCertificate/index', query: {orgcode: row.orgcode }});
203 }, 203 },
204 /** 查询【请填写功能名称】列表 */ 204 /** 查询【请填写功能名称】列表 */
205 getList() { 205 getList() {