|
@@ -25,17 +25,20 @@
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
<CellGroup title="交收信息" inset>
|
|
<CellGroup title="交收信息" inset>
|
|
|
<Cell title="交收对手方" :value="selectedRow.matchname" />
|
|
<Cell title="交收对手方" :value="selectedRow.matchname" />
|
|
|
- <Field name="DeliveryLot" type="digit" :rules="formRules.DeliveryLot" label="交收数量">
|
|
|
|
|
|
|
+ <Field name="DeliveryLot" type="digit" :rules="formRules.DeliveryLot" label="交收手数">
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<Stepper v-model="formData.DeliveryLot" theme="round" button-size="22" :min="0"
|
|
<Stepper v-model="formData.DeliveryLot" theme="round" button-size="22" :min="0"
|
|
|
:max="selectedRow.enableqty" :auto-fixed="false" integer />
|
|
:max="selectedRow.enableqty" :auto-fixed="false" integer />
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
|
|
+ <Cell title="交收数量" :value="(formData.DeliveryLot ?? 0) * selectedRow.agreeunit" />
|
|
|
<Field name="DeliveryInfo" v-model="formData.DeliveryInfo" type="textarea" autosize clearable
|
|
<Field name="DeliveryInfo" v-model="formData.DeliveryInfo" type="textarea" autosize clearable
|
|
|
- :rules="formRules.DeliveryInfo" maxlength="50" label="交收信息" placeholder="请输入交收信息">
|
|
|
|
|
|
|
+ :rules="formRules.DeliveryInfo" maxlength="50" label="收货地址" placeholder="必填" right-icon="add-o"
|
|
|
|
|
+ @click-right-icon="showContact = true">
|
|
|
</Field>
|
|
</Field>
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
</Form>
|
|
</Form>
|
|
|
|
|
+ <app-contact v-model:show="showContact" @change="contactChange" />
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<Button block square type="danger" @click="formRef?.submit">提交</Button>
|
|
<Button block square type="danger" @click="formRef?.submit">提交</Button>
|
|
|
</template>
|
|
</template>
|
|
@@ -52,6 +55,8 @@ import { formatDecimal } from '@/filters'
|
|
|
import { useOfflineDelivery } from '@/business/trade'
|
|
import { useOfflineDelivery } from '@/business/trade'
|
|
|
import { dialog, fullloading } from '@/utils/vant'
|
|
import { dialog, fullloading } from '@/utils/vant'
|
|
|
|
|
|
|
|
|
|
+import AppContact from '@mobile/components/modules/contact/index.vue'
|
|
|
|
|
+
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
selectedRow: {
|
|
selectedRow: {
|
|
|
type: Object as PropType<Model.TradePositionRsp & {
|
|
type: Object as PropType<Model.TradePositionRsp & {
|
|
@@ -66,28 +71,37 @@ const showModal = shallowRef(true)
|
|
|
// 是否刷新父组件数据
|
|
// 是否刷新父组件数据
|
|
|
const refresh = shallowRef(false)
|
|
const refresh = shallowRef(false)
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
|
|
+const showContact = shallowRef(false) // 显示联系人选择列表
|
|
|
const { formSubmit, formData } = useOfflineDelivery()
|
|
const { formSubmit, formData } = useOfflineDelivery()
|
|
|
|
|
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
|
DeliveryLot: [{
|
|
DeliveryLot: [{
|
|
|
- message: '请输入交收数量',
|
|
|
|
|
|
|
+ message: '请输入交收手数',
|
|
|
validator: (val) => {
|
|
validator: (val) => {
|
|
|
- if (val <= props.selectedRow.mindeliverylot) {
|
|
|
|
|
|
|
+ if (val >= props.selectedRow.mindeliverylot) {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
- return '不能小于最小交收数量' + `${props.selectedRow.mindeliverylot}`
|
|
|
|
|
|
|
+ return '不能小于最小交收手数' + `${props.selectedRow.mindeliverylot}`
|
|
|
}
|
|
}
|
|
|
}],
|
|
}],
|
|
|
DeliveryInfo: [{
|
|
DeliveryInfo: [{
|
|
|
required: true,
|
|
required: true,
|
|
|
- message: '请输入交收信息',
|
|
|
|
|
|
|
+ message: '请输入收货地址',
|
|
|
validator: () => {
|
|
validator: () => {
|
|
|
return !!formData.DeliveryInfo
|
|
return !!formData.DeliveryInfo
|
|
|
}
|
|
}
|
|
|
}],
|
|
}],
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 选择联系信息
|
|
|
|
|
+const contactChange = (item: Model.UserReceiveInfoRsp) => {
|
|
|
|
|
+ const contact = `${item.receivername} ${item.phonenum}`
|
|
|
|
|
+ const address = `${item.provincename} ${item.cityname} ${item.districtname} ${item.address}`
|
|
|
|
|
+ formData.DeliveryInfo = [contact, address].join('\n')
|
|
|
|
|
+ formRef.value?.validate('Region')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const onDeliverySumit = () => {
|
|
const onDeliverySumit = () => {
|
|
|
dialog({
|
|
dialog({
|
|
|
message: '确认要交收吗?',
|
|
message: '确认要交收吗?',
|
|
@@ -114,7 +128,11 @@ const onDeliverySumit = () => {
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
|
const closed = (isRefresh = false) => {
|
|
const closed = (isRefresh = false) => {
|
|
|
refresh.value = isRefresh
|
|
refresh.value = isRefresh
|
|
|
- showModal.value = false
|
|
|
|
|
|
|
+ if (showContact.value) {
|
|
|
|
|
+ showContact.value = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showModal.value = false
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 暴露组件属性给父组件调用
|
|
// 暴露组件属性给父组件调用
|