From 6622c8891d03e71d3dc75c2de97308ca71552786 Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期三, 09 二月 2022 13:52:45 +0800
Subject: [PATCH] bug

---
 src/views/your/area-manage/areaManage.vue |  122 ++++++++++++++++++++++++----------------
 1 files changed, 73 insertions(+), 49 deletions(-)

diff --git a/src/views/your/area-manage/areaManage.vue b/src/views/your/area-manage/areaManage.vue
index d9c42b1..3eb330d 100644
--- a/src/views/your/area-manage/areaManage.vue
+++ b/src/views/your/area-manage/areaManage.vue
@@ -68,6 +68,7 @@
         </FormItem>
         <FormItem label="閰嶉�佸憳" prop="userId">
           <Select v-model="areaForm.userId" filterable>
+            <Option :value="0" :key="0" selected>璇烽�夋嫨</Option>
             <Option v-for="item in userList" :value="item.id">{{ item.nickname }}</Option>
           </Select>
         </FormItem>
@@ -84,39 +85,36 @@
         <Button @click="addEquipment" type="primary" icon="md-add">娣诲姞鐗囧尯娈�</Button>
         <Button @click="init" icon="md-refresh">鍒锋柊</Button>
       </Row>
-      <Table :loading="loading" border :columns="columns2" :data="data2" ref="table"
-             sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
-
-
+      <Table :loading="loading" border :columns="columns2" :data="data2" ref="table" style="height: 400px" >
+             sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect" >
       </Table>
-    </Modal>05
+    </Modal>
     <Modal :title="modalTitle3" v-model="customerVisible" :mask-closable="false" :width="1050">
       <Row class="operation" style="padding-bottom: 20px">
         <Button @click="addCustomer" type="primary" icon="md-add">娣诲姞</Button>
         <Button @click="init" icon="md-refresh">鍒锋柊</Button>
-        <Input v-model="searchForm.name" suffix="ios-search" @on-change="getCustList" placeholder="杈撳叆鍟嗘埛鍚嶇О鎼滅储" clearable style="width: 250px"
+        <Input v-model="searchForm.customerName" suffix="ios-search" @on-change="getCustList" placeholder="杈撳叆鍟嗘埛鍚嶇О鎼滅储" clearable style="width: 250px"
         />
       </Row>
       <Table :loading="loading" border :columns="columns3" :data="data3" ref="table"
              sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
       </Table>
       <Row type="flex" justify="end" class="page">
-        <Page :current="searchForm.pageNumber" :total="total2"
+        <Page :current.sync="searchForm.pageNumber" :total="total2"
                 :page-size="searchForm.pageSize"
-                @on-change="changePage"
+                @on-change="changePage1"
                 @on-page-size-change="changePageSize"
                 :page-size-opts="[10, 20, 50]"
                 size="small"
                 show-total
                 show-elevator
-                show-sizer
         ></Page>
       </Row>
     </Modal>
-    <Modal :title="modalTitle" v-model="addEquipmentVisible" :mask-closable="false" :width="500">
+    <Modal :title="modalTitle" v-model="addEquipmentVisible" :mask-closable="false" :width="500" >
       <Form ref="areaSectionForm" :model="areaSectionForm" :label-width="80" :rules="areaSectionFormValidate">
         <FormItem label="鐗囧尯鍚嶇О" prop="code">
-          <Input v-model="areaSectionForm.code" />
+          <Input v-model="areaSectionForm.name" />
         </FormItem>
 
       </Form>
@@ -128,36 +126,50 @@
       </div>
     </Modal>
     <Modal :title="modalTitle" v-model="addCustomerVisible" :mask-closable="false" :width="550">
-      <Form ref="customerForm" :model="customerForm" :label-width="80" :rules="areaSectionFormValidate">
+      <Form ref="customerForm" :model="customerForm" :label-width="120" :rules="areaSectionFormValidate">
         <FormItem label="鍟嗘埛鍚嶇О" prop="name">
           <Input v-model="customerForm.name" />
         </FormItem>
         <FormItem label="鍟嗘埛缂栧彿" prop="code">
           <Input v-model="customerForm.code" />
         </FormItem>
-        <FormItem label="鑱旂郴鏂瑰紡" prop="phone">
-          <Input v-model="customerForm.phone" />
-        </FormItem>
-        <FormItem label="缁忓害" prop="lng">
-          <Input v-model="customerForm.lng" />
-        </FormItem>
-        <FormItem label="绾害" prop="lat">
-          <Input v-model="customerForm.lat" />
-        </FormItem>
-        <Form-item label="涓婃閰嶉�佹棩鏈�" prop="lastTime">
-          <Row>
-            <Col>
-              <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" v-model="customerForm.lastTime"></Date-picker>
-            </Col>
-          </Row>
-        </Form-item>
+
+        <Row :gutter="0">
+          <Col span="12">
+            <FormItem label="缁忓害" prop="lng">
+              <Input v-model="customerForm.lng" />
+            </FormItem>
+          </Col>
+          <Col span="12">
+            <FormItem label="绾害" prop="lat">
+              <Input v-model="customerForm.lat" />
+            </FormItem>
+          </Col>
+        </Row>
+        <Row :gutter="0">
+          <Col span="12">
+            <Form-item label="涓婃閰嶉�佹棩鏈�" prop="lastTime">
+              <Row>
+                <Col>
+                  <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" v-model="customerForm.lastTime"></Date-picker>
+                </Col>
+              </Row>
+            </Form-item>
+          </Col>
+          <Col span="12">
+            <FormItem label="鑱旂郴鏂瑰紡" prop="phone">
+              <Input v-model="customerForm.phone"/>
+            </FormItem>
+          </Col>
+        </Row>
+
         <FormItem label="鍟嗘埛娉ㄥ唽鍦板潃" prop="registeredAddress">
           <Input v-model="customerForm.registeredAddress" />
         </FormItem>
         <FormItem label="鑱旂郴浜�" prop="linker">
           <Input v-model="customerForm.linker" />
         </FormItem>
