Commit d950c91e by 张立顺

财务生效日期 选项处理

1 parent 9d9423bb
......@@ -2,35 +2,33 @@
<d2-Container>
<div class="divece-history">
<div class="title">
{{recordInfo.posTrmNo}}
{{ recordInfo.posTrmNo }}
</div>
<div class="account-detail"
ref="accountDetail">
<div class="account-detail" ref="accountDetail">
<div v-if="formArray && formArray.length">
<div v-for="(formItem, index) in formArray"
:ref="'resize' + index"
:key="index">
<p class="edit-sub-title"
:class="{ 'sub-border': !formItem.show }">
<div v-for="(formItem, index) in formArray" :ref="'resize' + index" :key="index">
<p class="edit-sub-title" :class="{ 'sub-border': !formItem.show }">
<span class="label">
<span>{{ formItem.formatEffectStartDate }}</span>
<span v-if="formItem.formatEffectStartDate"> - </span>
<span :class="{ labelColor: !formItem.formatEffectEndDate }">{{
formItem.formatEffectStartDate
? formItem.formatEffectEndDate
? formItem.formatEffectEndDate
? formItem.formatEffectEndDate
: "生效中"
: "待生效"
: "生效中"
: "待生效"
}}</span>
</span>
<span class="updatedInfo">
操作人: {{ formItem.createdBy }} 操作时间:
{{ formItem.formatCreatedDate }}
</span>
<span class="collapse"
@click="collapseItem(index)">
<i :class="{ move: !formItem.show }"
class="arrow el-icon-arrow-down" />
<span class="updatedInfo">
审核人: {{ formItem.auditorName }} 审核时间:
{{ formItem.formatAuditDate }}
</span>
<span class="collapse" @click="collapseItem(index)">
<i :class="{ move: !formItem.show }" class="arrow el-icon-arrow-down" />
{{ formItem.show ? "收起" : "展开" }}
</span>
</p>
......@@ -59,19 +57,15 @@
</div>
</div>
<div v-else
class="nothingtips">
<img style="height: 109px; width: 109px"
src="../images/empty.png" />
<div v-else class="nothingtips">
<img style="height: 109px; width: 109px" src="../images/empty.png" />
<p class="title">暂无历史记录</p>
<p class="tips">快去设置看看~</p>
</div>
</div>
<div class="btns">
<el-button @click="handleCancel"
size="small"
type="primary">
<el-button @click="handleCancel" size="small" type="primary">
返回
</el-button>
</div>
......@@ -88,7 +82,7 @@ export default {
data() {
return {
formArray: [],
recordInfo: null,
recordInfo: null
}
},
components: {
......@@ -109,7 +103,6 @@ export default {
}),
collapseItem(SelectIndex) {
this.formArray = this.formArray.map((element, index) => {
if (SelectIndex == index) {
element.show = !element.show
......@@ -136,6 +129,7 @@ export default {
? dayjs(item.effectStartDate).format(format)
: ""
item.formatCreatedDate = dayjs(item.createdDate).format(format)
item.formatAuditDate = dayjs(item.auditDate).format(format)
item.show = false
return item
})
......@@ -150,16 +144,18 @@ export default {
name: 'deviceManage'
})
this.close({ tagName: '/deviceHistory' })
},
}
}
}
</script>
<style lang="scss" scoped>
$color: #2a58ad;
.divece-history {
padding-left: 20px;
padding-right: 16px;
padding-bottom: 20px;
.account-detail {
// height: 400px;
// height: calc(100vh - 200px);
......@@ -167,12 +163,14 @@ $color: #2a58ad;
overflow-y: scroll;
overflow-x: hidden;
}
.edit-sub-title {
padding: 17px 0;
margin: 0;
display: flex;
justify-content: space-between;
font-size: 14px;
&::before {
top: 50%;
transform: translateY(-50%);
......@@ -182,37 +180,46 @@ $color: #2a58ad;
padding-left: 8px;
width: 37%;
}
.labelColor {
color: #0947c6;
}
.updatedInfo {
width: 40%;
text-align: left;
}
.collapse {
padding-right: 20px;
color: #0947c6;
cursor: pointer;
.arrow {
transition: all 1s;
}
.move {
transform: rotate(-180deg);
}
}
}
.sub-border {
animation: border-delay 1s forwards;
}
@keyframes border-delay {
0% {
/* opacity: 0; */
/* right: -100%; */
}
100% {
border-bottom: 1px solid #d8d8d8;
}
}
// .account-detail .detail-img {
// width: 180px;
// height: 104px;
......@@ -318,16 +325,19 @@ $color: #2a58ad;
text-align: center;
font-size: 16px;
padding-top: 40px;
.title {
font-size: 20px;
color: #666;
margin: 16px 0;
}
.tips {
font-size: 12px;
color: #999;
}
}
// .title {
// }
// .type {
......@@ -350,18 +360,23 @@ $color: #2a58ad;
// }
.cont {
background-color: #fff;
&.cont-table {
display: block;
}
&.cont-table1 {
padding: 16px 20px 20px;
}
display: flex;
flex-wrap: wrap;
padding: 16px 20px 32px;
.mt16 {
margin-top: 16px;
}
.msg {
padding-bottom: 12px;
flex: 1 0 auto;
......@@ -369,6 +384,7 @@ $color: #2a58ad;
display: flex;
align-items: flex-start;
line-height: 24px;
.msg-title {
width: 138px;
// height: 20px;
......@@ -376,6 +392,7 @@ $color: #2a58ad;
color: #666666;
text-align: right;
}
.msg-val {
// height: 20px;
font-size: 14px;
......@@ -383,24 +400,29 @@ $color: #2a58ad;
text-align: left;
}
}
.compute {
&:first-child {
margin-top: 0px;
}
margin-top: 16px;
margin-bottom: 10px;
display: flex;
font-size: 14px;
color: #666666;
.manner {
}
.manner {}
.online {
& + .online {
&+.online {
margin-left: 44px;
}
color: $color;
}
}
.white-table {
margin-bottom: 16px;
display: flex;
......@@ -409,6 +431,7 @@ $color: #2a58ad;
color: #666666;
border-top: 1px solid #e5e5e5;
border-left: 1px solid #e5e5e5;
.type1 {
// &:first-child {
// border-top: 1px solid #E5E5E5;
......@@ -421,66 +444,79 @@ $color: #2a58ad;
border-bottom: 1px solid #e5e5e5;
border-right: 1px solid #e5e5e5;
box-sizing: border-box;
.type-name {
text-align: right;
width: 90px;
}
.type-val {
flex: 1;
display: flex;
color: #1d1d1d;
}
.type-color {
color: $color;
}
.date {
margin-right: 10px;
color: #1d1d1d;
}
}
.type2 {
width: 66.66%;
}
}
.title-table {
font-size: 14px;
color: #333333;
border: 1px solid #e8e8ea;
.head {
display: flex;
height: 40px;
line-height: 40px;
text-align: center;
background: #f2f4f7;
.cost {
& + .cost {
&+.cost {
border-left: 1px solid #e8e8ea;
}
flex: 1;
}
}
.detail {
display: flex;
min-height: 40px;
color: #666666;
border-top: 1px solid #e8e8ea;
.detail-i {
display: flex;
justify-content: center;
align-items: center;
& + .detail-i {
&+.detail-i {
border-left: 1px solid #e8e8ea;
}
flex: 1;
}
}
}
}
.btns {
margin-top: 16px;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
}</style>
......@@ -840,7 +840,7 @@ export default {
// return false
// let obj
const filterObj = deepClone(this.classificationObjSelect)
console.log(filterObj, "filterObj")
// console.log(filterObj, "filterObj")
const obj = {}
// obj = deepClone(...obj, this.classificationObjSelect[key])
for (const key in filterObj) {
......@@ -857,7 +857,7 @@ export default {
}
})
}
console.log(obj, 'obj')
// console.log(obj, 'obj')
if (this.classificationObj.goodsCostFlag == "Y") {
const arr = [
{
......@@ -1139,7 +1139,7 @@ export default {
return item
})
this.forceUpdate()
console.log(this.classificationObj[name][index].children, "this.classificationObj[name][index].children")
// console.log(this.classificationObj[name][index].children, "this.classificationObj[name][index].children")
}
},
handleInput(newValue, name, type, index, ChildrenIndex) {
......@@ -1205,15 +1205,15 @@ export default {
// console.log('expenseCategoryRules', expenseCategoryRules)
const setList = this.classificationObjSelect
// const list = {}
console.log('setList', this.classificationObjSelect)
// console.log('setList', this.classificationObjSelect)
// 初始化类目
for (const key in setList) {
console.log('setList[key]', setList[key])
console.log('key', key)
// console.log('setList[key]', setList[key])
// console.log('key', key)
this.classificationObj[key] = []
setList[key].forEach((item) => {
// debugger
console.log(setList[key])
// console.log(setList[key])
const editObj =
expenseCategoryRules.find(
(el) => el.expenseCategoryId == item.expenseCategoryId
......@@ -1282,14 +1282,14 @@ export default {
// console.log(childrenObj, 'editChildrenObj')
}
// return Object.assign(childrenObj, editChildrenObj)
console.log(editChildrenObj, 'editChildrenObj')
// console.log(editChildrenObj, 'editChildrenObj')
return Object.assign(childrenObj, editChildrenObj)
})
// console.log(obj.children, ' obj.children')
}
console.log(editObj, 'obj')
// console.log(editObj, 'obj')
this.classificationObj[key].push(Object.assign(obj, editObj))
console.log(this.classificationObj, ' this.classificationObj')
// console.log(this.classificationObj, ' this.classificationObj')
// debugger
// this.classificationObj[key].push(Object.assign(obj))
// 流量方分润/其他费用是按整单计算 服务商分润 均为按整单计算 不可操作
......
......@@ -5,12 +5,14 @@
@closeDialog="handleClose" @confirmDialog="handleConfirm">
<el-form ref="form" :model="form" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="规则生效日期" prop="effectStartDate" required>
<el-form-item label="规则生效日期" prop="effectStartDate"
:rules="[{ required: !effectStartDate, message: '请选择生效开始日期', trigger: 'blur' }]">
<!-- placeholder="请输入服务开始时间"
prefix-icon="0" -->
<el-date-picker value-format="yyyy-MM-dd" v-model="form.effectStartDate" type="date"
<el-date-picker v-if="!effectStartDate" value-format="yyyy-MM-dd" v-model="form.effectStartDate" type="date"
:picker-options="expireTimeOPtion">
</el-date-picker>
<span v-else>立即生效</span>
<!-- <el-input placeholder="请填写验证码"
v-model="form.smsCode"
:size="size"
......@@ -39,6 +41,9 @@ export default {
// 弹窗是否展示
type: Boolean,
default: false
},
effectStartDate: {
type: Boolean
}
},
computed: {
......@@ -66,8 +71,8 @@ export default {
effectStartDate: ''
},
rules: {
smsCode: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
effectStartDate: [{ required: true, message: '请选择生效开始日期', trigger: 'blur' }]
smsCode: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
// effectStartDate: [{ required: true, message: '请选择生效开始日期', trigger: 'blur' }]
},
// 短信模块
isSend: false,
......
......@@ -109,8 +109,8 @@
</div>
</div>
<verificationCodeDialog v-if="verificationCodeVisible" @handleConfirm="codeHandleConfirm"
:visible.sync="verificationCodeVisible" />
<verificationCodeDialog v-if="verificationCodeVisible" :effect-start-date="effectStartDate"
@handleConfirm="codeHandleConfirm" :visible.sync="verificationCodeVisible" />
<!-- 财务分账测试 -->
<merchantTestDialog v-if="merchantTestVisible" :rules-test-params="rulesTestParams"
......@@ -123,8 +123,12 @@
import { mapActions, mapGetters, mapMutations } from 'vuex'
import { sceneList, userType, attrToVal as attrToValOptions } from '@/common/constants'
import { deepClone } from '@/common/util'
import { scenemerchantrefQueryServiceRefByShop, merchantSettleDistributeRuleLastRule, merchantSettleDistributeRule, getMerchantLevelApi, getDjzhySubMerchant } from '@api/merchant'
import {
scenemerchantrefQueryServiceRefByShop, merchantSettleDistributeRuleLastRule, merchantSettleDistributeRule, getMerchantLevelApi, getDjzhySubMerchant,
getLedgerHistoryRecordApi
} from '@api/merchant'
import { getPlatformMerchantList } from '@api/index'
import { queryFeeCategoryByType, getGoodsCategoryConfiguration } from '@/api/sys.base.js'
import verificationCodeDialog from './components/verificationCodeDialog'
import classificationCpt from './components/classificationCpt.vue'
......@@ -207,7 +211,8 @@ export default {
DjzhySubMerchantObj: {
djzhySubMerchantId: '',
djzhySubMerchantName: ''
}
},
effectStartDate: false // 规则时间 true 表示可以立即生效 是否立即生效
}
},
computed: {
......@@ -304,6 +309,7 @@ export default {
this.init4sServiceList()
this.initFeeCategoryByType()
this.getGoodsCategoryConfiguration()
this.getLedgerHistoryRecordApi()
const { merchantId } = this.routerInfo
// yqMerchant && this.getMerchantLevel(yqMerchant.merchantId, 'PlatformLevelList')
this.initPlatformLevelList()
......@@ -338,6 +344,25 @@ export default {
const { settleTimeType, settleTime } = this.financialObj
this.settleTimeObj[settleTimeType == 1 ? 'first' : 'second'] = settleTime
},
getLedgerHistoryRecordApi() {
// 根据历史记录 处理财务生效记录的选项
const { merchantId, scene: sceneType } = this.routerInfo
getLedgerHistoryRecordApi({
merchantId,
sceneType
}).then(res => {
// 立即生效或者需选择
// console.log(res.every(item => {
// return item.rule.enableFlag == 3
// }), 'getLedgerHistoryRecordApi')
this.effectStartDate = res.every(item => {
return item.rule.enableFlag == 3
}) || !res.length
}).catch((err) => {
console.log(err)
})
},
getGoodsCategoryConfiguration() {
// const { scene: sceneType } = this.routerInfo
// sceneType
......@@ -512,8 +537,9 @@ export default {
},
codeHandleConfirm({ smsCode, effectStartDate }) {
this.submitParams.smsCode = smsCode
this.submitParams.effectStartDate = effectStartDate + ' 00:00:00'
// console.log(this.submitParams)
// this.submitParams.effectStartDate = effectStartDate
this.submitParams.effectStartDate = effectStartDate ? effectStartDate + ' 00:00:00' : ''
console.log(this.submitParams)
// return
merchantSettleDistributeRule({ json: JSON.stringify(this.submitParams) }).then((result) => {
......
......@@ -74,8 +74,8 @@
<el-button size="small" @click="handleReset"> 取消 </el-button>
</div>
</div>
<verificationCodeDialog v-if="verificationCodeVisible" @handleConfirm="codeHandleConfirm"
:visible.sync="verificationCodeVisible" />
<verificationCodeDialog v-if="verificationCodeVisible" :effect-start-date="effectStartDate"
@handleConfirm="codeHandleConfirm" :visible.sync="verificationCodeVisible" />
</d2-Container>
</template>
......@@ -89,8 +89,9 @@ import { sceneList } from "@/common/constants"
import {
saveRuleApi,
getEffectRuleApi,
getQueryFeeCategoryByTypeApi
getQueryFeeCategoryByTypeApi, addContactgetReconciliationHistoryRecordApi
} from "@api/merchant"
import { getGoodsCategoryConfiguration } from '@/api/sys.base.js'
import classificationCpt from "./components/classificationCpt.vue"
import verificationCodeDialog from '../financialRules/components/verificationCodeDialog'
......@@ -104,10 +105,11 @@ export default {
},
data() {
return {
effectStartDateDate: '',
effectStartDate: false, // 规则时间 true 表示可以立即生效 是否立即生效
sceneList,
verificationCodeVisible: false,
smsCode: '',
effectStartDate: '',
goodsTypeGroupRulesAll: [], // 所有的要提交的formdata goodsTypeGroupRules
editableTabsValue: "1",
currentIndex: 1,
......@@ -175,6 +177,7 @@ export default {
this.getEffectRule()// 获取对账规则
}, 1000)
this.initBaseData()
this.addContactgetReconciliationHistoryRecordApi()
},
watch: {
productType: {
......@@ -193,6 +196,25 @@ export default {
}
return "%"
},
addContactgetReconciliationHistoryRecordApi() {
// 根据历史记录 处理财务生效记录的选项
const { merchantId, scene: sceneType } = this.routerInfo
getLedgerHistoryRecordApi({
merchantId,
sceneType
}).then(res => {
// 立即生效或者需选择
// console.log(res.every(item => {
// return item.rule.enableFlag == 3
// }), 'getLedgerHistoryRecordApi')
this.effectStartDate = res.every(item => {
return item.rule.enableFlag == 3
}) || !res.length
}).catch((err) => {
console.log(err)
})
},
getQueryFeeCategoryByType() {
const params = {
feeCategoryType: 2,
......@@ -539,7 +561,7 @@ export default {
},
// 获取弹框中的验证码
codeHandleConfirm({ smsCode, effectStartDate }) {
this.effectStartDate = effectStartDate + ' 00:00:00'
this.effectStartDateDate = effectStartDate ? effectStartDate + ' 00:00:00' : ''
this.smsCode = smsCode
this.submitFormData()
},
......@@ -548,7 +570,7 @@ export default {
const { shopMerchantTotalFeeCalculateType, shopMerchantExpenseCategoryValue, partnerMerchantTotalFeeCalculateType, partnerMerchantExpenseCategoryValue } = this.formObj
const params = {
smsCode: this.smsCode,
effectStartDate: this.effectStartDate,
effectStartDate: this.effectStartDateDate,
merchantId: this.merchantRow.merchantId,
sceneType: this.merchantRow.scene,
goodsTypeGroupRules: this.goodsTypeGroupRulesAll,
......
......@@ -28,6 +28,10 @@
操作人: {{ formItem.updatedBy }} 操作时间:
{{ formItem.formatUpdatedDate }}
</span>
<span class="updatedInfo">
审核人: {{ formItem.auditorName }} 审核时间:
{{ formItem.formatAuditDate }}
</span>
<span class="collapse" @click="collapseItem(index)">
<i :class="{ move: formItem.show }" class="arrow el-icon-arrow-down" />
{{ formItem.show ? "收起" : "展开" }}
......@@ -126,40 +130,41 @@ export default {
}
})
},
getDetail() {
// const merchantId = this.merchantRow.merchantId
const merchantId = 44209883
if (!merchantId) return
getHistoryRecord({ merchantId }).then((res) => {
// console.log(res)
// dayjs(this.summaryDate).startOf('month').format('YYYY-MM-DD')
// const timeLabele = {
// }
// let financialRulesList = res
// 财务规则有三个模式 待生效 生效中 历史
// 根据effectEndDate 和 effectStartDate
// console.log(res)
this.formArray = res.map((item) => {
const format = "YYYY/MM/DD HH:mm"
const createdDate = item.createdDate
item.merchant = item?.divisionRule?.realityDivisionMerchant
item = Object.assign(item, item.settleRule, item.divisionRule)
// 这个值强制取item里面的
item.createdDate = createdDate
item.formatEffectEndDate = item.effectEndDate
? dayjs(item.effectEndDate).format(format)
: ""
item.formatEffectStartDate = item.effectStartDate
? dayjs(item.effectStartDate).format(format)
: ""
// console.log('item.createdDate', item.createdDate)
item.formatUpdatedDate = dayjs(item.createdDate).format(format)
item.show = false
return item
})
})
},
// getDetail() {
// // const merchantId = this.merchantRow.merchantId
// const merchantId = 44209883
// if (!merchantId) return
// getHistoryRecord({ merchantId }).then((res) => {
// // console.log(res)
// // dayjs(this.summaryDate).startOf('month').format('YYYY-MM-DD')
// // const timeLabele = {
// // }
// // let financialRulesList = res
// // 财务规则有三个模式 待生效 生效中 历史
// // 根据effectEndDate 和 effectStartDate
// // console.log(res)
// this.formArray = res.map((item) => {
// const format = "YYYY/MM/DD HH:mm"
// const createdDate = item.createdDate
// item.merchant = item?.divisionRule?.realityDivisionMerchant
// item = Object.assign(item, item.settleRule, item.divisionRule)
// // 这个值强制取item里面的
// item.createdDate = createdDate
// item.formatEffectEndDate = item.effectEndDate
// ? dayjs(item.effectEndDate).format(format)
// : ""
// item.formatEffectStartDate = item.effectStartDate
// ? dayjs(item.effectStartDate).format(format)
// : ""
// // console.log('item.createdDate', item.createdDate)
// item.formatUpdatedDate = dayjs(item.createdDate).format(format)
// item.formatAuditDate = dayjs(item.auditDate).format(format)
// item.show = false
// return item
// })
// })
// },
init() {
if (this.activeName == "first") {
this.getLedgerHistoryRecord()
......@@ -263,7 +268,7 @@ $color: #2a58ad;
.label {
padding-left: 8px;
width: 37%;
width: 25%;
}
.labelColor {
......@@ -271,7 +276,7 @@ $color: #2a58ad;
}
.updatedInfo {
width: 40%;
width: 20%;
text-align: left;
}
......@@ -661,4 +666,5 @@ $color: #2a58ad;
// .part5 {
// }
}
}</style>
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!