Browse Source

bug更新

XMLWAN 5 years ago
parent
commit
d7c8c5a5b1

+ 15 - 1
src/xt_pages/qcd/dialysisTotal.vue View File

@@ -22,7 +22,7 @@
22 22
         <el-date-picker
23 23
           v-model="listQuery.end_time"
24 24
           prefix-icon="el-icon-date"
25
-          @change="changeTime"
25
+          @change="changeEndTime"
26 26
           :editable="false"
27 27
           style="width: 196px;"
28 28
           type="date"
@@ -301,6 +301,20 @@ export default {
301 301
     changeTime() {
302 302
       this.getList();
303 303
     },
304
+    changeEndTime(val) {
305
+      var time =
306
+        this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
307
+      if (time < 0) {
308
+        this.$message.error("结束时间不能小于开始时间");
309
+        this.listQuery.end_time = "";
310
+      } else {
311
+        this.getList();
312
+      }
313
+    },
314
+    getTimestamp(time) {
315
+      // 把时间日期转成时间戳
316
+      return new Date(time).getTime() / 1000;
317
+    },
304 318
     selectStatisticalMethod(type) {
305 319
       this.statisticalMethod = type;
306 320
       this.listQuery.statistical_method = type;

+ 15 - 1
src/xt_pages/qcd/outcomeIndicators/control.vue View File

@@ -31,7 +31,7 @@
31 31
         <el-date-picker
32 32
           v-model="listQuery.end_time"
33 33
           prefix-icon="el-icon-date"
34
-          @change="changeTime"
34
+          @change="changeEndTime"
35 35
           :editable="false"
36 36
           style="width: 196px;"
37 37
           type="date"
@@ -376,6 +376,20 @@ export default {
376 376
     changeTime() {
377 377
       this.getList();
378 378
     },
379
+    changeEndTime(val) {
380
+      var time =
381
+        this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
382
+      if (time < 0) {
383
+        this.$message.error("结束时间不能小于开始时间");
384
+        this.listQuery.end_time = "";
385
+      } else {
386
+        this.getList();
387
+      }
388
+    },
389
+    getTimestamp(time) {
390
+      // 把时间日期转成时间戳
391
+      return new Date(time).getTime() / 1000;
392
+    },
379 393
     selectLapseTo(lapseto) {
380 394
       this.lapsetoType = lapseto;
381 395
       this.listQuery.lapseto = lapseto;

+ 15 - 1
src/xt_pages/qcd/patientAnalysis/total.vue View File

@@ -38,7 +38,7 @@
38 38
         <el-date-picker
39 39
           v-model="listQuery.end_time"
40 40
           prefix-icon="el-icon-date"
41
-          @change="changeTime"
41
+          @change="changeEndTime"
42 42
           :editable="false"
43 43
           style="width: 196px;"
44 44
           type="date"
@@ -283,6 +283,20 @@ export default {
283 283
     changeTime() {
284 284
       this.getList();
285 285
     },
286
+    changeEndTime(val) {
287
+      var time =
288
+        this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
289
+      if (time < 0) {
290
+        this.$message.error("结束时间不能小于开始时间");
291
+        this.listQuery.end_time = "";
292
+      } else {
293
+        this.getList();
294
+      }
295
+    },
296
+    getTimestamp(time) {
297
+      // 把时间日期转成时间戳
298
+      return new Date(time).getTime() / 1000;
299
+    },
286 300
     onSearch() {
287 301
       this.getList();
288 302
     },

+ 15 - 1
src/xt_pages/qcd/processIndicators.vue View File

@@ -22,7 +22,7 @@
22 22
         <el-date-picker
23 23
           v-model="listQuery.end_time"
24 24
           prefix-icon="el-icon-date"
25
-          @change="changeTime"
25
+          @change="changeEndTime"
26 26
           :editable="false"
27 27
           style="width: 196px;"
28 28
           type="date"
@@ -321,6 +321,20 @@ export default {
321 321
     changeTime() {
322 322
       this.getList();
323 323
     },
324
+    changeEndTime(val) {
325
+      var time =
326
+        this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
327
+      if (time < 0) {
328
+        this.$message.error("结束时间不能小于开始时间");
329
+        this.listQuery.end_time = "";
330
+      } else {
331
+        this.getList();
332
+      }
333
+    },
334
+    getTimestamp(time) {
335
+      // 把时间日期转成时间戳
336
+      return new Date(time).getTime() / 1000;
337
+    },
324 338
     selectLapseTo(lapseto) {
325 339
       this.lapsetoType = lapseto;
326 340
       this.listQuery.lapseto = lapseto;

+ 11 - 1
src/xt_pages/stock/cancelStockOrder.vue View File

@@ -339,7 +339,17 @@ export default {
339 339
       this.GetCancelStock();
340 340
     },
341 341
     endTimeChange(val) {
342
-      this.GetCancelStock();
342
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
343
+      if (time < 0) {
344
+        this.$message.error("结束时间不能小于开始时间");
345
+        this.end_time = "";
346
+      } else {
347
+        this.GetCancelStock();
348
+      }
349
+    },
350
+    getTimestamp(time) {
351
+      // 把时间日期转成时间戳
352
+      return new Date(time).getTime() / 1000;
343 353
     },
344 354
     calculate: function(val) {
345 355
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 1
src/xt_pages/stock/detail/cancelStockDetail.vue View File

@@ -381,7 +381,17 @@ export default {
381 381
       this.GetCancelStock();
382 382
     },
383 383
     endTimeChange(val) {
384
-      this.GetCancelStock();
384
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
385
+      if (time < 0) {
386
+        this.$message.error("结束时间不能小于开始时间");
387
+        this.end_time = "";
388
+      } else {
389
+        this.GetCancelStock();
390
+      }
391
+    },
392
+    getTimestamp(time) {
393
+      // 把时间日期转成时间戳
394
+      return new Date(time).getTime() / 1000;
385 395
     },
386 396
     calculate: function(val) {
387 397
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 1
src/xt_pages/stock/detail/salesReturnDetail.vue View File

@@ -380,7 +380,17 @@ export default {
380 380
       this.GetCancelStock();
381 381
     },
382 382
     endTimeChange(val) {
383
-      this.GetCancelStock();
383
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
384
+      if (time < 0) {
385
+        this.$message.error("结束时间不能小于开始时间");
386
+        this.end_time = "";
387
+      } else {
388
+        this.GetCancelStock();
389
+      }
390
+    },
391
+    getTimestamp(time) {
392
+      // 把时间日期转成时间戳
393
+      return new Date(time).getTime() / 1000;
384 394
     },
385 395
     calculate: function(val) {
386 396
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 1
src/xt_pages/stock/detail/stockInDetail.vue View File

@@ -422,7 +422,17 @@ export default {
422 422
       this.GetCancelStock();
423 423
     },
424 424
     endTimeChange(val) {
425
-      this.GetCancelStock();
425
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
426
+      if (time < 0) {
427
+        this.$message.error("结束时间不能小于开始时间");
428
+        this.end_time = "";
429
+      } else {
430
+        this.GetCancelStock();
431
+      }
432
+    },
433
+    getTimestamp(time) {
434
+      // 把时间日期转成时间戳
435
+      return new Date(time).getTime() / 1000;
426 436
     },
427 437
     calculate: function(val) {
428 438
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 1
src/xt_pages/stock/detail/stockOutDetail.vue View File

@@ -404,7 +404,17 @@ export default {
404 404
       this.GetCancelStock();
405 405
     },
406 406
     endTimeChange(val) {
407
-      this.GetCancelStock();
407
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
408
+      if (time < 0) {
409
+        this.$message.error("结束时间不能小于开始时间");
410
+        this.end_time = "";
411
+      } else {
412
+        this.GetCancelStock();
413
+      }
414
+    },
415
+    getTimestamp(time) {
416
+      // 把时间日期转成时间戳
417
+      return new Date(time).getTime() / 1000;
408 418
     },
409 419
     calculate: function(val) {
410 420
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 1
src/xt_pages/stock/otherCancelStockOrder.vue View File

@@ -337,7 +337,17 @@ export default {
337 337
       this.GetCancelStock();
338 338
     },
339 339
     endTimeChange(val) {
340
-      this.GetCancelStock();
340
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
341
+      if (time < 0) {
342
+        this.$message.error("结束时间不能小于开始时间");
343
+        this.end_time = "";
344
+      } else {
345
+        this.GetCancelStock();
346
+      }
347
+    },
348
+    getTimestamp(time) {
349
+      // 把时间日期转成时间戳
350
+      return new Date(time).getTime() / 1000;
341 351
     },
342 352
     calculate: function(val) {
343 353
       return Math.round(parseFloat(val) * 100) / 100;

+ 125 - 127
src/xt_pages/stock/otherSalesReturnOrder.vue View File

@@ -174,51 +174,51 @@
174 174
 </template>
175 175
 
176 176
 <script>
177
-import { uParseTime } from '@/utils/tools'
178
-import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
177
+import { uParseTime } from "@/utils/tools";
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
179 179
 import {
180 180
   deleteSalesReturn,
181 181
   GetAllConfig,
182 182
   getSalesReturnList,
183 183
   getWarehouseInfoList,
184 184
   getWarehouseList
185
-} from '@/api/stock'
186
-import BreadCrumb from '../components/bread-crumb'
185
+} from "@/api/stock";
186
+import BreadCrumb from "../components/bread-crumb";
187 187
 
188 188
 export default {
189
-  name: 'salesReturnOrder',
189
+  name: "salesReturnOrder",
190 190
   components: { BreadCrumb },
191 191
   created() {
192
-    var nowDate = new Date()
193
-    var nowYear = nowDate.getFullYear()
194
-    var nowMonth = nowDate.getMonth() + 1
195
-    var nowDay = nowDate.getDate()
192
+    var nowDate = new Date();
193
+    var nowYear = nowDate.getFullYear();
194
+    var nowMonth = nowDate.getMonth() + 1;
195
+    var nowDay = nowDate.getDate();
196 196
     this.end_time =
197 197
       nowYear +
198
-      '-' +
199
-      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
200
-      '-' +
201
-      (nowDay < 10 ? '0' + nowDay : nowDay)
202
-    nowDate.setMonth(nowDate.getMonth() - 1)
203
-    nowYear = nowDate.getFullYear()
204
-    nowMonth = nowDate.getMonth() + 1
205
-    nowDay = nowDate.getDate()
198
+      "-" +
199
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
200
+      "-" +
201
+      (nowDay < 10 ? "0" + nowDay : nowDay);
202
+    nowDate.setMonth(nowDate.getMonth() - 1);
203
+    nowYear = nowDate.getFullYear();
204
+    nowMonth = nowDate.getMonth() + 1;
205
+    nowDay = nowDate.getDate();
206 206
     this.start_time =
207 207
       nowYear +
208
-      '-' +
209
-      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
210
-      '-' +
211
-      (nowDay < 10 ? '0' + nowDay : nowDay)
212
-    this.GetSalesReturn()
213
-    this.GetConfigInfo()
214
-    this.fetchAllAdminUsers()
208
+      "-" +
209
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
210
+      "-" +
211
+      (nowDay < 10 ? "0" + nowDay : nowDay);
212
+    this.GetSalesReturn();
213
+    this.GetConfigInfo();
214
+    this.fetchAllAdminUsers();
215 215
   },
216 216
   data() {
217 217
     return {
218
-      searchKey: '',
218
+      searchKey: "",
219 219
       crumbs: [
220
-        { path: false, name: '库存管理' },
221
-        { path: false, name: '其他退货单' }
220
+        { path: false, name: "库存管理" },
221
+        { path: false, name: "其他退货单" }
222 222
       ],
223 223
       type: 2,
224 224
       page: 1,
@@ -229,17 +229,17 @@ export default {
229 229
       pageSelect: 0,
230 230
       adminUserOptions: [],
231 231
       multipleSelection: [],
232
-      signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
233
-      start_time: '',
232
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
233
+      start_time: "",
234 234
       saleReturnDate: [],
235
-      end_time: '',
235
+      end_time: "",
236 236
       goodType: [],
237 237
       goodInfo: [],
238 238
       manufacturer: [],
239 239
       selectedTableData: [],
240 240
       dealer: [],
241
-      startTime: ''
242
-    }
241
+      startTime: ""
242
+    };
243 243
   },
244 244
   methods: {
245 245
     search: function() {
@@ -250,25 +250,25 @@ export default {
250 250
         end_time: this.end_time,
251 251
         type: this.type,
252 252
         keywords: this.searchKey
253
-      }
254
-      this.saleReturnDate = []
253
+      };
254
+      this.saleReturnDate = [];
255 255
       getSalesReturnList(Params).then(response => {
256 256
         if (response.data.state == 0) {
257
-          this.$message.error(response.data.msg)
258
-          return false
257
+          this.$message.error(response.data.msg);
258
+          return false;
259 259
         } else {
260
-          this.total = response.data.data.total
260
+          this.total = response.data.data.total;
261 261
           for (let i = 0; i < response.data.data.list.length; i++) {
262
-            this.saleReturnDate.push(response.data.data.list[i])
262
+            this.saleReturnDate.push(response.data.data.list[i]);
263 263
           }
264 264
         }
265
-      })
265
+      });
266 266
     },
267 267
     AddNewOrder: function() {
268 268
       this.$router.push({
269
-        name: 'salesReturnOrderAdd',
269
+        name: "salesReturnOrderAdd",
270 270
         query: { type: this.type }
271
-      })
271
+      });
272 272
     },
273 273
     GetSalesReturn: function() {
274 274
       const Params = {
@@ -277,214 +277,212 @@ export default {
277 277
         start_time: this.start_time,
278 278
         end_time: this.end_time,
279 279
         type: this.type
280
-      }
281
-      this.saleReturnDate = []
280
+      };
281
+      this.saleReturnDate = [];
282 282
       getSalesReturnList(Params).then(response => {
283 283
         if (response.data.state == 0) {
284
-          this.$message.error(response.data.msg)
285
-          return false
284
+          this.$message.error(response.data.msg);
285
+          return false;
286 286
         } else {
287
-          this.total = response.data.data.total
287
+          this.total = response.data.data.total;
288 288
           for (let i = 0; i < response.data.data.list.length; i++) {
289
-            this.saleReturnDate.push(response.data.data.list[i])
289
+            this.saleReturnDate.push(response.data.data.list[i]);
290 290
           }
291 291
         }
292
-      })
292
+      });
293 293
     },
294 294
     getXuserName(id) {
295 295
       if (id <= 0) {
296
-        return ''
296
+        return "";
297 297
       }
298
-      var name = ''
298
+      var name = "";
299 299
       if (
300 300
         this.adminUserOptions == null ||
301
-        typeof this.adminUserOptions.length === 'undefined'
301
+        typeof this.adminUserOptions.length === "undefined"
302 302
       ) {
303
-        return name
303
+        return name;
304 304
       }
305
-      var leng = this.adminUserOptions.length
305
+      var leng = this.adminUserOptions.length;
306 306
       if (leng == 0) {
307
-        return name
307
+        return name;
308 308
       }
309 309
       for (let index = 0; index < leng; index++) {
310 310
         if (this.adminUserOptions[index].id == id) {
311
-          name = this.adminUserOptions[index].name
312
-          break
311
+          name = this.adminUserOptions[index].name;
312
+          break;
313 313
         }
314 314
       }
315
-      return name
315
+      return name;
316 316
     },
317 317
     fetchAllAdminUsers() {
318 318
       fetchAllAdminUsers().then(response => {
319
-        console.log(response)
319
+        console.log(response);
320 320
         if (response.data.state == 1) {
321
-          this.adminUserOptions = response.data.data.users
322
-          var alen = this.adminUserOptions.length
321
+          this.adminUserOptions = response.data.data.users;
322
+          var alen = this.adminUserOptions.length;
323 323
           for (let index = 0; index < alen; index++) {
324 324
             if (this.adminUserOptions[index].user_type == 2) {
325 325
               // this.doctorOptions.push(this.adminUserOptions[index]);
326 326
             }
327 327
           }
328 328
         }
329
-      })
329
+      });
330 330
     },
331 331
     handleSelectionChange: function(val) {
332
-      this.multipleSelection = val
332
+      this.multipleSelection = val;
333 333
     },
334 334
     handleSizeChange(val) {
335
-      this.limit = val
336
-      this.GetSalesReturn()
335
+      this.limit = val;
336
+      this.GetSalesReturn();
337 337
     },
338 338
     handleCurrentChange(val) {
339
-      this.page = val
340
-      this.GetSalesReturn()
339
+      this.page = val;
340
+      this.GetSalesReturn();
341 341
     },
342 342
     startTimeChange(val) {
343
-      this.startTime = this.getTimestamp(val)
344
-      this.GetSalesReturn()
343
+      this.startTime = this.getTimestamp(val);
344
+      this.GetSalesReturn();
345 345
     },
346 346
     endTimeChange(val) {
347
-      var time = this.getTimestamp(val) - this.startTime
348
-      console.log('开始时间', this.startTime)
349
-      console.log('结束', this.getTimestamp(val))
350
-      console.log('时间差', time)
347
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
351 348
       if (time < 0) {
352
-        this.$message.error('结束时间不能小于开始时间')
353
-        this.end_time = ''
349
+        this.$message.error("结束时间不能小于开始时间");
350
+        this.end_time = "";
354 351
       } else {
355
-        this.GetSalesReturn()
352
+        this.GetSalesReturn();
356 353
       }
357 354
     },
358
-    getTimestamp(time) { // 把时间日期转成时间戳
359
-      return (new Date(time)).getTime() / 1000
355
+    getTimestamp(time) {
356
+      // 把时间日期转成时间戳
357
+      return new Date(time).getTime() / 1000;
360 358
     },
361 359
     calculate: function(val) {
362
-      return Math.round(parseFloat(val) * 100) / 100
360
+      return Math.round(parseFloat(val) * 100) / 100;
363 361
     },
364 362
     GetConfigInfo: function() {
365 363
       GetAllConfig().then(response => {
366 364
         if (response.data.state == 0) {
367
-          this.$message.error(response.data.msg)
368
-          return false
365
+          this.$message.error(response.data.msg);
366
+          return false;
369 367
         } else {
370
-          this.manufacturer = response.data.data.manufacturer
371
-          this.dealer = response.data.data.dealer
368
+          this.manufacturer = response.data.data.manufacturer;
369
+          this.dealer = response.data.data.dealer;
372 370
         }
373
-      })
371
+      });
374 372
     },
375 373
     getManufactuerName: function(manufacturer_id) {
376 374
       for (let i = 0; i < this.manufacturer.length; i++) {
377 375
         if (this.manufacturer[i].id == manufacturer_id) {
378
-          return this.manufacturer[i].manufacturer_name
376
+          return this.manufacturer[i].manufacturer_name;
379 377
         }
380 378
       }
381 379
     },
382 380
     getDealerName: function(dealer_id) {
383 381
       for (let i = 0; i < this.dealer.length; i++) {
384 382
         if (this.dealer[i].id == dealer_id) {
385
-          return this.dealer[i].dealer_name
383
+          return this.dealer[i].dealer_name;
386 384
         }
387 385
       }
388 386
     },
389 387
     handleEdit: function(index, row) {
390 388
       this.$router.push({
391
-        name: 'salesReturnDetail',
389
+        name: "salesReturnDetail",
392 390
         query: { id: row.id, type: this.type }
393
-      })
391
+      });
394 392
     },
395 393
     handleDelete: function(index, row) {
396
-      const ids = []
397
-      ids.push(row.id)
398
-      const idStr = ids.join(',')
394
+      const ids = [];
395
+      ids.push(row.id);
396
+      const idStr = ids.join(",");
399 397
 
400 398
       const params = {
401 399
         ids: idStr
402
-      }
400
+      };
403 401
 
404
-      this.$confirm('确认删除退货单记录?', '删除退货单记录', {
405
-        confirmButtonText: '确定',
406
-        cancelButtonText: '取消',
407
-        type: 'warning'
402
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
403
+        confirmButtonText: "确定",
404
+        cancelButtonText: "取消",
405
+        type: "warning"
408 406
       })
409 407
         .then(() => {
410 408
           deleteSalesReturn(params).then(response => {
411 409
             if (response.data.state == 0) {
412
-              this.$message.error(response.data.msg)
413
-              return false
410
+              this.$message.error(response.data.msg);
411
+              return false;
414 412
             } else {
415 413
               this.$notify({
416
-                title: '成功',
417
-                message: '删除成功',
418
-                type: 'success',
414
+                title: "成功",
415
+                message: "删除成功",
416
+                type: "success",
419 417
                 duration: 2000
420
-              })
418
+              });
421 419
               for (let i = 0; i < ids.length; i++) {
422 420
                 for (let y = 0; y < this.saleReturnDate.length; y++) {
423 421
                   if (ids[i] == this.saleReturnDate[y].id) {
424
-                    this.saleReturnDate.splice(y, 1)
422
+                    this.saleReturnDate.splice(y, 1);
425 423
                   }
426 424
                 }
427 425
               }
428 426
             }
429
-          })
427
+          });
430 428
         })
