Commit 14952b81 by 张立顺

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

1 parent 8cf15424
...@@ -28,6 +28,7 @@ import commonApi from "~/api/api"; ...@@ -28,6 +28,7 @@ import commonApi from "~/api/api";
import { withTabRefreshInFlight } from "../../../services/tabRefreshService.js"; import { withTabRefreshInFlight } from "../../../services/tabRefreshService.js";
import { openOrderPromptWithRestrictState } from "~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js"; import { openOrderPromptWithRestrictState } from "~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js";
import { confirmOrderPrompt } from "~/tabIndex/services/orderPromptConfirm.service.js"; import { confirmOrderPrompt } from "~/tabIndex/services/orderPromptConfirm.service.js";
import { buildEquityCustomerDailyDisplay } from "../services/customerDailyFields.helpers.js";
function getSceneNameForQuotationItem(item) { function getSceneNameForQuotationItem(item) {
if (!item) return ""; if (!item) return "";
...@@ -466,6 +467,7 @@ Component({ ...@@ -466,6 +467,7 @@ Component({
let tempList = this.dealListData(list || []); let tempList = this.dealListData(list || []);
// console.log(tempList); // console.log(tempList);
tempList = tempList.map((item) => { tempList = tempList.map((item) => {
item.customerDailyDisplay = buildEquityCustomerDailyDisplay(item);
const orderTypeMap = { const orderTypeMap = {
1: "正常订单", 1: "正常订单",
2: "打折策略", 2: "打折策略",
......
...@@ -126,6 +126,14 @@ ...@@ -126,6 +126,14 @@
<view class="order-label">场景名称</view> <view class="order-label">场景名称</view>
<view class="order-value">{{ item.baseSceneName || item.sceneNameForList || '--' }}</view> <view class="order-value">{{ item.baseSceneName || item.sceneNameForList || '--' }}</view>
</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" wx:if="{{ item.approveStatus != null }}">
<view class="order-label">审批状态</view> <view class="order-label">审批状态</view>
<view class="order-value">{{item.approveStatusText}}</view> <view class="order-value">{{item.approveStatusText}}</view>
...@@ -472,4 +480,4 @@ ...@@ -472,4 +480,4 @@
height="var(--fontSize540);" height="var(--fontSize540);"
includesChildHeight="var(--fontSize1060);" includesChildHeight="var(--fontSize1060);"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}" dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
\ No newline at end of file \ No newline at end of file
></order-prompt-popup>
...@@ -71,18 +71,29 @@ export function formatEquityDeliveryDateForSubmit(value) { ...@@ -71,18 +71,29 @@ export function formatEquityDeliveryDateForSubmit(value) {
return date ? `${date} 00:00:00` : '' return date ? `${date} 00:00:00` : ''
} }
export function buildEquityCustomerDailyDetail(quotationDetail = {}) { export function buildEquityCustomerDailyDisplay(source = {}) {
const owner = quotationDetail?.owner || {} const customerTagLabels = getEquityCustomerTagLabels(source.customerTags)
const actualDeliveryDate = formatEquityDeliveryDateForDisplay( const actualDeliveryDate = formatEquityDeliveryDateForDisplay(
owner.actualDeliveryDate source.actualDeliveryDate
) )
return { return {
showCustomerTags: customerTagLabels.length > 0,
showActualDeliveryDate: !!actualDeliveryDate,
customerTagLabels,
customerTagsText: customerTagLabels.join('/'),
actualDeliveryDate
}
}
export function buildEquityCustomerDailyDetail(quotationDetail = {}) {
const display = buildEquityCustomerDailyDisplay(quotationDetail?.owner || {})
return {
customerDailyInfo: { customerDailyInfo: {
showCustomerTags: isEquityCustomerTagsVisible(owner.salesType), showCustomerTags: display.showCustomerTags,
showActualDeliveryDate: !!actualDeliveryDate, showActualDeliveryDate: display.showActualDeliveryDate,
actualDeliveryDate actualDeliveryDate: display.actualDeliveryDate
}, },
customerTagLabels: getEquityCustomerTagLabels(owner.customerTags) customerTagLabels: display.customerTagLabels
} }
} }
......
import { describe, it } from 'node:test' import { describe, it } from 'node:test'
import assert from 'node:assert/strict' import assert from 'node:assert/strict'
import { import {
buildEquityCustomerDailyDisplay,
buildEquityCustomerDailyDetail, buildEquityCustomerDailyDetail,
EQUITY_CUSTOMER_TAGS, EQUITY_CUSTOMER_TAGS,
formatEquityCustomerTags, formatEquityCustomerTags,
...@@ -130,4 +131,35 @@ describe('quotation customer daily fields', () => { ...@@ -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', () => { ...@@ -72,4 +72,13 @@ describe('quotation customer daily field UI contract', () => {
/buildOwnerPayload\([\s\S]*this\.data\.needChangeList,[\s\S]*this\.data\.orderInfo[\s\S]*\)/ /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!