Browse Source

'修BUG'

main
hflllll 5 days ago
parent
commit
177284c992
7 changed files with 159 additions and 148 deletions
  1. +8
    -0
      api/modules/config.js
  2. +15
    -5
      pages/index/home.vue
  3. +2
    -2
      pages/index/maintain.vue
  4. +1
    -1
      subPages/home/RAArecord.vue
  5. +116
    -135
      subPages/home/maintainanceSubmit.vue
  6. +5
    -2
      subPages/home/repairSubmit.vue
  7. +12
    -3
      subPages/repair/maintainSubmit.vue

+ 8
- 0
api/modules/config.js View File

@ -40,4 +40,12 @@ export default {
method: 'GET'
})
},
// 配置- 查看轮播图列表
async queryBannerList() {
return http({
url: '/config/queryBannerList',
method: 'GET'
})
}
}

+ 15
- 5
pages/index/home.vue View File

@ -2,7 +2,8 @@
<view class="home-container">
<!-- 顶部横幅图片 -->
<view class="banner-section">
<image class="banner-image" src="@/static/首页背景图.png" mode="aspectFill"></image>
<!-- <image class="banner-image" src="@/static/首页背景图.png" mode="aspectFill"></image> -->
<uv-swiper :list="bannerList" :loading="!bannerList.length" height="250"></uv-swiper>
</view>
<!-- 搜索区域 -->
@ -107,7 +108,8 @@ export default {
label: '',
value: ''
},
//
bannerList: [],
}
},
computed: {
@ -182,9 +184,17 @@ export default {
uni.navigateTo({
url: '/subPages/home/RAArecord?id=' + item.id
})
// TODO:
}
}
},
async getBannerList() {
const bannerRes = await this.$api.config.queryBannerList()
if (bannerRes.code === 200) {
this.bannerList = bannerRes.result.records.map(item => item.image)
}
},
},
onLoad(){
this.getBannerList()
},
}
</script>


+ 2
- 2
pages/index/maintain.vue View File

