Explorar el Código

服务受理列表

NULL1222 hace 2 semanas
padre
commit
0679c20dac

+ 9 - 10
app.json

@@ -23,13 +23,14 @@
     ],
     "subpackages": [
         {
-          "root": "bgj",
-          "pages": [
-              "handling/index",
-              "workOrder/index",
-              "customerArchive/index",
-              "workerHome/index"
-          ]
+            "root": "bgj",
+            "pages": [
+                "handling/index",
+                "workOrder/index",
+                "customerArchive/index",
+                "workerHome/index",
+                "handling/datail"
+            ]
         }
     ],
     "preloadRule": {
@@ -54,15 +55,13 @@
         "Yl_ReportForms": "/components/Yl_ReportForms/index",
         "Yl_Headline": "/components/Yl_Headline/index",
         "Yl_FunTabs": "/components/Yl_FunTabs/index",
-
+        "Yl_Head": "/components/Yl_Head/index",
         "Yl_nav": "/components/Yl_nav/index",
         "Yl_filtrate": "/components/Yl_filtrate/index",
         "organization": "/components/organization/index",
         "Yl_Filtrate1": "/components/Yl_Filtrate1/index",
         "Yl_ListBox": "/components/Yl_ListBox/index",
-
         "My_empty": "/components/My_empty/index",
-
         "timeRange": "/components/timeRange/timeRange",
         "van-button": "@vant/weapp/button/index",
         "van-icon": "@vant/weapp/icon/index",

+ 66 - 0
bgj/handling/datail.js

@@ -0,0 +1,66 @@
+// bgj/handling/datail.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
bgj/handling/datail.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 1 - 0
bgj/handling/datail.scss

@@ -0,0 +1 @@
+/* bgj/handling/datail.wxss */

+ 2 - 0
bgj/handling/datail.wxml

@@ -0,0 +1,2 @@
+<!--bgj/handling/datail.wxml-->
+<text>bgj/handling/datail.wxml</text>

+ 97 - 62
bgj/handling/index.js

@@ -1,66 +1,101 @@
-// bgj/handling/index.js
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+const _Http = getApp().globalData.http;
 
+Page({
+  data: {
+    type: "default",
+    "id": 2026052013163202,
+    "content": {
+      "nocache": true,
+      "pageNumber": 1,
+      "pageSize": 20,
+      "where": {
+        "condition": "",
+        "status": ['待处理'], // 数组,状态
+        "type": "",//服务类型
+        "begindate_createdate": "",//创建时间开始
+        "enddate_createdate": "",//结束日期选择
+        "begindate_finishdate": "",//完成时间开始
+        "enddate_finishdate": ""//结束日期选择
+      },
     },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
+    filtratelist: []
+  },
+
+  onSearch({
+    detail
+  }) {
+    this.data.content.where.condition = detail;
+    this.getList(true)
+  },
+  onChangeTab({
+    detail
+  }) {
+    this.setData({
+      'content.where.status': [detail.title]
+    })
+    this.getList(true)
+  },
+  getList(init = false) {
+    _Http.init(this.data.content, init).then(content => {
+      _Http.basic({
+        id: this.data.id,
+        content
+      }).then(res => {
+        console.log("服务受理列表", res)
+        this.selectComponent('#ListBox').RefreshToComplete();
+        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)
+        })
+      })
+    })
+  },
+  async onLoad(options) {
+    getApp().globalData.Language.getLanguagePackage(this);
+    let filtratelist = [{
+      label: "服务类型",
+      index: null,
+      showName: "value", //显示字段
+      valueKey: "type", //返回Key
+      selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+      value: "", //选中值
+      list: await _Http.getTypes('servicebookingtype', _Http)
+    }]
+    this.setData({
+      filtratelist,
+      type: options.type || this.data.type,
+    })
+    if (options.type && options.type == 'admin') {
+      this.setData({
+        "content.isManage": true
+      })
     }
+    this.getList()
+  },
+
+  handleFilter({
+    detail
+  }) {
+    console.log("detail---------",detail);
+    // 合并搜索关键词 + tab状态
+    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_finishdate = detail.periodstart || '';
+    detail.enddate_finishdate = detail.periodend || '';
+    // 删除没用的字段
+    delete detail.startdate;
+    delete detail.enddate;
+    delete detail.periodstart;
+    delete detail.periodend;
+    // 更新查询条件
+    this.data.content.where = detail;
+    this.getList(true);
+  },
 })

+ 2 - 1
bgj/handling/index.json

@@ -1,3 +1,4 @@
 {
-    "usingComponents": {}
+    "usingComponents": {},
+    "navigationBarTitleText": "服务受理"
 }

