Browse Source

[feat]采购:添加供应商详情页面跳转

dev
zhangsiqi 6 months ago
parent
commit
aa7b48d8ad
  1. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java
  2. 59
      ruoyi-admin/src/main/resources/templates/system/supplier/add.html
  3. 2
      ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html

10
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java

@ -113,6 +113,14 @@ public class SysSupplierController extends BaseController
return prefix + "/edit"; return prefix + "/edit";
} }
@GetMapping("/detail/{supplierId}")
public String detail(@PathVariable("supplierId") Long supplierId, ModelMap mmap)
{
SysSupplier sysSupplier = sysSupplierService.selectSysSupplierById(supplierId);
mmap.put("sysSupplier", sysSupplier);
return prefix + "/detail";
}
/** /**
* 修改保存供应商资料 * 修改保存供应商资料
*/ */
@ -199,4 +207,6 @@ public class SysSupplierController extends BaseController
public Result getId() throws Exception { public Result getId() throws Exception {
return Result.getSuccessResult(sysSupplierService.getId()); return Result.getSuccessResult(sysSupplierService.getId());
} }
} }

59
ruoyi-admin/src/main/resources/templates/system/supplier/add.html

@ -6,7 +6,7 @@
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> <link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/>
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-supplier-add"> <form class="form-horizontal m" id="form-supplier-add">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">供应商编号:</label> <label class="col-sm-3 control-label is-required">供应商编号:</label>
@ -253,11 +253,62 @@
<script th:src="@{/ajax/libs/vue/vue.js}"></script> <script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> <script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript"> <script th:inline="javascript">
new Vue({
el: '#app',
data: function() {
return {
fileList: [],
fileUploadUrl: ctx + "common/uploadSingleFile",
fileDeleteUrl: ctx + "common/deleteFile",
fileIdList:[],
}
},
methods: {
uploadSuccess(response, file, fileList) {
console.log(response);
if(response.code == web_status.SUCCESS){
var attachFileId = response.data.id;
file.attachFileId = attachFileId;
this.fileIdList.push(attachFileId);
$("#fileIdStr").val(this.fileIdList.join(";"));
$.modal.msgSuccess("上传成功");
}else{
$.modal.alertError(response.msg);
}
},
uploadRemove(file, fileList) {
console.log(file, fileList);
var attachFileId = file.attachFileId;
$.ajax({
type: "get",
url: this.fileDeleteUrl,
data: {id:attachFileId},
cache: false,
async: false, // 设置成同步
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
var index = this.fileIdList.indexOf(attachFileId);
if(index!=-1){
this.fileIdList.splice(index,1);
$("#fileIdStr").val(this.fileIdList.join(";"));
}
$.modal.msgSuccess("删除附件成功。");
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertError("删除附件失败。");
}
});
},
}
})
var prefix = ctx + "system/supplier"; var prefix = ctx + "system/supplier";
var userName = [[${@permission.getPrincipalProperty('userName')}]]; var userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-supplier-add").validate({ $("#form-supplier-add").validate({focusCleanup: true});
focusCleanup: true
});
$(function () { $(function () {
$.ajax({ $.ajax({
url: prefix + "/getId", url: prefix + "/getId",

2
ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html

@ -203,7 +203,7 @@
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> '); actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
} }
// 详情 // 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.salesOrderId + '\')"><i class="fa fa-eye"></i> 详情</a> '); actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.supplierId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join(''); return actions.join('');
} }
} }

Loading…
Cancel
Save