|
@@ -84,7 +84,17 @@
|
|
|
placeholder="选填,请输入备注"
|
|
|
v-model="planData.remark"
|
|
|
></el-input>
|
|
|
- <div style="margin-bottom: 20px;">
|
|
|
+ <div style="margin-bottom: 20px;" class="flex-box-ce fontColorF">
|
|
|
+ <el-button class="primaryBtn" icon="el-icon-paperclip" plain size="small" @click="uploadOss">附件</el-button>
|
|
|
+ <div style="padding-left:10px">附件存放在企业钉盘,请确保钉盘有足够空间</div>
|
|
|
+ </div>
|
|
|
+ <div class="">
|
|
|
+ <div v-for="(item, index) in planData.append" style="cursor: pointer;" :key="index" class="blue">
|
|
|
+ <span @click="openImg(item)">{{ item.fileName }}</span>
|
|
|
+ <span class="red" style="padding-left:10px" @click="deleteFile(index)">删除</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div style="margin-bottom: 20px;">
|
|
|
<uploadOss
|
|
|
:headers="Xtoken"
|
|
|
class="avatar-uploader"
|
|
@@ -99,7 +109,6 @@
|
|
|
:multiple="true"
|
|
|
>
|
|
|
<el-button class="primaryBtn" icon="el-icon-picture-outline" plain size="small">图片</el-button>
|
|
|
- <!-- (最多选择3张) -->
|
|
|
</uploadOss>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -118,9 +127,8 @@
|
|
|
:before-upload="beforeFilesUpload"
|
|
|
>
|
|
|
<el-button class="primaryBtn" icon="el-icon-paperclip" plain size="small">附件</el-button>
|
|
|
- <!-- (仅支持上传xlsx,xls,doc,docx,pdf,txt,最多一份附件) -->
|
|
|
</uploadOss>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else style="background-color: #fff;">
|
|
@@ -156,7 +164,9 @@
|
|
|
<script>
|
|
|
import uploadOss from '@/components/public/upload';
|
|
|
export default {
|
|
|
- components: { uploadOss },
|
|
|
+ components: {
|
|
|
+ uploadOss
|
|
|
+ },
|
|
|
name: 'TrackManagement',
|
|
|
props: {
|
|
|
id: {
|
|
@@ -216,7 +226,7 @@ export default {
|
|
|
title: '',
|
|
|
employee_id: '',
|
|
|
images: [],
|
|
|
- append: '', //附件
|
|
|
+ append: [], //附件
|
|
|
appendName: '' //附件名称
|
|
|
},
|
|
|
planData2: {}, //备用数据,当不修改时使用
|
|
@@ -230,7 +240,9 @@ export default {
|
|
|
isOperationTwo: true, //管理记录人是否能操作指定指标
|
|
|
|
|
|
// 上传图标与附件
|
|
|
- Xtoken: { 'X-Token': this.$getToken() },
|
|
|
+ Xtoken: {
|
|
|
+ 'X-Token': this.$getToken()
|
|
|
+ },
|
|
|
img_fileList: [], // 图片附件
|
|
|
file_fileList: [], //文件附件
|
|
|
imgs: [],
|
|
@@ -238,7 +250,8 @@ export default {
|
|
|
isShowImg: false,
|
|
|
imgUrl: '',
|
|
|
|
|
|
- userData: this.$getUserData()
|
|
|
+ userData: this.$getUserData(),
|
|
|
+ spaceId: '' //上传到盯盘的spaceId
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -281,7 +294,6 @@ export default {
|
|
|
isFiltration = false;
|
|
|
this.isOperation = true;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
if (isFiltration) {
|
|
|
//当只是管理记录人员时设置指定数据
|
|
@@ -312,9 +324,83 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ openImg(item) {
|
|
|
+ let corpId = this.$getCache('corpId');
|
|
|
+ let loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading'
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ if (item) {
|
|
|
+ this.$axios('get', 'api/drive/grant',{file_id:item.fileId}).then(res => {
|
|
|
+ this.$dd.ready(() => {
|
|
|
+ this.$dd.biz.cspace.preview({
|
|
|
+ corpId: corpId,
|
|
|
+ spaceId: item.spaceId,
|
|
|
+ fileId: item.fileId,
|
|
|
+ fileName: item.fileName,
|
|
|
+ fileSize: item.fileSize,
|
|
|
+ fileType: item.fileType,
|
|
|
+ onSuccess: function(res) {
|
|
|
+ console.log(JSON.stringify(res))
|
|
|
+ },
|
|
|
+ onFail: function(err) {
|
|
|
+ console.log(JSON.stringify(err))
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }).finally(()=>{
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ uploadOss() {
|
|
|
+ let that = this;
|
|
|
+ let corpId = this.$getCache('corpId');
|
|
|
+ this.$axios('get', 'api/drive/info').then(res => {
|
|
|
+ let spaceId = res.data.data.space_id.toString();
|
|
|
+ console.log(spaceId,typeof(spaceId))
|
|
|
+ this.$dd.ready(() => {
|
|
|
+ this.$dd.biz.util.uploadAttachment({
|
|
|
+ image: {
|
|
|
+ multiple: true,
|
|
|
+ compress: false,
|
|
|
+ max: 5,
|
|
|
+ spaceId: spaceId
|
|
|
+ },
|
|
|
+ space: {
|
|
|
+ corpId: corpId,
|
|
|
+ spaceId: spaceId,
|
|
|
+ max: 5
|
|
|
+ },
|
|
|
+ file: {
|
|
|
+ spaceId: spaceId,
|
|
|
+ max: 5
|
|
|
+ },
|
|
|
+ compress: true,
|
|
|
+ multiple: false,
|
|
|
+ max: 5,
|
|
|
+ spaceId: spaceId,
|
|
|
+ types: ['photo', 'file', 'space'], //PC端支持["photo","file","space"]
|
|
|
+ onSuccess: function(res) {
|
|
|
+ console.log(JSON.stringify(res))
|
|
|
+ let data = res.data;
|
|
|
+ that.planData.append.push(...data);
|
|
|
+ that.isFill = true;
|
|
|
+ },
|
|
|
+ onFail: function(err) {
|
|
|
+ console.log(JSON.stringify(err))
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
//获取上级列表
|
|
|
async superiorList(id) {
|
|
|
- return this.$axios('get', '/api/per/user/manager_list', { id_code:this.$returnCode(id)});
|
|
|
+ return this.$axios('get', '/api/per/user/manager_list', {
|
|
|
+ id_code: this.$returnCode(id)
|
|
|
+ });
|
|
|
},
|
|
|
// 图片上传
|
|
|
beforeUpload(file) {
|
|
@@ -342,7 +428,10 @@ export default {
|
|
|
this.planData.images = [];
|
|
|
let images = [];
|
|
|
fileList.forEach((element, index) => {
|
|
|
- images.push({ url: element.url, name: element.name });
|
|
|
+ images.push({
|
|
|
+ url: element.url,
|
|
|
+ name: element.name
|
|
|
+ });
|
|
|
});
|
|
|
this.planData.images = images;
|
|
|
this.isFill = true;
|
|
@@ -352,7 +441,10 @@ export default {
|
|
|
this.planData.images = [];
|
|
|
let images = [];
|
|
|
fileList.forEach((element, index) => {
|
|
|
- images.push({ url: element.url, name: element.name });
|
|
|
+ images.push({
|
|
|
+ url: element.url,
|
|
|
+ name: element.name
|
|
|
+ });
|
|
|
});
|
|
|
this.planData.images = images;
|
|
|
this.isFill = true;
|
|
@@ -430,7 +522,7 @@ export default {
|
|
|
title: '',
|
|
|
remark: '',
|
|
|
images: [],
|
|
|
- append: '', //附件
|
|
|
+ append: [], //附件
|
|
|
appendName: '' //附件名称
|
|
|
};
|
|
|
this.indexItem.mamage_record.unshift(obj);
|
|
@@ -448,9 +540,16 @@ export default {
|
|
|
this.isFill = true;
|
|
|
});
|
|
|
}
|
|
|
- // console.log( this.activePlanIndex)
|
|
|
this.isFill2 = true;
|
|
|
},
|
|
|
+ deleteFile(index) {
|
|
|
+ if (this.planData.append.length == 0) {
|
|
|
+ this.planData.append = [];
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.planData.append.splice(index, 1);
|
|
|
+ this.isFill = true;
|
|
|
+ },
|
|
|
// 提交执行计划
|
|
|
saveActionPlan(f = function() {}) {
|
|
|
if (!this.planData.title) {
|
|
@@ -471,9 +570,9 @@ export default {
|
|
|
index_id: this.indexItem.id, //指标id
|
|
|
title: this.planData.title, //标题
|
|
|
remark: this.planData.remark, //内容
|
|
|
- images: JSON.stringify(this.planData.images),
|
|
|
- append: this.planData.append,
|
|
|
- append_name: this.planData.append_name
|
|
|
+ // images: JSON.stringify(this.planData.images),
|
|
|
+ append: JSON.stringify(this.planData.append)
|
|
|
+ // append_name: this.planData.append_name
|
|
|
};
|
|
|
// return false;
|
|
|
this.$axios('post', '/api/per/package/track', data).then(res => {
|
|
@@ -573,7 +672,7 @@ export default {
|
|
|
if (index != undefined) {
|
|
|
this.indexItem = this.actionPlanList[index].index[index2];
|
|
|
this.planData = this.indexItem.mamage_record[0];
|
|
|
- this.setFlie();
|
|
|
+ // this.setFlie();
|
|
|
this.isOperationTwo = this.indexItem.isOperation;
|
|
|
if (this.planData) {
|
|
|
this.planData2 = JSON.parse(JSON.stringify(this.planData));
|
|
@@ -583,7 +682,7 @@ export default {
|
|
|
//如果有指定下标展示
|
|
|
this.indexItem = this.actionPlanList[this.planIndex[0]].index[this.planIndex[1]];
|
|
|
this.planData = this.indexItem.mamage_record[0];
|
|
|
- this.setFlie();
|
|
|
+ // this.setFlie();
|
|
|
this.selectItemIndex = this.planIndex[0];
|
|
|
this.isOperationTwo = this.indexItem.isOperation;
|
|
|
if (this.planData) {
|
|
@@ -593,7 +692,7 @@ export default {
|
|
|
} else {
|
|
|
this.indexItem = this.actionPlanList[0].index[0];
|
|
|
this.planData = this.indexItem.mamage_record[0];
|
|
|
- this.setFlie();
|
|
|
+ // this.setFlie();
|
|
|
this.isOperationTwo = this.indexItem.isOperation;
|
|
|
if (this.planData) {
|
|
|
this.planData2 = JSON.parse(JSON.stringify(this.planData));
|
|
@@ -607,7 +706,12 @@ export default {
|
|
|
if (this.planData) {
|
|
|
this.img_fileList = this.planData.images;
|
|
|
if (this.planData.append) {
|
|
|
- this.file_fileList = [{ name: this.planData.append_name, url: this.planData.append }];
|
|
|
+ this.file_fileList = [
|
|
|
+ {
|
|
|
+ name: this.planData.append_name,
|
|
|
+ url: this.planData.append
|
|
|
+ }
|
|
|
+ ];
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -644,55 +748,67 @@ export default {
|
|
|
<style scoped="scoped">
|
|
|
::v-deep .el-icon-picture-outline {
|
|
|
}
|
|
|
+
|
|
|
.all-derawer ::v-deep.el-drawer {
|
|
|
height: 90% !important;
|
|
|
border-radius: 10px 10px 0 0;
|
|
|
background-color: #f5f7fa;
|
|
|
min-width: 1100px !important;
|
|
|
}
|
|
|
+
|
|
|
.all-derawer ::v-deep.el-drawer__header {
|
|
|
background-color: #f5f7fa;
|
|
|
padding: 12px 20px;
|
|
|
margin-bottom: 0px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
+
|
|
|
::v-deep .el-upload-list__item-name {
|
|
|
max-width: 250px;
|
|
|
}
|
|
|
+
|
|
|
::v-deep :focus {
|
|
|
outline: 0;
|
|
|
}
|
|
|
+
|
|
|
.btns {
|
|
|
position: absolute;
|
|
|
right: 20px;
|
|
|
top: 16px;
|
|
|
z-index: 999;
|
|
|
}
|
|
|
+
|
|
|
.plan-right-name {
|
|
|
color: #222;
|
|
|
}
|
|
|
+
|
|
|
.plan-right {
|
|
|
padding: 20px;
|
|
|
position: relative;
|
|
|
background-color: #f5f7fa;
|
|
|
min-height: 600px;
|
|
|
}
|
|
|
+
|
|
|
.plan-right-date {
|
|
|
text-align: center;
|
|
|
position: relative;
|
|
|
margin-bottom: 30px;
|
|
|
}
|
|
|
+
|
|
|
.plan-textarea ::v-deep textarea {
|
|
|
background-color: #f5f7fa;
|
|
|
border: none;
|
|
|
}
|
|
|
+
|
|
|
.plan-right-title {
|
|
|
border-bottom: 1px solid #f1f1f1;
|
|
|
}
|
|
|
+
|
|
|
.plan-right-title ::v-deep textarea {
|
|
|
background-color: #f5f7fa;
|
|
|
border: none;
|
|
|
}
|
|
|
+
|
|
|
.drawer-left {
|
|
|
background-color: #fff;
|
|
|
padding: 0 15px;
|
|
@@ -701,6 +817,7 @@ export default {
|
|
|
overflow: auto;
|
|
|
padding-bottom: 60px;
|
|
|
}
|
|
|
+
|
|
|
.drawer-left-title {
|
|
|
padding: 16px 0;
|
|
|
font-weight: 600;
|
|
@@ -708,28 +825,35 @@ export default {
|
|
|
color: #222;
|
|
|
border-bottom: 1px solid #f1f1f1;
|
|
|
}
|
|
|
+
|
|
|
.drawer-item {
|
|
|
padding: 16px 0;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
.drawer-item:hover {
|
|
|
background-color: #f5f7fa;
|
|
|
}
|
|
|
+
|
|
|
.drawer-left .active-drawer-item {
|
|
|
background-color: #f5f7fa;
|
|
|
border-right: 2px solid #409eff;
|
|
|
}
|
|
|
+
|
|
|
.plan-left-content:hover {
|
|
|
background-color: #f5f7fa;
|
|
|
}
|
|
|
+
|
|
|
.plan-left .active-drawer-item {
|
|
|
background-color: #f5f7fa;
|
|
|
}
|
|
|
+
|
|
|
.drawer-right-header {
|
|
|
background-color: #fff;
|
|
|
border-bottom: 1px solid #f1f1f1;
|
|
|
padding: 20px;
|
|
|
}
|
|
|
+
|
|
|
.drawer-right-main {
|
|
|
padding: 0px 20px;
|
|
|
height: 50px;
|
|
@@ -737,16 +861,19 @@ export default {
|
|
|
background-color: #fff;
|
|
|
border-bottom: 1px solid #f1f1f1;
|
|
|
}
|
|
|
+
|
|
|
.plan-title {
|
|
|
font-size: 14px;
|
|
|
color: #666666;
|
|
|
margin-top: 5px;
|
|
|
}
|
|
|
+
|
|
|
.plan-left {
|
|
|
background-color: #fff;
|
|
|
border-right: 1px solid #f1f1f1;
|
|
|
overflow: auto;
|
|
|
}
|
|
|
+
|
|
|
.remark {
|
|
|
height: 100px;
|
|
|
display: -webkit-box;
|
|
@@ -754,11 +881,12 @@ export default {
|
|
|
-webkit-line-clamp: 6;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
+
|
|
|
.plan-left-content {
|
|
|
border-bottom: 1px solid #f1f1f1;
|
|
|
padding: 10px 16px;
|
|
|
cursor: pointer;
|
|
|
width: 100%;
|
|
|
- box-sizing: border-box;
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
|
</style>
|