Browse Source

[feat]采购管理: 采购报价新增详情页面,页面展示修复。

dev
zhangsiqi 4 months ago
parent
commit
a8bd3eb4f7
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java
  3. 274
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html
  4. 1
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html

8
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java

@ -133,7 +133,13 @@ public class PurchaseQuoteController extends BaseController
mmap.put("purchaseQuote", purchaseQuote);
return prefix + "/edit";
}
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{
PurchaseQuote purchaseQuote = purchaseQuoteService.selectPurchaseQuoteById(id);
mmap.put("purchaseQuote", purchaseQuote);
return prefix + "/detail";
}
/**
* 修改保存采购报价单
*/

6
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java

@ -412,10 +412,14 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
if(roleKeys.contains("cgyRole")){
variables.put("authority",1);
}else if(roleKeys.contains("cgjlRole")){
variables.put("authority",2);
}else if(roleKeys.contains("cgzgRole")){
variables.put("authority",3);
}
// 角色不同审核人不同
if(roleKeys.contains("admin")){
variables.put("authority",2);
variables.put("authority",4);
}
}

274
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html

@ -0,0 +1,274 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('详情采购报价单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/>
</head>
<body class="white-bg">
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-purchaseQuote-edit" th:object="${purchaseQuote}">
<input name="purchaseQuoteId" th:field="*{purchaseQuoteId}" type="hidden">
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label" >采购报价单号:</label>
<div class="col-sm-8">
<input id="purchaseQuoteCode_edit" name="purchaseQuoteCode" th:field="*{purchaseQuoteCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label>
<div class="input-group date">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注说明:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">附件:</label>
<div class="col-sm-8">
<el-upload
:action="fileUploadUrl"
:on-success="uploadSuccess"
:on-preview="handlePictureCardPreview"
:on-remove="uploadRemove"
:file-list="fileList"
:limit="5"
list-type="picture"
accept=".jpg,.png"
multiple>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
<input id="fileIdStr" type="text" name="fileIdStr" hidden>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<div class="input-group">
<input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" />
<span class="input-group-addon">%</span>
</div>
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-purchaseQuoteChild"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript">
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var prefix = ctx + "purchase/purchaseQuote";
var purchaseQuote = [[${purchaseQuote}]];
new Vue({
el: '#app',
data: function() {
return {
fileList: [],
fileUploadUrl: ctx + "common/uploadSingleFile",
fileDeleteUrl: ctx + "common/deleteFile",
fileIdList:[],
dialogImageUrl: '',
dialogVisible: false
}
},
methods: {
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
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("删除附件失败。");
}
});
},
}
});
$("#form-purchaseQuote-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-purchaseQuoteChild',
url: ctx + "purchase/purchaseQuoteChild/list",
pagination: false,
queryParams: function(params) {
var temp = {
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
sortName: params.sort,
sortOrder: params.order,
purchaseQuoteCode: purchaseQuote.purchaseQuoteCode,
delFlag: 0
}
return temp;
},
sidePagination: "client",
model: "物料报价信息",
columns: [
{checkbox: true},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title:'最新报价',field: 'materialSole',align: 'center',},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true,},
{title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
],
};
$.table.init(options);
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('insertRow', {
index:1,
row: {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
materialSole: '',
materialNum: 1,
materialRmb: "",
materialNoRmb: "",
materialNoRmbSum: "",
materialRmbSum: "",
remark: ""
}
})
layer.close(index);
}
function insertRow() {
var url = ctx + "erp/material/select";
var options = {
title: '选择料号',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(materialCode){
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('remove', {
field: 'materialCode',
values: materialCode
})
}
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

1
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html

@ -98,6 +98,7 @@
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
modalName: "采购报价单",
fixedColumns: true, // 启用冻结列
fixedRightNumber: 1, // 冻结右列个数

Loading…
Cancel
Save