فهرست منبع

完善报修申请页面功能

fanghuisheng 1 سال پیش
والد
کامیت
14f9ae2393
2فایلهای تغییر یافته به همراه73 افزوده شده و 4 حذف شده
  1. 9 0
      src/api/common/repairReport.js
  2. 64 4
      src/pages/common/repairReport/index.vue

+ 9 - 0
src/api/common/repairReport.js

@@ -16,4 +16,13 @@ export function getHistory(param) {
         method: "POST",
         data: param,
     });
+}
+
+//获取项目历史信息
+export function getAddHistoryInfo(param) {
+    return request({
+        url: "/service-iot/crmDeviceRepair/getAddHistoryInfo",
+        method: "GET",
+        data: param,
+    });
 }

+ 64 - 4
src/pages/common/repairReport/index.vue

@@ -19,8 +19,12 @@
         <u--form :model="form" ref="uForm" :rules="rules" labelWidth="80">
           <view style="padding: 10px 0 10px 0; background: #ffffff">
             <view style="padding-left: 9px">
-              <u-form-item label="项目名称" prop="projectName" :borderBottom="true" required>
-                <u-input v-model="form.projectName" placeholder="请填写项目名称" border="none" />
+              <u-form-item label="项目名称" prop="projectName" required :borderBottom="true">
+                <u-input v-model="form.projectName" placeholder="请填写项目名称" border="none">
+                  <template #suffix>
+                    <u-icon name="search" color="#999999" size="22" @click="projectSubmit(form.projectName)"></u-icon>
+                  </template>
+                </u-input>
               </u-form-item>
               <u-form-item label="项目地址" prop="projectAddress" :borderBottom="true" required>
                 <u-input v-model="form.projectAddress" placeholder="请填写项目地址" border="none" />
@@ -50,6 +54,19 @@
         <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
       </view>
     </view>
+
+    <u-picker
+      :show="actionShow"
+      :columns="actionsList"
+      :title="'请选择' + actionTitle"
+      keyName="name"
+      visibleItemCount="6"
+      :defaultIndex="[actionDefaultIndex]"
+      :closeOnClickOverlay="true"
+      @close="actionShow = false"
+      @cancel="actionShow = false"
+      @confirm="selectAction"
+    ></u-picker>
   </oa-scroll>
 </template>
 
@@ -60,7 +77,7 @@ import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, on
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
 import { publicStores, useStores } from "@/store/modules/index";
 
-import { add } from "@/api/common/repairReport.js";
+import { add, getAddHistoryInfo } from "@/api/common/repairReport.js";
 
 const { proxy } = getCurrentInstance();
 const publicStore = publicStores();
@@ -121,9 +138,39 @@ const data = reactive({
       },
     ],
   },
+
+  actionShow: false,
+  actionTitle: "",
+  actionsList: [],
+  actionDefaultIndex: 0,
 });
 
-const { form, rules } = toRefs(data);
+const { form, rules, actionShow, actionTitle, actionsList, actionDefaultIndex } = toRefs(data);
+
+/**
+ * @项目名称
+ * @icon图标按钮点击事件
+ */
+function projectSubmit(e) {
+  actionsList.value = [[]];
+
+  getAddHistoryInfo({
+    projectName: e,
+  }).then((res) => {
+    if (res.status == "SUCCESS") {
+      if (res.data.length > 0) {
+        actionShow.value = true;
+        res.data.forEach((el) => {
+          el.name = el.projectName;
+          actionsList.value[0].push(el);
+        });
+        actionTitle.value = "项目名称";
+      } else {
+        proxy.$modal.msg("未匹配到您所输入的项目!");
+      }
+    }
+  });
+}
 
 /**
  * @提交
@@ -152,6 +199,19 @@ function handleSubmit(value) {
     });
 }
 
+/**
+ * @action弹出框选择事件
+ */
+function selectAction(e) {
+  if (actionTitle.value == "项目名称") {
+    form.value.projectName = e.value[0].projectName; //项目名称
+    form.value.projectAddress = e.value[0].projectAddress; //项目地址
+    form.value.reflectName = e.value[0].reflectName; //报修人
+  }
+
+  actionShow.value = false;
+}
+
 /**
  * @图片上传成功回调
  */