431
-        .catch(() => {})
429
+        .catch(() => {});
432 430
     },
433 431
     changeAllSelected: function(val) {
434 432
       if (val) {
435
-        this.$refs.multipleTable.toggleAllSelection()
433
+        this.$refs.multipleTable.toggleAllSelection();
436 434
       } else {
437
-        this.$refs.multipleTable.clearSelection()
435
+        this.$refs.multipleTable.clearSelection();
438 436
       }
439 437
     },
440 438
     select(selection) {
441
-      this.selectedTableData = selection
439
+      this.selectedTableData = selection;
442 440
     },
443 441
     batchDelete() {
444 442
       if (this.selectedTableData.length <= 0) {
445
-        this.$message.error('请选择要删除的记录')
446
-        return
443
+        this.$message.error("请选择要删除的记录");
444
+        return;
447 445
       }
448
-      const ids = []
446
+      const ids = [];
449 447
       for (let i = 0; i < this.selectedTableData.length; i++) {
450
-        ids.push(this.selectedTableData[i].id)
448
+        ids.push(this.selectedTableData[i].id);
451 449
       }
452
-      const idStr = ids.join(',')
450
+      const idStr = ids.join(",");
453 451
       const params = {
454 452
         ids: idStr
455
-      }
456
-      this.$confirm('确认删除退货单记录?', '删除退货单记录', {
457
-        confirmButtonText: '确定',
458
-        cancelButtonText: '取消',
459
-        type: 'warning'
453
+      };
454
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
455
+        confirmButtonText: "确定",
456
+        cancelButtonText: "取消",
457
+        type: "warning"
460 458
       })
