前端-胡立永 2 weeks ago
parent
commit
72ffa44354
1 changed files with 50 additions and 3 deletions
  1. +50
    -3
      pages/manager/inspect-result.vue

+ 50
- 3
pages/manager/inspect-result.vue View File

@ -143,6 +143,10 @@
</view>
</view>
</view>
<view class="popup-section">
<text class="section-label">自定义理由</text>
<textarea class="custom-reason-input" v-model="customReason" placeholder="请输入自定义理由..." maxlength="200" />
</view>
<view class="popup-section">
<text class="section-label">选择理由</text>
<view v-for="(item, index) in reasonOptions" :key="item.id" class="reason-row" @tap="toggleReason(index)">
@ -176,6 +180,7 @@ export default {
reasonImages: [],
reasonOptions: [],
reasonChecked: [],
customReason: '', //
currentReasonItem: null,
isPopupOpen: false, //
scrollTop: 0 //
@ -449,14 +454,29 @@ export default {
if (res.code == 200) {
this.reasonOptions = res.result;
if (item.testingInstructions && item.testingInstructions.trim() !== '') {
this.reasonChecked = item.testingInstructions.split(',').map(s => s.trim()).filter(Boolean)
const instructions = item.testingInstructions.split(',').map(s => s.trim()).filter(Boolean)
//
this.reasonChecked = []
this.customReason = ''
instructions.forEach(instruction => {
const foundOption = this.reasonOptions.find(option => option.reason === instruction)
if (foundOption) {
this.reasonChecked.push(instruction)
} else {
//
this.customReason = this.customReason ? `${this.customReason},${instruction}` : instruction
}
})
} else {
this.reasonChecked = []
this.customReason = ''
}
this.$nextTick(() => {
this.reasonChecked = [...this.reasonChecked]
console.log('[selectReasonForUnqualified] reasonOptions:', this.reasonOptions)
console.log('[selectReasonForUnqualified] reasonChecked:', this.reasonChecked)
console.log('[selectReasonForUnqualified] customReason:', this.customReason)
})
} else {
console.error('[selectReasonForUnqualified] API返回错误:', res)
@ -490,7 +510,7 @@ export default {
uni.chooseMedia({
count: 3 - this.reasonImages.length, //
mediaType: ['image'], //
sourceType: ['album', 'camera'], //
sourceType: ['camera'], // 使
maxDuration: 30,
sizeType: [ 'compressed'],
camera: 'back',
@ -560,8 +580,13 @@ export default {
saveReason() {
if (this.currentReasonItem) {
console.log('this.currentReasonItem', this.currentReasonItem)
//
const allReasons = [...this.reasonChecked]
if (this.customReason && this.customReason.trim() !== '') {
allReasons.push(this.customReason.trim())
}
//
this.currentReasonItem.testingInstructions = this.reasonChecked.join(',')
this.currentReasonItem.testingInstructions = allReasons.join(',')
this.currentReasonItem.testingImages = this.reasonImages.join(',')
}
this.closeReasonPopup()
@ -1031,6 +1056,28 @@ export default {
display: block;
font-weight: 500;
}
.custom-reason-input {
width: 100%;
min-height: 80px;
padding: 12px;
border: 1px solid #e0e0e0;
border-radius: 8px;
font-size: 14px;
color: #222;
background: #fff;
resize: none;
box-sizing: border-box;
&::placeholder {
color: #999;
}
&:focus {
border-color: #ffb400;
outline: none;
}
}
.img-list {
display: flex;


Loading…
Cancel
Save