caolin 3 months ago
commit acdcc670de
  1. 5
      src/api/clue/settle.js
  2. 10
      src/views/Clue/Order/Comp/DialogOrder.vue
  3. 71
      src/views/Clue/Order/Comp/MallSettle.vue
  4. 24
      src/views/Clue/Order/Comp/Reback.vue
  5. 71
      src/views/Clue/Order/Comp/SchoolSettle.vue

@ -24,3 +24,8 @@ export const getMallSettleDetail = async (id) => {
export const batchSaveSettle = async (data) => {
return await request.post({ url: '/admin-api/crm/sign-settlement/batch/save', data })
}
// 修改结算
export const updateSettle = async (data) => {
return await request.post({ url: '/admin-api/crm/sign-settlement/update/money', data })
}

@ -191,11 +191,17 @@ function getFields() {
})
getOrderFieldList().then((data) => {
const arr = useCrudSchemas(data).allSchemas.detailSchema
arr.forEach((it) => {
const list = useCrudSchemas(data).allSchemas.detailSchema
const arr = []
list.forEach((it) => {
if (it.label.includes('日期')) {
it.dateFormat = 'YYYY-MM-DD'
}
if (it.field == 'receivedMoney') {
checkPermi(['clue:order:return-list']) && arr.push(it)
} else {
arr.push(it)
}
})
if (arr.length % 2 != 0) {
arr.push({})

@ -157,16 +157,38 @@
<el-table-column prop="phone" label="联系方式" width="120px" />
<el-table-column prop="signUserName" label="登记人" min-width="90" />
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
<el-table-column
prop="createTime"
label="支出日期"
width="120px"
:formatter="dateFormatter"
/>
<el-table-column prop="createTime" label="支出日期" width="140px">
<template #default="{ row, col }">
<el-date-picker
v-if="row.edit"
v-model="row.createTime"
type="date"
size="small"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 110px"
:clearable="false"
placeholder="选择日期"
/>
<div v-else>{{ dateFormatter(row, col, row.createTime) }}</div>
</template>
</el-table-column>
<el-table-column prop="signProduct" label="成交产品" min-width="150px" />
<el-table-column prop="signSpecs" label="成交规格" min-width="150px" />
<el-table-column prop="supplier" label="供应商" min-width="150px" />
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.settlementPrice"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
<div v-else>{{ row.settlementPrice }}</div>
</template>
</el-table-column>
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
<el-table-column label="费用备注" width="90px">
@ -199,6 +221,19 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.settlementState == '待结算'"
type="primary"
text
v-hasPermi="['clue:order:settle-update']"
@click="handleUpdate(row)"
>
{{ row.edit ? '保存' : '修改' }}
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
@ -318,6 +353,28 @@ function getSummaries(param) {
return sums
}
async function handleUpdate(row) {
if (row.edit) {
//
await message.confirm('是否确认修改结算数据?')
//
SettleApi.updateSettle({
settlementId: row.settlementId,
settlementPrice: row.settlementPrice,
createTime: row.createTime
})
.then(() => {
message.success('修改成功')
getList()
})
.finally(() => {
row.edit = false
})
} else {
row.edit = true
}
}
const selectList = ref([])
function handleSelectionChange(val) {
selectList.value = [...val]

@ -218,9 +218,24 @@
<el-table-column
prop="applyTime"
label="申请时间"
min-width="120px"
min-width="140px"
:formatter="dateFormatter"
/>
>
<template #default="{ row, col }">
<el-date-picker
v-if="row.edit"
v-model="row.applyTime"
type="date"
size="small"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 110px"
:clearable="false"
placeholder="选择日期"
/>
<div v-else>{{ dateFormatter(row, col, row.applyTime) }}</div>
</template>
</el-table-column>
<el-table-column prop="checkUser" label="审核人" min-width="90" />
<el-table-column
prop="checkTime"
@ -297,7 +312,7 @@ import DialogBatchAudit from './DialogBatchAudit.vue'
import { removeNullField } from '@/utils'
import { useAppStore } from '@/store/modules/app'
import { dateFormatter } from '@/utils/formatTime'
import { dateFormatter, formatDate } from '@/utils/formatTime'
const userStore = useUserStore()
const message = useMessage() //
@ -438,7 +453,8 @@ async function handleUpdate(row) {
money: row.money,
companyProfit: row.companyProfit,
personProfit: row.personProfit,
isPayoff: row.isPayoffValue
isPayoff: row.isPayoffValue,
applyTime: formatDate(row.applyTime)
})
.then(() => {
message.success('修改成功')

@ -158,16 +158,38 @@
<el-table-column prop="phone" label="联系方式" width="120px" />
<el-table-column prop="signUserName" label="登记人" min-width="90" />
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
<el-table-column
prop="createTime"
label="支出日期"
width="120px"
:formatter="dateFormatter"
/>
<el-table-column prop="createTime" label="支出日期" width="140px">
<template #default="{ row, col }">
<el-date-picker
v-if="row.edit"
v-model="row.createTime"
type="date"
size="small"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 110px"
:clearable="false"
placeholder="选择日期"
/>
<div v-else>{{ dateFormatter(row, col, row.createTime) }}</div>
</template>
</el-table-column>
<el-table-column prop="signSchool" label="成交驾校" min-width="150px" />
<el-table-column prop="signPlace" label="成交场地" min-width="150px" />
<el-table-column prop="signClass" label="成交班型" min-width="150px" />
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px">
<template #default="{ row }">
<el-input-number
v-if="row.edit"
v-model="row.settlementPrice"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
<div v-else>{{ row.settlementPrice }}</div>
</template>
</el-table-column>
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
<el-table-column label="费用备注" width="90px">
@ -200,6 +222,19 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.settlementState == '待结算'"
type="primary"
text
v-hasPermi="['clue:order:settle-update']"
@click="handleUpdate(row)"
>
{{ row.edit ? '保存' : '修改' }}
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
@ -301,6 +336,28 @@ async function getList() {
}
}
async function handleUpdate(row) {
if (row.edit) {
//
await message.confirm('是否确认修改结算数据?')
//
SettleApi.updateSettle({
settlementId: row.settlementId,
settlementPrice: row.settlementPrice,
createTime: row.createTime
})
.then(() => {
message.success('修改成功')
getList()
})
.finally(() => {
row.edit = false
})
} else {
row.edit = true
}
}
function getSummaries(param) {
const { columns } = param
const sums = []

Loading…
Cancel
Save