|
|
@@ -39,29 +39,9 @@
|
|
|
<text class="info-label">接单时间</text>
|
|
|
<text class="info-value">{{ acceptTime ?? '' }}</text>
|
|
|
</view>
|
|
|
- <!-- <view class="info-item">
|
|
|
- <text class="info-label">挂起原因</text>
|
|
|
- <view class="form-picker" @click="showReasonPicker = true">
|
|
|
- <view class="picker-display">
|
|
|
- <text v-if="suspendReason" class="selected-value">{{ suspendReason }}</text>
|
|
|
- <text v-else class="placeholder">请选择挂起原因</text>
|
|
|
- <text class="arrow">▼</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- <view class="info-section">
|
|
|
- <view class="section-title">
|
|
|
- <text class="section-title-text">工作负责人</text>
|
|
|
- </view>
|
|
|
- <view class="info-card">
|
|
|
- <view class="info-item">
|
|
|
- <input class="input" type="text" placeholder="请输入工作负责人" v-model="teamLeaderName" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
- <!-- 工作负责人选择 -->
|
|
|
+ <!-- 退回原因选择 -->
|
|
|
<view class="info-section">
|
|
|
<!-- <view class="section-title">
|
|
|
<text class="section-title-text">退回类型</text>
|
|
|
@@ -69,26 +49,26 @@
|
|
|
<view class="info-card">
|
|
|
<view class="info-item">
|
|
|
<view class="info-label">
|
|
|
- <text class="form-label required">退回类型<text style="color: red;">*</text></text>
|
|
|
+ <text class="form-label required">退回原因<text style="color: red;">*</text></text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
<view class="form-picker" @click="showReasonPicker = true">
|
|
|
<view class="picker-display">
|
|
|
<text v-if="returnType" class="selected-value">{{ returnTypeLabel }}</text>
|
|
|
- <text v-else class="placeholder">请选择退回类型</text>
|
|
|
+ <text v-else class="placeholder">请选择退回原因</text>
|
|
|
<text class="arrow">▼</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="info-item">
|
|
|
+ <view class="info-item" v-if="returnType == '0'">
|
|
|
<view class="info-label">
|
|
|
- <text class="form-label required">退回原因<text style="color: red;">*</text></text>
|
|
|
+ <text class="form-label required">退回说明<text style="color: red;">*</text></text>
|
|
|
</view>
|
|
|
<view class="info-value">
|
|
|
<textarea
|
|
|
class="reject-reason-textarea"
|
|
|
- placeholder="请输入退回原因(必填)"
|
|
|
+ placeholder="请输入退回说明(必填)"
|
|
|
v-model="returnReason"
|
|
|
maxlength="100"
|
|
|
:show-confirm-bar="false"
|
|
|
@@ -159,11 +139,13 @@
|
|
|
const returnType = ref<string>('')
|
|
|
const returnReason = ref<string>("")
|
|
|
const returnTypeLabel = ref<string>("")
|
|
|
-
|
|
|
+ const acceptReturnType = ref<string>('')
|
|
|
+ const acceptReturnReason = ref<string>("")
|
|
|
+
|
|
|
const teamLeaderName = ref<string>("")
|
|
|
// 添加字典加载状态
|
|
|
const dictLoaded = ref<boolean>(false)
|
|
|
-
|
|
|
+
|
|
|
// 选择器选项类型
|
|
|
type PickerOption = {
|
|
|
label: string
|
|
|
@@ -171,7 +153,7 @@
|
|
|
}
|
|
|
|
|
|
// 选中的挂起原因
|
|
|
-
|
|
|
+
|
|
|
const selectedReasonIndex = ref<number>(-1)
|
|
|
const returnTypeOptions = ref<PickerOption[]>([])
|
|
|
const showReasonPicker = ref<boolean>(false)
|
|
|
@@ -179,7 +161,14 @@
|
|
|
// 获取负责人列表(使用用户列表接口)
|
|
|
const dictList = async (): Promise<void> => {
|
|
|
try {
|
|
|
- const result = await getDictDataByType('gxt_return_type')
|
|
|
+ const dictString = ref("")
|
|
|
+ if(workOrderStatus.value == 'assigned') {
|
|
|
+ dictString.value = "gxt_accept_return_type"
|
|
|
+ } else {
|
|
|
+ dictString.value = "gxt_return_type"
|
|
|
+ }
|
|
|
+
|
|
|
+ const result = await getDictDataByType(dictString.value)
|
|
|
const resultObj = result as UTSJSONObject
|
|
|
|
|
|
if (resultObj['code'] == 200) {
|
|
|
@@ -230,18 +219,18 @@
|
|
|
|
|
|
const isDealing = ref(false)
|
|
|
const hasDealed = ref(false)
|
|
|
- // 处理接单操作
|
|
|
+ // 处理退回操作
|
|
|
const handleSuspendOrder = async (): Promise<void> => {
|
|
|
if (returnType.value == '') {
|
|
|
uni.showToast({
|
|
|
- title: '请选择退回类型',
|
|
|
+ title: '请选择退回原因',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (returnReason.value == '' || returnReason.value.trim() === '') {
|
|
|
+ if (returnType.value == '0' && (returnReason.value == '' || returnReason.value.trim() === '')) {
|
|
|
uni.showToast({
|
|
|
- title: '请选输入退回原因',
|
|
|
+ title: '请选输入退回说明',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
@@ -253,11 +242,13 @@
|
|
|
orderType: orderType.value,
|
|
|
workOrderProjectNo: workOrderProjectNo.value,
|
|
|
workOrderStatus: workOrderStatus.value,
|
|
|
- returnType: returnType.value,
|
|
|
- returnReason: returnReason.value
|
|
|
+ returnType: workOrderStatus.value != 'assigned' ? returnType.value : null,
|
|
|
+ returnReason: workOrderStatus.value != 'assigned' ? returnReason.value : null,
|
|
|
+ acceptReturnType: workOrderStatus.value == 'assigned' ? returnType.value : null,
|
|
|
+ acceptReturnReason: workOrderStatus.value == 'assigned' ? returnReason.value : null,
|
|
|
// gxtRepairOrder:
|
|
|
} as UTSJSONObject
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
const result = await returnRepairOrder(subOrder)
|
|
|
const resultObj = result as UTSJSONObject
|
|
|
@@ -302,8 +293,8 @@
|
|
|
const loadDetail = async (id: string, orderType?: string): Promise<void> => {
|
|
|
try {
|
|
|
loading.value = true
|
|
|
-
|
|
|
- await dictList()
|
|
|
+
|
|
|
+
|
|
|
|
|
|
let result: any;
|
|
|
|
|
|
@@ -332,6 +323,9 @@
|
|
|
acceptTime.value = (data['acceptTime'] as string | null) ?? ''
|
|
|
returnType.value = (data['returnType'] as string | null) ?? ''
|
|
|
returnReason.value = (data['returnReason'] as string | null) ?? ''
|
|
|
+ acceptReturnType.value = (data['acceptReturnType'] as string | null) ?? ''
|
|
|
+ acceptReturnReason.value = (data['acceptReturnReason'] as string | null) ?? ''
|
|
|
+ await dictList()
|
|
|
if (returnTypeOptions.value.length > 0 && returnType.value != '') {
|
|
|
// 循环匹配
|
|
|
for (const option of returnTypeOptions.value) {
|