zhou.xiaoning 2 years ago
parent
commit
790140c0df

+ 1 - 1
public/config/appconfig.json

@@ -1,5 +1,5 @@
 {
   "version": "1.0.0",
   "versionCode": "100000",
-  "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
+  "apiUrl": "http://192.168.31.171:8080/cfg?key=test_171"
 }

+ 34 - 0
src/packages/sbyj/views/delivery/components/processing/components/pay/index.vue

@@ -0,0 +1,34 @@
+我的交收 - 付款>
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="交收付款" />
+        </template>
+        <div class="order-detail__container g-form__container">
+            <CellGroup inset>
+                <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" />
+            </CellGroup>
+        </div>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { getGoodsUnitName } from '@/constants/unit'
+
+const payAmount = shallowRef(0)
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.MyTradeGoodsDeliveryOfflineRsp>,
+        required: true,
+    }
+})
+
+
+</script>

+ 80 - 57
src/packages/sbyj/views/delivery/components/processing/list/index.vue

@@ -2,72 +2,73 @@
 <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> {{ item.buyOrSell === BuyOrSell.Buy ? '买料交收单:' : '卖料交收单:' }}{{ item.deliveryorderID
-                        }} </h5>
+            :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="right">
-                        <span >{{ getDeliveryStatusName(item.deliveryStatus) }}</span>
+                    <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>
+                        <Button size="small" round>货款明细</Button>
+                        <Button size="small" v-if="item.orderStatus === 2" @click="deliveryCommit(item)" round>确认</Button>
+                        <Button size="small" v-if="[3, 4].includes(item.orderStatus)" round>付款</Button>
                     </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>
-                    <Button size="small" round>货款明细</Button>
-                    <Button size="small" round>确认</Button>
-                    <Button size="small" round>付款</Button>
                 </div>
             </div>
