Browse Source

v1.7版本页面接口调试

yuwenjun1997 2 years ago
parent
commit
056495ec26
3 changed files with 137 additions and 58 deletions
  1. 2 0
      .env.staging
  2. 54 27
      src/views/normal/audit/club/device/review.vue
  3. 81 31
      src/views/normal/audit/club/review.vue

+ 2 - 0
.env.staging

@@ -21,3 +21,5 @@ VUE_APP_PAY_LOCAL = https://core-b.caimei365.com
 # 网站地址
 VUE_APP_LOCAL = 'https://zplm-b.caimei365.com'
 
+# 认证通页面
+VUE_APP_WWW_HOST = 'https://zp-b.caimei365.com'

+ 54 - 27
src/views/normal/audit/club/device/review.vue

@@ -29,7 +29,7 @@
 
       <div class="row">
         <div class="col">购买渠道:</div>
-        <div class="col">{{ productInfo.buyChannel }}</div>
+        <div class="col">{{ productInfo.purchaseWay }}</div>
       </div>
 
       <div class="row">
@@ -42,7 +42,6 @@
           />
         </div>
       </div>
-
       <div class="row">
         <div class="col">设备参数:</div>
         <div class="col">
@@ -54,12 +53,7 @@
           </template>
         </div>
       </div>
-
-      <div class="row">
-        <div class="col">审核状态:</div>
-        <div class="col">待审核</div>
-      </div>
-      <el-form label-width="112px" :model="auditForm" :rules="rules">
+      <el-form ref="auditForm" label-width="112px" :model="auditForm" :rules="rules">
         <el-form-item label="审核:">
           <el-radio-group v-model="auditForm.auditStatus">
             <el-radio :label="1">通过</el-radio>
@@ -79,29 +73,24 @@
 </template>
 
 <script>
