Browse Source

医健宝-多店铺审核页面优化

chenguo 1 tuần trước cách đây
mục cha
commit
fa580d199a

+ 37 - 33
src/views/hisStore/components/storeDetails.vue

@@ -162,7 +162,7 @@
 
 
       </el-descriptions>
-      <div v-if="item.isAudit===0" class="dialog">
+      <div v-if="item.isAudit===0 && this.showAudit" class="dialog">
         <el-divider content-position="left">审核</el-divider>
         <el-form ref="form1" :model="form1" :rules="rules1" label-width="80px">
           <el-form-item label="审核理由" prop="reason">
@@ -210,61 +210,65 @@
 <script>
 import { audit, getStore, getStoreAuditLog } from '@/api/hisStore/store'
 export default {
-  name: "user",
-  props:["data"],
+  name: 'user',
+  props:['data'],
   data() {
     return {
+      showAudit: true,
       statusOptions: [],
       // 审核状态字典
       isAuditOptions: [],
       item:null,
       logoUrl:[],
       form: {
-        sreason: '',
+        sreason: ''
       },
       form1: {},
       rules1: {
         auditReason: [
-          { required: true, message: "审核理由不能为空", trigger: "blur" }
+          { required: true, message: '审核理由不能为空', trigger: 'blur' }
         ]
-      },
+      }
     }
   },
   created() {
-    this.getDicts("sys_company_status").then(response => {
-      this.statusOptions = response.data;
-    });
-    this.getDicts("sys_company_isaudit").then(response => {
-      this.isAuditOptions = response.data;
-    });
+    this.getDicts('sys_company_status').then(response => {
+      this.statusOptions = response.data
+    })
+    this.getDicts('sys_company_isaudit').then(response => {
+      this.isAuditOptions = response.data
+    })
   },
   destroyed() {
-    this.item = null;
-    this.form1 = {};
+    this.item = null
+    this.form1 = {}
   },
   methods: {
-    getDetails(orderId) {
-      this.item = null;
+    getDetails(orderId,showAudit) {
+      if(showAudit === 0) {
+        this.showAudit = false
+      }
+      this.item = null
       Promise.all([getStore(orderId), getStoreAuditLog(orderId)])
         .then(([storeResponse, auditResponse]) => {
-          this.item = storeResponse.data;
+          this.item = storeResponse.data
           // 确保 item 不为 null 后再设置 auditLogs
-          this.$set(this.item, 'auditLogs', auditResponse.auditLog);
-        });
+          this.$set(this.item, 'auditLogs', auditResponse.auditLog)
+        })
     },
     handleUpdate(oper) {
-      let operStr = oper === 1 ? "审核通过" : "审核退回";
-      this.$confirm("是否确认"+operStr+"店铺?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+      let operStr = oper === 1 ? '审核通过' : '审核退回'
+      this.$confirm('是否确认'+operStr+'店铺?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       }).then(()=> {
         let param = {}
-        param.storeId = this.item.storeId;
-        param.reason = this.form1.reason;
-        param.attachImage = this.form1.attachImage;
-        param.isAudit=oper;
-        return audit(param);
+        param.storeId = this.item.storeId
+        param.reason = this.form1.reason
+        param.attachImage = this.form1.attachImage
+        param.isAudit=oper
+        return audit(param)
       }).then(res => {
         if(res.code === 200){
           this.$message.success("审核成功");
@@ -276,10 +280,10 @@ export default {
       }).catch(function() {
 
       }).finally(()=>{
-        this.form1.auditReason = null;
-        this.form1.attachment = null;
-      });
-    },
+        this.form1.auditReason = null
+        this.form1.attachment = null
+      })
+    }
   }
 }
 </script>

+ 1 - 1
src/views/hisStore/store/index.vue

@@ -736,7 +736,7 @@ export default {
     handledetails(row) {
       this.show.open = true;
       setTimeout(() => {
-        this.$refs.Details.getDetails(row.storeId);
+        this.$refs.Details.getDetails(row.storeId,0);
       }, 1);
     },