Browse Source

'0901-c01'

zory 2 tuần trước cách đây
mục cha
commit
52b49bc6eb

+ 26 - 0
src/api/model/account.js

@@ -0,0 +1,26 @@
+import config from "@/config"
+import http from "@/utils/request"
+
+export default {
+    list: {
+        url: `${config.API_URL}/account/list`,
+        name: "-",
+        get: async function(params){
+            return await http.get(this.url, params);
+        }
+    },
+    group: {
+        url: `${config.API_URL}/account/group`,
+        name: "-",
+        get: async function(params){
+            return await http.get(this.url, params);
+        }
+    },
+    sync: {
+        url: `${config.API_URL}/account/sync`,
+        name: "-",
+        post: async function(params){
+            return await http.post(this.url, params);
+        }
+    }
+}

+ 12 - 0
src/api/model/order.js

@@ -0,0 +1,12 @@
+import config from "@/config"
+import http from "@/utils/request"
+
+export default {
+    list: {
+        url: `${config.API_URL}/order/list`,
+        name: "-",
+        get: async function(params){
+            return await http.get(this.url, params);
+        }
+    },
+}

+ 7 - 0
src/api/model/product.js

@@ -15,5 +15,12 @@ export default {
         post: async function(params){
             return await http.post(this.url, params);
         }
+    },
+    status: {
+        url: `${config.API_URL}/product/status`,
+        name: "-",
+        post: async function(params){
+            return await http.post(this.url, params);
+        }
     }
 }

+ 71 - 0
src/views/project/account/components/option.vue

@@ -0,0 +1,71 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">按需操作</el-tag>
+        </legend>
+        <div class="op-header">
+            <div class="left-panel">
+                <el-button type="primary" icon="el-icon-plus" @click="table_add()">创建新计划</el-button>
+            </div>
+        </div>
+    </fieldset>
+    <formMain ref="formMain" @success="handleSuccess"></formMain>
+</template>
+
+<script>
+export default {
+    props: {
+        dataSelect: { type: Array, default: () => [] },
+        dataSelectFull: { type: Array, default: () => [] }
+    },
+    data(){
+        return {
+
+        }
+    },
+    methods: {
+        table_add(){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("add")
+            })
+        },
+        table_sync(){
+            this.$confirm(`发起同步后,请耐心等待1-2分钟后再刷新当前数据列表`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var resp = await this.$API.category.sync.get();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(() => {
+
+            })
+        },
+        table_batch_status(status){
+            if (this.dataSelect.length == 0) {
+                return this.$message.error("请选择修改数据")
+            }
+            this.$confirm(`审核中的商品不支持该操作,请确认是否有勾选审核中的商品`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var loading = this.$loading()
+                let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+                loading.close()
+                var resp = await this.$API.merGoods.batch.post(submitData);
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(() => {
+
+            })
+        },
+        handleSuccess(){
+            this.$emit("success");
+        }
+    }
+}
+</script>

+ 63 - 0
src/views/project/account/components/search.vue

@@ -0,0 +1,63 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.account" placeholder="账户ID" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>账户ID</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.name" placeholder="账户名称" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>账户名称</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+    <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        selectStore(){
+            this.$nextTick(()=>{
+                this.$refs.storeData.open()
+            })
+        },
+        handleStore(data){
+            this.searchKey.poi_id = data.poi_id;
+            this.searchKey.poi_name = data.poi_name;
+            this.$emit("success",this.searchKey);
+        },
+        clearStore(){
+            this.searchKey.poi_id = "";
+            this.searchKey.poi_name = "";
+            this.$emit("success",this.searchKey);
+        },
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 158 - 0
src/views/project/account/components/table.vue

@@ -0,0 +1,158 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="账户ID" width="300" prop="id" fixed="left">
+            <template #default="scope">
+                {{ scope.row.advertiser_id?scope.row.advertiser_id:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="账户名称" prop="category_id">
+            <template #default="scope">
+                {{ scope.row.advertiser_name?scope.row.advertiser_name:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="归属组织" prop="id">
+            <template #default="scope">
+                {{ scope.row.groups?scope.row.groups.account_name:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="状态" prop="enable" width="120" align="center">
+            <template #default="scope">
+                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
+                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 已下架</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.account.list
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+    
+    methods: {
+        table_rate(data){
+            this.$nextTick(() => {
+                this.$refs.editForm.open("goods").setData(data)
+            })
+        },
+        table_star(data){
+            this.$nextTick(() => {
+                this.$refs.editForm.open("star").setData(data)
+            })
+        },
+        table_auth(data){
+            this.$nextTick(() => {
+                this.$refs.comboMain.open("edit").setData(data)
+            })
+        },
+        table_update(data){
+            this.$confirm(`更新后可能数据没有变化,确定更新该达人的基础数据吗?`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var resp = await this.$API.merStar.update.post({"id":data.id});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(()=>{})
+        },
+        table_del(data){
+            this.$confirm(`删除后,所有该产品对应的数据将一并被删除`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var loading = this.$loading()
+                var resp = await this.$API.merPlan.merPlan.post({"id":data.id});
+                loading.close();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(()=>{})
+        },
+        table_close(data){
+            this.$confirm(`下架商品后,关联的落地页以及账户回调都将失效`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var loading = this.$loading()
+                var resp = await this.$API.merPlan.close.post({"id":data.id});
+                loading.close();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(()=>{})
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+        sortChange(event){
+            if (event.order) {
+                var data = {
+                    "field":event.prop,
+                    "order":event.order
+                }
+                this.$refs.table.upData(data)
+            } else {
+                this.$refs.table.reload(this.searchKey)
+            }
+            return ;
+        },
+        selectionChange(event){
+            this.dataSelect = [];
+            var arr = [];
+            var arrCompany = [];
+            event.forEach(function(val,index){
+                arr[index] = val.id;
+                arrCompany[index] = val;
+            });
+            this.dataSelectFull = arrCompany;
+            this.dataSelect = arr;
+            this.$emit("success",this.dataSelect);
+            this.$emit("successFull",this.dataSelectFull);
+        },
+        table_passwd(row){
+            this.$nextTick(() => {
+                this.$refs.userPasswd.open("edit").setData(row)
+            })
+        }
+    }
+}
+</script>
+
+<style>
+.goods-img{display: flex;gap: 5px;}
+.goods-img .name span{display: block;}
+.goods-img .name span.dec{color: #999;font-size: 12px;}
+.goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
+.goods-price .del{text-decoration: line-through;}
+.goods-price span{background-color: #fff !important;
+    border: 1px solid #d3d9e0 !important;
+    border-radius: 4px;
+    box-sizing: border-box;
+    color: #6c737a !important;
+    display: inline-flex;
+    flex: none;
+    font-size: 12px;
+    line-height: 18px !important;
+    padding: 1px 6px !important;text-decoration: none;}
+.flex{display: flex;align-items: center;gap: 5px;}
+</style>

+ 47 - 0
src/views/project/account/group.vue

@@ -0,0 +1,47 @@
+<template>
+    <el-container class="flex-column">
+        <div class="table-search">
+            <search @success="handleSuccess"></search>
+            <opMain @success="handleSuccess"></opMain>
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="3"></tablePage>
+            </div>
+        </el-main>
+    </el-container>  
+</template>
+
+<script>
+import search from './groups/search.vue';
+import tablePage from './groups/table.vue';
+import opMain from './groups/option.vue';
+export default {
+    components: {
+        search,tablePage,opMain
+    },
+    data(){
+        return {
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
+        }
+    },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
+}
+</script>

+ 69 - 0
src/views/project/account/groups/option.vue

@@ -0,0 +1,69 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">按需操作</el-tag>
+        </legend>
+        <div class="op-header">
+            <div class="left-panel">
+                <el-button type="primary" icon="el-icon-connection" @click="table_add()">授权新组织</el-button>
+            </div>
+        </div>
+    </fieldset>
+    <formMain ref="formMain" @success="handleSuccess"></formMain>
+</template>
+
+<script>
+export default {
+    props: {
+        dataSelect: { type: Array, default: () => [] },
+        dataSelectFull: { type: Array, default: () => [] }
+    },
+    data(){
+        return {
+
+        }
+    },
+    methods: {
+        table_add(){
+            window.open("https://open.oceanengine.com/audit/oauth.html?app_id=1874672050081403&state=ad&material_auth=1&rid=a6mm5mp5zm5", '_blank', 'noopener,noreferrer');
+        },
+        table_sync(){
+            this.$confirm(`发起同步后,请耐心等待1-2分钟后再刷新当前数据列表`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var resp = await this.$API.category.sync.get();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(() => {
+
+            })
+        },
+        table_batch_status(status){
+            if (this.dataSelect.length == 0) {
+                return this.$message.error("请选择修改数据")
+            }
+            this.$confirm(`审核中的商品不支持该操作,请确认是否有勾选审核中的商品`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var loading = this.$loading()
+                let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+                loading.close()
+                var resp = await this.$API.merGoods.batch.post(submitData);
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(() => {
+
+            })
+        },
+        handleSuccess(){
+            this.$emit("success");
+        }
+    }
+}
+</script>

+ 58 - 0
src/views/project/account/groups/search.vue

@@ -0,0 +1,58 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.name" placeholder="组织名称" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>组织名称</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+    <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        selectStore(){
+            this.$nextTick(()=>{
+                this.$refs.storeData.open()
+            })
+        },
+        handleStore(data){
+            this.searchKey.poi_id = data.poi_id;
+            this.searchKey.poi_name = data.poi_name;
+            this.$emit("success",this.searchKey);
+        },
+        clearStore(){
+            this.searchKey.poi_id = "";
+            this.searchKey.poi_name = "";
+            this.$emit("success",this.searchKey);
+        },
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 113 - 0
src/views/project/account/groups/table.vue

@@ -0,0 +1,113 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="组织ID" width="300" prop="id" fixed="left">
+            <template #default="scope">
+                {{ scope.row.account_id?scope.row.account_id:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="组织名称" prop="category_id">
+            <template #default="scope">
+                {{ scope.row.account_name?scope.row.account_name:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
+        <el-table-column label="操作" width="200" align="left" fixed="right">
+            <template #default="scope">
+                <el-button-group>
+                    <el-button type="danger" text size="small" @click="table_close(scope.row)">同步账户</el-button>
+                </el-button-group>
+            </template>
+        </el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.account.group
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+    
+    methods: {
+        table_close(data){
+            this.$confirm(`发起同步后,预计1-2分钟后数据会自动更新,可在账户列表中查看`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var loading = this.$loading()
+                var resp = await this.$API.account.sync.post({"id":data.account_id});
+                loading.close();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(()=>{})
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+        sortChange(event){
+            if (event.order) {
+                var data = {
+                    "field":event.prop,
+                    "order":event.order
+                }
+                this.$refs.table.upData(data)
+            } else {
+                this.$refs.table.reload(this.searchKey)
+            }
+            return ;
+        },
+        selectionChange(event){
+            this.dataSelect = [];
+            var arr = [];
+            var arrCompany = [];
+            event.forEach(function(val,index){
+                arr[index] = val.id;
+                arrCompany[index] = val;
+            });
+            this.dataSelectFull = arrCompany;
+            this.dataSelect = arr;
+            this.$emit("success",this.dataSelect);
+            this.$emit("successFull",this.dataSelectFull);
+        },
+        table_passwd(row){
+            this.$nextTick(() => {
+                this.$refs.userPasswd.open("edit").setData(row)
+            })
+        }
+    }
+}
+</script>
+
+<style>
+.goods-img{display: flex;gap: 5px;}
+.goods-img .name span{display: block;}
+.goods-img .name span.dec{color: #999;font-size: 12px;}
+.goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
+.goods-price .del{text-decoration: line-through;}
+.goods-price span{background-color: #fff !important;
+    border: 1px solid #d3d9e0 !important;
+    border-radius: 4px;
+    box-sizing: border-box;
+    color: #6c737a !important;
+    display: inline-flex;
+    flex: none;
+    font-size: 12px;
+    line-height: 18px !important;
+    padding: 1px 6px !important;text-decoration: none;}
+.flex{display: flex;align-items: center;gap: 5px;}
+</style>

+ 41 - 8
src/views/project/account/index.vue

@@ -1,12 +1,45 @@
 <template>
-
+    <el-container class="flex-column">
+        <div class="table-search">
+            <search @success="handleSuccess"></search>
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="3"></tablePage>
+            </div>
+        </el-main>
+    </el-container>  
 </template>
 
 <script>
-
-
-</script>
-
-<style>
-
-</style>
+import search from './components/search.vue';
+import tablePage from './components/table.vue';
+export default {
+    components: {
+        search,tablePage
+    },
+    data(){
+        return {
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
+        }
+    },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
+}
+</script>

+ 58 - 0
src/views/project/order/components/search.vue

@@ -0,0 +1,58 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.order_no" placeholder="订单编号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>订单编号</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+    <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        selectStore(){
+            this.$nextTick(()=>{
+                this.$refs.storeData.open()
+            })
+        },
+        handleStore(data){
+            this.searchKey.poi_id = data.poi_id;
+            this.searchKey.poi_name = data.poi_name;
+            this.$emit("success",this.searchKey);
+        },
+        clearStore(){
+            this.searchKey.poi_id = "";
+            this.searchKey.poi_name = "";
+            this.$emit("success",this.searchKey);
+        },
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 161 - 0
src/views/project/order/components/table.vue

@@ -0,0 +1,161 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="订单编号" width="300" prop="id" fixed="left">
+            <template #default="scope">
+                {{ scope.row.order_no?scope.row.order_no:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="订单信息" prop="category_id">
+            <template #default="scope">
+                <div class="goods-img">
+                    <div class="name">
+                        <span>{{ scope.row.account?scope.row.account.advertiser_name:'-' }}</span>
+                        <span class="dec">{{ scope.row.account?scope.row.account.advertiser_id:'-' }}</span>
+                    </div>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="归属账户" prop="category_id">
+            <template #default="scope">
+                <div class="goods-img">
+                    <div class="name">
+                        <span>{{ scope.row.account?scope.row.account.advertiser_name:'-' }}</span>
+                        <span class="dec">{{ scope.row.account?scope.row.account.advertiser_id:'-' }}</span>
+                    </div>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="归属产品" prop="category_id">
+            <template #default="scope">
+                {{ scope.row.product?scope.row.product.name:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="归属落地页" prop="category_id">
+            <template #default="scope">
+                {{ scope.row.pages?scope.row.pages.title:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="办理状态" prop="enable" width="120" align="center">
+            <template #default="scope">
+                {{ scope.row.status_str?scope.row.status_str:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="回传状态" prop="enable" width="120" align="center">
+            <template #default="scope">
+                <div class="status-success" v-if="scope.row.is_callback==1"><sc-status-indicator type="success"></sc-status-indicator> 已回传</div>
+                <div class="status-danger" v-else><sc-status-indicator type="danger"></sc-status-indicator> 未回传</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="回传时间" prop="enable" width="180" align="center">
+            <template #default="scope">
+                {{ scope.row.callback_at?scope.row.callback_at:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="回传方式" prop="enable" width="120" align="center">
+            <template #default="scope">
+                <div class="status-success" v-if="scope.row.is_auto==1"><sc-status-indicator type="success"></sc-status-indicator> 自动</div>
+                <div class="status-danger" v-if="scope.row.is_auto==2"><sc-status-indicator type="danger"></sc-status-indicator> 手动</div>
+                <div class="status-info" v-if="scope.row.is_auto==0"><sc-status-indicator type="info"></sc-status-indicator> 未回传</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
+        <el-table-column label="操作" width="200" align="left" fixed="right">
+            <template #default="scope">
+                <el-button-group>
+                    <el-button type="danger" text size="small" @click="table_close(scope.row)">手动回传</el-button>
+                </el-button-group>
+            </template>
+        </el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.order.list
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+    
+    methods: {
+        table_close(data){
+            this.$confirm(`手动回传后不影响自动回传的规则逻辑`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var loading = this.$loading()
+                var resp = await this.$API.account.sync.post({"id":data.account_id});
+                loading.close();
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$emit("success");
+            }).catch(()=>{})
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+        sortChange(event){
+            if (event.order) {
+                var data = {
+                    "field":event.prop,
+                    "order":event.order
+                }
+                this.$refs.table.upData(data)
+            } else {
+                this.$refs.table.reload(this.searchKey)
+            }
+            return ;
+        },
+        selectionChange(event){
+            this.dataSelect = [];
+            var arr = [];
+            var arrCompany = [];
+            event.forEach(function(val,index){
+                arr[index] = val.id;
+                arrCompany[index] = val;
+            });
+            this.dataSelectFull = arrCompany;
+            this.dataSelect = arr;
+            this.$emit("success",this.dataSelect);
+            this.$emit("successFull",this.dataSelectFull);
+        },
+        table_passwd(row){
+            this.$nextTick(() => {
+                this.$refs.userPasswd.open("edit").setData(row)
+            })
+        }
+    }
+}
+</script>
+
+<style>
+.goods-img{display: flex;gap: 5px;}
+.goods-img .name span{display: block;}
+.goods-img .name span.dec{color: #999;font-size: 12px;}
+.goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
+.goods-price .del{text-decoration: line-through;}
+.goods-price span{background-color: #fff !important;
+    border: 1px solid #d3d9e0 !important;
+    border-radius: 4px;
+    box-sizing: border-box;
+    color: #6c737a !important;
+    display: inline-flex;
+    flex: none;
+    font-size: 12px;
+    line-height: 18px !important;
+    padding: 1px 6px !important;text-decoration: none;}
+.flex{display: flex;align-items: center;gap: 5px;}
+</style>

+ 41 - 8
src/views/project/order/index.vue

@@ -1,12 +1,45 @@
 <template>
-
+    <el-container class="flex-column">
+        <div class="table-search">
+            <search @success="handleSuccess"></search>
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="3"></tablePage>
+            </div>
+        </el-main>
+    </el-container>  
 </template>
 
 <script>
-
-
-</script>
-
-<style>
-
-</style>
+import search from './components/search.vue';
+import tablePage from './components/table.vue';
+export default {
+    components: {
+        search,tablePage
+    },
+    data(){
+        return {
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
+        }
+    },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
+}
+</script>

+ 23 - 36
src/views/project/product/components/table.vue

@@ -1,58 +1,38 @@
 <template>
     <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
         <el-table-column type="selection" width="50" fixed="left"></el-table-column>
-        <el-table-column label="计划名称" width="300" prop="id" fixed="left">
+        <el-table-column label="产品编码" width="120" prop="id" fixed="left">
             <template #default="scope">
-                <div class="price">{{ scope.row.plan_name }}</div>
-                <span class="dec">计划ID:{{ scope.row.plan_id }}</span>
+                {{ scope.row.code?scope.row.code:'-' }}
             </template>
         </el-table-column>
-        <el-table-column label="所属商家" prop="id" width="260">
+        <el-table-column label="投放地区" width="120" prop="category_id">
             <template #default="scope">
-                <div class="goods-img">
-                    <div class="name" v-if="scope.row.poi">
-                        <span>{{ scope.row.poi.poi_name }}</span>
-                        <span class="dec">{{ scope.row.poi.poi_address }}</span>
-                    </div>
-                    <div v-else>-</div>
-                </div>
+                {{ scope.row.province?scope.row.province:'-' }}
             </template>
         </el-table-column>
-        <el-table-column label="抖音核销金额(元)" prop="id">
-            <template #header>
-                <el-tooltip effect="dark" placement="top-start" content="成交金额带来的核销金额">
-                    <div class="flex">抖音核销金额(元) <el-icon><el-icon-question-filled /></el-icon></div>
-                </el-tooltip>
-            </template>
+        <el-table-column label="产品名称" prop="id">
             <template #default="scope">
-                {{ scope.row.done_money?$TOOL.money(scope.row.done_money):'-' }}
+                {{ scope.row.name }}
             </template>
         </el-table-column>
-        <el-table-column label="成交金额(元)" prop="category_id">
-            <template #header>
-                <el-tooltip effect="dark" placement="top-start">
-                    <template #content>除通过达人视频、直播直接下单的成交金额外,还包含消费者<br>看过达人视频后,通过抖音其他渠道下单的成交金额,例如搜索等。</template>
-                    <div class="flex">成交金额(元) <el-icon><el-icon-question-filled /></el-icon></div>
-                </el-tooltip>
-            </template>
+        <el-table-column label="其他说明" prop="category_id">
             <template #default="scope">
-                {{ scope.row.order_money?$TOOL.money(scope.row.order_money):'-' }}
+                {{ scope.row.remark?scope.row.remark:'-' }}
             </template>
         </el-table-column>
         <el-table-column label="状态" prop="enable" width="120" align="center">
             <template #default="scope">
-                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 进行中</div>
-                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 已下架</div>
+                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
+                <div class="status-danger" v-if="scope.row.status==0"><sc-status-indicator type="danger"></sc-status-indicator> 已下架</div>
             </template>
         </el-table-column>
         <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
         <el-table-column label="操作" width="200" align="left" fixed="right">
             <template #default="scope">
                 <el-button-group>
-                    <el-button size="small" text @click="table_rate(scope.row)" v-if="scope.row.status == 1">修改佣金</el-button>
-                    <el-button type="success" size="small" text @click="table_star(scope.row)" v-if="scope.row.status == 1">达人</el-button>
-                    <el-button type="danger" text size="small" @click="table_close(scope.row)" v-if="scope.row.status == 1">关闭</el-button>
-                    <el-button type="danger" text size="small" @click="table_del(scope.row)" v-if="scope.row.status == 2">删除</el-button>
+                    <el-button type="danger" text size="small" @click="table_close(scope.row)" v-if="scope.row.status == 1">下架</el-button>
+                    <el-button type="success" text size="small" @click="table_close(scope.row)" v-if="scope.row.status == 0">上架</el-button>
                 </el-button-group>
             </template>
         </el-table-column>
@@ -109,7 +89,7 @@ export default {
             }).catch(()=>{})
         },
         table_del(data){
-            this.$confirm(`删除后,所有该计划对应的数据将一并被删除`, '提示', {
+            this.$confirm(`删除后,所有该产品对应的数据将一并被删除`, '提示', {
                 type: 'warning'
             }).then(async ()=>{
                 var loading = this.$loading()
@@ -123,17 +103,24 @@ export default {
             }).catch(()=>{})
         },
         table_close(data){
-            this.$confirm(`关闭该定向计划后,达人无法勾选对应商品进行直播`, '提示', {
+            var status = 1;
+            var str = "下架商品后,关联的落地页以及账户回调都将失效";
+            if (data.status == 0) {
+                status = 2;
+                str = "恢复商品上架,可继续投放";
+            }
+            console.log("data.status",status,data.status);
+            this.$confirm(str, '提示', {
                 type: 'warning'
             }).then(async ()=>{
                 var loading = this.$loading()
-                var resp = await this.$API.merPlan.close.post({"id":data.id});
+                var resp = await this.$API.product.status.post({"id":data.id,"status":status});
                 loading.close();
                 if (resp.code == 0) {
                     return this.$message.error(resp.msg);
                 }
                 this.$message.success(resp.msg);
-                this.$emit("success");
+                this.$refs.table.refresh()
             }).catch(()=>{})
         },
         refresh(){

+ 1 - 3
src/views/project/product/index.vue

@@ -2,7 +2,6 @@
     <el-container class="flex-column">
         <div class="table-search">
             <search @success="handleSuccess"></search>
-            <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" type="3"></optionBtn>
         </div>
         <el-main class="nopadding">
             <div class="table-container">
@@ -14,11 +13,10 @@
 
 <script>
 import search from './components/search.vue';
-import optionBtn from './components/option.vue';
 import tablePage from './components/table.vue';
 export default {
     components: {
-        search,tablePage,optionBtn
+        search,tablePage
     },
     data(){
         return {