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

Merge remote-tracking branch 'origin/master'

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