|
|
@@ -41,6 +41,7 @@
|
|
|
</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>
|
|
|
@@ -53,10 +54,12 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { Button } from 'vant'
|
|
|
+import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradeGoodsDeliveryOfflines } from '@/services/api/transfer'
|
|
|
+import { offlineDeliveryApplyCancelOrder } from '@/services/api/trade'
|
|
|
import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
@@ -91,4 +94,28 @@ const showComponent = (componentName: string, row: Model.MineTradeGoodsDeliveryO
|
|
|
selectedRow.value = row
|
|
|
openComponent(componentName)
|
|
|
}
|
|
|
+
|
|
|
+const onCancel = (row: Model.MineTradeGoodsDeliveryOfflinesRsp) => {
|
|
|
+ dialog({
|
|
|
+ message: '确认要撤销吗?',
|
|
|
+ showCancelButton: true,
|
|
|
+ }).then(() => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ offlineDeliveryApplyCancelOrder({
|
|
|
+ data: {
|
|
|
+ Header: {
|
|
|
+ MarketID: row.marketid,
|
|
|
+ GoodsID: row.goodsid
|
|
|
+ },
|
|
|
+ DeliveryOrderID: row.deliveryorderid
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ hideLoading('撤销成功', 'success')
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
+ }).catch((err) => {
|
|
|
+ hideLoading(err, 'fail')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|