租赁协议完善
This commit is contained in:
parent
c26a49e728
commit
959220a068
|
|
@ -5,7 +5,6 @@
|
|||
<van-icon name="arrow-left" @click="onClickLeft" />
|
||||
<text style="color: #000"> 租赁协议 </text>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y>
|
||||
<van-cell-group inset>
|
||||
<rich-text :nodes="docHtml"></rich-text>
|
||||
|
|
@ -19,14 +18,22 @@ import { ref } from 'vue'
|
|||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import mammoth from 'mammoth'
|
||||
const docHtml = ref('')
|
||||
|
||||
const pagesType = ref(1)
|
||||
const onClickLeft = () => {
|
||||
uni.navigateBack()
|
||||
let url = ''
|
||||
if (pagesType.value == 1) url = '/pages/cart/index'
|
||||
if (pagesType.value == 3) url = '/pages/order-list/index'
|
||||
if (pagesType.value == 1 || pagesType.value == 3) {
|
||||
uni.reLaunch({
|
||||
url,
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
onLoad(async () => {
|
||||
const response = await fetch(
|
||||
'http://36.33.26.201:17788/statics/2024/12/27/bookCar_20241227152534A023.docx',
|
||||
)
|
||||
onLoad(async (options) => {
|
||||
pagesType.value = options.type
|
||||
const response = await fetch(options.url)
|
||||
const arrayBuffer = await response.arrayBuffer()
|
||||
mammoth
|
||||
.convertToHtml({ arrayBuffer: arrayBuffer })
|
||||
|
|
|
|||
|
|
@ -141,24 +141,11 @@
|
|||
</view>
|
||||
</view>
|
||||
<van-row style="padding: 10px 0; margin-top: 10px; border-top: 1px solid #ccc">
|
||||
<!-- <van-checkbox-group
|
||||
v-model="item.protocolChecked"
|
||||
shape="square"
|
||||
icon-size="16px"
|
||||
>
|
||||
<van-checkbox name="1">
|
||||
我已阅读并同意
|
||||
<text class="protocol" @click.stop="onViewProtocol">
|
||||
《xxx公司协议》
|
||||
</text>
|
||||
</van-checkbox>
|
||||
|
||||
|
||||
</van-checkbox-group> -->
|
||||
|
||||
<van-checkbox v-model="item.protocolChecked" icon-size="16px">
|
||||
我已阅读并同意
|
||||
<text class="protocol" @click.stop="onViewProtocol"> 《xxx公司协议》 </text>
|
||||
<text class="protocol" @click.stop="onViewProtocol(item, index)">
|
||||
《{{ item.companyPersonPhoneKey.companyName }}公司协议》
|
||||
</text>
|
||||
</van-checkbox>
|
||||
</van-row>
|
||||
</view>
|
||||
|
|
@ -222,12 +209,14 @@ import dateIcon from '@/static/goods/date-icon.png'
|
|||
import { computed, nextTick, ref } from 'vue'
|
||||
import { onHide, onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import {
|
||||
getBookCarDetailsAPI,
|
||||
getAddressListAPI,
|
||||
submitBookCarAPI,
|
||||
deleteBookCarAPI,
|
||||
getAddressListAPI,
|
||||
getBookCarDetailsAPI,
|
||||
deleteBookCarByIdsAPI,
|
||||
getBookCarAgreementAPI,
|
||||
} from '@/services/cart/index.js'
|
||||
import { useMemberStore } from '@/stores/index.js'
|
||||
import moment from 'moment'
|
||||
const cartList = ref([])
|
||||
const showBottom = ref(false)
|
||||
|
|
@ -244,6 +233,7 @@ const chosenAddressId = ref()
|
|||
const addressList = ref([])
|
||||
const isCartManage = ref(false)
|
||||
const checkedAll = ref(false)
|
||||
const memberStore = useMemberStore()
|
||||
const onClickLeft = () => {
|
||||
uni.showTabBar()
|
||||
uni.switchTab({
|
||||
|
|
@ -341,9 +331,54 @@ const onSubmitOrder = async () => {
|
|||
// getDeviceDetailsData()
|
||||
}
|
||||
}
|
||||
const onViewProtocol = () => {
|
||||
const onViewProtocol = async (item, index) => {
|
||||
if (amountDevice.value < 1) {
|
||||
showFailToast('请选择装备')
|
||||
return
|
||||
}
|
||||
let isDays = false
|
||||
try {
|
||||
amountDeviceList.value.forEach((e) => {
|
||||
if (e.days < 1) {
|
||||
showFailToast('有装备租期未选择或租期为0,请选择租期')
|
||||
isDays = true
|
||||
throw new Error()
|
||||
}
|
||||
})
|
||||
} catch (error) {}
|
||||
|
||||
if (isDays) return
|
||||
// 组装参数 获取协议
|
||||
let detailsList = []
|
||||
let cost = 0
|
||||
const { companyName, companyId, personPhone } = item.companyPersonPhoneKey
|
||||
cartList.value[index].devInfoVoList.map((e) => {
|
||||
if (e.isChecked) {
|
||||
detailsList.push({
|
||||
rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
|
||||
rentEndTime: e.rentEndTime + ' ' + '23:59:59',
|
||||
manageType: e.manageType,
|
||||
days: e.days,
|
||||
num: e.num,
|
||||
costs: e.num * e.days * e.dayLeasePrice,
|
||||
deviceName: e.deviceName,
|
||||
dayLeasePrice: e.dayLeasePrice,
|
||||
})
|
||||
cost = cost + e.num * e.days * e.dayLeasePrice
|
||||
}
|
||||
})
|
||||
const queryParams = {
|
||||
companyName: memberStore.userCompanyName,
|
||||
czcompanyName: companyName,
|
||||
companyId,
|
||||
cost,
|
||||
detailsList,
|
||||
personPhone,
|
||||
}
|
||||
|
||||
const { data: res } = await getBookCarAgreementAPI(queryParams)
|
||||
uni.navigateTo({
|
||||
url: '/pages/agreement/index',
|
||||
url: `/pages/agreement/index?url=${res.url}&type=1`,
|
||||
})
|
||||
}
|
||||
const onSelectTime = (type, index, goodsI) => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@
|
|||
<text style="color: #000"> 我的订单 </text>
|
||||
</view>
|
||||
|
||||
<van-tabs v-model:active="activeTabs" swipeable color="#00a288" background="#f0f7f7">
|
||||
<van-tabs
|
||||
v-model:active="activeTabs"
|
||||
swipeable
|
||||
color="#00a288"
|
||||
background="#f0f7f7"
|
||||
@change="onTapsChange"
|
||||
>
|
||||
<van-tab v-for="(t, i) in tabList" :title="t.tab_name"> </van-tab>
|
||||
</van-tabs>
|
||||
|
||||
|
|
@ -146,20 +152,15 @@
|
|||
>
|
||||
费用确认
|
||||
</van-button>
|
||||
|
||||
<!-- <van-button style="margin-right: 6px" round type="success" size="small">
|
||||
发起退租
|
||||
</van-button>
|
||||
|
||||
<van-button
|
||||
style="margin-right: 6px"
|
||||
round
|
||||
type="success"
|
||||
size="small"
|
||||
@click="onReduction"
|
||||
>
|
||||
发起减免
|
||||
</van-button> -->
|
||||
<van-button
|
||||
style="margin-right: 6px"
|
||||
size="small"
|
||||
type="primary"
|
||||
class="primary-lease"
|
||||
@click.stop="onViewAgreement(item)"
|
||||
>
|
||||
租赁协议
|
||||
</van-button>
|
||||
</van-row>
|
||||
|
||||
<van-row style="margin-top: 14px">
|
||||
|
|
@ -414,6 +415,7 @@ import {
|
|||
editOrderStatusAPI,
|
||||
editOrderDetailsAPI,
|
||||
setAddLeaseRepairAPI,
|
||||
getLeaseAgreementAPI,
|
||||
} from '@/services/order/index.js'
|
||||
const showBottom = ref(false)
|
||||
const showCenter = ref(false)
|
||||
|
|
@ -495,7 +497,6 @@ const onReturnRepair = (item) => {
|
|||
submitParams.value.code = code
|
||||
submitParams.value.orderId = orderId
|
||||
editOrderDetailsAPI({ orderId }).then(async (result) => {
|
||||
console.log(result, 'resultresultresult')
|
||||
repairList.value = result.data.detailsList.map((e) => {
|
||||
// 维修费用
|
||||
const repairRecord = {
|
||||
|
|
@ -698,6 +699,14 @@ const onCostConfirm = (item) => {
|
|||
uni.navigateTo({ url: `/pages/order-confirm/index?orderId=${item.orderId}` })
|
||||
}
|
||||
|
||||
// 租赁协议
|
||||
const onViewAgreement = async (item) => {
|
||||
const { data: res } = await getLeaseAgreementAPI({ orderId: item.orderId })
|
||||
uni.navigateTo({
|
||||
url: `/pages/agreement/index?url=${res.url}&type=3`,
|
||||
})
|
||||
}
|
||||
|
||||
// 移除
|
||||
const onClearRepairRecord = (type, index) => {
|
||||
if (type === 1) {
|
||||
|
|
@ -795,6 +804,11 @@ const onJumpOrderDetails = (item) => {
|
|||
uni.navigateTo({ url: `/pages/order-details/index?orderId=${item.orderId}` })
|
||||
}
|
||||
|
||||
const onTapsChange = (val) => {
|
||||
orderQueryParams.value.orderStatus = val === 0 ? '' : tabList.value[val].order_status
|
||||
getOrderListData()
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
orderQueryParams.value.flag = options?.type == 1 ? true : false
|
||||
// console.log(options?.status, '状态')
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
</view>
|
||||
</van-col>
|
||||
<van-col span="10" class="contacts">
|
||||
<!-- 联系人: {{ item.person }} {{ item.personPhone }} -->
|
||||
<view> 联系人: {{ item.person }} </view>
|
||||
<view style="margin-top: 4px"> {{ item.personPhone }}</view>
|
||||
</van-col>
|
||||
|
|
@ -33,15 +32,12 @@
|
|||
<view style="color: #000">{{ item.deviceName }}</view>
|
||||
<view>装备编号:{{ item.code }}</view>
|
||||
<view>装备型号:{{ item.typeName }}</view>
|
||||
<view>
|
||||
租赁金额:
|
||||
<view style="display: flex; justify-content: space-between">
|
||||
<text style="color: var(--van-submit-bar-price-color)">
|
||||
¥{{ item.dayLeasePrice }}/天
|
||||
租赁金额:¥{{ item.dayLeasePrice }}/天
|
||||
</text>
|
||||
|
||||
<van-stepper
|
||||
style="margin-left: 20px"
|
||||
button-size="18"
|
||||
button-size="16"
|
||||
:max="item.deviceCount"
|
||||
v-model="item.num"
|
||||
/>
|
||||
|
|
@ -73,22 +69,38 @@
|
|||
</van-col>
|
||||
</van-row>
|
||||
|
||||
<van-row style="margin-top: 14px">
|
||||
总金额:
|
||||
<view
|
||||
style="
|
||||
margin-top: 14px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
"
|
||||
>
|
||||
<view style="color: var(--van-submit-bar-price-color)">
|
||||
<text> ¥ </text>
|
||||
<text style="font-size: 16px; font-weight: bold">
|
||||
{{ item.num * item.dayLeasePrice * item.days }}
|
||||
</text>
|
||||
</view>
|
||||
</van-row>
|
||||
</view>
|
||||
<van-row style="padding: 10px 0; margin-top: 10px; border-top: 1px solid #ccc">
|
||||
<van-checkbox-group v-model="item.checked" shape="square" icon-size="16px">
|
||||
<!-- <van-checkbox-group v-model="item.checked" shape="square" icon-size="16px">
|
||||
<van-checkbox name="1">
|
||||
我已阅读并同意
|
||||
<text class="protocol" @click.stop="onViewProtocol"> 《xxx公司协议》 </text>
|
||||
<text class="protocol" @click.stop="onViewProtocol">
|
||||
《{{ item.companyName }}公司协议》
|
||||
</text>
|
||||
</van-checkbox>
|
||||
</van-checkbox-group>
|
||||
</van-checkbox-group> -->
|
||||
|
||||
<van-checkbox v-model="item.checked" icon-size="16px">
|
||||
我已阅读并同意
|
||||
<text class="protocol" @click.stop="onViewProtocol(item)">
|
||||
《{{ item.companyName }}公司协议》
|
||||
</text>
|
||||
</van-checkbox>
|
||||
</van-row>
|
||||
</view>
|
||||
|
||||
|
|
@ -138,10 +150,13 @@ import { computed, ref } from 'vue'
|
|||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useMemberStore } from '@/stores/index.js'
|
||||
import { getDeviceDetailsAPI } from '@/services/goods/index.js'
|
||||
import { getAddressListAPI, submitBookCarAPI } from '@/services/cart/index.js'
|
||||
import {
|
||||
getAddressListAPI,
|
||||
submitBookCarAPI,
|
||||
getBookCarAgreementAPI,
|
||||
} from '@/services/cart/index.js'
|
||||
import moment from 'moment'
|
||||
const memberStore = useMemberStore()
|
||||
const checked = ref(['1'])
|
||||
const orderList = ref([])
|
||||
const showBottom = ref(false)
|
||||
const showBottomAddress = ref(false)
|
||||
|
|
@ -156,22 +171,27 @@ const onClickLeft = () => {
|
|||
uni.navigateBack()
|
||||
}
|
||||
const onSubmitOrder = async () => {
|
||||
let isPass = false
|
||||
orderList.value.forEach((e) => {
|
||||
if (e.days < 1) {
|
||||
showFailToast('请选择租期')
|
||||
isPass = true
|
||||
return
|
||||
}
|
||||
if (!e.checked.includes('1')) {
|
||||
if (!e.checked) {
|
||||
showFailToast('请先阅读公司协议')
|
||||
isPass = true
|
||||
return
|
||||
}
|
||||
|
||||
if (address.value.length == 0) {
|
||||
showFailToast('请选择收货地址')
|
||||
isPass = true
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
if (isPass) return
|
||||
const orderInfo = orderList.value[0]
|
||||
const submitInfo = {
|
||||
maId: orderInfo.maId,
|
||||
|
|
@ -197,9 +217,47 @@ const onSubmitOrder = async () => {
|
|||
}, 500)
|
||||
}
|
||||
}
|
||||
const onViewProtocol = () => {
|
||||
const onViewProtocol = async (item) => {
|
||||
let isDays = false
|
||||
orderList.value.forEach((e) => {
|
||||
if (e.days < 1) {
|
||||
showFailToast('请选择租期')
|
||||
isDays = true
|
||||
return
|
||||
}
|
||||
})
|
||||
if (isDays) return
|
||||
// 组装参数 获取协议
|
||||
let detailsList = []
|
||||
let cost = 0
|
||||
const { companyName, companyId, personPhone } = item
|
||||
|
||||
orderList.value.forEach((e) => {
|
||||
detailsList.push({
|
||||
rentBeginTime: e.rentBeginTime + ' ' + '00:00:00',
|
||||
rentEndTime: e.rentEndTime + ' ' + '23:59:59',
|
||||
manageType: e.manageType,
|
||||
days: e.days,
|
||||
num: e.num,
|
||||
costs: e.num * e.days * e.dayLeasePrice,
|
||||
deviceName: e.deviceName,
|
||||
dayLeasePrice: e.dayLeasePrice,
|
||||
})
|
||||
cost = cost + e.num * e.days * e.dayLeasePrice
|
||||
})
|
||||
|
||||
const queryParams = {
|
||||
companyName: memberStore.userCompanyName,
|
||||
czcompanyName: companyName,
|
||||
companyId,
|
||||
cost,
|
||||
detailsList,
|
||||
personPhone,
|
||||
}
|
||||
|
||||
const { data: res } = await getBookCarAgreementAPI(queryParams)
|
||||
uni.navigateTo({
|
||||
url: '/pages/agreement/index',
|
||||
url: `/pages/agreement/index?url=${res.url}&type=2`,
|
||||
})
|
||||
}
|
||||
const onSelectTime = (type) => {
|
||||
|
|
@ -235,7 +293,7 @@ const getDeviceDetailsData = async (id) => {
|
|||
rentEndTime: '',
|
||||
days: 0,
|
||||
num: 1,
|
||||
checked: [''],
|
||||
checked: false,
|
||||
...res,
|
||||
}
|
||||
orderList.value.push(orderInfo)
|
||||
|
|
@ -345,8 +403,9 @@ onLoad((options) => {
|
|||
align-items: center;
|
||||
|
||||
.info {
|
||||
font-size: 12px;
|
||||
|
||||
font-size: 13px;
|
||||
padding-left: 8px;
|
||||
flex: 1;
|
||||
view {
|
||||
padding: 2px 0 2px 10px;
|
||||
font-size: 12px;
|
||||
|
|
|
|||
|
|
@ -58,3 +58,13 @@ export const deleteBookCarByIdsAPI = (data) => {
|
|||
data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取协议
|
||||
*/
|
||||
export const getBookCarAgreementAPI = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material-mall/order/bookCarAgreement',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,3 +70,13 @@ export const confirmPriceAPI = (data) => {
|
|||
data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 订单 获取租赁协议
|
||||
*/
|
||||
export const getLeaseAgreementAPI = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material-mall/order/leaseAgreement',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue