|
|
@@ -6,19 +6,21 @@
|
|
|
<div v-if="detail" class="order-detail__container g-form__container">
|
|
|
<CellGroup title="采购信息">
|
|
|
<Cell title="商品" :value="detail.wrstandardname" />
|
|
|
- <Cell title="参考价" :value="detail.tradeprice.toFixed(2)" />
|
|
|
- <Cell title="数量" :value="detail.tradeqty" />
|
|
|
- <Cell title="预付款(含定金)" :value="handleNumberValue(detail.payeddeposit.toFixed(2))" />
|
|
|
+ <Cell title="参考价" :value="detail.tradeprice.toFixed(2) + '元/' + getGoodsUnitName(detail.unitid)" />
|
|
|
+ <Cell title="数量" :value="detail.tradeqty + getGoodsUnitName(detail.unitid)" />
|
|
|
+ <Cell title="总预付款(含定金)" :value="handleNumberValue(detail.payeddeposit.toFixed(2), '元')" />
|
|
|
<Cell title="付款比例" :value="parsePercent(detail.depositrate)" />
|
|
|
- <Cell title="预付金" :value="handleNumberValue(detail.transferprice.toFixed(2))" />
|
|
|
- <Cell title="实际价" :value="handleNumberValue(detail.lastprice.toFixed(2))" />
|
|
|
- <Cell title="尾款" :value="handleNumberValue(detail.remainamount.toFixed(2))" />
|
|
|
+ <Cell title="每吨预付金" :value="handleNumberValue(detail.transferprice.toFixed(2), '元')" />
|
|
|
+ <Cell title="交收结算价" :value="handleNumberValue(detail.lastprice.toFixed(2), '元')" />
|
|
|
+ <Cell title="尾款" :value="handleNumberValue(detail.remainamount.toFixed(2), '元')" />
|
|
|
+ <Cell title="尾款支付截止日" value="若河钢招标价晚于交收月10号,待公布后顺延2个自然日付款" />
|
|
|
<Cell title="状态" :value="detail.thjorderstatusdisplay" />
|
|
|
<Cell title="采购时间" :value="formatDate(detail.tradetime)" />
|
|
|
- <Cell title="到期日期" :value="detail.enddate" />
|
|
|
+ <Cell title="合同转让截止日" :value="detail.enddate" />
|
|
|
</CellGroup>
|
|
|
<CellGroup title="交收信息">
|
|
|
<Cell title="交收方式" :value="detail.thjdeliverymodedisplay" />
|
|
|
+ <Cell title="交收月份" :value="detail.enddatemonth" />
|
|
|
<Cell title="联系人" :value="detail.contactname" v-if="detail.contactname" />
|
|
|
<Cell title="联系方式" :value="detail.contactinfo" v-if="detail.contactinfo" />
|
|
|
<Cell title="目的地地址" :value="detail.desaddress" v-if="detail.desaddress" />
|
|
|
@@ -43,17 +45,17 @@
|
|
|
<div class="g-form__footer" v-if="detail">
|
|
|
<!-- 参数类型为 2 时只显示点价按钮 -->
|
|
|
<template v-if="type.toString() === '2'">
|
|
|
- <Button block round type="primary"
|
|
|
+ <Button :class="spotgoods?.priceflag ? '' : 'van-button--disabled'" block round type="primary"
|
|
|
v-if="detail.buyuserid === detail.firstbuyuserid && detail.availabletime > 0 && detail.presalestatus === 2 && detail.orderstatus === 1"
|
|
|
@click="spotPricingSubmit">点价</Button>
|
|
|
</template>
|
|
|
<template v-else-if="type.toString() !== '3'">
|
|
|
- <Button block round type="primary"
|
|
|
+ <Button :class="spotgoods?.priceflag ? '' : 'van-button--disabled'" block round type="primary"
|
|
|
v-if="detail.buyuserid === detail.firstbuyuserid && detail.availabletime > 0 && detail.presalestatus === 2 && detail.orderstatus === 1"
|
|
|
@click="spotPricingSubmit">点价</Button>
|
|
|
<Button block round type="primary"
|
|
|
v-if="detail.thjdeliverymode === 1 && detail.presalestatus === 2 && detail.orderstatus === 1"
|
|
|
- @click="showDialog">合同转让</Button>
|
|
|
+ @click="openComponent('transfer')">合同转让</Button>
|
|
|
<Button block round type="primary" v-if="detail.orderstatus === 9"
|
|
|
@click="spotCancelSubmit">撤销转让</Button>
|
|
|
<Button block round type="primary" v-if="detail.orderstatus === 5"
|
|
|
@@ -64,86 +66,86 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <!-- 转让价格 -->
|
|
|
- <Dialog class-name="order-detail__dialog" v-model:show="show" title="合同转让" show-cancel-button
|
|
|
- @confirm="spotListingSubmit" @cancel="cancelDialog">
|
|
|
- <Stepper v-model="formData.TransferPrice" placeholder="请输入转让价格" theme="round" :decimal-length="2"
|
|
|
- default-value="" :auto-fixed="false" button-size="22" allow-empty />
|
|
|
- </Dialog>
|
|
|
+ <!-- 转让金额 -->
|
|
|
+ <component ref="componentRef" v-bind="{ detail }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
-import { CellGroup, Cell, Empty, Button, showFailToast, Dialog, Stepper } from 'vant'
|
|
|
+import { CellGroup, Cell, Empty, Button, showFailToast } from 'vant'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
+import { getGoodsUnitName } from '@/constants/unit'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { querySpotgoodsPrice } from '@/services/api/market'
|
|
|
import { formatDate, getUrl, handleNumberValue, parsePercent } from '@/filters'
|
|
|
-import { useSpotPresaleDeliveryConfirm, useSpotPresaleBreachOfContractApply, useSpotPresaleTransferCancel, useSpotPresaleTransferListing, useSpotPresalePlayment, useSpotPresalePointPrice } from "@/business/trade"
|
|
|
+import { useSpotPresaleDeliveryConfirm, useSpotPresaleBreachOfContractApply, useSpotPresaleTransferCancel, useSpotPresalePlayment, useSpotPresalePointPrice } from "@/business/trade"
|
|
|
import plus from '@/utils/h5plus'
|
|
|
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['transfer', defineAsyncComponent(() => import('./components/transfer/index.vue'))],
|
|
|
+])
|
|
|
+
|
|
|
const { route, router } = useNavigation()
|
|
|
const { item, type } = route.params
|
|
|
-/// 是否显示dialog
|
|
|
-const show = shallowRef(false)
|
|
|
const detail = shallowRef<Model.THJPurchaseTradeDetailRsp>()
|
|
|
|
|
|
if (item) {
|
|
|
detail.value = JSON.parse(item.toString())
|
|
|
}
|
|
|
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
+ router.back()
|
|
|
+})
|
|
|
+
|
|
|
const { confirmSubmit } = useSpotPresaleDeliveryConfirm()
|
|
|
const { applySubmit } = useSpotPresaleBreachOfContractApply()
|
|
|
const { playmentSubmit } = useSpotPresalePlayment()
|
|
|
const { transferCancelSubmit } = useSpotPresaleTransferCancel()
|
|
|
-const { listingSubmit, formData } = useSpotPresaleTransferListing()
|
|
|
const { formSubmit } = useSpotPresalePointPrice(detail.value?.wrtradedetailid)
|
|
|
|
|
|
-const { runAsync: getSpotgoodsPrice } = useRequest(querySpotgoodsPrice, {
|
|
|
- manual: true,
|
|
|
+const { data: spotgoods } = useRequest(querySpotgoodsPrice, {
|
|
|
params: {
|
|
|
wrstandardid: detail.value?.wrstandardid
|
|
|
},
|
|
|
+ onSuccess: (res) => {
|
|
|
+ if (res.data.length) {
|
|
|
+ spotgoods.value = res.data[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
// 确认点价
|
|
|
const spotPricingSubmit = () => {
|
|
|
- fullloading((hideLoading) => {
|
|
|
- // 点价之前先获取当前价格
|
|
|
- getSpotgoodsPrice().then((res) => {
|
|
|
- if (res.data.length === 1) {
|
|
|
- const item = res.data[0]
|
|
|
- const message = `${item.wrstandardname}当前现货价为${item.spotgoodsprice},是否点价?`
|
|
|
+ const { availabletime = 0, pointtimes = 0 } = detail.value ?? {}
|
|
|
+ const { priceflag, wrstandardname, spotgoodsprice = 0 } = spotgoods.value ?? {}
|
|
|
+
|
|
|
+ if (priceflag) {
|
|
|
+ let message = `${wrstandardname}当前现货价为${spotgoodsprice},是否点价?\n`
|
|
|
+ message += `<span style="color:red;">剩余点价次数${availabletime}/${pointtimes}</span>`
|
|
|
|
|
|
- dialog({
|
|
|
- message,
|
|
|
- allowHtml: true,
|
|
|
- showCancelButton: true
|
|
|
- }).then(() => {
|
|
|
- fullloading((hideLoading) => {
|
|
|
- formSubmit().then(() => {
|
|
|
- hideLoading()
|
|
|
- dialog('点价提交成功。').then(() => {
|
|
|
- router.back()
|
|
|
- })
|
|
|
- }).catch((err) => {
|
|
|
- showFailToast(err)
|
|
|
- })
|
|
|
+ dialog({
|
|
|
+ message,
|
|
|
+ allowHtml: true,
|
|
|
+ showCancelButton: true
|
|
|
+ }).then(() => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ formSubmit().then(() => {
|
|
|
+ hideLoading()
|
|
|
+ dialog('点价提交成功。').then(() => {
|
|
|
+ router.back()
|
|
|
})
|
|
|
+ }).catch((err) => {
|
|
|
+ showFailToast(err)
|
|
|
})
|
|
|
- } else {
|
|
|
- dialog({
|
|
|
- message: '获取现货价格失败,请稍后重试'
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- showFailToast(err)
|
|
|
- }).finally(() => {
|
|
|
- hideLoading()
|
|
|
+ })
|
|
|
})
|
|
|
- }, '加载中...')
|
|
|
+ } else {
|
|
|
+ dialog('河钢招标价未公布或当前订单价格低于下单价格')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// 确认交收
|
|
|
@@ -212,23 +214,6 @@ const spotPlaymentSubmit = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-///合同转让申请
|
|
|
-const spotListingSubmit = () => {
|
|
|
- const param = detail.value
|
|
|
- if (param) {
|
|
|
- fullloading((hideLoading) => {
|
|
|
- listingSubmit(param.wrtradedetailid).then(() => {
|
|
|
- hideLoading()
|
|
|
- dialog('合同转让提交成功。').then(() => {
|
|
|
- router.back()
|
|
|
- })
|
|
|
- }).catch((err) => {
|
|
|
- showFailToast(err)
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
/// 转让撤销申请
|
|
|
const spotCancelSubmit = () => {
|
|
|
dialog({
|
|
|
@@ -254,15 +239,6 @@ const openPDF = (file?: string) => {
|
|
|
plus.openURL(getUrl(file).href)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-/// 是否显示Dialog
|
|
|
-const showDialog = () => {
|
|
|
- show.value = !show.value
|
|
|
-}
|
|
|
-
|
|
|
-const cancelDialog = () => {
|
|
|
- show.value = false
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|