Commit 14952b81 by 张立顺

feat: 按响应值展示权益工单日报字段

1 parent 8cf15424
......@@ -28,6 +28,7 @@ import commonApi from "~/api/api";
import { withTabRefreshInFlight } from "../../../services/tabRefreshService.js";
import { openOrderPromptWithRestrictState } from "~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js";
import { confirmOrderPrompt } from "~/tabIndex/services/orderPromptConfirm.service.js";
import { buildEquityCustomerDailyDisplay } from "../services/customerDailyFields.helpers.js";
function getSceneNameForQuotationItem(item) {
if (!item) return "";
......@@ -466,6 +467,7 @@ Component({
let tempList = this.dealListData(list || []);
// console.log(tempList);
tempList = tempList.map((item) => {
item.customerDailyDisplay = buildEquityCustomerDailyDisplay(item);
const orderTypeMap = {
1: "正常订单",
2: "打折策略",
......
......@@ -126,6 +126,14 @@
<view class="order-label">场景名称</view>
<view class="order-value">{{ item.baseSceneName || item.sceneNameForList || '--' }}</view>
</view>
<view class="order" wx:if="{{ item.customerDailyDisplay.showCustomerTags }}">
<view class="order-label">日报标签</view>
<view class="order-value">{{ item.customerDailyDisplay.customerTagsText }}</view>
</view>
<view class="order" wx:if="{{ item.customerDailyDisplay.showActualDeliveryDate }}">
<view class="order-label">实际交付日期</view>
<view class="order-value">{{ item.customerDailyDisplay.actualDeliveryDate }}</view>
</view>
<view class="order" wx:if="{{ item.approveStatus != null }}">
<view class="order-label">审批状态</view>
<view class="order-value">{{item.approveStatusText}}</view>
......@@ -472,4 +480,4 @@
height="var(--fontSize540);"
includesChildHeight="var(--fontSize1060);"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
\ No newline at end of file
></order-prompt-popup>
......@@ -71,18 +71,29 @@ export function formatEquityDeliveryDateForSubmit(value) {
return date ? `${date} 00:00:00` : ''
}
export function buildEquityCustomerDailyDetail(quotationDetail = {}) {
const owner = quotationDetail?.owner || {}
export function buildEquityCustomerDailyDisplay(source = {}) {
const customerTagLabels = getEquityCustomerTagLabels(source.customerTags)
const actualDeliveryDate = formatEquityDeliveryDateForDisplay(
owner.actualDeliveryDate
source.actualDeliveryDate
)
return {
showCustomerTags: customerTagLabels.length > 0,
showActualDeliveryDate: !!actualDeliveryDate,
customerTagLabels,
customerTagsText: customerTagLabels.join('/'),
actualDeliveryDate
}
}
export function buildEquityCustomerDailyDetail(quotationDetail = {}) {
const display = buildEquityCustomerDailyDisplay(quotationDetail?.owner || {})
return {
customerDailyInfo: {
showCustomerTags: isEquityCustomerTagsVisible(owner.salesType),
showActualDeliveryDate: !!actualDeliveryDate,
actualDeliveryDate
showCustomerTags: display.showCustomerTags,
showActualDeliveryDate: display.showActualDeliveryDate,
actualDeliveryDate: display.actualDeliveryDate
},
customerTagLabels: getEquityCustomerTagLabels(owner.customerTags)
customerTagLabels: display.customerTagLabels
}
}
......
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import {
buildEquityCustomerDailyDisplay,
buildEquityCustomerDailyDetail,
EQUITY_CUSTOMER_TAGS,
formatEquityCustomerTags,
......@@ -130,4 +131,35 @@ describe('quotation customer daily fields', () => {
}
)
})
it('IT-EQ-DAILY-007: builds list and detail visibility from returned values', () => {
assert.deepEqual(
buildEquityCustomerDailyDisplay({
salesType: 2,
customerTags: '3,1,3,5',
actualDeliveryDate: '2026-08-14 09:08:07'
}),
{
showCustomerTags: true,
showActualDeliveryDate: true,
customerTagLabels: ['已触客', '已交付引荐'],
customerTagsText: '已触客/已交付引荐',
actualDeliveryDate: '2026-08-14'
}
)
assert.deepEqual(buildEquityCustomerDailyDisplay({ salesType: 0 }), {
showCustomerTags: false,
showActualDeliveryDate: false,
customerTagLabels: [],
customerTagsText: '',
actualDeliveryDate: ''
})
assert.equal(
buildEquityCustomerDailyDetail({ owner: { salesType: 0 } })
.customerDailyInfo.showCustomerTags,
false
)
})
})
......@@ -72,4 +72,13 @@ describe('quotation customer daily field UI contract', () => {
/buildOwnerPayload\([\s\S]*this\.data\.needChangeList,[\s\S]*this\.data\.orderInfo[\s\S]*\)/
)
})
it('IT-EQ-DAILY-UI-007: quotation list renders normalized response fields conditionally', () => {
const listWxml = read('../pages/carQuotation/index/index.wxml')
assert.match(listWxml, /item\.customerDailyDisplay\.showCustomerTags/)
assert.match(listWxml, /item\.customerDailyDisplay\.customerTagsText/)
assert.match(listWxml, /item\.customerDailyDisplay\.showActualDeliveryDate/)
assert.match(listWxml, /item\.customerDailyDisplay\.actualDeliveryDate/)
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!