|
@@ -6,13 +6,20 @@
|
|
|
<!-- <uni-icons type="scan" size="24" /> -->
|
|
|
</view>
|
|
|
|
|
|
- <view class="time-controls" style="margin-top: 10rpx;">
|
|
|
- <uni-section title="检查日期:" type="square" class="uni-row sta">
|
|
|
- <input v-model="startTime" type="date" @input="timeSizer" />
|
|
|
- </uni-section>
|
|
|
+ <view class="time-controls" style="margin-top: 10rpx;display: flex;margin-right: 0px;background-color: #ffffff;">
|
|
|
+ <view class="uni-row sta">
|
|
|
+ <span style="align-items: center;display: flex;font-size: 16px;margin-left: 12rpx;">检查日期:</span>
|
|
|
+ <view class="uni-row" style="flex: 1;width: 100%;">
|
|
|
+ <input v-model="startTime" type="date" @input="timeSizer" style="flex: 1;width: 100%;" />
|
|
|
+ <span style="align-items: center;display: flex;">—</span>
|
|
|
+ <input v-model="endTime" type="date" @input="timeSizer" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="uni-row" style="margin-top: 10rpx;">
|
|
|
+ <view class="scan-btn " style="min-height: 80rpx;" @click.stop="handleAddDeliveryInspection">新增交检</view>
|
|
|
+ <view class="scan-btn " style="background-color: #aaaaff;min-height: 80rpx;margin-left: 24rpx;" @click.stop="handleScan">扫码</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="scan-btn uni-row" style="min-height: 80rpx;" @click.stop="handleAddDeliveryInspection">新增交检</view>
|
|
|
<view class="daywork-item uni-column" v-for="(item, index) in inspecionList" :key="index"
|
|
|
@click="handleSelection(item)">
|
|
|
<view class="lot-code uni-row">
|
|
@@ -78,7 +85,8 @@
|
|
|
const inspecionList = ref([]); //时间后筛选数组
|
|
|
const original = ref([]); //原始数组
|
|
|
const startTime = ref(new Date().toISOString().split("T")[0])
|
|
|
-
|
|
|
+ const endTime = ref(new Date().toISOString().split("T")[0])
|
|
|
+ const showPicker = ref(false)
|
|
|
const range = [{
|
|
|
value: 0,
|
|
|
text: "待确认",
|
|
@@ -122,9 +130,18 @@
|
|
|
title: '加载中'
|
|
|
});
|
|
|
quer.value.startTime = startTime.value;
|
|
|
+ quer.value.endTime = endTime.value;
|
|
|
quer.value.deptId = store.curDeptDetails.deptId
|
|
|
quer.value.type = "deliveryInspection"
|
|
|
- getProcessInspecionList(quer.value).then(res => {
|
|
|
+ if(!checkTime(quer.value.startTime,quer.value.endTime)) {
|
|
|
+ console.log("777")
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "开始日期不能大于结束日期",
|
|
|
+ duration:2000
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ getProcessInspecionList(quer.value).then(res => {
|
|
|
console.log("res", res);
|
|
|
if (res.code == 200) {
|
|
|
original.value = res.rows;
|
|
@@ -132,7 +149,53 @@
|
|
|
uni.hideLoading();
|
|
|
}
|
|
|
});
|
|
|
+ }
|
|
|
}
|
|
|
+ //扫码
|
|
|
+ function handleScan() {
|
|
|
+ // 引入原生插件
|
|
|
+ const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
+ if (mpaasScanModule) {
|
|
|
+ // 调用插件的 mpaasScan 方法
|
|
|
+ mpaasScanModule.mpaasScan({
|
|
|
+ // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
+ // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
+ scanType: ["qrCode", "barCode"],
|
|
|
+ // 是否隐藏相册,默认false不隐藏
|
|
|
+ hideAlbum: false,
|
|
|
+ },
|
|
|
+ (ret) => {
|
|
|
+ console.log(ret);
|
|
|
+ let vehicleObj = {
|
|
|
+ carrierCode: ret.resp_result
|
|
|
+ };
|
|
|
+ if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请扫载具码",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ quer.value.keyword = vehicleObj.carrierCode
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ // 测试时用
|
|
|
+ quer.value.keyword = ""
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //判断开始时间是否大于结束时间
|
|
|
+ function checkTime(time1,time2){
|
|
|
+ let date1 = new Date(startTime.value);
|
|
|
+ let date2 = new Date(endTime.value);
|
|
|
+ if(date1 > date2) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
function delable(item) {
|
|
|
return true
|
|
|
// if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:remove') && item.status == 0) {
|
|
@@ -188,7 +251,19 @@
|
|
|
}
|
|
|
|
|
|
//时间筛选,暂时注释,使用搜索向
|
|
|
- function timeSizer() {}
|
|
|
+ function timeSizer() {
|
|
|
+ if(!checkTime(startTime.value,endTime.value)) {
|
|
|
+ console.log("777")
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: "开始日期不能大于结束日期",
|
|
|
+ duration:2000
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
// 筛选函数
|
|
|
const filterSameDayItems = (inspectionList, startTime) => {
|
|
@@ -259,40 +334,25 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+
|
|
|
.time-controls {
|
|
|
.title {
|
|
|
margin: 20% auto 40% auto;
|
|
|
-
|
|
|
- .first {
|
|
|
- font-size: 48rpx;
|
|
|
- margin: 0 auto;
|
|
|
- }
|
|
|
-
|
|
|
- .second {
|
|
|
- color: red;
|
|
|
- font-size: 24rpx;
|
|
|
- margin: 10rpx auto 0 auto;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.sta {
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
|
|
|
input {
|
|
|
border: 1rpx solid gray;
|
|
|
border-radius: 8rpx;
|
|
|
- width: 400rpx;
|
|
|
+ width: 100%;
|
|
|
+ // width: 400rpx;
|
|
|
+ flex:1;
|
|
|
height: 64rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- button {
|
|
|
- width: 78%;
|
|
|
- background-color: #1684fc;
|
|
|
- color: white;
|
|
|
- margin: 0 auto;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.page-container {
|
|
@@ -329,12 +389,12 @@
|
|
|
|
|
|
.scan-btn {
|
|
|
height: 64rpx;
|
|
|
- margin: 32rpx 32rpx 0 32rpx;
|
|
|
color: #ffffff;
|
|
|
background-color: #f47c3c;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 8rpx;
|
|
|
+ flex:1;
|
|
|
}
|
|
|
|
|
|
.daywork-item {
|