461 459
         .then(() => {
462 460
           deleteSalesReturn(params).then(response => {
463 461
             if (response.data.state == 0) {
464
-              this.$message.error(response.data.msg)
465
-              return false
462
+              this.$message.error(response.data.msg);
463
+              return false;
466 464
             } else {
467 465
               this.$notify({
468
-                title: '成功',
469
-                message: '删除成功',
470
-                type: 'success',
466
+                title: "成功",
467
+                message: "删除成功",
468
+                type: "success",
471 469
                 duration: 2000
472
-              })
470
+              });
473 471
 
474 472
               for (let i = 0; i < ids.length; i++) {
475 473
                 for (let y = 0; y < this.saleReturnDate.length; y++) {
476 474
                   if (ids[i] == this.saleReturnDate[y].id) {
477
-                    this.saleReturnDate.splice(y, 1)
475
+                    this.saleReturnDate.splice(y, 1);
478 476
                   }
479 477
                 }
480 478
               }
481 479
             }
482
-          })
480
+          });
483 481
         })
484
-        .catch(() => {})
482
+        .catch(() => {});
485 483
     }
486 484
   }
487
-}
485
+};
488 486
 </script>
489 487
 
490 488
 <style rel="stylesheet/css" lang="scss" scoped>

+ 11 - 1
src/xt_pages/stock/otherStockInOrder.vue View File

