|
@@ -33,20 +33,23 @@
|
|
|
</section>
|
|
</section>
|
|
|
<section ref="details" class="panel">
|
|
<section ref="details" class="panel">
|
|
|
<h2>差异明细</h2>
|
|
<h2>差异明细</h2>
|
|
|
- <div class="filters"><el-select v-model="channel" size="small" aria-label="筛选渠道"><el-option label="全部渠道" value="" /><el-option v-for="key in channelKeys" :key="key" :label="labels[key]" :value="key" /></el-select>
|
|
|
|
|
|
|
+ <p class="muted">切换分部仅筛选下方明细;汇总、余额和取账仍按当前机构。</p>
|
|
|
|
|
+ <div class="filters">
|
|
|
|
|
+ <label>切换分部 <el-select v-model="branch" size="small" aria-label="切换分部"><el-option label="全部分部" value="" /><el-option v-for="option in branchOptions" :key="option.id" :label="option.name" :value="option.id" /><el-option label="待确认分部" value="unknown" /></el-select></label>
|
|
|
|
|
+ <el-select v-model="channel" size="small" aria-label="筛选渠道"><el-option label="全部渠道" value="" /><el-option v-for="key in channelKeys" :key="key" :label="labels[key]" :value="key" /></el-select>
|
|
|
<el-input v-model.trim="search" size="small" clearable placeholder="搜索订单号或流水号" />
|
|
<el-input v-model.trim="search" size="small" clearable placeholder="搜索订单号或流水号" />
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="scroll"><table><thead><tr><th>商户订单号</th><th>差异类型</th><th>系统渠道 / 金额</th><th>三方渠道 / 金额</th><th>操作</th></tr></thead>
|
|
|
|
|
|
|
+ <div class="scroll"><table><thead><tr><th>商户订单号</th><th>所属分部</th><th>差异类型</th><th>系统渠道 / 金额</th><th>三方渠道 / 金额</th><th>操作</th></tr></thead>
|
|
|
<tbody><tr v-for="(row, index) in pagedDifferences" :key="index">
|
|
<tbody><tr v-for="(row, index) in pagedDifferences" :key="index">
|
|
|
- <td>{{ orderLabel(row) }}</td><td>{{ labels[row.type] }}</td>
|
|
|
|
|
|
|
+ <td>{{ orderLabel(row) }}</td><td>{{ rowBranch(row).name }}</td><td>{{ labels[row.type] }}</td>
|
|
|
<td v-for="side in sides" :key="side.key">{{ sideLabel(entries(row, side.key)) }}</td>
|
|
<td v-for="side in sides" :key="side.key">{{ sideLabel(entries(row, side.key)) }}</td>
|
|
|
<td><el-button type="text" @click="detail = row">详情</el-button></td>
|
|
<td><el-button type="text" @click="detail = row">详情</el-button></td>
|
|
|
- </tr><tr v-if="!filtered.length"><td colspan="5" class="empty">{{ channel || search ? '当前筛选下没有差异记录' : complete ? '没有待核查的差异' : '取账未完成,暂无可展示的差异' }}</td></tr></tbody>
|
|
|
|
|
|
|
+ </tr><tr v-if="!filtered.length"><td colspan="6" class="empty">{{ branch || channel || search ? '当前筛选下没有差异记录' : complete ? '没有待核查的差异' : '取账未完成,暂无可展示的差异' }}</td></tr></tbody>
|
|
|
</table></div>
|
|
</table></div>
|
|
|
<el-pagination v-if="filtered.length > pageSize" :current-page.sync="pageNumber" :page-size="pageSize" :total="filtered.length" layout="prev, pager, next" />
|
|
<el-pagination v-if="filtered.length > pageSize" :current-page.sync="pageNumber" :page-size="pageSize" :total="filtered.length" layout="prev, pager, next" />
|
|
|
</section>
|
|
</section>
|
|
|
<el-dialog v-if="detail" title="差异详情" :visible="true" width="min(720px, 94%)" @close="detail = null">
|
|
<el-dialog v-if="detail" title="差异详情" :visible="true" width="min(720px, 94%)" @close="detail = null">
|
|
|
- <p>{{ tenantName }} · {{ billDate }} · {{ labels[detail.type] }}</p>
|
|
|
|
|
|
|
+ <p>{{ tenantName }} · {{ rowBranch(detail).name }} · {{ billDate }} · {{ labels[detail.type] }}</p>
|
|
|
<div class="columns"><div v-for="side in sides" :key="side.key"><h3>{{ side.title }}</h3>
|
|
<div class="columns"><div v-for="side in sides" :key="side.key"><h3>{{ side.title }}</h3>
|
|
|
<dl v-for="(entry, index) in entries(detail, side.key)" :key="index"><template v-for="field in fields"><dt :key="field.key + 'Label'">{{ field.title }}</dt><dd :key="field.key">{{ entryValue(entry, field.key) }}</dd></template></dl>
|
|
<dl v-for="(entry, index) in entries(detail, side.key)" :key="index"><template v-for="field in fields"><dt :key="field.key + 'Label'">{{ field.title }}</dt><dd :key="field.key">{{ entryValue(entry, field.key) }}</dd></template></dl>
|
|
|
<p v-if="!entries(detail, side.key).length" class="muted">无对应记录</p>
|
|
<p v-if="!entries(detail, side.key).length" class="muted">无对应记录</p>
|
|
@@ -86,7 +89,7 @@ export default {
|
|
|
sides: [{ key: 'system', title: '系统成功订单' }, { key: 'third', title: '第三方交易记录' }],
|
|
sides: [{ key: 'system', title: '系统成功订单' }, { key: 'third', title: '第三方交易记录' }],
|
|
|
fields: [{ key: 'id', title: '记录编号' }, { key: 'orderNo', title: '商户订单号' }, { key: 'tradeNo', title: '交易流水号' }, { key: 'channel', title: '渠道' }, { key: 'time', title: '收款时间' }, { key: 'description', title: '项目说明' }, { key: 'amount', title: '金额' }],
|
|
fields: [{ key: 'id', title: '记录编号' }, { key: 'orderNo', title: '商户订单号' }, { key: 'tradeNo', title: '交易流水号' }, { key: 'channel', title: '渠道' }, { key: 'time', title: '收款时间' }, { key: 'description', title: '项目说明' }, { key: 'amount', title: '金额' }],
|
|
|
billDate: dayjs().subtract(1, 'day').format('YYYY-MM-DD'), tenantId: null, tenantName: '', sequence: 0,
|
|
billDate: dayjs().subtract(1, 'day').format('YYYY-MM-DD'), tenantId: null, tenantName: '', sequence: 0,
|
|
|
- result: null, busy: '', error: '', scopeBlocked: false, channel: '', search: '', detail: null, pageNumber: 1, pageSize: 20
|
|
|
|
|
|
|
+ result: null, busy: '', error: '', scopeBlocked: false, branch: '', channel: '', search: '', detail: null, pageNumber: 1, pageSize: 20
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -97,6 +100,14 @@ export default {
|
|
|
return keys
|
|
return keys
|
|
|
},
|
|
},
|
|
|
canRequest() { return Number(this.tenantId) > 0 && !!this.billDate },
|
|
canRequest() { return Number(this.tenantId) > 0 && !!this.billDate },
|
|
|
|
|
+ branchOptions() {
|
|
|
|
|
+ const branches = new Map()
|
|
|
|
|
+ for (const row of this.result ? this.result.differences : []) {
|
|
|
|
|
+ const branch = this.rowBranch(row)
|
|
|
|
|
+ if (branch.id !== 'unknown') branches.set(branch.id, branch)
|
|
|
|
|
+ }
|
|
|
|
|
+ return Array.from(branches.values()).sort((left, right) => left.name.localeCompare(right.name, 'zh-CN'))
|
|
|
|
|
+ },
|
|
|
complete() { return this.result && this.result.status !== 'INCOMPLETE' },
|
|
complete() { return this.result && this.result.status !== 'INCOMPLETE' },
|
|
|
statusColor() { return { MATCHED: 'success', DIFFERENT: 'danger', INCOMPLETE: 'warning' }[this.result.status] },
|
|
statusColor() { return { MATCHED: 'success', DIFFERENT: 'danger', INCOMPLETE: 'warning' }[this.result.status] },
|
|
|
notice() {
|
|
notice() {
|
|
@@ -107,7 +118,8 @@ export default {
|
|
|
filtered() {
|
|
filtered() {
|
|
|
if (!this.result) return []
|
|
if (!this.result) return []
|
|
|
const term = this.search.toLowerCase()
|
|
const term = this.search.toLowerCase()
|
|
|
- return this.result.differences.filter(row => (!this.channel || this.involves(row, this.channel)) &&
|
|
|
|
|
|
|
+ return this.result.differences.filter(row => (!this.branch || this.rowBranch(row).id === this.branch) &&
|
|
|
|
|
+ (!this.channel || this.involves(row, this.channel)) &&
|
|
|
(!term || this.allEntries(row).some(entry => [entry.orderNo, entry.tradeNo].some(value => String(value || '').toLowerCase().includes(term)))))
|
|
(!term || this.allEntries(row).some(entry => [entry.orderNo, entry.tradeNo].some(value => String(value || '').toLowerCase().includes(term)))))
|
|
|
},
|
|
},
|
|
|
pagedDifferences() {
|
|
pagedDifferences() {
|
|
@@ -117,6 +129,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
billDate() { this.load(false) },
|
|
billDate() { this.load(false) },
|
|
|
|
|
+ branch() { this.pageNumber = 1; this.detail = null },
|
|
|
channel() { this.pageNumber = 1 },
|
|
channel() { this.pageNumber = 1 },
|
|
|
search() { this.pageNumber = 1 }
|
|
search() { this.pageNumber = 1 }
|
|
|
},
|
|
},
|
|
@@ -141,6 +154,14 @@ export default {
|
|
|
return Array.isArray(group) && group.length ? group : row[side] ? [row[side]] : []
|
|
return Array.isArray(group) && group.length ? group : row[side] ? [row[side]] : []
|
|
|
},
|
|
},
|
|
|
allEntries(row) { return this.entries(row, 'system').concat(this.entries(row, 'third')) },
|
|
allEntries(row) { return this.entries(row, 'system').concat(this.entries(row, 'third')) },
|
|
|
|
|
+ rowBranch(row) {
|
|
|
|
|
+ const orders = this.entries(row, 'system')
|
|
|
|
|
+ const first = orders[0]
|
|
|
|
|
+ if (!first || !(Number(first.organId) > 0) || !orders.every(order => String(order.organId) === String(first.organId))) {
|
|
|
|
|
+ return { id: 'unknown', name: '待确认分部' }
|
|
|
|
|
+ }
|
|
|
|
|
+ return { id: String(first.organId), name: first.organName || '分部 ' + first.organId }
|
|
|
|
|
+ },
|
|
|
orderLabel(row) {
|
|
orderLabel(row) {
|
|
|
const orders = [...new Set(this.allEntries(row).map(entry => entry.orderNo).filter(Boolean))]
|
|
const orders = [...new Set(this.allEntries(row).map(entry => entry.orderNo).filter(Boolean))]
|
|
|
return orders.length > 1 ? orders[0] + ' 等 ' + orders.length + ' 个单号' : orders[0] || '—'
|
|
return orders.length > 1 ? orders[0] + ' 等 ' + orders.length + ' 个单号' : orders[0] || '—'
|
|
@@ -152,6 +173,7 @@ export default {
|
|
|
involves(row, channel) { return this.allEntries(row).some(entry => entry.channel === channel) },
|
|
involves(row, channel) { return this.allEntries(row).some(entry => entry.channel === channel) },
|
|
|
showChannel(channel) {
|
|
showChannel(channel) {
|
|
|
this.pageNumber = 1
|
|
this.pageNumber = 1
|
|
|
|
|
+ this.branch = ''
|
|
|
this.channel = channel
|
|
this.channel = channel
|
|
|
this.search = ''
|
|
this.search = ''
|
|
|
this.$refs.details.scrollIntoView({ block: 'start' })
|
|
this.$refs.details.scrollIntoView({ block: 'start' })
|
|
@@ -161,7 +183,7 @@ export default {
|
|
|
this.result = null
|
|
this.result = null
|
|
|
this.detail = null
|
|
this.detail = null
|
|
|
this.pageNumber = 1
|
|
this.pageNumber = 1
|
|
|
- this.channel = this.search = this.error = this.busy = ''
|
|
|
|
|
|
|
+ this.branch = this.channel = this.search = this.error = this.busy = ''
|
|
|
},
|
|
},
|
|
|
blockScope() {
|
|
blockScope() {
|
|
|
this.clearResults()
|
|
this.clearResults()
|