作者 雷海东

合同解除按钮

@@ -141,30 +141,73 @@ @@ -141,30 +141,73 @@
141 </el-table-column> 141 </el-table-column>
142 <el-table-column label="甲方" align="center" prop="partyA" width="200"> 142 <el-table-column label="甲方" align="center" prop="partyA" width="200">
143 <template slot-scope="scope"> 143 <template slot-scope="scope">
144 - <a :href="scope.row.partyAAddress" target="_blank" style="color: #1890ff;;">{{ scope.row.partyA }}</a> 144 + <a
  145 + :href="scope.row.partyAAddress"
  146 + target="_blank"
  147 + style="color: #1890ff"
  148 + >{{ scope.row.partyA }}</a
  149 + >
145 </template> 150 </template>
146 </el-table-column> 151 </el-table-column>
147 <el-table-column label="乙方" align="center" prop="partyB" width="200"> 152 <el-table-column label="乙方" align="center" prop="partyB" width="200">
148 <template slot-scope="scope"> 153 <template slot-scope="scope">
149 - <a :href="scope.row.partyBAddress" target="_blank" style="color: #1890ff;;">{{ scope.row.partyB }}</a> 154 + <a
  155 + :href="scope.row.partyBAddress"
  156 + target="_blank"
  157 + style="color: #1890ff"
  158 + >{{ scope.row.partyB }}</a
  159 + >
150 </template> 160 </template>
151 </el-table-column> 161 </el-table-column>
152 - <el-table-column label="付款方式" align="center" prop="paymentMethod" width="200"/>  
153 - <el-table-column label="签订日期" align="center" prop="signingDate" width="100"> 162 + <el-table-column
  163 + label="付款方式"
  164 + align="center"
  165 + prop="paymentMethod"
  166 + width="200"
  167 + />
  168 + <el-table-column
  169 + label="签订日期"
  170 + align="center"
  171 + prop="signingDate"
  172 + width="100"
  173 + >
154 <template slot-scope="scope"> 174 <template slot-scope="scope">
155 - <span>{{ parseTime(scope.row.signingDate, '{y}-{m}-{d}') }}</span> 175 + <span>{{ parseTime(scope.row.signingDate, "{y}-{m}-{d}") }}</span>
156 </template> 176 </template>
157 </el-table-column> 177 </el-table-column>
158 - <el-table-column label="标的物信息" align="center" prop="subjectInformation" width="200" />  
159 - <el-table-column label="附件" align="center" prop="attachments" width="100"> 178 + <el-table-column
  179 + label="标的物信息"
  180 + align="center"
  181 + prop="subjectInformation"
  182 + width="200"
  183 + />
  184 + <el-table-column
  185 + label="附件"
  186 + align="center"
  187 + prop="attachments"
  188 + width="100"
  189 + >
160 <!-- <template slot-scope="scope"> 190 <!-- <template slot-scope="scope">
161 <img :src="baseUrl + scope.row.attachments" width="40px" height="auto" style="cursor: pointer"/> 191 <img :src="baseUrl + scope.row.attachments" width="40px" height="auto" style="cursor: pointer"/>
162 </template> --> 192 </template> -->
163 <template slot-scope="scope"> 193 <template slot-scope="scope">
164 - <img v-if="scope.row.attachments" src="@/assets/images/PDF.png" @click="preview(scope.row.attachments)" width="40px" height="auto" style="cursor: pointer"/> 194 + <img
  195 + v-if="scope.row.attachments"
  196 + src="@/assets/images/PDF.png"
  197 + @click="preview(scope.row.attachments)"
  198 + width="40px"
  199 + height="auto"
  200 + style="cursor: pointer"
  201 + />
165 </template> 202 </template>
166 </el-table-column> 203 </el-table-column>
167 - <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200"> 204 + <el-table-column
  205 + label="操作"
  206 + align="center"
  207 + class-name="small-padding fixed-width"
  208 + fixed="right"
  209 + width="200"
  210 + >
