|
|
@@ -1,48 +1,198 @@
|
|
|
<!-- 现货仓单-现货明细-提货 -->
|
|
|
<template>
|
|
|
- <app-drawer title="充值" v-model:show="show" :loading="loading" :refresh="refresh">
|
|
|
- <el-form ref="formRef" class="el-form--vertical" label-width="100px" label-position="left" :model="formData"
|
|
|
+ <app-drawer title="提货" v-model:show="show" :width="960" :loading="loading" :refresh="refresh">
|
|
|
+ <el-form ref="formRef" class="el-form--horizontal" label-width="120px" :model="formData"
|
|
|
:rules="formRules">
|
|
|
- <el-form-item prop="Amount" label="充值金额">
|
|
|
- <el-input-number placeholder="请输入" v-model="formData.Amount" />
|
|
|
+ <el-form-item label="商品代码/名称">
|
|
|
+ <span>{{selectedRow.wrstandardcode}}/{{ selectedRow.wrstandardname }}</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="凭证">
|
|
|
- <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
|
|
|
+ <el-form-item label="仓库" >
|
|
|
+ <span>{{selectedRow.warehousename}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="库存量">
|
|
|
+ <span>{{selectedRow.qty}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="冻结量">
|
|
|
+ <span>{{selectedRow.freezerqty}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="可用量">
|
|
|
+ <span>{{selectedRow.enableqty}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="OrderQty" label="提货数量">
|
|
|
+ <el-input-number placeholder="请输入提货数量" v-model="orderQty" :max="selectedRow.enableqty" :min="0" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="AppointmentModel" label="提货方式">
|
|
|
+ <el-select v-model="formData.AppointmentModel" :disabled="loading">
|
|
|
+ <el-option :label="item.label" :value="item.value" v-for="(item, index) in getAppointmentModelOutList()"
|
|
|
+ :key="index" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="ContractName" label="联系人">
|
|
|
+ <div class="el-form-item--col">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="formData.ContactName" />
|
|
|
+ <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="addressChange(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-item prop="ContactNum" label="联系方式">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.ContactNum" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="Region" class="el-form-item--row" label="收货地区">
|
|
|
+ <app-region class="el-form-item--col" v-model:province="formData.ProvinceID"
|
|
|
+ v-model:city="formData.CityID" v-model:district="formData.DistrictID" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="el-form-item--row" prop="Address" label="收货地址">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.Address" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="AppointmentRemark" class="el-form-item--row" label="发票信息">
|
|
|
+ <div class="el-form-item--col">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="formData.AppointmentRemark" />
|
|
|
+ <el-dropdown trigger="click" v-if="invoiceList.length">
|
|
|
+ <el-icon :size="20" style="cursor: pointer;">
|
|
|
+ <CirclePlusFilled />
|
|
|
+ </el-icon>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item v-for="(item, index) in invoiceList" :key="index"
|
|
|
+ @click="invoiceChange(item)">
|
|
|
+ {{ [getReceiptTypeName(item.receipttype), item.username].join(' ') }}
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
- <el-button type="primary" @click="formSubmit">提交</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit">提货</el-button>
|
|
|
<el-button @click="onCancel(false)" plain>取消</el-button>
|
|
|
</template>
|
|
|
</app-drawer>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, PropType } from 'vue'
|
|
|
+import { shallowRef, ref, PropType } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
-import { useDoDeposit } from '@/business/bank'
|
|
|
+import { useWrOutInApply } from '@/business/trade'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { getAppointmentModelOutList } from '@/constants/order'
|
|
|
+import { queryUserReceiveInfo, queryWrUserReceiptInfo } from '@/services/api/user'
|
|
|
+import { getReceiptTypeName } from '@/constants/receipt'
|
|
|
+import AppRegion from '@pc/components/base/region/index.vue'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
-import AppUpload from '@pc/components/base/upload/index.vue'
|
|
|
+
|
|
|
+const { dataList: invoiceList } = useRequest(queryWrUserReceiptInfo)
|
|
|
+const { dataList: addressList } = useRequest(queryUserReceiveInfo)
|
|
|
|
|
|
const props = defineProps({
|
|
|
selectedRow: {
|
|
|
- type: Object as PropType<Model.TaAccountsRsp>,
|
|
|
- required: true
|
|
|
+ type: Object as PropType<Model.HoldLBRsp>,
|
|
|
+ required: true,
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const { formData, onSubmit, extendInfo, loading } = useDoDeposit(props.selectedRow.userid)
|
|
|
+const { formData, applySubmit, orderQty, loading } = useWrOutInApply(props.selectedRow)
|
|
|
const show = ref(true)
|
|
|
const refresh = ref(false)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
+const regionName = shallowRef('') // 地区名称
|
|
|
|
|
|
+// 表单验证规则
|
|
|
const formRules: FormRules = {
|
|
|
- Amount: [{ required: true, message: '请输入充值金额' }],
|
|
|
+ orderQty: [{
|
|
|
+ message: '请输入提货数量',
|
|
|
+ validator: () => {
|
|
|
+ return !!orderQty.value
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ ContactName: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入联系人',
|
|
|
+ }],
|
|
|
+ ContactNum: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入联系方式',
|
|
|
+ }],
|
|
|
+ Region: [{
|
|
|
+ message: '请选择收货地区',
|
|
|
+ validator: () => {
|
|
|
+ return !!formData.ProvinceID && !!formData.CityID && !!formData.DistrictID
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ Address: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入收货地址',
|
|
|
+ }],
|
|
|
+ AppointmentRemark: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入发票信息',
|
|
|
+ }],
|
|
|
}
|
|
|
|
|
|
-const onUploadChange = (file: { filePath: string }) => {
|
|
|
- console.log(file.filePath)
|
|
|
- extendInfo.certificate_photo_url = file.filePath
|
|
|
+// 选择地址
|
|
|
+const addressChange = (item: Model.UserReceiveInfoRsp) => {
|
|
|
+ formData.ContactName = item.receivername
|
|
|
+ formData.ContactNum = item.phonenum
|
|
|
+ formData.ProvinceID = item.provinceid
|
|
|
+ formData.CityID = item.cityid
|
|
|
+ formData.DistrictID = item.districtid
|
|
|
+ formData.Address = item.address
|
|
|
+ regionName.value = [item.provincename, item.cityname, item.districtname].join(' ')
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 选择发票
|
|
|
+const invoiceChange = (item: Model.WrUserReceiptInfoRsp) => {
|
|
|
+ formData.AppointmentRemark = ''
|
|
|
+ Object.entries(item).forEach(([key, value]) => {
|
|
|
+ if (value !== '') {
|
|
|
+ switch (key) {
|
|
|
+ case 'receipttype': {
|
|
|
+ formData.AppointmentRemark += '发票类型:' + getReceiptTypeName(Number(value)) + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'username': {
|
|
|
+ formData.AppointmentRemark += '户名:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'address': {
|
|
|
+ formData.AppointmentRemark += '地址:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'contactinfo': {
|
|
|
+ formData.AppointmentRemark += '联系方式:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'idnum': {
|
|
|
+ formData.AppointmentRemark += '身份证号码:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'receiptaccount': {
|
|
|
+ formData.AppointmentRemark += '发票帐号:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'receiptbank': {
|
|
|
+ formData.AppointmentRemark += '发票开户行:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'taxpayerid': {
|
|
|
+ formData.AppointmentRemark += '纳税人识别号:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const onCancel = (isRefresh = false) => {
|
|
|
@@ -50,20 +200,13 @@ const onCancel = (isRefresh = false) => {
|
|
|
refresh.value = isRefresh
|
|
|
}
|
|
|
|
|
|
-const formSubmit = () => {
|
|
|
- formRef.value?.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if (formData.CusBankID) {
|
|
|
- onSubmit().then(() => {
|
|
|
- ElMessage.success('提交成功')
|
|
|
- onCancel(true)
|
|
|
- }).catch((err) => {
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
- })
|
|
|
- } else {
|
|
|
- ElMessage.error('未签约')
|
|
|
- }
|
|
|
- }
|
|
|
+const onSubmit = () => {
|
|
|
+ applySubmit().then(() => {
|
|
|
+ ElMessage.success('提货申请成功')
|
|
|
+ onCancel(true)
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error('提货申请失败:' + err)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
</script>
|