|
@@ -56,12 +56,14 @@
|
|
<input type="text" class="my-input" style="width:80px" value="${componentsName!}" placeholder="零件名称" id="componentsName" name="componentsName">
|
|
<input type="text" class="my-input" style="width:80px" value="${componentsName!}" placeholder="零件名称" id="componentsName" name="componentsName">
|
|
<button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont"></i> 搜索</button>
|
|
<button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont"></i> 搜索</button>
|
|
</form>
|
|
</form>
|
|
- <form id="sourcefile" name="sourcefile" action="" method="post" enctype="multipart/form-data" style="width: 42%;display: inline-block;">
|
|
|
|
|
|
+ <#--<form id="sourcefile" name="sourcefile" action="" method="post" enctype="multipart/form-data" style="width: 42%;display: inline-block;">
|
|
<input class="my-btn-search" data-loading-text="请勿重复提交" type="button" value="上传EXCEL" onClick="upPolicy()">
|
|
<input class="my-btn-search" data-loading-text="请勿重复提交" type="button" value="上传EXCEL" onClick="upPolicy()">
|
|
<input style="width: 125px;" id="source_file" name="sourceFile" type="file" value="" />
|
|
<input style="width: 125px;" id="source_file" name="sourceFile" type="file" value="" />
|
|
<button type="button" style="cursor:pointer;" class="my-btn-search" onclick="toExcel();">导出Excel</button>
|
|
<button type="button" style="cursor:pointer;" class="my-btn-search" onclick="toExcel();">导出Excel</button>
|
|
<button type="button" style="cursor:pointer;" class="my-btn-search" onclick="downloadExcel();">下载模板</button>
|
|
<button type="button" style="cursor:pointer;" class="my-btn-search" onclick="downloadExcel();">下载模板</button>
|
|
- </form>
|
|
|
|
|
|
+ </form>-->
|
|
|
|
+ <button onClick="upFiles();" class="btn radius" style="background: #32a3d8;color: #fff;" type="button"><i class="Hui-iconfont"></i> 上传Excel</button>
|
|
|
|
+ <button type="button" style="cursor:pointer;" class="my-btn-search" onclick="downloadExcel();">下载模板</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="mt-20">
|
|
<div class="mt-20">
|
|
@@ -125,14 +127,64 @@
|
|
<tfoot>
|
|
<tfoot>
|
|
<#include "/base/page_util.ftl">
|
|
<#include "/base/page_util.ftl">
|
|
</tfoot>
|
|
</tfoot>
|
|
|
|
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
|
|
|
|
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
|
|
|
|
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
|
|
|
|
+<script type="text/plain" id="upload_ue"></script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
|
+ var _editor;
|
|
|
|
+ $(function() {
|
|
|
|
+ //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
|
|
|
|
+ _editor = UE.getEditor('upload_ue',{
|
|
|
|
+ initialFrameWidth : 375,
|
|
|
|
+ initialFrameHeight: 600
|
|
|
|
+ });
|
|
|
|
+ _editor.ready(function () {
|
|
|
|
+ _editor.setDisabled("attachment");//设置编辑器不可用
|
|
|
|
+ _editor.hide();//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
|
|
|
|
+ //侦听图片上传
|
|
|
|
+ _editor.addListener('beforeInsertImage', function (t, arg) {
|
|
|
|
+ console.log(arg[0].src);
|
|
|
|
+ $("#picture").attr("value", arg[0].src);//将地址赋值给相应的input,只去第一张图片的路径
|
|
|
|
+ $("#preview").attr("src", arg[0].src); //图片预览
|
|
|
|
+ });
|
|
|
|
+ //侦听文件上传,取上传文件列表中第一个上传的文件的路径
|
|
|
|
+ _editor.addListener('afterUpfile', function (t, arg) {
|
|
|
|
+ console.log(arg[0].url);
|
|
|
|
+ /*window.location.href=root_path + '/admin/machineParts/excelAdd?sourceFile='+arg[0].url;*/
|
|
|
|
+ $.ajax({
|
|
|
|
+ cache: true,
|
|
|
|
+ type: "POST",
|
|
|
|
+ data: {"sourceFile":arg[0].url},
|
|
|
|
+ contentType: false,
|
|
|
|
+ processData: false,
|
|
|
|
+ url: "${path}/admin/machineParts/excelAdd",
|
|
|
|
+ async: false,
|
|
|
|
+ success: function(data){
|
|
|
|
+ if (data) {
|
|
|
|
+ layer.msg('添加成功!', {icon: 1, time: 2000},function () {
|
|
|
|
+ window.location.href = '${path}/admin/machineParts/_parts_list'
|
|
|
|
+ });
|
|
|
|
|
|
-
|
|
|
|
- /*管理员-编辑*/
|
|
|
|
- function parts_edit(title,url,id,w,h){
|
|
|
|
- layer_show(title,url,w,h);
|
|
|
|
|
|
+ }else{
|
|
|
|
+ layer.msg('添加失败!', {icon: 2, time: 2000});
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: function(XmlHttpRequest, textStatus, errorThrown){
|
|
|
|
+ layer.msg('添加失败!', {icon: 2, time: 2000});
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ $("#source_file").attr("value", _editor.options.filePath + arg[0].url);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ //弹出文件上传的对话框
|
|
|
|
+ function upFiles() {
|
|
|
|
+ var myFiles = _editor.getDialog("attachment");
|
|
|
|
+ myFiles.open();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/* 修改二级菜单状态 */
|
|
/* 修改二级菜单状态 */
|
|
function update_FAQState(detaId) {
|
|
function update_FAQState(detaId) {
|
|
layer.confirm('确认要停用吗?',function(index){
|
|
layer.confirm('确认要停用吗?',function(index){
|
|
@@ -153,7 +205,7 @@
|
|
|
|
|
|
</script>
|
|
</script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
- function upPolicy() {
|
|
|
|
|
|
+ /*function upPolicy() {
|
|
if($('#source_file').val().length > 0){
|
|
if($('#source_file').val().length > 0){
|
|
var formData = new FormData($( "#sourcefile" )[0]);
|
|
var formData = new FormData($( "#sourcefile" )[0]);
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -182,7 +234,7 @@
|
|
layer.msg('请先上传文件!', {icon: 2, time: 2000});
|
|
layer.msg('请先上传文件!', {icon: 2, time: 2000});
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
/**
|
|
/**
|
|
* 跳转到添加零件页面
|
|
* 跳转到添加零件页面
|
|
*/
|
|
*/
|