+import { getProductById, auditProduct } from '@/api/product'
+import { mapGetters } from 'vuex'
 export default {
   data() {
     return {
       productInfo: {
-        productName: '产品名称产品名称',
-        snCode: 'adsgfadsgdsagasg',
-        productImage: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-        certificateImage: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-        paramList: [{
-          paramName: '参数名称',
-          paramContent: '参数信息信息'
-        }, {
-          paramName: '参数名称',
-          paramContent: '参数信息信息'
-        }, {
-          paramName: '参数名称',
-          paramContent: '参数信息信息'
-        }],
-        invoiceImage: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-        brandName: '品牌名',
-        buyChannel: '购买渠道'
+        productId: '',
+        productName: '',
+        snCode: '',
+        productImage: '',
+        certificateImage: '',
+        paramList: [],
+        invoiceImage: '',
+        brandName: '',
+        purchaseWay: ''
       },
       auditForm: {
+        productId: '',
         auditBy: '', // 审核人id
         authId: '', // 机构id
         auditStatus: 1, // 审核状态
@@ -112,8 +101,46 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters(['authUserId'])
+  },
+  created() {
+    this.productInfo.productId = this.$route.query.id
+    this.authId = this.$route.query.authId
+    this.getDetail()
+  },
   methods: {
-    submit() {}
+    // 获取商品详情
+    getDetail() {
+      this.isLoading = true
+      getProductById({ productId: this.productInfo.productId })
+        .then((res) => {
+          this.productInfo = { ...this.productInfo, ...res.data }
+        })
+        .finally(() => {
+          this.isLoading = false
+        })
+    },
+    // 提交审核信息
+    submit() {
+      this.$refs.auditForm.validate((valid) => {
+        if (valid) {
+          this.isLoading = true
+          // 指定审核人
+          this.auditForm.auditBy = this.authUserId
+          this.auditForm.productId = this.productInfo.productId
+          auditProduct(this.auditForm)
+            .then((res) => {
+              this.$message.success(res.data)
+              this.$store.dispatch('tagsView/delView', this.$route)
+              this.$router.back()
+            })
+            .finally(() => {
+              this.isLoading = false
+            })
+        }
+      })
+    }
   }
 }
 </script>
@@ -139,7 +166,7 @@ export default {
       padding-bottom: 16px;
       text-align: left;
 
-      &:first-child{
+      &:first-child {
         text-align: right;
       }
     }

+ 81 - 31
src/views/normal/audit/club/review.vue

@@ -47,45 +47,62 @@
           </template>
         </div>
       </div>
+
       <div class="row">
         <div class="col">机构类型:</div>
         <div class="col">
-          <el-radio-group v-model="clubInfo.clubType">
+          <el-radio-group v-model="clubInfo.firstClubType">
             <el-radio
               v-for="item in clubTypeList"
               :key="item.id"
               :label="item.id"
-              :disabled="clubInfo.clubType !== item.id"
+              :disabled="clubInfo.firstClubType !== item.id"
             >{{ item.name }}</el-radio>
           </el-radio-group>
         </div>
       </div>
-      <div class="row">
+
+      <div v-if="clubInfo.firstClubType === 1" class="row">
         <div class="col">医美类型:</div>
         <div class="col">
-          <el-radio-group v-model="clubInfo.medicalType">
+          <el-radio-group v-model="clubInfo.secondClubType">
             <el-radio
-              v-for="item in medicalTypeList"
+              v-for="item in medicalTypeList1"
               :key="item.id"
               :label="item.id"
-              :disabled="clubInfo.clubType !== item.id"
+              :disabled="clubInfo.secondClubType !== item.id"
             >{{ item.name }}</el-radio>
           </el-radio-group>
         </div>
       </div>
+
+      <div v-if="clubInfo.firstClubType === 2" class="row">
+        <div class="col">生美类型:</div>
+        <div class="col">
+          <el-radio-group v-model="clubInfo.secondClubType">
+            <el-radio
+              v-for="item in medicalTypeList2"
+              :key="item.id"
+              :label="item.id"
+              :disabled="clubInfo.secondClubType !== item.id"
+            >{{ item.name }}</el-radio>
+          </el-radio-group>
+        </div>
+      </div>
+
       <div class="row">
         <div class="col">医疗许可证:</div>
         <div class="col">
           <el-image
             style="width: 120px; height: 120px"
-            :src="clubInfo.licenseImage"
-            :preview-src-list="[clubInfo.licenseImage]"
+            :src="clubInfo.medicalLicenseImage"
+            :preview-src-list="[clubInfo.medicalLicenseImage]"
           />
         </div>
       </div>
       <div class="row">
         <div class="col">员工人数:</div>
-        <div class="col">{{ clubInfo.memberCount }}人</div>
+        <div class="col">{{ clubInfo.empNum }}人</div>
       </div>
 
       <div class="row">
@@ -101,12 +118,7 @@
         <div class="col">店铺备注:</div>
         <div class="col">{{ clubInfo.remarks }}人</div>
       </div>
-
-      <div class="row">
-        <div class="col">审核状态:</div>
-        <div class="col">待审核</div>
-      </div>
-      <el-form label-width="112px" :model="auditForm" :rules="rules">
+      <el-form ref="auditForm" label-width="112px" :model="auditForm" :rules="rules">
         <el-form-item label="审核:">
           <el-radio-group v-model="auditForm.auditStatus">
             <el-radio :label="1">通过</el-radio>
@@ -133,12 +145,15 @@
 
 <script>
 import AMapUI from '@/components/AMapUI'
+import { getAuthFormData, auditAuth } from '@/api/auth'
+import { mapGetters } from 'vuex'
 export default {
   components: {
     [AMapUI.name]: AMapUI
   },
   data() {
     return {
+      isLoading: false,
       dialogMapVisible: false,
       clubTypeList: [
         { id: 1, name: '医美' },
@@ -147,29 +162,32 @@ export default {
         { id: 4, name: '个人' },
         { id: 5, name: '其他' }
       ],
-      medicalTypeList: [
+      medicalTypeList1: [
         { id: 1, name: '诊所' },
         { id: 2, name: '门诊' },
         { id: 3, name: '医院' },
         { id: 4, name: '其他' }
       ],
+      medicalTypeList2: [
+        { id: 5, name: '美容院' },
+        { id: 6, name: '养生馆' },
+        { id: 7, name: '其他' }
+      ],
+      authId: '',
       clubInfo: {
-        medicalType: 1,
-        clubType: 1,
-        licenseImage: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-        memberCount: 10,
-        address: '广东省深圳市龙华区大浪街道',
-        area: '广东省深圳市龙华区',
+        secondClubType: 1,
+        firstClubType: 1,
+        medicalLicenseImage: '',
+        empNum: '',
+        address: '',
+        area: '',
         authId: '',
-        authParty: '水柔医美',
-        bannerList: [
-          'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-          'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
-        ],
+        authParty: '',
+        bannerList: [],
         cityId: '',
-        lngAndLat: '116.42729,39.904993',
-        logo: 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
-        mobile: '15872950940',
+        lngAndLat: '',
+        logo: '',
+        mobile: '',
         provinceId: '',
         townId: '',
         customFlag: 0,
@@ -186,8 +204,40 @@ export default {
       }
     }
   },
+  computed: {
+    ...mapGetters(['authUserId'])
+  },
+  created() {
+    this.auditForm.authId = this.$route.query.authId
+    this.getDetail()
+  },
   methods: {
-    submit() {}
+    // 数据回显
+    getDetail() {
+      getAuthFormData({ authId: this.auditForm.authId }).then((res) => {
+        this.clubInfo = { ...this.clubInfo, ...res.data }
+      })
+    },
+    // 提交审核信息
+    submit() {
+      this.$refs.auditForm.validate((valid) => {
+        if (valid) {
+          this.isLoading = true
+          // 指定审核人
+          this.auditForm.auditBy = this.authUserId
+          // 提交审核信息
+          auditAuth(this.auditForm)
+            .then((res) => {
+              this.$message.success(res.data)
+              this.$store.dispatch('tagsView/delView', this.$route)
+              this.$router.back()
+            })
+            .finally(() => {
+              this.isLoading = false
+            })
+        }
+      })
+    }
   }
 }
 </script>