|
|
|
@ -29,20 +29,28 @@ |
|
|
|
<text class="arrow-icon">▼</text> |
|
|
|
</view> |
|
|
|
<view class="picker-btn" :class="{ active: selectedPerson }" @click="showPersonPicker" > |
|
|
|
<text class="btn-text">{{ selectedPerson || '人员' }}</text> |
|
|
|
<text class="btn-text">{{ selectedPerson.label || '人员' }}</text> |
|
|
|
<text class="arrow-icon">▼</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 时间选择器 --> |
|
|
|
<uv-picker |
|
|
|
<!-- <uv-picker |
|
|
|
ref="timePicker" |
|
|
|
:columns="timeColumns" |
|
|
|
@confirm="onTimeConfirm" |
|
|
|
@cancel="onTimeCancel" |
|
|
|
title="选择时间范围" |
|
|
|
confirmColor="#C70019" |
|
|
|
></uv-picker> |
|
|
|
></uv-picker> --> |
|
|
|
|
|
|
|
<!-- 日期选择器 --> |
|
|
|
<uv-datetime-picker |
|
|
|
confirm-color="#C70019" |
|
|
|
ref="timePicker" |
|
|
|
mode="date" |
|
|
|
@confirm="onTimeConfirm" |
|
|
|
></uv-datetime-picker> |
|
|
|
|
|
|
|
<!-- 人员选择器 --> |
|
|
|
<uv-picker |
|
|
|
@ -50,6 +58,7 @@ |
|
|
|
:columns="personColumns" |
|
|
|
@confirm="onPersonConfirm" |
|
|
|
@cancel="onPersonCancel" |
|
|
|
keyName="label" |
|
|
|
title="选择人员" |
|
|
|
confirmColor="#C70019" |
|
|
|
></uv-picker> |
|
|
|
@ -86,11 +95,11 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 上传图片 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">上传图片</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="image-container" v-if="!record.isCollapsed"> |
|
|
|
<view class="image-container" v-if="!collapsedStates[index]"> |
|
|
|
<image class="uploaded-image" :src="record.uploadImage" mode="aspectFill"></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -124,7 +133,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 保养前图片 --> |
|
|
|
<view class="image-container" v-if="!record.isCollapsed"> |
|
|
|
<view class="image-container" v-if="!collapsedStates[index]"> |
|
|
|
<image |
|
|
|
class="uploaded-image" |
|
|
|
v-for="(img, imgIndex) in record.beforeImages" |
|
|
|
@ -134,17 +143,17 @@ |
|
|
|
></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">保养后状态</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 保养后状态文本区域 --> |
|
|
|
<view class="content-text" v-if="!record.isCollapsed"> |
|
|
|
<view class="content-text" v-if="!collapsedStates[index]"> |
|
|
|
<text>{{ record.afterStatus }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 保养后图片 --> |
|
|
|
<view class="image-container" v-if="!record.isCollapsed"> |
|
|
|
<view class="image-container" v-if="!collapsedStates[index]"> |
|
|
|
<image |
|
|
|
class="uploaded-image" |
|
|
|
v-for="(img, imgIndex) in record.afterImages" |
|
|
|
@ -155,33 +164,33 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 是否产生费用 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">是否产生费用</text> |
|
|
|
<text class="value red-text">{{ record.hasCost }}</text> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 查看全部按钮(收起状态时显示) --> |
|
|
|
<!-- <view class="view-all-btn" v-if="record.isCollapsed" @click="toggleCollapse(index)"> |
|
|
|
<!-- <view class="view-all-btn" v-if="collapsedStates[index]" @click="toggleCollapse(index)"> |
|
|
|
<text class="view-all-text">查看全部</text> |
|
|
|
<text class="view-all-icon">▼</text> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<!-- 产生费用 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">产生费用</text> |
|
|
|
<text class="value red-text">{{ record.totalCost }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 费用详情表格 --> |
|
|
|
<view class="cost-table" v-if="!record.isCollapsed"> |
|
|
|
<view class="cost-table" v-if="!collapsedStates[index]"> |
|
|
|
<view class="table-header"> |
|
|
|
<text class="header-cell">费用名称</text> |
|
|
|
<text class="header-cell">数量</text> |
|
|
|
<text class="header-cell">金额</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="table-row" v-for="(item, index) in record.costDetails" :key="index"> |
|
|
|
<view class="table-row" v-for="(item, costIndex) in record.costDetails" :key="costIndex"> |
|
|
|
<text class="cell">{{ item.name }}</text> |
|
|
|
<text class="cell">{{ item.quantity }}</text> |
|
|
|
<text class="cell">{{ item.amount }}</text> |
|
|
|
@ -191,18 +200,18 @@ |
|
|
|
<!-- 维修记录特有字段 --> |
|
|
|
<template v-if="activeMainTab === 'repair'"> |
|
|
|
<!-- 问题是否解决 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">问题是否解决</text> |
|
|
|
<text class="value red-text">{{ record.isResolved }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 备注 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">备注</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 备注文本区域 --> |
|
|
|
<view class="content-text" v-if="!record.isCollapsed"> |
|
|
|
<view class="content-text" v-if="!collapsedStates[index]"> |
|
|
|
<text>{{ record.remark }}</text> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -210,35 +219,35 @@ |
|
|
|
<!-- 保养记录特有字段 --> |
|
|
|
<template v-else> |
|
|
|
<!-- 附件信息 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">附件信息</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 附件信息文本区域 --> |
|
|
|
<view class="content-text" v-if="!record.isCollapsed"> |
|
|
|
<view class="content-text" v-if="!collapsedStates[index]"> |
|
|
|
<text>{{ record.attachmentInfo }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 附件图片 --> |
|
|
|
<view class="image-container" v-if="!record.isCollapsed"> |
|
|
|
<view class="image-container" v-if="!collapsedStates[index]"> |
|
|
|
<image class="uploaded-image" :src="record.attachmentImage" mode="aspectFill"></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 保养备注 --> |
|
|
|
<view class="info-row" v-if="!record.isCollapsed"> |
|
|
|
<view class="info-row" v-if="!collapsedStates[index]"> |
|
|
|
<text class="label">备注</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 保养备注文本区域 --> |
|
|
|
<view class="content-text" v-if="!record.isCollapsed"> |
|
|
|
<view class="content-text" v-if="!collapsedStates[index]"> |
|
|
|
<text>{{ record.maintainRemark }}</text> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 收起按钮 --> |
|
|
|
<view class="collapse-btn" @click="toggleCollapse(index)"> |
|
|
|
<text class="collapse-text">{{ record.isCollapsed ? '查看全部' : '收起' }}</text> |
|
|
|
<text class="collapse-icon">{{ record.isCollapsed ? '▼' : '▲' }}</text> |
|
|
|
<text class="collapse-text">{{ collapsedStates[index] ? '查看全部' : '收起' }}</text> |
|
|
|
<text class="collapse-icon">{{ collapsedStates[index] ? '▼' : '▲' }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -256,6 +265,7 @@ export default { |
|
|
|
mixinListApi: 'exhibit.queryRepairList', |
|
|
|
activeMainTab: 'repair', // 当前激活的主Tab |
|
|
|
activeFilter: 0, // 当前激活的筛选器 |
|
|
|
collapsedStates: [], // 控制每个记录项的展开/收起状态 |
|
|
|
filterOptions: [ |
|
|
|
{ name: '时间' }, |
|
|
|
{ name: '人员' } |
|
|
|
@ -265,9 +275,7 @@ export default { |
|
|
|
timeColumns: [ |
|
|
|
['今天', '昨天', '本周', '本月', '上月', '自定义'] |
|
|
|
], |
|
|
|
personColumns: [ |
|
|
|
['张三', '李四', '王五', '赵六', '钱七', '孙八'] |
|
|
|
], |
|
|
|
personColumns: [ ], |
|
|
|
// 维修记录数据 |
|
|
|
repairData: [ |
|
|
|
{ |
|
|
|
@ -284,7 +292,6 @@ export default { |
|
|
|
], |
|
|
|
isResolved: '是', |
|
|
|
remark: '文字内容', |
|
|
|
isCollapsed: true // 控制收起状态 |
|
|
|
}, |
|
|
|
{ |
|
|
|
repairPerson: '李华', |
|
|
|
@ -299,8 +306,7 @@ export default { |
|
|
|
{ name: '达玛树脂', quantity: '1', amount: '200.00' } |
|
|
|
], |
|
|
|
isResolved: '是', |
|
|
|
remark: '文字内容', |
|
|
|
isCollapsed: true // 控制收起状态 |
|
|
|
remark: '文字内容' |
|
|
|
}, |
|
|
|
], |
|
|
|
// 保养记录数据 |
|
|
|
@ -320,8 +326,7 @@ export default { |
|
|
|
], |
|
|
|
attachmentInfo: '附件信息', |
|
|
|
maintainRemark: '文字内容', |
|
|
|
attachmentImage: '/static/商城_商品2.png', |
|
|
|
isCollapsed: true // 控制收起状态 |
|
|
|
attachmentImage: '/static/商城_商品2.png' |
|
|
|
}, |
|
|
|
{ |
|
|
|
maintainPerson: '李华', |
|
|
|
@ -338,16 +343,12 @@ export default { |
|
|
|
], |
|
|
|
attachmentInfo: '附件信息', |
|
|
|
maintainRemark: '文字内容', |
|
|
|
attachmentImage: '/static/商城_商品2.png', |
|
|
|
isCollapsed: true // 控制收起状态 |
|
|
|
attachmentImage: '/static/商城_商品2.png' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// list() { |
|
|
|
// return this.activeMainTab === 'repair' ? this.repairData : this.maintainData |
|
|
|
// }, |
|
|
|
contentText() { |
|
|
|
const tabText = this.activeMainTab === 'repair' ? '维修' : '保养' |
|
|
|
const filterText = this.filterOptions[this.activeFilter].name |
|
|
|
@ -364,18 +365,37 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
mixinSetParams() { |
|
|
|
const params = { } |
|
|
|
if (this.activeMainTab === 'repair' && this.selectedTime) { |
|
|
|
params.repairDate = this.selectedTime |
|
|
|
} else if (this.activeMainTab === 'maintain' && this.selectedTime) { |
|
|
|
params.maintainDate = this.selectedTime |
|
|
|
} |
|
|
|
if (this.selectedPerson) { |
|
|
|
params.id = this.selectedPerson.id |
|
|
|
} |
|
|
|
return { |
|
|
|
showpieceId: this.showpieceId |
|
|
|
showpieceId: this.showpieceId, |
|
|
|
...params |
|
|
|
} |
|
|
|
}, |
|
|
|
switchMainTab(tab) { |
|
|
|
async switchMainTab(tab) { |
|
|
|
this.activeMainTab = tab |
|
|
|
this.mixinListApi = this.activeMainTab === 'repair' ? 'exhibit.queryRepairList' : 'exhibit.queryMaintenanceList' |
|
|
|
this.onFilterChange() |
|
|
|
this.initPage() |
|
|
|
await this.getList(true) |
|
|
|
this.initCollapsedStates() |
|
|
|
}, |
|
|
|
onFilterChange(index) { |
|
|
|
this.activeFilter = index |
|
|
|
initCollapsedStates() { |
|
|
|
this.collapsedStates = new Array(this.list.length).fill(true) |
|
|
|
}, |
|
|
|
onFilterChange() { |
|
|
|
// this.activeFilter = index |
|
|
|
// 切换筛选器时清空选择 |
|
|
|
this.selectedTime = '' |
|
|
|
this.selectedPerson = '' |
|
|
|
|
|
|
|
}, |
|
|
|
showTimePicker() { |
|
|
|
this.$refs.timePicker.open() |
|
|
|
@ -383,9 +403,11 @@ export default { |
|
|
|
showPersonPicker() { |
|
|
|
this.$refs.personPicker.open() |
|
|
|
}, |
|
|
|
onTimeConfirm(value) { |
|
|
|
this.selectedTime = value.value[0] |
|
|
|
console.log('选择的时间:', value) |
|
|
|
onTimeConfirm(e) { |
|
|
|
const date = new Date(e.value) |
|
|
|
this.selectedTime = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}` |
|
|
|
this.initPage() |
|
|
|
this.getList(true) |
|
|
|
}, |
|
|
|
onTimeCancel() { |
|
|
|
console.log('取消选择时间') |
|
|
|
@ -393,22 +415,25 @@ export default { |
|
|
|
onPersonConfirm(value) { |
|
|
|
this.selectedPerson = value.value[0] |
|
|
|
console.log('选择的人员:', value) |
|
|
|
this.initPage() |
|
|
|
this.getList(true) |
|
|
|
}, |
|
|
|
onPersonCancel() { |
|
|
|
console.log('取消选择人员') |
|
|
|
}, |
|
|
|
toggleCollapse(index) { |
|
|
|
if (this.activeMainTab === 'repair') { |
|
|
|
this.repairData[index].isCollapsed = !this.repairData[index].isCollapsed |
|
|
|
console.log('收起/展开费用详情', this.repairData[index].isCollapsed) |
|
|
|
} else { |
|
|
|
this.maintainData[index].isCollapsed = !this.maintainData[index].isCollapsed |
|
|
|
console.log('收起/展开费用详情', this.maintainData[index].isCollapsed) |
|
|
|
} |
|
|
|
this.$set(this.collapsedStates, index, !this.collapsedStates[index]) |
|
|
|
console.log('收起/展开费用详情', this.collapsedStates[index]) |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(args){{ |
|
|
|
async onLoad(args){{ |
|
|
|
this.showpieceId = args.id |
|
|
|
this.initCollapsedStates() |
|
|
|
const userRes = await this.$api.config.queryUserList() |
|
|
|
this.personColumns = [[...userRes.result.records.map(item => ({ |
|
|
|
label: item.nickName, |
|
|
|
id: item.id |
|
|
|
}))]] |
|
|
|
}} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|