@@ -453,7 +453,17 @@ export default {
453 453
       this.GetWarehouse();
454 454
     },
455 455
     endTimeChange(val) {
456
-      this.GetWarehouse();
456
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
457
+      if (time < 0) {
458
+        this.$message.error("结束时间不能小于开始时间");
459
+        this.end_time = "";
460
+      } else {
461
+        this.GetWarehouse();
462
+      }
463
+    },
464
+    getTimestamp(time) {
465
+      // 把时间日期转成时间戳
466
+      return new Date(time).getTime() / 1000;
457 467
     },
458 468
     calculate: function(val) {
459 469
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 1
src/xt_pages/stock/otherStockOutOrder.vue View File

@@ -336,7 +336,17 @@ export default {
336 336
       this.GetWarehouseOut();
337 337
     },
338 338
     endTimeChange(val) {
339
-      this.GetWarehouseOut();
339
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
340
+      if (time < 0) {
341
+        this.$message.error("结束时间不能小于开始时间");
342
+        this.end_time = "";
343
+      } else {
344
+        this.GetWarehouseOut();
345
+      }
346
+    },
347
+    getTimestamp(time) {
348
+      // 把时间日期转成时间戳
349
+      return new Date(time).getTime() / 1000;
340 350
     },
341 351
     calculate: function(val) {
342 352
       return Math.round(parseFloat(val) * 100) / 100;

+ 11 - 0
src/xt_pages/stock/salesReturnOrder.vue View File

@@ -338,8 +338,19 @@ export default {
338 338
       this.GetSalesReturn();
339 339
     },
340 340
     endTimeChange(val) {
341
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
342
+      if (time < 0) {
343
+        this.$message.error("结束时间不能小于开始时间");
344
+        this.end_time = "";
345
+      } else {
346
+        this.GetWarehouse();
347
+      }
341 348
       this.GetSalesReturn();
342 349
     },
350
+    getTimestamp(time) {
351
+      // 把时间日期转成时间戳
352
+      return new Date(time).getTime() / 1000;
353
+    },
343 354
     calculate: function(val) {
344 355
       return Math.round(parseFloat(val) * 100) / 100;
345 356
     },

+ 0 - 2
src/xt_pages/stock/stockInOrder.vue View File

@@ -483,9 +483,7 @@ export default {
483 483
       this.startTime = this.getTimestamp(val);
484 484
     },
485 485
     endTimeChange(val) {
486
-      console.log("开始时间", this.start_time);
487 486
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
488
-      console.log("time", time);
489 487
       if (time < 0) {
490 488
         this.$message.error("结束时间不能小于开始时间");
491 489
         this.end_time = "";

+ 127 - 117
src/xt_pages/stock/stockOutOrder.vue View File

@@ -168,50 +168,50 @@
168 168
 </template>
169 169
 
170 170
 <script>
171
-import { uParseTime } from "@/utils/tools";
172
-import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
171
+import { uParseTime } from '@/utils/tools'
172
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
173 173
 
174 174
 import {
175 175
   deleteWarehouseOut,
176 176
   GetAllConfig,
177 177
   getWarehouseOutList
178
-} from "@/api/stock";
179
-import BreadCrumb from "../components/bread-crumb";
178
+} from '@/api/stock'
179
+import BreadCrumb from '../components/bread-crumb'
180 180
 
181 181
 export default {
182
-  name: "salesReturnOrder",
182
+  name: 'salesReturnOrder',
183 183
   components: { BreadCrumb },
184 184
   created() {
185
-    var nowDate = new Date();
186
-    var nowYear = nowDate.getFullYear();
187
-    var nowMonth = nowDate.getMonth() + 1;
188
-    var nowDay = nowDate.getDate();
185
+    var nowDate = new Date()
186
+    var nowYear = nowDate.getFullYear()
187
+    var nowMonth = nowDate.getMonth() + 1
188
+    var nowDay = nowDate.getDate()
189 189
     this.end_time =
190 190
       nowYear +
191
-      "-" +
192
-      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
193
-      "-" +
194
-      (nowDay < 10 ? "0" + nowDay : nowDay);
195
-    nowDate.setMonth(nowDate.getMonth() - 1);
196
-    nowYear = nowDate.getFullYear();
197
-    nowMonth = nowDate.getMonth() + 1;
198
-    nowDay = nowDate.getDate();
191
+      '-' +
192
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
193
+      '-' +
194
+      (nowDay < 10 ? '0' + nowDay : nowDay)
195
+    nowDate.setMonth(nowDate.getMonth() - 1)
196
+    nowYear = nowDate.getFullYear()
197
+    nowMonth = nowDate.getMonth() + 1
198
+    nowDay = nowDate.getDate()
199 199
     this.start_time =
200 200
       nowYear +
201
-      "-" +
202
-      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
203
-      "-" +
204
-      (nowDay < 10 ? "0" + nowDay : nowDay);
205
-    this.GetWarehouseOut();
206
-    this.GetConfigInfo();
207
-    this.fetchAllAdminUsers();
201
+      '-' +
202
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
203
+      '-' +
204
+      (nowDay < 10 ? '0' + nowDay : nowDay)
205
+    this.GetWarehouseOut()
206
+    this.GetConfigInfo()
207
+    this.fetchAllAdminUsers()
208 208
   },
209 209
   data() {
210 210
     return {
211
-      searchKey: "",
211
+      searchKey: '',
212 212
       crumbs: [
213
-        { path: false, name: "库存管理" },
214
-        { path: false, name: "出库单" }
213
+        { path: false, name: '库存管理' },
214
+        { path: false, name: '出库单' }
215 215
       ],
216 216
       page: 1,
217 217
       limit: 10,
@@ -221,17 +221,17 @@ export default {
221 221
       pageSelect: 0,
222 222
       adminUserOptions: [],
223 223
       multipleSelection: [],
224
-      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
225
-      start_time: "",
224
+      signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
225
+      start_time: '',
226 226
       warehouseOutDate: [],
227
-      end_time: "",
227
+      end_time: '',
228 228
       goodType: [],
229 229
       goodInfo: [],
230 230
       manufacturer: [],
231 231
       selectedTableData: [],
232 232
       dealer: [],
233 233
       type: 1
234
-    };
234
+    }
235 235
   },
236 236
   methods: {
237 237
     search: function() {
@@ -242,25 +242,25 @@ export default {
242 242
         end_time: this.end_time,
243 243
         type: this.type,
244 244
         keywords: this.searchKey
245
-      };
246
-      this.warehouseOutDate = [];
245
+      }
246
+      this.warehouseOutDate = []
247 247
       getWarehouseOutList(Params).then(response => {
248 248
         if (response.data.state == 0) {
249
-          this.$message.error(response.data.msg);
250
-          return false;
249
+          this.$message.error(response.data.msg)
250
+          return false
251 251
         } else {
252
-          this.total = response.data.data.total;
252
+          this.total = response.data.data.total
253 253
           for (let i = 0; i < response.data.data.list.length; i++) {
254
-            this.warehouseOutDate.push(response.data.data.list[i]);
254
+            this.warehouseOutDate.push(response.data.data.list[i])
255 255
           }
256 256
         }
257
-      });
257
+      })
258 258
     },
259 259
     AddNewOrder: function() {
260 260
       this.$router.push({
261
-        name: "stockOutOrderAdd",
261
+        name: 'stockOutOrderAdd',
262 262
         query: { type: this.type }
263
-      });
263
+      })
264 264
     },
