Browse Source

汇总单功能

seimin 11 months ago
parent
commit
4349ddaac1

+ 2 - 2
components/IncidentAttachment.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <view class="container" @touchstart.stop>
2
+  <view class="container" @touchmove.stop.prevent>
3 3
     <view class="container_head">
4 4
       {{incidentData.reqAttachment ? '报修图片' : ''}}{{incidentData.reqAttachment && incidentData.callID ? '及' : ''}}{{incidentData.callID ? '录音' : ''}}
5 5
     </view>
@@ -18,7 +18,7 @@
18 18
       </view>
19 19
     </view>
20 20
   </view>
21
-  <view class="mask" @touchstart.stop></view>
21
+  <view class="mask" @touchmove.stop.prevent></view>
22 22
 </template>
23 23
 
24 24
 <script setup>

+ 5 - 5
components/IncidentListFilter.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <view class="container" @touchstart.stop v-if="pageData.pageRouter === 'default'">
2
+  <view class="container" @touchmove.stop.prevent v-if="pageData.pageRouter === 'default'">
3 3
     <view class="container_form">
4 4
       <view class="hospital">
5 5
         <text class="name">院区</text>
@@ -28,7 +28,7 @@
28 28
       </view>
29 29
     </view>
30 30
   </view>
31
-  <view class="container" @touchstart.stop v-else-if="pageData.pageRouter === 'area'">
31
+  <view class="container" @touchmove.stop.prevent v-else-if="pageData.pageRouter === 'area'">
32 32
     <view class="container_form">
33 33
       <view class="hospital">
34 34
         <text class="name">楼栋</text>
@@ -44,7 +44,7 @@
44 44
       </view>
45 45
     </view>
46 46
   </view>
47
-  <view class="container" @touchstart.stop v-else-if="pageData.pageRouter === 'category'">
47
+  <view class="container" @touchmove.stop.prevent v-else-if="pageData.pageRouter === 'category'">
48 48
     <view class="container_form">
49 49
       <view class="hospital">
50 50
         <text class="name">故障现象</text>
@@ -60,8 +60,8 @@
60 60
       </view>
61 61
     </view>
62 62
   </view>
63
-  <view class="mask" @touchstart.stop></view>
64
-  <view class="line" @touchstart.stop></view>
63
+  <view class="mask" @touchmove.stop.prevent></view>
64
+  <view class="line" @touchmove.stop.prevent></view>
65 65
 </template>
66 66
 
67 67
 <script setup>

+ 157 - 0
components/NumberModal.vue

@@ -0,0 +1,157 @@
1
+<template>
2
+  <view class="container" @touchmove.stop.prevent>
3
+    <view class="container_head">
4
+      数量
5
+    </view>
6
+    <view class="container_form">
7
+      <view class="content">
8
+        <template v-if="selectType === 'editConsumable' || selectType === 'addConsumable'">
9
+        {{ selectData.consumableName }}({{ selectData.consumableBrandModel }}) {{ selectData.consumableEndPrice }}元
10
+        </template>
11
+        <template v-else-if="selectType === 'editWorkHourManagement'">
12
+        {{ selectData.workName }}{{ selectData.wage }}元
13
+        </template>
14
+      </view>
15
+      
16
+      <view class="number">
17
+        <uni-number-box v-model="pageData.num" :background="primaryColor" color="#fff" :min="1" :max="10000" />
18
+      </view>
19
+    </view>
20
+    <view class="container_foot">
21
+      <view class="foot_btns">
22
+        <view class="cancel btn" @click="cancel">取消</view>
23
+        <view v-if="showRemove" class="remove btn" @click="remove">移除</view>
24
+        <view class="confirm btn" @click="confirm">确认</view>
25
+      </view>
26
+    </view>
27
+  </view>
28
+  <view class="mask" @touchmove.stop.prevent></view>
29
+</template>
30
+
31
+<script setup>
32
+  import { defineEmits, ref, reactive, defineProps } from 'vue'
33
+  import { onLoad } from '@dcloudio/uni-app'
34
+  import { defaultColor } from '@/static/js/theme.js'
35
+  
36
+  const emit = defineEmits(['cancelEmit', 'confirmEmit', 'removeEmit']);
37
+  const { selectData, selectType, evtNumber, showRemove } = defineProps({
38
+    selectData: Object,
39
+    selectType: String,
40
+    evtNumber: {
41
+      type: Number,
42
+      default: 1,
43
+    },
44
+    showRemove: {
45
+      type: Boolean,
46
+      default: false,
47
+    }
48
+  });
49
+  
50
+  // 主题颜色
51
+  const primaryColor = ref(defaultColor)
52
+  
53
+  // 页面数据
54
+  const pageData = reactive({
55
+    num: 1,
56
+  });
57
+  
58
+  // 取消
59
+  function cancel(){
60
+    emit('cancelEmit')
61
+  }
62
+  
63
+  // 确认
64
+  function confirm(){
65
+    emit('confirmEmit', pageData.num);
66
+  }
67
+  
68
+  // 移除
69
+  function remove(){
70
+    emit('removeEmit', pageData.num);
71
+  }
72
+  
73
+  onLoad((option) => {
74
+    pageData.num = evtNumber;
75
+  })
76
+</script>
77
+
78
+<style lang="scss" scoped>
79
+.mask{
80
+  position: fixed;
81
+  left: 0;
82
+  top: 0;
83
+  right: 0;
84
+  bottom: 0;
85
+  background-color: rgba(0, 0, 0, 0.4);
86
+  z-index: 999;
87
+}
88
+.container{
89
+  position: fixed;
90
+  left: 50%;
91
+  top: 50%;
92
+  transform: translate(-50%, -50%);
93
+  z-index: 9999;
94
+  width: 690rpx;
95
+  background-color: #fff;
96
+  border-radius: 10rpx;
97
+  
98
+  .container_head{
99
+    padding: 55rpx;
100
+    font-size: 32rpx;
101
+    color: #333;
102
+    text-align: center;
103
+  }
104
+  
105
+  .container_form{
106
+    padding: 0 55rpx;
107
+    .content{
108
+      text-align: center;
109
+      font-size: 28rpx;
110
+    }
111
+    .number{
112
+      padding: 24rpx 0;
113
+      display: flex;
114
+      justify-content: center;
115
+    }
116
+  }
117
+  
118
+  .container_foot{
119
+    .foot_btns{
120
+      display: flex;
121
+      border-top: 1rpx solid #DDDDDD;
122
+      .btn{
123
+        border-right: 1rpx solid #E3E3E3;
124
+        &:last-of-type{
125
+          border-right: none;
126
+        }
127
+      }
128
+      .confirm{
129
+        flex: 1;
130
+        font-size: 32rpx;
131
+        padding: 30rpx;
132
+        display: flex;
133
+        justify-content: center;
134
+        color: $uni-primary;
135
+      }
136
+      
137
+      .remove{
138
+        flex: 1;
139
+        font-size: 32rpx;
140
+        padding: 30rpx;
141
+        display: flex;
142
+        justify-content: center;
143
+        color: red;
144
+      }
145
+      
146
+      .cancel{
147
+        flex: 1;
148
+        background-color: #fff;
149
+        font-size: 32rpx;
150
+        padding: 30rpx;
151
+        display: flex;
152
+        justify-content: center;
153
+      }
154
+    }
155
+  }
156
+}
157
+</style>

