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

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

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