|
|
@ -12,7 +12,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 修改状态按钮 --> |
|
|
|
<button class="status-btn" :class="{ active: statusType === 'modify' }" @click="statusType = 'modify'"> |
|
|
|
<button class="status-btn" :class="{ active: statusType === 'modify' }" @click="modifyStatus"> |
|
|
|
<text class="status-text">修改状态</text> |
|
|
|
</button> |
|
|
|
</view> |
|
|
@ -27,13 +27,13 @@ |
|
|
|
<!-- 报修日期 --> |
|
|
|
<view class="form-item"> |
|
|
|
<text class="label">报修日期</text> |
|
|
|
<text class="value">{{ repairData.repairDate }}</text> |
|
|
|
<text class="value">{{ repairData.malfunctionDate }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 故障紧急程度 --> |
|
|
|
<view class="form-item"> |
|
|
|
<text class="label">故障紧急程度</text> |
|
|
|
<text class="value">{{ repairData.urgencyLevel }}</text> |
|
|
|
<text class="value">{{ repairData.urgency === '1' ? '紧急' : '一般' }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 故障情况描述 --> |
|
|
@ -43,9 +43,8 @@ |
|
|
|
|
|
|
|
<!-- 故障情况描述文本区域 --> |
|
|
|
<view class="content-text"> |
|
|
|
<!-- <text>{{ repairData.faultDescription }}</text> --> |
|
|
|
<uv-textarea |
|
|
|
v-model="repairData.faultDescription" |
|
|
|
v-model="repairData.malfunctionDesc" |
|
|
|
placeholder="展品故障描述" |
|
|
|
:maxlength="200" |
|
|
|
:show-confirm-bar="false" |
|
|
@ -65,30 +64,30 @@ |
|
|
|
<view class="image-container" v-if="!isCollapsed"> |
|
|
|
<image |
|
|
|
class="uploaded-image" |
|
|
|
v-for="(img, index) in repairData.imageList" |
|
|
|
v-for="(img, index) in getImageList(repairData.malfunctionImage)" |
|
|
|
:key="index" |
|
|
|
:src="img" |
|
|
|
:src="img.trim()" |
|
|
|
mode="aspectFill" |
|
|
|
@click="previewImage(img)" |
|
|
|
@click="previewImage(img.trim())" |
|
|
|
></image> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 故障首次发生时间 --> |
|
|
|
<view class="form-item" v-if="!isCollapsed"> |
|
|
|
<text class="label">故障首次发生时间</text> |
|
|
|
<text class="value">{{ repairData.firstOccurTime }}</text> |
|
|
|
<text class="value">{{ repairData.firstDate }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 发生频率 --> |
|
|
|
<view class="form-item" v-if="!isCollapsed"> |
|
|
|
<text class="label">发生频率</text> |
|
|
|
<text class="value red-text">{{ repairData.frequency }}</text> |
|
|
|
<text class="value red-text">{{ repairData.frequency === '1' ? '间歇性问题' : '持续性问题' }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 故障发生频率的触发条件 --> |
|
|
|
<view class="content-text" v-if="!isCollapsed"> |
|
|
|
<uv-textarea |
|
|
|
v-model="repairData.faultCondition" |
|
|
|
v-model="repairData.reason" |
|
|
|
placeholder="故障发生频率的触发条件" |
|
|
|
:maxlength="200" |
|
|
|
:show-confirm-bar="false" |
|
|
@ -99,28 +98,24 @@ |
|
|
|
:custom-style="{ backgroundColor: '#f5f5f5' }" |
|
|
|
></uv-textarea> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="content-text" v-if="!isCollapsed"> |
|
|
|
<text>{{ repairData.faultCondition }}</text> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 是否影响使用 --> |
|
|
|
<view class="form-item" v-if="!isCollapsed"> |
|
|
|
<text class="label">是否影响使用</text> |
|
|
|
<text class="value red-text">{{ repairData.impactUsage }}</text> |
|
|
|
<text class="value red-text">{{ repairData.isAffectUse === '1' ? '是' : '否' }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 是否采取临时措施 --> |
|
|
|
<view class="form-item" v-if="!isCollapsed"> |
|
|
|
<text class="label">是否采取临时措施</text> |
|
|
|
<text class="value red-text">{{ repairData.hasTakenMeasures ? '是' : '否' }}</text> |
|
|
|
<text class="value red-text">{{ repairData.isTakeMeasure === '1' ? '是' : '否' }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 如有采取临时措施请填写措施说明 --> |
|
|
|
<view class="content-text" v-if="!isCollapsed"> |
|
|
|
<!-- <text>{{ repairData.faultDescription }}</text> --> |
|
|
|
<uv-textarea |
|
|
|
v-model="repairData.temporaryMeasures" |
|
|
|
v-model="repairData.measureDesc" |
|
|
|
placeholder="如果有采取临时措施请填写措施说明" |
|
|
|
:maxlength="200" |
|
|
|
:show-confirm-bar="false" |
|
|
@ -132,14 +127,10 @@ |
|
|
|
></uv-textarea> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="content-text" v-if="!isCollapsed && repairData.hasTakenMeasures"> |
|
|
|
<text>{{ repairData.temporaryMeasures }}</text> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<!-- 是否影响体验 --> |
|
|
|
<view class="form-item" v-if="!isCollapsed"> |
|
|
|
<text class="label">是否影响体验</text> |
|
|
|
<text class="value red-text">{{ repairData.impactExperience ? '是' : '否' }}</text> |
|
|
|
<text class="value red-text">{{ repairData.isAffectUsage === '1' ? '是' : '否' }}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="form-item" v-if="!isCollapsed"> |
|
|
@ -147,7 +138,7 @@ |
|
|
|
</view> |
|
|
|
<!-- 备注 --> |
|
|
|
<view class="content-text" v-if="!isCollapsed"> |
|
|
|
<!-- <text>{{ repairData.faultDescription }}</text> --> |
|
|
|
|
|
|
|
<uv-textarea |
|
|
|
v-model="repairData.remark" |
|
|
|
placeholder="备注" |
|
|
@ -161,7 +152,7 @@ |
|
|
|
></uv-textarea> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 查看全部/收起按钮 --> |
|
|
|
<view class="collapse-btn" @click="toggleCollapse"> |
|
|
@ -182,7 +173,7 @@ |
|
|
|
<text class="label">维修人</text> |
|
|
|
<view class="input-area" > |
|
|
|
<input |
|
|
|
v-model="processData.repairPerson" |
|
|
|
v-model="processData.repairName" |
|
|
|
placeholder="请填写" |
|
|
|
class="input-field" |
|
|
|
ref="maintainerInput" |
|
|
@ -195,7 +186,7 @@ |
|
|
|
<text class="label">联系方式</text> |
|
|
|
<view class="input-area" > |
|
|
|
<input |
|
|
|
v-model="processData.contactPhone" |
|
|
|
v-model="processData.phone" |
|
|
|
placeholder="请填写" |
|
|
|
class="input-field" |
|
|
|
ref="maintainerInput" |
|
|
@ -218,13 +209,12 @@ |
|
|
|
</view> |
|
|
|
<view class="textarea-container"> |
|
|
|
<uv-textarea |
|
|
|
v-model="processData.processContent" |
|
|
|
v-model="processData.content" |
|
|
|
placeholder="请输入处理内容" |
|
|
|
:maxlength="200" |
|
|
|
:show-confirm-bar="false" |
|
|
|
height="60" |
|
|
|
border="none" |
|
|
|
disabled |
|
|
|
:textStyle="{ color: '#000' }" |
|
|
|
:custom-style="{ backgroundColor: '#f5f5f5' }" |
|
|
|
></uv-textarea> |
|
|
@ -235,8 +225,8 @@ |
|
|
|
<text class="label">上传图片</text> |
|
|
|
</view> |
|
|
|
<view class="image-upload"> |
|
|
|
<view v-for="(img, index) in processData.imageList" :key="index" class="image-item"> |
|
|
|
<image :src="img" mode="aspectFill" @click="previewImage(img)"></image> |
|
|
|
<view v-for="(img, index) in getImageList(processData.image)" :key="index" class="image-item"> |
|
|
|
<image :src="img.trim()" mode="aspectFill" @click="previewImage(img.trim())"></image> |
|
|
|
<view class="delete-btn" @click="deleteImage(index)"> |
|
|
|
<uv-icon name="close" size="12" color="#fff"></uv-icon> |
|
|
|
</view> |
|
|
@ -252,30 +242,31 @@ |
|
|
|
<view class="radio-options"> |
|
|
|
<view |
|
|
|
class="radio-item" |
|
|
|
:class="{ active: processData.hasCost === true }" |
|
|
|
@click="selectCost(true)" |
|
|
|
:class="{ active: processData.isExpend === '1' }" |
|
|
|
@click="selectCost('1')" |
|
|
|
> |
|
|
|
<view class="radio-dot" :class="{ active: processData.hasCost === true }"></view> |
|
|
|
<text :class="{ active: processData.hasCost === true }">是</text> |
|
|
|
<view class="radio-dot" :class="{ active: processData.isExpend === '1' }"></view> |
|
|
|
<text :class="{ active: processData.isExpend === '1' }">是</text> |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="radio-item" |
|
|
|
:class="{ active: processData.hasCost === false }" |
|
|
|
@click="selectCost(false)" |
|
|
|
:class="{ active: processData.isExpend === '0' }" |
|
|
|
@click="selectCost('0')" |
|
|
|
> |
|
|
|
<view class="radio-dot" :class="{ active: processData.hasCost === false }"></view> |
|
|
|
<text :class="{ active: processData.hasCost === false }">否</text> |
|
|
|
<view class="radio-dot" :class="{ active: processData.isExpend === '0' }"></view> |
|
|
|
<text :class="{ active: processData.isExpend === '0' }">否</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 产生费用 --> |
|
|
|
<view class="form-item" v-if="processData.hasCost"> |
|
|
|
<view class="form-item" v-if="processData.isExpend === '1'"> |
|
|
|
<text class="label">产生费用</text> |
|
|
|
<view class="input-area" > |
|
|
|
<input |
|
|
|
v-model="processData.totalCost" |
|
|
|
v-model="amount" |
|
|
|
placeholder="请输入费用" |
|
|
|
disabled |
|
|
|
class="input-field" |
|
|
|
ref="maintainerInput" |
|
|
|
/> |
|
|
@ -283,7 +274,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 费用详情表格 --> |
|
|
|
<view class="cost-table" v-if="processData.hasCost"> |
|
|
|
<view class="cost-table" v-if="processData.isExpend === '1'"> |
|
|
|
<view class="table-header"> |
|
|
|
<text class="header-cell">费用名称</text> |
|
|
|
<text class="header-cell">数量</text> |
|
|
@ -333,19 +324,19 @@ |
|
|
|
<view class="radio-options"> |
|
|
|
<view |
|
|
|
class="radio-item" |
|
|
|
:class="{ active: processData.isResolved === true }" |
|
|
|
@click="selectResolved(true)" |
|
|
|
:class="{ active: processData.isFix === '1' }" |
|
|
|
@click="selectResolved('1')" |
|
|
|
> |
|
|
|
<view class="radio-dot" :class="{ active: processData.isResolved === true }"></view> |
|
|
|
<text :class="{ active: processData.isResolved === true }">是</text> |
|
|
|
<view class="radio-dot" :class="{ active: processData.isFix === '1' }"></view> |
|
|
|
<text :class="{ active: processData.isFix === '1' }">是</text> |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="radio-item" |
|
|
|
:class="{ active: processData.isResolved === false }" |
|
|
|
@click="selectResolved(false)" |
|
|
|
:class="{ active: processData.isFix === '0' }" |
|
|
|
@click="selectResolved('0')" |
|
|
|
> |
|
|
|
<view class="radio-dot" :class="{ active: processData.isResolved === false }"></view> |
|
|
|
<text :class="{ active: processData.isResolved === false }">否</text> |
|
|
|
<view class="radio-dot" :class="{ active: processData.isFix === '0' }"></view> |
|
|
|
<text :class="{ active: processData.isFix === '0' }">否</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -378,13 +369,12 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 日期选择器 --> |
|
|
|
<uv-picker |
|
|
|
<uv-datetime-picker |
|
|
|
confirm-color="#C70019" |
|
|
|
ref="datePicker" |
|
|
|
:columns="dateColumns" |
|
|
|
mode="date" |
|
|
|
@confirm="confirmDate" |
|
|
|
@cancel="cancelDate" |
|
|
|
></uv-picker> |
|
|
|
></uv-datetime-picker> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -395,52 +385,165 @@ export default { |
|
|
|
statusType: 'modify', |
|
|
|
selectedStatus: '故障中', |
|
|
|
isCollapsed: true, |
|
|
|
|
|
|
|
id: '', |
|
|
|
// 映射表 |
|
|
|
statusMap: { |
|
|
|
'故障中': '0', |
|
|
|
'维修中': '1', |
|
|
|
'已解决': '2' |
|
|
|
}, |
|
|
|
// 报修基本信息(只读) |
|
|
|
repairData: { |
|
|
|
repairDate: '2025/03/31', |
|
|
|
urgencyLevel: '一般', |
|
|
|
faultDescription: '展品故障情况', |
|
|
|
imageList: [ |
|
|
|
'/static/商城_商品2.png', |
|
|
|
'/static/商城_商品2.png' |
|
|
|
], |
|
|
|
firstOccurTime: '2025/03/31', |
|
|
|
frequency: '持续性问题', |
|
|
|
faultCondition: '故障发生频率的触发条件说明', |
|
|
|
impactUsage: '是', |
|
|
|
hasTakenMeasures: true, |
|
|
|
temporaryMeasures: '已采取临时措施说明', |
|
|
|
impactExperience: true, |
|
|
|
remark: '备注信息' |
|
|
|
malfunctionDate: '2025-08-28', // 从接口 malfunctionDate 字段获取 |
|
|
|
urgency: '0', // 从接口 urgency 字段映射:0-一般,1-紧急,2-非常紧急 |
|
|
|
malfunctionDesc: '故障描述', // 从接口 malfunctionDesc 字段获取 |
|
|
|
malfunctionImage: '', // 从接口 malfunctionImage 字段获取(字符串格式,多张图片用逗号分隔) |
|
|
|
firstDate: '2025-08-27', // 从接口 firstDate 字段获取 |
|
|
|
frequency: '0', // 从接口 frequency 字段映射:0-偶发性,1-持续性 |
|
|
|
reason: '发生频率触发条件', // 从接口 reason 字段获取 |
|
|
|
isAffectUse: '0', // 从接口 isAffectUse 字段映射:0-否,1-是 |
|
|
|
isMeasure: '0', // 从接口 isMeasure 字段映射:0-否,1-是 |
|
|
|
measureDesc: '措施说明', // 从接口 measureDesc 字段获取 |
|
|
|
isAffectExperience: '0', // 从接口 isAffectExperience 字段映射:0-否,1-是 |
|
|
|
remark: '备注' // 从接口 remark 字段获取 |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理内容(可编辑) |
|
|
|
processData: { |
|
|
|
repairPerson: '', |
|
|
|
contactPhone: '', |
|
|
|
repairName: '', |
|
|
|
phone: '', |
|
|
|
repairDate: '', |
|
|
|
processContent: '', |
|
|
|
imageList: [], |
|
|
|
hasCost: null, |
|
|
|
totalCost: '', |
|
|
|
content: '', |
|
|
|
image: '', |
|
|
|
isExpend: '0', |
|
|
|
costDetails: [ |
|
|
|
{ name: '', quantity: '', amount: '' } |
|
|
|
], |
|
|
|
isResolved: null, |
|
|
|
isFix: '0', |
|
|
|
remark: '' |
|
|
|
}, |
|
|
|
|
|
|
|
// 日期选择器数据 |
|
|
|
dateColumns: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad() { |
|
|
|
this.initDatePicker() |
|
|
|
computed: { |
|
|
|
// 计算总金额 |
|
|
|
amount() { |
|
|
|
return this.processData.costDetails.reduce((sum, item) => { |
|
|
|
return sum + (Number(item.quantity) * Number(item.amount)) |
|
|
|
}, 0) |
|
|
|
} |
|
|
|
}, |
|
|
|
async onShow(){ |
|
|
|
await this.getRepairDetail() |
|
|
|
}, |
|
|
|
onLoad(args){ |
|
|
|
this.id = args.id |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// 修改状态 |
|
|
|
async modifyStatus(){ |
|
|
|
const res = await this.$api.exhibit.updateMalfunction({ |
|
|
|
id: this.id, |
|
|
|
status: this.statusMap[this.selectedStatus] |
|
|
|
}) |
|
|
|
if (res.code === 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: '修改成功', |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取报修详情 |
|
|
|
async getRepairDetail() { |
|
|
|
const queryRes = await this.$api.exhibit.queryMalfunctionById({ |
|
|
|
malfunctionId: this.id |
|
|
|
}) |
|
|
|
if (queryRes.code === 200) { |
|
|
|
this.repairData = queryRes.result |
|
|
|
} |
|
|
|
}, |
|
|
|
// 立即维修 |
|
|
|
async startRepair() { |
|
|
|
// 验证必填项 |
|
|
|
if (!this.processData.repairName) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入维修人', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.processData.phone) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入联系方式', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.processData.repairDate) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请选择维修日期', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.processData.content) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入处理内容', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.processData.isFix === null) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请选择问题是否解决', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.processData.isExpend === '1') { |
|
|
|
// 如果总金额为0则没有消费信息 |
|
|
|
if (!this.amount) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请添加费用明细', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
const tempData = {...this.processData} |
|
|
|
const tempDataList = [...this.processData.costDetails] |
|
|
|
const submitRes = await this.$api.exhibit.addRepair({ |
|
|
|
id: this.id, |
|
|
|
...tempData, |
|
|
|
amount: this.amount, |
|
|
|
expenseList: tempDataList.map(item => `${item.name},${item.quantity},${item.amount}`).join(';') |
|
|
|
}) |
|
|
|
|
|
|
|
if (submitRes.code === 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: submitRes.message, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}else { |
|
|
|
uni.showToast({ |
|
|
|
title: submitRes.message, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取图片列表 |
|
|
|
getImageList(imageStr) { |
|
|
|
if (!imageStr || typeof imageStr !== 'string') { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return imageStr.split(',').filter(img => img && img.trim()) |
|
|
|
}, |
|
|
|
// 切换折叠状态 |
|
|
|
toggleCollapse() { |
|
|
|
this.isCollapsed = !this.isCollapsed |
|
|
@ -461,38 +564,11 @@ export default { |
|
|
|
|
|
|
|
// 确认日期 |
|
|
|
confirmDate(e) { |
|
|
|
const { indexs, value } = e |
|
|
|
this.processData.repairDate = value.join('/') |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消日期选择 |
|
|
|
cancelDate() { |
|
|
|
// 取消选择 |
|
|
|
}, |
|
|
|
|
|
|
|
// 初始化日期选择器 |
|
|
|
initDatePicker() { |
|
|
|
const currentYear = new Date().getFullYear() |
|
|
|
const years = [] |
|
|
|
const months = [] |
|
|
|
const days = [] |
|
|
|
|
|
|
|
// 生成年份 |
|
|
|
for (let i = currentYear - 10; i <= currentYear + 10; i++) { |
|
|
|
years.push(i + '年') |
|
|
|
} |
|
|
|
|
|
|
|
// 生成月份 |
|
|
|
for (let i = 1; i <= 12; i++) { |
|
|
|
months.push(i.toString().padStart(2, '0') + '月') |
|
|
|
} |
|
|
|
|
|
|
|
// 生成日期 |
|
|
|
for (let i = 1; i <= 31; i++) { |
|
|
|
days.push(i.toString().padStart(2, '0') + '日') |
|
|
|
} |
|
|
|
|
|
|
|
this.dateColumns = [years, months, days] |
|
|
|
const date = new Date(e.value) |
|
|
|
const year = date.getFullYear() |
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0') |
|
|
|
const day = String(date.getDate()).padStart(2, '0') |
|
|
|
this.processData.repairDate = `${year}-${month}-${day}` |
|
|
|
}, |
|
|
|
|
|
|
|
// 上传图片 |
|
|
@ -502,7 +578,12 @@ export default { |
|
|
|
if (result && result.success) { |
|
|
|
console.log(result); |
|
|
|
|
|
|
|
this.processData.imageList.push(result.url) |
|
|
|
// 将新图片URL添加到字符串中 |
|
|
|
if (this.processData.image) { |
|
|
|
this.processData.image += ',' + result.url |
|
|
|
} else { |
|
|
|
this.processData.image = result.url |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('图片上传失败:', error) |
|
|
@ -515,14 +596,16 @@ export default { |
|
|
|
|
|
|
|
// 删除图片 |
|
|
|
deleteImage(index) { |
|
|
|
this.processData.imageList.splice(index, 1) |
|
|
|
const imageList = this.getImageList(this.processData.image) |
|
|
|
imageList.splice(index, 1) |
|
|
|
this.processData.image = imageList.join(',') |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择是否产生费用 |
|
|
|
selectCost(value) { |
|
|
|
this.processData.hasCost = value |
|
|
|
this.processData.isExpend = value |
|
|
|
if (!value) { |
|
|
|
this.processData.totalCost = '' |
|
|
|
this.processData.amount = 0 |
|
|
|
this.processData.costDetails = [{ name: '', quantity: '', amount: '' }] |
|
|
|
} |
|
|
|
}, |
|
|
@ -539,81 +622,21 @@ export default { |
|
|
|
|
|
|
|
// 选择问题是否解决 |
|
|
|
selectResolved(value) { |
|
|
|
this.processData.isResolved = value |
|
|
|
this.processData.isFix = value |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示状态选择器 |
|
|
|
showStatusPicker() { |
|
|
|
uni.showActionSheet({ |
|
|
|
itemList: ['故障中', '维修中', '已完成', '暂停维修'], |
|
|
|
itemList: ['故障中', '维修中', '已解决'], |
|
|
|
success: (res) => { |
|
|
|
const statusList = ['故障中', '维修中', '已完成', '暂停维修'] |
|
|
|
const statusList = ['故障中', '维修中', '已解决'] |
|
|
|
this.selectedStatus = statusList[res.tapIndex] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 立即维修 |
|
|
|
startRepair() { |
|
|
|
// 验证必填项 |
|
|
|
if (!this.processData.repairPerson) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入维修人', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.processData.contactPhone) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入联系方式', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.processData.repairDate) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请选择维修日期', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.processData.processContent) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入处理内容', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.processData.isResolved === null) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请选择问题是否解决', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 提交数据 |
|
|
|
uni.showLoading({ |
|
|
|
title: '提交中...' |
|
|
|
}) |
|
|
|
|
|
|
|
// 模拟提交 |
|
|
|
setTimeout(() => { |
|
|
|
uni.hideLoading() |
|
|
|
uni.showToast({ |
|
|
|
title: '提交成功', |
|
|
|
icon: 'success' |
|
|
|
}) |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
uni.navigateBack() |
|
|
|
}, 1500) |
|
|
|
}, 2000) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|