|
|
@@ -34,12 +34,30 @@
|
|
|
{{ formatDecimal(selectedRow.closepl, selectedRow.decimalplace) }}
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="DeliveryLot" label="交收数量">
|
|
|
- <el-input-number placeholder="请输入数量" v-model="formData.DeliveryLot" :precision="0"
|
|
|
+ <el-form-item prop="DeliveryLot" label="交收手数">
|
|
|
+ <el-input-number placeholder="请输入" v-model="formData.DeliveryLot" :precision="0"
|
|
|
:max="selectedRow.enableqty" :min="0" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="DeliveryInfo" label="交收信息">
|
|
|
- <el-input type="textarea" placeholder="请输入交收信息" v-model="formData.DeliveryInfo" />
|
|
|
+ <el-form-item label="交收数量">
|
|
|
+ <span>{{ (formData.DeliveryLot ?? 0) * selectedRow.agreeunit }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="el-form-item--row" prop="DeliveryInfo" label="收货地址">
|
|
|
+ <div class="el-form-item--col">
|
|
|
+ <el-input type="textarea" placeholder="请输入收货地址" :rows="3" v-model="formData.DeliveryInfo" />
|
|
|
+ <el-dropdown trigger="click" v-if="addressList.length">
|
|
|
+ <el-icon :size="20" style="cursor: pointer;">
|
|
|
+ <CirclePlusFilled />
|
|
|
+ </el-icon>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item v-for="(item, index) in addressList" :key="index"
|
|
|
+ @click="onAddressChange(item)">
|
|
|
+ {{ [item.provincename, item.cityname, item.districtname, item.address].join(' ') }}
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -52,7 +70,9 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, PropType } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
import { useOfflineDelivery } from '@/business/trade'
|
|
|
+import { queryUserReceiveInfo } from '@/services/api/user'
|
|
|
import { getBuyOrSellName } from '@/constants/order'
|
|
|
import { formatDecimal } from '@/filters'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
@@ -72,27 +92,37 @@ const show = ref(true)
|
|
|
const refresh = ref(false)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
|
|
|
+const { dataList: addressList } = useRequest(queryUserReceiveInfo)
|
|
|
+
|
|
|
// 表单验证规则
|
|
|
const formRules: FormRules = {
|
|
|
DeliveryLot: [{
|
|
|
- message: '请输入交收数量',
|
|
|
+ required: true,
|
|
|
+ message: '请输入交收手数',
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (value >= props.selectedRow.mindeliverylot) {
|
|
|
callback()
|
|
|
} else {
|
|
|
- callback(new Error('不能小于最小交收数量' + `${props.selectedRow.mindeliverylot}`))
|
|
|
+ callback(new Error('不能小于最小交收手数' + `${props.selectedRow.mindeliverylot}`))
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
DeliveryInfo: [{
|
|
|
required: true,
|
|
|
- message: '请输入交收信息',
|
|
|
+ message: '请输入收货地址',
|
|
|
validator: () => {
|
|
|
return !!formData.DeliveryInfo
|
|
|
}
|
|
|
}],
|
|
|
}
|
|
|
|
|
|
+// 选择地址
|
|
|
+const onAddressChange = (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')
|
|
|
+}
|
|
|
+
|
|
|
const onCancel = (isRefresh = false) => {
|
|
|
show.value = false
|
|
|
refresh.value = isRefresh
|