Commit 2eb05572 authored by 罗超's avatar 罗超

新增功能

parent 83a68ee9
<template>
<div>
<div style="margin:10px auto;">
<h3
v-if="d.w"
style="font-size:18px;border-bottom:1px solid #ddd;font-weight:400;font-family:pingfangR;padding-bottom:10px;"
>
<span class="circle" v-if="d.w.ExamineStatus==0||d.w.ExamineStatus==-1"></span>
<span class="circle green" v-else-if="d.w.Status==0"></span>
<span class="circle red" v-else-if="d.w.Status==1||d.w.Status==2"></span>
<span class="circle black" v-else-if="d.w.Status==3"></span>
<span style="margin-right:15px;">{{d.w.Title}}</span>
<el-tag v-if="d.w.Tags.length>0">{{d.w.Tags}}</el-tag>
</h3>
<div
v-if="d.w"
style="font-size:14px;font-family:pingfangR;margin: 10px 0;padding: 10px;background: #FFF;"
>{{d.w.Description}}</div>
<fieldset style="border: 1px solid #DDD;padding: 13px;font-size: 12px;">
<legend style="padding:0 10px; font-size:14px;">计划工时信息</legend>
<el-row :gutter="12">
<el-col :span="6">创建人:{{d.w.CreateName}}</el-col>
<el-col :span="6">创建日期:{{d.w.CreateDate}}</el-col>
<el-col :span="6">开始时间:{{d.w.BeginTime}}</el-col>
<el-col :span="6">截止时间:{{d.w.EndTime}}</el-col>
</el-row>
</fieldset>
<fieldset style="border: 1px solid #DDD;padding: 13px;font-size: 12px;margin-top:30px;">
<legend style="padding:0 10px; font-size:14px;">计划操作记录</legend>
<div v-if="d.w.ExamineStatus==1">
<el-card class="work-content green">
<h4>主管立项审核通过</h4>
<p>{{d.w.ExamineUserName}} 提交于 {{d.w.ExamineDate}}</p>
<div class="cont">{{d.w.ExamineRemark}}</div>
</el-card>
</div>
<div v-if="d.w.ExamineStatus==-1">
<el-card class="work-content red">
<h4>主管立项审核驳回</h4>
<p>{{d.w.ExamineState}} 提交于 {{d.w.ExamineDate}}</p>
<div class="cont">{{d.w.ExamineRemark}}</div>
</el-card>
</div>
<div v-for="(item, index) in d.p" :key="index">
<el-card class="work-content">
<h4>
进度更新:
<div style="width:120px;display: inline-block;margin-left: 15px;">
<el-progress
:text-inside="true"
:stroke-width="24"
:percentage="item.Progree"
status="success"
></el-progress>
</div>
</h4>
<p v-if="d.w">{{d.w.CreateName}} 提交于 {{item.CreateDate}}</p>
<div class="cont">{{item.Content}}</div>
<div class="attach" v-if="item.Attach!==''">
附件:
<span
@click="openFile(item.Attach)"
style="cursor: pointer;"
class="work-file"
>{{item.Attach.substring(item.Attach.lastIndexOf("/")+1,item.Attach.length)}}</span>
</div>
<div class="attach" v-if="item.Linker && item.Linker.length>0">
相关链接
<span
v-for="lik in item.Linker" :key="lik"
@click="openFile(lik)"
style="cursor: pointer;display:block;margin-top:10px;"
class="work-file"
>{{lik}}</span>
</div>
</el-card>
</div>
<div v-if="d.w.FinishExamineStatus==1">
<el-card class="work-content green">
<h4>主管完结审核通过</h4>
<p>{{d.w.FinishExamineUserName}} 提交于 {{d.w.FinishExamineDate}}</p>
<div class="cont">{{d.w.FinishExamineRemark}}</div>
</el-card>
</div>
<div v-if="d.w.FinishExamineStatus==-1">
<el-card class="work-content red">
<h4>主管完结审核驳回</h4>
<p>{{d.w.FinishExamineState}} 提交于 {{d.w.FinishExamineDate}}</p>
<div class="cont">{{d.w.FinishExamineRemark}}</div>
</el-card>
</div>
</fieldset>
<fieldset
v-if="isEaxmine && d.w && (d.w.ExamineStatus==0 || (d.w.Status>=2 && d.w.FinishExamineStatus==0))"
style="border: 1px solid #DDD;padding: 13px;font-size: 12px;margin-top:20px;"
>
<legend style="padding:0 10px; font-size:14px;">审批</legend>
<div style="margin-bottom:10px">
<el-radio v-model="radio" label="1">通过</el-radio>
<el-radio v-model="radio" label="-1">驳回</el-radio>
</div>
<div style="margin-bottom:10px">
<el-input
type="textarea"
:rows="4"
style="width:100%"
placeholder="请输入审批意见"
v-model="textarea"
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="goexamine">确认提交</button>
</div>
</fieldset>
<fieldset
v-if="isUpdate && d.w && ((d.w.Status==0 && d.w.ExamineStatus==1) || d.w.Status==1)"
style="border: 1px solid #DDD;padding: 13px;font-size: 12px;margin-top:20px;"
>
<legend style="padding:0 10px; font-size:14px;">提交进度</legend>
<div style="margin-bottom:10px">
进度说明:
<el-input
type="textarea"
:rows="4"
style="width:100%"
placeholder="请输入进度说明"
v-model="textarea2"
></el-input>
</div>
<div style="margin-bottom:10px">
相关链接:
<el-input
type="textarea"
:rows="2"
style="width:100%"
placeholder="请填写相关链接,附件和相关链接必须二选一提交"
v-model="linker"
></el-input>
<span style="font-size:12px;color:#aaa;margin:10px 0;">注意,多个URL请使用换行分割</span>
</div>
<div style="margin-bottom:10px;width: 29%;">
附件上传:
<el-upload
class="upload-demo"
drag
:http-request="uploadFileBtn"
:multiple="true"
:show-file-list="true"
:on-preview="previewFile"
:on-remove="removeFile"
:limit="1"
action
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
</el-upload>
</div>
<div style="margin-bottom:10px;">
<el-row :gutter="12">
<el-col :span="4">当前进度:</el-col>
</el-row>
<div v-if="d.w">
<div style="margin:10px auto;">
<h3
v-if="d.w"
style="font-size:18px;border-bottom:1px solid #ddd;font-weight:400;font-family:pingfangR;padding-bottom:10px;"
>
<span class="circle" v-if="d.w.ExamineStatus==0||d.w.ExamineStatus==-1"></span>
<span class="circle green" v-else-if="d.w.Status==0"></span>
<span class="circle red" v-else-if="d.w.Status==1||d.w.Status==2"></span>
<span class="circle black" v-else-if="d.w.Status==3"></span>
<span style="margin-right:15px;">{{d.w.Title}}</span>
<el-tag v-if="d.w.Tags.length>0">{{d.w.Tags}}</el-tag>
</h3>
<div
v-if="d.w"
style="font-size:14px;font-family:pingfangR;margin: 10px 0;padding: 10px;background: #FFF;"
>{{d.w.Description}}</div>
<fieldset v-if="d.w" style="border: 1px solid #DDD;padding: 13px;font-size: 12px;">
<legend style="padding:0 10px; font-size:14px;">计划工时信息</legend>
<el-row :gutter="12">
<el-col :span="4">
<el-slider v-model="progree" :min="d.w.Progree" :max="100" :step="1"></el-slider>
</el-col>
<el-col :span="6">创建人:{{d.w.CreateName}}</el-col>
<el-col :span="6">创建日期:{{d.w.CreateDate}}</el-col>
<el-col :span="6">开始时间:{{d.w.BeginTime}}</el-col>
<el-col :span="6">截止时间:{{d.w.EndTime}}</el-col>
</el-row>
</div>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="setprogress">确认提交</button>
</div>
</fieldset>
</fieldset>
<fieldset style="border: 1px solid #DDD;padding: 13px;font-size: 12px;margin-top:30px;">
<legend style="padding:0 10px; font-size:14px;">计划操作记录</legend>
<div v-if="d.w.ExamineStatus!=0">
<el-card
class="work-content"
:class="{'green':d.w.ExamineStatus==1,'red':d.w.ExamineStatus==-1}"
>
<el-row :gutter="10">
<el-col :span="22">
<h4>主管立项审核{{d.w.ExamineStatus==-1?'驳回':'通过'}}</h4>
<p>{{d.w.ExamineUserName}} 提交于 {{d.w.ExamineDate}}</p>
<div class="cont">{{d.w.ExamineRemark}}</div>
</el-col>
<el-col :span="2">
<el-button
type="primary"
v-if="!showZui1 && userInfo.EmployeeId==d.w.ExamineUser"
@click="showZui1=true"
>追加信息</el-button>
<br/><br/>
<el-button
type="warning"
v-if="canCancel1 && userInfo.EmployeeId==d.w.ExamineUser"
@click="cancelExamine(1)"
>取消审核</el-button>
</el-col>
</el-row>
<div v-if="d.w.ExamineRemarkExpand && d.w.ExamineRemarkExpand.length>0">
<div
v-for="(item, index) in d.w.ExamineRemarkExpand"
:key="index"
style="margin-top:10px;border-top:1px dotted #Fefefe;padding-top:10px;"
>
<el-row :gutter="12">
<el-col :span="24">
<el-tag style="margin-right:12px">追加信息</el-tag>
{{item.u}} 提交于 {{item.d}}
</el-col>
</el-row>
<el-row :gutter="12" style="margin-top:12px;">
<el-col :span="24">
<div class="cont">{{item.c}}</div>
</el-col>
</el-row>
</div>
</div>
<div
v-if="showZui1"
style="margin-top:10px;border-top:1px dotted #Fefefe;padding-top:10px;"
>
<div style="margin:10px 0;font-size:18px;">追加信息</div>
<div style="margin-bottom:10px">
<el-input
type="textarea"
:rows="2"
style="width:100%;color:#000 !important;"
placeholder="请输入追加内容信息"
v-model="examineRemarkExpand"
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="setRemark(0)">确认提交</button>
<button class="normalBtn" @click="showZui1=false">取消</button>
</div>
</div>
</el-card>
</div>
<div v-for="(item, index) in d.p" :key="index">
<el-card class="work-content">
<h4>
进度更新:
<div style="width:120px;display: inline-block;margin-left: 15px;">
<el-progress
:text-inside="true"
:stroke-width="24"
:percentage="item.Progree"
status="success"
></el-progress>
</div>
</h4>
<p v-if="d.w">{{d.w.CreateName}} 提交于 {{item.CreateDate}}</p>
<div class="cont">{{item.Content}}</div>
<div class="attach" v-if="item.Attach!==''">
附件:
<span
@click="openFile(item.Attach)"
style="cursor: pointer;"
class="work-file"
>{{item.Attach.substring(item.Attach.lastIndexOf("/")+1,item.Attach.length)}}</span>
</div>
<div class="attach" v-if="item.Linker && item.Linker.length>0">
相关链接
<span
v-for="lik in item.Linker"
:key="lik"
@click="openFile(lik)"
style="cursor: pointer;display:block;margin-top:10px;"
class="work-file"
>{{lik}}</span>
</div>
</el-card>
</div>
<div v-if="d.w.FinishExamineStatus!=0">
<el-card
class="work-content"
:class="{'green':d.w.FinishExamineStatus==1,'red':d.w.FinishExamineStatus==-1}"
>
<el-row :gutter="10">
<el-col :span="22">
<h4>主管完结审核{{d.w.FinishExamineStatus==-1?'驳回':'通过'}}</h4>
<p>{{d.w.FinishExamineUserName}} 提交于 {{d.w.FinishExamineDate}}</p>
<div class="cont">{{d.w.FinishExamineRemark}}</div>
</el-col>
<el-col :span="2">
<el-button
type="primary"
v-if="!showZui2 && userInfo.EmployeeId==d.w.FinishExamineUser"
@click="showZui2=true"
>追加信息</el-button>
</el-col>
</el-row>
<div v-if="d.w.FinishExamineRemarkExpand && d.w.FinishExamineRemarkExpand.length>0">
<div
v-for="(item, index) in d.w.FinishExamineRemarkExpand"
:key="index"
style="margin-top:10px;border-top:1px dotted #Fefefe;padding-top:10px;"
>
<el-row :gutter="12">
<el-col :span="24">
<el-tag style="margin-right:12px">追加信息</el-tag>
{{item.u}} 提交于 {{item.d}}
</el-col>
</el-row>
<el-row :gutter="12" style="margin-top:12px;">
<el-col :span="24">
<div class="cont">{{item.c}}</div>
</el-col>
</el-row>
</div>
</div>
<div
v-if="showZui2"
style="margin-top:10px;border-top:1px dotted #Fefefe;padding-top:10px;"
>
<div style="margin:10px 0;font-size:18px;">追加信息</div>
<div style="margin-bottom:10px">
<el-input
type="textarea"
:rows="2"
style="width:100%;color:#000 !important;"
placeholder="请输入追加内容信息"
v-model="examineRemarkExpand"
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="setRemark(1)">确认提交</button>
<button class="normalBtn" @click="showZui2=false">取消</button>
</div>
</div>
</el-card>
</div>
</fieldset>
<fieldset
v-if="isEaxmine && d.w && (d.w.ExamineStatus==0 || (d.w.Status>=2 && d.w.FinishExamineStatus==0))"
style="border: 1px solid #DDD;padding: 13px;font-size: 12px;margin-top:20px;"
>
<legend style="padding:0 10px; font-size:14px;">审批</legend>
<div style="margin-bottom:10px">
<el-radio v-model="radio" label="1">通过</el-radio>
<el-radio v-model="radio" label="-1">驳回</el-radio>
</div>
<div style="margin-bottom:10px">
<el-input
type="textarea"
:rows="4"
style="width:100%"
placeholder="请输入审批意见"
v-model="textarea"
></el-input>
</div>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="goexamine">确认提交</button>
</div>
</fieldset>
<fieldset
v-if="isUpdate && d.w && ((d.w.Status==0 && d.w.ExamineStatus==1) || d.w.Status==1)"
style="border: 1px solid #DDD;padding: 13px;font-size: 12px;margin-top:20px;"
>
<legend style="padding:0 10px; font-size:14px;">提交进度</legend>
<div style="margin-bottom:10px">
进度说明:
<el-input
type="textarea"
:rows="4"
style="width:100%"
placeholder="请输入进度说明"
v-model="textarea2"
></el-input>
</div>
<div style="margin-bottom:10px">
相关链接:
<el-input
type="textarea"
:rows="2"
style="width:100%"
placeholder="请填写相关链接,附件和相关链接必须二选一提交"
v-model="linker"
></el-input>
<span style="font-size:12px;color:#aaa;margin:10px 0;">注意,多个URL请使用换行分割</span>
</div>
<div style="margin-bottom:10px;width: 29%;">
附件上传:
<el-upload
class="upload-demo"
drag
:http-request="uploadFileBtn"
:multiple="true"
:show-file-list="true"
:on-preview="previewFile"
:on-remove="removeFile"
:limit="1"
action
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
</el-upload>
</div>
<div style="margin-bottom:10px;">
<el-row :gutter="12">
<el-col :span="4">当前进度:</el-col>
</el-row>
<el-row :gutter="12">
<el-col :span="4">
<el-slider v-model="progree" :min="d.w.Progree" :max="100" :step="1"></el-slider>
</el-col>
</el-row>
</div>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="setprogress">确认提交</button>
</div>
</fieldset>
</div>
<viewer :images="images" :options="imageOptions" @inited="inited" class="viewer" ref="viewer">
<img v-for="src in images" :src="src" :key="src" />
</viewer>
</div>
<viewer :images="images" :options="imageOptions" @inited="inited" class="viewer" ref="viewer">
<img v-for="src in images" :src="src" :key="src" />
</viewer>
</div>
</template>
......@@ -199,10 +298,18 @@ export default {
navbar: false,
title: false
},
images: []
images: [],
showZui1: false,
showZui2: false,
examineRemarkExpand: "",
userInfo: {},
canCancel1:false,
canCancel2:false,
canCancel3:false
};
},
mounted() {
this.userInfo = this.getLocalStorage();
let id = this.$route.query.id;
this.isEaxmine = this.$route.query.examine ? true : false;
this.isUpdate = this.$route.query.update ? true : false;
......@@ -246,10 +353,42 @@ export default {
res => {
if (res.data.resultCode == 1) {
this.d = res.data.data;
if(this.d.w.ExamineRemarkExpand && this.d.w.ExamineRemarkExpand.length>0){
this.d.w.ExamineRemarkExpand=JSON.parse(this.d.w.ExamineRemarkExpand);
}
if(this.d.w.FinishExamineRemarkExpand && this.d.w.FinishExamineRemarkExpand.length>0){
this.d.w.FinishExamineRemarkExpand=JSON.parse(this.d.w.FinishExamineRemarkExpand);
}
if(this.d.w.ZongExamineRemarkExpand && this.d.w.ZongExamineRemarkExpand.length>0){
this.d.w.ZongExamineRemarkExpand=JSON.parse(this.d.w.ZongExamineRemarkExpand);
}
let dateEnd = new Date();
if (this.d.w.ExamineStatus!=0) {
let dateBegin = new Date(this.d.w.ExamineDate.replace(/-/g, "/"))
let dateDiff = dateEnd.getTime() - dateBegin.getTime();
if(dateDiff/1000/600>5){
this.canCancel1=true;
}
}
if (this.d.w.FinishExamineStatus!=0) {
let dateBegin = new Date(this.d.w.FinishExamineDate.replace(/-/g, "/"))
let dateDiff = dateEnd.getTime() - dateBegin.getTime();
if(dateDiff/1000/600<5){
this.canCancel2=true;
}
}
if (this.d.w.ZongExamineStatus!=0) {
let dateBegin = new Date(this.d.w.ZongExamineDate.replace(/-/g, "/"))
let dateDiff = dateEnd.getTime() - dateBegin.getTime();
if(dateDiff/1000/600<5){
this.canCancel3=true;
}
}
this.progree = this.d.w.Progree;
this.d.p.forEach(x => {
if(x.Linker && x.Linker!=''){
x.Linker=JSON.parse(x.Linker);
if (x.Linker && x.Linker != "") {
x.Linker = JSON.parse(x.Linker);
}
});
} else {
......@@ -267,9 +406,9 @@ export default {
this.$message.error("附件和相关链接必须二选一提交");
return;
}
let tempLinker='';
if(this.linker.length>0){
tempLinker=JSON.stringify(this.linker.split(/[(\r\n)\r\n]+/));
let tempLinker = "";
if (this.linker.length > 0) {
tempLinker = JSON.stringify(this.linker.split(/[(\r\n)\r\n]+/));
}
this.apipost(
"user_post_SetWorkProcess",
......@@ -278,7 +417,7 @@ export default {
content: this.textarea2,
progree: this.progree,
attach: this.attach,
linker:tempLinker
linker: tempLinker
},
res => {
if (res.data.resultCode == 1) {
......@@ -307,13 +446,118 @@ export default {
this.$router.push({
name: "workManager",
query: {}
})
});
} else {
this.$message.error(res.data.message);
}
},
null
);
},
setRemark(type) {
let p = {
type,
id: this.$route.query.id
};
let r = {
u: this.userInfo.emName,
d: this.formatDate("yyyy-MM-dd hh:mm"),
c: this.examineRemarkExpand
};
if (type == 0) {
if (this.d.w.ExamineRemarkExpand && this.d.w.ExamineRemarkExpand.length > 0) {
this.d.w.ExamineRemarkExpand.push(r);
} else {
this.d.w.ExamineRemarkExpand = [];
this.d.w.ExamineRemarkExpand.push(r);
}
p.remark = JSON.stringify(this.d.w.ExamineRemarkExpand);
} else if (type == 1) {
if (
this.d.w.FinishExamineRemarkExpand &&
this.d.w.FinishExamineRemarkExpand.length > 0
) {
this.d.w.FinishExamineRemarkExpand.push(r);
} else {
this.d.w.FinishExamineRemarkExpand = [];
this.d.w.FinishExamineRemarkExpand.push(r);
}
p.remark = JSON.stringify(this.d.w.FinishExamineRemarkExpand);
} else if (type == 2) {
if (
this.d.w.ZongExamineRemarkExpand &&
this.d.w.ZongExamineRemarkExpand.length > 0
) {
this.d.w.ZongExamineRemarkExpand.push(r);
} else {
this.d.w.ZongExamineRemarkExpand = [];
this.d.w.ZongExamineRemarkExpand.push(r);
}
p.remark = JSON.stringify(this.d.w.ZongExamineRemarkExpand);
}
this.apipost(
"UserWork_SetRemarkt",
p,
res => {
if (res.data.resultCode == 1) {
//window.location.reload();
this.$message.success(res.data.message);
this.showZui1=false;
this.showZui2=false;
this.examineRemarkExpand='';
} else {
this.$message.error(res.data.message);
}
},
null
);
},
cancelExamine(type){
this.apipost(
"user_post_DeleteWorkExamine",
{
id:this.$route.query.id,
type
},
res => {
if (res.data.resultCode == 1) {
window.location.reload();
} else {
this.$message.error(res.data.message);
}
},
null
);
},
formatDate(fmt) {
let date = new Date();
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
S: date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
);
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1
? o[k]
: ("00" + o[k]).substr(("" + o[k]).length)
);
}
}
return fmt;
}
}
};
......@@ -377,4 +621,7 @@ export default {
color: #409eff;
text-decoration: underline;
}
.work-content .el-textarea__inner {
color: #333 !important;
}
</style>
\ No newline at end of file
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