feat: 创建工单的优化调整

This commit is contained in:
2025-08-10 23:34:45 +08:00
parent bb33726459
commit 76a176d4cd
2 changed files with 22 additions and 16 deletions

View File

@@ -9,10 +9,10 @@
<image src="./images/icon_service.png" class="order-icon"></image>
<uni-data-select
v-if="!isCallSuccess && workOrderTypeList.length > 0"
class="order-select"
class="order-select"
placeholder="请选择服务工单"
v-model="workOrderTypeName"
:localdata="workOrderTypeList"
:localdata="workOrderTypeListSelectData"
@change="changeWorkOrderType"
></uni-data-select>
<text v-else class="order-description">{{ workOrderTypeName }}</text>
@@ -96,11 +96,16 @@ const contactPhone = ref("");
const isCallSuccess = ref(false); // 呼叫成功状态
const workOrderId = ref(0); // 工单ID
const workOrderTypeList = ref([])
const workOrderTypeListSelectData = ref([])
const changeWorkOrderType = (item) => {
console.log(item)
workOrderTypeId.value = item.value
workOrderTypeName.value = item.text
const changeWorkOrderType = (index) => {
if (index < 0 || index >= workOrderTypeListSelectData.value.length) {
return;
}
const item = workOrderTypeList.value[index]
console.log("item:", item)
workOrderTypeId.value = item.id
workOrderTypeName.value = item.workOrderTypeName
}
const handleCall = async () => {
@@ -177,17 +182,18 @@ const sendCreateWorkOrder = async () => {
/// 获取工单类型
const getWorkOrderType = async () => {
const res = await workOrderTypeListForBiz()
if(res.code === 0) {
res.data.forEach((item, index) => {
workOrderTypeList.value.push({
value: item.id,
text: item.workOrderTypeName,
})
if (res.code === 0) {
workOrderTypeList.value = res.data
workOrderTypeList.value.forEach((item, index) => {
workOrderTypeListSelectData.value.push({
value: index,
text: item.workOrderTypeName,
})
})
if (workOrderTypeList.value.length > 0) {
workOrderTypeId.value = workOrderTypeList.value[0].value
workOrderTypeName.value = workOrderTypeList.value[0].text
workOrderTypeId.value = workOrderTypeList.value[0].id
workOrderTypeName.value = workOrderTypeList.value[0].workOrderTypeName
}
}
}

View File

@@ -86,7 +86,7 @@
align-items: center;
margin-bottom: 10px;
font-size: 14px;
color: #666;
color: #333;
}
.detail-label {
@@ -103,7 +103,7 @@
outline: none;
width: calc(100% - 80px);
font-size: 14px;
color: #999;
color: #333;
border-bottom: 1px solid #ddd;
}