From 3c75ba788897a524771bfde12feddcc94aaf14c6 Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期二, 22 四月 2025 11:26:02 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiXinLaiRui/LunDuiYa --- 项目代码/WMS/WIDESEA_WMSClient/src/extension/quartzJob/extend/importDevicePro.vue | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 116 insertions(+), 0 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/quartzJob/extend/importDevicePro.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/quartzJob/extend/importDevicePro.vue" new file mode 100644 index 0000000..66b521c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/quartzJob/extend/importDevicePro.vue" @@ -0,0 +1,116 @@ +<template> + <div> + <vol-box + v-model="showDetialBox" + :lazy="true" + :height="350" + :width="600" + :padding="15" + title="璁惧鍗忚淇℃伅-瀵煎叆" + > + <upload-excel + ref="upload_excel" + :url="url" + :template="template" + ></upload-excel> + </vol-box> + </div> +</template> + + <script> +import VolBox from "@/components/basic/VolBox.vue"; +import UploadExcel from "@/components/basic/UploadExcel.vue"; +export default { + components: { VolBox, UploadExcel }, + data() { + return { + showDetialBox: false, + url: "", + template: { + url: "", //妯℃澘涓嬭浇璺緞锛屽鏋滄病鏈夋ā鏉胯矾寰勶紝鍒欎笉鏄剧ず涓嬭浇妯℃澘鍔熻兘 + fileName: "璁惧鍗忚淇℃伅瀵煎叆妯℃澘", //涓嬭浇妯℃澘鐨勬枃浠跺悕 + }, + }; + }, + methods: { + open() { + this.template.url = `${this.http.ipAddress}api/DeviceProtocol/DownLoadTemplate`; + this.url = `${this.http.ipAddress}api/DeviceProtocol/GetImportData`; + this.showDetialBox = true; + this.$nextTick(() => { + this.$refs.upload_excel.upload = this.upload; + console.log(this.$refs.upload_excel); + }); + }, + upload() { + console.log("upload"); + let _url = this.url; + if (!_url) { + return this.$Message.error("娌℃湁閰嶇疆濂経rl"); + } + + if (!this.$refs.upload_excel.file) { + return this.$Message.error("璇烽�夋嫨鏂囦欢"); + } + var formData = new FormData(); + formData.append("fileInput", this.$refs.upload_excel.file); + if (!this.$refs.upload_excel.importExcelBefore(formData)) { + return; + } + this.$refs.upload_excel.loadingStatus = true; + this.http.post(_url, formData).then( + (x) => { + // this.$refs.uploadFile.clearFiles(); + this.$refs.upload_excel.loadingStatus = false; + this.$refs.upload_excel.file = null; + if (x.status) { + this.$emit("parentCall", ($vue) => { + $vue.$refs.detail.rowData.push(...x.data); + }); + } + + this.message = x.message; + this.resultClass = x.status ? "v-r-success" : "v-r-error"; + }, + (error) => { + this.$refs.upload_excel.loadingStatus = false; + } + ); + }, + }, + created() {}, +}; +</script> + + <style scoped> +.el-col { + border-radius: 4px; +} +.grid-content { + border-radius: 4px; + min-height: 36px; +} +.content-text { + display: flex; + align-items: center; + justify-content: center; +} +.left-text { + display: flex; + align-items: center; + justify-content: flex-start; +} +</style> + <style> +.el-table .warning-row { + background: #fcf1e2; +} + +.el-table .success-row { + background: #f0f9eb; +} + +.el-table .error-row { + background: #fde2e2; +} +</style> \ No newline at end of file -- Gitblit v1.9.3