+ 57 - 1
bgj/handling/index.scss

@@ -1 +1,57 @@
-/* bgj/handling/index.wxss */
+.item {
+  width: 690rpx;
+  background: #ffffff;
+  border-radius: 8rpx;
+  padding:16rpx 20rpx 20rpx;
+  box-sizing: border-box;
+  margin: 20rpx auto 0;
+  .head {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    padding-bottom: 18rpx;
+    margin-bottom: 20rpx;
+    border-bottom: 2rpx solid #dddddd;
+
+    .btn {
+      display: flex;
+      align-items: center;
+      padding: 0 16rpx;
+      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;
+    }
+
+    .status {
+      font-family: PingFang SC, PingFang SC;
+      font-weight: 400;
+      font-size: 28rpx;
+      text-align: left;
+      font-style: normal;
+    }
+  }
+  .address {
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #333333;
+    text-align: left;
+    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;
+  }
+}

+ 22 - 2
bgj/handling/index.wxml

@@ -1,2 +1,22 @@
-<!--bgj/handling/index.wxml-->
-<text>bgj/handling/index.wxml</text>
+<Yl_Head tabs="{{[{title:'待处理'},{title:'进行中'},{title:'待验收'},{title:'已完成'}]}}" bind:onSearch='onSearch'
+  bind:onChangeTab='onChangeTab' />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+  <navigator class="item" url="/bgj/handling/detail?id={{item.billno}}"
+    wx:for="{{list}}" wx:key="billno" hover-class="none">
+    <view class="head">
+      <view class="btn">施工</view>
+      <view class="status" style="color:{{sColors[item.status]}};">{{language[item.status]||item.status}}</view>
+    </view>
+    <view class="address">{{item.province + item.city + item.county + item.address}}</view>
+    <view class="row">{{language['预约单号']||'预约单号'}}:{{item.billno}}</view>
+    <view class="row">
+      {{language['客户']||'客户'}}:{{item.scenecontact}}
+      <text style="margin-right: 20rpx;">{{item.scenecontactphonenumber}}</text>
+    </view>
+    <view class="row">{{language['创建时间']||'创建时间'}}:{{item.createdate}} </view>
+    <view class="row">{{language['经销商']||'经销商'}}:{{ item.enterprisename ? (language[item.enterprisename] || item.enterprisename) : '--' }}</view>
+  </navigator>
+  <My_Empty wx:if="{{list.length==0}}" />
+</Yl_ListBox>
+<Yl_Filtrate1 id='filtrate' list="{{filtratelist}}" bind:handle="handleFilter" dateRange dateRange1 dateRangeName='创建时间'
+  dateRangeName1='完成时间' />

+ 155 - 0
components/Yl_Head/index.js

