qa-regulatory-gwj-app/pages/safety-environmental-inspec.../initiate/plead.vue

205 lines
6.4 KiB
Vue
Raw Permalink Normal View History

2023-11-07 10:08:37 +08:00
<template>
<view class="content">
<view class="card">
<u-cell-group :border="false">
2024-10-10 10:14:31 +08:00
<u-cell>
2023-11-07 10:08:37 +08:00
<view slot="title" class="title">申辩人</view>
2024-10-10 10:14:31 +08:00
<view slot="label" class="mt-10">
2023-11-07 10:08:37 +08:00
<u--image :showLoading="true" :src="$store.state.filePath + form.INSPECTED_SITEUSER_SIGN_IMG"
width="100%" height="80px" mode="scaleToFill"
@click="previewImage($store.state.filePath + form.INSPECTED_SITEUSER_SIGN_IMG)"></u--image>
</view>
</u-cell>
<u-cell>
<view slot="title" class="title">申辩时间</view>
<view slot="value">{{ form.INSPECTED_SITEUSER_SIGN_TIME }}</view>
</u-cell>
<u-cell>
<view slot="title" class="title">申辩说明</view>
<view slot="value">{{ form.INSPECTED_EXPLAIN }}</view>
</u-cell>
2024-10-10 10:14:31 +08:00
<u-cell v-if="form.INSPECTED_EXPLAIN_FILENAME">
2023-11-07 10:08:37 +08:00
<view slot="title" class="title">申辩附件</view>
2024-10-10 10:14:31 +08:00
<view slot="label" class="mt-10 flex-between">
2023-11-07 10:08:37 +08:00
<text class="u-line-1">{{ form.INSPECTED_EXPLAIN_FILENAME }}</text>
2024-10-10 10:14:31 +08:00
<view class="ml-10">
<u-button type="primary" text="下载" size="mini" @click="downloadAppendix"></u-button>
</view>
2023-11-07 10:08:37 +08:00
</view>
</u-cell>
<u-cell>
<view slot="title" class="title required">申辩是否成立</view>
<view slot="value">
<u-radio-group v-model="form.INSPECTION_STATUS" placement="row">
<u-radio label="是" name="-2"></u-radio>
<u-radio label="否" name="3" class="ml-10"></u-radio>
</u-radio-group>
</view>
</u-cell>
<template v-if="form.INSPECTION_STATUS === '-2'">
2024-10-10 10:14:31 +08:00
<u-cell>
2023-11-07 10:08:37 +08:00
<view slot="title" class="title flex-between">
确认人签字
2024-08-28 16:29:32 +08:00
<view>
2024-10-10 10:14:31 +08:00
<u-button type="primary" text="手写添加" size="mini"
@click="signShow = true"></u-button>
2024-08-28 16:29:32 +08:00
<sign v-if="signShow" :signShow.sync="signShow" @confirm="signConfirm"></sign>
</view>
2023-11-07 10:08:37 +08:00
</view>
2024-10-10 10:14:31 +08:00
<view slot="label" class="mt-10">
2024-08-28 16:29:32 +08:00
</view>
</u-cell>
<u-cell v-if="form.SIGN_IMG">
2024-10-10 10:14:31 +08:00
<view slot="label" class="mt-10 flex-1" v-show="form.SIGN_IMG">
2023-11-07 10:08:37 +08:00
<u--image v-show="form.SIGN_IMG" :showLoading="true" :src="form.SIGN_IMG"
width="100%" height="80px" mode="scaleToFill"
@click="previewImage(form.SIGN_IMG)"></u--image>
2024-08-28 16:29:32 +08:00
2023-11-07 10:08:37 +08:00
</view>
</u-cell>
</template>
<template v-if="form.INSPECTION_STATUS === '3'">
2024-10-10 10:14:31 +08:00
<u-cell>
2023-11-07 10:08:37 +08:00
<view slot="title" class="title required">不成立理由</view>
2024-10-10 10:14:31 +08:00
<view slot="label" class="mt-10">
2023-11-07 10:08:37 +08:00
<u--textarea v-model="form.INSPECTED_EXPLAIN_REFUSE" placeholder="请输入不成立理由"></u--textarea>
</view>
</u-cell>
2024-10-10 10:14:31 +08:00
<u-cell>
2023-11-07 10:08:37 +08:00
<view slot="title" class="title flex-between">
确认人签字
2024-08-28 16:29:32 +08:00
<view>
2024-10-10 10:14:31 +08:00
<u-button type="primary" text="手写添加" size="mini"
@click="signShow = true"></u-button>
2024-08-28 16:29:32 +08:00
<sign v-if="signShow" :signShow.sync="signShow" @confirm="signConfirm"></sign>
</view>
2023-11-07 10:08:37 +08:00
</view>
2024-10-10 10:14:31 +08:00
<view slot="label" class="mt-10">
2023-11-07 10:08:37 +08:00
</view>
</u-cell>
2024-08-28 16:29:32 +08:00
<view>
<u--image v-show="form.SIGN_IMG" :showLoading="true" :src="form.SIGN_IMG"
width="100%" height="80px" mode="scaleToFill"
@click="previewImage(form.SIGN_IMG)"></u--image>
</view>
2023-11-07 10:08:37 +08:00
</template>
2024-10-10 10:14:31 +08:00
<u-cell :border="false">
<view slot="label" class="flex-between">
<u-button type="primary" text="提交" @click="$u.debounce(fnSubmit, 1000,true)"></u-button>
2023-11-07 10:08:37 +08:00
</view>
</u-cell>
</u-cell-group>
</view>
</view>
</template>
<script>
import sign from "../../../components/sign/sign";
import {setSafetyenvironmentalGoEdit, setSafetyenvironmentalExplain} from "../../../api";
export default {
components: {
sign,
},
data() {
return {
INSPECTION_ID: '',
form: {},
signShow: false
}
},
onLoad(event) {
this.INSPECTION_ID = event.INSPECTION_ID
this.getData()
},
computed: {
userInfo() {
return this.$store.getters.getUserInfo
}
},
methods: {
async getData() {
let params = {
INSPECTION_ID: this.INSPECTION_ID,
}
let resData = await setSafetyenvironmentalGoEdit(params)
this.form = resData.pd
},
previewImage(current) {
uni.previewImage({
urls: [current],
current
});
},
downloadAppendix() {
2024-10-16 09:25:19 +08:00
uni.downloadFile({
url: this.$store.state.filePath + this.form.INSPECTED_EXPLAIN_FILEPATH,
success: (res) => {
uni.openDocument({
filePath: res.tempFilePath,
});
},
2023-11-07 10:08:37 +08:00
});
},
2024-10-10 10:14:31 +08:00
signConfirm({path}) {
this.form.SIGN_IMG = path
2023-11-07 10:08:37 +08:00
},
async fnSubmit() {
if (!this.form.INSPECTION_STATUS) {
uni.showToast({
title: '请选择申辩是否成立',
icon: "none"
})
return;
}
if (this.form.INSPECTION_STATUS === '3') {
if (!this.form.INSPECTED_EXPLAIN_REFUSE) {
uni.showToast({
title: '请填写不成立理由',
icon: "none"
})
return;
}
if (!this.form.SIGN_IMG) {
uni.showToast({
title: '请签字',
icon: "none"
})
return;
}
await setSafetyenvironmentalExplain({
...this.form,
'loginUserId': this.userInfo.USER_ID,
'loginUserName': this.userInfo.USERNAME
})
uni.showToast({
title: '申辩成功',
})
uni.$u.route({
type: 'navigateBack'
})
} else if (this.form.INSPECTION_STATUS === '-2') {
uni.$u.route({
url: '/pages/safety-environmental-inspection/initiate/detail',
params: {
INSPECTION_ID: this.INSPECTION_ID,
type: 'edit',
vector: 'list'
}
})
}
}
}
}
</script>
<style scoped>
2024-08-28 16:29:32 +08:00
.title {
min-width: 150rpx;
}
2024-10-10 10:14:31 +08:00
2024-08-28 16:29:32 +08:00
.flex-1 {
flex: 1;
}
2023-11-07 10:08:37 +08:00
</style>