|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="page-form-container">
|
|
|
- <device-detail :product-id="productId" :relation-id="relationId" />
|
|
|
+ <device-detail :product-id="auditForm.productId" :relation-id="auditForm.relationId" />
|
|
|
<template v-if="type === 'audit'">
|
|
|
<el-form ref="auditForm" label-width="112px" :model="auditForm" :rules="rules">
|
|
|
<el-form-item label="审核:">
|
|
@@ -23,7 +23,6 @@
|
|
|
|
|
|
<script>
|
|
|
import { auditProduct } from '@/api/product'
|
|
|
-import { mapGetters } from 'vuex'
|
|
|
import { DeviceDetail } from '@/views/components'
|
|
|
export default {
|
|
|
components: {
|
|
@@ -32,11 +31,9 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
type: 'review',
|
|
|
- productId: '',
|
|
|
- relationId: '',
|
|
|
auditForm: {
|
|
|
+ relationId: '',
|
|
|
productId: '',
|
|
|
- auditBy: '', // 审核人id
|
|
|
authId: '', // 机构id
|
|
|
auditStatus: 1, // 审核状态
|
|
|
invalidReason: '', // 审核信息
|
|
@@ -47,35 +44,35 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapGetters(['authUserId'])
|
|
|
- },
|
|
|
created() {
|
|
|
- this.authId = this.$route.query.authId
|
|
|
- this.productId = this.$route.query.productId
|
|
|
- this.relationId = this.$route.query.relationId
|
|
|
+ this.auditForm.authId = this.$route.query.authId
|
|
|
+ this.auditForm.productId = this.$route.query.productId
|
|
|
+ this.auditForm.relationId = this.$route.query.relationId
|
|
|
this.type = this.$route.query.type
|
|
|
},
|
|
|
methods: {
|
|
|
// 提交审核信息
|
|
|
- submit() {
|
|
|
- this.auditForm.productId = this.productId
|
|
|
- this.$refs.auditForm.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.isLoading = true
|
|
|
- // 指定审核人
|
|
|
- this.auditForm.auditBy = this.authUserId
|
|
|
- auditProduct(this.auditForm)
|
|
|
- .then((res) => {
|
|
|
- this.$message.success(res.data)
|
|
|
- this.$store.dispatch('tagsView/delView', this.$route)
|
|
|
- this.$router.back()
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.isLoading = false
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ async submit() {
|
|
|
+ try {
|
|
|
+ await this.$refs.auditForm.validate()
|
|
|
+ this.onAudit()
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ async onAudit() {
|
|
|
+ try {
|
|
|
+ this.isLoading = true
|
|
|
+ const res = await auditProduct(this.auditForm)
|
|
|
+ this.$message.success(res.data)
|
|
|
+ this.$store.dispatch('tagsView/delView', this.$route)
|
|
|
+ this.$router.back()
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ } finally {
|
|
|
+ this.isLoading = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|