This commit is contained in:
parent
e20ba76e7d
commit
a56768d330
Binary file not shown.
|
|
@ -26,6 +26,7 @@
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||||
|
<el-button type="warning" icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
|
||||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -179,6 +180,45 @@
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 导入对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="upload.title"
|
||||||
|
:visible.sync="upload.open"
|
||||||
|
width="400px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xlsx, .xls"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
|
<a
|
||||||
|
:href="uploadUrlTemp"
|
||||||
|
download="机具检验标识信息导入模板"
|
||||||
|
class="text-button primary-lease"
|
||||||
|
style="color: #409eff; text-decoration: none; font-size: 14px;"
|
||||||
|
>
|
||||||
|
模板下载
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -187,6 +227,7 @@ import {
|
||||||
addWsMaInfoData, delGadget,
|
addWsMaInfoData, delGadget,
|
||||||
getDeviceType, getGadgetInfo, getGadgetList, updateGadgetInfo
|
getDeviceType, getGadgetInfo, getGadgetList, updateGadgetInfo
|
||||||
} from '@/api/ma/device'
|
} from '@/api/ma/device'
|
||||||
|
import {getToken} from "@/utils/auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Device',
|
name: 'Device',
|
||||||
|
|
@ -221,6 +262,22 @@ export default {
|
||||||
sex: undefined,
|
sex: undefined,
|
||||||
teamId: undefined
|
teamId: undefined
|
||||||
},
|
},
|
||||||
|
uploadUrlTemp:null,
|
||||||
|
// 导入参数
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层(用户导入)
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题(用户导入)
|
||||||
|
title: "",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 是否更新已经存在的用户数据
|
||||||
|
updateSupport: 0,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + "/material/wsMaInfo/importData"
|
||||||
|
},
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
|
@ -282,6 +339,8 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getDeviceTypeOptions();
|
this.getDeviceTypeOptions();
|
||||||
|
this.uploadUrlTemp=window.location.origin+"/iws/jiju-api/aaa.xlsx";
|
||||||
|
// this.uploadUrlTemp=window.location.origin+"/aaa.xlsx";
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
|
|
@ -373,6 +432,10 @@ export default {
|
||||||
`领料出库报表_${currentTime}.xlsx`
|
`领料出库报表_${currentTime}.xlsx`
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
handleImport() {
|
||||||
|
this.upload.title = "小工具编码信息导入";
|
||||||
|
this.upload.open = true;
|
||||||
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
@ -497,6 +560,22 @@ export default {
|
||||||
};
|
};
|
||||||
this.deviceModelOptions = [];
|
this.deviceModelOptions = [];
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
this.upload.open = false;
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 提交上传文件
|
||||||
|
submitFileForm() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -524,4 +603,20 @@ export default {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
.el-message-box {
|
||||||
|
display: inline-block;
|
||||||
|
width: 830px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #e6ebf5;
|
||||||
|
font-size: 18px;
|
||||||
|
-webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue