bug修改

This commit is contained in:
wlikett 2023-12-09 11:46:09 +08:00
parent fdfd6ad203
commit 84c5d75ee5
4 changed files with 113 additions and 192 deletions

View File

@ -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>

View File

@ -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)

View File

@ -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()

View File

@ -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>