+ 1 - 1
filters/filterFormatDate.js

@@ -1,6 +1,6 @@
1 1
 import { computed } from "vue"
2 2
 import { isDate, format } from 'date-fns';
3
-import { isTimestamp } from '@/utils/isTimestamp.js'
3
+import { isTimestamp } from '@/utils/index.js'
4 4
 export function filterFormatDate() {
5 5
   /**
6 6
    * 日期格式化

+ 31 - 3
http/api.js

@@ -36,14 +36,14 @@ export function api_getDictionary(data){
36 36
 }
37 37
 
38 38
 /**
39
- * 获取事件列表
39
+ * 获取工单列表
40 40
  */
41 41
 export function api_incident(data){
42 42
   return post("/user/data/fetchDataList/incident", data);
43 43
 }
44 44
 
45 45
 /**
46
- * 获取事件列表-数量
46
+ * 获取工单列表-数量
47 47
  */
48 48
 export function api_incident_count(data){
49 49
   return post("/flow/incident/list/count", data);
@@ -113,8 +113,36 @@ export function api_incidentDetail(data){
113 113
 }
114 114
 
115 115
 /**
116
- * 转派
116
+ * 转派/指派/退回/延期处理/新建事件
117 117
  */
118 118
 export function api_incidentTask(type, data){
119 119
   return post("/flow/incident/task/" + type, data);
120
+}
121
+
122
+/**
123
+ * 获取汇总单信息
124
+ */
125
+export function api_querySummaryDoc(data){
126
+  return post("/bpm/data/querySummaryDoc", data);
127
+}
128
+
129
+/**
130
+ * 获取耗材列表
131
+ */
132
+export function api_consumable(data){
133
+  return post("/bpm/data/fetchDataList/consumable", data);
134
+}
135
+
136
+/**
137
+ * 添加/修改/删除耗材
138
+ */
139
+export function api_addSummaryDoc(data){
140
+  return post("/bpm/data/addSummaryDoc", data);
141
+}
142
+
143
+/**
144
+ * 获取工时管理列表
145
+ */
146
+export function api_workHourManagement(data){
147
+  return post("/bpm/data/fetchDataList/workHourManagement", data);
120 148
 }

+ 5 - 0
node_modules/.package-lock.json

@@ -12,6 +12,11 @@
12 12
         "url": "https://github.com/sponsors/kossnocorp"
13 13
       }
14 14
     },
15
+    "node_modules/lodash-es": {
16
+      "version": "4.17.21",
17
+      "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz",
18
+      "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
19
+    },
15 20
     "node_modules/weixin-jsapi": {
16 21
       "version": "1.1.0",
17 22
       "resolved": "https://registry.npmmirror.com/weixin-jsapi/-/weixin-jsapi-1.1.0.tgz",

+ 6 - 0
package-lock.json

@@ -6,6 +6,7 @@
6 6
     "": {
7 7
       "dependencies": {
8 8
         "date-fns": "^3.6.0",
9
+        "lodash-es": "^4.17.21",
9 10
         "weixin-jsapi": "^1.1.0"
10 11
       }
11 12
     },
@@ -18,6 +19,11 @@
18 19
         "url": "https://github.com/sponsors/kossnocorp"
19 20
       }
20 21
     },
22
+    "node_modules/lodash-es": {
23
+      "version": "4.17.21",
24
+      "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz",
25
+      "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
26
+    },
21 27
     "node_modules/weixin-jsapi": {
22 28
       "version": "1.1.0",
23 29
       "resolved": "https://registry.npmmirror.com/weixin-jsapi/-/weixin-jsapi-1.1.0.tgz",

+ 1 - 0
package.json

@@ -1,6 +1,7 @@
1 1
 {
2 2
   "dependencies": {
3 3
     "date-fns": "^3.6.0",
4
+    "lodash-es": "^4.17.21",
4 5
     "weixin-jsapi": "^1.1.0"
5 6
   }
6 7
 }

+ 35 - 0
pages.json

@@ -47,6 +47,41 @@
47 47
           "titleNView": false
48 48
         }
49 49
       }
50
+    },
51
+    {
52
+      "path": "pages/handler/handler",
53
+      "style": {
54
+        "h5": {
55
+          "titleNView": false
56
+        }
57
+      }
58
+    },
59
+    {
60
+      "path": "pages/consumableList/consumableList",
61
+      "style": {
62
+        "h5": {
63
+          "titleNView": false
64
+        },
65
+        "enablePullDownRefresh": true
66
+      }
67
+    },
68
+    {
69
+      "path": "pages/workHourManagementOne/workHourManagementOne",
70
+      "style": {
71
+        "h5": {
72
+          "titleNView": false
73
+        },
74
+        "enablePullDownRefresh": true
75
+      }
76
+    },
77
+    {
78
+      "path": "pages/workHourManagementTwo/workHourManagementTwo",
79
+      "style": {
80
+        "h5": {
81
+          "titleNView": false
82
+        },
83
+        "enablePullDownRefresh": true
84
+      }
50 85
     }
