Merge branch 'material-ui' of http://14.103.246.124:16000/bonus/bonus-ui into material-ui

This commit is contained in:
hongchao 2025-09-06 18:13:19 +08:00
commit 8e0cb9831e
3 changed files with 82 additions and 0 deletions

BIN
public/aaa.xlsx Normal file

Binary file not shown.

View File

@ -26,6 +26,7 @@
<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 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-form-item>
</el-form>
@ -179,6 +180,45 @@
<el-button @click="cancel"> </el-button>
</div>
</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>仅允许导入xlsxlsx格式文件</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>
</template>
@ -187,6 +227,7 @@ import {
addWsMaInfoData, delGadget,
getDeviceType, getGadgetInfo, getGadgetList, updateGadgetInfo
} from '@/api/ma/device'
import {getToken} from "@/utils/auth";
export default {
name: 'Device',
@ -221,6 +262,22 @@ export default {
sex: 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: "",
//
@ -282,6 +339,8 @@ export default {
created() {
this.getList()
this.getDeviceTypeOptions();
this.uploadUrlTemp=window.location.origin+"/iws/jiju-api/aaa.xlsx";
// this.uploadUrlTemp=window.location.origin+"/aaa.xlsx";
},
methods: {
/** 查询列表 */
@ -373,6 +432,10 @@ export default {
`领料出库报表_${currentTime}.xlsx`
);
},
handleImport() {
this.upload.title = "小工具编码信息导入";
this.upload.open = true;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
@ -497,6 +560,22 @@ export default {
};
this.deviceModelOptions = [];
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();
}
}
}

View File

@ -480,6 +480,7 @@ export default {
},
/** 机具类型 */
equipmentType() {
const loading = this.$loading()
equipmentTypeTree({
agreementIdList: this.agreementId,
proId: this.maForm.proId,
@ -497,6 +498,8 @@ export default {
if (this.equipmentList.length > 0) {
this.deviceType = this.equipmentList.map(item => item.typeId)
}
}).finally(() => {
loading.close()
})
},
//