Commit 83ee169e authored by BlueWhite's avatar BlueWhite

延期审批

parent 37ca0095
...@@ -229,6 +229,42 @@ export function superviseAdd(url, data) { ...@@ -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 @@ ...@@ -10,7 +10,7 @@
<van-field <van-field
readonly readonly
clickable clickable
name="delayTime" name="applyDate"
:value="delayTime" :value="delayTime"
label="延期时间" label="延期时间"
placeholder="点击选择日期" placeholder="点击选择日期"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<van-field <van-field
v-model="delayApply" v-model="delayApply"
label="延期理由" label="延期理由"
name="delayApply" name="applyReason"
rows="3" rows="3"
type="textarea" type="textarea"
placeholder="请输入" placeholder="请输入"
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { timestampToTime } from "@/utils/format"; import { timestampToTime } from "@/utils/format";
import { delayAdd } from "@/service/danger";
export default { export default {
components: { components: {
LHeader LHeader
...@@ -72,8 +73,30 @@ export default { ...@@ -72,8 +73,30 @@ export default {
methods: { methods: {
onSubmit(values) { 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("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) { onConDelayTime(date) {
this.delayTime = timestampToTime(date, "DT1", true); this.delayTime = timestampToTime(date, "DT1", true);
......
...@@ -14,21 +14,21 @@ ...@@ -14,21 +14,21 @@
> >
<van-row gutter=""> <van-row gutter="">
<van-col span="7">所属工程名称:</van-col> <van-col span="7">隐患编号:</van-col>
<van-col span="17">{{ item.proId }}</van-col> <van-col span="17">{{ item.businessId }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患项目名称:</van-col> <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>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患发现时间:</van-col> <van-col span="7">隐患级别:</van-col>
<van-col span="17">{{ item.findTime }}</van-col> <van-col span="17">{{ item.hdLev }}</van-col>
</van-row> </van-row>
<van-row gutter=""> <van-row gutter="">
<van-col span="7">隐患级别:</van-col> <van-col span="7">发现时间:</van-col>
<van-col span="17">{{ item.level }}</van-col> <van-col span="17">{{ item.startDate }}</van-col>
</van-row> </van-row>
<!-- *接口对接4 END --> <!-- *接口对接4 END -->
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { delayList } from "@/service/danger";
...@@ -80,7 +81,29 @@ export default { ...@@ -80,7 +81,29 @@ export default {
}, },
methods: { methods: {
getList() { 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) { onSearch(val) {
console.log(val); console.log(val);
......
...@@ -8,19 +8,18 @@ ...@@ -8,19 +8,18 @@
validate-trigger="onSubmit" validate-trigger="onSubmit"
> >
<van-field <van-field
v-model="delayTime" v-model="applyDate"
name="delayTime" name="applyDate"
label="延期时间" label="延期时间"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '延期时间不能为空' }]" :rules="[{ required: true, message: '延期时间不能为空' }]"
/> />
<van-field <van-field
v-model="delayApply" v-model="applyReason"
readonly readonly
label="延期理由" label="延期理由"
name="delayApply" name="applyReason"
rows="1" rows="1"
autosize autosize
type="textarea" type="textarea"
...@@ -42,21 +41,20 @@ ...@@ -42,21 +41,20 @@
<van-field <van-field
v-model="opinion" v-model="opinion"
label="理由或者意见" label="理由或者意见"
name="opinion" name="examineReason"
rows="3" rows="3"
type="textarea" type="textarea"
placeholder="请输入" placeholder="请输入"
:rules="[{ required: true, message: '理由或者意见不能为空' }]" :rules="[{ required: true, message: '理由或者意见不能为空' }]"
/> />
<div style="margin: 16px">
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit"
>保存</van-button >保存</van-button
> >
</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
> >
...@@ -66,10 +64,11 @@ ...@@ -66,10 +64,11 @@
<script> <script>
import LHeader from "@/components/header.vue"; import LHeader from "@/components/header.vue";
import { timestampToTime } from "@/utils/format"; import { delayReturn } from "@/service/danger";
import { delayEdit } from "@/service/danger";
export default { export default {
components: { components: {
LHeader LHeader,
}, },
data() { data() {
return { return {
...@@ -80,27 +79,71 @@ export default { ...@@ -80,27 +79,71 @@ export default {
delayApply: "", // 延迟理由 delayApply: "", // 延迟理由
isAgree: 1, // 延期是否通过 isAgree: 1, // 延期是否通过
opinion: "", //理由或者意见 opinion: "", //理由或者意见
applyDate: "", //延期时间
applyReason: "", //延期理由
}; };
}, },
created() { created() {
this.taskId = this.$route.params.taskId; this.taskId = this.$route.params.taskId;
this.getReturnEcho();
}, },
methods: { methods: {
onSubmit(values) { 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) { selectResult(val) {
this.isAgree = val; this.isAgree = val;
}, },
cancel() { cancel() {
this.$router.go(-1); this.$router.go(-1);
} },
} },
}; };
</script> </script>
<style lang="less" scoped> <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