@@ -0,0 +1,155 @@
+Component({
+  options: {
+    addGlobalClass: true
+  },
+  lifetimes: {
+    attached() {
+      if (wx.getStorageSync('SearchHistory')) this.setData({
+        history: wx.getStorageSync('SearchHistory')
+      })
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  properties: {
+    active: {
+      type: [Number, String],
+      value: 0
+    },
+    tabs: {
+      type: Array,
+      value: [{
+        title: "中止"
+      }]
+    },
+    onChangeTab: {
+      type: Function
+    },
+    onSearch: {
+      type: Function
+    },
+    threshold: {
+      type: [String, Number],
+      value: 4
+    }
+  },
+  data: {
+
+  },
+  methods: {
+    onChange({
+      detail
+    }) {
+      this.triggerEvent("onChangeTab", detail)
+    },
+    /* 开启关闭搜索 */
+    clickSearch() {
+      this.setData({
+        startUsing: !this.data.startUsing
+      });
+      setTimeout(this.setListHeight, 400)
+    },
+    /* 搜索 */
+    confirmSearch(e) {
+      if (this.data.condition == e.detail.value) return;
+      this.setData({
+        condition: e.detail.value
+      })
+      this.triggerEvent("onSearch", e.detail.value)
+    },
+    /* 开始搜索 */
+    startSearch({
+      detail
+    }) {
+      if (this.data.condition == detail) return;
+      this.setData({
+        condition: detail
+      })
+      this.triggerEvent("onSearch", detail)
+      if (this.data.record || detail == '') {
+        let list = this.data.history;
+        if (list.findIndex(v => v == detail) == -1) {
+          list.push(detail)
+          this.setData({
+            history: list
+          });
+          wx.setStorageSync("SearchHistory", list)
+        }
+      }
+    },
+    /* 取消搜索 */
+    endSearch() {
+      this.setData({
+        condition: ""
+      })
+      this.triggerEvent("onSearch", "")
+    },
+    /* 删除搜索历史 */
+    deleteHistory(e) {
+      let that = this;
+      wx.showModal({
+        cancelText: getApp().globalData.Language.getMapText('取消'),
+        confirmText: getApp().globalData.Language.getMapText('确定'),
+        title: getApp().globalData.Language.getMapText('提示'),
+        content: getApp().globalData.Language.getMapText('是否删除所有搜索历史'),
+        complete: ({
+          confirm
+        }) => {
+          if (confirm) {
+            wx.setStorageSync("SearchHistory", [])
+            that.setData({
+              history: []
+            });
+            this.setListHeight();
+          }
+        }
+      })
+    },
+    /* 快速搜索 */
+    clickTag(e) {
+      const {
+        name
+      } = e.currentTarget.dataset;
+      this.setData({
+        condition: name
+      });
+      this.triggerEvent("onSearch", name)
+    },
+    /* 单独删除 */
+    delteTag(e) {
+      const {
+        name
+      } = e.currentTarget.dataset;
+      this.setData({
+        history: this.data.history.filter(v => v != name)
+      });
+      wx.setStorageSync('SearchHistory', this.data.history);
+      this.setListHeight();
+    },
+    /* 设置列表高度 */
+    setListHeight() {
+      let pages = getCurrentPages()[getCurrentPages().length - 1].selectComponent("#ListBox");
+      if (pages) pages.automaticSetHei();
+    },
+    /* 搜索框焦点 */
+    onFocus() {
+      this.setData({
+        showHistory: true
+      });
+      setTimeout(this.setListHeight, 50);
+    },
+    /* 搜索框失焦 */
+    onBlur() {
+      this.setData({
+        showHistory: false
+      })
+      setTimeout(this.setListHeight, 50);
+    },
+    clickFiltration() {
+      let page = getCurrentPages()[getCurrentPages().length - 1];
+      let filtrate = page.selectComponent("#filtrate");
+      if (filtrate) {
+        filtrate.setData({ show: true });
+      }
+    }
+  }
+})

+ 6 - 0
components/Yl_Head/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-transition": "@vant/weapp/transition/index"
+  }
+}

+ 30 - 0
components/Yl_Head/index.scss

@@ -0,0 +1,30 @@
+.tabs {
+	position: relative;
+	display: flex;
+	width: 100vw;
+	overflow: hidden;
+	background-color: #fff;
+	box-shadow: 0rpx 4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	z-index: 9;
+
+	.tab-active-class {
+		font-size: 28rpx;
+		color: #3874F6;
+		text-transform: none;
+	}
+
+	.right {
+		display: flex;
+		align-items: center;
+		flex-shrink: 0;
+		width: 200rpx;
+
+		.option {
+			width: 100rpx;
+			height: 88rpx;
+			text-align: center;
+			line-height: 88rpx;
+			color: #666666;
+		}
+	}
+}

+ 30 - 0
components/Yl_Head/index.wxml

@@ -0,0 +1,30 @@
+<view class="tabs">
+	<view style="flex: 1;width: 0;">
+		<van-tabs swipe-threshold='{{threshold}}' active="{{ active }}" tab-active-class='tab-active-class' color='#3874F6' bind:change="onChange">
+			<van-tab wx:for="{{tabs}}" wx:key="title" title="{{language[item.title]||item.title}}" />
+		</van-tabs>
+	</view>
+
+	<view class="right">
+		<view class="option" hover-class="navigator-hover" bind:tap="clickSearch">
+			<text class="iconfont icon-a-sousuolansousuo" />
+		</view>
+		<view class="option" hover-class="navigator-hover" bind:tap="clickFiltration">
+			<text class="iconfont icon-shaixuan_xianxing" />
+		</view>
+	</view>
+</view>
+
+<van-transition show="{{ startUsing }}" custom-class="block">
+	<van-search custom-class='Yl_search' value="{{ condition }}" bindfocus='onFocus' bind:blur='onBlur' shape="round" placeholder="{{language['关键字']||'请输入搜索关键词'}}" bind:search='startSearch' bind:clear='endSearch' />
+	<view class="Yl_history" wx:if="{{record}}">
+		<view class="label" wx:if="{{showHistory && history.length}}">
+			<text>{{language['最近搜索记录']||'最近搜索记录'}}</text>
+		</view>
+		<view class="content" wx:if="{{showHistory}}">
+			<van-tag wx:for="{{history}}" style="margin-left: 6rpx;" wx:key="item" size="medium" round data-name="{{item}}" catch:close="delteTag" catchtap="clickTag">
+				{{language[item]||item}}
+			</van-tag>
+		</view>
+	</view>
+</van-transition>