|
|
@ -6,7 +6,7 @@ |
|
|
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
|
|
|
</head> |
|
|
|
<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"> |
|
|
|
<div class="form-group"> |
|
|
|
<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/element-ui/element-ui.js}"></script> |
|
|
|
<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 userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|
|
|
$("#form-supplier-add").validate({ |
|
|
|
focusCleanup: true |
|
|
|
}); |
|
|
|
$("#form-supplier-add").validate({focusCleanup: true}); |
|
|
|
$(function () { |
|
|
|
$.ajax({ |
|
|
|
url: prefix + "/getId", |
|
|
|