+
保存
- 关闭
+
@@ -85,39 +93,125 @@ export default {
name: 'OrderDetail',
data() {
return {
+ canSubmit: true, // 是否可提交
+ isEdit: false, // 是否编辑
+ showNotice:false, //拒绝提示
activities: [
{ status: '待完善', },
- { status: '信息待审核', },
+ { status: '信息审核中', },
{ status: '审核通过', },
],
options: [
{value: 'zhinan',label: '指南', children: [{value: 'shejiyuanze',label: '设计原则',
children: [{value: 'yizhi', label: '一致'}]}]},
],
- activeIndex:2,
- activeIndexFlag:1,
- user: {},
+ activeIndex:0, // 已完成
+ activeIndexFlag:0, // 当前
+ user: {
+ business_license: "",
+ },
inputRequired: { required: true, message: '请输入', trigger: 'blur' },
selectRequired: { required: true, message: '请选择', trigger: 'change' },
};
},
- computed: {
-
+ mounted() {
+ this.getEnterprise()
},
methods: {
handleAvatarChange(file) {
- this.user.avatar = URL.createObjectURL(file.raw);
+ this.util.imgToBase64(file.raw).then(base64 => {
+ console.log(base64);
+ this.post({
+ img_base64: base64
+ }, "/api/pbservice/Other/base64Upload").then(res=>{
+ this.user.business_license = res.data.url;
+ })
+ })
+ },
+
+ getEnterprise () {
+ this.post({},"/api/enterprise/index").then(res=>{
+ console.log(res)
+ // 未完善
+ if (!res.data) {
+ this.activeIndex = 0;
+ this.activeIndexFlag = 0;
+ this.canSubmit = true;
+ return
+ }
+ // 审核中
+ if (res.data.status == 0) {
+ this.activeIndex = 1;
+ this.activeIndexFlag = 1;
+ this.user = res.data;
+ this.canSubmit = false;
+ return
+ }
+
+ // 审核通过
+ if (res.data.status == 1) {
+ this.activeIndex = 3;
+ this.activeIndexFlag = 3;
+ this.user = res.data;
+ this.canSubmit = false;
+ return
+ }
+ // 审核拒绝
+ if (res.data.status == 2) {
+ this.activeIndex = 2;
+ this.activeIndexFlag = 2;
+ this.user = res.data;
+ this.canSubmit = true;
+ this.activities = [
+ { status: '待完善', },
+ { status: '信息审核中', },
+ { status: '审核拒绝,请重新提交', },
+ ];
+ if (res.data.reason) {
+ this.showNotice = true;
+ }
+ }
+
+ })
+ },
+
+ saveUser () {
+ this.$refs.userForm.validate((valid) => {
+ if (valid) {
+ let api = "/api/enterprise/edit";
+ if (!this.isEdit) {
+ api = "/api/enterprise/create";
+ delete this.user.id
+ delete this.user.status
+ delete this.user.reason
+ }
+ this.post(this.user, api).then(res => {
+ if (res.code == 1 || res.code == 200) {
+ this.$message.success(res.msg);
+ this.getEnterprise();
+ }
+ })
+ }
+ })
+ },
+
+ editUser () {
+ this.canSubmit = true;
+ this.isEdit = true;
},
}
}