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

新增功能

parent 83a68ee9
<template>
<div>
<div v-if="d.w">
<div style="margin:10px auto;">
<h3
v-if="d.w"
......@@ -16,7 +17,7 @@
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;">
<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="6">创建人:{{d.w.CreateName}}</el-col>
......@@ -27,18 +28,69 @@
</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>
<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-card>
</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>
<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">
......@@ -67,7 +119,8 @@
<div class="attach" v-if="item.Linker && item.Linker.length>0">
相关链接
<span
v-for="lik in item.Linker" :key="lik"
v-for="lik in item.Linker"
:key="lik"
@click="openFile(lik)"
style="cursor: pointer;display:block;margin-top:10px;"
class="work-file"
......@@ -75,18 +128,63 @@
</div>
</el-card>
</div>
<div v-if="d.w.FinishExamineStatus==1">
<el-card class="work-content green">
<h4>主管完结审核通过</h4>
<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-card>
</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>
<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>
......@@ -179,6 +277,7 @@
<img v-for="src in images" :src="src" :key="src" />
</viewer>
</div>
</div>
</template>
<script>
......@@ -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