265 265
     GetWarehouseOut: function() {
266 266
       const Params = {
@@ -269,201 +269,211 @@ export default {
269 269
         start_time: this.start_time,
270 270
         end_time: this.end_time,
271 271
         type: this.type
272
-      };
273
-      this.warehouseOutDate = [];
272
+      }
273
+      this.warehouseOutDate = []
274 274
       getWarehouseOutList(Params).then(response => {
275 275
         if (response.data.state == 0) {
276
-          this.$message.error(response.data.msg);
277
-          return false;
276
+          this.$message.error(response.data.msg)
277
+          return false
278 278
         } else {
279
-          this.total = response.data.data.total;
279
+          this.total = response.data.data.total
280 280
           for (let i = 0; i < response.data.data.list.length; i++) {
281
-            this.warehouseOutDate.push(response.data.data.list[i]);
281
+            this.warehouseOutDate.push(response.data.data.list[i])
282 282
           }
283 283
         }
284
-      });
284
+      })
285 285
     },
286 286
     getXuserName(id) {
287 287
       if (id <= 0) {
288
-        return "";
288
+        return ''
289 289
       }
290
-      var name = "";
290
+      var name = ''
291 291
       if (
292 292
         this.adminUserOptions == null ||
293
-        typeof this.adminUserOptions.length === "undefined"
293
+        typeof this.adminUserOptions.length === 'undefined'
294 294
       ) {
295
-        return name;
295
+        return name
296 296
       }
297
-      var leng = this.adminUserOptions.length;
297
+      var leng = this.adminUserOptions.length
298 298
       if (leng == 0) {
299
-        return name;
299
+        return name
300 300
       }
301 301
       for (let index = 0; index < leng; index++) {
302 302
         if (this.adminUserOptions[index].id == id) {
303
-          name = this.adminUserOptions[index].name;
304
-          break;
303
+          name = this.adminUserOptions[index].name
304
+          break
305 305
         }
306 306
       }
307
-      return name;
307
+      return name
308 308
     },
