Commit aa47ff43 by 前端

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.56.0-0908
2 parents 41797ade b1d73175
...@@ -495,9 +495,14 @@ export default { ...@@ -495,9 +495,14 @@ export default {
source: 'ORDER', source: 'ORDER',
rule: (value, rowIndex) => { rule: (value, rowIndex) => {
const totalPaymentObj = this.tmplFieldsList.find(item => item.fieldCode == 'totalPaymentAmount') const totalPaymentObj = this.tmplFieldsList.find(item => item.fieldCode == 'totalPaymentAmount')
const orderList = this.tableList.filter(item => item.ORDER.orderCode == this.tableList[rowIndex].ORDER.orderCode)
var errorTxt = '' var errorTxt = ''
const max = this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount || '0' let max = 0
const min = parseFloat((this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount * -1).toFixed(2)) || '0' let min = 0
orderList.forEach(item => {
max = max + item[totalPaymentObj.extInfo.source].totalPaymentAmount
})
min = parseFloat((max * -1).toFixed(2))
if (value > max || value < min) { if (value > max || value < min) {
errorTxt = `请输入大于${min}且小于${max}的数字` errorTxt = `请输入大于${min}且小于${max}的数字`
} else if (value !== null && value !== undefined && value !== '') { } else if (value !== null && value !== undefined && value !== '') {
...@@ -1159,6 +1164,7 @@ export default { ...@@ -1159,6 +1164,7 @@ export default {
let headObj = this.tmplFieldsList.find(i => i.fieldCode == field) let headObj = this.tmplFieldsList.find(i => i.fieldCode == field)
if (!noValidList.includes(field) && fieldConfig && this.isEditableField(fieldConfig, field)) { if (!noValidList.includes(field) && fieldConfig && this.isEditableField(fieldConfig, field)) {
if (!this.validateField(rowIndex, source, field, fieldConfig)) { if (!this.validateField(rowIndex, source, field, fieldConfig)) {
console.log(rowIndex, source, field, fieldConfig, '===')
isValid = false isValid = false
} }
} }
...@@ -1290,6 +1296,8 @@ export default { ...@@ -1290,6 +1296,8 @@ export default {
handleConfirm() { handleConfirm() {
const validFlag = this.billTypeStr == 'traffic' ? (this.$refs.dynamicReceiveAdd.validateForm() && this.$refs.dynamicAdd.validateForm()) : this.$refs.dynamicAdd.validateForm() const validFlag = this.billTypeStr == 'traffic' ? (this.$refs.dynamicReceiveAdd.validateForm() && this.$refs.dynamicAdd.validateForm()) : this.$refs.dynamicAdd.validateForm()
console.log(validFlag, 'validFlag---')
console.log(this.validateForm(), 'this.validateForm()--')
if (this.validateForm() && validFlag) { if (this.validateForm() && validFlag) {
const dynamicForm = { const dynamicForm = {
id: this.orderId, id: this.orderId,
......
<!-- 2 - 分账金额设置 --> <!-- 2 - 分账金额设置 -->
<template> <template>
<div class="division-rule"> <div class="division-rule">
<p class="edit-sub-title">
费用归属设置 (用于定义费用的业务归属)
</p>
<el-form class="formSty" ref="divisionRuleRef2" :model="form2" :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 radioList2" :key="index">
{{ item.applicationObjectName || item.expenseCategoryName }}
</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" v-for="(item, index) in radioList2" :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="form2['id' + item.expenseCategoryId]" @change="
(e) => handleClearValid2(e, 'id' + item.expenseCategoryId)
">
<el-radio v-for="(el, index) in tableSelectOptions" :key="index" :label="+el.targetMerchantType" />
</el-radio-group>
</el-form-item>
</td>
</tr>
</table>
</el-form-item>
</el-form>
<p class="edit-sub-title">
实际分账设置 (用于定义费用的实际分账归属)
</p>
<el-form class="formSty" ref="divisionRuleRef" :model="form" :rules="rules" label-suffix=":" label-width="180px"> <el-form class="formSty" ref="divisionRuleRef" :model="form" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px"> <el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block"> <table cellpadding="0" cellspacing="0" class="table-block">
...@@ -40,8 +81,6 @@ ...@@ -40,8 +81,6 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex"
// import { userType } from '@/common/constants'
export default { export default {
name: "TableAccount", name: "TableAccount",
props: { props: {
...@@ -56,7 +95,12 @@ export default { ...@@ -56,7 +95,12 @@ export default {
return [] return []
} }
}, },
owningMerchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户 // 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: { tableSelectOptions: {
type: Array, type: Array,
...@@ -72,8 +116,6 @@ export default { ...@@ -72,8 +116,6 @@ export default {
3: "流量方", 3: "流量方",
4: "平台方" 4: "平台方"
} }
const type = val.targetMerchantType
// ${name[type]}:
return ` ${val.merchantName}` return ` ${val.merchantName}`
} }
}, },
...@@ -83,6 +125,9 @@ export default { ...@@ -83,6 +125,9 @@ export default {
form: { form: {
// settleTimeType: 1 // settleTimeType: 1
}, },
form2: {
// settleTimeType: 1
},
platformSideLabel: 0, platformSideLabel: 0,
merchantAccountInfo: {}, merchantAccountInfo: {},
partnerSettleAccountModel: "", partnerSettleAccountModel: "",
...@@ -134,7 +179,30 @@ export default { ...@@ -134,7 +179,30 @@ export default {
}) })
// console.log('list', arr) // console.log('list', arr)
return arr return arr
},
radioList2: function () {
const obj = this.classificationObjSelect
let list = []
let arr = []
const arrIdx = [1, 2, 302, 701, 4]
for (const key in obj) {
obj[key].map((item) => {
if (
arrIdx.includes(item.id) ||
arrIdx.includes(item.expenseCategoryId)
) {
list.push(item)
}
})
} }
arr = list.filter((item) => {
return (
arrIdx.includes(item.id) || arrIdx.includes(item.expenseCategoryId)
)
})
// console.log('list', arr)
return arr
},
// ...mapGetters("goodsInfoData", { // ...mapGetters("goodsInfoData", {
// shelfType: "shelfType" // shelfType: "shelfType"
// }) // })
...@@ -143,6 +211,7 @@ export default { ...@@ -143,6 +211,7 @@ export default {
classificationObjSelect: { classificationObjSelect: {
handler() { handler() {
this.initList() this.initList()
this.initList2()
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -150,6 +219,7 @@ export default { ...@@ -150,6 +219,7 @@ export default {
merchantDistributionRules: { merchantDistributionRules: {
handler() { handler() {
this.initList() this.initList()
this.initList2()
}, },
deep: true deep: true
// immediate: true // immediate: true
...@@ -187,6 +257,30 @@ export default { ...@@ -187,6 +257,30 @@ export default {
this.form = form this.form = form
// console.log(this.form,'this.form') // console.log(this.form,'this.form')
}, },
initList2() {
// 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.owningMerchantDistributionRules.find((el) => {
return el.expenseCategoryId == item.expenseCategoryId
})
form[name] = findObj?.targetMerchantType || ""
})
}
// 判断id是否有在选项里面 没有就去掉
this.form2 = form
console.log(this.form, 'this.form')
},
changFormList() { changFormList() {
// console.log(this.form,'this.form') // console.log(this.form,'this.form')
// 判断id是否有在选项里面 没有就去掉 // 判断id是否有在选项里面 没有就去掉
...@@ -197,6 +291,78 @@ export default { ...@@ -197,6 +291,78 @@ export default {
}) == -1 && (this.form[key] = "") }) == -1 && (this.form[key] = "")
} }
}, },
handleClearValid2(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef2.clearValidate(validField)
},
handleConfirm2() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
this.$refs.divisionRuleRef2.validate((valid) => {
if (valid) {
// this.form
const merchantDistributionRules = this.radioList2.reduce(
(prev, next) => {
const id = this.form2["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
// (item) => item.merchantId == id
(item) => item.targetMerchantType == id
)
// console.log(merchantObj, 'merchantObj')
// if (merchantObj?.merchantId == 1) {
// merchantObj.merchantId = this.copyMerchantInfo.merchantId
// merchantObj.merchantName = this.copyMerchantInfo.merchantName
// }
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)
}
})
})
},
getTableAccountParams2() {
const merchantDistributionRules = this.radioList2.reduce((prev, next) => {
const id = this.form2["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
// (item) => item.merchantId == id
// (item) => (item.merchantId == id) || item.targetMerchantLevel == id
(item) => item.targetMerchantType == id
)
// if (merchantObj?.merchantId == 1) {
// merchantObj.merchantId = this.copyMerchantInfo.merchantId
// merchantObj.merchantName = this.copyMerchantInfo.merchantName
// }
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
},
handleClearValid(e, validField) { handleClearValid(e, validField) {
this.$forceUpdate() this.$forceUpdate()
// this.handleConfirm() // this.handleConfirm()
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<d2-table ref="purchaseOrderDetailTable" :table-params="tableParams" :has-page="hasPage" <d2-table ref="purchaseOrderDetailTable" :table-params="tableParams" :has-page="hasPage"
@refreshTable="refreshTable" :table-data="detailInfo.tableData" :table-total="detailInfo.tableTotal"> @refreshTable="refreshTable" :table-data="detailInfo.tableData" :table-total="detailInfo.tableTotal">
<div slot="nowPurNum" slot-scope="scope"> <div slot="nowPurNum" slot-scope="scope">
<span v-if="scope.scope.refundStatus != 'Y'">
<div <div
v-if="detailInfo.tableData[scope.index].purchaseNumber == detailInfo.tableData[scope.index].goodsNumber"> v-if="detailInfo.tableData[scope.index].purchaseNumber == detailInfo.tableData[scope.index].goodsNumber">
{{ detailInfo.tableData[scope.index].shipper || '未分配' }}</div> {{ detailInfo.tableData[scope.index].shipper || '未分配' }}</div>
...@@ -32,6 +33,8 @@ ...@@ -32,6 +33,8 @@
<el-option v-for="item in staffList" :key="item.uuid" :label="item.staffName" :value="item.uuid"> <el-option v-for="item in staffList" :key="item.uuid" :label="item.staffName" :value="item.uuid">
</el-option> </el-option>
</el-select> </el-select>
</span>
<span v-else>--</span>
</div> </div>
<template slot="carName" slot-scope="scope"> <template slot="carName" slot-scope="scope">
<el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top"> <el-tooltip v-if="scope.scope.suitCarTypeList && scope.scope.suitCarTypeList.length" placement="top">
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div v-if=" <div v-if="
(detailInfo.tableData[scope.index].purchaseNumber == 0 || (detailInfo.tableData[scope.index].purchaseNumber == 0 ||
detailInfo.tableData[scope.index].purchaseNumber != detailInfo.tableData[scope.index].purchaseNumber !=
detailInfo.tableData[scope.index].goodsNumber) && scope.scope.row.refundStatus != 'Y' detailInfo.tableData[scope.index].goodsNumber) && scope.scope.refundStatus != 'Y'
"> ">
<!-- 判断是否当前账户发货 --> <!-- 判断是否当前账户发货 -->
<el-input v-if=" <el-input v-if="
......
...@@ -160,27 +160,6 @@ export default { ...@@ -160,27 +160,6 @@ export default {
return val.courseId == courseId return val.courseId == courseId
}) })
}, },
// handleCourse() {
// this.selectObj = {
// courseTotalDuration: 0,
// count: 0
// }
// this.selected.forEach((courseId) => {
// if (!this.filter(courseId)) {
// this.courseList.forEach((item) => {
// if (item.courseId == courseId) {
// this.selectCourseList.push(item)
// }
// })
// }
// })
// this.selectCourseList.forEach((item) => {
// this.selectObj.courseTotalDuration += item.courseTotalDuration
// this.selectObj.count++
// })
// this.$emit("handleCourse", this.selectCourseList)
// },
handleCourse() { handleCourse() {
this.selectObj = { this.selectObj = {
...@@ -212,8 +191,12 @@ export default { ...@@ -212,8 +191,12 @@ export default {
// 统计信息 // 统计信息
this.selectCourseList.forEach((item) => { this.selectCourseList.forEach((item) => {
this.selectObj.courseTotalDuration += item.courseTotalDuration this.selectObj.courseTotalDuration = parseFloat(
this.selectObj.count++ (
this.selectObj.courseTotalDuration + item.courseTotalDuration
).toFixed(2)
)
this.selectObj.count += 1
}) })
this.$emit("handleCourse", this.selectCourseList) this.$emit("handleCourse", this.selectCourseList)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!