Commit e71f67aa by 张立顺

feat: require customer archive for create order

1 parent 4e329353
...@@ -114,145 +114,45 @@ value="{{ orderObj.remark }}" ...@@ -114,145 +114,45 @@ value="{{ orderObj.remark }}"
border border
valueAlign="right" valueAlign="right"
label="车主姓名" label="车主姓名"
requiredAfter
titleBtn="客户档案" titleBtn="客户档案"
bindtitleClick="showCustomPop" bindtitleClick="showCustomPop"
iconSrc="{{ recordIcon }}" value="{{ orderObj.customer.customerName || '请通过客户档案选择' }}"
labelWidth="var(--fontSize290)" />
required
>
<input
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
maxlength="16"
value="{{ orderObj.customer.customerName }}"
bindinput="input"
data-name="customer.customerName"
disabled="{{ orderObj.orderSource == 5 }}"
always-embed
></input>
</gl-cell>
</view> </view>
<gl-cell <gl-cell
border border
label="客户来源" label="客户来源"
value="{{ filter.getSalesTypeName(Sourcecolumns, orderObj.customer.salesType) }}" value="{{ filter.getSalesTypeName(Sourcecolumns, orderObj.customer.salesType) || '请通过客户档案选择' }}"
bind:click="toSelectCustomerSource"
haveArrow="{{ true }}"
placeholder="点击选择"
requiredAfter
required
valueAlign="right" valueAlign="right"
labelWidth="var(--fontSize140)" />
></gl-cell> <gl-cell border label="性别" value="{{ orderObj.customer.customerSex == 1 ? '男' : (orderObj.customer.customerSex == 2 ? '女' : '请通过客户档案选择') }}" valueAlign="right" labelWidth="var(--fontSize140)" />
<gl-cell border label="性别" valueAlign="right" labelWidth="var(--fontSize140)"> <gl-cell border valueAlign="right" label="手机号" value="{{ orderObj.customer.customerPhone || '请通过客户档案选择' }}" labelWidth="var(--fontSize140)" />
<view class="gender-box">
<view class="block text-center {{ orderObj.customer.customerSex==1?'':'right' }}" />
<view class="male text-center {{ orderObj.customer.customerSex == 1?'active':'' }}" bindtap="changeGender" data-gender="1">男</view>
<view class="woman text-center {{ orderObj.customer.customerSex == 2?'active':'' }}" bindtap="changeGender" data-gender="2">女</view>
</view>
</gl-cell>
<view class="customerPhone" wx:if="{{ !phoneShow }}">
<gl-cell border valueAlign="right" label="手机号" requiredAfter labelWidth="var(--fontSize140)" required>
<input
placeholder="点击输入"
class="input"
type="number"
maxlength="11"
placeholder-class="placeholder-class"
value="{{ orderObj.customer.customerPhone }}"
bindinput="input"
bindblur="phoneBlur"
data-name="customer.customerPhone"
disabled="{{ orderObj.orderSource == 5||orderObj.orderSource == 6 }}"
always-embed
></input>
</gl-cell>
</view>
<gl-cell <gl-cell
required="{{ filter.isIncludesItem(requiredList ,'carBrand') }}"
border border
valueAlign="right" valueAlign="right"
label="选择车型" label="选择车型"
labelWidth="var(--fontSize140)" labelWidth="var(--fontSize140)"
haveArrow value="{{ orderObj.customer.carSeriesName ? orderObj.customer.carBrand + ' - ' + orderObj.customer.carChildsBrandName + ' - ' + orderObj.customer.carSeriesName : '请通过客户档案选择' }}"
requiredAfter />
placeholder="点击选择"
bindclick="showPopup"
data-show-name="carBrandBox"
>
<block wx:if="{{ orderObj.customer.carSeriesName }}">
<view class="between">
{{orderObj.customer.carBrand}}
- {{orderObj.customer.carChildsBrandName}}
- {{orderObj.customer.carSeriesName}}
</view>
</block>
</gl-cell>
<gl-cell <gl-cell
wx:if="{{ orderObj.selectPayType !=0 }}" wx:if="{{ orderObj.selectPayType !=0 }}"
required="{{ filter.isIncludesItem(requiredList ,'standNo') }}" required="{{ filter.isIncludesItem(requiredList ,'standNo') }}"
border border
iconSrc="{{ scanIcon }}"
bindtitleClick="navOcr"
valueAlign="right" valueAlign="right"
label="车架号( VIN )" label="车架号( VIN )"
requiredAfter
data-type="standNo"
labelWidth="var(--fontSize280)" labelWidth="var(--fontSize280)"
> value="{{ orderObj.customer.standNo || '请通过客户档案选择' }}"
<input />
placeholder="点击输入"
class="input"
placeholder-class="placeholder-class"
value="{{ orderObj.customer.standNo }}"
bindinput="input"
data-name="customer.standNo"
maxlength="17"
always-embed
></input>
</gl-cell>
<gl-cell <gl-cell
wx:if="{{ orderObj.selectPayType !=0 }}" wx:if="{{ orderObj.selectPayType !=0 }}"
required="{{ filter.isIncludesItem(requiredList ,'plateNumber') }}" required="{{ filter.isIncludesItem(requiredList ,'plateNumber') }}"
border border
valueAlign="right" valueAlign="right"
iconSrc="{{ scanIcon }}"
bindtitleClick="navOcr"
data-type="plateNumber"
label="车牌号" label="车牌号"
requiredAfter
labelWidth="var(--fontSize240)" labelWidth="var(--fontSize240)"
> value="{{ orderObj.customer.plateNumber || '请通过客户档案选择' }}"
<input />
placeholder="点击输入" <gl-cell wx:if="{{ orderObj.selectPayType !=0 }}" border label="是否体验" value="{{ orderObj.customer.experienceFlag == 'Y' ? '是' : (orderObj.customer.experienceFlag == 'N' ? '否' : '请通过客户档案选择') }}" valueAlign="right" labelWidth="var(--fontSize140)" />
class="input"
placeholder-class="placeholder-class"
value="{{ orderObj.customer.plateNumber }}"
bindinput="input"
data-name="customer.plateNumber"
maxlength="8"
always-embed
></input>
</gl-cell>
<gl-cell wx:if="{{ orderObj.selectPayType !=0 }}" border label="是否体验" valueAlign="right" labelWidth="var(--fontSize140)">
<view class="gender-box">
<view class="block text-center {{ orderObj.customer.experienceFlag=='Y'?'':'right' }}" />
<view
class="male text-center {{ orderObj.customer.experienceFlag == 'Y'?'active':'' }}"
bindtap="changeExperience"
data-experience="Y"
>是</view>
<view
class="woman text-center {{ orderObj.customer.experienceFlag == 'N'?'active':'' }}"
bindtap="changeExperience"
data-experience="N"
>否</view>
</view>
</gl-cell>
</view> </view>
<view class="box" wx:if="{{ orderObj.userId && orderObj.baseSceneCode }}"> <view class="box" wx:if="{{ orderObj.userId && orderObj.baseSceneCode }}">
<block wx:if="{{ orderObj.merchantId }}"> <block wx:if="{{ orderObj.merchantId }}">
......
import { readFileSync } from 'node:fs'
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
const template = readFileSync(
new URL('../createOrder.wxml', import.meta.url),
'utf8'
)
const start = template.indexOf('<view class="customerName">')
const end = template.indexOf(
'\n\t\t<view class="box" wx:if="{{ orderObj.userId && orderObj.baseSceneCode }}">',
start
)
const customerSection = template.slice(start, end)
describe('createOrder customer information template', () => {
it('keeps customer archive as the only manual customer-data entry', () => {
assert.ok(start >= 0)
assert.ok(end > start)
assert.match(customerSection, /bindtitleClick="showCustomPop"/)
assert.match(customerSection, /请通过客户档案选择/)
assert.doesNotMatch(customerSection, /<input/)
assert.doesNotMatch(customerSection, /bind:click="toSelectCustomerSource"/)
assert.doesNotMatch(customerSection, /bindtap="changeGender"/)
assert.doesNotMatch(customerSection, /data-show-name="carBrandBox"/)
assert.doesNotMatch(customerSection, /bindtitleClick="navOcr"/)
assert.doesNotMatch(customerSection, /bindtap="changeExperience"/)
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!