51 86
   ],
52 87
   "globalStyle": {

+ 2 - 0
pages/changeUser/changeUser.vue

@@ -597,6 +597,7 @@
597 597
     z-index: 99;
598 598
     width: 100%;
599 599
     background-color: #fff;
600
+    font-size: 30rpx;
600 601
     .tab{
601 602
       flex: 1;
602 603
       display: flex;
@@ -621,6 +622,7 @@
621 622
       padding-top: 24rpx;
622 623
       height: 86rpx;
623 624
       &.column{
625
+        height: auto;
624 626
         flex-direction: column;
625 627
         align-items: flex-start;
626 628
         .title{

+ 243 - 0
pages/consumableList/consumableList.vue

@@ -0,0 +1,243 @@
1
+<template>
2
+  <view class="consumableList">
3
+    <view class="head">
4
+      <uni-search-bar v-model="dataInfo.keyWord" placeholder="请搜索耗材" bgColor="#F8F8F8" @input="search" cancelButton="none" focus :radius="18" />
5
+    </view>
6
+    <view class="body" v-if="dataInfo.list.length">
7
+      <view class="body_item ellipsis" v-for="data in dataInfo.list" :key="data.id" @click="numberClick(data, 'addConsumable')">
8
+        {{data.name}}
9
+      </view>
10
+    </view>
11
+    <view class="zanwu" v-else>
12
+      <text class="newicon newicon-zanwu"></text>
13
+    </view>
14
+    <view class="foot_common_btns">
15
+      <button @click="goBack" type="default" class="primaryButton btn">返回</button>
16
+    </view>
17
+    <NumberModal v-if="dataInfo.isNumber" @cancelEmit="cancelNumber" @confirmEmit="conformNumber" :selectData="dataInfo.selectData" :selectType="dataInfo.selectType"></NumberModal>
18
+  </view>
19
+</template>
20
+
21
+<script setup>
22
+  import { debounce } from 'lodash-es'
23
+  import { ref, reactive} from 'vue'
24
+  import NumberModal from '@/components/NumberModal.vue';
25
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
26
+  import { api_consumable, api_incidentDetail, api_addSummaryDoc } from "@/http/api.js"
27
+  import { defaultColor } from '@/static/js/theme.js'
28
+  import { useSetTitle } from '@/share/useSetTitle.js'
29
+  import { useLoginUserStore } from '@/stores/loginUser'
30
+  import { useGoBack } from '@/share/useGoBack.js'
31
+  
32
+  useSetTitle();
33
+  const loginUserStore = useLoginUserStore();
34
+  const { goBack }  = useGoBack();
35
+  
36
+  // 主题颜色
37
+  const primaryColor = ref(defaultColor)
38
+  
39
+  // 数据
40
+  const dataInfo = reactive({
41
+    list: [],//工单列表
42
+    idx: 0,//页码
43
+    hasMore: true,//是否有更多数据
44
+    incidentId: undefined,//事件ID
45
+    summaryId: undefined,//汇总单ID
46
+    incidentData: {},//事件对象
47
+    keyWord: '',//搜索的关键词
48
+    isNumber: false,//修改数量弹窗
49
+    evtNumber: 1,//弹窗返回的数量
50
+    selectData: {},//选择的对象
51
+    selectType: {},//选择的对象类型
52
+  })
53
+  
54
+  // 点击修改数量
55
+  function numberClick(data, type){
56
+    dataInfo.isNumber = true;
57
+    dataInfo.selectData = data;
58
+    dataInfo.selectType = type;
59
+  }
60
+  
61
+  // 确认修改数量
62
+  function conformNumber(evtNumber){
63
+    dataInfo.evtNumber = evtNumber;
64
+    dataInfo.isNumber = false;
65
+    addSummaryDoc();
66
+  }
67
+  
68
+  // 关闭修改数量
69
+  function cancelNumber(){
70
+    dataInfo.isNumber = false;
71
+  }
72
+  
73
+  // 添加耗材
74
+  function addSummaryDoc(){
75
+    uni.showLoading({
76
+      title: "加载中",
77
+      mask: true,
78
+    });
79
+    let postData = {
80
+      "consumableList": [
81
+        {
82
+          "consumablesId": dataInfo.selectData.id,
83
+          "consumablesNum": dataInfo.evtNumber
84
+        }
85
+      ],
86
+      "summaryId": dataInfo.summaryId
87
+    };
88
+    api_addSummaryDoc(postData).then(res => {
89
+      uni.hideLoading();
90
+      if(res.status == 200){
91
+        uni.showToast({
92
+        	icon: 'none',
93
+          title: '添加耗材成功',
94
+          mask: true,
95
+        });
96
+        setTimeout(() => {
97
+          uni.reLaunch({
98
+            url: `/pages/handler/handler?incidentId=${dataInfo.incidentId}`,
99
+          })
100
+        }, 1500)
101
+      }else{
102
+        uni.showToast({
103
+          icon: 'none',
104
+          title: res.msg || '请求数据失败!'
105
+        });
106
+      }
107
+    })
108
+  }
109
+  
110
+  // 获取事件详情
111
+  function getIncidentDetail(){
112
+    uni.showLoading({
113
+      title: "加载中",
114
+      mask: true,
115
+    });
116
+    api_incidentDetail(dataInfo.incidentId).then(res => {
117
+      uni.hideLoading();
118
+      if(res.status == 200){
119
+        dataInfo.incidentData = res.data || {};
120
+        getList(0);
121
+      }else{
122
+        uni.showToast({
123
+          icon: 'none',
124
+          title: res.msg || '请求数据失败!'
125
+        });
126
+      }
127
+    })
128
+  }
129
+  
130
+  // 搜索
131
+  const search = debounce(getList.bind(null, 0), 500);
132
+  
133
+  // 获取列表信息
134
+  function getList(idx){
135
+    if(dataInfo.keyWord.trim() === ''){
136
+      dataInfo.list = [];
137
+      uni.stopPullDownRefresh();
138
+      return;
139
+    }
140
+    
141
+    uni.showLoading({
142
+      title: "加载中",
143
+      mask: true,
144
+    });
145
+    
146
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
147
+    if(dataInfo.idx === 0){
148
+      dataInfo.list = [];
149
+    }
150
+
151
+    let postData = {
152
+      idx: dataInfo.idx,
153
+      sum: 20,
154
+      consumable: {
155
+        keyWord: dataInfo.keyWord,
156
+        dutyDTO: dataInfo.incidentData.duty,
157
+        showZero: true,
158
+      }
159
+    }
160
+    
161
+    api_consumable(postData).then(res => {
162
+      uni.hideLoading();
163
+      uni.stopPullDownRefresh();
164
+      if(res.status == 200){
165
+        let list = res.list || [];
166
+        if(list.length){
167
+          dataInfo.hasMore = true;
168
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
169
+        }else{
170
+          dataInfo.hasMore = false;
171
+        }
172
+      }else{
173
+        uni.showToast({
174
+          icon: 'none',
175
+          title: res.msg || '请求数据失败!'
176
+        });
177
+      }
178
+    })
179
+  }
180
+  
181
+  onLoad((option) => {
182
+    dataInfo.incidentId = option.incidentId;
183
+    dataInfo.summaryId = option.summaryId;
184
+    getIncidentDetail();
185
+  })
186
+  
187
+  onPullDownRefresh(() => {
188
+    getList(0)
189
+  })
190
+  
191
+  onReachBottom(() => {
192
+    dataInfo.idx += 1;
193
+    if (dataInfo.hasMore) {
194
+      getList(); // 当触底时加载更多数据
195
+    }
196
+  })
197
+</script>
198
+
199
+<style lang="scss" scoped>
200
+.consumableList{
201
+  display: flex;
202
+  flex-direction: column;
203
+  justify-content: space-between;
204
+  .head{
205
+    height: 88rpx;
206
+    display: flex;
207
+    align-items: center;
208
+    justify-content: center;
209
+    padding: 0 24rpx;
210
+    position: fixed;
211
+    z-index: 99;
212
+    width: 100%;
213
+    box-sizing: border-box;
214
+    background: linear-gradient( 90deg, #58CF66 0%, #DDE9FC 100%);
215
+  }
216
+  .body{
217
+    margin-bottom: 140rpx;
218
+    margin-top: 88rpx;
219
+    font-size: 26rpx;
220
+    .body_item{
221
+      border-bottom: 1rpx solid #DEDEDE;
222
+      padding: 24rpx;
223
+    }
224
+  }
225
+  .zanwu{
226
+    margin-bottom: 140rpx;
227
+    margin-top: 88rpx;
228
+    display: flex;
229
+    justify-content: center;
230
+    .newicon-zanwu{
231
+      font-size: 256rpx;
232
+      color: #D6D6D6;
233
+      margin-top: 140rpx;
234
+    }
235
+  }
236
+  .foot_common_btns{
237
+    position: fixed;
238
+    left: 0;
239
+    bottom: 0;
240
+    background-color: #fff;
241
+  }
242
+}
243
+</style>

File diff suppressed because it is too large
+ 1036 - 0
pages/handler/handler.vue


+ 8 - 3
pages/incidentList/incidentList.vue

@@ -51,9 +51,9 @@
51 51
     <view class="zanwu" v-else>
52 52
       <text class="newicon newicon-zanwu"></text>
53 53
     </view>
54
+    <IncidentListFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter"></IncidentListFilter>
55
+    <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
54 56
   </view>
55
-  <incidentListFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter"></incidentListFilter>
56
-  <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
57 57
 </template>
58 58
 
59 59
 <script setup>
@@ -103,7 +103,7 @@
103 103
   const dataInfo = reactive({
104 104
     tabs: [{id: 0, name: '全部', value: 'all', num: ''}],
105 105
     tabActiveId: 0,//当前选择的tab
106
-    list: [],//事件列表
106
+    list: [],//工单列表
107 107
     idx: 0,//页码
108 108
     hasMore: true,//是否有更多数据
109 109
     isFilter: false,//筛选框开关
@@ -367,6 +367,9 @@
367 367
 </script>
368 368
 
369 369
 <style lang="scss" scoped>
370
+page{
371
+  height: calc(100vh - 50px);
372
+}
370 373
 .incidentList{
371 374
   display: flex;
372 375
   flex-direction: column;
@@ -378,6 +381,7 @@
378 381
     z-index: 99;
379 382
     width: 100%;
380 383
     background-color: #fff;
384
+    font-size: 30rpx;
381 385
     .tab{
382 386
       flex: 1;
383 387
       display: flex;
@@ -411,6 +415,7 @@
411 415
         text-align: justify;
412 416
         text-align: left;
413 417
         margin: 24rpx;
418
+        font-size: 30rpx;
414 419
       }
415 420
       .body_item_content{
416 421
         border-top: 1rpx solid #D8D8D8;

+ 156 - 0
pages/workHourManagementOne/workHourManagementOne.vue

@@ -0,0 +1,156 @@
1
+<template>
2
+  <view class="workHourManagementOne">
3
+    <view class="head">
4
+      请选择工时分类
5
+    </view>
6
+    <view class="body" v-if="dataInfo.list.length">
7
+      <view class="body_item ellipsis" v-for="data in dataInfo.list" :key="data.id" @click="toWorkHourManagementTwo(data)">
8
+        {{data.workName}}
9
+      </view>
10
+    </view>
11
+    <view class="zanwu" v-else>
12
+      <text class="newicon newicon-zanwu"></text>
13
+    </view>
14
+    <view class="foot_common_btns">
15
+      <button @click="goBack" type="default" class="primaryButton btn">返回</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { ref, reactive} from 'vue'
22
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
23
+  import { api_workHourManagement } from "@/http/api.js"
24
+  import { defaultColor } from '@/static/js/theme.js'
25
+  import { useSetTitle } from '@/share/useSetTitle.js'
26
+  import { useLoginUserStore } from '@/stores/loginUser'
27
+  import { useGoBack } from '@/share/useGoBack.js'
28
+  
29
+  useSetTitle();
30
+  const loginUserStore = useLoginUserStore();
31
+  const { goBack }  = useGoBack();
32
+  
33
+  // 主题颜色
34
+  const primaryColor = ref(defaultColor)
35
+  
36
+  // 数据
37
+  const dataInfo = reactive({
38
+    list: [],//工单列表
39
+    idx: 0,//页码
40
+    hasMore: true,//是否有更多数据
41
+    incidentId: undefined,//事件ID
42
+    summaryId: undefined,//汇总单ID
43
+  })
44
+  
45
+  // 跳转二级工时管理列表
46
+  function toWorkHourManagementTwo(data){
47
+    uni.navigateTo({
48
+      url: `/pages/workHourManagementTwo/workHourManagementTwo?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}&parentId=${data.id}&parentName=${data.workName}`
49
+    })
50
+  }
51
+  
52
+  // 获取列表信息
53
+  function getList(idx){
54
+    uni.showLoading({
55
+      title: "加载中",
56
+      mask: true,
57
+    });
58
+    
59
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
60
+    if(dataInfo.idx === 0){
61
+      dataInfo.list = [];
62
+    }
63
+
64
+    let postData = {
65
+      idx: dataInfo.idx,
66
+      sum: 20,
67
+      workHourManagement: {
68
+        treeLevel: 1,
69
+      }
70
+    }
71
+    
72
+    api_workHourManagement(postData).then(res => {
73
+      uni.hideLoading();
74
+      uni.stopPullDownRefresh();
75
+      if(res.status == 200){
76
+        let list = res.list || [];
77
+        if(list.length){
78
+          dataInfo.hasMore = true;
79
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
80
+        }else{
81
+          dataInfo.hasMore = false;
82
+        }
83
+      }else{
84
+        uni.showToast({
85
+          icon: 'none',
86
+          title: res.msg || '请求数据失败!'
87
+        });
88
+      }
89
+    })
90
+  }
91
+  
92
+  onLoad((option) => {
93
+    dataInfo.incidentId = option.incidentId;
94
+    dataInfo.summaryId = option.summaryId;
95
+    getList(0);
96
+  })
97
+  
98
+  onPullDownRefresh(() => {
99
+    getList(0)
100
+  })
101
+  
102
+  onReachBottom(() => {
103
+    dataInfo.idx += 1;
104
+    if (dataInfo.hasMore) {
105
+      getList(); // 当触底时加载更多数据
106
+    }
107
+  })
108
+</script>
109
+
110
+<style lang="scss" scoped>
111
+.workHourManagementOne{
112
+  display: flex;
113
+  flex-direction: column;
114
+  justify-content: space-between;
115
+  .head{
116
+    height: 88rpx;
117
+    display: flex;
118
+    align-items: center;
119
+    padding: 0 24rpx;
120
+    position: fixed;
121
+    z-index: 99;
122
+    width: 100%;
123
+    box-sizing: border-box;
124
+    background: #fff;
125
+    font-size: 26rpx;
126
+    color: $uni-primary;
127
+  }
128
+  .body{
129
+    border-top: 1rpx solid #DEDEDE;
130
+    margin-bottom: 140rpx;
131
+    margin-top: 88rpx;
132
+    font-size: 26rpx;
133
+    .body_item{
134
+      border-bottom: 1rpx solid #DEDEDE;
135
+      padding: 24rpx;
136
+    }
137
+  }
138
+  .zanwu{
139
+    margin-bottom: 140rpx;
140
+    margin-top: 88rpx;
141
+    display: flex;
142
+    justify-content: center;
143
+    .newicon-zanwu{
144
+      font-size: 256rpx;
145
+      color: #D6D6D6;
146
+      margin-top: 140rpx;
147
+    }
148
+  }
149
+  .foot_common_btns{
150
+    position: fixed;
151
+    left: 0;
152
+    bottom: 0;
153
+    background-color: #fff;
154
+  }
155
+}
156
+</style>

+ 234 - 0
pages/workHourManagementTwo/workHourManagementTwo.vue

@@ -0,0 +1,234 @@
1
+<template>
2
+  <view class="workHourManagementTwo">
3
+    <view class="head">
4
+      <text class="one">{{dataInfo.parentName}}<uni-icons class="right" type="right" :size="16" :color="primaryColor"></uni-icons></text>
5
+      <text class="two ellipsis">{{dataInfo.workHourManagementSelectedList.filter(v => v.parent.id == dataInfo.parentId).map(v => v.workName).join(';')}}</text>
6
+    </view>
7
+    <view class="body" v-if="dataInfo.list.length">
8
+      <uni-data-checkbox v-model="dataInfo.workHourManagementList" multiple :localdata="dataInfo.list" mode="list" wrap icon="right" :map="{text:'workName',value:'id'}" @change="selectItem"></uni-data-checkbox>
9
+    </view>
10
+    <view class="zanwu" v-else>
11
+      <text class="newicon newicon-zanwu"></text>
12
+    </view>
13
+    <view class="foot_common_btns">
14
+      <button @click="goBack" type="default" class="primaryButton btn">上一级</button>
15
+      <button @click="confirm" type="default" class="primaryButton btn">确认</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { ref, reactive} from 'vue'
22
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
23
+  import { api_workHourManagement, api_querySummaryDoc, api_addSummaryDoc } from "@/http/api.js"
24
+  import { defaultColor } from '@/static/js/theme.js'
25
+  import { useSetTitle } from '@/share/useSetTitle.js'
26
+  import { useLoginUserStore } from '@/stores/loginUser'
27
+  import { useGoBack } from '@/share/useGoBack.js'
28
+  
29
+  useSetTitle();
30
+  const loginUserStore = useLoginUserStore();
31
+  const { goBack }  = useGoBack();
32
+  
33
+  // 主题颜色
34
+  const primaryColor = ref(defaultColor)
35
+  
36
+  // 数据
37
+  const dataInfo = reactive({
38
+    list: [],//工单列表
39
+    idx: 0,//页码
40
+    hasMore: true,//是否有更多数据
41
+    incidentId: undefined,//事件ID
42
+    summaryId: undefined,//汇总单ID
43
+    parentId: undefined,//一级工时管理id
44
+    parentName: '',//一级工时管理名称
45
+    workHourManagementList: [],//二级工时管理列表-回显
46
+    workHourManagementSelectedList: [],//二级工时管理列表-已选择
47
+  })
48
+  
49
+  // 获取汇总单信息
50
+  function getQuerySummaryDoc(){
51
+    uni.showLoading({
52
+      title: "加载中",
53
+      mask: true,
54
+    });
55
+    let postData = {
56
+      incidentId: dataInfo.incidentId,
57
+    };
58
+    api_querySummaryDoc(postData).then(res => {
59
+      uni.hideLoading();
60
+      if(res.status == 200){
61
+        dataInfo.workHourManagementSelectedList = res.workHourManagementList || [];
62
+        dataInfo.workHourManagementList = dataInfo.workHourManagementSelectedList.map(v => v.id);
63
+        getList(0);
64
+      }else{
65
+        uni.showToast({
66
+          icon: 'none',
67
+          title: res.msg || '请求数据失败!'
68
+        });
69
+      }
70
+    })
71
+  }
72
+  
73
+  // 选择
74
+  function selectItem(e){
75
+    let workHourManagementSelectedList = dataInfo.workHourManagementSelectedList.filter(v => v.parent.id != dataInfo.parentId);
76
+    let equelParentList = dataInfo.workHourManagementSelectedList.filter(v => v.parent.id == dataInfo.parentId);
77
+    dataInfo.workHourManagementSelectedList = workHourManagementSelectedList.concat(e.detail.data);
78
+  }
79
+  
80
+  // 确认
81
+  function confirm(){
82
+    if(dataInfo.workHourManagementSelectedList.length === 0){
83
+      uni.showToast({
84
+      	icon: 'none',
85
+        title: '请选择二级工时管理'
86
+      });
87
+      return;
88
+    }
89
+    uni.showLoading({
90
+      title: "加载中",
91
+      mask: true,
92
+    });
93
+
94
+    let postData = {
95
+      "workHourManagementList": dataInfo.workHourManagementSelectedList.map(v => ({workHourId: v.id, workHourNum: v.workHourNum2 || 1})),
96
+      "summaryId": dataInfo.summaryId
97
+    };
98
+    api_addSummaryDoc(postData).then(res => {
99
+      uni.hideLoading();
100
+      if(res.status == 200){
101
+        uni.showToast({
102
+        	icon: 'none',
103
+          title: '添加工时成功',
104
+          mask: true,
105
+        });
106
+        setTimeout(() => {
107
+          uni.reLaunch({
108
+            url: `/pages/handler/handler?incidentId=${dataInfo.incidentId}`,
109
+          })
110
+        }, 1500)
111
+      }else{
112
+        uni.showToast({
113
+          icon: 'none',
114
+          title: res.msg || '请求数据失败!'
115
+        });
116
+      }
117
+    })
118
+  }
119
+  
120
+  // 获取列表信息
121
+  function getList(idx){
122
+    uni.showLoading({
123
+      title: "加载中",
124
+      mask: true,
125
+    });
126
+    
127
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
128
+    if(dataInfo.idx === 0){
129
+      dataInfo.list = [];
130
+    }
131
+
132
+    let postData = {
133
+      idx: dataInfo.idx,
134
+      sum: 20,
135
+      workHourManagement: {
136
+        parent: {
137
+          id: dataInfo.parentId,
138
+        }
139
+      }
140
+    }
141
+    
142
+    api_workHourManagement(postData).then(res => {
143
+      uni.hideLoading();
144
+      uni.stopPullDownRefresh();
145
+      if(res.status == 200){
146
+        let list = res.list || [];
147
+        if(list.length){
148
+          dataInfo.hasMore = true;
149
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
150
+        }else{
151
+          dataInfo.hasMore = false;
152
+        }
153
+      }else{
154
+        uni.showToast({
155
+          icon: 'none',
156
+          title: res.msg || '请求数据失败!'
157
+        });
158
+      }
159
+    })
160
+  }
161
+  
162
+  onLoad((option) => {
163
+    dataInfo.incidentId = option.incidentId;
164
+    dataInfo.summaryId = option.summaryId;
165
+    dataInfo.parentId = option.parentId;
166
+    dataInfo.parentName = option.parentName;
167
+    getQuerySummaryDoc();
168
+  })
169
+  
170
+  onPullDownRefresh(() => {
171
+    getList(0)
172
+  })
173
+  
174
+  onReachBottom(() => {
175
+    dataInfo.idx += 1;
176
+    if (dataInfo.hasMore) {
177
+      getList(); // 当触底时加载更多数据
178
+    }
179
+  })
180
+</script>
181
+
182
+<style lang="scss" scoped>
183
+.workHourManagementTwo{
184
+  display: flex;
185
+  flex-direction: column;
186
+  justify-content: space-between;
187
+  .head{
188
+    height: 88rpx;
189
+    display: flex;
190
+    align-items: center;
191
+    padding: 0 24rpx;
192
+    position: fixed;
193
+    z-index: 99;
194
+    width: 100%;
195
+    box-sizing: border-box;
196
+    background: #fff;
197
+    font-size: 26rpx;
198
+    color: $uni-primary;
199
+    .right{
200
+      margin-top: 2rpx;
201
+    }
202
+    .two{
203
+      flex: 1;
204
+    }
205
+  }
206
+  .body{
207
+    border-top: 1rpx solid #DEDEDE;
208
+    margin-bottom: 140rpx;
209
+    margin-top: 88rpx;
210
+    font-size: 26rpx;
211
+    .body_item{
212
+      border-bottom: 1rpx solid #DEDEDE;
213
+      padding: 24rpx;
214
+    }
215
+  }
216
+  .zanwu{
217
+    margin-bottom: 140rpx;
218
+    margin-top: 88rpx;
219
+    display: flex;
220
+    justify-content: center;
221
+    .newicon-zanwu{
222
+      font-size: 256rpx;
223
+      color: #D6D6D6;
224
+      margin-top: 140rpx;
225
+    }
226
+  }
227
+  .foot_common_btns{
228
+    position: fixed;
229
+    left: 0;
230
+    bottom: 0;
231
+    background-color: #fff;
232
+  }
233
+}
234
+</style>

+ 141 - 3
static/font/demo_index.html

@@ -55,6 +55,42 @@
55 55
           <ul class="icon_lists dib-box">
56 56
           
57 57
             <li class="dib">
58
+              <span class="icon newicon">&#xe640;</span>
59
+                <div class="name">11</div>
60
+                <div class="code-name">&amp;#xe640;</div>
61
+              </li>
62
+          
63
+            <li class="dib">
64
+              <span class="icon newicon">&#xe602;</span>
65
+                <div class="name">下箭头</div>
66
+                <div class="code-name">&amp;#xe602;</div>
67
+              </li>
68
+          
69
+            <li class="dib">
70
+              <span class="icon newicon">&#xe601;</span>
71
+                <div class="name">3.1拍摄</div>
72
+                <div class="code-name">&amp;#xe601;</div>
73
+              </li>
74
+          
75
+            <li class="dib">
76
+              <span class="icon newicon">&#xe6a0;</span>
77
+                <div class="name">录制管理</div>
78
+                <div class="code-name">&amp;#xe6a0;</div>
79
+              </li>
80
+          
81
+            <li class="dib">
82
+              <span class="icon newicon">&#xe621;</span>
83
+                <div class="name">知识库</div>
84
+                <div class="code-name">&amp;#xe621;</div>
85
+              </li>
86
+          
87
+            <li class="dib">
88
+              <span class="icon newicon">&#xe689;</span>
89
+                <div class="name">快速报修</div>
90
+                <div class="code-name">&amp;#xe689;</div>
91
+              </li>
92
+          
93
+            <li class="dib">
58 94
               <span class="icon newicon">&#xe6cf;</span>
59 95
                 <div class="name">暂无</div>
60 96
                 <div class="code-name">&amp;#xe6cf;</div>
@@ -174,9 +210,9 @@
174 210
 <pre><code class="language-css"
175 211
 >@font-face {
176 212
   font-family: 'newicon';
177
-  src: url('iconfont.woff2?t=1713330377145') format('woff2'),
178
-       url('iconfont.woff?t=1713330377145') format('woff'),
179
-       url('iconfont.ttf?t=1713330377145') format('truetype');
213
+  src: url('iconfont.woff2?t=1713576883104') format('woff2'),
214
+       url('iconfont.woff?t=1713576883104') format('woff'),
215
+       url('iconfont.ttf?t=1713576883104') format('truetype');
180 216
 }
181 217
 </code></pre>
182 218
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -203,6 +239,60 @@
203 239
         <ul class="icon_lists dib-box">
204 240
           
205 241
           <li class="dib">
242
+            <span class="icon newicon newicon-icon-test"></span>
243
+            <div class="name">
244
+              11
245
+            </div>
246
+            <div class="code-name">.newicon-icon-test
247
+            </div>
248
+          </li>
249
+          
250
+          <li class="dib">
251
+            <span class="icon newicon newicon-xiajiantou"></span>
252
+            <div class="name">
253
+              下箭头
254
+            </div>
255
+            <div class="code-name">.newicon-xiajiantou
256
+            </div>
257
+          </li>
258
+          
259
+          <li class="dib">
260
+            <span class="icon newicon newicon-31paishe"></span>
261
+            <div class="name">
262
+              3.1拍摄
263
+            </div>
264
+            <div class="code-name">.newicon-31paishe
265
+            </div>
266
+          </li>
267
+          
268
+          <li class="dib">
269
+            <span class="icon newicon newicon-luzhiguanli"></span>
270
+            <div class="name">
271
+              录制管理
272
+            </div>
273
+            <div class="code-name">.newicon-luzhiguanli
274
+            </div>
275
+          </li>
276
+          
277
+          <li class="dib">
278
+            <span class="icon newicon newicon-zhishiku"></span>
279
+            <div class="name">
280
+              知识库
281
+            </div>
282
+            <div class="code-name">.newicon-zhishiku
283
+            </div>
284
+          </li>
285
+          
286
+          <li class="dib">
287
+            <span class="icon newicon newicon-kuaisubaoxiu"></span>
288
+            <div class="name">
289
+              快速报修
290
+            </div>
291
+            <div class="code-name">.newicon-kuaisubaoxiu
292
+            </div>
293
+          </li>
294
+          
295
+          <li class="dib">
206 296
             <span class="icon newicon newicon-zanwu"></span>
207 297
             <div class="name">
208 298
               暂无
@@ -384,6 +474,54 @@
384 474
           
385 475
             <li class="dib">
386 476
                 <svg class="icon svg-icon" aria-hidden="true">
477
+                  <use xlink:href="#newicon-icon-test"></use>
478
+                </svg>
479
+                <div class="name">11</div>
480
+                <div class="code-name">#newicon-icon-test</div>
481
+            </li>
482
+          
483
+            <li class="dib">
484
+                <svg class="icon svg-icon" aria-hidden="true">
485
+                  <use xlink:href="#newicon-xiajiantou"></use>
486
+                </svg>
487
+                <div class="name">下箭头</div>
488
+                <div class="code-name">#newicon-xiajiantou</div>
489
+            </li>
490
+          
491
+            <li class="dib">
492
+                <svg class="icon svg-icon" aria-hidden="true">
493
+                  <use xlink:href="#newicon-31paishe"></use>
494
+                </svg>
495
+                <div class="name">3.1拍摄</div>
496
+                <div class="code-name">#newicon-31paishe</div>
497
+            </li>
498
+          
499
+            <li class="dib">
500
+                <svg class="icon svg-icon" aria-hidden="true">
501
+                  <use xlink:href="#newicon-luzhiguanli"></use>
502
+                </svg>
503
+                <div class="name">录制管理</div>
504
+                <div class="code-name">#newicon-luzhiguanli</div>
505
+            </li>
506
+          
507
+            <li class="dib">
508
+                <svg class="icon svg-icon" aria-hidden="true">
509
+                  <use xlink:href="#newicon-zhishiku"></use>
510
+                </svg>
511
+                <div class="name">知识库</div>
512
+                <div class="code-name">#newicon-zhishiku</div>
513
+            </li>
514
+          
515
+            <li class="dib">
516
+                <svg class="icon svg-icon" aria-hidden="true">
517
+                  <use xlink:href="#newicon-kuaisubaoxiu"></use>
518
+                </svg>
519
+                <div class="name">快速报修</div>
520
+                <div class="code-name">#newicon-kuaisubaoxiu</div>
521
+            </li>
522
+          
523
+            <li class="dib">
524
+                <svg class="icon svg-icon" aria-hidden="true">
387 525
                   <use xlink:href="#newicon-zanwu"></use>
388 526
                 </svg>
389 527
                 <div class="name">暂无</div>

+ 27 - 3
static/font/iconfont.css

@@ -1,8 +1,8 @@
1 1
 @font-face {
2 2
   font-family: "newicon"; /* Project id 4304860 */
3
-  src: url('iconfont.woff2?t=1713330377145') format('woff2'),
4
-       url('iconfont.woff?t=1713330377145') format('woff'),
5
-       url('iconfont.ttf?t=1713330377145') format('truetype');
3
+  src: url('iconfont.woff2?t=1713576883104') format('woff2'),
4
+       url('iconfont.woff?t=1713576883104') format('woff'),
5
+       url('iconfont.ttf?t=1713576883104') format('truetype');
6 6
 }
7 7
 
8 8
 .newicon {
@@ -13,6 +13,30 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.newicon-icon-test:before {
17
+  content: "\e640";
18
+}
19
+
20
+.newicon-xiajiantou:before {
21
+  content: "\e602";
22
+}
23
+
24
+.newicon-31paishe:before {
25
+  content: "\e601";
26
+}
27
+
28
+.newicon-luzhiguanli:before {
29
+  content: "\e6a0";
30
+}
31
+
32
+.newicon-zhishiku:before {
33
+  content: "\e621";
34
+}
35
+
36
+.newicon-kuaisubaoxiu:before {
37
+  content: "\e689";
38
+}
39
+
16 40
 .newicon-zanwu:before {
17 41
   content: "\e6cf";
18 42
 }

File diff suppressed because it is too large
+ 1 - 1
static/font/iconfont.js


+ 42 - 0
static/font/iconfont.json

@@ -6,6 +6,48 @@
6 6
   "description": "",
7 7
   "glyphs": [
8 8
     {
9
+      "icon_id": "5598925",
10
+      "name": "11",
11
+      "font_class": "icon-test",
12
+      "unicode": "e640",
13
+      "unicode_decimal": 58944
14
+    },
15
+    {
16
+      "icon_id": "1718353",
17
+      "name": "下箭头",
18
+      "font_class": "xiajiantou",
19
+      "unicode": "e602",
20
+      "unicode_decimal": 58882
21
+    },
22
+    {
23
+      "icon_id": "201565",
24
+      "name": "3.1拍摄",
25
+      "font_class": "31paishe",
26
+      "unicode": "e601",
27
+      "unicode_decimal": 58881
28
+    },
29
+    {
30
+      "icon_id": "2732023",
31
+      "name": "录制管理",
32
+      "font_class": "luzhiguanli",
33
+      "unicode": "e6a0",
34
+      "unicode_decimal": 59040
35
+    },
36
+    {
37
+      "icon_id": "11836501",
38
+      "name": "知识库",
39
+      "font_class": "zhishiku",
40
+      "unicode": "e621",
41
+      "unicode_decimal": 58913
42
+    },
43
+    {
44
+      "icon_id": "18856229",
45
+      "name": "快速报修",
46
+      "font_class": "kuaisubaoxiu",
47
+      "unicode": "e689",
48
+      "unicode_decimal": 59017
49
+    },
50
+    {
9 51
       "icon_id": "20043806",
10 52
       "name": "暂无",
11 53
       "font_class": "zanwu",

BIN
static/font/iconfont.ttf


BIN
static/font/iconfont.woff


BIN
static/font/iconfont.woff2


+ 27 - 2
static/scss/common.scss

@@ -48,8 +48,7 @@ uni-toast,
48 48
 .foot_common_btns{
49 49
   width: 100%;
50 50
   box-sizing: border-box;
51
-  margin-bottom: 24rpx;
52
-  padding: 0 24rpx;
51
+  padding: 24rpx;
53 52
   display: flex;
54 53
   align-items: center;
55 54
   gap: 24rpx;
@@ -130,3 +129,29 @@ uni-toast,
130 129
     border: 1px solid red!important;
131 130
   }
132 131
 }
132
+
133
+// 搜索框
134
+.uni-searchbar{
135
+  padding: 0!important;
136
+  width: 100%!important;
137
+}
138
+
139
+// 数字框
140
+.uni-numbox__value{
141
+  background-color: #fff!important;
142
+  color: #000!important;
143
+  border: 1px solid #E5E5E5!important;
144
+  margin-left: 20rpx!important;
145
+  margin-right: 20rpx!important;
146
+}
147
+
148
+// 多选框
149
+.uni-data-checklist .checklist-group .checklist-box.is--list{
150
+  padding: 24rpx!important;
151
+  font-size: 26rpx!important;
152
+}
153
+.uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text{
154
+  margin-left: 0!important;
155
+  margin-right: 24rpx!important;
156
+  flex: 1!important;
157
+}

+ 13 - 1
utils/isTimestamp.js

@@ -1,7 +1,9 @@
1 1
 import { isDate } from 'date-fns';
2 2
 
3 3
 /**
4
- * 判断是否是时间戳
4
+ * @description 判断是否是时间戳
5
+ * @param {number} 时间戳
6
+ * @return {boolean}
5 7
  */
6 8
 export const isTimestamp = (value) => {
7 9
   // 判断是否为数字
@@ -13,3 +15,13 @@ export const isTimestamp = (value) => {
13 15
   // 判断是否为日期对象
14 16
   return isDate(new Date(value));
15 17
 }
18
+
19
+/**
20
+ * @description 生成连续的数字
21
+ * @param {number} start 起点数字  
22
+ * @param {number} end 终点数字
23
+ * @return {array} 
24
+ */
25
+export const generateNumberArray = (start, end) => {
26
+  return Array.from(new Array(end + 1).keys()).slice(start);
27
+}