Commit 83ee169e authored by BlueWhite's avatar BlueWhite

延期审批

parent 37ca0095
......@@ -229,6 +229,42 @@ export function superviseAdd(url, data) {
})
}
//延期审批
export function delayList(url, data) {
return request({
url: url,
method: 'post',
data
})
}
//延期审批退回回显
export function delayReturn(url, data) {
return request({
url: url,
method: 'get',
data
})
}
//延期审批添加
export function delayAdd(url, data) {
return request({
url: url,
method: 'post',
data
})
}
//延期审批添加
export function delayEdit(url, data) {
return request({
url: url,
method: 'post',
data
})
}
......
......@@ -10,7 +10,7 @@
<van-field
readonly
clickable
name="delayTime"
name="applyDate"
:value="delayTime"
label="延期时间"
placeholder="点击选择日期"
......@@ -28,7 +28,7 @@
<van-field
v-model="delayApply"
label="延期理由"
name="delayApply"
name="applyReason"
rows="3"
type="textarea"
placeholder="请输入"
......@@ -52,6 +52,7 @@
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from "@/utils/format";
import { delayAdd } from "@/service/danger";
export default {
components: {
LHeader
......@@ -70,10 +71,32 @@ export default {
this.taskId = this.$route.params.taskId;
},
methods: {
onSubmit(values) {
console.log("submit", values);
},
onSubmit(values) {
console.log("submit", values);
this.$toast.loading({
message: "提交中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
let formdata = new FormData();
formdata.append("applyDate", values.applyDate);
formdata.append("applyReason", values.applyReason);
formdata.append("taskId", this.taskId);
delayAdd(`/delayApply/add`, formdata)
.then((res) => {
this.$toast.clear();
this.$toast.success({
message: "提交成功",
duration: 2000,
});
history.go(-1);
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("提交失败,请稍后再试");
});
},
// 延期时间
onConDelayTime(date) {
this.delayTime = timestampToTime(date, "DT1", true);
......
......@@ -14,21 +14,21 @@
>
<van-row gutter="">
<van-col span="7">所属工程名称:</van-col>
<van-col span="17">{{ item.proId }}</van-col>
<van-col span="7">隐患编号:</van-col>
<van-col span="17">{{ item.businessId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患项目名称:</van-col>
<van-col span="17">{{ item.subject }}</van-col>
<van-col span="17">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患发现时间:</van-col>
<van-col span="17">{{ item.findTime }}</van-col>
<van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.hdLev }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.level }}</van-col>
<van-col span="7">发现时间:</van-col>
<van-col span="17">{{ item.startDate }}</van-col>
</van-row>
<!-- *接口对接4 END -->
......@@ -58,6 +58,7 @@
<script>
import LHeader from "@/components/header.vue";
import { delayList } from "@/service/danger";
......@@ -80,7 +81,29 @@ export default {
},
methods: {
getList() {
/*接口对接3 START*/
// 例子:
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
delayList("/delayApply/list")
.then(res => {
this.$toast.clear();
this.messageList = res.rows
// 判断有无数据返回
if (this.messageList.length == 0) {
this.isHaveNews = true;
}
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
/*接口对接3 END*/
},
onSearch(val) {
console.log(val);
......
......@@ -7,26 +7,25 @@
:scroll-to-error="true"
validate-trigger="onSubmit"
>
<van-field
v-model="delayTime"
name="delayTime"
<van-field
v-model="applyDate"
name="applyDate"
label="延期时间"
placeholder="请输入"
:rules="[{ required: true, message: '延期时间不能为空' }]"
/>
<van-field
v-model="delayApply"
v-model="applyReason"
readonly
label="延期理由"
name="delayApply"
name="applyReason"
rows="1"
autosize
type="textarea"
/>
<van-field name="isAgree" label="延期是否通过">
<van-field name="isAgree" label="延期是否通过">
<template #input>
<van-radio-group
v-model="isAgree"
......@@ -42,21 +41,20 @@
<van-field
v-model="opinion"
label="理由或者意见"
name="opinion"
name="examineReason"
rows="3"
type="textarea"
placeholder="请输入"
:rules="[{ required: true, message: '理由或者意见不能为空' }]"
/>
<div style="margin: 16px;">
<div style="margin: 16px">
<van-button round block type="info" native-type="submit"
>保存</van-button
>
</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
>
......@@ -66,10 +64,11 @@
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from "@/utils/format";
import { delayReturn } from "@/service/danger";
import { delayEdit } from "@/service/danger";
export default {
components: {
LHeader
LHeader,
},
data() {
return {
......@@ -80,27 +79,71 @@ export default {
delayApply: "", // 延迟理由
isAgree: 1, // 延期是否通过
opinion: "", //理由或者意见
applyDate: "", //延期时间
applyReason: "", //延期理由
};
},
created() {
this.taskId = this.$route.params.taskId;
this.getReturnEcho();
},
methods: {
onSubmit(values) {
console.log("submit", values);
},
console.log("submit", values);
this.$toast.loading({
message: "提交中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
let formdata = new FormData();
formdata.append("examineResult", values.examineResult);
formdata.append("examineReason", values.examineReason);
formdata.append("taskId", this.taskId);
delayEdit(`/delayApply/edit`, formdata)
.then((res) => {
this.$toast.clear();
this.$toast.success({
message: "提交成功",
duration: 2000,
});
history.go(-1);
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("提交失败,请稍后再试");
});
},
// 请求已退回详情数据
getReturnEcho() {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
delayReturn(`/delayApply/edit/${this.taskId}`)
.then((res) => {
this.$toast.clear();
// 对数据进行赋值
this.applyDate = res.data.delayApply.applyDate;
this.applyReason = res.data.delayApply.applyReason;
})
.catch(() => {
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
},
selectResult(val) {
this.isAgree = val;
},
cancel() {
this.$router.go(-1);
}
}
},
},
};
</script>
<style lang="less" scoped>
......
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