bug修改
This commit is contained in:
parent
fdfd6ad203
commit
84c5d75ee5
|
|
@ -3,7 +3,7 @@
|
|||
border
|
||||
:header-cell-class-name="headerClassName"
|
||||
style="width: 100%">
|
||||
<el-table-column label="装备" min-width="200" >
|
||||
<el-table-column label="装备" min-width="210" >
|
||||
<template #default="scope">
|
||||
<div class="equipData">
|
||||
<div class="name">
|
||||
|
|
@ -27,12 +27,12 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="租金" min-width="120" >
|
||||
<el-table-column prop="name" label="租金" min-width="80" >
|
||||
<template #default="scope">
|
||||
{{ scope.row.price }}/{{ scope.row.unit }}
|
||||
{{ scope.row.price }}{{ scope.row.unit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="company" label="供应商" min-width="180" />
|
||||
<el-table-column prop="company" label="供应商" min-width="120" />
|
||||
</el-table>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="title">
|
||||
<div class="name">{{ pageData.modelName }}{{ pageData.deviceName }}</div>
|
||||
<div class="tag">
|
||||
<div class="item">{{ pageData.maStatus }}</div>
|
||||
<div class="item">{{ pageData.maStatusStr }}</div>
|
||||
<div class="item otherItem" v-if="pageData.isAudit == 1">已审核</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -159,8 +159,13 @@
|
|||
<el-row>
|
||||
<el-col :span="15">
|
||||
<el-form-item label="工期时长" prop="duration">
|
||||
<el-input v-model="ruleForm.duration" type="number" placeholder="请输入工期时长">
|
||||
<template #append>天</template>
|
||||
<el-input v-model.number="ruleForm.duration" type="number" placeholder="请输入工期时长">
|
||||
<template #append>
|
||||
<el-select v-model="ruleForm.durationUnit" placeholder="Select" style="width: 85px" @change="priceChange">
|
||||
<el-option label="天" value="0" />
|
||||
<el-option label="月" value="1" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -205,7 +210,7 @@
|
|||
</el-form>
|
||||
</el-config-provider>
|
||||
<equipDetailTable
|
||||
:price="pageData.monthLeasePrice"
|
||||
:price="`${priceChange}元`"
|
||||
:name="`${pageData.modelName}${pageData.deviceName}`"
|
||||
:company="pageData.companyName"
|
||||
:url="pageData.picUrl"
|
||||
|
|
@ -215,7 +220,7 @@
|
|||
:position="pageData.location"
|
||||
:specifications="pageData.specification"
|
||||
:type="pageData.typeName"
|
||||
unit="月"
|
||||
unit=""
|
||||
></equipDetailTable>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
|
|
@ -246,7 +251,7 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import ShowImg from './comoonents/showImg.vue'
|
||||
import {reactive, ref} from 'vue'
|
||||
import {computed, reactive, ref} from 'vue'
|
||||
import EquipCard from 'components/equipCard.vue'
|
||||
import {getDetail,getHotList,equipCollect,apiSubmitLease,apiGetAddressList} from "@/http/api/equip"
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
|
|
@ -267,8 +272,8 @@ const equipBaseInfoList = reactive([
|
|||
key: 'specification'
|
||||
},
|
||||
{
|
||||
label: '设备单位',
|
||||
key: 'companyName'
|
||||
label: '设备位置',
|
||||
key: 'city'
|
||||
},
|
||||
{
|
||||
label: '配备机手',
|
||||
|
|
@ -389,13 +394,23 @@ const isCollect = ref(false)
|
|||
//推荐列表
|
||||
const hotList = ref([])
|
||||
|
||||
const checkDuration = (rule,value,callback) => {
|
||||
if((value == '' || value == null) && value !== 0) {
|
||||
return callback(new Error('请输入工期时长'))
|
||||
}else if(value <= 0){
|
||||
return callback(new Error('工期时长需大于0'))
|
||||
}else {
|
||||
return callback()
|
||||
}
|
||||
}
|
||||
|
||||
//我要租 表单数据
|
||||
const ruleForm = ref({
|
||||
address: [],//进场地址
|
||||
detailAddress: '',//详细地址
|
||||
entryTime: '',//进场时间
|
||||
duration: '',//工期时长
|
||||
duration: null,//工期时长
|
||||
durationUnit:'0',//工期时长单位 0 —> 天 1 -> 月
|
||||
machinist: 0,//是否需要机手
|
||||
invoiceType: '',//发票类型
|
||||
projectDescription: ''//项目说明
|
||||
|
|
@ -408,10 +423,11 @@ const rules = reactive({
|
|||
{required: true, message: '请输入详细地址', trigger: 'blur'}
|
||||
],
|
||||
entryTime: [
|
||||
{required: true, message: '请选择进场时间', trigger: 'blur'}
|
||||
{required: true, message: '请选择进场时间', trigger: 'blur'},
|
||||
],
|
||||
duration: [
|
||||
{required: true, message: '请输入工期时长', trigger: 'blur'}
|
||||
{validator:checkDuration, trigger: 'blur'}
|
||||
|
||||
],
|
||||
machinist: [
|
||||
{required: true, message: '请输入进场地址', trigger: 'blur'}
|
||||
|
|
@ -423,6 +439,9 @@ const rules = reactive({
|
|||
{required: true, message: '请输入项目说明', trigger: 'blur'}
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
|
||||
//打开我要租表单
|
||||
const openLease = () => {
|
||||
dialoglease.value = true
|
||||
|
|
@ -444,6 +463,35 @@ const collectChange = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
//计算具体价格
|
||||
const priceChange = computed(() => {
|
||||
//总价
|
||||
let count = 0
|
||||
//单价
|
||||
let unitPrice = 0
|
||||
// 额外机手价格
|
||||
let jsPrice = 0
|
||||
// 时长
|
||||
let duration = 0
|
||||
|
||||
if(ruleForm.value.durationUnit == '0'){
|
||||
unitPrice = Number(pageData.value.dayLeasePrice)
|
||||
jsPrice = Number(pageData.value.jsDayPrice)
|
||||
}else {
|
||||
unitPrice = Number(pageData.value.monthLeasePrice)
|
||||
jsPrice = Number(pageData.value.jsMonthPrice)
|
||||
}
|
||||
if(!ruleForm.value.machinist){
|
||||
jsPrice = 0
|
||||
}
|
||||
|
||||
duration = Number(ruleForm.value.duration)
|
||||
|
||||
count = unitPrice * duration + jsPrice * duration
|
||||
|
||||
return Math.round(count * 100) / 100
|
||||
})
|
||||
|
||||
//打开商家电话弹窗
|
||||
const openPhone = () => {
|
||||
dialogPhone.value = !dialogPhone.value
|
||||
|
|
@ -542,7 +590,8 @@ const submit = async() => {
|
|||
duration: ruleForm.value.duration,
|
||||
isMachinist: ruleForm.value.machinist,
|
||||
invoiceType: ruleForm.value.invoiceType,
|
||||
description: ruleForm.value.projectDescription
|
||||
description: ruleForm.value.projectDescription,
|
||||
durationType: ruleForm.value.durationUnit
|
||||
}
|
||||
|
||||
const res = await apiSubmitLease(params)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
:key="i"
|
||||
:url="v.picUrl"
|
||||
:company="v.companyName"
|
||||
:tags="[v.maStatus,v.city || '合肥市']"
|
||||
:tags="[v.maStatusStr,v.city || '合肥市']"
|
||||
:name="`${v.modelName}${v.deviceName}`"
|
||||
:price="v.monthLeasePrice"
|
||||
:id="v.maId"
|
||||
|
|
@ -292,6 +292,9 @@ const handleClose = (tag, index) => {
|
|||
screenChooseList[tag.parentIndex].select.splice(tag.index)
|
||||
screenChooseList[tag.parentIndex].index = tag.index
|
||||
|
||||
const data = JSON.parse(JSON.stringify(screenChooseList[tag.parentIndex].select))
|
||||
|
||||
getTypeData( data.pop()?.typeId || '' )
|
||||
getData()
|
||||
}
|
||||
//清除所有标签
|
||||
|
|
@ -323,7 +326,6 @@ const selectScreen = (parentIndex, val, index) => {
|
|||
)
|
||||
screenChooseList[parentIndex].index++
|
||||
|
||||
|
||||
getData()
|
||||
|
||||
if (screenChooseList[parentIndex].index == screenChooseList[parentIndex].list.length) {
|
||||
|
|
@ -374,6 +376,8 @@ const getTypeData = async (typeId = null) => {
|
|||
if (typeId) {
|
||||
params = {typeId}
|
||||
}
|
||||
const index = screenChooseList.findIndex(key => key.name == 'type')
|
||||
screenChooseList[index].list[screenChooseList[index].index].select = []
|
||||
const res = await apiGetEquipTypeList(params)
|
||||
const list = res.rows.map(
|
||||
item => {
|
||||
|
|
@ -384,9 +388,10 @@ const getTypeData = async (typeId = null) => {
|
|||
}
|
||||
}
|
||||
)
|
||||
const index = screenChooseList.findIndex(key => key.name == 'type')
|
||||
|
||||
|
||||
|
||||
screenChooseList[index].list[screenChooseList[index].index].select = list
|
||||
console.log('getTypeData ===============', list)
|
||||
}
|
||||
|
||||
//获取列表
|
||||
|
|
@ -446,7 +451,7 @@ const getData = async (text = '') => {
|
|||
}
|
||||
|
||||
const getParams = () => {
|
||||
const paramsKey = ['keyWord']
|
||||
const paramsKey = ['keyWord','typeTag']
|
||||
let params = {}
|
||||
paramsKey.forEach(key => {
|
||||
if (history.state[key]) {
|
||||
|
|
@ -458,13 +463,33 @@ const getParams = () => {
|
|||
|
||||
const init = () => {
|
||||
const params = getParams()
|
||||
if (params && params.keyWord) {
|
||||
$bus.emit('callBackText', params.keyWord)
|
||||
$bus.off('callBackText')
|
||||
if (params) {
|
||||
if(params.keyWord){
|
||||
$bus.emit('callBackText', params.keyWord)
|
||||
$bus.off('callBackText')
|
||||
}
|
||||
if(params.typeTag){
|
||||
const index = screenChooseList.findIndex(key => key.name == 'type')
|
||||
const data = params.typeTag.map((key,i) => {
|
||||
return{
|
||||
...key,
|
||||
name:key.typeName,
|
||||
index:i,
|
||||
parentIndex:index
|
||||
}
|
||||
})
|
||||
screenChooseList[index].select = data
|
||||
screenChooseList[index].index = data.length
|
||||
}else {
|
||||
getTypeData()
|
||||
}
|
||||
}else {
|
||||
getTypeData()
|
||||
}
|
||||
getTypeData()
|
||||
|
||||
|
||||
getAddressData()
|
||||
getData()
|
||||
getData(params.keyWord || '')
|
||||
}
|
||||
init()
|
||||
|
||||
|
|
|
|||
|
|
@ -18,172 +18,19 @@
|
|||
|
||||
getGoodsClassList()
|
||||
|
||||
const handlerGoodsDetails = (...arg) => {
|
||||
const arr = arg.map((key,index) => {
|
||||
return {
|
||||
level: index + 1 + '',
|
||||
typeId:key.id,
|
||||
typeName:key.name
|
||||
}
|
||||
})
|
||||
|
||||
// [
|
||||
// {
|
||||
// name: '全部商品',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [
|
||||
// { goodsName: '履带挖掘机' },
|
||||
// { goodsName: '履带挖掘机' },
|
||||
// { goodsName: '履带挖掘机' },
|
||||
// { goodsName: '履带挖掘机' },
|
||||
// { goodsName: '履带挖掘机' },
|
||||
// { goodsName: '履带挖掘机' }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '挖掘机',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '土方机械',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '工程起重机械',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '动力设备',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '压实机械',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '路桥机械',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '混凝土机械',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: '桩工机械',
|
||||
// children: [
|
||||
// {
|
||||
// title: '挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '开沟机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// },
|
||||
// {
|
||||
// title: '斗轮挖掘机',
|
||||
// children: [{ goodsName: '履带挖掘机' }]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
const handlerGoodsDetails = () => {
|
||||
console.log('去往商品详情页')
|
||||
|
||||
router.push({
|
||||
name:'equipList',
|
||||
state:{ typeTag:arr }
|
||||
})
|
||||
}
|
||||
|
||||
const detailsList = ref([
|
||||
|
|
@ -243,7 +90,7 @@
|
|||
<a
|
||||
v-for="son in child.children"
|
||||
:key="son.id"
|
||||
@click="handlerGoodsDetails">
|
||||
@click="handlerGoodsDetails(item,child,son)">
|
||||
{{ son.name }}
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Reference in New Issue