zhou.xiaoning 2 년 전
부모
커밋
26703decc4

+ 114 - 0
src/packages/sbyj/views/delivery/components/pending/list/index.vue

@@ -0,0 +1,114 @@
+<!-- 水贝亿爵-我的交收-待审核 -->
+<template>
+    <app-view>
+        <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+            :page-count="pageCount" @refresh="run">
+            <div class="g-order-list">
+                <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
+                    <div class="g-order-list__titlebar">
+                        <div class="left">
+                            <h5 :class="item.buyorsell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'"> {{ item.buyorsell
+                                === BuyOrSell.Buy ? '买料交收单: ' : '卖料交收单: ' }}{{ item.deliveryorderid
+    }} </h5>
+                        </div>
+                        <div class="right">
+                            <span>{{ getDeliveryStatusName(item.deliverystatus) }}</span>
+                        </div>
+                    </div>
+                    <div class="g-order-list__content">
+                        <ul>
+                            <li>
+                                <span>商品名称:</span>
+                                <span>{{ item.goodsname }}</span>
+                            </li>
+                            <li>
+                                <span>交收重量:</span>
+                                <span>{{ item.deliveryqty }}{{
+                                    getGoodsUnitName(item.goodunitid) }}</span>
+                            </li>
+                            <li>
+                                <span>升贴水:</span>
+                                <span>{{ item.deliverypremium }}</span>
+                            </li>
+                            <li>
+                                <span>交收价格:</span>
+                                <span>{{ item.deliveryprice }}</span>
+                            </li>
+                            <li>
+                                <span>总货款:</span>
+                                <span>{{ item.deliveryamount }}</span>
+                            </li>
+                            <li>
+                                <span>已付货款:</span>
+                                <span>{{ item.payedamount }}</span>
+                            </li>
+                            <li>
+                                <span>冻结货款:</span>
+                                <span>{{ item.freezeamount }}</span>
+                            </li>
+                            <li>
+                                <span>申请时间:</span>
+                                <span>{{ item.reqtime }}</span>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="g-order-list__btnbar">
+                        <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
+                    </div>
+                </div>
+            </div>
+            <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+                @closed="closeComponent" v-if="componentId" />
+        </app-pull-refresh>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+
+import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent, reactive } from 'vue'
+import { BuyOrSell } from '@/constants/order'
+import { formatDate, formatDecimal, parsePercent, handleNumberValue } from '@/filters'
+import { getGoodsUnitName } from '@/constants/unit'
+import { useComponent } from '@/hooks/component'
+import { useRequest } from '@/hooks/request'
+import { queryMyTradeGoodsDeliveryOfflines } from '@/services/api/order'
+import { Button } from 'vant'
+import { fullloading, dialog } from '@/utils/vant'
+import AppPullRefresh from '@/packages/sbyj/components/base/pull-refresh/index.vue'
+import { getDeliveryStatusName } from '@/constants/order'
+import { deliveryClientOperator } from '@/services/api/trade'
+
+const dataList = shallowRef<Model.MyTradeGoodsDeliveryOfflineRsp[]>([])
+const selectedRow = shallowRef<Model.MyTradeGoodsDeliveryOfflineRsp>()
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('../../../detail/index.vue'))], // 详情
+])
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    pullRefreshRef.value?.refresh()
+})
+
+const { loading, pageIndex, pageCount, run } = useRequest(queryMyTradeGoodsDeliveryOfflines, {
+    params: {
+        pagesize: 20,
+        status: '1',
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
+const showComponent = (componentName: string, row: Model.MyTradeGoodsDeliveryOfflineRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
+
+</script>

+ 115 - 8
src/packages/sbyj/views/delivery/components/processing/components/pay/index.vue

@@ -1,4 +1,4 @@
-我的交收 - 付款>
+<!-- 我的交收 - 付款 -->
 <template>
     <app-view>
         <template #header>
@@ -6,22 +6,58 @@
         </template>
         <div class="order-detail__container g-form__container">
             <CellGroup inset>
-                <Cell title="交收单号" :value="selectedRow.deliveryorderID" />
+                <Cell title="交收单号" :value="selectedRow.deliveryorderid" />
                 <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>
         </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>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType } from 'vue'
+import { ref, shallowRef, PropType, reactive } from 'vue'
 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({
     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>

+ 9 - 9
src/packages/sbyj/views/delivery/detail/index.vue

@@ -7,15 +7,15 @@
             </template>
             <div class="order-detail__container g-form__container">
                 <CellGroup inset>
-                    <Cell title="交收单号" :value="selectedRow.deliveryorderID" />
+                    <Cell title="交收单号" :value="selectedRow.deliveryorderid" />
                     <Cell title="商品代码/名称" :value="selectedRow.goodscode + '/' + selectedRow.goodsname" />
-                    <Cell title="交收重量" :value="selectedRow.deliveryQty + getGoodsUnitName(selectedRow.goodunitid)" />
-                    <Cell title="交收价格" :value="selectedRow.deliveryPrice" />
-                    <Cell title="升贴水" :value="selectedRow.deliveryPremium" />
-                    <Cell title="总货款" :value="selectedRow.deliveryTotalAmount" />
-                    <Cell title="已付货款" :value="selectedRow.payedAmount" />
-                    <Cell title="冻结货款" :value="selectedRow.freezeAmount" />
-                    <Cell title="申请时间" :value="selectedRow.reqTime" />
+                    <Cell title="交收重量" :value="selectedRow.deliveryqty + getGoodsUnitName(selectedRow.goodunitid)" />
+                    <Cell title="交收价格" :value="selectedRow.deliveryprice" />
+                    <Cell title="升贴水" :value="selectedRow.deliverypremium" />
+                    <Cell title="总货款" :value="selectedRow.deliverytotalamount" />
+                    <Cell title="已付货款" :value="selectedRow.payedamount" />
+                    <Cell title="冻结货款" :value="selectedRow.freezeamount" />
+                    <Cell title="申请时间" :value="selectedRow.reqtime" />
                 </CellGroup>
             </div>
             <div class="g-order-list">
@@ -82,7 +82,7 @@ const props = defineProps({
 // 查询订单明细
 const { pageIndex } = useRequest(queryMyDeliveryofflinedetails, {
     params: {
-        deliveryorderid: props.selectedRow.deliveryorderID
+        deliveryorderid: props.selectedRow.deliveryorderid
     },
     onSuccess: (res) => {
         if (pageIndex.value === 1) {

+ 41 - 41
src/types/model/order.d.ts

@@ -1559,69 +1559,69 @@ declare namespace Model {
 
     /* 查询我的交收 回复*/
     interface MyTradeGoodsDeliveryOfflineRsp {
-        /// 交收单号(905+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
-        deliveryorderID: number;
-        /// 申请用户ID
-        userID: number;
-        /// 账户ID
-        accountID: number;
-        /// 商品ID
-        goodsID: number;
-        /// 市场ID
-        marketID: number;
+        /// 交收单号(905+unix秒时间戳(10位)+2位(marketserviceid)+xxxx)
+        deliveryorderid: string;
+        /// 申请用户id
+        userid: number;
+        /// 账户id
+        accountid: number;
+        /// 商品id
+        goodsid: number;
+        /// 市场id
+        marketid: number;
         /// 交收方向 - 0:买 1:卖
-        buyOrSell: number;
+        buyorsell: number;
         /// 交收手数
-        deliveryLot: number;
+        deliverylot: number;
         /// 交收数量 (手数*合约乘数)
-        deliveryQty: number;
+        deliveryqty: number;
         /// 交收信息
-        deliveryInfo: string;
-        /// 对手方UserID
-        matchUserID: number;
-        /// 对手方AccountID
-        matchAccountID: number;
+        deliveryinfo: string;
+        /// 对手方userid
+        matchuserid: number;
+        /// 对手方accountid
+        matchaccountid: number;
         /// 申请时间
-        reqTime: string;
+        reqtime: string;
         /// 申请交易日
-        reqTradeDate: string;
-        /// 线下交收单状态 - 1:待处理 2:交收中 3:已完成 4:申请失败 枚举deliveryOrderStatus
-        orderStatus: number;
+        reqtradedate: string;
+        /// 线下交收单状态 - 1:待处理 2:交收中 3:已完成 4:申请失败 枚举deliveryorderstatus
+        orderstatus: number;
         /// 交收价格
-        deliveryPrice: number;
+        deliveryprice: number;
         /// 交收货款
-        deliveryAmount: number;
+        deliveryamount: number;
         /// 完成时间
-        closeTime: Date;
+        closetime: date;
         /// 完成交易日
-        closeTradeDate: string;
+        closetradedate: string;
         /// 交割手续费
-        deliveryCharge: number;
+        deliverycharge: number;
         /// 手续费收取方式  1:比率  2:固定
-        feeAlgorithm: number;
+        feealgorithm: number;
         /// 会员手续费设置值
-        memberChargeValue: number;
+        memberchargevalue: number;
         /// 交易所手续费设置值
-        exchChargeValue: number;
+        exchchargevalue: number;
         /// 处理状态
-        handleStatus: number;
+        handlestatus: number;
         /// 交收升贴水(每单位)
-        deliveryPremium: number;
+        deliverypremium: number;
         /// 交收总货款 = 交收货款 + 交收升贴水 * 交收数量
-        deliveryTotalAmount: number;
-        /// 交收单状态2(52模式使用) - 1:待审核 2:待确认 3:待付款 4:付款中 5:已完成付款 6:处理中 20:交收完成 21:审核拒绝 22:确认过期 23:付款过期 24:财务撤销 -- 枚举deliveryStatus
-        deliveryStatus: number;
+        deliverytotalamount: number;
+        /// 交收单状态2(52模式使用) - 1:待审核 2:待确认 3:待付款 4:付款中 5:已完成付款 6:处理中 20:交收完成 21:审核拒绝 22:确认过期 23:付款过期 24:财务撤销 -- 枚举deliverystatus
+        deliverystatus: number;
         /// 确认截止时间(买交收)
-        toConfirmTime: Date;
+        toconfirmtime: date;
         /// 付款截止时间(买交收)
-        toPayTime: Date;
+        topaytime: date;
         /// 已付货款
-        payedAmount: number;
+        payedamount: number;
         /// 冻结货款
-        freezeAmount: number;
+        freezeamount: number;
         goodscode: string;//商品代码(内部)
         goodsname: string;//商品名称
-        goodunitid: number;//报价单位ID
+        goodunitid: number;//报价单位id
         agreeunit: number;//合约单位
         decimalplace: number;//报价小数位
     }
@@ -1635,7 +1635,7 @@ declare namespace Model {
         /// 用户id
         userid?: number
         /// 交收单号(905+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
-        deliveryorderid: number
+        deliveryorderid: string
     }
 
     /* 查询我的交收-订单明细 回复*/

+ 2 - 2
src/types/proto/trade.d.ts

@@ -689,8 +689,8 @@ declare global {
             AccountID?: number; // 交易账号,必填
             DeliveryOrderID?: number; // 交收单号,必填
             OperateType?: number; // 操作类型,必填1:客户确认2:客户付款
-            DeliveryPayMode?: number; // 付款方式,必填1:线上支付2:线下支付
-            PayAmount?: number; // 付款金额,必填
+            DeliveryPayMode: number; // 付款方式,必填1:线上支付2:线下支付
+            PayAmount: number; // 付款金额,必填
             PayAttr?: PayAttrs[]; // 付款凭证,必填
             OperatorID?: number; // 操作人ID
             OperatorAccount?: string; // 操作人账号