309 309
     fetchAllAdminUsers() {
310 310
       fetchAllAdminUsers().then(response => {
311
-        console.log(response);
311
+        console.log(response)
312 312
         if (response.data.state == 1) {
313
-          this.adminUserOptions = response.data.data.users;
314
-          var alen = this.adminUserOptions.length;
313
+          this.adminUserOptions = response.data.data.users
314
+          var alen = this.adminUserOptions.length
315 315
           for (let index = 0; index < alen; index++) {
316 316
             if (this.adminUserOptions[index].user_type == 2) {
317 317
               // this.doctorOptions.push(this.adminUserOptions[index]);
318 318
             }
319 319
           }
320 320
         }
321
-      });
321
+      })
322 322
     },
323 323
     handleSelectionChange: function(val) {
324
-      this.multipleSelection = val;
324
+      this.multipleSelection = val
325 325
     },
326 326
     handleSizeChange(val) {
327
-      this.limit = val;
328
-      this.GetWarehouseOut();
327
+      this.limit = val
328
+      this.GetWarehouseOut()
329 329
     },
330 330
     handleCurrentChange(val) {
331
-      this.page = val;
332
-      this.GetWarehouseOut();
331
+      this.page = val
332
+      this.GetWarehouseOut()
333 333
     },
334 334
     startTimeChange(val) {
335
-      this.GetWarehouseOut();
335
+      this.GetWarehouseOut()
336 336
     },
