li.shaoyi 1 år sedan
förälder
incheckning
bb7a974331

+ 2 - 2
src/packages/sbyj/router/index.ts

@@ -214,7 +214,7 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: '',
         name: 'delivery-list',
-        component: () => import('../views/delivery/list/index.vue'),
+        component: () => import('../views/delivery/index.vue'),
         props: {
           title: '交料订单',
           buyorsell: 1
@@ -229,7 +229,7 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: '',
         name: 'pickup-list',
-        component: () => import('../views/delivery/list/index.vue'),
+        component: () => import('../views/delivery/index.vue'),
         props: {
           title: '提料订单',
           buyorsell: 0

+ 1 - 1
src/packages/sbyj/views/delivery/components/completed/list/index.vue → src/packages/sbyj/views/delivery/completed/list/index.vue

@@ -80,7 +80,7 @@ const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 
 const componentMap = new Map<string, unknown>([
-    ['detail', defineAsyncComponent(() => import('../../../detail/index.vue'))], // 详情
+    ['detail', defineAsyncComponent(() => import('../../components/detail/index.vue'))], // 详情
     ['paydetail', defineAsyncComponent(() => import('../../processing/components/pay-detail/index.vue'))], // 货款明细
 ])
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {

+ 0 - 0
src/packages/sbyj/views/delivery/detail/file-list/index.vue → src/packages/sbyj/views/delivery/components/detail/file-list/index.vue


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


+ 0 - 0
src/packages/sbyj/views/delivery/detail/order-list/index.vue → src/packages/sbyj/views/delivery/components/detail/order-list/index.vue


+ 3 - 3
src/packages/sbyj/views/delivery/list/index.vue → src/packages/sbyj/views/delivery/index.vue

@@ -32,8 +32,8 @@ defineProps({
 const active = shallowRef(0)
 
 const componentMap = new Map<string, unknown>([
-    ['pending', defineAsyncComponent(() => import('../components/pending/list/index.vue'))], // 待审核
-    ['processing', defineAsyncComponent(() => import('../components/processing/list/index.vue'))], // 进行中
-    ['completed', defineAsyncComponent(() => import('../components/completed/list/index.vue'))], // 已完成
+    ['pending', defineAsyncComponent(() => import('./pending/list/index.vue'))], // 待审核
+    ['processing', defineAsyncComponent(() => import('./processing/list/index.vue'))], // 进行中
+    ['completed', defineAsyncComponent(() => import('./completed/list/index.vue'))], // 已完成
 ])
 </script>

+ 32 - 4
src/packages/sbyj/views/delivery/components/pending/list/index.vue → src/packages/sbyj/views/delivery/pending/list/index.vue

@@ -41,23 +41,26 @@
                     </ul>
                 </div>
                 <div class="g-order-list__btnbar">
+                    <Button size="small" @click="onCancel(item)" round>撤单</Button>
                     <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" />
+        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+            @closed="closeComponent" v-if="componentId" />
     </app-pull-refresh>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
-import { formatDate, formatDecimal } from '@/filters'
+import { fullloading, dialog } from '@/utils/vant'
+import { formatDate, formatDecimal, handleRequestBigNumber } from '@/filters'
 import { BuyOrSell } from '@/constants/order'
 import { getGoodsUnitName } from '@/constants/unit'
 import { useComponent } from '@/hooks/component'
 import { useRequest } from '@/hooks/request'
 import { queryMyTradeGoodsDeliveryOfflines } from '@/services/api/order'
+import { deliveryClientOperator } from '@/services/api/trade'
 import { Button } from 'vant'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
@@ -71,7 +74,7 @@ const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 
 const componentMap = new Map<string, unknown>([
-    ['detail', defineAsyncComponent(() => import('../../../detail/index.vue'))], // 详情
+    ['detail', defineAsyncComponent(() => import('../../components/detail/index.vue'))], // 详情
 ])
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     pullRefreshRef.value?.refresh()
@@ -103,4 +106,29 @@ const showComponent = (componentName: string, row: Model.MyTradeGoodsDeliveryOff
     selectedRow.value = row
     openComponent(componentName)
 }
+
+// 撤单
+const onCancel = (item: Model.MyTradeGoodsDeliveryOfflineRsp) => {
+    dialog({
+        message: '是否确认撤单?',
+        showCancelButton: true,
+    }).then(() => {
+        fullloading((hideLoading) => {
+            deliveryClientOperator({
+                data: {
+                    Header: {
+                        MarketID: item.marketid
+                    },
+                    DeliveryOrderID: handleRequestBigNumber(item.deliveryorderid),
+                    OperateType: 3
+                }
+            }).then(() => {
+                hideLoading('提交成功', 'success')
+                pullRefreshRef.value?.refresh()
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    })
+}
 </script>

+ 0 - 0
src/packages/sbyj/views/delivery/components/processing/components/files/index.vue → src/packages/sbyj/views/delivery/processing/components/files/index.vue


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


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


+ 1 - 1
src/packages/sbyj/views/delivery/components/processing/list/index.vue → src/packages/sbyj/views/delivery/processing/list/index.vue

@@ -90,7 +90,7 @@ const pullRefreshRef = shallowRef()
 const formData = reactive<Proto.DeliveryClientOperatorReq>({ PayAmount: 0, DeliveryPayMode: 2 })
 
 const componentMap = new Map<string, unknown>([
-    ['detail', defineAsyncComponent(() => import('../../../detail/index.vue'))], // 详情
+    ['detail', defineAsyncComponent(() => import('../../components/detail/index.vue'))], // 详情
     ['paydetail', defineAsyncComponent(() => import('../components/pay-detail/index.vue'))], // 货款明细
     ['pay', defineAsyncComponent(() => import('../components/pay/index.vue'))], // 付款
 ])

+ 1 - 1
src/packages/sbyj/views/order/history/components/detail/index.vue

@@ -34,7 +34,7 @@ import { BuyOrSell } from '@/constants/order'
 import AppModal from '@/components/base/modal/index.vue'
 import { getGoodsUnitName } from '@/constants/unit'
 
-const props = defineProps({
+defineProps({
     selectedRow: {
         type: Object as PropType<Model.TradeHolderDetailExRsp>,
         required: true,

+ 38 - 11
src/packages/sbyj/views/order/list/components/market-order-delivery/index.vue

@@ -27,6 +27,9 @@
                         </template>
                     </Field>
                 </CellGroup>
+                <CellGroup inset>
+                    <Cell title="交易时间" :value="`${param326} - ${param327}`" />
+                </CellGroup>
             </Form>
             <template #footer>
                 <div class="g-form__footer">
@@ -40,12 +43,15 @@
 <script lang="ts" setup>
 import { shallowRef, PropType, onMounted, computed, reactive } from 'vue'
 import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
-import { BuyOrSell } from '@/constants/order'
 import { fullloading } from '@/utils/vant'
 import { handleRequestBigNumber, parsePercent, formatDecimal } from '@/filters'
-import AppModal from '@/components/base/modal/index.vue'
-import { marketOrderDeliveryApply } from '@/services/api/trade'
+import { BuyOrSell } from '@/constants/order'
 import { getGoodsUnitName } from '@/constants/unit'
+import { getServerTime } from '@/services/api/common'
+import { marketOrderDeliveryApply } from '@/services/api/trade'
+import { useUserStore } from '@/stores'
+import AppModal from '@/components/base/modal/index.vue'
+import moment from 'moment'
 
 const props = defineProps({
     selectedRow: {
@@ -54,6 +60,10 @@ const props = defineProps({
     }
 })
 
+const userStore = useUserStore()
+const param326 = userStore.getSystemParamValue('326')
+const param327 = userStore.getSystemParamValue('327')
+
 const formData = reactive<Proto.MarketOrderDeliveryApplyReq>({ HoldDetails: [] })
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
@@ -106,14 +116,31 @@ const onSubmit = () => {
         DeliveryQty: orderQty.value // 交收接口要的是数量不是手数,所以不用除以agreeunit
     }]
 
-    fullloading((hideLoading) => {
-        marketOrderDeliveryApply({
-            data: formData
-        }).then(() => {
-            hideLoading('提交成功', 'success')
-            closed(true)
-        }).catch((err) => {
-            hideLoading(err, 'fail')
+    fullloading(async (hideLoading) => {
+        getServerTime().then((res) => {
+            if (param326 && param327) {
+                const n = moment(res.data)
+                const s = moment(param326, 'HH:mm')
+                const e = moment(param327, 'HH:mm')
+
+                // 任务 #6055
+                if (n.isSameOrAfter(s) && n.isBefore(e)) {
+                    marketOrderDeliveryApply({
+                        data: formData
+                    }).then(() => {
+                        hideLoading('提交成功', 'success')
+                        closed(true)
+                    }).catch((err) => {
+                        hideLoading(err, 'fail')
+                    })
+                } else {
+                    hideLoading('提交失败:不在交易时间内', 'fail')
+                }
+            } else {
+                hideLoading('交易时间错误,请联系管理员', 'fail')
+            }
+        }).catch(() => {
+            hideLoading('服务器时间错误', 'fail')
         })
     })
 }