|
|
@@ -3,8 +3,8 @@
|
|
|
<app-drawer title="新增" v-model:show="show" :width="800" :loading="loading" :refresh="refresh">
|
|
|
<el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules"
|
|
|
@submit.prevent>
|
|
|
- <el-form-item prop="InLoginID" label="转入客户">
|
|
|
- <el-select placeholder="请输入" v-model="formData.InLoginID" :loading="searchLoading"
|
|
|
+ <el-form-item prop="InUserID" label="转入客户">
|
|
|
+ <el-select placeholder="请输入" v-model="formData.InUserID" :loading="searchLoading"
|
|
|
:remote-method="remoteMethod" filterable remote clearable>
|
|
|
<template v-for="(item, index) in userList" :key="index">
|
|
|
<el-option :label="item.customername" :value="item.userid" />
|
|
|
@@ -22,13 +22,13 @@
|
|
|
<el-input-number placeholder="请输入" v-model="formData.TransferPrice" />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="Qty" label="转让数量">
|
|
|
- <el-input-number placeholder="请输入" v-model="formData.Qty" />
|
|
|
+ <el-input-number placeholder="请输入" v-model="formData.Qty" :min="0" :max="enableqty" />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="FreezeDays" label="冻结天数">
|
|
|
<el-input-number placeholder="请输入" v-model="formData.FreezeDays" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="可用数量">
|
|
|
- <span>0</span>
|
|
|
+ <span>{{ enableqty }}</span>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -46,8 +46,10 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { holderTransferApply } from '@/services/api/trade'
|
|
|
import { getUserInfo } from '@/services/api/user'
|
|
|
import { usePosition } from '@/business/position'
|
|
|
+import { useLoginStore } from '@/stores'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
|
|
|
+const loginStore = useLoginStore()
|
|
|
const { positionList } = usePosition(16)
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const loading = shallowRef(false)
|
|
|
@@ -58,27 +60,35 @@ const refresh = shallowRef(false)
|
|
|
const goodsList = computed(() => positionList.value.filter((e) => e.enableqty > 0))
|
|
|
// 选中的商品
|
|
|
const selectedGoods = shallowRef<Model.TradePositionRsp>()
|
|
|
+//可用数量
|
|
|
+const enableqty = computed(() => selectedGoods.value?.enableqty ?? 0)
|
|
|
|
|
|
const formData = reactive<Partial<Proto.HolderTransferDetail>>({
|
|
|
- OutLoginID: 0, // 转出方登录账号,必填
|
|
|
+ OutUserID: loginStore.userId, // 转出方用户ID,必填
|
|
|
BuyOrSell: BuyOrSell.Buy, // 转出方买卖方向,必填
|
|
|
TransferType: 1, // 转让类型-1.协议转让
|
|
|
})
|
|
|
|
|
|
const formRules: FormRules = {
|
|
|
- goodsId: [{
|
|
|
- required: true,
|
|
|
- message: '请选择委托商品'
|
|
|
+ InUserID: [{
|
|
|
+ message: '请输入转入客户',
|
|
|
+ validator: () => !!formData.InUserID
|
|
|
}],
|
|
|
- price: [{
|
|
|
- required: true,
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- if (value) {
|
|
|
- callback()
|
|
|
- } else {
|
|
|
- callback(new Error('请输入撤销价格'))
|
|
|
- }
|
|
|
- }
|
|
|
+ GoodsID: [{
|
|
|
+ message: '请选择转让商品',
|
|
|
+ validator: () => !!selectedGoods.value
|
|
|
+ }],
|
|
|
+ TransferPrice: [{
|
|
|
+ message: '请输入转让价格',
|
|
|
+ validator: () => !!formData.TransferPrice
|
|
|
+ }],
|
|
|
+ Qty: [{
|
|
|
+ message: '请输入转让数量',
|
|
|
+ validator: () => !!formData.Qty
|
|
|
+ }],
|
|
|
+ FreezeDays: [{
|
|
|
+ message: '请输入冻结天数',
|
|
|
+ validator: () => !!formData.FreezeDays
|
|
|
}]
|
|
|
}
|
|
|
|