337 337
     endTimeChange(val) {
338
-      this.GetWarehouseOut();
338
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time)
339
+      if (time < 0) {
340
+        this.$message.error('结束时间不能小于开始时间')
341
+        this.end_time = ''
342
+      } else {
343
+        this.GetWarehouseOut()
344
+      }
345
+    },
346
+    getTimestamp(time) {
347
+      // 把时间日期转成时间戳
348
+      return new Date(time).getTime() / 1000
339 349
     },
340 350
     calculate: function(val) {
341
-      return Math.round(parseFloat(val) * 100) / 100;
351
+      return Math.round(parseFloat(val) * 100) / 100
342 352
     },
343 353
     GetConfigInfo: function() {
344 354
       GetAllConfig().then(response => {
345 355
         if (response.data.state == 0) {
346
-          this.$message.error(response.data.msg);
347
-          return false;
356
+          this.$message.error(response.data.msg)
357
+          return false
348 358
         } else {
349
-          this.manufacturer = response.data.data.manufacturer;
350
-          this.dealer = response.data.data.dealer;
359
+          this.manufacturer = response.data.data.manufacturer
360
+          this.dealer = response.data.data.dealer
351 361
         }
352
-      });
362
+      })
353 363
     },
354 364
     getManufactuerName: function(manufacturer_id) {
355 365
       for (let i = 0; i < this.manufacturer.length; i++) {
356 366
         if (this.manufacturer[i].id == manufacturer_id) {
357
-          return this.manufacturer[i].manufacturer_name;
367
+          return this.manufacturer[i].manufacturer_name
358 368
         }
359 369
       }
360 370
     },
