Commit 7912ecac by wangzhihui

嘀加上架

1 parent 7da28ed7
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-02-24 10:57:17
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-02-24 17:13:11
* @FilePath: \dj-car-life-system\src\api\shelfManage.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "./request"
import RequestMethods from "./request.methods"
//嘀加上架查看详情(分账、对账配置)
export function merchantSettleDistributeRuleLastRule(data) {
data.method = `dj.api.create.business.approve.detail.rule`
return request(data)
}
// 获取不同场景的商品分类
export function getGoodsCategoryConfiguration(data) {
data.currentPage = 1
data.pageSize = 999999
// data.method = `${path}goodsCategoryConfiguration.page`
data.method = `${path}goodsCategoryConfiguration.page.new`
return request(data)
}
// 财务 - 2 - 获取导流方
export function getMerchantLevelApi(data) {
data.method = `dj.api.smartcarlife.get.merchantLevel`
return request(data, "post")
}
\ No newline at end of file
<!-- 2 - 分账金额设置 -->
<template>
<div class="division-rule">
<el-form
class="formSty"
ref="divisionRuleRef"
:model="form"
:rules="rules"
label-suffix=":"
label-width="180px"
>
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
<tr class="tableHeader">
<td>分账对象/分账类目</td>
<!-- <td>平台方分账金额</td> -->
<td v-for="(item, index) in radioList" :key="index">
{{ item.applicationObjectName }}
</td>
</tr>
<tr>
<td class="merchantNameTd p-b-20">
<p
:title="item | filterMerchantType"
v-for="(item, index) in tableSelectOptions"
:key="index"
>
{{ item | filterMerchantType }}
</p>
</td>
<!-- <td class="p-b-20">
<el-form-item label-width="0px">
<el-radio-group v-model="platformSideLabel">
<el-radio
v-for="(item, index) in tableSelectOptions"
:key="index + 'index'"
:disabled="item != 0"
:label="index"
/>
</el-radio-group>
</el-form-item>
</td> -->
<td
class="p-b-20"
v-for="(item, index) in radioList"
:key="index + 'radioList'"
>
<el-form-item
label-width="0"
:prop="`id${item.expenseCategoryId}`"
:rules="[
{
required: true,
message: `请选择${item.applicationObjectName}`,
trigger: 'change'
}
]"
>
<el-radio-group
v-model="form['id' + item.expenseCategoryId]"
@change="
(e) => handleClearValid(e, 'id' + item.expenseCategoryId)
"
>
<el-radio
v-for="(el, index) in tableSelectOptions"
:key="index"
:label="+el.merchantId"
/>
</el-radio-group>
</el-form-item>
</td>
</tr>
</table>
</el-form-item>
</el-form>
</div>
</template>
<script>
// import { userType } from '@/common/constants'
export default {
name: "TableAccount",
props: {
// 列选项
classificationObjSelect: {
type: Object,
default: () => {}
},
// merchantInfo: {
// type: Object,
// default: () => { }
// },
merchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:导流方 4:子商户
tableSelectOptions: {
type: Array,
default: () => []
}
},
filters: {
// 过滤商户类型
filterMerchantType(val) {
const name = {
1: "平台方",
2: "服务商",
3: "导流方",
4: "平台方"
}
const type = val.targetMerchantType
return `${name[type]}: ${val.merchantName}`
}
},
data() {
return {
form: {
// settleTimeType: 1
},
platformSideLabel: 0,
merchantAccountInfo: {},
partnerSettleAccountModel: "",
djDivisionDefalut: 1,
rules: {},
// 导流方下拉选项对应
attrToVal: [
{
confId: 3,
confLabel: "city"
},
{
// confId: 4,
confId: 2,
confLabel: "province"
},
{
// confId: 5,
confId: 1,
confLabel: "factory"
}
],
realityShopMerchant: {
merchantId: "",
merchantName: "",
userType: ""
},
baseData: {
merchantLevelList: [],
PlatformLevelList: []
}
}
},
computed: {
radioList: function () {
const obj = this.classificationObjSelect
let list = [],
arr = [],
arrIdx = [1, 2, 302, 701, 4]
for (const key in obj) {
obj[key].map((item) => {
if (arrIdx.includes(item.id)) {
list.push(item)
}
})
}
arr = list.filter((item) => {
return arrIdx.includes(item.id)
})
console.log(arr)
return arr
}
},
watch: {
classificationObjSelect: {
handler() {
this.initList()
},
deep: true,
immediate: true
},
merchantDistributionRules: {
handler() {
this.initList()
},
deep: true
// immediate: true
},
tableSelectOptions: {
handler() {
// this.initList()
this.changFormList()
},
deep: true
// immediate: true
}
},
mounted() {},
methods: {
initList() {
// console.log('initList')
// this.merchantDistributionRules
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const form = {}
// console.log('obj', obj)
for (const key in obj) {
obj[key].map((item) => {
// 数字转字符串
const name = "id" + item.expenseCategoryId
// console.log(name, item.id || item.expenseCategoryId, 'item.id')
// 做回显用数据
const findObj = this.merchantDistributionRules.find((el) => {
return el.expenseCategoryId == item.expenseCategoryId
})
// 还要跟存在现在的选项里面
// console.log('findObj', findObj)
// console.log(name)
// const optIndex = this.tableSelectOptions.findIndex((opt) => { return opt.merchantId == findObj?.merchantId })
// console.log(optIndex, 'optIndex')
form[name] = parseInt(findObj?.merchantId) || ""
})
}
// 判断id是否有在选项里面 没有就去掉
this.form = form
},
changFormList() {
// 判断id是否有在选项里面 没有就去掉
for (const key in this.form) {
const element = this.form[key]
this.tableSelectOptions.findIndex((opt) => {
return opt.merchantId == element
}) == -1 && (this.form[key] = "")
}
},
handleClearValid(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef.clearValidate(validField)
},
handleConfirm() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
this.$refs.divisionRuleRef.validate((valid) => {
if (valid) {
// this.form
const merchantDistributionRules = this.radioList.reduce(
(prev, next) => {
const id = this.form["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
(item) => item.merchantId == id
)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
},
[]
)
resolve(merchantDistributionRules)
} else {
resolve(false)
}
})
})
},
getTableAccountParams() {
const merchantDistributionRules = this.radioList.reduce((prev, next) => {
const id = this.form["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
(item) => item.merchantId == id
)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
}, [])
return merchantDistributionRules
// console.log(this.merchantInfo)
// return new Promise((resolve, reject) => {
// this.$refs.divisionRuleRef.validate(valid => {
// if (valid) {
// // this.form
// } else {
// resolve(false)
// }
// })
// }
// )
}
}
}
</script>
<style scoped lang="scss">
.formSty {
overflow-x: scroll;
}
.division-rule table {
width: 98%;
color: #666666;
border: 1px solid #e5e6e7;
border-width: 1px 0 0 1px;
}
.division-rule table tr {
height: 50px;
line-height: 50px;
}
.division-rule table th,
.division-rule table td {
font-size: 12px;
font-weight: normal;
padding: 0px 10px;
border: 1px solid #e5e6e7;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
min-width: 100px;
white-space: nowrap;
/* white-space: nowrap; */
/* overflow: hidden; */
/* text-overflow: ellipsis; */
}
.division-rule table .merchantNameTd {
min-width: 150px;
}
.division-rule .flex {
display: flex;
justify-content: space-around;
}
.division-rule .table-block .el-radio {
display: block;
height: 60px;
line-height: 42px;
margin-right: 0;
}
.division-rule .table-block .el-radio__label {
display: none !important;
}
.p-b-20 {
padding-bottom: 26px !important;
}
</style>
......@@ -126,7 +126,7 @@ export default {
label: "备注",
name: "remark",
type: "input",
maxlength: 30,
maxlength: 100,
placeholder: "请输入",
inputType: "textarea",
width: "580px",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!