Browse Source

审核列表搜索栏

XuZinan 3 years ago
parent
commit
74eddfe1a5
1 changed files with 56 additions and 2 deletions
  1. 56 2
      pages/Project/auth.vue

+ 56 - 2
pages/Project/auth.vue

@@ -13,7 +13,39 @@
       <view class="loadmore">{{ loadMoreText }}</view>
     </view>
 
-    <search-drawer title="查询项目"></search-drawer>
+    <search-drawer title="查询项目" ref="searchDrawer" @onOk="search">
+      <uni-forms :modelValue="projectFilter" label-position="top" class="form">
+        <uni-forms-item label="项目名称">
+          <uni-easyinput
+            type="text"
+            class="input"
+            v-model="projectFilter.project_name"
+          />
+        </uni-forms-item>
+        <uni-forms-item label="项目编号">
+          <uni-easyinput
+            type="text"
+            class="input"
+            v-model="projectFilter.project_code"
+          />
+        </uni-forms-item>
+        <uni-forms-item label="状态">
+          <picker
+            @change="selectChangeStatus"
+            :range="statusList"
+            :range-key="'label'"
+          >
+            <view class="select">
+              {{
+                projectFilter.project_status != null
+                  ? statusList[projectFilter.project_status + 1].label
+                  : "全部"
+              }}
+            </view>
+          </picker>
+        </uni-forms-item>
+      </uni-forms>
+    </search-drawer>
   </view>
 </template>
 
@@ -21,6 +53,13 @@
 import { queryAuth } from "@/services/project";
 import { mapState } from "vuex";
 import mixin from "@/utils/listMixin";
+const statusList = [
+  { value: null, label: "全部" },
+  { value: 0, label: "售前" },
+  { value: 1, label: "转执行" },
+  { value: 2, label: "转运营" },
+  { value: 3, label: "转质保" },
+];
 export default {
   mixins: [mixin],
   computed: {
@@ -32,8 +71,9 @@ export default {
       projectFilter: {
         project_name: "",
         project_code: "",
-        project_status: 0,
+        project_status: null,
       },
+      statusList,
     };
   },
   onShow() {
@@ -54,6 +94,17 @@ export default {
         url: `./detail?id=${project.id}&auth=${true}`,
       });
     },
+    selectChangeStatus(e) {
+      const item = this.statusList[e.target.value];
+      this.projectFilter.project_status = item.value;
+    },
+    async search() {
+      this.projectFilter.project_code =
+        this.projectFilter.project_code.toUpperCase();
+      this.pagination.currentPage = 1;
+      await this.initData();
+      this.$refs.searchDrawer.closeDrawer();
+    },
   },
 };
 </script>
@@ -88,4 +139,7 @@ export default {
   color: gray;
   text-align: center;
 }
+.form {
+  margin: 0 20px;
+}
 </style>