361 371
     getDealerName: function(dealer_id) {
362 372
       for (let i = 0; i < this.dealer.length; i++) {
363 373
         if (this.dealer[i].id == dealer_id) {
364
-          return this.dealer[i].dealer_name;
374
+          return this.dealer[i].dealer_name
365 375
         }
366 376
       }
367 377
     },
368 378
     handleEdit: function(index, row) {
369 379
       this.$router.push({
370
-        name: "stockOutDetail",
380
+        name: 'stockOutDetail',
371 381
         query: { id: row.id, type: this.type }
372
-      });
382
+      })
373 383
     },
374 384
     handleDelete: function(index, row) {
375
-      const ids = [];
376
-      ids.push(row.id);
377
-      const idStr = ids.join(",");
385
+      const ids = []
386
+      ids.push(row.id)
387
+      const idStr = ids.join(',')
378 388
 
379 389
       const params = {
380 390
         ids: idStr
381
-      };
391
+      }
382 392
 
383
-      this.$confirm("确认删除出库单记录?", "删除出库单记录", {
384
-        confirmButtonText: "确定",
385
-        cancelButtonText: "取消",
386
-        type: "warning"
393
+      this.$confirm('确认删除出库单记录?', '删除出库单记录', {
394
+        confirmButtonText: '确定',
395
+        cancelButtonText: '取消',
396
+        type: 'warning'
387 397
       })
388 398
         .then(() => {
389 399
           deleteWarehouseOut(params).then(response => {
390 400
             if (response.data.state == 0) {
391
-              this.$message.error(response.data.msg);
392
-              return false;
401
+              this.$message.error(response.data.msg)
402
+              return false
393 403
             } else {
394 404
               this.$notify({
395
-                title: "成功",
396
-                message: "删除成功",
397
-                type: "success",
405
+                title: '成功',
406
+                message: '删除成功',
407
+                type: 'success',
398 408
                 duration: 2000
399
-              });
409
+              })
400 410
               for (let i = 0; i < ids.length; i++) {
401 411
                 for (let y = 0; y < this.warehouseOutDate.length; y++) {
402 412
                   if (ids[i] == this.warehouseOutDate[y].id) {
403
-                    this.warehouseOutDate.splice(y, 1);
413
+                    this.warehouseOutDate.splice(y, 1)
404 414
                   }
405 415
                 }
406 416
               }
407 417
             }
408
-          });
418
+          })
409 419
         })
410
-        .catch(() => {});
420
+        .catch(() => {})
411 421
     },
412 422
     changeAllSelected: function(val) {
413 423
       if (val) {
414
-        this.$refs.multipleTable.toggleAllSelection();
424
+        this.$refs.multipleTable.toggleAllSelection()
415 425
       } else {
416
-        this.$refs.multipleTable.clearSelection();
426
+        this.$refs.multipleTable.clearSelection()
417 427
       }
418 428
     },
419 429
     select(selection) {
420
-      this.selectedTableData = selection;
430
+      this.selectedTableData = selection
421 431
     },
422 432
     batchDelete() {
423 433
       if (this.selectedTableData.length <= 0) {
424
-        this.$message.error("请选择要删除的记录");
425
-        return;
434
+        this.$message.error('请选择要删除的记录')
435
+        return
426 436
       }
427
-      const ids = [];
437
+      const ids = []
428 438
       for (let i = 0; i < this.selectedTableData.length; i++) {
429
-        ids.push(this.selectedTableData[i].id);
439
+        ids.push(this.selectedTableData[i].id)
430 440
       }
431
-      const idStr = ids.join(",");
441
+      const idStr = ids.join(',')
432 442
       const params = {
433 443
         ids: idStr
434
-      };
435
-      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
436
-        confirmButtonText: "确定",
437
-        cancelButtonText: "取消",
438
-        type: "warning"
444
+      }
445
+      this.$confirm('确认删除退货单记录?', '删除退货单记录', {
446
+        confirmButtonText: '确定',
447
+        cancelButtonText: '取消',
448
+        type: 'warning'
439 449
       })
440 450
         .then(() => {
441 451
           deleteWarehouseOut(params).then(response => {
442 452
             if (response.data.state == 0) {
443
-              this.$message.error(response.data.msg);
444
-              return false;
453
+              this.$message.error(response.data.msg)
454
+              return false
445 455
             } else {
446 456
               this.$notify({
447
-                title: "成功",
448
-                message: "删除成功",
449
-                type: "success",
457
+                title: '成功',
458
+                message: '删除成功',
459
+                type: 'success',
450 460
                 duration: 2000
451
-              });
461
+              })
452 462
 
453 463
               for (let i = 0; i < ids.length; i++) {
454 464
                 for (let y = 0; y < this.warehouseOutDate.length; y++) {
455 465
                   if (ids[i] == this.warehouseOutDate[y].id) {
456
-                    this.warehouseOutDate.splice(y, 1);
466
+                    this.warehouseOutDate.splice(y, 1)
457 467
                   }
458 468
                 }
459 469
               }
460 470
             }
461
-          });
471
+          })
462 472
         })
463
-        .catch(() => {});
473
+        .catch(() => {})
464 474
     }
465 475
   }
466
-};
476
+}
467 477
 </script>
468 478
 
469 479
 <style rel="stylesheet/scss" lang="scss">