Commit 01646854 by 王志慧

Merge branch 'dev_v4.17.0' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into wangzh_dev_v4.17.0
2 parents cddbd1d5 6f8784f1
......@@ -3508,27 +3508,6 @@
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz",
"integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
......@@ -3918,6 +3897,27 @@
"lodash": "^4.17.4"
}
},
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz",
"integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"@vue/vue2-jest": {
"version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
......@@ -17687,7 +17687,7 @@
},
"yarn": {
"version": "1.22.19",
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.19.tgz",
"resolved": "https://registry.npmmirror.com/yarn/-/yarn-1.22.19.tgz",
"integrity": "sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ=="
},
"yorkie": {
......
......@@ -30,15 +30,15 @@ export const severSelectOptions = [
},
{
expenseCategoryCalculateType: 4,
label: "按(产值-流量成本)比例"
label: "按园区店总金额比例"
},
{
expenseCategoryCalculateType: 5,
label: "按(产值-流量成本-其他费用不包含产品成本))比例"
label: "按园区店毛利(不扣除产品成本)比例"
},
{
expenseCategoryCalculateType: 6,
label: "按(产值-流量成本-其他费用包含产品成本)比例"
label: "按园区店毛利比例"
}
]
// 回显财务管理-费用管理-费用类别-费用类
......
......@@ -328,7 +328,7 @@ export const routerName = {
authId: "90613",
parentId: "90603",
cache: false,
activePath: "/merchantCheck"
activePath: "/merchantManage",
},
component: _import("systemConfig/merchant/merchantStep/merchantCheck")
},
......@@ -340,7 +340,7 @@ export const routerName = {
authId: "90614",
parentId: "90603",
cache: false,
activePath: "/merchantCheckDetail"
activePath: "/merchantManage",
},
component: _import("systemConfig/merchant/merchantStep/merchantCheckDetail")
},
......@@ -352,7 +352,7 @@ export const routerName = {
authId: "90615",
parentId: "90603",
cache: false,
activePath: "/merchantCheckRecord"
activePath: "/merchantManage",
},
component: _import("systemConfig/merchant/merchantStep/merchantCheckRecord")
},
......
......@@ -23,12 +23,13 @@
:ref="'selectMerchant' + index"
v-el-select-loadmore="interestsLoadmore"
:loading="interesLoading">
<!-- !v.isSetUpgradeSettleRule -->
<el-option
v-for="(v, k) in merchantList"
:key="k"
:label="(v.merchant && v.merchant.merchantName) + ' ' + (v.merchant && v.merchant.merchantId)"
:value="(v.merchant && v.merchant.merchantName) + ' ' + (v.merchant && v.merchant.merchantId)"
:disabled="!v.isSetUpgradeSettleRule">
:disabled="false">
</el-option>
</el-select>
</div>
......
......@@ -27,15 +27,15 @@
prop="yqMerchantName"
label="园区店名称"
align="center">
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<span
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.yqMerchantName }}</span>
</template>
</template> -->
</el-table-column>
<el-table-column prop="merchantName"
label="4S店名称"
align="center">
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<span
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule"
......@@ -46,7 +46,7 @@
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon">?</span>
</el-tooltip>
</template>
</template> -->
</el-table-column>
</el-table>
<el-pagination small
......@@ -170,13 +170,14 @@ export default {
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
if (this.sourcePage === 'editProduct') {
// 不能选的判断
// console.log('??')
isSelect = row.isSetUpgradeSettleRule
}
return isSelect
// var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
// if (this.sourcePage === 'editProduct') {
// // 不能选的判断
// // console.log('??')
// isSelect = row.isSetUpgradeSettleRule
// }
// return isSelect
return true
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId)
......@@ -224,7 +225,8 @@ export default {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed && item.isSetUpgradeSettleRule) {
// if (selection.length && (isExit === -1) && !isServed && item.isSetUpgradeSettleRule) {
if (selection.length && (isExit === -1) && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) {
this.selectedData.splice(isExit, 1)
......
......@@ -230,7 +230,7 @@
<template slot-scope="scope">
<auth-button
slot="auth-button"
:show-btn-ids="['9040102']"
:show-btn-ids="['9040111']"
:data="scope"
/>
</template>
......@@ -345,10 +345,10 @@ export default {
Y: "已升级",
N: "不升级"
},
// constructioOpts: {
// Y: "已施工",
// N: "未施工"
// },
// constructioOpts: {
// Y: "已施工",
// N: "未施工"
// },
showFormData: [
{
label: "订单状态",
......@@ -753,7 +753,7 @@ export default {
},
handleReset() {
this.searchForm = {
sceneType: 1,
sceneType: 1,
status: "",
upgradeFinishFlag: "",
customerName: "",
......
......@@ -18,15 +18,18 @@
</el-form-item>
<el-form-item class="d2-drawer-item"
label="主订单编号:">
<span>{{ recordInfo.inputtedOrderCode }}</span>
<!-- <span>{{ recordInfo.inputtedOrderCode }}</span> -->
<span>{{ recordInfo.orderCode }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="订单金额:">
<span>{{ recordInfo.totalFee ? '¥' + recordInfo.totalFee / 100 : '' }}</span>
<!-- <span>{{ recordInfo.totalFee ? '¥' + recordInfo.totalFee / 100 : '' }}</span> -->
<span>{{ recordInfo.totalPrice ? '¥' + recordInfo.totalPrice : '' }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="支付时间:">
<span>{{ recordInfo.accountDate }}</span>
<!-- <span>{{ recordInfo.accountDate }}</span> -->
<span>{{ recordInfo.paySuccessDate }}</span>
</el-form-item>
</el-form>
<div class="fontD">请选择要应用的分账规则:</div>
......@@ -110,7 +113,7 @@ export default {
},
mounted() {
this.recordInfo.accountDate = this.recordInfo.accountDate ? Util.dateFormate(this.recordInfo.accountDate, 'YYYY-MM-DD HH:mm:ss') : ''
// this.recordInfo.accountDate = this.recordInfo.accountDate ? Util.dateFormate(this.recordInfo.accountDate, 'YYYY-MM-DD HH:mm:ss') : ''
this.getLedgerHistoryRecord()
},
methods: {
......@@ -150,7 +153,8 @@ export default {
}
var params = {}
params.outTradeNo = this.recordInfo.outTradeNo
params.inputtedOrderCode = this.recordInfo.inputtedOrderCode
// params.inputtedOrderCode = this.recordInfo.inputtedOrderCode
params.inputtedOrderCode = this.recordInfo.orderCode
params.effectRuleId = this.radio
// return console.log('params', params);
......
<!-- 订单列表 -->
<template>
<d2-container class="order-list m-t-40">
<div class="header" slot="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'150px'"
:form-data="showFormData"
/>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'150px'"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">累计订单金额:¥{{ totalCount }}元</span>
<el-button
type="primary"
size="mini"
class="orderTips"
@click="handlMakeUpOrder"
v-if="jurisdictionFlag"
style="padding: 0px 13px; height: 30px; margin-top: 6px"
>
<el-button type="primary"
size="mini"
class="orderTips"
@click="handlMakeUpOrder"
v-if="jurisdictionFlag"
style="padding:0px 13px;height:30px;margin-top:6px">
待补录订单
<span class="tipsNum" v-show="waitOrderNum">{{ waitOrderNum }}</span>
<span class="tipsNum"
v-show="waitOrderNum">{{ waitOrderNum }}</span>
</el-button>
<!-- @click="downloadAccount" -->
<!-- <auth-button category="Button"></auth-button> -->
<!-- <auth-button :showBtnIds="['9040104']"
class="p-r-20"
category="Button"></auth-button> -->
<auth-button :show-btn-ids="['9040101', '9040104']" category="Button" />
<auth-button :show-btn-ids="['9040101','9040104']"
category="Button" />
</d2-table-header>
<el-table
:data="tableData"
v-loading="$store.state.d2admin.loading.value"
border
>
<el-table :data="tableData"
v-loading="$store.state.d2admin.loading.value"
border>
<!-- <el-table-column type="expand">
<template slot-scope="props">
<div v-if="props.row.goods" class="product_list">
......@@ -55,132 +57,121 @@
</div>
</template>
</el-table-column> -->
<el-table-column
type="index"
label="序号"
:index="(index) => index + (page.pageNum - 1) * page.pageSize + 1"
align="center"
/>
<el-table-column
label="订单编号"
align="center"
width="150"
prop="orderCode"
/>
<el-table-column
label="订单时间"
align="center"
width="160"
prop="orderTimeStr"
/>
<el-table-column type="index"
label="序号"
:index="index => index + (page.pageNum - 1) * page.pageSize + 1"
align="center" />
<el-table-column label="订单编号"
align="center"
width="150"
prop="orderCode" />
<el-table-column label="订单时间"
align="center"
width="160"
prop="orderTimeStr" />
<el-table-column
label="支付时间"
align="center"
width="160"
prop="paySuccessDate"
/>
<el-table-column label="客户姓名" align="center" prop="customerName" />
<el-table-column label="客户性别" align="center" prop="customerSex">
<el-table-column label="支付时间"
align="center"
width="160"
prop="paySuccessDate" />
<el-table-column label="客户姓名"
align="center"
prop="customerName" />
<el-table-column label="客户性别"
align="center"
prop="customerSex">
<template slot-scope="scope">
<span>{{ scope.row.customerSex == 1 ? "男" : "女" }}</span>
<span>{{ scope.row.customerSex ==1 ? '男' : '女' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="客户手机号"
align="center"
width="150"
prop="customerPhone" /> -->
<el-table-column
label="客户车型"
align="center"
width="200"
prop="carTypeName"
>
<el-table-column label="客户车型"
align="center"
width="200"
prop="carTypeName">
<template slot-scope="scope">
<span v-show="scope.row.carBrand">{{ scope.row.carBrand }}</span>
<span v-show="scope.row.carChildsBrandName"
>-{{ scope.row.carChildsBrandName }}</span
>
<span v-show="scope.row.carSeriesName"
>-{{ scope.row.carSeriesName }}</span
>
<span v-show="scope.row.carChildsBrandName">-{{ scope.row.carChildsBrandName }}</span>
<span v-show="scope.row.carSeriesName">-{{ scope.row.carSeriesName }}</span>
</template>
</el-table-column>
<el-table-column
label="客户车牌号"
align="center"
width="110"
prop="plateNumber"
/>
<el-table-column label="客户车牌号"
align="center"
width="110"
prop="plateNumber" />
<!-- <el-table-column label="客户车架号"
align="center"
width="150"
prop="standNo" /> -->
<el-table-column label="升级状态" align="center" prop="upgradeFlag">
<el-table-column label="升级状态"
align="center"
prop="upgradeFlag">
<template slot-scope="scope">
<span>{{
scope.row.upgradeFlag
? upgradeOpts[scope.row.upgradeFlag]
: "待升级"
}}</span>
<span>{{ scope.row.upgradeFlag ? upgradeOpts[scope.row.upgradeFlag] : '待升级' }}</span>
</template>
</el-table-column>
<el-table-column label="施工状态" align="center" prop="upgradeFlag">
<el-table-column label="施工状态"
align="center"
prop="upgradeFlag">
<template slot-scope="scope">
<span>{{
scope.row.constructionFlag
? constructioOpts[scope.row.constructionFlag]
: "未施工"
}}</span>
<span>{{ scope.row.constructionFlag ? constructioOpts[scope.row.constructionFlag] : '未施工' }}</span>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="status">
<el-table-column label="订单状态"
align="center"
prop="status">
<template slot-scope="scope">
<span>{{ statusOpts[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column
label="商品名称"
align="center"
width="150"
prop="subOrderList"
>
<el-table-column label="分账状态"
align="center"
prop="profitAllocationStatus">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<span>{{ profitAllocationStatusOpts[scope.row.profitAllocationStatus] }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称"
align="center"
width="150"
prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList"
:key="index">
<p v-if="item.upgradeGoodsId">{{ item.upgradeGoodsName }}</p>
<p v-else>{{ item.baseGoodsName }}</p>
</span>
</template>
</el-table-column>
<el-table-column label="商品单价" align="center" prop="subOrderList">
<el-table-column label="商品单价"
align="center"
prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<span v-for="(item, index) in scope.row.subOrderList"
:key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.totalPrice }}</p>
<!-- <p v-if="item.upgradeGoodsId">¥ {{item.upgradePrice}}</p> -->
<p v-else>¥ {{ item.baseRetailPrice }}</p>
</span>
</template>
</el-table-column>
<el-table-column label="总价" align="center" prop="totalPrice">
<el-table-column label="总价"
align="center"
prop="totalPrice">
<template slot-scope="scope">
<span>¥ {{ scope.row.totalPrice }}</span>
</template>
</el-table-column>
<el-table-column
prop="upgradeWarrantyPeriod"
align="center"
label="质保年限"
>
<el-table-column prop="upgradeWarrantyPeriod"
align="center"
label="质保年限">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>
{{
item.upgradeWarrantyPeriod
? item.upgradeWarrantyPeriod + "年"
: "无"
}}
</p>
<span v-for="(item, index) in scope.row.subOrderList"
:key="index">
<p>{{ item.upgradeWarrantyPeriod ? (item.upgradeWarrantyPeriod + '年') : '无' }}</p>
</span>
</template>
</el-table-column>
......@@ -188,148 +179,152 @@
align="center"
width="170"
prop="merchantName" /> -->
<el-table-column
label="流量方"
align="center"
width="170"
prop="merchantName"
/>
<el-table-column
label="二级流量方"
align="center"
width="170"
prop="merchantName"
>
<el-table-column label="流量方"
align="center"
width="170"
prop="merchantName" />
<el-table-column label="二级流量方"
align="center"
width="170"
prop="merchantName">
<template slot-scope="scope">
<span>{{ scope.row.subShopMerchantName || "-" }}</span>
<span>{{ scope.row.subShopMerchantName || '-' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="园区店" -->
<el-table-column
label="服务对接"
align="center"
width="170"
prop="sellerMerchantName"
/>
<el-table-column
label="安装服务商"
align="center"
width="170"
prop="installMerchantName"
/>
<el-table-column
label="营销服务商"
align="center"
width="170"
prop="marketingMerchantName"
/>
<el-table-column label="销售顾问" align="center" prop="employeeName" />
<el-table-column label="转化人员" align="center" prop="sellerName" />
<el-table-column
v-if="!specialAccout"
label="订单来源"
align="center"
prop="source"
>
<el-table-column label="服务对接"
align="center"
width="170"
prop="sellerMerchantName" />
<el-table-column label="安装服务商"
align="center"
width="170"
prop="installMerchantName" />
<el-table-column label="营销服务商"
align="center"
width="170"
prop="marketingMerchantName" />
<el-table-column label="销售顾问"
align="center"
prop="employeeName" />
<el-table-column label="转化人员"
align="center"
prop="sellerName" />
<el-table-column v-if="!specialAccout"
label="订单来源"
align="center"
prop="source">
<template slot-scope="scope">
<span>{{ scope.row.source == 7 ? "系统导入" : "小程序订单" }}</span>
<span>{{ scope.row.source ==7 ? '系统导入' : '小程序订单' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<el-table-column label="操作"
align="center"
fixed="right">
<template slot-scope="scope">
<auth-button
slot="auth-button"
:show-btn-ids="['9040102']"
:data="scope"
/>
<auth-button slot="auth-button"
:show-btn-ids="['9040102']"
:data="scope" />
<el-button type="text"
size="small"
v-if="scope.row.profitAllocationStatus == 1"
@click="chooseRule(scope.row)">
发起分账
</el-button>
<el-button type="text"
size="small"
v-if="scope.row.manualFlag == '1'"
@click="ruleHistory(scope.row)">
分账记录
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageNum"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
/>
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageNum"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper" />
</div>
<d2-dialog
:title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport"
>
<d2-dialog :title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport">
<slot>
<el-form
:model="fileForm"
ref="fileRuleForm"
:rules="fileRules"
label-width="120px"
>
<el-form-item label="导入文件:" prop="fileName">
<el-form :model="fileForm"
ref="fileRuleForm"
:rules="fileRules"
label-width="120px">
<el-form-item label="导入文件:"
prop="fileName">
<el-col :span="16">
<el-input readonly v-model="fileForm.fileName" />
<el-input readonly
v-model="fileForm.fileName" />
</el-col>
<el-col :span="4" class="m-l-md">
<el-col :span="4"
class="m-l-md">
<el-button class="import-btn">
导入文件
<input
type="file"
id="fileUpload"
class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)"
/>
<input type="file"
id="fileUpload"
class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)">
<!-- href="http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx?fname=自定义文件名称.zip" -->
<!-- href="https://img01.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/园区店客户订单导入模板.xlsx" -->
<el-link
type="primary"
class="import-template"
href="http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx"
icon="el-icon-link"
>
<el-link type="primary"
class="import-template"
href="http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx"
icon="el-icon-link">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
<el-form-item v-show="showNum">
<span
>导入成功{{ importNum.succNum }}条,导入失败{{
importNum.failNum
}}条</span
>
<span>导入成功{{ importNum.succNum }}条,导入失败{{ importNum.failNum }}条</span>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 选择分账规则 -->
<choose-rule-dialog :rule-visible="ruleVisible"
:record-info="recordInfo"
v-if="ruleVisible"
@dialogClose="ruleDialogClose" />
<!-- 分账记录 -->
<rule-info-dialog :rule-info-visible="ruleInfoVisible"
:record-info="recordInfo"
v-if="ruleInfoVisible"
@dialogClose="ruleInfoDialogClose" />
</d2-container>
</template>
<script>
import { Util } from "@/common/util"
import {
getList,
getOrderCount,
waitinputorderCount,
orderImport
} from "@api/order"
import { getDiversionMerchantRef } from "@api/merchant"
import { manageTypeList, BaseData } from "@/common/constants"
import { mapActions, mapState, mapMutations } from "vuex"
import { getServiceStore, getParkStore } from "@api/editCustomer"
// import { asyncExportExcel } from '@api/sys.base'
import { Util } from '@/common/util'
import { getList, getOrderCount, waitinputorderCount, orderImport } from '@api/order'
import { getDiversionMerchantRef } from '@api/merchant'
import { manageTypeList, BaseData } from '@/common/constants'
import { mapActions, mapState, mapMutations } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer'
import chooseRuleDialog from './chooseRuleDialog'
import ruleInfoDialog from './ruleInfoDialog'
export default {
name: "Order",
name: 'OrderList',
components: {
chooseRuleDialog,
ruleInfoDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
fileForm: {},
fileRules: {
fileName: [{ required: true, message: "请上传文件", trigger: "change" }]
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
showNum: false,
importNum: {
......@@ -339,243 +334,242 @@ export default {
fileVisible: false,
waitOrderNum: 0,
statusOpts: {
1: "待升级",
2: "战败",
3: "待支付",
4: "已支付",
1: '待升级',
2: '战败',
3: '待支付',
4: '已支付',
// 5: '已退款',
6: "已评价",
9: "已撤销",
10: "已关闭",
11: "错误订单",
12: "已退款"
6: '已评价',
9: '已撤销',
10: '已关闭',
11: '错误订单',
12: '已退款'
},
upgradeOpts: {
Y: "已升级",
N: "不升级"
Y: '已升级',
N: '不升级'
},
constructioOpts: {
Y: "已施工",
N: "未施工"
Y: '已施工',
N: '未施工'
},
showFormData: [
{
label: "订单状态",
name: "status",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "orderStatusList"
},
{
label: "升级状态",
name: "upgradeFinishFlag",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "upgradeList"
},
{
label: "施工状态",
name: "constructionFlag",
type: "select",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "constructionList"
},
{
label: "商品名称",
name: "orderGoodsName",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "客户姓名",
name: "customerName",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
},
{
// label: '园区店',
label: "服务对接",
name: "yqMerchantId",
type: "select",
optionList: [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "parkServiceList",
changeAttr: (value, targetItem) => {
if (value) {
// 获取流量方
this.getServiceStore(value)
} else {
this.baseData.storeIdList = []
}
this.searchForm.merchantId = ""
this.getOptionsList()
profitAllocationStatusOpts: {
1: '未分账',
2: '已分账'
},
showFormData: [{
label: '订单状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'orderStatusList'
}, {
label: '升级状态',
name: 'upgradeFinishFlag',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'upgradeList'
},
{
label: '施工状态',
name: 'constructionFlag',
type: 'select',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'constructionList'
},
{
label: '分账状态',
name: 'profitAllocationStatus',
type: 'select',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'profitAllocationStatusList'
},
{
label: '商品名称',
name: 'orderGoodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '客户姓名',
name: 'customerName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
// label: '园区店',
label: '服务对接',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'parkServiceList',
changeAttr: (value, targetItem) => {
if (value) {
// 获取流量方
this.getServiceStore(value)
} else {
this.baseData.storeIdList = []
}
},
{
label: "流量来源",
name: "merchantId",
type: "select",
noDataText: "请先选择服务对接",
// noDataText: '请先选择园区店',
optionList: [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "storeIdList",
changeAttr: (value, targetItem) => {
if (value) {
// // 获取二级流量方
this.getDiversionMerchantRef(value)
} else {
this.baseData.subShopMerchantList = []
}
this.searchForm.subShopMerchantId = ""
this.getOptionsList()
this.searchForm.merchantId = ''
this.getOptionsList()
}
}, {
label: '流量来源',
name: 'merchantId',
type: 'select',
noDataText: '请先选择服务对接',
// noDataText: '请先选择园区店',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'storeIdList',
changeAttr: (value, targetItem) => {
if (value) {
// // 获取二级流量方
this.getDiversionMerchantRef(value)
} else {
this.baseData.subShopMerchantList = []
}
},
{
label: "下单日期",
name: "orderTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
},
{
label: "订单编号",
name: "orderCode",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList
},
{
label: "订单来源",
name: "sourceList",
type: "select",
noDataText: "请先选择订单来源",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "sourceList"
},
{
label: "渠道",
name: "channelType",
type: "select",
optionList: [],
optionId: "value",
optionLabel: "name",
// optionsName: 'sourceChannelTypeList'
optionsName: "channelTypeList"
},
{
label: "服务对接模式",
// label: '园区店模式',
name: "businessModel",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "manageTypeList"
},
{
label: "二级流量方",
name: "subShopMerchantId",
type: "select",
noDataText: "请先选择流量来源",
isHide: this.subShopMerchanShowHide,
optionList: [],
optionId: "subMerchantId",
optionLabel: "subMerchantName",
optionsName: "subShopMerchantList"
this.searchForm.subShopMerchantId = ''
this.getOptionsList()
}
],
}, {
label: '下单日期',
name: 'orderTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '订单编号',
name: 'orderCode',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '订单来源',
name: 'sourceList',
type: 'select',
noDataText: '请先选择订单来源',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'sourceList'
}, {
label: '渠道',
name: 'channelType',
type: 'select',
optionList: [],
optionId: 'value',
optionLabel: 'name',
// optionsName: 'sourceChannelTypeList'
optionsName: 'channelTypeList'
}, {
label: '服务对接模式',
// label: '园区店模式',
name: 'businessModel',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'manageTypeList'
}, {
label: '二级流量方',
name: 'subShopMerchantId',
type: 'select',
noDataText: '请先选择流量来源',
isHide: this.subShopMerchanShowHide,
optionList: [],
optionId: 'subMerchantId',
optionLabel: 'subMerchantName',
optionsName: 'subShopMerchantList'
}],
searchForm: {
sceneType: 1,
status: "",
upgradeFinishFlag: "",
customerName: "",
yqMerchantId: "",
merchantId: "",
orderTime: "",
constructionFlag: "",
sourceList: "",
channelType: "",
businessModel: "",
subShopMerchantId: ""
status: '',
upgradeFinishFlag: '',
customerName: '',
yqMerchantId: '',
merchantId: '',
orderTime: '',
constructionFlag: '',
sourceList: '',
channelType: '',
businessModel: '',
subShopMerchantId: ''
},
baseData: {
orderStatusList: [
{
confId: 1,
confLabel: "待升级"
},
{
confId: 2,
confLabel: "战败"
},
{
confId: 3,
confLabel: "待支付"
},
{
confId: 4,
confLabel: "已支付"
},
/* {
orderStatusList: [{
confId: 1,
confLabel: '待升级'
}, {
confId: 2,
confLabel: '战败'
}, {
confId: 3,
confLabel: '待支付'
}, {
confId: 4,
confLabel: '已支付'
}, /* {
confId: 5,
confLabel: '已退款'
}, */ {
confId: 6,
confLabel: "已评价"
},
{
confId: 9,
confLabel: "已撤销"
},
{
confId: 10,
confLabel: "已关闭"
},
{
confId: 11,
confLabel: "错误订单"
},
{
confId: 12,
confLabel: "已退款"
}
}, */{
confId: 6,
confLabel: '已评价'
}, {
confId: 9,
confLabel: '已撤销'
},
{
confId: 10,
confLabel: '已关闭'
},
{
confId: 11,
confLabel: '错误订单'
},
{
confId: 12,
confLabel: '已退款'
}
],
upgradeList: [
{
confId: "Y",
confLabel: "已升级"
},
upgradeList: [{
confId: 'Y',
confLabel: '已升级'
}, {
confId: 'N',
confLabel: '战败'
}, {
confId: 'R',
confLabel: '待升级'
}],
constructionList: [
{
confId: "N",
confLabel: "战败"
confId: 'Y',
confLabel: '已施工'
},
{
confId: "R",
confLabel: "待升级"
confId: 'N',
confLabel: '未施工'
}
],
constructionList: [
profitAllocationStatusList: [
{
confId: "Y",
confLabel: "已施工"
confId: '1',
confLabel: '未分账'
},
{
confId: "N",
confLabel: "未施工"
confId: '2',
confLabel: '已分账'
}
],
parkServiceList: [],
......@@ -584,12 +578,12 @@ export default {
manageTypeList: Util.deepClone(manageTypeList),
sourceList: [
{
confId: "1",
confLabel: "小程序订单"
confId: '1',
confLabel: '小程序订单'
},
{
confId: "7",
confLabel: "系统导入"
confId: '7',
confLabel: '系统导入'
}
],
channelTypeList: [],
......@@ -599,12 +593,15 @@ export default {
total: 0,
page: {
pageNum: 1,
pageSize: 20
pageSize: 10
},
totalCount: "",
totalCount: '',
jurisdictionFlag: false, // 待补录按钮权限标识
signRefundFlag: false, // 标记退款权限标识
subShopMerchanShowHide: true
subShopMerchanShowHide: true,
ruleVisible: false,
recordInfo: null,
ruleInfoVisible: false
}
},
computed: {
......@@ -614,7 +611,7 @@ export default {
updateRefesh: (state) => state.d2admin.user.updateRefesh
}),
specialAccout() {
return this.userInfo?.loginAccount?.loginAccout == "18123663366"
return this.userInfo?.loginAccount?.loginAccout == '18123663366'
}
},
mounted() {
......@@ -624,30 +621,26 @@ export default {
// console.log(specialAccout)
if (this.specialAccout) {
// debugger
const itemName = ["sourceList", "channelType", "businessModel"]
this.showFormData = this.showFormData.filter(
(item) => !itemName.includes(item.name)
)
const itemName = ['sourceList', 'channelType', 'businessModel']
this.showFormData = this.showFormData.filter(item => !itemName.includes(item.name))
}
if (this.userInfo.beSuper || this.specialAccout) {
getParkStore({}).then((res) => {
res.forEach((item) => {
getParkStore({}).then(res => {
res.forEach(item => {
item.merchantId = item.merchantNo
})
this.baseData.parkServiceList = res
this.getOptionsList()
})
} else {
this.showFormData = this.showFormData.filter(
(item) => item.name !== "yqMerchantId"
)
this.showFormData = this.showFormData.filter(item => item.name !== 'yqMerchantId')
this.getServiceStore(this.userInfo.detail.merchantId)
}
const $store = this.$store.getters["d2admin/auth/curBtns"]
const btnId = "9040103" // 待补录订单权限ID
const signRefundBtnId = "9040105" // 标记退款权限ID
const _item = $store.find((i) => i.authId === btnId)
const signRefundItem = $store.find((i) => i.authId === signRefundBtnId)
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '9040103' // 待补录订单权限ID
const signRefundBtnId = '9040105' // 标记退款权限ID
const _item = $store.find(i => (i.authId === btnId))
const signRefundItem = $store.find(i => (i.authId === signRefundBtnId))
if (_item) {
this.jurisdictionFlag = true // 是否有待补录订单按钮权限
this.getWaitinputorderCount()
......@@ -664,28 +657,26 @@ export default {
// console.log('val', val)
if (val == true) {
this.handleSearch()
this.setUpdateRefesh("false")
this.setUpdateRefesh('false')
}
},
"baseData.subShopMerchantList": {
'baseData.subShopMerchantList': {
handler(val) {
console.log("baseData.subShopMerchantList", val)
console.log('baseData.subShopMerchantList', val);
if (val.length > 0) {
this.showFormData[
this.findFormIdx("subShopMerchantId")
].isHide = false
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = false
} else {
this.showFormData[this.findFormIdx("subShopMerchantId")].isHide = true
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = true
}
},
immediate: true
}
},
methods: {
...mapActions({ close: "d2admin/page/close" }),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
...mapMutations("d2admin/user", ["setUpdateRefesh"]),
...mapActions({ close: 'd2admin/page/close' }),
...mapActions('d2admin/user', ['actionSetDownloadList']),
...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions("d2admin/base", ["get"]),
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
......@@ -701,23 +692,22 @@ export default {
// console.log(e)
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, "fileName", e.target.files[0].name)
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = (event) => {
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(",")
this.fileInfo =
e.target.files[0].name.split(".")[1] + "@" + arrBase64[1]
document.getElementById("fileUpload").value = ""
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips("上传文件不可超过9M")
this.notice.errorTips('上传文件不可超过9M')
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate((valid) => {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
// advanceUserId: this.userInfo.detail.uuid,
......@@ -725,22 +715,20 @@ export default {
// yqMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.merchantId,
file: this.fileInfo
}
orderImport(params).then((res) => {
orderImport(params).then(res => {
// console.log(res)
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [
...this.updateList,
{
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: "upload"
// labelText: ''
}
]
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: 'upload'
// labelText: ''
}]
this.actionSetDownloadList({ list, type: "updateList" })
this.notice.okTips("上传成功")
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.handleImport()
}
// this.showNum = !!res.failNum
......@@ -761,17 +749,17 @@ export default {
},
handleReset() {
this.searchForm = {
sceneType: 1,
status: "",
upgradeFinishFlag: "",
customerName: "",
yqMerchantId: "",
merchantId: "",
orderTime: "",
constructionFlag: "",
channelType: "",
businessModel: "",
subShopMerchantId: ""
sceneType: 1,
status: '',
upgradeFinishFlag: '',
customerName: '',
yqMerchantId: '',
merchantId: '',
orderTime: '',
constructionFlag: '',
channelType: '',
businessModel: '',
subShopMerchantId: ''
}
this.baseData.storeIdList = []
this.getOptionsList()
......@@ -779,7 +767,7 @@ export default {
getServiceStore(merchantId) {
getServiceStore({
yqMerchantId: merchantId
}).then((res) => {
}).then(res => {
this.baseData.storeIdList = res || []
this.getOptionsList()
})
......@@ -787,30 +775,21 @@ export default {
getDiversionMerchantRef(merchantId) {
getDiversionMerchantRef({
merchantId: merchantId
}).then((res) => {
}).then(res => {
this.baseData.subShopMerchantList = res || []
this.getOptionsList()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
......@@ -819,18 +798,13 @@ export default {
const form = this.searchForm
if (form.orderTime && form.orderTime.length) {
params.placeOrderStartDateStr = Util.dateFormate(
form.orderTime[0],
"YYYY-MM-DD HH:mm:ss"
)
params.placeOrderEndDateStr =
Util.dateFormate(form.orderTime[1], "YYYY-MM-DD") + " 23:59:59"
params.placeOrderStartDateStr = Util.dateFormate(form.orderTime[0], 'YYYY-MM-DD HH:mm:ss')
params.placeOrderEndDateStr = Util.dateFormate(form.orderTime[1], 'YYYY-MM-DD') + ' 23:59:59'
}
if (params.sourceList != "") {
if (params.sourceList != '') {
// 处理d2-search 下拉选不支持绑定数组的问题
params.sourceList =
params.sourceList == "1" ? ["1", "2", "3", "4", "5", "6"] : ["7"]
params.sourceList = params.sourceList == '1' ? ['1', '2', '3', '4', '5', '6'] : ['7']
}
return params
},
......@@ -844,11 +818,9 @@ export default {
...params
}
// console.log(params)
getList(params).then((res) => {
getList(params).then(res => {
this.tableData = res.list.map((item) => {
item.paySuccessDate = item.paySuccessDate
? Util.dateFormate(item.paySuccessDate, "YYYY-MM-DD HH:mm:ss")
: ""
item.paySuccessDate = item.paySuccessDate ? Util.dateFormate(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss') : ''
return item
})
this.page.pageNum = res.pageNum
......@@ -861,7 +833,7 @@ export default {
params = {
...params
}
getOrderCount(params).then((res) => {
getOrderCount(params).then(res => {
this.totalCount = res.totalPriceCount
})
},
......@@ -874,28 +846,28 @@ export default {
handleExport() {
var params = this.getParams()
params.pageNum = 1
// exportFile(params).then(res => {
// this.$open(res)
// })
params.method = "dj.api.smartcarlife.ordermanage.export.async"
// asyncExportExcel({ exportParam: JSON.stringify(params) }).then(res => {
params.method = 'dj.api.smartcarlife.ordermanage.export.async'
const list = [
...this.dowloadList,
{
name: "订单列表",
name: '订单列表',
exportParam: JSON.stringify(params),
status: "waiting",
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
// })
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 查看详情
handleDetail(data) {
<<<<<<< HEAD
this.close({ tagName: "/orderDetail" })
=======
// console.log(data.row)
this.close({ tagName: '/orderDetail' })
>>>>>>> 6f8784f1c24acda26aa497e635c8be66bcfcb01d
this.$router.push({
name: "orderDetail",
name: 'orderDetail',
params: {
detail: data.row,
signRefundFlag: this.signRefundFlag
......@@ -906,7 +878,7 @@ export default {
handlMakeUpOrder(data) {
// console.log('跳转订单补录')
this.$router.push({
name: "orderSupplement"
name: 'orderSupplement'
// params: {
// detail: data.row
// }
......@@ -926,16 +898,43 @@ export default {
// 待补录订单数
getWaitinputorderCount() {
waitinputorderCount({}).then((res) => {
waitinputorderCount({}).then(res => {
this.waitOrderNum = res.waitInputCount
})
},
findFormIdx(name) {
return this.showFormData.findIndex((item) => item.name === name)
return this.showFormData.findIndex(item => item.name === name)
},
// 选择对账规则
chooseRule(row) {
this.recordInfo = row
this.ruleVisible = true
},
ruleDialogClose(flag) {
this.ruleVisible = !this.ruleVisible
if (flag) {
this.getList()
}
},
// 分账记录
ruleHistory(row) {
this.recordInfo = row
this.ruleInfoVisible = true
},
ruleInfoDialogClose(flag) {
this.ruleInfoVisible = !this.ruleInfoVisible
// if (flag) {
// this.getList()
// }
}
}
}
</script>
<style lang="scss" scoped>
.order_table {
......@@ -991,7 +990,6 @@ export default {
.order-list .m-l-md {
margin-left: 20px;
}
// .order-list
.order-list .import-btn {
position: relative;
}
......
<!-- 订单列表 -->
<template>
<div class="order-list-wrap">
<div class="header" slot="header" style="background: #e7eaec">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index"
>
<div class="header"
slot="header"
style="background: #e7eaec">
<el-tabs v-model="activeName"
@tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index">
</el-tab-pane>
</el-tabs>
<components :is="tabName"></components>
</div>
</div>
</template>
<script>
import Order from "./order.vue"
import CrowdFunding from "./crowdfunding.vue"
......@@ -47,7 +46,7 @@ export default {
tabName: "Order"
}
},
mounted() {},
mounted() { },
watch: {},
methods: {
async getBaseData() {
......@@ -75,4 +74,4 @@ export default {
}
}
}
</style>
</style>
\ No newline at end of file
......@@ -90,16 +90,16 @@
@click="cancelRelat(scope.scope)">
取消关联
</el-button>
<el-button type="text"
v-if="scope.scope.inputStatus == '5'"
@click="chooseRule(scope.scope)">
<!-- <el-button type="text"
v-if="scope.scope.inputStatus == '5'"
@click="chooseRule(scope.scope)">
发起分账
</el-button>
<el-button type="text"
v-if="scope.scope.manualFlag == '1'"
@click="ruleHistory(scope.scope)">
分账记录
</el-button>
</el-button> -->
</div>
</template>
</d2-table>
......
......@@ -3,7 +3,7 @@
<d2-dialog title="关联活动订单"
:is-visible="relatActivityVisible"
class="relatActivityDailog"
width="70%"
width="80%"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<div>
......@@ -83,12 +83,29 @@ export default {
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: 20,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '所属活动',
name: 'activityName',
type: 'input',
maxlength: 20,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '客户名称',
name: 'customerName',
type: 'input',
maxlength: 20,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '手机号',
name: 'customerPhone',
type: 'input',
inputType: "number",
maxlength: 11,
isClear: true,
keyFn: this.keyDowmGetList
}],
......
<!-- 选择分账规则弹窗 -->
<template>
<d2-dialog title="查看分账操作记录" :is-visible="ruleInfoVisible" class="ruleInfoDialog" width="60%" @closeDialog="handleClose">
<el-form class="rule-form" label-width="110px" :inline="true">
<el-form-item class="d2-drawer-item" label="订单所属商户:">
<d2-dialog title="查看分账操作记录"
:is-visible="ruleInfoVisible"
class="ruleInfoDialog"
width="60%"
@closeDialog="handleClose">
<el-form class="rule-form"
label-width="110px"
:inline="true">
<el-form-item class="d2-drawer-item"
label="订单所属商户:">
<span>{{ recordInfo.merchantName }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item" label="主订单编号:">
<span>{{ recordInfo.inputtedOrderCode }}</span>
<el-form-item class="d2-drawer-item"
label="主订单编号:">
<!-- <span>{{ recordInfo.inputtedOrderCode }}</span> -->
<span>{{ recordInfo.orderCode }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item" label="订单金额:">
<span>{{ recordInfo.totalFee ? '¥' + recordInfo.totalFee / 100 : '' }}</span>
<el-form-item class="d2-drawer-item"
label="订单金额:">
<!-- <span>{{ recordInfo.totalFee ? '¥' + recordInfo.totalFee / 100 : '' }}</span> -->
<span>{{ recordInfo.totalPrice ? '¥' + recordInfo.totalPrice : '' }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item" label="支付时间:">
<span>{{ recordInfo.accountDate }}</span>
<el-form-item class="d2-drawer-item"
label="支付时间:">
<!-- <span>{{ recordInfo.accountDate }}</span> -->
<span>{{ recordInfo.paySuccessDate }}</span>
</el-form-item>
</el-form>
<div class="fontD">已应用分账规则:</div>
<div>
<div class="merchant-checkrecord">
<div class="account-detail" ref="accountDetail">
<div class="account-detail"
ref="accountDetail">
<div v-if="ruleInfo">
<p class="sub-title" :class="{ 'sub-border': !ruleInfo.show }">
<p class="sub-title"
:class="{ 'sub-border': !ruleInfo.show }">
<span class="label">
<span>{{ ruleInfo.formatEffectStartDate }}</span>
<span v-if="ruleInfo.formatEffectStartDate"> - </span>
......@@ -39,20 +54,27 @@
</p>
</div>
<div v-else class="nothingtips">
<img style="height: 109px; width: 109px" src="../systemConfig/merchant/images/empty.png" />
<div v-else
class="nothingtips">
<img style="height: 109px; width: 109px"
src="../systemConfig/merchant/images/empty.png" />
<p class="title">暂无财务规则</p>
<p class="tips">快去设置看看~</p>
</div>
</div>
</div>
</div>
<el-form class="rule-form" style="marginTop:35px" label-width="110px" :inline="true">
<el-form-item class="d2-drawer-item" label="分账操作人:">
<span>{{ recordInfo.updatedBy }}</span>
<el-form class="rule-form"
style="marginTop:35px"
label-width="110px"
:inline="true">
<el-form-item class="d2-drawer-item"
label="分账操作人:">
<span>{{ recordInfo.wioUpdatedBy }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item" label="分账操作时间:">
<span>{{ recordInfo.updatedDate }}</span>
<el-form-item class="d2-drawer-item"
label="分账操作时间:">
<span>{{ recordInfo.wioUpdatedDate }}</span>
</el-form-item>
</el-form>
</d2-dialog>
......@@ -87,15 +109,17 @@ export default {
},
mounted() {
this.recordInfo.accountDate = this.recordInfo.accountDate ? Util.dateFormate(this.recordInfo.accountDate, 'YYYY-MM-DD HH:mm:ss') : ''
this.recordInfo.updatedDate = this.recordInfo.updatedDate ? Util.dateFormate(this.recordInfo.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
console.log(this.recordInfo);
// this.recordInfo.accountDate = this.recordInfo.accountDate ? Util.dateFormate(this.recordInfo.accountDate, 'YYYY-MM-DD HH:mm:ss') : ''
this.recordInfo.wioUpdatedDate = this.recordInfo.wioUpdatedDate ? Util.dateFormate(this.recordInfo.wioUpdatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
this.getRuleInfo()
},
methods: {
// 获取分账记录
getRuleInfo() {
getDivisionRecordById({ id: this.recordInfo.effectRuleId }).then(res => {
getDivisionRecordById({ id: this.recordInfo.wioEffectRuleId }).then(res => {
this.ruleInfo = res
const format = "YYYY/MM/DD HH:mm"
this.ruleInfo.formatEffectEndDate = this.ruleInfo.effectEndDate
......@@ -234,7 +258,8 @@ $color: #2a58ad;
}
}
.title {}
.title {
}
.type {
margin-top: 6px;
......
......@@ -2,7 +2,7 @@
<d2-Container>
<div class="divece-history">
<div class="title">
我是终端编码
{{recordInfo.posTrmNo}}
</div>
<div class="account-detail"
ref="accountDetail">
......@@ -89,88 +89,17 @@ export default {
return {
formArray: [],
recordInfo: null,
// testData: [{
// "id": 287,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1672045943000,
// "effectEndDate": null,
// "createdBy": "glsadmin",
// "createdDate": 1672037915000
// }, {
// "id": 285,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1672037366000,
// "effectEndDate": 1672045943000,
// "createdBy": "glsadmin",
// "createdDate": 1672037366000
// }, {
// "id": 103,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1656432000000,
// "effectEndDate": 1656559315000,
// "createdBy": "glsadmin",
// "createdDate": 1656559315000
// }, {
// "id": 97,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1656172800000,
// "effectEndDate": 1656432000000,
// "createdBy": "system",
// "createdDate": 1656432000000
// }, {
// "id": 91,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1656000000000,
// "effectEndDate": 1656172800000,
// "createdBy": "system",
// "createdDate": 1656172800000
// }, {
// "id": 51,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1644545185000,
// "effectEndDate": 1656000000000,
// "createdBy": "system",
// "createdDate": 1656000000000
// }, {
// "id": 50,
// "merchantId": 44210956,
// "merchantName": "老梁用车",
// "yqMerchantId": 44210956,
// "yqMerchantName": "老梁用车",
// "effectStartDate": 1644545169000,
// "effectEndDate": 1644545185000,
// "createdBy": "glsadmin",
// "createdDate": 1644545185000
// }]
}
},
components: {
},
computed: {},
computed: {
},
created() {
this.recordInfo = this.$route.params.info
},
mounted() {
this.recordInfo = this.$route.params.info
this.getHistoryRecord()
},
methods: {
......@@ -184,7 +113,6 @@ export default {
this.formArray = this.formArray.map((element, index) => {
if (SelectIndex == index) {
element.show = !element.show
console.log(element);
} else {
element.show = false
}
......
......@@ -20,7 +20,7 @@
</el-tooltip>:
</span>
<el-input v-model.trim="form.posTrmNo"
maxlength="8"
maxlength="20"
class="itd"
placeholder="请输入POS机的终端编码"
:disabled="isDisabled"
......@@ -160,7 +160,7 @@ export default {
var info = deepClone(res)
this.form.posTrmNo = info.posTrmNo
this.form.yqMerchantId = info.yqMerchantId.toString()
this.form.merchantId = info.merchantId.toString()
this.form.merchantId = info.merchantId
})
},
......
<template>
<div class="classificationCptContainer">
<div class="hederContainer">
<span class="tips ruleTest">不确定规则是否正确?点击 <el-button @click="ruleTest"
type="text">进行测算</el-button></span>
<span v-show="goodsTypeGroupDivisionId"
class="tips dimensionTest">未进行分账测试,点击 <el-button @click="getProgress"
type="text">立即测试</el-button></span>
<span class="tips ruleTest"
>不确定规则是否正确?点击
<el-button @click="ruleTest" type="text">进行测算</el-button></span
>
<span v-show="goodsTypeGroupDivisionId" class="tips dimensionTest"
>未进行分账测试,点击
<el-button @click="getProgress" type="text">立即测试</el-button></span
>
</div>
<el-form ref="classification"
:model="classificationObj"
:rules="rules"
label-suffix=":"
label-width="180px">
<el-form
ref="classification"
:model="classificationObj"
:rules="rules"
label-suffix=":"
label-width="180px"
>
<p class="edit-sub-title">
分账品类
<!-- <span class="title-tips"></span> -->
</p>
<el-form-item v-if="tabindex"
label="选择商品"
prop="goodsTypes"
required>
<el-form-item v-if="tabindex" label="选择品类" prop="goodsTypes" required>
<!-- collapse-tags @change="goodsSelectChange" -->
<el-select v-model="classificationObj.goodsTypes"
value-key="goodsType"
multiple
placeholder="请选择商品">
<el-option v-for="item in goodsList"
:key="item.goodsType"
:label="item.goodsTypeName"
:disabled="item|filterItem(disabledList)"
:value="item" />
<el-select
v-model="classificationObj.goodsTypes"
value-key="goodsType"
multiple
placeholder="请选择品类"
>
<el-option
v-for="item in goodsList"
:key="item.goodsType"
:label="item.goodsTypeName"
:disabled="item | filterItem(disabledList)"
:value="item"
/>
</el-select>
</el-form-item>
<h3 v-if="!tabindex">全部品类</h3>
<p class="edit-sub-title">
流量方分润
</p>
<el-form-item required
:label="'手续费计算'">
<el-radio-group v-model="classificationObj.shop4sDeductChargeFlag ">
<el-radio :label="'Y'">
扣除手续费
</el-radio>
<el-radio :label="'N'">
不扣除手续费
</el-radio>
<p class="edit-sub-title">流量方分润</p>
<el-form-item
required
:label="'手续费计算(仅针对线上支付订单)'"
label-width="310px"
>
<el-radio-group v-model="classificationObj.shop4sDeductChargeFlag">
<el-radio :label="'Y'"> 扣除手续费 </el-radio>
<el-radio :label="'N'"> 不扣除手续费 </el-radio>
</el-radio-group>
</el-form-item>
<div class="trafficSide"
v-for="(item,index) in classificationObj.trafficSide"
:key="index+100">
<el-form-item :label="item.expenseCategoryName"
:prop="'trafficSide.'+index+'.expenseCategoryCalculateType'"
:rules="[{ required: true, message: '请选择分润模式', trigger: 'change' }]"
required>
<div
class="trafficSide"
v-for="(item, index) in classificationObj.trafficSide"
:key="index + 100"
>
<el-form-item
:label="item.expenseCategoryName"
:prop="'trafficSide.' + index + '.calculateMode'"
:rules="[
{ required: true, message: '请选择计算方式', trigger: 'change' }
]"
style="width: 100%"
required
>
<span slot="label">
{{ item.expenseCategoryName }}
<!-- content="Top Left 提示文字" -->
<el-tooltip class="item"
effect="dark"
placement="right">
<el-tooltip class="item" effect="dark" placement="right">
<template slot="content">
<p>计算模式说明:</p>
<p>
按品类计算:按商品对应的品类规则进行计算,多个商品进行结果汇总;
</p>
<p>
按整单计算:按整个订单进行计算,若存在多个商品的整单规则,则取最高的计算结果对应的规则;
</p>
<br />
<p>分润模式说明:</p>
<p>若流量方分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;</p>
<p>若流量方分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。</p>
<p>
若流量方分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;
</p>
<p>
若流量方分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。
</p>
<br />
<p>按收入比例:以收入*(定义的比例)进行费用计算;</p>
<p>按毛利比例:以毛利*(定义的比例)进行费用计算;</p>
......@@ -74,127 +93,257 @@
</el-tooltip>
:
</span>
<el-select v-model="classificationObj.trafficSide[index].expenseCategoryCalculateType"
@change="forceUpdate"
placeholder="请选择分润模式">
<el-option v-for="el in defaultSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType" />
</el-select>
</el-form-item>
<!-- label-width="" -->
<el-form-item required
:prop="'trafficSide.'+index+'.expenseCategoryValue'"
:rules="[{ required: true, message: '请输入分润比例', trigger: ['change', 'blur'] }]"
label="分润比例设定">
<el-input v-model="classificationObj.trafficSide[index].expenseCategoryValue"
@input="handleInput($event,'trafficSide',classificationObj.trafficSide[index].expenseCategoryCalculateType,index)"
style="width:150px"
:placeholder="classificationObj.trafficSide[index].expenseCategoryCalculateType|filerPlaceName">
<!-- accountSecondSetForm.marketingCostCalculateType== 1?'请输入固定金额': -->
<!-- v-if="accountSecondSetForm.marketingCostCalculateType== 2" -->
<i slot="suffix"
v-if="classificationObj.trafficSide[index].expenseCategoryCalculateType !=3"
class="suffix">%</i>
</el-input>
<el-radio-group
v-model="classificationObj.trafficSide[index].calculateMode"
@change="changeShop4sMethodType"
>
<el-radio :label="1"> 按品类计算 </el-radio>
<el-radio :label="2" disabled> 按整单计算 </el-radio>
</el-radio-group>
</el-form-item>
<div style="display: flex">
<el-form-item
required
:prop="'trafficSide.' + index + '.expenseCategoryCalculateType'"
:rules="[
{ required: true, message: '请选择分润模式', trigger: 'change' }
]"
>
<el-select
v-model="
classificationObj.trafficSide[index]
.expenseCategoryCalculateType
"
@change="forceUpdate"
placeholder="请选择分润模式"
>
<el-option
v-for="el in defaultSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType"
/>
</el-select>
</el-form-item>
<!-- label-width="" -->
<el-form-item
required
:prop="'trafficSide.' + index + '.expenseCategoryValue'"
:rules="[
{
required: true,
message: '请输入分润比例',
trigger: ['change', 'blur']
}
]"
label="分润比例设定"
>
<el-input
v-model="
classificationObj.trafficSide[index].expenseCategoryValue
"
@input="
handleInput(
$event,
'trafficSide',
classificationObj.trafficSide[index]
.expenseCategoryCalculateType,
index
)
"
style="width: 150px"
:placeholder="
classificationObj.trafficSide[index]
.expenseCategoryCalculateType | filerPlaceName
"
>
<!-- accountSecondSetForm.marketingCostCalculateType== 1?'请输入固定金额': -->
<!-- v-if="accountSecondSetForm.marketingCostCalculateType== 2" -->
<i
slot="suffix"
v-if="
classificationObj.trafficSide[index]
.expenseCategoryCalculateType != 3
"
class="suffix"
>%</i
>
</el-input>
</el-form-item>
</div>
</div>
<p class="edit-sub-title">
服务商分润
</p>
<el-form-item required
:label="'手续费计算'">
<el-radio-group v-model="classificationObj.partnerDeductChargeFlag ">
<el-radio :label="'Y'">
扣除手续费
</el-radio>
<el-radio :label="'N'">
不扣除手续费
</el-radio>
<p class="edit-sub-title">服务商分润</p>
<el-form-item
required
:label="'手续费计算(仅针对线上支付订单)'"
label-width="310px"
>
<el-radio-group v-model="classificationObj.partnerDeductChargeFlag">
<el-radio :label="'Y'"> 扣除手续费 </el-radio>
<el-radio :label="'N'"> 不扣除手续费 </el-radio>
</el-radio-group>
</el-form-item>
<div class="serviceProvider"
v-for="(item,index) in classificationObj.serviceProvider"
:key="index+200">
<el-form-item :label="item.expenseCategoryName"
:prop="'serviceProvider.'+index+'.expenseCategoryCalculateType'"
:rules="[{ required: true, message: '请选择分润模式', trigger: 'change' }]"
required>
<div
class="serviceProvider"
v-for="(item, index) in classificationObj.serviceProvider"
:key="index + 200"
>
<el-form-item
:label="item.expenseCategoryName"
:prop="'serviceProvider.' + index + '.calculateMode'"
:rules="[
{ required: true, message: '请选择计算方式', trigger: 'change' }
]"
style="width: 100%"
required
>
<span slot="label">
{{ item.expenseCategoryName }}
<!-- content="Top Left 提示文字" -->
<el-tooltip class="item"
effect="dark"
placement="right">
<el-tooltip class="item" effect="dark" placement="right">
<template slot="content">
<p>计算模式说明:</p>
<p>
按品类计算:按商品对应的品类规则进行计算,多个商品进行结果汇总;
</p>
<p>
按整单计算:按整个订单进行计算,若存在多个商品的整单规则,则取最高的计算结果对应的规则;
</p>
<br />
<p>分润模式说明:</p>
<p>若流量方分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;</p>
<p>若流量方分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。</p>
<p>
若流量方分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;
</p>
<p>
若流量方分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。
</p>
<br />
<p>按收入比例:以收入*(定义的比例)进行费用计算;</p>
<p>按毛利比例:以毛利*(定义的比例)进行费用计算;</p>
<p>按固定金额:费用=定义的固定金额</p>
<p>按(收入-流量方总分润)比例:以(收入-流量方总分润)*(定义的比例)进行费用计算;</p>
<p>按(收入-流量方总分润-其他费用不包含产品成本)比例:以(收入-流量方总分润-其他费用不包含产品成本)*(定义的比例)进行费用计算</p>
<p>按(收入-流量方总分润-其他费用包含产品成本)比例:以(收入-流量方总分润-其他费用包含产品成本)*(定义的比例)进行费用计算</p>
<p>
按园区店总金额比例:以(收入-流量方总分润)*(定义的比例)进行费用计算;
</p>
<p>
按园区店毛利(不扣除产品成本)比例:以(收入-流量方总分润-其他费用不包含产品成本)*(定义的比例)进行费用计算
</p>
<p>
按园区店毛利比例:以(收入-流量方总分润-其他费用包含产品成本)*(定义的比例)进行费用计算
</p>
</template>
<i class="el-icon-info"></i>
</el-tooltip>
:
</span>
<el-select v-model="classificationObj.serviceProvider[index].expenseCategoryCalculateType"
@change="forceUpdate"
placeholder="请选择分润模式">
<el-option v-for="el in severSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType" />
</el-select>
</el-form-item>
<el-form-item required
:prop="'serviceProvider.'+index+'.expenseCategoryValue'"
:rules="[{ required: true, message: '请输入分润比例',trigger: ['change', 'blur'] }]"
label="分润比例设定">
<!-- expenseCategoryValue -->
<el-input v-model="classificationObj.serviceProvider[index].expenseCategoryValue"
@input="handleInput($event,'serviceProvider',classificationObj.serviceProvider[index].expenseCategoryCalculateType,index)"
style="width:150px"
:placeholder="classificationObj.serviceProvider[index].expenseCategoryCalculateType|filerPlaceName">
<i slot="suffix"
v-if="classificationObj.serviceProvider[index].expenseCategoryCalculateType !=3"
class="suffix">%</i>
</el-input>
</el-form-item>
<el-form-item label="分润服务商">
<el-select v-model="classificationObj.serviceProvider[index].targetMerchant"
@change="handleSelectChange"
value-key="merchantId"
placeholder="请选分润服务商">
<el-option v-for="el in serviceMerchantList"
:key="el.merchantId"
:label="el.merchantName"
:value="el" />
</el-select>
<el-radio-group
v-model="classificationObj.serviceProvider[index].calculateMode"
:disabled="classificationObj.serviceProvider[index].isDisabled"
>
<el-radio :label="1"> 按类目计算 </el-radio>
<el-radio :label="2"> 按整单计算 </el-radio>
</el-radio-group>
</el-form-item>
<div style="display: flex">
<el-form-item
required
:prop="'serviceProvider.' + index + '.expenseCategoryCalculateType'"
:rules="[
{ required: true, message: '请选择分润模式', trigger: 'change' }
]"
>
<el-select
v-model="
classificationObj.serviceProvider[index]
.expenseCategoryCalculateType
"
@change="forceUpdate"
placeholder="请选择分润模式"
>
<el-option
v-for="el in severSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType"
/>
</el-select>
</el-form-item>
<el-form-item
required
:prop="'serviceProvider.' + index + '.expenseCategoryValue'"
:rules="[
{
required: true,
message: '请输入分润比例',
trigger: ['change', 'blur']
}
]"
label="分润比例设定"
>
<!-- expenseCategoryValue -->
<el-input
v-model="
classificationObj.serviceProvider[index].expenseCategoryValue
"
@input="
handleInput(
$event,
'serviceProvider',
classificationObj.serviceProvider[index]
.expenseCategoryCalculateType,
index
)
"
style="width: 150px"
:placeholder="
classificationObj.serviceProvider[index]
.expenseCategoryCalculateType | filerPlaceName
"
>
<i
slot="suffix"
v-if="
classificationObj.serviceProvider[index]
.expenseCategoryCalculateType != 3
"
class="suffix"
>%</i
>
</el-input>
</el-form-item>
<el-form-item label="分润服务商">
<el-select
v-model="classificationObj.serviceProvider[index].targetMerchant"
@change="handleSelectChange"
value-key="merchantId"
placeholder="请选分润服务商"
>
<el-option
v-for="el in serviceMerchantList"
:key="el.merchantId"
:label="el.merchantName"
:value="el"
/>
</el-select>
</el-form-item>
</div>
</div>
<p class="edit-sub-title">
其他费用
<span class="title-tips">用于费用预留,进行完流量方和服务商分润后,会自动先预留出对应的费用给承担方</span>
<span class="title-tips"
>用于费用预留,进行完流量方和服务商分润后,会自动先预留出对应的费用给承担方</span
>
</p>
<el-form-item required
:label="'产品成本'">
<el-form-item required :label="'产品成本'">
<span slot="label">
产品成本
<!-- content="Top Left 提示文字" -->
<el-tooltip class="item"
effect="dark"
placement="right">
<el-tooltip class="item" effect="dark" placement="right">
<template slot="content">
<p>开启产品成本,计算分账时会自动预留出产品成本费用给对应的承担方;</p>
<p>
开启产品成本,计算分账时会自动预留出产品成本费用给对应的承担方;
</p>
<p>不开启产品成本,计算分账时不自动预留出产品成本费用;</p>
</template>
<i class="el-icon-info"></i>
......@@ -202,31 +351,44 @@
:
</span>
<el-radio-group v-model="classificationObj.goodsCostFlag">
<el-radio :label="'N'">
不扣除产品成本
</el-radio>
<el-radio :label="'Y'">
扣除产品成本
</el-radio>
<el-radio :label="'N'"> 不扣除产品成本 </el-radio>
<el-radio :label="'Y'"> 扣除产品成本 </el-radio>
</el-radio-group>
</el-form-item>
<div class="platformPublic"
v-for="(item,index) in classificationObj.platformPublic"
:key="index+300">
<el-form-item :label="item.expenseCategoryName"
:prop="'platformPublic.'+index+'.expenseCategoryCalculateType'"
:rules="[{ required: true, message: '请选择分润模式', trigger: 'change' }]"
required>
<div
class="platformPublic"
v-for="(item, index) in classificationObj.platformPublic"
:key="index + 300"
>
<el-form-item
:label="item.expenseCategoryName"
:prop="'platformPublic.' + index + '.calculateMode'"
:rules="[
{ required: true, message: '请选择计算方式', trigger: 'change' }
]"
style="width: 100%"
required
>
<span slot="label">
{{ item.expenseCategoryName }}
<!-- content="Top Left 提示文字" -->
<el-tooltip class="item"
effect="dark"
placement="right">
<el-tooltip class="item" effect="dark" placement="right">
<template slot="content">
<p>计算模式说明:</p>
<p>
按品类计算:按商品对应的品类规则进行计算,多个商品进行结果汇总;
</p>
<p>
按整单计算:按整个订单进行计算,若存在多个商品的整单规则,则取最高的计算结果对应的规则;
</p>
<br />
<p>分润模式说明:</p>
<p>若流量方分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;</p>
<p>若流量方分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。</p>
<p>
若流量方分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;
</p>
<p>
若流量方分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。
</p>
<br />
<p>按收入比例:以收入*(定义的比例)进行费用计算;</p>
<p>按毛利比例:以毛利*(定义的比例)进行费用计算;</p>
......@@ -236,27 +398,80 @@
</el-tooltip>
:
</span>
<el-select v-model="classificationObj.platformPublic[index].expenseCategoryCalculateType"
placeholder="请选择分润模式">
<el-option v-for="el in defaultSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType" />
</el-select>
<el-radio-group
v-model="classificationObj.platformPublic[index].calculateMode"
:disabled="classificationObj.platformPublic[index].isDisabled"
>
<el-radio :label="1"> 按类目计算 </el-radio>
<el-radio :label="2"> 按整单计算 </el-radio>
</el-radio-group>
</el-form-item>
<el-form-item required
:prop="'platformPublic.'+index+'.expenseCategoryValue'"
:rules="[{ required: true, message: '请输入分润比例', trigger: ['change', 'blur']}]"
label="分润比例设定">
<el-input v-model="classificationObj.platformPublic[index].expenseCategoryValue"
@input="handleInput($event,'platformPublic',classificationObj.platformPublic[index].expenseCategoryCalculateType,index)"
style="width:150px"
:placeholder="classificationObj.platformPublic[index].expenseCategoryCalculateType|filerPlaceName">
<div>
<el-form-item
:prop="'platformPublic.' + index + '.expenseCategoryCalculateType'"
:rules="[
{ required: true, message: '请选择分润模式', trigger: 'change' }
]"
required
>
<el-select
v-model="
classificationObj.platformPublic[index]
.expenseCategoryCalculateType
"
placeholder="请选择分润模式"
>
<el-option
v-for="el in defaultSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType"
/>
</el-select>
</el-form-item>
</div>
<el-form-item
required
:prop="'platformPublic.' + index + '.expenseCategoryValue'"
:rules="[
{
required: true,
message: '请输入分润比例',
trigger: ['change', 'blur']
}
]"
label="分润比例设定"
>
<el-input
v-model="
classificationObj.platformPublic[index].expenseCategoryValue
"
@input="
handleInput(
$event,
'platformPublic',
classificationObj.platformPublic[index]
.expenseCategoryCalculateType,
index
)
"
style="width: 150px"
:placeholder="
classificationObj.platformPublic[index]
.expenseCategoryCalculateType | filerPlaceName
"
>
<!-- accountSecondSetForm.marketingCostCalculateType== 1?'请输入固定金额': -->
<!-- v-if="accountSecondSetForm.marketingCostCalculateType== 2" -->
<i slot="suffix"
v-if="classificationObj.platformPublic[index].expenseCategoryCalculateType !=3"
class="suffix">%</i>
<i
slot="suffix"
v-if="
classificationObj.platformPublic[index]
.expenseCategoryCalculateType != 3
"
class="suffix"
>%</i
>
</el-input>
</el-form-item>
</div>
......@@ -264,34 +479,44 @@
<!-- <p>区别</p> -->
</el-form>
<!-- <el-button @click="handleConfirm">测试</el-button> -->
<tableAccount ref="tableAccount"
:merchant-distribution-rules="goodsTypeGroupRules.merchantDistributionRules"
:table-select-options="tableSelectOptions"
:classification-obj-select="tableClassificationObjSelect" />
<tipsDialog v-if="tipsDialogVisible"
:account-valid-merchants="accountValidMerchants"
:visible.sync="tipsDialogVisible" />
<financialCalculationDialog v-if="financialCalculationVisible"
v-on="$listeners"
:financial-calculation-obj="financialCalculationObj"
:visible.sync="financialCalculationVisible" />
<tableAccount
ref="tableAccount"
:merchant-distribution-rules="
goodsTypeGroupRules.merchantDistributionRules
"
:table-select-options="tableSelectOptions"
:classification-obj-select="tableClassificationObjSelect"
/>
<tipsDialog
v-if="tipsDialogVisible"
:account-valid-merchants="accountValidMerchants"
:visible.sync="tipsDialogVisible"
/>
<financialCalculationDialog
v-if="financialCalculationVisible"
v-on="$listeners"
:financial-calculation-obj="financialCalculationObj"
:visible.sync="financialCalculationVisible"
/>
</div>
</template>
<script>
// 1按毛利比例;2按收入比例;3按固定金额
// 1按收入比例;2按毛利比例;3按固定金额;4按(产值-流量成本)比例;5按(产值-流量成本-其他费用不包含产品成本))比例;6按(产值-流量成本-其他费用包含产品成本)比例);其他费用:1按收入比例
import { mapActions, mapState } from 'vuex'
import tableAccount from './tableAccount'
import { limitPrice } from '@/common/format'
import { deepClone } from '@/common/util'
import { divisionRuleTestGet } from '@api/merchant'
import { defaultSelectOptions, severSelectOptions } from '@/common/constant/merchant'
import tipsDialog from './tipsDialog'
import financialCalculationDialog from './financialCalculationDialog.vue'
import { mapActions, mapState } from "vuex"
import tableAccount from "./tableAccount"
import { limitPrice } from "@/common/format"
import { deepClone } from "@/common/util"
import { divisionRuleTestGet } from "@api/merchant"
import {
defaultSelectOptions,
severSelectOptions
} from "@/common/constant/merchant"
import tipsDialog from "./tipsDialog"
import financialCalculationDialog from "./financialCalculationDialog.vue"
export default {
name: 'ClassificationCpt',
name: "ClassificationCpt",
components: {
tableAccount,
tipsDialog,
......@@ -324,16 +549,15 @@ export default {
return {}
}
},
classificationObjSelect: // 类目选择
{
// 类目选择
classificationObjSelect: {
type: Object,
default() {
return {}
}
},
// 平台方和导流方
financialLedgerParty:
{
financialLedgerParty: {
type: Object,
default() {
return {}
......@@ -365,9 +589,9 @@ export default {
// serviceProviderSide: [],
// platformPublic: [],
// expenseCategoryRules: []
shop4sDeductChargeFlag: 'Y', // 导流方POS机支付是否扣除手续费(Y:扣除,N:不扣)
partnerDeductChargeFlag: 'Y', // 服务商POS机支付是否扣除手续费(Y:扣除,N:不扣)
goodsCostFlag: 'Y', // 平台方是否扣除产品成本(Y:计算,N:不计算)
shop4sDeductChargeFlag: "Y", // 导流方POS机支付是否扣除手续费(Y:扣除,N:不扣)
partnerDeductChargeFlag: "Y", // 服务商POS机支付是否扣除手续费(Y:扣除,N:不扣)
goodsCostFlag: "Y", // 平台方是否扣除产品成本(Y:计算,N:不计算)
groupType: 1
// expenseCategoryRules: [
// {
......@@ -384,11 +608,12 @@ export default {
severSelectOptions: Object.freeze(severSelectOptions),
// serviceMerchantList: [],
rules: {
goodsTypes: [{ required: true, message: '请选择商品', trigger: 'change' }]
goodsTypes: [
{ required: true, message: "请选择品类", trigger: "change" }
]
},
serviceSelectList: [],
financialCalculationObj: {}
}
},
computed: {
......@@ -407,7 +632,11 @@ export default {
const list = this.goodsSelectList.filter((item) => {
// item.goodsType
// const flag = selectList.findIndex(el => { return el.goodsType == item.goodsType })
if (selectList.findIndex(el => { return el.goodsType == item.goodsType }) == -1) {
if (
selectList.findIndex((el) => {
return el.goodsType == item.goodsType
}) == -1
) {
return item
}
})
......@@ -439,63 +668,68 @@ export default {
// return false
const obj = deepClone(this.classificationObjSelect)
if (this.classificationObj.goodsCostFlag == 'Y') {
if (this.classificationObj.goodsCostFlag == "Y") {
// console.log(obj, 'obj')
const arr = [{
id: 3,
applicationObjectName: '产品成本',
applicationObjectType: 3
}
const arr = [
{
id: 3,
applicationObjectName: "产品成本",
applicationObjectType: 3
}
]
obj.platformPublic && obj.platformPublic.push(...arr)
// return obj
// platformPublic
}
obj.platformPublic && obj.platformPublic.push({
id: 4,
applicationObjectName: '手续费',
applicationObjectType: 3
})
obj.platformPublic &&
obj.platformPublic.push({
id: 4,
applicationObjectName: "手续费",
applicationObjectType: 3
})
return obj
// else {
// return this.classificationObjSelect
// }
},
goodsTypeGroupDivisionId() {
console.log(this.tabItem.groupDivisionRuleId, 'this.tabItem.groupDivisionRuleId')
const id = this.tabItem.testFlag != 'Y' ? this.tabItem.groupDivisionRuleId : false
console.log(
this.tabItem.groupDivisionRuleId,
"this.tabItem.groupDivisionRuleId"
)
const id =
this.tabItem.testFlag != "Y" ? this.tabItem.groupDivisionRuleId : false
return id || false
}
},
filters: {
filterItem(item, list) {
return list.findIndex(el => el.goodsType == item.goodsType) != -1
return list.findIndex((el) => el.goodsType == item.goodsType) != -1
},
filerPlaceName(value) {
// value? :''
if (!value) return ''
return value == 3 ? '请输入金额' : '请输入比例'
if (!value) return ""
return value == 3 ? "请输入金额" : "请输入比例"
}
},
watch: {
// 解决商品取消选择的数据锁死问题
'classificationObj.goodsTypes': {
"classificationObj.goodsTypes": {
handler(val, oldVal) {
// console.log(oldVal)
// console.log(val, 'val')
if (val.length < oldVal.length) {
// 对比出已经取消的商品
const deleteItem = oldVal.find(item => {
if (!val.find(el => el.goodsType == item.goodsType)) {
const deleteItem = oldVal.find((item) => {
if (!val.find((el) => el.goodsType == item.goodsType)) {
return item
}
})
// console.log(deleteItem)
this.$emit('deleteGoodsItem', deleteItem)
this.$emit("deleteGoodsItem", deleteItem)
} else {
this.$emit('assignGoodsList', val)
this.$emit("assignGoodsList", val)
}
},
deep: true
......@@ -528,7 +762,7 @@ export default {
deep: true
// immediate: true
},
'tabItem.groupDivisionRuleId': {
"tabItem.groupDivisionRuleId": {
handler() {
this.resetGoodsTypeGroupDivisionId()
},
......@@ -541,66 +775,80 @@ export default {
},
methods: {
...mapActions('FinancialRules', ['reset']),
...mapActions("FinancialRules", ["reset"]),
// ...mapMutations('FinancialRules', ['toggle', 'set']),
resetGoodsTypeGroupDivisionId() {
// goodsTypeGroupDivisionId() {
console.log(this.tabItem.groupDivisionRuleId, 'this.tabItem.groupDivisionRuleId')
console.log(
this.tabItem.groupDivisionRuleId,
"this.tabItem.groupDivisionRuleId"
)
// const id = this.tabItem.testFlag != 'Y' ? this.tabItem.groupDivisionRuleId : false
// this.goodsTypeGroupDivisionId = id || false
// }
},
getProgress() {
// groupDivisionRuleId:118
this.goodsTypeGroupDivisionId && divisionRuleTestGet({ goodsTypeGroupDivisionId: this.goodsTypeGroupDivisionId }).then((result) => {
const { subProgress, accountValidMerchants } = result
// 没有虚拟对公账户
if (subProgress == 32) {
this.tipsDialogVisible = true
this.accountValidMerchants = accountValidMerchants
}
console.log([34, 35, 36, 31].includes(subProgress))
if ([34, 35, 36, 31].includes(subProgress)) {
this.financialCalculationVisible = true
this.financialCalculationObj = result
}
console.log('result', result)
})
this.goodsTypeGroupDivisionId &&
divisionRuleTestGet({
goodsTypeGroupDivisionId: this.goodsTypeGroupDivisionId
}).then((result) => {
const { subProgress, accountValidMerchants } = result
// 没有虚拟对公账户
if (subProgress == 32) {
this.tipsDialogVisible = true
this.accountValidMerchants = accountValidMerchants
}
console.log([34, 35, 36, 31].includes(subProgress))
if ([34, 35, 36, 31].includes(subProgress)) {
this.financialCalculationVisible = true
this.financialCalculationObj = result
}
console.log("result", result)
})
},
ruleTest() {
this.$emit('rulesTest')
this.$emit("rulesTest")
},
handleInput(newValue, name, type, index) {
// 'expenseCategoryValue'
// expenseCategoryValue
// debugger
const valueName = this.classificationObj[name][index]
console.log(valueName, 'valueName')
console.log(valueName, "valueName")
// debugger
// const obj = this.classificationObj[name][index]
// console.log(obj)
// // obj.expenseCategoryValue = newValue
// // this.$set(this.classificationObj[name], index, obj)
// return
newValue = newValue.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
newValue = newValue.replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符
console.log(newValue)
console.log(name, 'name', type, 'type', index, 'index')
console.log(name, "name", type, "type", index, "index")
// const handleName = this.classificationObj[name][index]
// 按金额
if (type == 3) {
// this.classificationObj[name][index].expenseCategoryValue = limitPrice(newValue, this.accountSecondSetForm[name], 10, 2)
valueName.expenseCategoryValue = limitPrice(newValue, valueName.expenseCategoryValue, 10, 2)
valueName.expenseCategoryValue = limitPrice(
newValue,
valueName.expenseCategoryValue,
10,
2
)
// 按百分比
} else {
// console.log(newValue)
// 验证第一个字符是数字
newValue = newValue.replace(/^\./g, '')
newValue = newValue.replace(/^\./g, "")
// 只保留第一个, 清除多余的
newValue = newValue.replace(/\.{2,}/g, '.')
newValue = newValue.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')
newValue = newValue.replace(/\.{2,}/g, ".")
newValue = newValue
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", ".")
// 只能输入两个小数
// eslint-disable-next-line no-useless-escape
newValue = newValue.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
newValue = newValue.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")
if (newValue > 100) newValue = 100
if (newValue < 0) newValue = 0
......@@ -614,7 +862,8 @@ export default {
initList() {
this.classificationObj.groupType = this.tabindex ? 1 : 2
// this.goodsTypeGroupRules
const expenseCategoryRules = deepClone(this.goodsTypeGroupRules.expenseCategoryRules) || []
const expenseCategoryRules =
deepClone(this.goodsTypeGroupRules.expenseCategoryRules) || []
// console.log('expenseCategoryRules', expenseCategoryRules)
const setList = this.classificationObjSelect
// const list = {}
......@@ -625,18 +874,22 @@ export default {
this.classificationObj[key] = []
setList[key].forEach((item) => {
// console.log(item)
const editObj = expenseCategoryRules.find(el => el.expenseCategoryId == item.id) || {}
const editObj =
expenseCategoryRules.find(
(el) => el.expenseCategoryId == item.id
) || {}
// console.log(editObj)
const obj = {
expenseCategoryCalculateType: '', // 计算方式
expenseCategoryValue: '', // 费用类目计算值(%/元)
targetMerchantName: '',
targetMerchantId: '',
expenseCategoryCalculateType: "", // 计算方式
expenseCategoryValue: "", // 费用类目计算值(%/元)
targetMerchantName: "",
targetMerchantId: "",
expenseCategoryId: item.id, // 费用类目id
expenseCategoryName: item.applicationObjectName // 费用类目名
expenseCategoryName: item.applicationObjectName, // 费用类目名
calculateMode: item.calculateMode || 1 // 计算模式
// { applicationObjectType: 1, applicationObjectName: 'test1', id: 1 }
}
if (key == 'serviceProvider') {
if (key == "serviceProvider") {
// if (editObj) {
// debugger
// }
......@@ -650,9 +903,16 @@ export default {
})
}
// 需要拷贝的值
const keyNameList = ['shop4sDeductChargeFlag', 'partnerDeductChargeFlag', 'goodsCostFlag', 'groupType', 'goodsTypes']
const keyNameList = [
"shop4sDeductChargeFlag",
"partnerDeductChargeFlag",
"goodsCostFlag",
"groupType",
"goodsTypes"
]
keyNameList.forEach((item) => {
this.goodsTypeGroupRules[item] && (this.classificationObj[item] = this.goodsTypeGroupRules[item])
this.goodsTypeGroupRules[item] &&
(this.classificationObj[item] = this.goodsTypeGroupRules[item])
})
this.classificationObj = deepClone(this.classificationObj)
// console.log(list)
......@@ -663,17 +923,66 @@ export default {
this.$forceUpdate() // 强制更新
},
// 切换流量方分润计算方式
changeShop4sMethodType(e) {
if (e == 2) {
// 流量方分润是按整单计算 服务商分润/其它费用同步为整单不可操作
this.classificationObj.serviceProvider.forEach((val, index) => {
this.$set(
this.classificationObj.serviceProvider[index],
"calculateMode",
2
)
this.$set(
this.classificationObj.serviceProvider[index],
"isDisabled",
true
)
})
this.classificationObj.platformPublic.forEach((val, index) => {
this.$set(
this.classificationObj.platformPublic[index],
"calculateMode",
2
)
this.$set(
this.classificationObj.platformPublic[index],
"isDisabled",
true
)
})
} else {
this.classificationObj.serviceProvider.forEach((val, index) => {
this.$set(
this.classificationObj.serviceProvider[index],
"isDisabled",
false
)
})
this.classificationObj.platformPublic.forEach((val, index) => {
this.$set(
this.classificationObj.platformPublic[index],
"isDisabled",
false
)
})
}
},
handleSelectChange() {
// console.log('handleSelectChange')
this.forceUpdate()
const serviceProviderList = this.classificationObj.serviceProvider
let list = []
// console.log('serviceProviderList', serviceProviderList)
if (typeof serviceProviderList == 'object' && serviceProviderList.length > 0) {
if (
typeof serviceProviderList == "object" &&
serviceProviderList.length > 0
) {
list = serviceProviderList.reduce((pre, cur) => {
const id = cur.targetMerchant.merchantId
// 数组对象去重
if (id && pre.findIndex(el => el.merchantId == id) == -1) {
if (id && pre.findIndex((el) => el.merchantId == id) == -1) {
// console.log(cur)
pre.push({
merchantId: id,
......@@ -692,7 +1001,7 @@ export default {
const expenseCategoryRules = []
// 合并出对象的集合 类目对象合集
for (const key in obj) {
if (Array.isArray(obj[key]) && key != 'goodsTypes') {
if (Array.isArray(obj[key]) && key != "goodsTypes") {
const list = obj[key].map((cur) => {
return {
...cur,
......@@ -736,8 +1045,10 @@ export default {
// console.log(this.getParams())
const obj = this.getParams()
const res = await this.$refs.tableAccount.handleConfirm()
console.log('res', { ...obj, merchantDistributionRules: res })
res ? resolve({ ...obj, merchantDistributionRules: res }) : resolve(false)
console.log("res", { ...obj, merchantDistributionRules: res })
res
? resolve({ ...obj, merchantDistributionRules: res })
: resolve(false)
} else {
resolve(false)
}
......@@ -790,6 +1101,7 @@ export default {
.platformPublic,
.serviceProvider {
display: flex;
flex-flow: column;
.el-form-item {
width: 25%;
}
......
......@@ -55,14 +55,21 @@
:data="categoryTableData.expenseCategoryCalculatedItemForRuleTestsResults">
<el-table-column prop="targetType"
label="类型"
width="200">
width="143">
<template slot-scope="scope">
{{ targetType[scope.row.targetType] }}
</template>
</el-table-column>
<el-table-column prop="expenseCategoryName"
label="分账类目"
width="200" />
width="143" />
<el-table-column prop="calculateMode"
label="计算模式"
width="143">
<template slot-scope="scope">
<span>{{ scope.row.calculateMode == 1 ? '按类目计算' : scope.row.calculateMode == 2 ? '按整单计算' : '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="expenseCategoryCalculateType"
label="分账规则">
<!-- width="180" -->
......
......@@ -6,17 +6,17 @@
label-suffix=":"
label-width="180px">
<p class="edit-sub-title">
分账品类
对账品类
<!-- <span class="title-tips">阿斯顿</span> -->
</p>
<el-form-item label-width="234px"
v-if="tabindex"
label="选择商品"
label="选择品类"
prop="goodsTypeGroupRelations"
:rules="[
{
required: true,
message: '请选择商品',
message: '请选择品类',
trigger: 'blur'
}
]">
......@@ -26,7 +26,7 @@
@change="goodsSelectChange"
value-key="goodsType"
multiple
placeholder="请选择商品">
placeholder="请选择品类">
<el-option v-for="item in goodsList"
:key="item.goodsType"
:label="item.goodsTypeName"
......@@ -35,7 +35,7 @@
</el-select>
</el-form-item>
<p v-if="!tabindex"
class="store">全部商品</p>
class="store">全部分类</p>
<!-- 流量方 -->
<p class="edit-sub-title">
流量方分润
......@@ -48,70 +48,101 @@
<!-- .feeCategoryNameList[0] -->
<el-form-item :label="floweItem.feeCategoryName"
label-width="234px"
:prop="'flowCostArr.' + floweIdx + '.calculateMode'"
:rules="[{ required: true, message: '请选择计算方式', trigger: 'change' }]"
required>
<div class="multiple-type">
<el-form-item :prop="
'flowCostArr.' + floweIdx + '.expenseCategoryCalculateType'
<span slot="label">
{{ floweItem.feeCategoryName }}
<el-tooltip class="item"
effect="dark"
placement="right">
<template slot="content">
<p>计算模式说明:</p>
<p>按品类计算:按商品对应的品类规则进行计算,多个商品进行结果汇总;</p>
<p>按整单计算:按整个订单进行计算,若存在多个商品的整单规则,则取最高的计算结果对应的规则;</p>
<br />
<p>对账模式说明:</p>
<p>若服务商分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;</p>
<p>若服务商分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。</p>
<br />
<p>按收入比例:以收入*(定义的比例)进行费用计算;</p>
<p>按毛利比例:以毛利*(定义的比例)进行费用计算;</p>
<p>按固定金额:费用=定义的固定金额</p>
</template>
<i class="el-icon-info"></i>
</el-tooltip>
</span>
<el-radio-group v-model="classificationObj.flowCostArr[floweIdx].calculateMode" @change="changeCalculateMode">
<el-radio :label="1">
按类目计算
</el-radio>
<el-radio :label="2" disabled>
按整单计算
</el-radio>
</el-radio-group>
</el-form-item>
<div class="multiple-type">
<el-form-item :prop="
'flowCostArr.' + floweIdx + '.expenseCategoryCalculateType'
"
:rules="[
{
required: true,
message: '请选择对账费用',
trigger: 'blur'
}
]" label-width="234px">
<el-select class="w432"
v-model="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType
"
placeholder="请选择对账费用">
<el-option v-for="(item, index) in flowFeeList"
:key="index + 'flowFeeList'"
:label="item.expenseCategoryCalculateTypeName"
:value="item.expenseCategoryCalculateType"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="`flowCostArr[${floweIdx}].expenseCategoryValue`"
:rules="[
{ required: true, message: '请输入', trigger: 'blur' },
{
pattern:
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
message: '请输入正确额格式,可保留两位小数'
}
]"
class="ml20">
<el-input v-model="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryValue
"
v-if="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType == 3
"
:rules="[
{
required: true,
message: '请选择对账费用',
trigger: 'blur'
}
]">
<el-select class="w432"
v-model="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType
"
placeholder="请选择对账费用">
<el-option v-for="(item, index) in flowFeeList"
:key="index + 'flowFeeList'"
:label="item.expenseCategoryCalculateTypeName"
:value="item.expenseCategoryCalculateType"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="`flowCostArr[${floweIdx}].expenseCategoryValue`"
:rules="[
{ required: true, message: '请输入', trigger: 'blur' },
{
pattern:
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
message: '请输入正确额格式,可保留两位小数'
}
]"
class="ml20">
<el-input v-model="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryValue
"
v-if="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType == 3
"
type="number"
oninput="if(value>999999)value=999999;if(value<0)value=0"></el-input>
<el-input v-model="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryValue
"
v-else
type="number"
oninput="if(value>100)value=100;if(value<0)value=0">
<span slot="suffix">
{{
hasSignal(
classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType
)
}}
</span>
</el-input>
type="number"
oninput="if(value>999999)value=999999;if(value<0)value=0"></el-input>
<el-input v-model="
classificationObj.flowCostArr[floweIdx]
.expenseCategoryValue
"
v-else
type="number"
oninput="if(value>100)value=100;if(value<0)value=0">
<span slot="suffix">
{{
hasSignal(
classificationObj.flowCostArr[floweIdx]
.expenseCategoryCalculateType
)
}}
</span>
</el-input>
</el-form-item>
</div>
</el-form-item>
</el-form-item>
</div>
<el-form-item label="对账对象"
label-width="234px">
<!-- @change="flowListChange" -->
......@@ -152,7 +183,7 @@
<!-- 服务方 -->
<p class="edit-sub-title">
服务商分润
<span class="title-tips">系统基于分账计算结果,将流量方总分润按照以下对账规则进行拆分,不影响原有分账结果</span>
<span class="title-tips">系统基于分账计算结果,将服务商总分润按照以下对账规则进行拆分,不影响原有分账结果</span>
</p>
<template v-if="titleListServe.length != 0">
<div v-for="(serveItem, serveIdx) in titleListServe"
......@@ -160,72 +191,104 @@
<template v-if="serveIdx != titleListServe.length - 1">
<el-form-item :label="serveItem.feeCategoryName"
label-width="234px"
:prop="'serviceCostArr.' + serveIdx + '.calculateMode'"
:rules="[{ required: true, message: '请选择计算方式', trigger: 'change' }]"
required>
<div class="multiple-type">
<el-form-item :prop="
'serviceCostArr.' +
serveIdx +
'.expenseCategoryCalculateType'
<span slot="label">
{{ serveItem.feeCategoryName }}
<el-tooltip class="item"
effect="dark"
placement="right">
<template slot="content">
<p>计算模式说明:</p>
<p>按品类计算:按商品对应的品类规则进行计算,多个商品进行结果汇总;</p>
<p>按整单计算:按整个订单进行计算,若存在多个商品的整单规则,则取最高的计算结果对应的规则;</p>
<br />
<p>对账模式说明:</p>
<p>若服务商分润扣除手续费,则收入=实收金额,毛利=实收金额-产品成本;</p>
<p>若服务商分润不扣除手续费,则收入=原支付金额,毛利=原支付金额-产品成本。</p>
<br />
<p>按收入比例:以收入*(定义的比例)进行费用计算;</p>
<p>按毛利比例:以毛利*(定义的比例)进行费用计算;</p>
<p>按固定金额:费用=定义的固定金额</p>
</template>
<i class="el-icon-info"></i>
</el-tooltip>
:
</span>
<el-radio-group v-model="classificationObj.serviceCostArr[serveIdx].calculateMode" :disabled="classificationObj.serviceCostArr[serveIdx].calculateModeDisabled">
<el-radio :label="1">
按类目计算
</el-radio>
<el-radio :label="2">
按整单计算
</el-radio>
</el-radio-group>
</el-form-item>
<div class="multiple-type">
<el-form-item :prop="
'serviceCostArr.' +
serveIdx +
'.expenseCategoryCalculateType'
"
:rules="[
{
required: true,
message: '请选择对账费用',
trigger: 'blur'
}
]" label-width="234px">
<el-select class="w432"
v-model="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType
"
placeholder="请选择对账费用">
<el-option v-for="(item, index) in serveFeeList"
:key="index + 'serveFeeList'"
:label="item.expenseCategoryCalculateTypeName"
:value="item.expenseCategoryCalculateType"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="`serviceCostArr[${serveIdx}].expenseCategoryValue`"
:rules="[
{ required: true, message: '请输入', trigger: 'blur' },
{
pattern:
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
message: '请输入正确额格式,可保留两位小数'
}
]"
class="ml20">
<el-input v-model="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryValue
"
v-if="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType == 3
"
:rules="[
{
required: true,
message: '请选择对账费用',
trigger: 'blur'
}
]">
<el-select class="w432"
v-model="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType
"
placeholder="请选择对账费用">
<el-option v-for="(item, index) in serveFeeList"
:key="index + 'serveFeeList'"
:label="item.expenseCategoryCalculateTypeName"
:value="item.expenseCategoryCalculateType"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="`serviceCostArr[${serveIdx}].expenseCategoryValue`"
:rules="[
{ required: true, message: '请输入', trigger: 'blur' },
{
pattern:
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
message: '请输入正确额格式,可保留两位小数'
}
]"
class="ml20">
<el-input v-model="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryValue
"
v-if="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType == 3
"
type="number"
oninput="if(value>999999)value=999999;if(value<0)value=0"></el-input>
<el-input v-model="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryValue
"
v-else
type="number"
oninput="if(value>100)value=100;if(value<0)value=0">
<span slot="suffix">
{{
hasSignal(
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType
)
}}
</span>
</el-input>
type="number"
oninput="if(value>999999)value=999999;if(value<0)value=0"></el-input>
<el-input v-model="
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryValue
"
v-else
type="number"
oninput="if(value>100)value=100;if(value<0)value=0">
<span slot="suffix">
{{
hasSignal(
classificationObj.serviceCostArr[serveIdx]
.expenseCategoryCalculateType
)
}}
</span>
</el-input>
</el-form-item>
</div>
</el-form-item>
</el-form-item>
</div>
<el-form-item label="对账对象"
label-width="234px">
<el-select class="w432"
......@@ -375,20 +438,21 @@ export default {
expenseCategoryCalculateTypeName: "按固定金额",
expenseCategoryCalculateType: 3
},
{
expenseCategoryCalculateTypeName: "按(产值-流量方总分润)比例",
expenseCategoryCalculateType: 4
},
{
expenseCategoryCalculateTypeName:
"按(产值-流量方总分润-其他费用不包含产品成本)比例",
expenseCategoryCalculateType: 5
},
{
expenseCategoryCalculateTypeName:
"按(产值-流量方总分润-其他费用包含产品成本)比例",
expenseCategoryCalculateType: 6
}
// v4.16.1 按整单计算需求 删除 服务商费用项
// {
// expenseCategoryCalculateTypeName: "按(产值-流量方总分润)比例",
// expenseCategoryCalculateType: 4
// },
// {
// expenseCategoryCalculateTypeName:
// "按(产值-流量方总分润-其他费用不包含产品成本)比例",
// expenseCategoryCalculateType: 5
// },
// {
// expenseCategoryCalculateTypeName:
// "按(产值-流量方总分润-其他费用包含产品成本)比例",
// expenseCategoryCalculateType: 6
// }
], // 服务商费用列表
flowList: [], // 流量方列表
serveList: [], // 服务商列表
......@@ -580,6 +644,7 @@ export default {
that.classificationObj.flowCostArr[index].expenseCategoryId = item.id
that.classificationObj.flowCostArr[index].expenseCategoryName =
item.feeCategoryName
that.classificationObj.flowCostArr[index].calculateMode = item.calculateMode || 1
})
}
},
......@@ -625,6 +690,7 @@ export default {
item.id
that.classificationObj.serviceCostArr[index].expenseCategoryName =
item.feeCategoryName
that.classificationObj.serviceCostArr[index].calculateMode = item.calculateMode || 1
})
}
},
......@@ -646,7 +712,8 @@ export default {
merchant: {
merchantName: flag == 1 ? this.merchantRow.merchantName : "", //
merchantId: flag == 1 ? this.merchantRow.merchantId : "" //
}
},
calculateMode: "" // 计算模式
})
}
return targetArr
......@@ -671,7 +738,7 @@ export default {
getClassificationObjFormat(originArr, detailArr) {
// console.log('originArr, detailArr: ', originArr, detailArr)
if (originArr.length == 0 || detailArr.length == 0) return []
const resArr = originArr.map((item) => {
const resArr = originArr.map((item, index) => {
detailArr.forEach((innerItem) => {
// console.log(innerItem.expenseCategoryId, item.expenseCategoryId)
if (innerItem.expenseCategoryId == item.expenseCategoryId) {
......@@ -690,7 +757,9 @@ export default {
// 复制当前商户的默认值 -对账对象
merchantName: innerItem.targetMerchantName,
merchantId: innerItem.targetMerchantId
}
},
// 承担剩余金额的对账类目无需定义,默认是按整单计算
calculateMode: index === originArr.length -1 ? 2 : (innerItem.calculateMode || 1)
}
}
})
......@@ -800,6 +869,13 @@ export default {
// 取消
handleReset() {
this.$router.go(-1)
},
// 修改流量方计算模式
changeCalculateMode(value) {
this.classificationObj.serviceCostArr.forEach((val, index) => {
this.$set(this.classificationObj.serviceCostArr[index], 'calculateMode', 2)
this.$set(this.classificationObj.serviceCostArr[index], 'calculateModeDisabled', true)
})
}
}
}
......@@ -844,7 +920,7 @@ export default {
.multiple-type {
display: flex;
align-items: center;
margin-bottom: 18px;
.el-form-item__content {
display: flex;
align-items: center;
......
......@@ -128,12 +128,14 @@
<div class="title-table">
<div class="head">
<div class="cost">费用类目</div>
<div class="cost">计算模式</div>
<div class="cost">分润规则</div>
</div>
<div class="detail"
v-for="(ininItem,ininIdx) in inItem.expenseCategoryRules"
:key="ininIdx+'expenseCategory3'">
<div class="detail-i">{{ ininItem.expenseCategoryName }}</div>
<div class="detail-i">{{ ininItem.calculateMode == 1 ? '按类目计算' : ininItem.calculateMode == 2 ? '按整单计算' : '-' }}</div>
<div class="detail-i">
{{ getExpenseCategoryCalculateType(ininItem.expenseCategoryCalculateType,ininItem.expenseCategoryValue) }}
</div>
......@@ -232,12 +234,14 @@
<div class="title-table">
<div class="head">
<div class="cost">费用类目</div>
<div class="cost">计算模式</div>
<div class="cost">分润规则</div>
</div>
<div class="detail"
v-for="(ininItem,ininIdx) in inItem.expenseCategoryRules"
:key="ininIdx+'expenseCategory4'">
<div class="detail-i">{{ ininItem.expenseCategoryName }}</div>
<div class="detail-i">{{ ininItem.calculateMode == 1 ? '按类目计算' : ininItem.calculateMode == 2 ? '按整单计算' : '-' }}</div>
<div class="detail-i">
{{ getExpenseCategoryCalculateType(ininItem.expenseCategoryCalculateType,ininItem.expenseCategoryValue) }}
</div>
......
......@@ -32,6 +32,7 @@
<div class="title-table">
<div class="head">
<div class="cost">费用类目</div>
<div class="cost">计算模式</div>
<div class="cost">分润规则</div>
<div class="cost">对账对象</div>
<div class="cost">商户号</div>
......@@ -39,6 +40,7 @@
<div v-for="(childItem, idx) in item.expenseCategoryRules" :key="idx + 'expenseCategoryRules1'">
<div class="detail" v-if="childItem.targetType == 1">
<div class="detail-i">{{ childItem.expenseCategoryName }}</div>
<div class="detail-i">{{ childItem.calculateMode == 1 ? '按类目计算' : childItem.calculateMode == 2 ? '按整单计算' : '-' }}</div>
<div class="detail-i">{{ childItem.ruleDescription }}</div>
<div class="detail-i">{{ childItem.targetMerchantName }}</div>
<div class="detail-i">{{ childItem.targetMerchantId }}</div>
......@@ -57,6 +59,7 @@
<div class="title-table">
<div class="head">
<div class="cost">费用类目</div>
<div class="cost">计算模式</div>
<div class="cost">分润规则</div>
<div class="cost">对账对象</div>
<div class="cost">商户号</div>
......@@ -67,6 +70,7 @@
class="detail"
v-if="childItem.targetType == 2">
<div class="detail-i">{{ childItem.expenseCategoryName }}</div>
<div class="detail-i">{{ childItem.calculateMode == 1 ? '按类目计算' : childItem.calculateMode == 2 ? '按整单计算' : '-' }}</div>
<div class="detail-i">{{ childItem.ruleDescription }}</div>
<div class="detail-i">{{ childItem.targetMerchantName }}</div>
<div class="detail-i">{{ childItem.targetMerchantId }}</div>
......
......@@ -37,7 +37,7 @@
</span>
<span class="collapse"
@click="collapseItem(index)">
<i :class="{ move: !formItem.show }"
<i :class="{ move: formItem.show }"
class="arrow el-icon-arrow-down" />
{{ formItem.show ? "收起" : "展开" }}
</span>
......
......@@ -69,7 +69,7 @@ export default {
getYqMerchantSceneConfigAPI({ yqMerchantId: this.info.yqMerchantId }).then(res => {
res?.forEach(val => {
this.sceneList.map(v => {
if (v.sceneType === val.scene && val.sceneOpenFlag === 1) {
if (v.sceneType === val.scene && val.sceneOpenFlag === 0) {
v.isOpen = 'Y'
}
return v
......@@ -85,7 +85,7 @@ export default {
this.sceneList.forEach(v => {
arr.push({
merchantId: this.info.yqMerchantId,
sceneOpenFlag: v.isOpen === 'Y' ? 1 : 0,
sceneOpenFlag: v.isOpen === 'Y' ? 0 : 1,
scene: v.sceneType
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!