Files
2022-03-28 09:05:03 +08:00

94 lines
2.6 KiB
Vue

<template>
<div class="app-container">
<div style="width: 50%">
<AgentForm
v-model="form"
:showTitle="true"
:formType="formType"
:labelWidth="labelWidth"
ref="agentRef"
/>
</div>
<el-button @click="$router.go(-1)">关闭</el-button>
<!-- <el-button @click="submitForm(3)">审核拒绝</el-button> -->
<!-- <el-button type="primary" @click="submitForm(2)">审核通过</el-button> -->
</div>
</template>
<script>
import AgentForm from "@/views/components/AgentForm";
import { agentDetail } from "@/api/dataList/agent";
export default {
components: {
AgentForm,
},
data() {
return {
formType: 2,
labelWidth: 140,
form: {
id: undefined,
name: undefined,
mobile: undefined,
id_card: undefined,
work_place: undefined,
work_experience: undefined,
tenant_id: undefined,
researchs: [],
keywords: [],
id_image: [],
credential_image: undefined,
},
};
},
methods: {
submitForm(status) {
console.log(this.form);
if (this.$refs.agentRef.submitForm()) {
const str =
status == 2
? "<span style='color:green'>通过</span>"
: "<span class='el-message-box__errormsg'>拒绝</span>";
this.$prompt(`您将 ${str} 该数据审核,请输入处理备注`, "审核", {
dangerouslyUseHTMLString: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputType: "textarea",
inputPattern: status == 2 ? "" : /^.{1,30}$/,
inputErrorMessage: "请输入拒绝原因",
})
.then(({ value }) => {
laboratoryEdit(this.form).then((res) => {
if (res.code == 200) {
const query = {
id: this.form.id,
status,
remark: value,
};
laboratoryExamine(query).then((res) => {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.go(-1);
this.$modal.msgSuccess("处理成功");
});
}
});
})
.catch(() => {});
} else {
console.log("校验未通过");
}
},
},
created() {
let { id } = this.$route.query;
if (!id) {
this.$message.error("无ID");
this.$router.go(-1);
return;
}
agentDetail({ id }).then((res) => {
this.form = res.data;
});
},
};
</script>