소스 검색

Merge branch 'ch/ht_3.2' of eta_mini/eta_mini_crm_front into debug_ht

leichen 2 주 전
부모
커밋
58b974f19a
2개의 변경된 파일37개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 0
      src/api/author/common.js
  2. 27 1
      src/views/author/List.vue

+ 10 - 0
src/api/author/common.js

@@ -30,6 +30,16 @@ export default {
      */
     editAuthor: params => {
         return post('/analyst/edit',params)
+    },
+    /**
+     * 禁用/启用研究员
+     * @param {Object} params 
+     * @param {Number} params.Id
+     * @param {String} params.Status enabled-启用,disabled-禁用
+     * @returns 
+     */
+    analystStatus: params => {
+        return post('/analyst/status',params)
     }
 
 };

+ 27 - 1
src/views/author/List.vue

@@ -21,6 +21,7 @@ const tableColumns = [
     {label:'照片',key:'HeadImgURL',},
     {label:'从业资格号',key:'ProfessionalCertificate',},
     {label:'投资咨询号',key:'InvestmentCertificate',},
+    {label:'状态',key:'Status',width:150,fixed:'right'},
     {label:'添加时间',key:'CreatedTime',width:250},
 ]
 let modifyAuthorShow = ref(false)
@@ -91,6 +92,28 @@ async function handleSaveAuthor(){
     })
 }
 
+function handleDisabled(data){
+    apiAuthor.analystStatus({
+        Id: data.Id,
+        Status: 'disabled'
+    }).then(res=>{
+        tableLoading.value = false
+        if(res.Ret!==200) return 
+        ElMessage.success('禁用成功')
+        getTableData()
+    })
+}
+
+function handleEnabled(data){
+    apiAuthor.analystStatus({
+        Id: data.Id,
+        Status: 'enabled'
+    }).then(res=>{
+        if(res.Ret!==200) return 
+        ElMessage.success('启用成功')
+        getTableData()
+    })
+}
 </script>
 
 <template>
@@ -119,12 +142,15 @@ async function handleSaveAuthor(){
                                 style="display: inline-block;width:60px;height: 60px;" preview-teleported/>
                             <span v-else style="display: inline-block;width:60px;height: 60px;line-height: 60px;">-</span> 
                         </div>
+                        <span v-else-if="column.key==='Status'" :style="row.Status !== 'enabled' ? 'color: red;' : ''">{{ row.Status === 'enabled' ? '启用' : '禁用'}}</span>
                         <span v-else>{{ row[column.key]||'-' }}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label="操作">
                     <template #default="{row}">
-                        <el-link type="primary" :underline="false" @click="handleModifyAuthorShow(row)" v-permission="'analyst:config'">配置</el-link>
+                        <el-link type="primary" :underline="false" @click="handleModifyAuthorShow(row)" v-permission="'analyst:config'" style="margin-right: 10px;">配置</el-link>
+                        <el-link type="danger" v-if="row.Status === 'enabled'" :underline="false" @click="handleDisabled(row)">禁用</el-link>
+                        <el-link type="primary" v-else :underline="false" @click="handleEnabled(row)">启用</el-link>
                     </template>
                 </el-table-column>
             </el-table>