-        <FormItem label="闆跺敭璁稿彲璇佷俊鎭�" prop="licence">
+        <FormItem label="闆跺敭璁稿彲璇佷俊鎭�" prop="licence" >
           <Input v-model="customerForm.licence" />
         </FormItem>
       </Form>
@@ -265,6 +277,7 @@
   addCar,
   getCarList,
   getUser,
+  getDriver,
   addArea,
   deleteArea,
   getAreaSection,
@@ -348,6 +361,9 @@
           title: "鐗囧尯鎻忚堪",
           key: "description",
           width: 442,
+          render: (h, params) => {
+            return h("div",params.row.description=="undefined" ? '':params.row.description);
+          }
         },
         {
           title: "閰嶉�佷汉",
@@ -420,14 +436,13 @@
           align: "center",
         },
         {
-          title: "鍒嗘缂栧彿鎴栧悕绉�",
-          key: "code",
+          title: "鍒嗘鍚嶇О",
+          key: "name",
         },
         {
           title: "鎿嶄綔",
           key: "action",
           align: "center",
-
           render: (h, params) => {
             return h("div", [
               h(
@@ -491,23 +506,23 @@
         {
           title: "鍟嗘埛鍚嶇О",
           key: "name",
-          width: 100,
+          tooltip:true,
+          width: 200,
         },
         {
           title: "鍟嗘埛缂栧彿",
-          key: "code",
-          minWidth: 120,
+          key: "licence",
+          minWidth: 140,
         },
         {
           title: "鑱旂郴鏂瑰紡",
           key: "phone",
-          width: 140,
+          width: 135,
         },
         {
           title: "鐘舵��",
           key: "status",
           width:100,
-          sortable: true,
           render: (h, params) => {
             let re = "";
             if (params.row.status == 0) {
@@ -530,16 +545,6 @@
               ]);
             }
           },
-        },
-        {
-          title: "涓婃閰嶉�佹棩鏈�",
-          key: "lastTime",
-          width: 150,
-        },
-        {
-          title: "鍟嗘埛娉ㄥ唽鍦板潃",
-          key: "registeredAddress",
-          width: 180,
         },
         {
           title: "鑱旂郴浜�",
@@ -588,7 +593,9 @@
       data2: [],
       data3: [],
       total: 0,
-
+      type: {
+        type : 1
+      },
       total2: 0,
       permData: [],
       editRolePermId: "",
@@ -661,6 +668,10 @@
       this.getDataList();
       this.clearSelectAll();
     },
+    changePage1(v) {
+      this.searchForm.pageNumber = v;
+      this.getCustomerList(this.areaSectionId);
+    },
     changePageSize(v) {
       this.searchForm.pageSize = v;
       this.getDataList();
@@ -685,6 +696,7 @@
     },
     getCustList() {
       this.loading = true;
+      this.searchForm.pageNumber=1;
       getCustomer(this.searchForm).then((res) => {
         this.loading = false;
         if (res.success) {
@@ -692,9 +704,10 @@
           this.total2 = res.result.total;
         }
       });
+      this.$emit('update:current',this.searchForm.pageNumber);
     },
     getAllUser(){
-      getUser().then((res)=>{
+      getDriver({type:1}).then((res)=>{
         if (res.success){
           this.userList=res.result;
         }
@@ -749,6 +762,12 @@
       this.roleModalVisible = false;
     },
     submitArea() {
+      if(this.areaForm.userId==undefined){
+        this.areaForm.userId=0;
+      }
+      if(this.areaForm.description==undefined){
+        this.areaForm.description="";
+      }
       this.$refs.areaForm.validate((valid) => {
         if (valid) {
           if (this.modalType == 0) {
@@ -760,16 +779,19 @@
                 this.$Message.success("鎿嶄綔鎴愬姛");
                 this.getDataList();
                 this.roleModalVisible = false;
+                this.areaForm={};
               }
             });
           } else {
             this.submitLoading = true;
+            this.$delete(this.areaForm,'children')
             addArea(this.areaForm).then((res) => {
               this.submitLoading = false;
               if (res.success) {
                 this.$Message.success("鎿嶄綔鎴愬姛");
                 this.getDataList();
                 this.roleModalVisible = false;
+                this.areaForm={};
               }
             });
           }
@@ -871,6 +893,7 @@
       this.$refs.areaForm.resetFields();
       delete this.areaForm.id;
       this.customerVisible = true;
+      console.log(this.areaSectionId);
     },
     addCar() {
       this.getAllUser();
@@ -910,6 +933,7 @@
       let str = JSON.stringify(v);
       let roleInfo = JSON.parse(str);
       this.areaForm = roleInfo;
+      console.log(this.areaForm);
       this.roleModalVisible = true;
     },
     editEquipment(v) {

--
Gitblit v1.9.1