|
|
@@ -0,0 +1,165 @@
|
|
|
+<template>
|
|
|
+ <app-view class="purchasetradedetail">
|
|
|
+ <template #header>
|
|
|
+ <app-navbar title="采购详情" />
|
|
|
+ </template>
|
|
|
+ <div v-if="detail" class="purchasetradedetail__container">
|
|
|
+ <table class="purchasetradedetail__container__table" cellspacing="0" cellpadding="0">
|
|
|
+ <tbody>
|
|
|
+ <tr class="row">
|
|
|
+ <td>商品:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.wrstandardname) }}</td>
|
|
|
+ <td>仓库:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.warehousename) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>预售价:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.tradeprice) }}</td>
|
|
|
+ <td>数量:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.tradeqty) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>定金:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.payeddeposit) }}</td>
|
|
|
+ <td>实际价:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.lastprice) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>尾款:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.remainamount) }}</td>
|
|
|
+ <td>优惠:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.discountamount) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>状态:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.orderstatus) }}</td>
|
|
|
+ <td>总货款:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.tradeamount) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>提货方式:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.thjdeliverymodedisplay) }}</td>
|
|
|
+ <td>摘牌时间:</td>
|
|
|
+ <td>{{ formatDate(detail.tradetime, 'YYYY/MM/DD HH:mm:ss') }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>联系人:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.contactname) }}</td>
|
|
|
+ <td>联系方式:</td>
|
|
|
+ <td>{{ handleNoneValue(detail.contactinfo) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>目的地地址:</td>
|
|
|
+ <td colspan="3">{{ handleNoneValue(detail.desaddress) }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>发票信息:</td>
|
|
|
+ <td colspan="3">{{ handleNoneValue(detail.receiptinfo )}}</td>
|
|
|
+ </tr>
|
|
|
+ <tr class="row">
|
|
|
+ <td>合同单号:</td>
|
|
|
+ <td colspan="2">{{ handleNoneValue(detail.wrtradedetailid) }}</td>
|
|
|
+ <Button size="mini">查看合同</Button>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <Empty />
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="purchasetradedetail_buttonview">
|
|
|
+ <Button block round type="primary" v-if="detail?.orderstatus === 1">合同转让</Button>
|
|
|
+ <Button block round type="primary" v-if="detail?.orderstatus === 8">转让撤销</Button>
|
|
|
+ <Button block round type="primary" v-if="detail?.orderstatus === 5" @click="spotConfirmSubmit">确认交收</Button>
|
|
|
+ <div class="pay__buttonview">
|
|
|
+ <Button block round type="primary" v-if="detail?.orderstatus === 3" @click="spotBreachSubmit">违约</Button>
|
|
|
+ <Button block round type="primary" v-if="detail?.orderstatus === 3">支付</Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </app-view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+
|
|
|
+import { shallowRef, computed, ref } from 'vue'
|
|
|
+import { useNavigation } from '@/hooks/navigation'
|
|
|
+import { fullloading, dialog } from '@/utils/vant'
|
|
|
+import { Empty, Button, Toast } from 'vant'
|
|
|
+import { handleNoneValue, formatDate } from "@/filters";
|
|
|
+import { useSpotPresaleBreachOfContractConfirm, useSpotPresaleDeliveryConfirm } from "@/business/trade";
|
|
|
+
|
|
|
+const { route } = useNavigation()
|
|
|
+const item = route.params.item
|
|
|
+const detail = shallowRef<Model.THJPurchaseTradeDetailRsp>()
|
|
|
+const { breachSubmit } = useSpotPresaleBreachOfContractConfirm()
|
|
|
+const { confirmSubmit} = useSpotPresaleDeliveryConfirm()
|
|
|
+const { router } = useNavigation()
|
|
|
+
|
|
|
+if (item) {
|
|
|
+ detail.value = JSON.parse(item.toString())
|
|
|
+}
|
|
|
+
|
|
|
+/// 确认交收
|
|
|
+const spotConfirmSubmit = () => {
|
|
|
+ dialog('确认要交收吗?', {
|
|
|
+ showCancelButton: true
|
|
|
+ }).then(() => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ confirmSubmit(detail.value?.wrtradedetailid ?? 0).then(() => {
|
|
|
+ hideLoading()
|
|
|
+ dialog('确认交收提交成功,请耐心等待审核。').then(() => {
|
|
|
+ router.back()
|
|
|
+ })
|
|
|
+ }).catch((err) => {
|
|
|
+ Toast.fail(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const spotBreachSubmit = () => {
|
|
|
+ dialog('确认要违约吗?', {
|
|
|
+ showCancelButton: true
|
|
|
+ }).then(() => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ const {wrtradedetailid, lastamount, discountamount} = detail.value ?? {}
|
|
|
+ breachSubmit(lastamount, discountamount, wrtradedetailid).then(() => {
|
|
|
+ hideLoading()
|
|
|
+ dialog('违约提交成功,请耐心等待审核。').then(() => {
|
|
|
+ router.back()
|
|
|
+ })
|
|
|
+ }).catch((err) => {
|
|
|
+ Toast.fail(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+
|
|
|
+.purchasetradedetail {
|
|
|
+ &__container {
|
|
|
+ height: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: .10rem .20rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ &_buttonview {
|
|
|
+ .pay__buttonview {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: .1rem;
|
|
|
+
|
|
|
+ .van-button {
|
|
|
+ width: 45%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|