diff --git a/components/CreateServiceOrder/index.vue b/components/CreateServiceOrder/index.vue
index 774cb87..c936660 100644
--- a/components/CreateServiceOrder/index.vue
+++ b/components/CreateServiceOrder/index.vue
@@ -9,10 +9,10 @@
{{ workOrderTypeName }}
@@ -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
}
}
}
diff --git a/components/CreateServiceOrder/styles/index.scss b/components/CreateServiceOrder/styles/index.scss
index 74e93db..4e1700e 100644
--- a/components/CreateServiceOrder/styles/index.scss
+++ b/components/CreateServiceOrder/styles/index.scss
@@ -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;
}