Browse Source

Merge branch 'master' of http://git.cc-lotus.info/tyre/lt-system into master

wxy 4 năm trước cách đây
mục cha
commit
2855febfc7
1 tập tin đã thay đổi với 73 bổ sung12 xóa
  1. 73 12
      src/views/test/repairorder.vue

+ 73 - 12
src/views/test/repairorder.vue

@@ -7,44 +7,47 @@
           <el-col :span="24" class="back">
             <el-button type="primary" size="mini" @click="$router.push({ path: '/test' })">返回</el-button>
           </el-col>
-          <el-col :span="24">
-            <el-col :span="6">
+          <el-col :span="24" class="carinfo">
+            <el-col :span="24" class="top">
+              客户信息
+            </el-col>
+            <el-col :span="6" class="txt textOver">
               <span>顾客姓名</span>
               <span>{{ carinfo.name }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>顾客电话</span>
               <span>{{ carinfo.mobile }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>车牌号</span>
               <span>{{ carinfo.license }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>车型</span>
               <span>{{ carinfo.model }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>车辆颜色</span>
               <span>{{ carinfo.carcolor }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>行驶里程</span>
               <span>{{ carinfo.mileage }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>VIN号</span>
               <span>{{ carinfo.vin }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>保险日期</span>
               <span>{{ carinfo.insurance }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>驾驶证日期</span>
               <span>{{ carinfo.drive }}</span>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" class="txt textOver">
               <span>行驶证日期</span>
               <span>{{ carinfo.travel }}</span>
             </el-col>
@@ -54,6 +57,9 @@
               <el-button type="primary" size="mini" @click="add">添加维修单</el-button>
             </el-col>
             <el-col :span="24">
+              <el-col :span="24" class="top">
+                维修项目
+              </el-col>
               <el-table :data="list" style="width: 100%" border>
                 <el-table-column prop="name" label="维修项目名" align="center">
                   <template slot-scope="scope">
@@ -87,6 +93,16 @@
                   </template>
                 </el-table-column>
               </el-table>
+              <el-col :span="24" class="page">
+                <el-pagination
+                  @current-change="handleCurrentChange"
+                  :current-page="currentPage"
+                  layout="total,  prev, pager, next, jumper"
+                  :total="total"
+                  :page-size="pageSize"
+                >
+                </el-pagination>
+              </el-col>
             </el-col>
           </el-col>
         </el-col>
@@ -111,6 +127,9 @@ export default {
       // 维修单
       list: [],
       total: 0,
+      currentPage: 0,
+      pageSize: 7,
+      skip: '',
     };
   },
   async created() {
@@ -121,7 +140,8 @@ export default {
   methods: {
     ...car(['fetch']),
     ...repair({ repairquery: 'query', repairdelete: 'delete', repairupdate: 'update', repaircreate: 'create' }),
-    async search({ skip = 0, limit = 5, ...info } = {}) {
+    async search({ skip = 0, limit = 7, ...info } = {}) {
+      skip = this.skip;
       let res = await this.fetch(this.id);
       let arr = await this.repairquery({ uid: this.id, skip, limit });
       if (this.$checkRes(res)) {
@@ -189,6 +209,10 @@ export default {
         this.list.splice(index, 1);
       }
     },
+    handleCurrentChange(currentPage) {
+      this.$set(this, `skip`, (currentPage - 1) * this.pageSize);
+      this.search();
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -203,8 +227,45 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
 .back {
   text-align: right;
   padding: 10px 0;
 }
+.page {
+  text-align: center;
+  padding: 15px 0;
+}
+.carinfo {
+  .txt {
+    height: 40px;
+    line-height: 40px;
+    border: 1px solid #ccc;
+    span:nth-child(1) {
+      display: inline-block;
+      width: 30%;
+      color: #fff;
+      text-align: center;
+      background-color: #409eff;
+    }
+    span:nth-child(2) {
+      padding: 0 10px;
+      height: 40px;
+      line-height: 40px;
+      font-weight: bold;
+    }
+  }
+}
+.top {
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  background-color: #409eff;
+  color: #fff;
+  font-weight: bold;
+}
 </style>