订单数据源增加订单对比功能
This commit is contained in:
@@ -24,6 +24,16 @@
|
||||
@click="openFilterRebill()"
|
||||
>重新计费</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Search"
|
||||
:loading="checkLoading"
|
||||
v-hasPermi="['price:orderBill:list']"
|
||||
@click="handleCheckProducts()"
|
||||
>检测产品</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Document" @click="logDrawerRef.open()">操作记录</el-button>
|
||||
</el-col>
|
||||
@@ -83,6 +93,7 @@
|
||||
</basic-table>
|
||||
<order-source-sync-dialog ref="syncDialogRef" @success="onRebillSuccess" />
|
||||
<order-source-sync-log-drawer ref="logDrawerRef" />
|
||||
<order-bill-product-check-drawer ref="productCheckDrawerRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -92,10 +103,13 @@ import { listOrderBill, listOrderNoOptions, listTrackingNoOptions, listTransferN
|
||||
import { syncOrderSourceSelected } from '@/api/monitor/orderSource'
|
||||
import OrderSourceSyncDialog from '../../monitor/orderSource/components/OrderSourceSyncDialog.vue'
|
||||
import OrderSourceSyncLogDrawer from '../../monitor/orderSource/components/OrderSourceSyncLogDrawer.vue'
|
||||
import OrderBillProductCheckDrawer from './components/OrderBillProductCheckDrawer.vue'
|
||||
|
||||
const tableRef = ref()
|
||||
const syncDialogRef = ref()
|
||||
const logDrawerRef = ref()
|
||||
const productCheckDrawerRef = ref()
|
||||
const checkLoading = ref(false)
|
||||
const batchLoading = ref(false)
|
||||
const tableHeight = ref(480)
|
||||
let tableResizeObserver = null
|
||||
@@ -183,6 +197,16 @@ const searchColumns = [
|
||||
defaultTime: [new Date(2000, 0, 1, 0, 0, 0), new Date(2000, 0, 1, 23, 59, 59)]
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '提货时间',
|
||||
prop: 'pickupDateRange',
|
||||
component: 'datetimerange',
|
||||
colSpan: 2,
|
||||
props: {
|
||||
clearable: true,
|
||||
defaultTime: [new Date(2000, 0, 1, 0, 0, 0), new Date(2000, 0, 1, 23, 59, 59)]
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '订单状态',
|
||||
prop: 'orderStatuses',
|
||||
@@ -205,17 +229,26 @@ const searchColumns = [
|
||||
}
|
||||
]
|
||||
|
||||
function queryList(params) {
|
||||
const { bizDateRange, ...rest } = params
|
||||
function applySearchRanges(params) {
|
||||
const { bizDateRange, pickupDateRange, ...rest } = params
|
||||
const query = { ...rest }
|
||||
const rangeParams = {}
|
||||
if (Array.isArray(bizDateRange) && (bizDateRange[0] || bizDateRange[1])) {
|
||||
query.params = {
|
||||
...(query.params || {}),
|
||||
beginBizDate: bizDateRange[0] || null,
|
||||
endBizDate: bizDateRange[1] || null
|
||||
}
|
||||
rangeParams.beginBizDate = bizDateRange[0] || null
|
||||
rangeParams.endBizDate = bizDateRange[1] || null
|
||||
}
|
||||
return listOrderBill(query)
|
||||
if (Array.isArray(pickupDateRange) && (pickupDateRange[0] || pickupDateRange[1])) {
|
||||
rangeParams.beginPickupDate = pickupDateRange[0] || null
|
||||
rangeParams.endPickupDate = pickupDateRange[1] || null
|
||||
}
|
||||
if (Object.keys(rangeParams).length) {
|
||||
query.params = { ...(query.params || {}), ...rangeParams }
|
||||
}
|
||||
return query
|
||||
}
|
||||
|
||||
function queryList(params) {
|
||||
return listOrderBill(applySearchRanges(params))
|
||||
}
|
||||
|
||||
|
||||
@@ -237,6 +270,29 @@ function buildRebillFilter() {
|
||||
return filter
|
||||
}
|
||||
|
||||
|
||||
function buildCheckQuery() {
|
||||
const q = tableRef.value?.getQueryParams?.() || {}
|
||||
return applySearchRanges(q)
|
||||
}
|
||||
|
||||
function handleCheckProducts() {
|
||||
const q = buildCheckQuery()
|
||||
const hasCustomer = Array.isArray(q.customerCodes) && q.customerCodes.length > 0
|
||||
const begin = q.params?.beginBizDate
|
||||
const end = q.params?.endBizDate
|
||||
if (!hasCustomer || !begin || !end) {
|
||||
ElMessage.warning('检测产品需先选择客户并选择计费时间')
|
||||
return
|
||||
}
|
||||
checkLoading.value = true
|
||||
try {
|
||||
productCheckDrawerRef.value?.open(q)
|
||||
} finally {
|
||||
checkLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openFilterRebill() {
|
||||
const identifiers = currentIdentifiers()
|
||||
if (!identifiers.length) {
|
||||
|
||||
Reference in New Issue
Block a user