168 <template slot-scope="scope"> 211 <template slot-scope="scope">
169 <el-button 212 <el-button
170 type="text" 213 type="text"
@@ -206,6 +249,15 @@ @@ -206,6 +249,15 @@
206 @click="handleEdit(scope.row)" 249 @click="handleEdit(scope.row)"
207 >合同变更</el-button 250 >合同变更</el-button
208 > 251 >
  252 + <el-switch
  253 + class="switch"
  254 + v-model="scope.row.status"
  255 + :active-value="0"
  256 + :inactive-value="1"
  257 + active-text="进行中"
  258 + inactive-text="已解除"
  259 + >
  260 + </el-switch>
209 </template> 261 </template>
210 </el-table-column> 262 </el-table-column>
211 </el-table> 263 </el-table>
@@ -217,8 +269,19 @@ @@ -217,8 +269,19 @@
217 :limit.sync="queryParams.pageSize" 269 :limit.sync="queryParams.pageSize"
218 @pagination="getList" 270 @pagination="getList"
219 /> 271 />
220 - <el-dialog title="合同预览" :visible.sync="dialogVisibleContract" width="50%" center :before-close="handleClose">  
221 - <vue-pdf :src="pdfUrl" type="application/pdf" width="100%" height="800px" /> 272 + <el-dialog
  273 + title="合同预览"
  274 + :visible.sync="dialogVisibleContract"
  275 + width="50%"
  276 + center
  277 + :before-close="handleClose"
  278 + >
  279 + <vue-pdf
  280 + :src="pdfUrl"
  281 + type="application/pdf"
  282 + width="100%"
  283 + height="800px"
  284 + />
222 </el-dialog> 285 </el-dialog>
223 <!-- 添加或修改【请填写功能名称】对话框 --> 286 <!-- 添加或修改【请填写功能名称】对话框 -->
224 <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> 287 <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
@@ -275,10 +338,15 @@ @@ -275,10 +338,15 @@
275 <el-input v-model="form.attachments" placeholder="请输入附件" /> 338 <el-input v-model="form.attachments" placeholder="请输入附件" />
276 </el-form-item> --> 339 </el-form-item> -->
277 <el-form-item label="变更原因" prop="reasonChange"> 340 <el-form-item label="变更原因" prop="reasonChange">
278 - <el-input v-model="form.reasonChange" placeholder="请输入变更原因"/> 341 + <el-input v-model="form.reasonChange" placeholder="请输入变更原因" />
279 </el-form-item> 342 </el-form-item>
280 <el-form-item label="变更内容" prop="reasonText"> 343 <el-form-item label="变更内容" prop="reasonText">
281 - <el-input type="textarea" v-model="form.reasonText" placeholder="请输入变更内容" :row="3"/> 344 + <el-input
  345 + type="textarea"
  346 + v-model="form.reasonText"
  347 + placeholder="请输入变更内容"
  348 + :row="3"
  349 + />
282 </el-form-item> 350 </el-form-item>
283 </el-form> 351 </el-form>
284 <div slot="footer" class="dialog-footer"> 352 <div slot="footer" class="dialog-footer">
@@ -292,19 +360,26 @@ @@ -292,19 +360,26 @@
292 </template> 360 </template>
293 361
294 <script> 362 <script>
295 -import { listContract, getContract, delContract, addContract, updateContract } from "@/api/compliancemanagement/contract";  
296 -import {startProcess,stopProcess} from "@/api/workflow/process"  
297 -import VuePdf from 'vue-pdf'; 363 +import {
  364 + listContract,
  365 + getContract,
  366 + delContract,
  367 + addContract,
  368 + updateContract,
  369 +} from "@/api/compliancemanagement/contract";
  370 +import { startProcess, stopProcess } from "@/api/workflow/process";
  371 +import VuePdf from "vue-pdf";
