Commit 97d9a55b authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents f0ce4dca c93799f2
......@@ -395,7 +395,6 @@ export default {
let matterId = this.$route.query.matterId;
this.getMatterInfo(matterId);
}
console.log(this.matterDict);
this.getDeptListData();
},
methods: {
......
......@@ -23,9 +23,11 @@
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 需要 -->
<template slot="num" slot-scope="text, record, index">
{{ (current - 1) * size + index + 1 }}
</template>
<!-- 查看详情 -->
<template slot="more" slot-scope="text">
<a class="look-more" @click="lookMore(text)">查看详情</a>
</template>
......
......@@ -5,6 +5,7 @@
@cancel="handleClose"
:title="title"
@ok="handleOk"
:maskClosable="false"
>
<template slot="footer">
<a-button @click="handleInit">重置</a-button>
......
<template>
<a-spin tip="正在上传中..." :spinning="spinning">
<div class="website">
<!-- 右边 -->
<div class="right ff">
......@@ -20,7 +21,11 @@
>
{{ curDept }}
</div>
<a-popover arrowPointAtCenter placement="rightTop" title="部门列表">
<a-popover
arrowPointAtCenter
placement="rightTop"
title="部门列表"
>
<template slot="content">
<div class="dept-list" v-if="deptData.length">
<a-radio-group v-model="deptSearch" @change="changeDept">
......@@ -34,7 +39,11 @@
</a-radio>
</a-radio-group>
</div>
<a-empty style="margin-top: 20px" :image="simpleImage" v-else />
<a-empty
style="margin-top: 20px"
:image="simpleImage"
v-else
/>
</template>
<div class="item dept-select-item3">
......@@ -71,7 +80,11 @@
>
{{ curWindow }}
</div>
<a-popover arrowPointAtCenter placement="rightTop" title="窗口列表">
<a-popover
arrowPointAtCenter
placement="rightTop"
title="窗口列表"
>
<template slot="content">
<div class="dept-list" v-if="windowData.length">
<a-radio-group
......@@ -88,7 +101,11 @@
</a-radio>
</a-radio-group>
</div>
<a-empty style="margin-top: 20px" :image="simpleImage" v-else />
<a-empty
style="margin-top: 20px"
:image="simpleImage"
v-else
/>
</template>
<div class="item dept-select-item3">
......@@ -114,15 +131,44 @@
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1">
<a style="color: #1890ff" @click="handleUpload"> 批量导入 </a>
<a-upload
name="file"
:multiple="false"
:action="api + 'base/workman/importData'"
:showUploadList="false"
:headers="headers"
@change="handleChange"
:data="{
siteId,
deptId: deptSearch,
windowId: windowSearch,
}"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
>
<div style="color: #1890ff">批量导入</div>
</a-upload>
<!-- <a style="color: #1890ff" @click="handleUpload"> 批量导入 </a> -->
</a-menu-item>
<a-menu-item key="2">
<a style="color: #1890ff" @click="handleDownload"> 模板下载</a>
<a style="color: #1890ff" @click="handleDownload">
模板下载</a
>
</a-menu-item>
<a-menu-item key="3">
<a style="color: #1890ff" @click="handleUploadImg">
<a-upload
name="file"
:multiple="false"
:action="api + 'base/file/commonupload'"
:showUploadList="false"
:headers="headers"
@change="handleChangeImg"
accept="application/x-zip-compressed"
>
<div style="color: #1890ff">批量导入照片</div>
</a-upload>
<!-- <a style="color: #1890ff" @click="handleUploadImg">
批量导入照片
</a>
</a> -->
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
......@@ -194,7 +240,9 @@
</template>
<!-- 最后登录时间 -->
<template slot="logintime" slot-scope="text">
<span v-if="text.logintime">{{ text.logintime | dateFormat }}</span>
<span v-if="text.logintime">{{
text.logintime | dateFormat
}}</span>
<span v-else>--</span>
</template>
<!-- 操作 -->
......@@ -229,6 +277,7 @@
<!-- 修改密码 -->
<EditPwd ref="EditPwd" :visibleEditPwd.sync="visibleEditPwd"></EditPwd>
</div>
</a-spin>
</template>
<script>
......@@ -244,10 +293,10 @@ import {
getWorkmanList,
delWorkman,
downLoadTemplate,
uploadFile,
// uploadFile,
uploadAllImg,
// editWorkman,
importData,
// importData,
} from "@/services/dept";
const columns = [
......@@ -325,6 +374,10 @@ export default {
},
data() {
return {
headers: {
Authorization: local.getLocal("token"),
},
spinning: false,
columns,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
loading: false,
......@@ -485,9 +538,9 @@ export default {
this.getWorkmanData();
},
// 导入
handleUpload() {
this.importFile();
},
// handleUpload() {
// this.importFile();
// },
// 批量导入工作人员模板下载
async handleDownload() {
......@@ -506,70 +559,104 @@ export default {
},
//导入文件
importFile() {
let that = this;
let input = document.createElement("input");
input.setAttribute("type", "file");
input.setAttribute(
"accept",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
);
input.style.display = "none";
input.addEventListener("change", () => {
if (input.files && input.files.length > 0) {
that.uploadFile(input.files[0]);
}
});
document.body.appendChild(input);
input.click();
document.body.removeChild(input);
},
// importFile() {
// let that = this;
// let input = document.createElement("input");
// input.setAttribute("type", "file");
// input.setAttribute(
// "accept",
// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
// );
// input.style.display = "none";
// input.addEventListener("change", () => {
// if (input.files && input.files.length > 0) {
// that.uploadFile(input.files[0]);
// }
// });
// document.body.appendChild(input);
// input.click();
// document.body.removeChild(input);
// },
//上传文件
async uploadFile(file) {
let formData = new FormData();
formData.append("file", file);
formData.append("siteId", this.siteId);
formData.append("deptId", this.deptSearch);
formData.append("windowId", this.windowSearch);
let config = {
headers: {
"Content-Type": "multipart/form-data",
},
};
let res = await importData(formData, config);
let { code, msg } = res.data;
if (code === 1) {
// async uploadFile(file) {
// let formData = new FormData();
// formData.append("file", file);
// formData.append("siteId", this.siteId);
// formData.append("deptId", this.deptSearch);
// formData.append("windowId", this.windowSearch);
// let config = {
// headers: {
// "Content-Type": "multipart/form-data",
// },
// };
// let res = await importData(formData, config);
// let { code, msg } = res.data;
// if (code === 1) {
// this.$message.success(msg);
// this.page = 1;
// this.getWorkmanData();
// }
// },
// 批量上传工作人员
handleChange({ file }) {
this.spinning = true;
if (file.status === "done") {
let { code, msg } = file.response;
if (code == 1) {
this.$message.success(msg);
this.page = 1;
this.getWorkmanData();
} else {
this.$message.error(msg);
}
this.spinning = false;
}
},
// 批量导入照片
handleUploadImg() {
let input = document.createElement("input");
input.setAttribute("type", "file");
input.setAttribute("accept", "application/x-zip-compressed");
input.style.display = "none";
input.addEventListener("change", async () => {
if (input.files && input.files.length > 0) {
let file = input.files[0];
let formData = new FormData();
formData.append("file", file);
let res = await uploadFile(formData);
if (res.data.code == 1) {
let result = await uploadAllImg({
filePath: res.data.url,
// handleUploadImg() {
// let input = document.createElement("input");
// input.setAttribute("type", "file");
// input.setAttribute("accept", "application/x-zip-compressed");
// input.style.display = "none";
// input.addEventListener("change", async () => {
// if (input.files && input.files.length > 0) {
// let file = input.files[0];
// let formData = new FormData();
// formData.append("file", file);
// let res = await uploadFile(formData);
// if (res.data.code == 1) {
// let result = await uploadAllImg({
// filePath: res.data.url,
// });
// if (result.data.code === 1) {
// this.$message.success(result.data.msg);
// }
// }
// }
// });
// document.body.appendChild(input);
// input.click();
// document.body.removeChild(input);
// },
// 批量导入照片
async handleChangeImg({ file }) {
this.spinning = true;
if (file.status === "done") {
let { code, msg } = file.response;
if (code == 1) {
let url = file.response.url;
let res = await uploadAllImg({
filePath: url,
});
if (result.data.code === 1) {
this.$message.success(result.data.msg);
if (res.data.code == 1) {
this.$message.success(res.data.msg);
// this.spinning = false;
}
} else {
this.$message.error(msg);
}
this.spinning = false;
}
});
document.body.appendChild(input);
input.click();
document.body.removeChild(input);
},
// 修改密码弹窗
changePwd(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment