wjx 1 year ago
parent
commit
38baf452eb

+ 20 - 4
src/views/accounts/account/components/changeRecord.vue

@@ -57,6 +57,13 @@
                             <div>{{ scope.row.platformInfo.platformName }}</div>
                         </template>
                     </el-table-column>
+                    <el-table-column prop="backCoefficient" label="回本系数" width="100" align="center">
+                        <template slot-scope="scope">
+                            <div>
+                                {{ scope.row.backCoefficient }}
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="createUser" label="操作人" width="90" :show-overflow-tooltip="true" align="center">
                         <template slot-scope="scope" v-if="scope.row.createUser">
                             <div>{{ scope.row.createUser.nickname }}</div>
@@ -143,6 +150,10 @@
                 <el-form-item label="充值模板" prop="rechargeTemplate">
                     <el-input v-model="queryPlatformCutRecord.rechargeTemplate" size="small" style="width: 140px" placeholder="输入充值模板" />
                 </el-form-item>
+                <el-form-item label="回本系数" prop="backCoefficient">
+                    <el-input-number v-model="queryPlatformCutRecord.backCoefficient" size="small" :min="0" :max="1"
+                        style="width: 140px" :step="0.1" placeholder="输入回本系数" />
+                </el-form-item>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="editCutShow = false">取 消</el-button>
@@ -173,6 +184,9 @@ export default {
             rulesCut: {
                 beginTime: [
                     { required: true, message: '请选择开始时间', trigger: 'change' }
+                ],
+                backCoefficient: [
+                    { required: true, message: '请选择回本系数', trigger: 'change' }
                 ]
             },
             totalCut: 0,
@@ -262,7 +276,7 @@ export default {
         },
         /** 新增记录 */
         handleCutRecord() {
-            const { id, businessGroupId, putUserId, operUserId, periodId, platformId, platformAccountId, bookId, putStatus, putChannel, rechargeTemplate } = this.resourceData
+            const { id, businessGroupId, putUserId, operUserId, periodId, backCoefficient, platformId, platformAccountId, bookId, putStatus, putChannel, rechargeTemplate } = this.resourceData
             this.editCutTitle = '插入起始记录'
             this.editCutShow = true
             this.queryPlatformCutRecord = {
@@ -276,7 +290,8 @@ export default {
                 bookId,
                 putStatus,
                 putChannel,
-                rechargeTemplate
+                rechargeTemplate,
+                backCoefficient
             }
         },
         /** 向后插入 */
@@ -290,7 +305,7 @@ export default {
             if(item.endTime) {
                 item.endTime = item.endTime.split(' ')[0]
             }
-            const { beginTime, endTime, id, resourceId, businessGroupId, operUserId, putUserId, periodId, platformId, platformAccountId, bookId, putStatus, putChannel, rechargeTemplate } = item
+            const { beginTime, endTime, id, resourceId, businessGroupId, operUserId, putUserId, backCoefficient, periodId, platformId, platformAccountId, bookId, putStatus, putChannel, rechargeTemplate } = item
             if(type === '修改') {
                 data = {beginTime, endTime, id}
             } else {
@@ -308,7 +323,8 @@ export default {
                 bookId,
                 putStatus,
                 putChannel,
-                rechargeTemplate
+                rechargeTemplate,
+                backCoefficient
             }
             if(platformId) {
                 this.selectZh(platformId, platformAccountId)

+ 42 - 27
src/views/accounts/account/components/cutBook.vue

@@ -1,10 +1,12 @@
 <template>
     <el-button size="mini" type="text" @click="handleCutBook">
-        <span><i class="el-icon-sort"></i>切书切平台</span> 
+        <span><i class="el-icon-sort"></i>切书切平台</span>
         <el-dialog :title="title" :visible.sync="open" width="330px" append-to-body @close="addClose">
-            <el-form :model="queryPlatform" :rules="rules" ref="platFormCutBook" label-position="right" label-width="80px" :inline="true">
+            <el-form :model="queryPlatform" :rules="rules" ref="platFormCutBook" label-position="right" label-width="80px"
+                :inline="true">
                 <el-form-item label="开始时间" prop="beginTime">
-                    <el-date-picker v-model="queryPlatform.beginTime" size="small" style="width: 200px" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="选择开始时间" />
+                    <el-date-picker v-model="queryPlatform.beginTime" size="small" style="width: 200px" format="yyyy-MM-dd"
+                        value-format="yyyy-MM-dd" type="date" placeholder="选择开始时间" />
                 </el-form-item>
                 <el-form-item label="期数" prop="periodId">
                     <el-select v-model="queryPlatform.periodId" size="small" placeholder="选择期数" filterable clearable>
@@ -12,12 +14,14 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item label="书城" prop="platformId">
-                    <el-select v-model="queryPlatform.platformId" @change="selectZh" size="small" placeholder="选择书城" filterable clearable>
+                    <el-select v-model="queryPlatform.platformId" @change="selectZh" size="small" placeholder="选择书城"
+                        filterable clearable>
                         <el-option v-for="item in bookCity" :key="item.id" :label="item.platformName" :value="item.id" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="账号" prop="platformAccountId">
-                    <el-select v-model="queryPlatform.platformAccountId" :disabled="!queryPlatform.platformId" size="small" placeholder="选择账号" filterable clearable>
+                    <el-select v-model="queryPlatform.platformAccountId" :disabled="!queryPlatform.platformId" size="small"
+                        placeholder="选择账号" filterable clearable>
                         <el-option v-for="item in accList" :key="item.id" :label="item.account" :value="item.id" />
                     </el-select>
                 </el-form-item>
@@ -27,8 +31,10 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item label="项目组" prop="businessGroupId">
-                    <el-select v-model="queryPlatform.businessGroupId" size="small" placeholder="选择项目组" filterable clearable>
-                        <el-option v-for="item in teamsList" :key="item.id" :label="item.businessGroupName" :value="item.id" />
+                    <el-select v-model="queryPlatform.businessGroupId" size="small" placeholder="选择项目组" filterable
+                        clearable>
+                        <el-option v-for="item in teamsList" :key="item.id" :label="item.businessGroupName"
+                            :value="item.id" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="投放状态" prop="putStatus">
@@ -41,12 +47,16 @@
                 </el-form-item>
                 <el-form-item label="投放渠道" prop="putChannel">
                     <el-select v-model="queryPlatform.putChannel" size="small" placeholder="选择投放渠道" filterable>
-                        <el-option :label="item.label" :value="item.value" :key="item.value" v-for="item in channelList"/>
+                        <el-option :label="item.label" :value="item.value" :key="item.value" v-for="item in channelList" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="充值模板" prop="rechargeTemplate">
                     <el-input v-model="queryPlatform.rechargeTemplate" size="small" placeholder="输入充值模板" />
                 </el-form-item>
+                <el-form-item label="回本系数" prop="backCoefficient">
+                    <el-input-number v-model="queryPlatform.backCoefficient" size="small" :min="0" :max="1"
+                        style="width: 140px" :step="0.1" placeholder="输入回本系数" />
+                </el-form-item>
                 <el-form-item label="备注" prop="remark">
                     <el-input v-model="queryPlatform.remark" type="textarea" size="small" placeholder="输入备注" />
                 </el-form-item>
@@ -64,13 +74,15 @@ import { cutBookPlatform, checkTime } from "@/api/accounts/account";
 import { formatDateYMD } from "@/utils"
 import { channelList } from "@/utils/const.js"
 export default {
-    data () {
+    data() {
         return {
             title: '',
             open: false,
             channelList: channelList,
             accList: [],  // 账号
-            queryPlatform: {},
+            queryPlatform: {
+                backCoefficient: 1
+            },
             rules: {
                 beginTime: [
                     { required: true, message: '请选择开始时间', trigger: 'blur' }
@@ -89,6 +101,9 @@ export default {
                 ],
                 putChannel: [
                     { required: true, message: '请选择投放渠道', trigger: 'blur' }
+                ],
+                backCoefficient: [
+                    { required: true, message: '请选择回本系数', trigger: 'blur' }
                 ]
             }
         }
@@ -118,17 +133,17 @@ export default {
     methods: {
         handleCutBook() {
             this.title = this.value.resourceName + '切书切平台'
-            const { periodId, platformId, platformAccountId, bookId, id, businessGroupId, putStatus, putChannel, rechargeTemplate } = this.value
-            this.queryPlatform = { periodId, platformId, platformAccountId, bookId, resourceId: id, beginTime: formatDateYMD(new Date()), businessGroupId, putStatus, putChannel, rechargeTemplate }
+            const { periodId, platformId, platformAccountId, bookId, id, businessGroupId, putStatus, putChannel, rechargeTemplate, backCoefficient } = this.value
+            this.queryPlatform = { periodId, platformId, platformAccountId, backCoefficient, bookId, resourceId: id, beginTime: formatDateYMD(new Date()), businessGroupId, putStatus, putChannel, rechargeTemplate }
             this.open = true
-            if(platformId) {
+            if (platformId) {
                 this.selectZh(platformId, platformAccountId)
             }
         },
         /** 关闭弹窗调用 */
         addClose() {
             this.open = false
-            this.queryPlatform = {}
+            this.queryPlatform = { backCoefficient: 1 }
         },
         selectZh(e, id) {
             this.queryPlatform.platformAccountId = id || null
@@ -163,16 +178,16 @@ export default {
 </script>
 
 <style>
-    .cutBook{
-        display: inline;
-        line-height: normal;
-    }
-    .dropdownItem {
-        cursor: pointer;
-        color: #409EFF;
-        font-size: 12px;
-        padding: 4px 0;
-        display: inline;
-        line-height: normal;
-    }
-</style>
+.cutBook {
+    display: inline;
+    line-height: normal;
+}
+
+.dropdownItem {
+    cursor: pointer;
+    color: #409EFF;
+    font-size: 12px;
+    padding: 4px 0;
+    display: inline;
+    line-height: normal;
+}</style>

+ 20 - 5
src/views/accounts/account/index.vue

@@ -168,6 +168,13 @@
                     </div>
                 </template>
             </el-table-column>
+            <el-table-column prop="backCoefficient" label="回本系数" width="100" align="center">
+                <template slot-scope="scope">
+                    <div>
+                        {{ scope.row.backCoefficient }}
+                    </div>
+                </template>
+            </el-table-column>
             <el-table-column label="账号" prop="platformAccountInfo" width="300">
                 <template slot-scope="scope">
                     <div v-if="scope.row.platformAccountInfo && scope.row.platformAccountInfo.account">
@@ -338,6 +345,10 @@
                     <el-input v-model="queryPlatform.rechargeTemplate" size="small" style="width: 140px"
                         placeholder="输入充值模板" />
                 </el-form-item>
+                <el-form-item label="回本系数" prop="backCoefficient" v-if="isAdd">
+                    <el-input-number v-model="queryPlatform.backCoefficient" size="small" :min="0" :max="1" style="width: 140px" :step="0.1"
+                        placeholder="输入回本系数" />
+                </el-form-item>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="openEdit = false">取 消</el-button>
@@ -521,7 +532,7 @@ export default {
             // 分组数据
             groupingData: [],
             isAdd: true,
-            queryPlatform: {},
+            queryPlatform: {backCoefficient: 1},
             rules: {
                 beginTime: [
                     { required: true, message: '请输入开始时间', trigger: 'blur' }
@@ -537,6 +548,9 @@ export default {
                 ],
                 putStatus: [
                     { required: true, message: '请选择投放状态', trigger: 'blur' }
+                ],
+                backCoefficient: [
+                    { required: true, message: '请选择回本系数', trigger: 'blur' }
                 ]
             },
             userAll: [], //所有用户
@@ -691,7 +705,7 @@ export default {
         /** 编辑按钮方法 */
         handleEdit(value) {
             console.log(value)
-            let { id, resourceKey, resourceName, bookId, rechargeTemplate, putChannel, putStatus, platformAccountId, platformId, resourceType, resourceGroupId, businessGroupId, periodId } = value
+            let { id, resourceKey, resourceName, bookId, rechargeTemplate, putChannel, putStatus, platformAccountId, platformId, resourceType, resourceGroupId, businessGroupId, periodId, backCoefficient } = value
             this.$nextTick(() => {
                 this.queryPlatform = Object.assign({}, {
                     id,
@@ -706,7 +720,8 @@ export default {
                     bookId,
                     putStatus,
                     putChannel,
-                    rechargeTemplate
+                    rechargeTemplate,
+                    backCoefficient
                 }) // 给表单赋值
             })
             this.isAdd = false
@@ -758,11 +773,11 @@ export default {
             }
             this.getList()
         },
-        // 新增公众号
+        // 新增资源
         handleAdd() {
             this.isAdd = true
             this.openEdit = true
-            this.queryPlatform = {}
+            this.queryPlatform = { backCoefficient: 1 }
         },
         /** 新增 编辑 提交 */
         submit(formName) {