Commit 142a54a8 authored by 薄玉虎's avatar 薄玉虎

隐患上报、隐患确认时间选择器增加默认值 默认值为今日

parent 7c1c2584
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
type="datetime" type="datetime"
@confirm="onConFindTime" @confirm="onConFindTime"
@cancel="showFindTime = false" @cancel="showFindTime = false"
v-model="findDateTime"
/> />
</van-popup> </van-popup>
...@@ -259,7 +260,7 @@ ...@@ -259,7 +260,7 @@
> >
</div> </div>
</van-form> </van-form>
<div style="margin:10px 16px 0px;padding-bottom:16px"> <div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel" <van-button round block type="warning" @click.native="cancel"
>取消</van-button >取消</van-button
> >
...@@ -278,12 +279,12 @@ import { ...@@ -278,12 +279,12 @@ import {
postHdRiskSource, postHdRiskSource,
postHdShowPeople, postHdShowPeople,
postHdReportAdd, postHdReportAdd,
dangerReturnEcho dangerReturnEcho,
} from "@/service/danger"; } from "@/service/danger";
export default { export default {
name: "add-danger", name: "add-danger",
components: { components: {
LHeader LHeader,
}, },
activated() { activated() {
this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId;
...@@ -294,7 +295,7 @@ export default { ...@@ -294,7 +295,7 @@ export default {
} }
this.getList(); this.getList();
this.$bus.$on("sourceAyy", res => { this.$bus.$on("sourceAyy", (res) => {
console.log(res.join(",")); console.log(res.join(","));
this.source1 = res.join(","); this.source1 = res.join(",");
}); });
...@@ -378,10 +379,13 @@ export default { ...@@ -378,10 +379,13 @@ export default {
showRecPeople: false, showRecPeople: false,
columnsRecPeople: [], columnsRecPeople: [],
isShowreturnCause: false, isShowreturnCause: false,
returnCause: "" // 退回原因 returnCause: "", // 退回原因
findDateTime : new Date()
}; };
}, },
created() {
},
methods: { methods: {
onSubmit(values) { onSubmit(values) {
console.log("submit", values); console.log("submit", values);
...@@ -401,17 +405,17 @@ export default { ...@@ -401,17 +405,17 @@ export default {
formdata.append("hdExpirationTime", values.hdExpirationTime); formdata.append("hdExpirationTime", values.hdExpirationTime);
formdata.append("rectificationUser", values.rectificationUser); formdata.append("rectificationUser", values.rectificationUser);
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式 // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.hdPicture1.forEach(item => { values.hdPicture1.forEach((item) => {
formdata.append("hdPicture1[]", item.file); formdata.append("hdPicture1[]", item.file);
}); });
values.hdVideo1.forEach(item => { values.hdVideo1.forEach((item) => {
formdata.append("hdVideo1[]", item.file); formdata.append("hdVideo1[]", item.file);
}); });
this.$toast.loading({ this.$toast.loading({
message: "提交中...", message: "提交中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
let url = "/hdreport/add"; let url = "/hdreport/add";
if (this.taskId) { if (this.taskId) {
...@@ -419,11 +423,11 @@ export default { ...@@ -419,11 +423,11 @@ export default {
} }
postHdReportAdd(url, formdata) postHdReportAdd(url, formdata)
.then(res => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
this.$toast.success({ this.$toast.success({
message: "提交成功", message: "提交成功",
duration: 2000 duration: 2000,
}); });
history.go(-1); history.go(-1);
}) })
...@@ -438,10 +442,10 @@ export default { ...@@ -438,10 +442,10 @@ export default {
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
getFormList("/hdreport/add") getFormList("/hdreport/add")
.then(res => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
this.columnsProjectName = res.data.projectInformations; this.columnsProjectName = res.data.projectInformations;
this.columnsRange = res.data.hdInventories; this.columnsRange = res.data.hdInventories;
...@@ -459,17 +463,17 @@ export default { ...@@ -459,17 +463,17 @@ export default {
message: "加载中...", message: "加载中...",
forbidClick: true, forbidClick: true,
loadingType: "spinner", loadingType: "spinner",
duration: 0 duration: 0,
}); });
dangerReturnEcho(`/hdreport/edit/${this.taskId}`) dangerReturnEcho(`/hdreport/edit/${this.taskId}`)
.then(res => { .then((res) => {
this.$toast.clear(); this.$toast.clear();
let msg = res.data.hdReport; let msg = res.data.hdReport;
// 对数据进行赋值 // 对数据进行赋值
this.returnCause = res.data.reason; this.returnCause = res.data.reason;
this.projectId = msg.proId; this.projectId = msg.proId;
// 对所属工程数组筛选出 相同id 的工程名 // 对所属工程数组筛选出 相同id 的工程名
let name = this.columnsProjectName.filter(item => { let name = this.columnsProjectName.filter((item) => {
return item.id == msg.proId; return item.id == msg.proId;
}); });
this.projectName = name[0].projectName; this.projectName = name[0].projectName;
...@@ -501,7 +505,7 @@ export default { ...@@ -501,7 +505,7 @@ export default {
this.projectName = value.projectName; this.projectName = value.projectName;
this.showProjectName = false; this.showProjectName = false;
// 这里请求隐患整改人接口 // 这里请求隐患整改人接口
postHdShowPeople(`/hdreport/showPeople/${this.projectId}`).then(res => { postHdShowPeople(`/hdreport/showPeople/${this.projectId}`).then((res) => {
this.columnsRecPeople = res.data; this.columnsRecPeople = res.data;
}); });
}, },
...@@ -514,7 +518,7 @@ export default { ...@@ -514,7 +518,7 @@ export default {
this.dangerNum = ""; this.dangerNum = "";
this.dangerLevel = ""; this.dangerLevel = "";
// 去请求隐患类型的数据 // 去请求隐患类型的数据
postHdTyp(`/hdreport/showHdType/${this.range}`).then(res => { postHdTyp(`/hdreport/showHdType/${this.range}`).then((res) => {
this.columnsType = res.data; this.columnsType = res.data;
}); });
}, },
...@@ -528,7 +532,7 @@ export default { ...@@ -528,7 +532,7 @@ export default {
// 请求隐患项目名称的数据 // 请求隐患项目名称的数据
console.log(this.range); console.log(this.range);
postHdName(`/hdreport/showHdName/${this.range}/${this.type}`).then( postHdName(`/hdreport/showHdName/${this.range}/${this.type}`).then(
res => { (res) => {
this.columnsDangerName = res.data; this.columnsDangerName = res.data;
} }
); );
...@@ -540,7 +544,7 @@ export default { ...@@ -540,7 +544,7 @@ export default {
// 请求隐患项目编号和隐患级别 // 请求隐患项目编号和隐患级别
postHdInventories( postHdInventories(
`/hdreport/showHdInventories/${this.range}/${this.type}/${this.dangerName}` `/hdreport/showHdInventories/${this.range}/${this.type}/${this.dangerName}`
).then(res => { ).then((res) => {
this.dangerNum = res.data[0].hdId; this.dangerNum = res.data[0].hdId;
this.dangerLevel = res.data[0].hdLev; this.dangerLevel = res.data[0].hdLev;
}); });
...@@ -557,7 +561,7 @@ export default { ...@@ -557,7 +561,7 @@ export default {
// 请求风险源第二个字段 // 请求风险源第二个字段
let formdata = new FormData(); let formdata = new FormData();
formdata.append("factor", this.source); formdata.append("factor", this.source);
postHdRiskSource("/riskSource/list", formdata).then(res => { postHdRiskSource("/riskSource/list", formdata).then((res) => {
this.columnsSource1 = res.data; this.columnsSource1 = res.data;
}); });
}, },
...@@ -572,8 +576,8 @@ export default { ...@@ -572,8 +576,8 @@ export default {
this.$router.push({ this.$router.push({
name: "choose-people", name: "choose-people",
params: { params: {
source: this.source source: this.source,
} },
}); });
} else { } else {
this.$toast("请先选择风险源"); this.$toast("请先选择风险源");
...@@ -592,8 +596,8 @@ export default { ...@@ -592,8 +596,8 @@ export default {
cancel() { cancel() {
this.$router.go(-1); this.$router.go(-1);
} },
} },
}; };
</script> </script>
<style scoped> <style scoped>
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
type="datetime" type="datetime"
@confirm="onConfirm" @confirm="onConfirm"
@cancel="showCalendar = false" @cancel="showCalendar = false"
v-model="endDateTime"
/> />
</van-popup> </van-popup>
...@@ -174,7 +175,8 @@ export default { ...@@ -174,7 +175,8 @@ export default {
columnsReview: [], columnsReview: [],
showPickerReview: false, showPickerReview: false,
valueIdea: "", valueIdea: "",
returnReason: "" returnReason: "",
endDateTime: new Date()
}; };
}, },
......
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