Przeglądaj źródła

客户详情质保卡tab

NULL1222 1 tydzień temu
rodzic
commit
2b560d6771

+ 3 - 1
app.json

@@ -42,7 +42,9 @@
                 "workOrder/material/index",
                 "workOrder/team/index",
                 "workOrder/application/index",
-                "workOrder/nodes/report/index"
+                "workOrder/nodes/report/index",
+                "customerArchive/detail",
+                "customerArchive/warranty/index"
             ]
         }
     ],

+ 104 - 0
bgj/customerArchive/detail.js

@@ -0,0 +1,104 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    sc_customers_terminalid: '',
+    detail: {},
+    tabsList: [{
+      label: "服务预约单",
+      idname: "phonenumber"
+    }, {
+      label: "工单",
+      idname: "phonenumber",
+      model: "#warranty"
+    }, {
+      label: "质保卡",
+      idname: "phonenumber",
+      model: "#warranty"
+    }, {
+      label: "附件",
+      idname: "sc_customers_terminalid",
+      model: "#Files"
+    }, {
+      label: "操作记录",
+      idname: "sc_customers_terminalid",
+      model: "#Record"
+    }],
+    tabsActive: 0,
+  },
+
+  onLoad(options) {
+    getApp().globalData.Language.getLanguagePackage(this, '客户详情');
+    if (options.id) {
+      this.setData({
+        sc_customers_terminalid: options.id
+      });
+      this.getDetail();
+    }
+  },
+
+  getDetail() {
+    _Http.basic({
+      id: 2026053014231502,
+      content: {
+        sc_customers_terminalid: this.data.sc_customers_terminalid
+      },
+    }).then(res => {
+      if (res.code != '1') return wx.showToast({
+        title: res.msg,
+        icon: "none"
+      })
+      const item = res.data;
+      this.setData({
+        detail: item,
+      })
+    });
+  },
+
+
+
+  tabsChange({
+    detail
+  }) {
+    this.setData({
+      tabsActive: detail
+    });
+    this.partialRenewal();
+  },
+
+  partialRenewal(init = false) {
+    try {
+      let ac = this.data.tabsList[this.data.tabsActive];
+      let model = ac.model;
+      if (model) {
+        let Component = this.selectComponent(model),
+          {
+            total,
+            pageNumber,
+            pageTotal
+          } = Component.data.content,
+          id = this.data.detail[ac.idname || 'sc_customers_terminalid'];
+        if (total == null || init) {
+          Component.getList(id, init);
+        } else if (pageNumber <= pageTotal) {
+          Component.getList(id, false);
+        }
+      }
+    } catch (error) {}
+  },
+
+  callPhone(e) {
+    wx.makePhoneCall({
+      phoneNumber: e.currentTarget.dataset.number
+    })
+  },
+
+  onUnload() {
+    const page = getCurrentPages().find(v => v.__route__ == 'bgj/handling/index');
+    if (page) {
+      page.setData({
+        isback: true
+      });
+    }
+  },
+});

+ 8 - 0
bgj/customerArchive/detail.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+      "Files": "/components/files/index",
+      "Record": "/components/record/index",
+      "Warranty": "/bgj/customerArchive/warranty/index"
+  },
+  "navigationBarTitleText": "客户详情"
+}

+ 64 - 0
bgj/customerArchive/detail.scss