298 export default { 372 export default {
299 name: "Contract", 373 name: "Contract",
300 components: { 374 components: {
301 - VuePdf 375 + VuePdf,
302 }, 376 },
303 data() { 377 data() {
304 return { 378 return {
305 - pdfUrl: '',  
306 - dialogVisibleContract:false,  
307 - baseUrl:process.env.VUE_APP_BASE_API+ '/', 379 + switchValue: true,
  380 + pdfUrl: "",
  381 + dialogVisibleContract: false,
  382 + baseUrl: process.env.VUE_APP_BASE_API + "/",
308 // 按钮loading 383 // 按钮loading
309 buttonLoading: false, 384 buttonLoading: false,
310 // 遮罩层 385 // 遮罩层
@@ -344,7 +419,7 @@ export default { @@ -344,7 +419,7 @@ export default {
344 }, 419 },
345 // 表单参数 420 // 表单参数
346 form: {}, 421 form: {},
347 - biangeng:[], 422 + biangeng: [],
348 423
349 // 表单校验 424 // 表单校验
350 rules: { 425 rules: {
@@ -381,10 +456,10 @@ export default { @@ -381,10 +456,10 @@ export default {
381 { required: true, message: "附件不能为空", trigger: "blur" }, 456 { required: true, message: "附件不能为空", trigger: "blur" },
382 ], 457 ],
383 reasonChange: [ 458 reasonChange: [
384 - {required: true ,message:'变更原因不能为空', trigger:'blur'} 459 + { required: true, message: "变更原因不能为空", trigger: "blur" },
385 ], 460 ],
386 reasonText: [ 461 reasonText: [
387 - {required: true ,message:'变更内容不能为空', trigger:'blur'} 462 + { required: true, message: "变更内容不能为空", trigger: "blur" },
388 ], 463 ],
389 id: [{ required: true, message: "不能为空", trigger: "blur" }], 464 id: [{ required: true, message: "不能为空", trigger: "blur" }],
390 }, 465 },
@@ -411,13 +486,13 @@ export default { @@ -411,13 +486,13 @@ export default {
411 }, 486 },
412 //合同附件预览 487 //合同附件预览
413 preview(contract) { 488 preview(contract) {
414 - this.dialogVisibleContract = true  
415 - console.log('contract:',contract)  
416 - this.pdfUrl = this.baseUrl + contract 489 + this.dialogVisibleContract = true;
  490 + console.log("contract:", contract);
  491 + this.pdfUrl = this.baseUrl + contract;
417 }, 492 },
418 handleClose() { 493 handleClose() {
419 - this.pdfUrl = ''  
420 - this.dialogVisibleContract = false 494 + this.pdfUrl = "";
  495 + this.dialogVisibleContract = false;
421 }, 496 },
422 // 表单重置 497 // 表单重置
423 reset() { 498 reset() {
@@ -434,8 +509,8 @@ export default { @@ -434,8 +509,8 @@ export default {
434 signingDate: undefined, 509 signingDate: undefined,
435 subjectInformation: undefined, 510 subjectInformation: undefined,
436 attachments: undefined, 511 attachments: undefined,
437 - reasonChange:undefined,  
438 - reasonText:undefined, 512 + reasonChange: undefined,
  513 + reasonText: undefined,
439 id: undefined, 514 id: undefined,
440 }; 515 };
441 this.resetForm("form"); 516 this.resetForm("form");
@@ -466,10 +541,10 @@ export default { @@ -466,10 +541,10 @@ export default {
466 handleEdit(row) { 541 handleEdit(row) {
467 this.loading = true; 542 this.loading = true;
468 this.reset(); 543 this.reset();
469 - this.biangeng=row  
470 - console.log("变更值:",this.biangeng)  
471 - const id = row.id || this.ids  
472 - getContract(id).then(response => { 544 + this.biangeng = row;
  545 + console.log("变更值:", this.biangeng);
  546 + const id = row.id || this.ids;
  547 + getContract(id).then((response) => {
473 this.loading = false; 548 this.loading = false;
474 this.form = response.data; 549 this.form = response.data;
475 this.open = true; 550 this.open = true;
@@ -487,8 +562,8 @@ export default { @@ -487,8 +562,8 @@ export default {
487 this.$modal.msgSuccess("合同变更成功,已重新启动流程"); 562 this.$modal.msgSuccess("合同变更成功,已重新启动流程");
488 this.open = false; 563 this.open = false;
489 this.getList(); 564 this.getList();
490 - console.log("变更列表值:",this.biangeng)  
491 - this.handleAgain2(this.biangeng) 565 + console.log("变更列表值:", this.biangeng);
  566 + this.handleAgain2(this.biangeng);
492 }) 567 })
493 .finally(() => { 568 .finally(() => {
494 this.buttonLoading = false; 569 this.buttonLoading = false;
@@ -538,7 +613,7 @@ export default { @@ -538,7 +613,7 @@ export default {
538 }, 613 },
539 /** 流程流转记录 */ 614 /** 流程流转记录 */
540 handleFlowRecord(row) { 615 handleFlowRecord(row) {
541 - console.log(row) 616 + console.log(row);
542 this.$router.push({ 617 this.$router.push({
543 path: "/workflow/process/detail/" + row.procInsId, 618 path: "/workflow/process/detail/" + row.procInsId,
544 query: { 619 query: {
@@ -557,12 +632,12 @@ export default { @@ -557,12 +632,12 @@ export default {
557 }); 632 });
558 }, 633 },
559 handleAgain(row) { 634 handleAgain(row) {
560 - console.log(row)  
561 - startProcess(row.procDefId,row).then((res) =>{  
562 - if(res){ 635 + console.log(row);
  636 + startProcess(row.procDefId, row).then((res) => {
  637 + if (res) {
563 this.$modal.msgSuccess("流程重启动成功"); 638 this.$modal.msgSuccess("流程重启动成功");
564 } 639 }
565 - }) 640 + });
566 641
567 // this.$router.push({ 642 // this.$router.push({
568 // path: "/workflow/process/start/" + row.deployId, 643 // path: "/workflow/process/start/" + row.deployId,
@@ -574,10 +649,43 @@ export default { @@ -574,10 +649,43 @@ export default {
574 // console.log(row); 649 // console.log(row);
575 }, 650 },
576 handleAgain2(row) { 651 handleAgain2(row) {
577 - console.log(row)  
578 - startProcess(row.procDefId,row).then((res) =>{  
579 - })  
580 - } 652 + console.log(row);
  653 + startProcess(row.procDefId, row).then((res) => {});
  654 + },
581 }, 655 },
582 }; 656 };
583 </script> 657 </script>
  658 +<style>
  659 +/* switch按钮样式 */
  660 +.switch .el-switch__label {
  661 + position: absolute;
  662 + display: none;
  663 + color: #fff !important;
  664 +}
  665 +/*打开时文字位置设置*/
  666 +.switch .el-switch__label--right {
  667 + z-index: 1;
  668 +}
  669 +/* 调整打开时文字的显示位子 */
  670 +.switch .el-switch__label--right span {
  671 + margin-right: 9px;
  672 +}
  673 +/*关闭时文字位置设置*/
  674 +.switch .el-switch__label--left {
  675 + z-index: 1;
  676 +}
  677 +/* 调整关闭时文字的显示位子 */
  678 +.switch .el-switch__label--left span {
  679 + margin-left: 9px;
  680 +}
  681 +/*显示文字*/
  682 +.switch .el-switch__label.is-active {
  683 + display: block;
  684 +}
  685 +/* 调整按钮的宽度 */
  686 +.switch.el-switch .el-switch__core,
  687 +.el-switch .el-switch__label {
  688 + width: 70px !important;
  689 + margin: 0;
  690 +}
  691 +</style>