Browse Source

fix:优化修复

chenlei 5 months ago
parent
commit
abb96d4706

+ 17 - 0
src/api/order/order.js

@@ -63,4 +63,21 @@ export default {
     getExportTradeOrder:params=>{
         return get('/order/tradeOrder/export',params)
     },
+    /**
+     * 退款详情 
+     * @param {String} params.ProductOrderNo
+     * @returns 
+     */
+    getRefundDetail:params=>{
+        return get('/order/refundDetail',params)
+    },
+    /**
+     * 退款
+     * @param {String} params.ProductOrderNo
+     * @param {String} params.Remark
+     * @returns 
+     */
+    postOrderRefund:params=>{
+        return post('/order/refund',params)
+    }
 };

+ 4 - 0
src/api/system/common.js

@@ -12,5 +12,9 @@ export default{
     // 上传文件
     uploadFile:params=>{
         return post('/report_pdf/uploadPdf',params)
+    },
+    // 上传文件
+    getSysConfig:params=>{
+        return get('/sys/config',params)
     }
 }

+ 47 - 16
src/views/author/List.vue

@@ -16,8 +16,11 @@ const tableQuery = reactive({
 
 const tableColumns = [
     {label:'研究员名称',key:'Name',},
+    {label:'职位',key:'Position',},
     {label:'简介',key:'Introduction'},
     {label:'照片',key:'HeadImgURL',},
+    {label:'从业资格号',key:'ProfessionalCertificate',},
+    {label:'投资咨询号',key:'InvestmentCertificate',},
     {label:'添加时间',key:'CreatedTime',width:250},
 ]
 let modifyAuthorShow = ref(false)
@@ -76,9 +79,9 @@ async function handleSaveAuthor(){
     try{
         await formRef.value?.validate()
     }catch(e){ return }
-    const {Id,HeadImgURL,Introduction,Name} = curAuthorData.value
+    const {Id,HeadImgURL,Introduction,Name,ProfessionalCertificate,Position,InvestmentCertificate} = curAuthorData.value
     apiAuthor.editAuthor({
-        Id,HeadImgUrl:HeadImgURL,Introduction,Name
+        Id,HeadImgUrl:HeadImgURL,Introduction,Name,ProfessionalCertificate,Position,InvestmentCertificate
     }).then(res=>{
         if(res.Ret!==200) return 
         ElMessage.success('配置成功')
@@ -135,25 +138,40 @@ async function handleSaveAuthor(){
             />
         </div>
     </div>
-    <el-dialog v-model="modifyAuthorShow" title="配置作者" width="646px" draggable>
+    <el-dialog v-model="modifyAuthorShow" title="配置作者" width="60%" draggable>
         <div class="content-wrap">
             <el-form label-width="95px" label-position="left" :rules="rules" ref="formRef" :model="curAuthorData">
                 <el-form-item label="研究员名称">
                     {{ curAuthorData.Name||'-' }}
                 </el-form-item>
-                <el-form-item label="简介" prop="Introduction">
-                    <el-input type="textarea" placeholder="请输入作者简介" v-model="curAuthorData.Introduction"></el-input>
-                </el-form-item>
-                <el-form-item label="照片" prop="HeadImgURL">
-                    <ImageUpload
-                        :imgUrl="curAuthorData.HeadImgURL"
-                        uploadHint="支持jpg、jpeg、png等格式,建议上传宽高比例为1:1的图片"
-                        width="120px"
-                        height="120px"
-                        @upload="handleUploadImg"
-                        @remove="curAuthorData.HeadImgURL=''"
-                    ></ImageUpload>
-                </el-form-item>
+                <div class="content-box">
+                    <div class="content-item">
+                        <el-form-item label="简介" prop="Introduction" class="form-item">
+                            <el-input type="textarea" placeholder="请输入作者简介" :rows="5" v-model="curAuthorData.Introduction"></el-input>
+                        </el-form-item>
+                        <el-form-item label="从业资格号" class="form-item">
+                            <el-input placeholder="请输入作者从业资格号" :rows="5" v-model="curAuthorData.ProfessionalCertificate"></el-input>
+                        </el-form-item>
+                        <el-form-item label="照片" prop="HeadImgURL" class="form-item">
+                            <ImageUpload
+                                :imgUrl="curAuthorData.HeadImgURL"
+                                uploadHint="支持jpg、jpeg、png等格式,建议上传宽高比例为1:1的图片"
+                                width="120px"
+                                height="120px"
+                                @upload="handleUploadImg"
+                                @remove="curAuthorData.HeadImgURL=''"
+                            ></ImageUpload>
+                        </el-form-item>                 
+                    </div>
+                    <div class="content-item">
+                        <el-form-item label="职位" class="form-item">
+                            <el-input placeholder="请输入作者职位" :rows="5" v-model="curAuthorData.Position"></el-input>
+                        </el-form-item>
+                        <el-form-item label="投资咨询号" class="form-item">
+                            <el-input placeholder="请输入作者投资咨询号" :rows="5" v-model="curAuthorData.InvestmentCertificate"></el-input>
+                        </el-form-item>
+                    </div>
+                </div>
             </el-form>
         </div>
         <template #footer>
@@ -174,4 +192,17 @@ async function handleSaveAuthor(){
         margin-top: 25px;
     }
 }
+.content-box {
+    display: flex;
+    justify-content: space-between;
+    .content-item {
+        width: 49%;
+        .form-item {
+            margin-bottom: 15px;
+            :deep(.el-input__wrapper){ 
+            padding:5px 10px;
+        }
+        }
+    }
+}
 </style>

+ 3 - 2
src/views/customer/components/ReadDialog.vue

@@ -37,7 +37,7 @@ import {apiCustomerUser} from '@/api/customer'
 const tableColumns = [
     {
         label:'标题',
-        key:'',
+        key:'SourceTitle',
         sortable:false
     },{
         label:'产品类型',
@@ -114,7 +114,7 @@ function handleSelectChange(){
   >
     <div class="dialog-content">
         <div class="dialog-content-top">
-            <el-select v-model="tableQuery.ProductType" clearable @change="handleSelectChange()" placeholder="请选择" style="width: 250px; margin-right: 20px;">
+            <el-select v-model="tableQuery.ProductType" clearable @change="handleSelectChange()" placeholder="全部" style="width: 250px; margin-right: 20px;">
                 <el-option
                 v-for="item in options"
                 :key="item.value"
@@ -134,6 +134,7 @@ function handleSelectChange(){
                     emitPath:false,
                     multiple:true
                 }"
+                placeholder="请选择品种"
                 style="width: 250px;"
                 clearable>
             </el-cascader>

+ 45 - 22
src/views/order/OrderList.vue

@@ -4,6 +4,7 @@ import { Search } from '@element-plus/icons-vue'
 import {apiOrderConfig} from '@/api/order'
 import { apiMediaCommon } from '@/api/media'
 import UserDialog from './components/UserDialog.vue'
+import { apiSystemCommon } from '@/api/system'
 
 const tableColumns = [
     {
@@ -128,9 +129,10 @@ const tableQuery = reactive({
 const tableData = ref([])
 const show = ref(false)
 const showUserDialog = ref(false)
+const isRefund = ref(false)
 function getTableData(){
     apiOrderConfig.getProductOrderList({
-        Keyword:tableQuery.keyWord,
+        KeyWord:tableQuery.keyWord,
         CurrentIndex:tableQuery.currentPage,
         PageSize:tableQuery.pageSize,
         SortType:tableQuery.sortType,
@@ -150,12 +152,20 @@ function getTableData(){
 getTableData()
 getLableList()
 const labelOptions = ref([])
-const userId = ref('')
-const value1 = ref(['',''])
+const refundRow = ref({})
 function getLableList(){
-    apiMediaCommon.getPermissionList().then(res=>{
+    apiSystemCommon.getSysConfig({
+        ConfigKey:'paymentWay'
+    }).then(res=>{
         if(res.Ret!==200) return
-        labelOptions.value = res.Data.List||[]
+        labelOptions.value = res.Data.paymentWay.map(item => {
+            const key = Object.keys(item)[0]; // 获取支付方式的中文名称
+            const value = item[key]; // 获取支付方式的英文名称
+            return {
+                value: value, // 将英文名称设置为 value
+                label: key // 将中文名称设置为 label
+            };
+        })
     })
 }
 
@@ -175,24 +185,15 @@ function handleSortChange({order,prop}){
     getTableData()
 }
 
-// 查看用户详情
-function Details(row) {
-    if (row.ReadCount <= 0) return;
-    show.value = true;
-    userId.value = row.TemplateUserId + '';
-}
 function handleSelectChange() {
     getTableData();
 }
-function userDetails(row) {
-    showUserDialog.value = true;
-}
 
 /* 下载数据 */
 async function downloadExcel() {
     const res = await apiOrderConfig.getExportProductOrder(
         {
-            Keyword:tableQuery.keyWord,
+            KeyWord:tableQuery.keyWord,
             SortType:tableQuery.sortType,
             PaymentDate:tableQuery.paymentDate,
             PaymentWay:tableQuery.paymentWay,
@@ -215,6 +216,24 @@ async function downloadExcel() {
     URL.revokeObjectURL(elink.href); // 释放URL 对象
     document.body.removeChild(elink); // 释放标
 }
+
+function operation (handle, row) {
+    refundRow.value = row
+    console.log(refundRow);
+    
+    switch (handle) {
+        case 'details':
+            showUserDialog.value = true;
+            isRefund.value = false
+        break
+        case 'refund':
+            showUserDialog.value = true;
+            isRefund.value = true
+        break;
+        default:
+        return false;
+    }
+}
 </script>
 
 <template>
@@ -238,9 +257,13 @@ async function downloadExcel() {
                         :value="item.value">
                         </el-option>
                     </el-select>
-                    <el-select v-model="tableQuery.FollowingGzh" clearable @change="handleSelectChange()" placeholder="支付渠道" style="width: 150px; margin-right: 20px;">
-                        <el-option label="是" :value="true"></el-option>
-                        <el-option label="否" :value="false"></el-option>
+                    <el-select v-model="tableQuery.paymentWay" clearable @change="handleSelectChange()" placeholder="支付渠道" style="width: 150px; margin-right: 20px;">
+                        <el-option
+                            v-for="item in labelOptions"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                        </el-option>
                     </el-select>
                     <el-select v-model="tableQuery.refundStatus" clearable @change="handleSelectChange()" placeholder="售后状态" style="width: 150px; margin-right: 20px;">
                         <el-option
@@ -289,9 +312,9 @@ async function downloadExcel() {
                             <el-tag :type="scope.row[column.key]=== 'Open' ?'success':'info'">{{scope.row[column.key]=== 'Open'?'已开户':'未开户' }}</el-tag>
                         </template>
                         <template #default="scope" v-else-if="column.key === 'handle'">
-                            <span v-if="scope.row.Status !== '已支付'" @click="operation('stock', scope.row)">-</span>
-                            <span class="edit" v-if="scope.row.Status === '已支付' && scope.row.RefundStatus === '退款成功'"  @click="operation('delist', scope.row)" >退款详情</span>
-                            <span class="edit" v-if="scope.row.Status === '已支付'" @click="operation('edit', scope.row)">退款</span>
+                            <span v-if="scope.row.Status !== '已支付' && scope.row.RefundStatus !== '退款成功'">-</span>
+                            <span class="edit" v-if="scope.row.Status === '售后' && scope.row.RefundStatus === '退款成功'"  @click="operation('details', scope.row)" >退款详情</span>
+                            <span class="edit" v-if="scope.row.Status === '已支付'" @click="operation('refund', scope.row)">退款</span>
                         </template>
                         <template #default="scope" v-else>
                             {{scope.row[column.key] || '-'}}
@@ -309,7 +332,7 @@ async function downloadExcel() {
                 />
             </div>
         </div>
-        <UserDialog v-model:show="showUserDialog" :userId="userId"></UserDialog>
+        <UserDialog v-model:show="showUserDialog" :isRefund="isRefund" :row="refundRow"></UserDialog>
     </el-card>
 </template>
 

+ 2 - 2
src/views/order/PaymentList.vue

@@ -92,7 +92,7 @@ const show = ref(false)
 const showUserDialog = ref(false)
 function getTableData(){
     apiOrderConfig.getTradeOrderList({
-        Keyword:tableQuery.keyWord,
+        KeyWord:tableQuery.keyWord,
         CurrentIndex:tableQuery.currentPage,
         PageSize:tableQuery.pageSize,
         SortType:tableQuery.sortType,
@@ -153,7 +153,7 @@ function userDetails(row) {
 async function downloadExcel() {
     const res = await apiOrderConfig.getExportTradeOrder(
         {
-            Keyword:tableQuery.keyWord,
+            KeyWord:tableQuery.keyWord,
             SortType:tableQuery.sortType,
             PaymentDate:tableQuery.paymentDate,
             PaymentWay:tableQuery.paymentWay,

+ 2 - 2
src/views/order/RefundList.vue

@@ -87,7 +87,7 @@ const tableQuery = reactive({
 const tableData = ref([])
 function getTableData(){
     apiOrderConfig.getTradeOrderList({
-        Keyword:tableQuery.keyWord,
+        KeyWord:tableQuery.keyWord,
         CurrentIndex:tableQuery.currentPage,
         PageSize:tableQuery.pageSize,
         SortType:tableQuery.sortType,
@@ -116,7 +116,7 @@ function handleSelectChange() {
 async function downloadExcel() {
     const res = await apiOrderConfig.getExportTradeOrder(
         {
-            Keyword:tableQuery.keyWord,
+            KeyWord:tableQuery.keyWord,
             SortType:tableQuery.sortType,
             PaymentDate:tableQuery.paymentDate,
             PaymentWay:tableQuery.paymentWay,

+ 85 - 99
src/views/order/components/UserDialog.vue

@@ -1,91 +1,50 @@
 <script setup>
+import { ref, reactive } from 'vue'
+import {apiOrderConfig} from '@/api/order'
+import { InfoFilled } from '@element-plus/icons-vue'
 const show = defineModel('show', { type: Boolean, default: false })
 const props=defineProps({
-    userId:{
-        type:String,
-        default:''
+    isRefund:{
+        type:Boolean,
+        default:false
+    },
+    row:{
+        type:Object,
+        default:()=>{}
     },
 })
-const emits = defineEmits(["success"])
-emits("success")
 
 watch(() => props.show, (newval) => {
   if (newval) {
-    getTableData()
+    if (!props.isRefund) {
+        getRefundData()
+    } else {
+        refundInfo.value = props.row||{}
+    }
   }
 })
-const options = ref([
-    {
-        value: 'report',
-        label: '报告'
-    }, {
-        value: 'audio',
-        label: '音频'
-    }, {
-        value: 'video',
-        label: '视频'
-    }
-])
-
-import { ref, reactive } from 'vue'
-import {apiOrderConfig} from '@/api/order'
-
-const tableColumns = [
-    {
-        label:'标题',
-        key:'SourceName',
-        sortable:false
-    },{
-        label:'产品类型',
-        key:'SourceId',
-        sortable:false
-    },{
-        label:'品种',
-        key:'PermissionNames',
-        sortable:false,
-    },{
-        label:'最近一次点击时间',
-        key:'ClickTime',
-        sortable:true
-    },{
-        label:'停留时长',
-        key:'ReadDurationMinutes',
-        sortable:true
-    }
-]
 
-const tableQuery = reactive({
-    sortParam:'',
-    sortType:'',
-})
-const tableData = ref([])
-function getTableData(){
-    apiOrderConfig.getUserDetail({
-        UserId:props.userId,
+const refundInfo = ref({})
+const remark = ref('')
+function getRefundData(){
+    apiOrderConfig.getRefundDetail({
+        ProductOrderNo:props.row.ProductOrderNo,
     }).then(res=>{
         if(res.Ret!==200) return
-        tableData.value = res.Data.List||[]
-        tableQuery.totals = res.Data.Paging && res.Data.Paging.Totals||0
+        refundInfo.value = res.Data||{}
+        remark.value = refundInfo.value.Remark||''
     })
 }
-// function handlePageChange(page){
-//     tableQuery.currentPage = page
-//     getTableData()
-// }
-function handleSortChange({order,prop}){
-    const propMap = {
-        0:'ClickTime',
-        1:'ReadDurationMinutes',
-    }
-    tableQuery.sortParam = propMap[prop]||2
-    tableQuery.sortType = order==='ascending'?1:0
-    getTableData()
-}
 
-function handleSelectChange(){
-    getTableData()
+function confirm() {
+    apiOrderConfig.postOrderRefund({
+        ProductOrderNo:props.row.ProductOrderNo,
+        Remark:remark.value
+    }).then(res=>{
+        if(res.Ret!==200) return
+        show.value = false
+    })
 }
-
 </script>
 
 <template>
@@ -93,50 +52,77 @@ function handleSelectChange(){
     v-model="show"
     :close-on-click-modal="false"
     :modal-append-to-body="false"
-    width="60%"
+    width="30%"
     draggable
-    title="阅读详情"
+    :title="props.isRefund ? '退款' : '退款详情'"
   >
-    <div class="dialog-content">
+    <div class="dialog-top">
         <div class="dialog-content-top">
+            <div class="dialog-top-item">
+                退款用户:{{ refundInfo.RealName }}
+            </div>
+            <div class="dialog-top-item">
+                退回账号:{{  }}
+            </div>
+            <div class="dialog-top-item">
+                退款金额:{{ refundInfo.RefundAmount }}
+            </div>
+        </div>
+        <div class="dialog-content">
+            <div class="dialog-content-item">
+                退款说明
+            </div>
+            <el-input
+                type="textarea"
+                :rows="5"
+                placeholder="请输入内容"
+                v-model="remark">
+            </el-input>
         </div>
-        <div class="table">
-            <el-table :data="tableData" @sort-change="handleSortChange">
-                <el-table-column 
-                    v-for="column in tableColumns" :key="column.key"
-                    :prop="column.key" :label="column.label" :sortable="column.sortable">
-                    <template #default="scope">
-                        {{scope.row[column.key]}}
-                    </template>
-                </el-table-column>
-            </el-table>
-            <!-- <el-pagination
-                background
-                layout="total,prev,pager,next,jumper"
-                :current-page="tableQuery.currentPage"
-                :page-size="tableQuery.pageSize"
-                :total="tableQuery.totals"
-                @current-change="handlePageChange"
-                style=" justify-content: flex-end; margin-top: 10px;"
-            /> -->
+    </div>
+    <div class="dialog-footer">
+        <el-button @click="show = false">取 消</el-button>
+        <div class="button">
+            <el-button type="primary" @click="confirm()" style="margin-right: 10px;">确定</el-button>
+            <el-tooltip
+                class="box-item"
+                effect="dark"
+                content="原支付渠道退款"
+                placement="top"
+            >
+                <el-icon><InfoFilled /></el-icon>
+            </el-tooltip>
         </div>
     </div>
   </el-dialog>
 </template>
 
 <style scoped lang="scss">
-.dialog-content {
-    // padding: 10px 50px 50px 50px;
+.dialog-top {
+    padding-bottom: 40px;
     .dialog-content-top {
         display: flex;
         justify-content: flex-start;
         padding-bottom: 30px;
-        :deep(.el-cascader-node__label) {
-            max-width: 111px;
+        .dialog-top-item {
+            flex: 1;
+            padding-right: 20px;
         }
     }
-    .table {
-        padding-bottom: 30px;
+    .dialog-content{
+        .dialog-content-item {
+            padding-bottom: 10px;
+        }
+    }
+}
+.dialog-footer {
+    display: flex;
+    justify-content: space-around;
+    padding-bottom: 40px;
+    .button {
+        display: flex;
+        justify-content: space-around;
+        align-items: center;
     }
 }
 

+ 1 - 1
src/views/products/PackageConfigList.vue

@@ -100,7 +100,7 @@ const tableQuery = reactive({
 function getTableData(){
     apiProductsConfig.getproductList({
         IsSingle:false, // 是否是单品
-        Keyword:tableQuery.keyWord,
+        KeyWord:tableQuery.keyWord,
         CurrentIndex:tableQuery.currentPage,
         PageSize:tableQuery.pageSize,
         ProductType:tableQuery.ProductType,

+ 1 - 1
src/views/products/SingleConfigList.vue

@@ -97,7 +97,7 @@ const tableQuery = reactive({
 function getTableData(){
     apiProductsConfig.getproductList({
         IsSingle:true, // 是否是单品
-        Keyword:tableQuery.keyWord,
+        KeyWord:tableQuery.keyWord,
         CurrentIndex:tableQuery.currentPage,
         PageSize:tableQuery.pageSize,
         ProductType:tableQuery.ProductType,

+ 1 - 1
src/views/products/addSingleList.vue

@@ -63,7 +63,7 @@ getTableData()
 getLableList()
 function getTableData(){
     apiProductsConfig.getUnSetProductList({
-        Keyword:tableQuery.keyWord,
+        KeyWord:tableQuery.keyWord,
         CurrentIndex:tableQuery.currentPage,
         PageSize:tableQuery.pageSize,
         ProductType:tableQuery.ProductType,