@ -62,7 +62,7 @@
</view>
<view class="detail-item">
<text class="detail-label">报修日期</text>
<text class="detail-value">{{ item.firstDate }}</text>
<text class="detail-value">{{ item.malfunctionDate }}</text>
</view>
</view>
<view class="detail-row">
@ -176,7 +176,7 @@ export default {
},
navigateToDetail(item) {
uni.navigateTo({
url: '/subPages/repair/maintainSubmit?id=' + item.id
url: '/subPages/repair/maintainSubmit?id=' + item.id + '&showpieceId=' + item.showpieceId
})
},
openUrgencyPicker() {


+ 1
- 1
subPages/home/RAArecord.vue View File

@ -115,7 +115,7 @@
<view class="info-row">
<text class="label">保养日期</text>
<text class="value">{{ record.maintainDate }}</text>
<text class="value">{{ record.maintenanceDate }}</text>
</view>
<view class="info-row">


+ 116
- 135
subPages/home/maintainanceSubmit.vue View File

@ -111,63 +111,60 @@
</view>
<!-- 产生费用 -->
<view v-if="isExpend === '1'" class="cost-section">
<view class="form-item form-item-header">
<text class="label active">产生费用</text>
</view>
<view class="cost-input">
<text class="label">费用名称</text>
<uv-input
v-model="newCostName"
<view class="form-item" v-if="isExpend === '1'">
<text class="label">产生费用</text>
<view class="input-area" >
<input
v-model="amount"
placeholder="请输入费用"
border="none"
:custom-style="{ backgroundColor: '#fff', borderRadius: '4px', textAlign: 'right', marginLeft: '24rpx' }"
></uv-input>
disabled
class="input-field"
/>
</view>
</view>
<!-- 费用详情表格 -->
<view class="cost-table" v-if="isExpend === '1'">
<view class="table-header">
<text class="header-cell">费用名称</text>
<text class="header-cell">数量</text>
<text class="header-cell">金额</text>
<text class="header-cell"></text>
</view>
<view class="cost-list">
<view class="cost-header">
<text class="header-item">费用名称</text>
<text class="header-item">数量</text>
<text class="header-item">金额</text>
<view class="table-row" v-for="(item, index) in costList" :key="index">
<view class="cell-input">
<uv-input
v-model="item.name"
placeholder="费用名称"
border="none"
:custom-style="{ backgroundColor: 'transparent', fontSize: '28rpx' }"
></uv-input>
</view>
<view v-for="(item, index) in costList" :key="index" class="cost-item">
<text class="cost-name">{{ item.name }}</text>
<view class="quantity-control">
<uv-icon
name="minus-circle"
size="20"
:color="item.quantity > 1 ? '#C70019' : '#ccc'"
@click="decreaseQuantity(index)"
></uv-icon>
<text class="quantity">{{ item.quantity }}</text>
<uv-icon
name="plus-circle"
size="20"
color="#C70019"
@click="increaseQuantity(index)"
></uv-icon>
</view>
<view class="cell-input">
<uv-input
v-model="item.quantity"
placeholder="数量"
border="none"
:custom-style="{ backgroundColor: 'transparent', fontSize: '28rpx' }"
></uv-input>
</view>
<view class="cell-input">
<uv-input
v-model="item.amount"
placeholder="0.00"
placeholder="金额"
type="digit"
border="none"
:custom-style="{ backgroundColor: '#f5f5f5', borderRadius: '4px', textAlign: 'right' }"
:custom-style="{ backgroundColor: 'transparent', fontSize: '28rpx' }"
></uv-input>
<uv-icon
name="close-circle"
size="20"
color="#C70019"
@click="removeCostItem(index)"
></uv-icon>
</view>
<view class="add-cost-btn" @click="addCostItem">
<uv-icon name="plus-circle" size="20" color="#C70019"></uv-icon>
<text>添加费用项目</text>
<view class="cell-action">
<view class="action-btn delete-btn" @click="removeCostItem(index)" v-if="costList.length > 1">
<uv-icon name="close" size="14" color="#fff"></uv-icon>
</view>
<view class="action-btn add-btn" @click="addCostItem" v-if="index === costList.length - 1">
<uv-icon name="plus" size="14" color="#fff"></uv-icon>
</view>
</view>
</view>
</view>
@ -210,7 +207,7 @@
<view class="form-item" @click="showNextDatePicker">
<text class="label">下次保养日期</text>
<view class="select-area">
<text class="value" :class="{ placeholder: !malfunctionDate }">{{ malfunctionDate || '请选择' }}</text>
<text class="value" :class="{ placeholder: !nextMaintenanceDate }">{{ nextMaintenanceDate || '请选择' }}</text>
<uv-icon name="arrow-down" size="18" color="#000"></uv-icon>
</view>
</view>
@ -248,6 +245,7 @@
confirm-color="#C70019"
ref="datePicker"
mode="date"
v-model="timeValue"
@confirm="confirmDate"
></uv-datetime-picker>
@ -255,6 +253,7 @@
confirm-color="#C70019"
ref="nextDatePicker"
mode="date"
v-model="nextTimeValue"
@confirm="confirmNextDate"
></uv-datetime-picker>
</view>
@ -264,6 +263,8 @@
export default {
data() {
return {
timeValue: Number(new Date()),
nextTimeValue: Number(new Date()),
//
maintenanceName: '',
maintenanceDate: '',
@ -272,11 +273,10 @@ export default {
stateBackText: '',
stateBackImage: [],
isExpend: '0',
newCostName: '',
costList: [],
costList: [{ name: '', quantity: '', amount: '' }],
remarkText: '',
remarkImage: [],
malfunctionDate: '',
nextMaintenanceDate: '',
remark: '',
showpieceId: '',
submiting: false
@ -285,7 +285,9 @@ export default {
computed: {
//
amount() {
return this.costList.reduce((sum, item) => sum + (parseFloat(item.amount) * Number(item.quantity) || 0), 0)
return this.costList.reduce((sum, item) => {
return sum + (Number(item.quantity) * parseFloat(item.amount || 0))
}, 0)
}
},
methods: {
@ -308,31 +310,22 @@ export default {
//
confirmNextDate(e) {
// uv-datetime-picker
this.malfunctionDate = this.$utils.formatTime(e.value)
this.nextMaintenanceDate = this.$utils.formatTime(e.value)
},
//
selectCost(value) {
this.isExpend = value
if (!value) {
this.costList = []
this.newCostName = ''
if (value === '0') {
this.costList = [{ name: '', quantity: '', amount: '' }]
} else if (this.costList.length === 0) {
this.costList = [{ name: '', quantity: '', amount: '' }]
}
},
//
addCostItem() {
if (!this.newCostName.trim()) {
uni.showToast({ title: '请输入费用名称', icon: 'none' })
return
}
this.costList.push({
name: this.newCostName,
quantity: 1,
amount: ''
})
this.newCostName = ''
this.costList.push({ name: '', quantity: '', amount: '' })
},
//
@ -344,17 +337,6 @@ export default {
}
},
//
increaseQuantity(index) {
this.costList[index].quantity++
},
//
decreaseQuantity(index) {
if (this.costList[index].quantity > 1) {
this.costList[index].quantity--
}
},
//
async uploadBeforeImage() {
@ -472,7 +454,7 @@ export default {
amount: this.amount,
remarkText: this.remarkText,
remarkImage: this.remarkImage?.join(',') || '',
malfunctionDate: this.malfunctionDate,
nextMaintenanceDate: this.nextMaintenanceDate,
remark: this.remark,
showpieceId: this.showpieceId
}
@ -691,79 +673,78 @@ export default {
}
}
.cost-section {
.cost-input {
//
.cost-table {
margin-top: 24rpx;
border: 2rpx solid #f0f0f0;
border-radius: 8rpx;
overflow: hidden;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
border-bottom: 2rpx solid #f0f0f0;
background-color: #f5f5f5;
padding: 16rpx 0;
.label {
font-size: 30rpx;
.header-cell {
flex: 1;
text-align: center;
font-size: 28rpx;
font-weight: bold;
color: $primary-text-color;
flex-shrink: 0;
margin-right: 24rpx;
}
}
.cost-list {
.cost-header {
display: flex;
align-items: center;
padding: 24rpx 0;
border-bottom: 4rpx solid #f0f0f0;
.header-item {
flex: 1;
font-size: 28rpx;
font-weight: bold;
color: $primary-text-color;
text-align: center;
&:first-child {
text-align: left;
}
&:first-child {
flex: 2;
}
&:last-child {
width: 120rpx;
flex: none;
}
}
}
.table-row {
display: flex;
border-top: 2rpx solid #f0f0f0;
.cost-item {
display: flex;
align-items: center;
padding: 24rpx 0;
border-bottom: 2rpx solid #f0f0f0;
gap: 24rpx;
.cell-input {
flex: 1;
padding: 8rpx;
border-right: 2rpx solid #f0f0f0;
.cost-name {
flex: 1;
font-size: 28rpx;
color: $primary-text-color;
&:first-child {
flex: 2;
}
.quantity-control {
display: flex;
align-items: center;
gap: 16rpx;
.quantity {
font-size: 28rpx;
color: $primary-text-color;
min-width: 40rpx;
text-align: center;
}
&:last-child {
border-right: none;
}
}
.add-cost-btn {
.cell-action {
width: 120rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 16rpx;
padding: 24rpx 0;
color: $primary-color;
gap: 8rpx;
padding: 8rpx;
text {
font-size: 28rpx;
.action-btn {
width: 36rpx;
height: 36rpx;
padding: 4rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
&.add-btn {
background-color: #1a9c10;
}
&.delete-btn {
background-color: $primary-color;
}
}
}
}


+ 5
- 2
subPages/home/repairSubmit.vue View File

@ -147,7 +147,7 @@
<!-- 是否采取的对措施 -->
<view class="form-item">
<text class="label">是否采取的对措施</text>
<text class="label">是否采取临时措施</text>
<view class="radio-options">
<view
class="radio-item"
@ -251,6 +251,7 @@
<uv-datetime-picker
ref="firstOccurTimePicker"
mode="date"
v-model="firstTime"
confirm-color="#C70019"
@confirm="confirmFirstOccurTime"
></uv-datetime-picker>
@ -269,6 +270,7 @@
<uv-datetime-picker
confirm-color="#C70019"
ref="datePicker"
v-model="timeValue"
mode="date"
@confirm="confirmDate"
></uv-datetime-picker>
@ -294,7 +296,8 @@ export default {
isAffectExperience: '0',
remark: '',
showpieceId: '',
timeValue: Number(new Date()),
firstTime: Number(new Date()),
//
frequencyOptions: [
{ label: '持续性问题', value: '0' },


+ 12
- 3
subPages/repair/maintainSubmit.vue View File

@ -109,7 +109,7 @@
<!-- 是否采取临时措施 -->
<view class="form-item" v-if="!isCollapsed">
<text class="label">是否采取临时措施</text>
<text class="value red-text">{{ repairData.isTakeMeasure === '1' ? '是' : '否' }}</text>
<text class="value red-text">{{ repairData.isMeasure === '1' ? '是' : '否' }}</text>
</view>
<!-- 如有采取临时措施请填写措施说明 -->
@ -130,7 +130,7 @@
<!-- 是否影响体验 -->
<view class="form-item" v-if="!isCollapsed">
<text class="label">是否影响体验</text>
<text class="value red-text">{{ repairData.isAffectUsage === '1' ? '是' : '否' }}</text>
<text class="value red-text">{{ repairData.isAffectExperience === '1' ? '是' : '否' }}</text>
</view>
<view class="form-item" v-if="!isCollapsed">
@ -372,6 +372,7 @@
<uv-datetime-picker
confirm-color="#C70019"
ref="datePicker"
v-model="timeValue"
mode="date"
@confirm="confirmDate"
></uv-datetime-picker>
@ -382,10 +383,12 @@
export default {
data() {
return {
timeValue: Number(new Date()),
statusType: 'modify',
selectedStatus: '故障中',
isCollapsed: true,
id: '',
showpieceId: '',
//
statusMap: {
'故障中': '0',
@ -444,6 +447,7 @@ export default {
},
onLoad(args){
this.id = args.id
this.showpieceId = args.showpieceId
},
methods: {
//
@ -536,7 +540,7 @@ export default {
delete tempData.expenseList
}
const submitRes = await this.$api.exhibit.addRepair({
id: this.id,
id: this.showpieceId,
...tempData,
amount: this.amount
})
@ -546,6 +550,11 @@ export default {
title: submitRes.message,
icon: 'none'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 400)
}else {
uni.showToast({
title: submitRes.message,


Loading…
Cancel
Save