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>
<div>
<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 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 || ''">
......@@ -116,6 +116,7 @@ export default {
},
data() {
return {
loading: false,
billTypeStr: 'traffic',
tmplFieldsList: [],
tableHeader: [],
......@@ -287,17 +288,20 @@ export default {
// console.log(rowIndex, source, field)
console.log(this.tableList, 'this.tableList---')
// billCompute
this.loading = true
const dynamicForm = {
id: this.orderId,
orders: deepClone(this.dealParams()),
adjustments: this.$refs.dynamicAdd.dynamicForm.tableData
}
console.log(dynamicForm)
console.log(dynamicForm, 'dynamicForm')
billCompute({ json: JSON.stringify(dynamicForm) }).then(res => {
console.log(res, 'res----')
this.originalOrderList = res.orders
this.total = res.totalAmount
this.dealTableData()
}).finally(() => {
this.loading = false
})
},
......@@ -348,7 +352,7 @@ export default {
let editable = true
if (exitEditable) {
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 (!this.validateField(rowIndex, source, field)) {
......@@ -400,7 +404,7 @@ export default {
adjustments: this.$refs.dynamicAdd.dynamicForm.tableData,
sceneType: this.sceneType
}
console.log(dynamicForm)
console.log(dynamicForm, 'dynamicForm')
editBill({ json: JSON.stringify(dynamicForm) }).then(res => {
this.$message.success("操作成功")
this.$emit('handleConfirm')
......@@ -552,7 +556,7 @@ export default {
})
},
handleBatch(obj) {
console.log(obj)
// console.log(obj)
if (!this.multipleSelecList.length) {
this.$message.warning('请选择数据');
return true
......@@ -564,9 +568,9 @@ export default {
} else {
this.$set(this.batchForm, this.headObj.fieldCode, '')
}
console.log(this.multipleSelecList)
console.log(this.headObj)
console.log(this.batchForm)
// console.log(this.multipleSelecList)
// console.log(this.headObj)
// console.log(this.batchForm)
this.handelBatchVisible()
},
getSummaries(param) {
......@@ -616,14 +620,14 @@ export default {
},
handleDelete(rowIndex, row) {
if(this.tableList.length == 1) {
if (this.tableList.length == 1) {
this.$message.error("至少选择一个")
return true
}
const orderCode = row.ORDER.orderCode
let list = []
this.tableList.forEach(item => {
if(item.ORDER.orderCode != orderCode) {
if (item.ORDER.orderCode != orderCode) {
list.push(item)
}
})
......@@ -644,9 +648,9 @@ export default {
handleInputDown(e, rowIndex, source, fieldConfig) {
// limitPrice
// 处理输入框按键事件
console.log(e, rowIndex, source, fieldConfig)
// console.log(e, rowIndex, source, fieldConfig)
const value = this.tableList[rowIndex][source][fieldConfig.fieldCode]
console.log(value)
// console.log(value)
},
maxLengthInput(e, item) {
......
......@@ -938,7 +938,7 @@ export default {
this.infoForm.shopTrafficMoney = res.shopTrafficMoney
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) {
this.infoForm.transferTotalAmount = numberList.reduce((preVal, curVal) => {
return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
......@@ -1142,7 +1142,7 @@ export default {
params.orderRefList = infoForm?.orderCodeScope?.map(val => {
return {
orderCode: val.orderCode,
transferShopTrafficMoney: val.shopDivisionMoneyInput
transferShopTrafficMoney: val.shopTrafficMoneyInput
}
})
delete params.startTime
......
......@@ -71,8 +71,8 @@
<el-table-column label="服务对接" prop="yqMerchantName" align="center"></el-table-column>
<el-table-column label="流量方总金额" align="center">
<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>
<span v-else>{{ `¥${scope.row.shopDivisionMoney}` }}</span>
<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.shopTrafficMoney}` }}</span>
</template>
</el-table-column>
</el-table>
......@@ -180,7 +180,7 @@ export default {
watch: {
selectedData: {
handler(newVal) {
const numberList = newVal?.map(val => { return val.shopDivisionMoneyInput }) || []
const numberList = newVal?.map(val => { return val.shopTrafficMoneyInput }) || []
if (numberList?.length) {
this.selectedTotalPrice = numberList.reduce((preVal, curVal) => {
return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
......@@ -227,8 +227,8 @@ export default {
handleChange(selection, row) {
// 不再选中后将输入框的值重置
if (!selection?.map(val => val.orderCode)?.includes(row?.orderCode)) {
row.shopDivisionMoneyInput = row.shopDivisionMoneyInput || row.shopDivisionMoney
row.oldShopDivisionMoneyInput = row.shopDivisionMoney
row.shopTrafficMoneyInput = row.shopTrafficMoneyInput || row.shopTrafficMoney
row.oldShopTrafficMoneyInput = row.shopTrafficMoney
}
var addOrDelete = !!selection.find(
(item) => item.orderCode === row.orderCode
......@@ -243,8 +243,8 @@ export default {
// 不再选中后将输入框的值重置
if (!selection?.length) {
this.tableData?.forEach(row => {
row.shopDivisionMoneyInput = row.shopDivisionMoney
row.oldShopDivisionMoneyInput = row.shopDivisionMoney
row.shopTrafficMoneyInput = row.shopTrafficMoney
row.oldShopTrafficMoneyInput = row.shopTrafficMoney
})
}
this.tableData.forEach((item) => {
......@@ -266,12 +266,12 @@ export default {
// 输入框输入限制
handleInput(e, index, row) {
let newValue = e.replace(/[^\d.]/g, '')
let oldValue = this.tableData[index].oldShopDivisionMoneyInput
this.$set(this.tableData[index], 'shopDivisionMoneyInput', limitPrice(newValue, oldValue, 6, 2))
this.$set(this.tableData[index], 'oldShopDivisionMoneyInput', this.tableData[index].shopDivisionMoneyInput)
let oldValue = this.tableData[index].oldShopTrafficMoneyInput
this.$set(this.tableData[index], 'shopTrafficMoneyInput', limitPrice(newValue, oldValue, 6, 2))
this.$set(this.tableData[index], 'oldShopTrafficMoneyInput', this.tableData[index].shopTrafficMoneyInput)
const selIndex = this.selectedData?.findIndex(val => val.orderCode == row.orderCode)
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 {
let params = this.getParams()
api.getList(params).then(res => {
res?.list?.forEach(val => {
val.shopDivisionMoneyInput = val.shopDivisionMoney
val.oldShopDivisionMoneyInput = val.shopDivisionMoney
val.shopTrafficMoneyInput = val.shopTrafficMoney
val.oldShopTrafficMoneyInput = val.shopTrafficMoney
})
this.tableData = res?.list || []
this.tableTotal = res?.total
......@@ -296,7 +296,7 @@ export default {
if (exitIds.includes(item.orderCode)) {
this.$refs.orderTable && this.$refs.orderTable.toggleRowSelection(item, true)
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 {
handleAddConfirm() {
if (!this.selectedData?.length) return this.$message.warning('请选择订单')
if (this.checkPriceEmpty(this.selectedData, 'shopDivisionMoneyInput')) {
if (this.checkPriceEmpty(this.selectedData, 'shopTrafficMoneyInput')) {
return this.$message.warning('请完整输入流量方总金额')
}
this.$emit('chooseOrderConfirm', this.selectedData)
......
......@@ -22,7 +22,7 @@
{ required: true, message: '请输入产品名称', 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-form-item>
<el-form-item label="包含以下商品:" :prop="`productList[${index}].selectSku`" :rules="rules.selectSku">
......@@ -42,7 +42,7 @@
{ required: true, message: '请输入套餐名称', 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-form-item>
<el-form-item label="包含以下圈定产品:" :prop="`packageList[${index}].targetProducts`" :rules="rules.targetProducts">
......@@ -472,6 +472,7 @@ export default {
return this.$message.error(`套餐名称"${pkg.packageName}"与产品名称重复`)
}
packageNames.add(pkg.packageName)
if (pkg.targetProducts?.length < 2) return this.$message.warning('套餐至少包含两个圈定产品')
}
let productDefineList = []
this.targetInfo.productList?.forEach(val => {
......
......@@ -9,6 +9,9 @@
<div class="tableContent">
<div class="searchBox">
<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>
</div>
<el-table
......@@ -47,12 +50,12 @@
:data="selectedData"
border
height="420px">
<el-table-column prop="upgradeGoodsName" label="商品名称" align="center">
<el-table-column prop="upgradeGoodsName" label="商品名称" width="420px" align="center">
<template slot-scope="scope">
<span>{{ scope.row.upgradeGoodsName }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="50px">
<el-table-column label="操作" align="center" width="55px">
<template slot-scope="scope">
<el-button
@click="handleDelete(scope.row)"
......@@ -115,6 +118,7 @@
</template>
<script>
import { getUpgradeProductList } from '@api/productManage'
import { getBrandSupplyMerchant } from '@api/product'
import { deepClone } from '@/common/util'
export default {
name: 'SelectDefineProductDialog',
......@@ -126,7 +130,9 @@ export default {
total: 0,
currentPage: 1,
pageSize: 20,
upgradeGoodsName: ''
upgradeGoodsName: '',
brandMerchantCodeList: [],
brandMerchantCodeSelectList: []
}
},
computed: {
......@@ -149,6 +155,8 @@ export default {
if (this.selectDialogConfig.type == 1) {
// 获取sku商品列表数据
this.getSkuGoodsList()
// 获取品牌方数据
this.getBrandDataList()
} else {
this.listData = deepClone(this.selectDialogConfig.listData)
this.$nextTick(() => {
......@@ -158,11 +166,19 @@ export default {
this.selectedData = deepClone(this.selectDialogConfig.selectData)
},
methods: {
getBrandDataList() {
getBrandSupplyMerchant({
partitionFlag: 1
}).then(res => {
this.brandMerchantCodeSelectList = res
})
},
getSkuGoodsList() {
let params = {
currentPage: this.currentPage,
pageSize: this.pageSize,
upgradeGoodsName: this.upgradeGoodsName
upgradeGoodsName: this.upgradeGoodsName,
brandMerchantCodeList: this.brandMerchantCodeList
}
getUpgradeProductList(params).then(res => {
res?.list?.forEach(val => {
......
......@@ -341,10 +341,6 @@ export default {
prop: "provinceName"
},
{
label: "所属省份",
prop: "provinceName"
},
{
label: "所属城市",
prop: "cityName"
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!