|
@@ -1,4 +1,4 @@
|
|
|
-我的交收 - 付款>
|
|
|
|
|
|
|
+<!-- 我的交收 - 付款 -->
|
|
|
<template>
|
|
<template>
|
|
|
<app-view>
|
|
<app-view>
|
|
|
<template #header>
|
|
<template #header>
|
|
@@ -6,22 +6,58 @@
|
|
|
</template>
|
|
</template>
|
|
|
<div class="order-detail__container g-form__container">
|
|
<div class="order-detail__container g-form__container">
|
|
|
<CellGroup inset>
|
|
<CellGroup inset>
|
|
|
- <Cell title="交收单号" :value="selectedRow.deliveryorderID" />
|
|
|
|
|
|
|
+ <Cell title="交收单号" :value="selectedRow.deliveryorderid" />
|
|
|
<Cell title="商品代码/名称" :value="selectedRow.goodscode + '/' + selectedRow.goodsname" />
|
|
<Cell title="商品代码/名称" :value="selectedRow.goodscode + '/' + selectedRow.goodsname" />
|
|
|
- <Cell title="交收重量" :value="selectedRow.deliveryQty + getGoodsUnitName(selectedRow.goodunitid)" />
|
|
|
|
|
- <Cell title="总货款" :value="selectedRow.deliveryTotalAmount" />
|
|
|
|
|
- <Cell title="已付货款" :value="selectedRow.payedAmount" />
|
|
|
|
|
- <Cell title="剩余货款" :value="selectedRow.deliveryTotalAmount - selectedRow.payedAmount - payAmount" />
|
|
|
|
|
|
|
+ <Cell title="交收重量" :value="selectedRow.deliveryqty + getGoodsUnitName(selectedRow.goodunitid)" />
|
|
|
|
|
+ <Cell title="总货款" :value="selectedRow.deliverytotalamount" />
|
|
|
|
|
+ <Cell title="已付货款" :value="selectedRow.payedamount" />
|
|
|
|
|
+ <Cell title="剩余货款"
|
|
|
|
|
+ :value="selectedRow.deliverytotalamount - selectedRow.payedamount - formData.PayAmount" />
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <Form class="pricing-detail__form" ref="formRef" style="padding: 0.2rem; background-color: white;"
|
|
|
|
|
+ @submit="onSubmit">
|
|
|
|
|
+ <Field label="类型">
|
|
|
|
|
+ <template #input>
|
|
|
|
|
+ <RadioGroup v-model="formData.DeliveryPayMode" @click="onDeliveryPayModeChanged">
|
|
|
|
|
+ <Radio :name="2">线下支付</Radio>
|
|
|
|
|
+ <Radio :name="1">余额补货款</Radio>
|
|
|
|
|
+ </RadioGroup>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ <Field name="PayAmount" :rules="formRules.PayAmount">
|
|
|
|
|
+ <template #input>
|
|
|
|
|
+ <div class="goods-listing__stepper">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <Stepper v-model="formData.PayAmount" theme="round" button-size="22" :min="0" />
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ <Field label="上传凭证" v-if="formData.DeliveryPayMode === 2" :rules="formRules.headurl">
|
|
|
|
|
+ <template #input>
|
|
|
|
|
+ <Uploader v-model="fileList" :max-count="1" :max-size="5 * 1024 * 1024" @oversize="onOversize" :after-read="afterRead" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ </Form>
|
|
|
</app-view>
|
|
</app-view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, PropType } from 'vue'
|
|
|
|
|
|
|
+import { ref, shallowRef, PropType, reactive } from 'vue'
|
|
|
import { getGoodsUnitName } from '@/constants/unit'
|
|
import { getGoodsUnitName } from '@/constants/unit'
|
|
|
|
|
+import { showFailToast, showSuccessToast, Uploader, UploaderFileListItem, Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, Checkbox } from 'vant'
|
|
|
|
|
+import { fullloading, dialog } from '@/utils/vant'
|
|
|
|
|
+import axios from 'axios'
|
|
|
|
|
+import service from '@/services'
|
|
|
|
|
|
|
|
-const payAmount = shallowRef(0)
|
|
|
|
|
|
|
+const fileList = ref<UploaderFileListItem[]>([])
|
|
|
|
|
+const formData = reactive<Proto.DeliveryClientOperatorReq>({
|
|
|
|
|
+ DeliveryPayMode: 2, // 默认线下支付
|
|
|
|
|
+ PayAmount: 0,
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
defineProps({
|
|
defineProps({
|
|
|
selectedRow: {
|
|
selectedRow: {
|
|
@@ -30,5 +66,76 @@ defineProps({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// 表单验证规则
|
|
|
|
|
+const formRules: { [key: string]: FieldRule[] } = {
|
|
|
|
|
+ PayAmount: [{
|
|
|
|
|
+ message: '请输入支付金额',
|
|
|
|
|
+ validator: () => {
|
|
|
|
|
+ return !!formData.PayAmount
|
|
|
|
|
+ }
|
|
|
|
|
+ }],
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onDeliveryPayModeChanged = () => {
|
|
|
|
|
+ console.log('')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onOversize = () => {
|
|
|
|
|
+ showFailToast('图片大小不能超过 5Mb')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// eslint-disable-next-line
|
|
|
|
|
+const afterRead = (file: any) => {
|
|
|
|
|
+ const data = new FormData()
|
|
|
|
|
+ data.append('file', file.file)
|
|
|
|
|
+
|
|
|
|
|
+ file.status = 'uploading'
|
|
|
|
|
+ file.message = '上传中...'
|
|
|
|
|
+ axios.post(service.getConfig('uploadUrl'), data).then(res => {
|
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
|
+ file.status = 'success'
|
|
|
|
|
+ file.message = '上传成功'
|
|
|
|
|
+ if (res.data.length) {
|
|
|
|
|
+ // emit('success', res.data[0].filePath)
|
|
|
|
|
+ showSuccessToast('上传成功')
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ file.status = 'failed'
|
|
|
|
|
+ file.message = '上传失败'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 下单
|
|
|
|
|
+const onSubmit = () => {
|
|
|
|
|
+ dialog({
|
|
|
|
|
+ allowHtml: true,
|
|
|
|
|
+ message: `确认要提交吗?\n`,
|
|
|
|
|
+ showCancelButton: true,
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+
|
|
|
|
|
+ // const { marketid = 0, goodsid = 0 } = quote.value ?? {}
|
|
|
|
|
+ // /// 获取对应的市场ID
|
|
|
|
|
+ // formData.MarketID = marketid
|
|
|
|
|
+ // formData.PriceMode = EPriceMode.PRICEMODE_MARKET
|
|
|
|
|
+ // formData.GoodsID = goodsid
|
|
|
|
|
+ // formData.TimevalidType = EValidType.VALIDTYPE_DR
|
|
|
|
|
+ // formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
|
|
|
|
|
+ // formData.BuildType = EBuildType.BUILDTYPE_OPEN
|
|
|
|
|
+ // formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
|
|
|
|
|
+
|
|
|
|
|
+ // fullloading((hideLoading) => {
|
|
|
|
|
+ // formSubmit().then(() => {
|
|
|
|
|
+ // hideLoading('提交成功。', 'success')
|
|
|
|
|
+ // // 刷新订单列表
|
|
|
|
|
+ // getSBYJMyOrders()
|
|
|
|
|
+ // }).catch((err) => {
|
|
|
|
|
+ // hideLoading(err, 'fail')
|
|
|
|
|
+ // })
|
|
|
|
|
+ // })
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|