Commit cac652b4 by wangzhihui

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

…ife-system into SAAS+V4.54.0-0630
2 parents 1f64280c 5525a80a
<template> <template>
<div> <div>
<d2-dialog title="系统对账单" :is-visible="billVisible" class="privacyDailog" width="80%" @closeDialog="handleClose" @confirmDialog="handleConfirm"> <d2-dialog title="系统对账单" :is-visible="billVisible" class="privacyDailog" width="80%" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<el-table :data="tableList" style="width: 100%" ref="billMutiTable" show-summary :summary-method="getSummaries" :span-method="arraySpanMethod" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="tableList" style="width: 100%" ref="billMutiTable" show-summary :summary-method="getSummaries" :span-method="arraySpanMethod" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName"> <el-table-column v-for="(item, idx) in tableHeader" :key="idx" :label="item.moduleName">
<el-table-column v-for="(subItem, subIdx) in item.items" :key="subIdx" :prop="subItem.fieldCode" :label="subItem.fieldName" :width="subItem.width || ''"> <el-table-column v-for="(subItem, subIdx) in item.items" :key="subIdx" :prop="subItem.fieldCode" :label="subItem.fieldName" :width="subItem.width || ''">
...@@ -116,6 +116,7 @@ export default { ...@@ -116,6 +116,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
billTypeStr: 'traffic', billTypeStr: 'traffic',
tmplFieldsList: [], tmplFieldsList: [],
tableHeader: [], tableHeader: [],
...@@ -287,17 +288,20 @@ export default { ...@@ -287,17 +288,20 @@ export default {
// console.log(rowIndex, source, field) // console.log(rowIndex, source, field)
console.log(this.tableList, 'this.tableList---') console.log(this.tableList, 'this.tableList---')
// billCompute // billCompute
this.loading = true
const dynamicForm = { const dynamicForm = {
id: this.orderId, id: this.orderId,
orders: deepClone(this.dealParams()), orders: deepClone(this.dealParams()),
adjustments: this.$refs.dynamicAdd.dynamicForm.tableData adjustments: this.$refs.dynamicAdd.dynamicForm.tableData
} }
console.log(dynamicForm) console.log(dynamicForm, 'dynamicForm')
billCompute({ json: JSON.stringify(dynamicForm) }).then(res => { billCompute({ json: JSON.stringify(dynamicForm) }).then(res => {
console.log(res, 'res----') console.log(res, 'res----')
this.originalOrderList = res.orders this.originalOrderList = res.orders
this.total = res.totalAmount this.total = res.totalAmount
this.dealTableData() this.dealTableData()
}).finally(() => {
this.loading = false
}) })
}, },
...@@ -348,7 +352,7 @@ export default { ...@@ -348,7 +352,7 @@ export default {
let editable = true let editable = true
if (exitEditable) { if (exitEditable) {
editable = row[headObj.extInfo.source || 'ORDER'][headObj.editObj.editableAttr] editable = row[headObj.extInfo.source || 'ORDER'][headObj.editObj.editableAttr]
console.log(editable, field, 'editable---') // console.log(editable, field, 'editable---')
} }
if (!noValidList.includes(field) && fieldConfig && this.isEditableField(fieldConfig, field) && editable) { if (!noValidList.includes(field) && fieldConfig && this.isEditableField(fieldConfig, field) && editable) {
if (!this.validateField(rowIndex, source, field)) { if (!this.validateField(rowIndex, source, field)) {
...@@ -400,7 +404,7 @@ export default { ...@@ -400,7 +404,7 @@ export default {
adjustments: this.$refs.dynamicAdd.dynamicForm.tableData, adjustments: this.$refs.dynamicAdd.dynamicForm.tableData,
sceneType: this.sceneType sceneType: this.sceneType
} }
console.log(dynamicForm) console.log(dynamicForm, 'dynamicForm')
editBill({ json: JSON.stringify(dynamicForm) }).then(res => { editBill({ json: JSON.stringify(dynamicForm) }).then(res => {
this.$message.success("操作成功") this.$message.success("操作成功")
this.$emit('handleConfirm') this.$emit('handleConfirm')
...@@ -552,7 +556,7 @@ export default { ...@@ -552,7 +556,7 @@ export default {
}) })
}, },
handleBatch(obj) { handleBatch(obj) {
console.log(obj) // console.log(obj)
if (!this.multipleSelecList.length) { if (!this.multipleSelecList.length) {
this.$message.warning('请选择数据'); this.$message.warning('请选择数据');
return true return true
...@@ -564,9 +568,9 @@ export default { ...@@ -564,9 +568,9 @@ export default {
} else { } else {
this.$set(this.batchForm, this.headObj.fieldCode, '') this.$set(this.batchForm, this.headObj.fieldCode, '')
} }
console.log(this.multipleSelecList) // console.log(this.multipleSelecList)
console.log(this.headObj) // console.log(this.headObj)
console.log(this.batchForm) // console.log(this.batchForm)
this.handelBatchVisible() this.handelBatchVisible()
}, },
getSummaries(param) { getSummaries(param) {
...@@ -616,14 +620,14 @@ export default { ...@@ -616,14 +620,14 @@ export default {
}, },
handleDelete(rowIndex, row) { handleDelete(rowIndex, row) {
if(this.tableList.length == 1) { if (this.tableList.length == 1) {
this.$message.error("至少选择一个") this.$message.error("至少选择一个")
return true return true
} }
const orderCode = row.ORDER.orderCode const orderCode = row.ORDER.orderCode
let list = [] let list = []
this.tableList.forEach(item => { this.tableList.forEach(item => {
if(item.ORDER.orderCode != orderCode) { if (item.ORDER.orderCode != orderCode) {
list.push(item) list.push(item)
} }
}) })
...@@ -644,9 +648,9 @@ export default { ...@@ -644,9 +648,9 @@ export default {
handleInputDown(e, rowIndex, source, fieldConfig) { handleInputDown(e, rowIndex, source, fieldConfig) {
// limitPrice // limitPrice
// 处理输入框按键事件 // 处理输入框按键事件
console.log(e, rowIndex, source, fieldConfig) // console.log(e, rowIndex, source, fieldConfig)
const value = this.tableList[rowIndex][source][fieldConfig.fieldCode] const value = this.tableList[rowIndex][source][fieldConfig.fieldCode]
console.log(value) // console.log(value)
}, },
maxLengthInput(e, item) { maxLengthInput(e, item) {
......
...@@ -938,7 +938,7 @@ export default { ...@@ -938,7 +938,7 @@ export default {
this.infoForm.shopTrafficMoney = res.shopTrafficMoney this.infoForm.shopTrafficMoney = res.shopTrafficMoney
if (params.rangeType == 2) { // 按订单选择的前端计算 if (params.rangeType == 2) { // 按订单选择的前端计算
// 计算转账金额总和 // 计算转账金额总和
const numberList = this.infoForm.orderCodeScope?.map(val => { return val.shopDivisionMoneyInput }) || [] const numberList = this.infoForm.orderCodeScope?.map(val => { return val.shopTrafficMoneyInput }) || []
if (numberList?.length) { if (numberList?.length) {
this.infoForm.transferTotalAmount = numberList.reduce((preVal, curVal) => { this.infoForm.transferTotalAmount = numberList.reduce((preVal, curVal) => {
return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}` return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
...@@ -1142,7 +1142,7 @@ export default { ...@@ -1142,7 +1142,7 @@ export default {
params.orderRefList = infoForm?.orderCodeScope?.map(val => { params.orderRefList = infoForm?.orderCodeScope?.map(val => {
return { return {
orderCode: val.orderCode, orderCode: val.orderCode,
transferShopTrafficMoney: val.shopDivisionMoneyInput transferShopTrafficMoney: val.shopTrafficMoneyInput
} }
}) })
delete params.startTime delete params.startTime
......
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
<el-table-column label="服务对接" prop="yqMerchantName" align="center"></el-table-column> <el-table-column label="服务对接" prop="yqMerchantName" align="center"></el-table-column>
<el-table-column label="流量方总金额" align="center"> <el-table-column label="流量方总金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input class="wid_120" @input="event => { handleInput(event, scope.$index, scope.row) }" placeholder="请输入" v-model="scope.row.shopDivisionMoneyInput" v-if="isShowInput(scope.row)"></el-input> <el-input class="wid_120" @input="event => { handleInput(event, scope.$index, scope.row) }" placeholder="请输入" v-model="scope.row.shopTrafficMoneyInput" v-if="isShowInput(scope.row)"></el-input>
<span v-else>{{ `¥${scope.row.shopDivisionMoney}` }}</span> <span v-else>{{ `¥${scope.row.shopTrafficMoney}` }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
watch: { watch: {
selectedData: { selectedData: {
handler(newVal) { handler(newVal) {
const numberList = newVal?.map(val => { return val.shopDivisionMoneyInput }) || [] const numberList = newVal?.map(val => { return val.shopTrafficMoneyInput }) || []
if (numberList?.length) { if (numberList?.length) {
this.selectedTotalPrice = numberList.reduce((preVal, curVal) => { this.selectedTotalPrice = numberList.reduce((preVal, curVal) => {
return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}` return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
...@@ -227,8 +227,8 @@ export default { ...@@ -227,8 +227,8 @@ export default {
handleChange(selection, row) { handleChange(selection, row) {
// 不再选中后将输入框的值重置 // 不再选中后将输入框的值重置
if (!selection?.map(val => val.orderCode)?.includes(row?.orderCode)) { if (!selection?.map(val => val.orderCode)?.includes(row?.orderCode)) {
row.shopDivisionMoneyInput = row.shopDivisionMoneyInput || row.shopDivisionMoney row.shopTrafficMoneyInput = row.shopTrafficMoneyInput || row.shopTrafficMoney
row.oldShopDivisionMoneyInput = row.shopDivisionMoney row.oldShopTrafficMoneyInput = row.shopTrafficMoney
} }
var addOrDelete = !!selection.find( var addOrDelete = !!selection.find(
(item) => item.orderCode === row.orderCode (item) => item.orderCode === row.orderCode
...@@ -243,8 +243,8 @@ export default { ...@@ -243,8 +243,8 @@ export default {
// 不再选中后将输入框的值重置 // 不再选中后将输入框的值重置
if (!selection?.length) { if (!selection?.length) {
this.tableData?.forEach(row => { this.tableData?.forEach(row => {
row.shopDivisionMoneyInput = row.shopDivisionMoney row.shopTrafficMoneyInput = row.shopTrafficMoney
row.oldShopDivisionMoneyInput = row.shopDivisionMoney row.oldShopTrafficMoneyInput = row.shopTrafficMoney
}) })
} }
this.tableData.forEach((item) => { this.tableData.forEach((item) => {
...@@ -266,12 +266,12 @@ export default { ...@@ -266,12 +266,12 @@ export default {
// 输入框输入限制 // 输入框输入限制
handleInput(e, index, row) { handleInput(e, index, row) {
let newValue = e.replace(/[^\d.]/g, '') let newValue = e.replace(/[^\d.]/g, '')
let oldValue = this.tableData[index].oldShopDivisionMoneyInput let oldValue = this.tableData[index].oldShopTrafficMoneyInput
this.$set(this.tableData[index], 'shopDivisionMoneyInput', limitPrice(newValue, oldValue, 6, 2)) this.$set(this.tableData[index], 'shopTrafficMoneyInput', limitPrice(newValue, oldValue, 6, 2))
this.$set(this.tableData[index], 'oldShopDivisionMoneyInput', this.tableData[index].shopDivisionMoneyInput) this.$set(this.tableData[index], 'oldShopTrafficMoneyInput', this.tableData[index].shopTrafficMoneyInput)
const selIndex = this.selectedData?.findIndex(val => val.orderCode == row.orderCode) const selIndex = this.selectedData?.findIndex(val => val.orderCode == row.orderCode)
if (selIndex > -1) { if (selIndex > -1) {
this.$set(this.selectedData[selIndex], 'shopDivisionMoneyInput', this.tableData[index].shopDivisionMoneyInput) this.$set(this.selectedData[selIndex], 'shopTrafficMoneyInput', this.tableData[index].shopTrafficMoneyInput)
} }
}, },
// 获取订单列表 // 获取订单列表
...@@ -279,8 +279,8 @@ export default { ...@@ -279,8 +279,8 @@ export default {
let params = this.getParams() let params = this.getParams()
api.getList(params).then(res => { api.getList(params).then(res => {
res?.list?.forEach(val => { res?.list?.forEach(val => {
val.shopDivisionMoneyInput = val.shopDivisionMoney val.shopTrafficMoneyInput = val.shopTrafficMoney
val.oldShopDivisionMoneyInput = val.shopDivisionMoney val.oldShopTrafficMoneyInput = val.shopTrafficMoney
}) })
this.tableData = res?.list || [] this.tableData = res?.list || []
this.tableTotal = res?.total this.tableTotal = res?.total
...@@ -296,7 +296,7 @@ export default { ...@@ -296,7 +296,7 @@ export default {
if (exitIds.includes(item.orderCode)) { if (exitIds.includes(item.orderCode)) {
this.$refs.orderTable && this.$refs.orderTable.toggleRowSelection(item, true) this.$refs.orderTable && this.$refs.orderTable.toggleRowSelection(item, true)
let obj = this.selectedData?.find(val => val.orderCode == item.orderCode) let obj = this.selectedData?.find(val => val.orderCode == item.orderCode)
item.shopDivisionMoneyInput = obj?.shopDivisionMoneyInput || obj?.shopDivisionMoney item.shopTrafficMoneyInput = obj?.shopTrafficMoneyInput || obj?.shopTrafficMoney
} }
}) })
}, },
...@@ -342,7 +342,7 @@ export default { ...@@ -342,7 +342,7 @@ export default {
handleAddConfirm() { handleAddConfirm() {
if (!this.selectedData?.length) return this.$message.warning('请选择订单') if (!this.selectedData?.length) return this.$message.warning('请选择订单')
if (this.checkPriceEmpty(this.selectedData, 'shopDivisionMoneyInput')) { if (this.checkPriceEmpty(this.selectedData, 'shopTrafficMoneyInput')) {
return this.$message.warning('请完整输入流量方总金额') return this.$message.warning('请完整输入流量方总金额')
} }
this.$emit('chooseOrderConfirm', this.selectedData) this.$emit('chooseOrderConfirm', this.selectedData)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
{ required: true, message: '请输入产品名称', trigger: 'blur' }, { required: true, message: '请输入产品名称', trigger: 'blur' },
{ validator: (rule, value, callback) => validateProductName(rule, value, callback, index), trigger: 'blur' } { validator: (rule, value, callback) => validateProductName(rule, value, callback, index), trigger: 'blur' }
]"> ]">
<el-input class="name_input" v-model.trim="item.productName" placeholder="请输入名称"></el-input> <el-input class="name_input" v-model.trim="item.productName" maxlength="20" placeholder="请输入名称"></el-input>
<el-button class="marl_10" type="text" size="small" v-if="targetInfo.productList.length > 1" @click="removeItem(index, 'products', item)">删除</el-button> <el-button class="marl_10" type="text" size="small" v-if="targetInfo.productList.length > 1" @click="removeItem(index, 'products', item)">删除</el-button>
</el-form-item> </el-form-item>
<el-form-item label="包含以下商品:" :prop="`productList[${index}].selectSku`" :rules="rules.selectSku"> <el-form-item label="包含以下商品:" :prop="`productList[${index}].selectSku`" :rules="rules.selectSku">
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
{ required: true, message: '请输入套餐名称', trigger: 'blur' }, { required: true, message: '请输入套餐名称', trigger: 'blur' },
{ validator: (rule, value, callback) => validatePackageName(rule, value, callback, index), trigger: 'blur' } { validator: (rule, value, callback) => validatePackageName(rule, value, callback, index), trigger: 'blur' }
]"> ]">
<el-input class="name_input" v-model.trim="item.packageName" placeholder="请输入名称"></el-input> <el-input class="name_input" v-model.trim="item.packageName" maxlength="20" placeholder="请输入名称"></el-input>
<el-button class="marl_10" type="text" size="small" @click="removeItem(index, 'packages', item)">删除</el-button> <el-button class="marl_10" type="text" size="small" @click="removeItem(index, 'packages', item)">删除</el-button>
</el-form-item> </el-form-item>
<el-form-item label="包含以下圈定产品:" :prop="`packageList[${index}].targetProducts`" :rules="rules.targetProducts"> <el-form-item label="包含以下圈定产品:" :prop="`packageList[${index}].targetProducts`" :rules="rules.targetProducts">
...@@ -472,6 +472,7 @@ export default { ...@@ -472,6 +472,7 @@ export default {
return this.$message.error(`套餐名称"${pkg.packageName}"与产品名称重复`) return this.$message.error(`套餐名称"${pkg.packageName}"与产品名称重复`)
} }
packageNames.add(pkg.packageName) packageNames.add(pkg.packageName)
if (pkg.targetProducts?.length < 2) return this.$message.warning('套餐至少包含两个圈定产品')
} }
let productDefineList = [] let productDefineList = []
this.targetInfo.productList?.forEach(val => { this.targetInfo.productList?.forEach(val => {
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<div class="tableContent"> <div class="tableContent">
<div class="searchBox"> <div class="searchBox">
<el-input v-model.trim="upgradeGoodsName" placeholder="搜索商品名称" size="small" clearable style="width: 200px;"></el-input> <el-input v-model.trim="upgradeGoodsName" placeholder="搜索商品名称" size="small" clearable style="width: 200px;"></el-input>
<el-select v-model="brandMerchantCodeList" placeholder="请选择品牌方" multiple filterable collapse-tags clearable>
<el-option v-for="(item, index) in brandMerchantCodeSelectList" :key="index" :label="item.relatedPartyName" :value="item.id"></el-option>
</el-select>
<el-button type="primary" size="small" @click="handleSearch" >搜索</el-button> <el-button type="primary" size="small" @click="handleSearch" >搜索</el-button>
</div> </div>
<el-table <el-table
...@@ -47,12 +50,12 @@ ...@@ -47,12 +50,12 @@
:data="selectedData" :data="selectedData"
border border
height="420px"> height="420px">
<el-table-column prop="upgradeGoodsName" label="商品名称" align="center"> <el-table-column prop="upgradeGoodsName" label="商品名称" width="420px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.upgradeGoodsName }}</span> <span>{{ scope.row.upgradeGoodsName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="50px"> <el-table-column label="操作" align="center" width="55px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
...@@ -115,6 +118,7 @@ ...@@ -115,6 +118,7 @@
</template> </template>
<script> <script>
import { getUpgradeProductList } from '@api/productManage' import { getUpgradeProductList } from '@api/productManage'
import { getBrandSupplyMerchant } from '@api/product'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
export default { export default {
name: 'SelectDefineProductDialog', name: 'SelectDefineProductDialog',
...@@ -126,7 +130,9 @@ export default { ...@@ -126,7 +130,9 @@ export default {
total: 0, total: 0,
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
upgradeGoodsName: '' upgradeGoodsName: '',
brandMerchantCodeList: [],
brandMerchantCodeSelectList: []
} }
}, },
computed: { computed: {
...@@ -149,6 +155,8 @@ export default { ...@@ -149,6 +155,8 @@ export default {
if (this.selectDialogConfig.type == 1) { if (this.selectDialogConfig.type == 1) {
// 获取sku商品列表数据 // 获取sku商品列表数据
this.getSkuGoodsList() this.getSkuGoodsList()
// 获取品牌方数据
this.getBrandDataList()
} else { } else {
this.listData = deepClone(this.selectDialogConfig.listData) this.listData = deepClone(this.selectDialogConfig.listData)
this.$nextTick(() => { this.$nextTick(() => {
...@@ -158,11 +166,19 @@ export default { ...@@ -158,11 +166,19 @@ export default {
this.selectedData = deepClone(this.selectDialogConfig.selectData) this.selectedData = deepClone(this.selectDialogConfig.selectData)
}, },
methods: { methods: {
getBrandDataList() {
getBrandSupplyMerchant({
partitionFlag: 1
}).then(res => {
this.brandMerchantCodeSelectList = res
})
},
getSkuGoodsList() { getSkuGoodsList() {
let params = { let params = {
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
upgradeGoodsName: this.upgradeGoodsName upgradeGoodsName: this.upgradeGoodsName,
brandMerchantCodeList: this.brandMerchantCodeList
} }
getUpgradeProductList(params).then(res => { getUpgradeProductList(params).then(res => {
res?.list?.forEach(val => { res?.list?.forEach(val => {
......
...@@ -341,10 +341,6 @@ export default { ...@@ -341,10 +341,6 @@ export default {
prop: "provinceName" prop: "provinceName"
}, },
{ {
label: "所属省份",
prop: "provinceName"
},
{
label: "所属城市", label: "所属城市",
prop: "cityName" prop: "cityName"
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!