@@ -0,0 +1,64 @@
+.detail-info {
+  padding: 20rpx 30rpx;
+  background: #fff;
+}
+
+.info-row {
+  display: flex;
+  padding: 20rpx 0;
+  border-bottom: 1rpx solid #f0f0f0;
+
+  .info-label {
+    width: 160rpx;
+    flex-shrink: 0;
+    font-size: 28rpx;
+    color: #999;
+  }
+
+  .info-value {
+    flex: 1;
+    font-size: 28rpx;
+    color: #333;
+  }
+}
+
+.head {
+  width: 100vw;
+  background: #fff;
+  box-sizing: border-box;
+  padding: 20rpx 22rpx;
+  .title {
+    padding-bottom: 10rpx;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #333333;
+    text-align: left;
+    font-style: normal;
+  }
+  .btn {
+    margin-bottom: 12rpx;
+    width: 80rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: #3874f6;
+    border-radius: 4rpx;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 24rpx;
+    line-height: 48rpx;
+    color: #ffffff;
+    font-style: normal;
+  }
+  .row {
+    padding-top: 8rpx;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 24rpx;
+    color: #999999;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+}

+ 26 - 0
bgj/customerArchive/detail.wxml

@@ -0,0 +1,26 @@
+<view class="head">
+  <view class="title">
+    {{detail.name}}
+  </view>
+  <view class="row">
+    {{language['客户电话']||'客户电话'}}:<text style="margin-right: 20rpx;color: #3874F6;">{{detail.phonenumber}}</text>
+  </view>
+  <view class="row">{{language['省市县']||'省市县'}}:{{detail.province + detail.city + detail.county }}</view>
+  <view class="row">{{language['详细地址']||'详细地址'}}:{{detail.address}}</view>
+  <view class="row">
+    {{language['是否生成质保卡']||'是否生成质保卡'}}:<text style="color:{{detail.ishaswarrantycard == 1 ? sColors['是'] : sColors['否']}};">{{detail.ishaswarrantycard == 1 ? '是' : '否'}}</text>
+  </view>
+  <view class="row">{{language['创建时间']||'创建时间'}}:{{detail.createdate}}</view>
+  <view class="row">{{language['经销商']||'经销商'}}:{{ detail.enterprisename ? (language[detail.enterprisename] ||
+    detail.enterprisename) : '--' }}</view>
+  <view class="row">{{language['备注']||'备注'}}:{{detail.remarks}}</view>
+</view>
+<view style="height: 20rpx;" />
+<Yl_FunTabs list='{{tabsList}}' showIcon='{{false}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+  <!-- <Handling slot='服务预约单' list1='{{list1}}' list2='{{list2}}' />
+  <WorkOrder slot="工单" id='linkWork' sc_customers_terminalid="{{sc_customers_terminalid}}"></WorkOrder> -->
+  <Warranty slot="质保卡" id='warranty' phonenumber="{{phonenumber}}"></Warranty>
+  <Record slot='操作记录' id="Record" ownertable='sc_serviceform' ownerid='{{detail.sc_customers_terminalid}}' />
+  <Files slot='附件' id="Files" ownertable='sc_serviceform' ownerid='{{detail.sc_customers_terminalid}}' />
+  <view style="height: 180rpx;" />
+</Yl_FunTabs>

+ 20 - 19
bgj/customerArchive/index.js

@@ -2,34 +2,38 @@ const _Http = getApp().globalData.http;
 
 Page({
   data: {
-    tabs: [{ title: '全部' }],
-    id: 2026053014220602, 
+    condition: "",
+    id: 2026053014220602,
     content: {
       nocache: true,
       pageNumber: 1,
       pageSize: 20,
       where: {
         condition: "",
-        status: ['全部'],
-        iswarranty: "",
-        begindate_createdate: "",
-        enddate_createdate: ""
+        ishaswarrantycard: "",
+        begindate: "",
+        enddate: ""
       }
     },
     filtratelist: [],
     list: []
   },
 
+  onChange({ detail }) {
+    this.setData({ condition: detail });
+  },
+
   onSearch({ detail }) {
+    this.setData({ condition: detail });
     this.data.content.where.condition = detail;
     this.getList(true);
   },
 
-  onChangeTab({ detail }) {
-    this.setData({
-      'content.where.status': [detail.title]
-    });
-    this.getList(true);
+  clickFiltration() {
+    let filtrate = this.selectComponent("#filtrate");
+    if (filtrate) {
+      filtrate.setData({ show: true });
+    }
   },
 
   getList(init = false) {
@@ -58,12 +62,12 @@ Page({
       label: "是否生成质保卡",
       index: null,
       showName: "value",
-      valueKey: "iswarranty",
-      selectKey: "value",
+      valueKey: "ishaswarrantycard",
+      selectKey: "id",
       value: "",
       list: [
-        { value: "是" },
-        { value: "否" }
+        { value: "是", id: 1 },
+        { value: "否", id: 0 }
       ]
     }];
     this.setData({ filtratelist });
@@ -72,11 +76,8 @@ Page({
 
   handleFilter({ detail }) {
     detail.condition = this.data.content.where.condition;
-    detail.status = this.data.content.where.status;
-    detail.begindate_createdate = detail.startdate || '';
-    detail.enddate_createdate = detail.enddate || '';
+    detail.begindate = detail.startdate || '';
     delete detail.startdate;
-    delete detail.enddate;
     this.data.content.where = detail;
     this.getList(true);
   }

+ 9 - 0
bgj/customerArchive/index.scss

@@ -1,3 +1,12 @@
+.head{
+  padding: 0 20rpx 0 10rpx;
+}
+.search {
+  .van-search__content {
+    background-color: #fff !important;
+  }
+}
+
 .item {
   width: 690rpx;
   background: #ffffff;

+ 6 - 2
bgj/customerArchive/index.wxml

@@ -1,5 +1,9 @@
-<view class="expand">
-    <van-search  custom-class='custom-class' focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索" background='#fff' />
+<view class="head">
+  <van-search class="search" focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="搜索" background='transparent' use-action-slot>
+  <navigator url="#" slot="action" class="iconfont icon-shaixuan" bindtap="clickFiltration">
+    {{language['筛选']||'筛选'}}
+  </navigator>
+</van-search>
 </view>
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
   <navigator class="item" url="/bgj/customerArchive/detail?id={{item.sc_customers_terminalid}}" wx:for="{{list}}" wx:key="sc_customers_terminalid">

+ 53 - 0
bgj/customerArchive/warranty/index.js

@@ -0,0 +1,53 @@
+const _Http = getApp().globalData.http;
+
+Component({
+  options: {
+    addGlobalClass: true
+  },
+  properties: {
+    phonenumber: {
+      type: String,
+      value: ''
+    }
+  },
+  data: {
+    id: 2026053014370002,
+    content: {
+      nocache: true,
+      pageNumber: 1,
+      pageSize: 20,
+      where: {
+        condition: "",
+      }
+    },
+    list: []
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    },
+  },
+  methods: {
+    getList(phonenumber, init = false) {
+      let content = {
+        ...this.data.content,
+        phonenumber: phonenumber || this.properties.phonenumber
+      };
+      _Http.init(content, init).then(content => {
+        _Http.basic({
+          id: this.data.id,
+          content
+        }).then(res => {
+          if (res.code != '1') return wx.showToast({
+            title: res.msg,
+            icon: "none"
+          });
+          this.setData({
+            content: _Http.paging(content, res),
+            list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+          })
+        })
+      })
+    },
+  }
+});

+ 5 - 0
bgj/customerArchive/warranty/index.json

@@ -0,0 +1,5 @@
+{
+  "component": true,
+  "usingComponents": {
+  }
+}

+ 30 - 0
bgj/customerArchive/warranty/index.scss

@@ -0,0 +1,30 @@
+.item {
+  width: 690rpx;
+  background: #ffffff;
+  border-radius: 8rpx;
+  padding: 16rpx 20rpx 20rpx;
+  box-sizing: border-box;
+  margin: 20rpx auto 0;
+
+  .name {
+    padding-bottom: 8rpx;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #333333;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+
+  .row {
+    padding-top: 8rpx;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 24rpx;
+    color: #999999;
+    text-align: left;
+    font-style: normal;
+    text-transform: none;
+  }
+}

+ 13 - 0
bgj/customerArchive/warranty/index.wxml

@@ -0,0 +1,13 @@
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+  <navigator class="item" url="#" wx:for="{{list}}" wx:key="sc_customers_terminalid">
+    <view class="name">{{item.cardno}}</view>
+    <view class="row">
+      {{language['客户']||'客户'}}:{{item.name}}<text style="margin-left: 20rpx;color: #3874F6;">{{item.phonenumber}}</text>
+    </view>
+    <view class="row">{{language['省市县']||'省市县'}}:{{item.province + item.city + item.county }}</view>
+    <view class="row">{{language['详细地址']||'详细地址'}}:{{item.address}}</view>
+    <view class="row">{{language['来源工单号']||'来源工单号'}}:{{item.billno}}</view>
+    <view class="row">{{language['状态']||'状态'}}:<text style="color:{{sColors[item.status]}};">{{language[item.status] || item.status}}</text> </view>
+  </navigator>
+  <My_Empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>

+ 1 - 2
bgj/handling/linkWork/link.wxml

@@ -10,8 +10,7 @@
     <text style="margin-right: 20rpx;color: #3874F6;">{{item.phonenumber}}</text>
   </view>
   <view class="row">
-    {{language['现场联系人']||'现场联系人'}}:{{item.scenecontact}}
-    <text style="margin-right: 20rpx;color: #3874F6;">{{item.scenecontactphonenumber}}</text>
+    {{language['现场联系人']||'现场联系人'}}:{{item.scenecontact}}<text style="margin-left: 20rpx;color: #3874F6;">{{item.scenecontactphonenumber}}</text>
   </view>
   <view class="row">{{language['负责人']||'负责人'}}:{{item.leadername}} </view>
 </navigator>