-        </div>
-        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
-            v-if="componentId" />
-            </app-pull-refresh>
+            <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 } from 'vue'
+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'
@@ -75,13 +76,16 @@ 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 formData = reactive<Proto.DeliveryClientOperatorReq>({})
 
 const componentMap = new Map<string, unknown>([
     ['detail', defineAsyncComponent(() => import('../../../detail/index.vue'))], // 详情
@@ -111,4 +115,23 @@ const showComponent = (componentName: string, row: Model.MyTradeGoodsDeliveryOff
     openComponent(componentName)
 }
 
+// 交收确认
+const deliveryCommit = (item: Model.MyTradeGoodsDeliveryOfflineRsp) => {
+    dialog({
+        message: '是否追加未付转让定金?',
+        showCancelButton: true,
+    }).then(() => {
+        formData.DeliveryOrderID = item.deliveryorderID
+        formData.OperateType = 1 // 操作类型,必填1:客户确认2:客户付款
+        fullloading((hideLoading) => {
+            deliveryClientOperator({ data: formData }).then(() => {
+                hideLoading('提交成功', 'success')
+                // closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
+
 </script>

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

@@ -0,0 +1,108 @@
+水贝亿爵 - 我的交收 - 详情
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="交收详情" @back="closed" />
+            </template>
+            <div class="order-detail__container g-form__container">
+                <CellGroup inset>
+                    <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" />
+                </CellGroup>
+            </div>
+            <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.tradeid
+    }} </h5>
+                        </div>
+                    </div>
+                    <div class="g-order-list__content">
+                        <ul>
+                            <li>
+                                <span>订单重量:</span>
+                                <span>{{ item.holdqty }}{{ getGoodsUnitName(selectedRow.goodunitid)
+                                }}</span>
+                            </li>
+                            <li>
+                                <span>交收重量:</span>
+                                <span>{{ item.deliveryqty }}{{
+                                    getGoodsUnitName(selectedRow.goodunitid) }}</span>
+                            </li>
+                            <li>
+                                <span>交收价格:</span>
+                                <span>{{ formatDecimal(item.deliveryprice) }}</span>
+                            </li>
+                            <li>
+                                <span>交收货款:</span>
+                                <span>{{ item.deliveryamount }}</span>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import { formatDate, formatDecimal, parsePercent } from '@/filters'
+import AppModal from '@/components/base/modal/index.vue'
+import { getBuyOrSellName, getWrTradeTypeName } from '@/constants/order'
+import { getGoodsUnitName } from '@/constants/unit'
+import { useRequest } from '@/hooks/request'
+import { queryMyDeliveryofflinedetails } from '@/services/api/order'
+import { propsToAttrMap } from '@vue/shared'
+import { BuyOrSell } from '@/constants/order'
+
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const dataList = shallowRef<Model.MyDeliveryofflinedetailRsp[]>([]) // 订单明细
+const error = shallowRef(false)
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.MyTradeGoodsDeliveryOfflineRsp>,
+        required: true,
+    }
+})
+
+// 查询订单明细
+const { pageIndex } = useRequest(queryMyDeliveryofflinedetails, {
+    params: {
+        deliveryorderid: props.selectedRow.deliveryorderID
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 6 - 5
src/packages/sbyj/views/order/list/components/supplement-deposit/index.vue

@@ -67,7 +67,7 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
 const orderType = shallowRef(1) // 1-补充 2-退返
 
 // 表单验证规则
-const formRules:{ [key: string]: FieldRule[] } = {
+const formRules: { [key: string]: FieldRule[] } = {
     RestockDeposit: [{
         message: '请输入定金额',
         validator: (val) => {
@@ -95,10 +95,10 @@ const onSubmit = () => {
     const { tHDetailEx } = props.selectedRow ?? {}
 
     if (orderType.value === 1) {
-        // 补充
-
         supplementDepositReq.TradeID = tHDetailEx.tradeID
         supplementDepositReq.BuyOrSell = tHDetailEx.buyOrSell
+        supplementDepositReq.MarketID = tHDetailEx.marketID
+        // 补充
         fullloading((hideLoading) => {
             supplementDeposit({ data: supplementDepositReq }).then(() => {
                 hideLoading('提交成功', 'success')
@@ -110,10 +110,11 @@ const onSubmit = () => {
     }
 
     if (orderType.value === 2) {
-        // 退返
-
         refundedDepositReq.TradeID = tHDetailEx.tradeID
         refundedDepositReq.BuyOrSell = tHDetailEx.buyOrSell
+        refundedDepositReq.MarketID = tHDetailEx.marketID
+
+        // 退返
         fullloading((hideLoading) => {
             refundedDeposit({ data: refundedDepositReq }).then(() => {
                 hideLoading('提交成功', 'success')

+ 10 - 6
src/packages/sbyj/views/order/list/index.vue

@@ -7,21 +7,25 @@
             <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
                 <div class="g-order-list__titlebar">
                     <div class="left">
-                        <h5> {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料订单:' : '卖料订单:' }}{{ item.tHDetailEx.tradeID }} </h5>
+                        <h5> {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料订单:' : '卖料订单:' }}{{ item.tHDetailEx.tradeID
+                        }} </h5>
                     </div>
                     <div class="right">
-                        <span :class="item.tHDetailEx.depositRate >= 0.4 ? 'g-price-up' : ''">{{ parsePercent(item.tHDetailEx.depositRate) }}</span>
+                        <span :class="item.tHDetailEx.depositRate >= 0.4 ? 'g-price-up' : ''">{{
+                            parsePercent(item.tHDetailEx.depositRate) }}</span>
                     </div>
                 </div>
                 <div class="g-order-list__content">
                     <ul>
                         <li>
                             <span>订单重量:</span>
-                            <span>{{ item.tHDetailEx.holderQty * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID) }}</span>
+                            <span>{{ item.tHDetailEx.holderQty * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID)
+                            }}</span>
                         </li>
                         <li>
                             <span>可用重量:</span>
-                            <span>{{ (item.tHDetailEx.holderQty - item.tHDetailEx.freezeQty ) * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID) }}</span>
+                            <span>{{ (item.tHDetailEx.holderQty - item.tHDetailEx.freezeQty) * item.agreeUnit }}{{
+                                getGoodsUnitName(item.goodsUnitID) }}</span>
                         </li>
                         <li>
                             <span>订单金额:</span>
@@ -75,9 +79,9 @@ import { Button } from 'vant'
 
 const dataList = shallowRef<Model.SBYJMyOrderRsp[]>([])
 const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
-    const error = shallowRef(false)
+const error = shallowRef(false)
 
-    const componentMap = new Map<string, unknown>([
+const componentMap = new Map<string, unknown>([
     ['detail', defineAsyncComponent(() => import('../detail/index.vue'))], // 详情
     ['supplement', defineAsyncComponent(() => import('./components/supplement-deposit/index.vue'))], // 补充
     ['delivery', defineAsyncComponent(() => import('./components/market-order-delivery/index.vue'))], // 交收

+ 1 - 0
src/services/api/trade/index.ts

@@ -329,6 +329,7 @@ export function deliveryClientOperator(config: RequestConfig<Partial<Proto.Deliv
             AccountID: accountStore.accountId,
             ClientSerialNo: v4(),
             UserID: loginStore.userId,
+            ClientType: ClientType.Web,
             ...config.data
         },
         requestCode: 'DeliveryClientOperatorReq',