|
|
|
@ -19,7 +19,7 @@ |
|
|
|
<view class="nes"> |
|
|
|
<view class="conclusion"> |
|
|
|
<text class="prosecutors_pre">检查结论</text> |
|
|
|
<picker class="prosecutors_name" @change="pickerChange" :value="checkResultFlag" :range="array"> |
|
|
|
<picker class="prosecutors_name" @change="pickerChange" :value="checkResultFlag" :range="array" mode="selector"> |
|
|
|
<view :class="checkResultFlagName ? '' : 'gray'"> |
|
|
|
{{ checkResultFlagName ? checkResultFlagName : '请选择' }} |
|
|
|
</view> |
|
|
|
@ -100,6 +100,7 @@ |
|
|
|
<image @tap="deleteImage" :data-imageid="item.imageId" class="close" v-else src="/static/images/icon_close.png" /> |
|
|
|
</view> |
|
|
|
<image v-if="uploadImageList.length < 3" src="/static/images/ig_tianjiatupian@2x.png" @tap="chooseImage" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="attachment"> |
|
|
|
@ -109,7 +110,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="form_record"> |
|
|
|
<view class="form_record" > |
|
|
|
<view class="text2">巡查记录</view> |
|
|
|
<view class="logsBox" v-for="(item, index) in showList" :key="index"> |
|
|
|
<view :class="'item-dian ' + (index != 0 ? 'item-dian1' : '')"> |
|
|
|
@ -130,15 +131,15 @@ |
|
|
|
<text class="logs-content-title">检查结论:</text> |
|
|
|
<text class="logs-content-txt">{{ item.checkResultFlag == 1 ? '合格' : '不合格' }}</text> |
|
|
|
</view> |
|
|
|
<view v-if="item.hiddenDangeList0.length"> |
|
|
|
<view v-if="item.hiddenDangeList0"> |
|
|
|
<text class="logs-content-title">{{ !item.hiddenDangeList3 ? '未整改隐患:' : '隐患明细:' }}</text> |
|
|
|
<text class="logs-content-txt" :name="index" v-for="(item, index1) in item.hiddenDangeList0" :key="index1">{{ index + 1 }}.{{ item.hazardDesc }}</text> |
|
|
|
</view> |
|
|
|
<view v-if="item.hiddenDangeList1.length"> |
|
|
|
<view v-if="item.hiddenDangeList1"> |
|
|
|
<text class="logs-content-title" v-if="item.hiddenDangeList2.length == 0">已整改隐患:</text> |
|
|
|
<text class="logs-content-txt" :name="index" v-for="(item, index1) in item.hiddenDangeList1" :key="index1">{{ index + 1 }}.{{ item.hazardDesc }}</text> |
|
|
|
</view> |
|
|
|
<view v-if="item.hiddenDangeList2.length"> |
|
|
|
<view v-if="item.hiddenDangeList2"> |
|
|
|
<text class="logs-content-title">整改要求:</text> |
|
|
|
<text class="logs-content-txt" v-for="(item, index1) in item.hiddenDangeList2" :key="index1">{{ index + 1 }}.{{ item.hazardDesc }}</text> |
|
|
|
</view> |
|
|
|
@ -148,7 +149,7 @@ |
|
|
|
</view> |
|
|
|
<view> |
|
|
|
<text class="logs-content-title" v-if="item.attachmentUrls">附件:</text> |
|
|
|
<block v-if="item.attachmentUrls.length > 0"> |
|
|
|
<block > |
|
|
|
<text class="logs-content-txt" :data-item="item" @tap="onImage" v-for="(item, index1) in item.attachmentUrls" :key="index1"> |
|
|
|
{{ item.fileName }} |
|
|
|
</text> |
|
|
|
@ -179,27 +180,24 @@ |
|
|
|
</van-checkbox-group> |
|
|
|
</view> |
|
|
|
</van-popup> |
|
|
|
<wux-actionsheet id="wux-actionsheet" /> |
|
|
|
<van-popup :show="showtime" close-icon="close" position="bottom" custom-style="height: 50%" @close="closePopup" round> |
|
|
|
<van-datetime-picker type="datetime" :value="currentDate" :min-date="minDate" :max-date="maxDate" @confirm="handelConfirmDate" @input="onInput" @cancel="onCancel" /> |
|
|
|
<van-datetime-picker v-model="currentDate" type="datetime" /> |
|
|
|
</van-popup> |
|
|
|
<van-popup :show="imageshow" @close="onClose1" custom-style="imageup"> |
|
|
|
<van-image width="300" height="300" :src="attachmentUrl" /> |
|
|
|
</van-popup> |
|
|
|
<van-action-sheet v-model="uploadImageSheet" :actions="actions" @select="onSelectUpload" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import wuxActionsheet from '../../../../wxcomponents/dist/actionsheet/index'; |
|
|
|
// subpages/safetyinspection/pages/safetyinspection/safetyinspection.js |
|
|
|
import { $wuxActionSheet } from '../../../../wxcomponents/dist/index'; |
|
|
|
const app = getApp(); |
|
|
|
import { showRecord, addRecord, inspectionStaff, securityCheckk } from '../../../../utils/api'; |
|
|
|
import { timestampToTime } from '../../../../utils/index'; |
|
|
|
const config = require('../../../../utils/config'); |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
wuxActionsheet |
|
|
|
|
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -229,7 +227,7 @@ export default { |
|
|
|
selectedOptions: [], |
|
|
|
|
|
|
|
// 选中的复选框项 |
|
|
|
selectedNames: [], |
|
|
|
selectedNames: '', |
|
|
|
|
|
|
|
//显示检察人员 |
|
|
|
newContent: '', |
|
|
|
@ -256,7 +254,9 @@ export default { |
|
|
|
currentDateShow: '', |
|
|
|
checkPersonsIdList: '', |
|
|
|
checkResultFlagName: '', |
|
|
|
getData: '' |
|
|
|
getData: '', |
|
|
|
actions:[{name:'拍照'},{name:'从相册中获取'}], |
|
|
|
uploadImageSheet:true |
|
|
|
}; |
|
|
|
}, |
|
|
|
/** |
|
|
|
@ -437,6 +437,8 @@ export default { |
|
|
|
this.setData({ |
|
|
|
showList: res.data |
|
|
|
}); |
|
|
|
console.log(this.showList,'seeee'); |
|
|
|
|
|
|
|
const updatedShowList = this.showList.map((item, index, array) => { |
|
|
|
if (index < array.length - 1) { |
|
|
|
if (array[index + 1].checkResultFlag === 1 && item.checkResultFlag === 0) { |
|
|
|
@ -488,7 +490,7 @@ export default { |
|
|
|
}); |
|
|
|
this.setData({ |
|
|
|
showPopup: false, |
|
|
|
selectedNames: names, |
|
|
|
selectedNames: names.join(','), |
|
|
|
checkPersonsIdList: this.selectedOptions |
|
|
|
}); // 关闭弹出层 |
|
|
|
}, |
|
|
|
@ -504,7 +506,7 @@ export default { |
|
|
|
const selectedName = this.arr.filter((item) => this.selectedOptions.includes(item.staffId)).map((item) => item.name); |
|
|
|
this.setData({ |
|
|
|
showPopup: false, |
|
|
|
selectedNames: selectedName |
|
|
|
selectedNames: selectedName.join(',') |
|
|
|
}); // 关闭弹出层 |
|
|
|
}, |
|
|
|
|
|
|
|
@ -670,157 +672,159 @@ export default { |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
const _this = this; |
|
|
|
$wuxActionSheet().showSheet({ |
|
|
|
buttons: [ |
|
|
|
{ |
|
|
|
text: '拍照' |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: '从相册中获取', |
|
|
|
openType: null |
|
|
|
} |
|
|
|
], |
|
|
|
className: 'dialog-class', |
|
|
|
buttonClicked(index) { |
|
|
|
if (index === 0) { |
|
|
|
uni.chooseMedia({ |
|
|
|
count: 1, |
|
|
|
sizeType: ['original', 'compressed'], |
|
|
|
sourceType: ['camera'], |
|
|
|
success(res) { |
|
|
|
let deleteLength = _this.uploadImageList.length; |
|
|
|
const uploadImageList = [..._this.uploadImageList]; |
|
|
|
if (res.tempFiles[0].size <= 5242880) { |
|
|
|
uploadImageList.push({ |
|
|
|
uploaded: false, |
|
|
|
ossUrl: { |
|
|
|
url: res.tempFiles[0].tempFilePath |
|
|
|
}, |
|
|
|
imgUrl: res.tempFiles[0].tempFilePath, |
|
|
|
imageId: ++_this.imageId, |
|
|
|
type: res.tempFiles[0].tempFilePath.substr(res.tempFiles[0].tempFilePath.length - 3, 3), |
|
|
|
format: 'image', |
|
|
|
name: 'wximage' |
|
|
|
}); |
|
|
|
} else { |
|
|
|
_this.showToast('图片上限5M,请压缩后重试~'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
_this.setData({ |
|
|
|
uploadImageList |
|
|
|
}); |
|
|
|
uni.uploadFile({ |
|
|
|
url: `${config.BASEURL()}oss/file/uploadvariedfile`, |
|
|
|
filePath: res.tempFiles[0].tempFilePath, |
|
|
|
name: 'file', |
|
|
|
header: { |
|
|
|
'Content-type': 'application/json;charset=UTF-8', |
|
|
|
Authorization: uni.getStorageSync('token') |
|
|
|
}, |
|
|
|
success(fileRes) { |
|
|
|
if (!JSON.parse(fileRes.data).data) { |
|
|
|
_this.showToast('图片上传失败,请重试~'); |
|
|
|
// 删除 |
|
|
|
const index = _this.uploadImageList.findIndex((item) => item.imageId === _this.imageId); |
|
|
|
if (index > -1) { |
|
|
|
_this.uploadImageList.splice(index, 1); |
|
|
|
_this.setData({ |
|
|
|
uploadImageList: _this.uploadImageList |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
uploadImageList[uploadImageList.length - 1].uploaded = true; |
|
|
|
uploadImageList[uploadImageList.length - 1].ossUrl = JSON.parse(fileRes.data).data; |
|
|
|
_this.setData({ |
|
|
|
uploadImageList |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
fail(fileRes) { |
|
|
|
_this.setData({ |
|
|
|
uploadImageList: [] |
|
|
|
}); |
|
|
|
_this.showToast('图片上传失败,请重试~'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (index === 1) { |
|
|
|
uni.chooseMedia({ |
|
|
|
count: 1, |
|
|
|
type: 'image', |
|
|
|
sourceType: ['album'], |
|
|
|
success(res) { |
|
|
|
let deleteLength = _this.uploadImageList.length; |
|
|
|
const uploadImageList = []; |
|
|
|
const endIndex = _this.uploadImageList.length; |
|
|
|
res.tempFiles.forEach((item, index) => { |
|
|
|
if (item.size <= 5242880) { |
|
|
|
uploadImageList.push({ |
|
|
|
uploaded: false, |
|
|
|
ossUrl: { |
|
|
|
url: item.tempFilePath |
|
|
|
}, |
|
|
|
imgUrl: item.tempFilePath, |
|
|
|
imageId: ++_this.imageId, |
|
|
|
format: 'image', |
|
|
|
type: item.tempFilePath.substr(item.tempFilePath.length - 3, 3), |
|
|
|
originFileName: 'image' + index + 1 |
|
|
|
}); |
|
|
|
} else { |
|
|
|
_this.showToast('图片上限5M,请压缩后重试~'); |
|
|
|
} |
|
|
|
}); |
|
|
|
_this.setData({ |
|
|
|
uploadImageList: [..._this.uploadImageList, ...uploadImageList] |
|
|
|
}); |
|
|
|
uploadImageList.forEach((item, index) => { |
|
|
|
return (function (index) { |
|
|
|
uni.uploadFile({ |
|
|
|
url: `${config.BASEURL()}oss/file/uploadvariedfile`, |
|
|
|
filePath: res.tempFiles[index].tempFilePath, |
|
|
|
name: 'file', |
|
|
|
header: { |
|
|
|
'Content-type': 'application/json;charset=UTF-8', |
|
|
|
Authorization: uni.getStorageSync('token') |
|
|
|
}, |
|
|
|
success(fileRes) { |
|
|
|
if (!JSON.parse(fileRes.data).data) { |
|
|
|
_this.showToast('图片上传失败,请重试~'); |
|
|
|
_this.uploadImageList.splice(deleteLength, _this.uploadImageList.length - deleteLength); |
|
|
|
_this.setData({ |
|
|
|
uploadImageList: _this.uploadImageList |
|
|
|
}); |
|
|
|
} else { |
|
|
|
uploadImageList[index].uploaded = true; |
|
|
|
uploadImageList[index].ossUrl = JSON.parse(fileRes.data).data; |
|
|
|
_this.uploadImageList = _this.uploadImageList.slice(0, endIndex); |
|
|
|
_this.setData({ |
|
|
|
uploadImageList: [..._this.uploadImageList, ...uploadImageList] |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
fail(fileRes) { |
|
|
|
_this.setData({ |
|
|
|
uploadImageList: [] |
|
|
|
}); |
|
|
|
_this.showToast('图片上传失败,请重试~'); |
|
|
|
} |
|
|
|
}); |
|
|
|
})(index); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
cancelText: '取消', |
|
|
|
cancel() {}, |
|
|
|
destructiveButtonClicked() {} |
|
|
|
}); |
|
|
|
this.uploadImageSheet = true; |
|
|
|
}, |
|
|
|
onSelectUpload(item){ |
|
|
|
console.log(item); |
|
|
|
// wuxActionsheet.showSheet({ |
|
|
|
// buttons: [ |
|
|
|
// { |
|
|
|
// text: '拍照' |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// text: '从相册中获取', |
|
|
|
// openType: null |
|
|
|
// } |
|
|
|
// ], |
|
|
|
// className: 'dialog-class', |
|
|
|
// buttonClicked(index) { |
|
|
|
// if (index === 0) { |
|
|
|
// uni.chooseMedia({ |
|
|
|
// count: 1, |
|
|
|
// sizeType: ['original', 'compressed'], |
|
|
|
// sourceType: ['camera'], |
|
|
|
// success(res) { |
|
|
|
// let deleteLength = _this.uploadImageList.length; |
|
|
|
// const uploadImageList = [..._this.uploadImageList]; |
|
|
|
// if (res.tempFiles[0].size <= 5242880) { |
|
|
|
// uploadImageList.push({ |
|
|
|
// uploaded: false, |
|
|
|
// ossUrl: { |
|
|
|
// url: res.tempFiles[0].tempFilePath |
|
|
|
// }, |
|
|
|
// imgUrl: res.tempFiles[0].tempFilePath, |
|
|
|
// imageId: ++_this.imageId, |
|
|
|
// type: res.tempFiles[0].tempFilePath.substr(res.tempFiles[0].tempFilePath.length - 3, 3), |
|
|
|
// format: 'image', |
|
|
|
// name: 'wximage' |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// _this.showToast('图片上限5M,请压缩后重试~'); |
|
|
|
// return false; |
|
|
|
// } |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList |
|
|
|
// }); |
|
|
|
// uni.uploadFile({ |
|
|
|
// url: `${config.BASEURL()}oss/file/uploadvariedfile`, |
|
|
|
// filePath: res.tempFiles[0].tempFilePath, |
|
|
|
// name: 'file', |
|
|
|
// header: { |
|
|
|
// 'Content-type': 'application/json;charset=UTF-8', |
|
|
|
// Authorization: uni.getStorageSync('token') |
|
|
|
// }, |
|
|
|
// success(fileRes) { |
|
|
|
// if (!JSON.parse(fileRes.data).data) { |
|
|
|
// _this.showToast('图片上传失败,请重试~'); |
|
|
|
// // 删除 |
|
|
|
// const index = _this.uploadImageList.findIndex((item) => item.imageId === _this.imageId); |
|
|
|
// if (index > -1) { |
|
|
|
// _this.uploadImageList.splice(index, 1); |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList: _this.uploadImageList |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// uploadImageList[uploadImageList.length - 1].uploaded = true; |
|
|
|
// uploadImageList[uploadImageList.length - 1].ossUrl = JSON.parse(fileRes.data).data; |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// fail(fileRes) { |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList: [] |
|
|
|
// }); |
|
|
|
// _this.showToast('图片上传失败,请重试~'); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } else if (index === 1) { |
|
|
|
// uni.chooseMedia({ |
|
|
|
// count: 1, |
|
|
|
// type: 'image', |
|
|
|
// sourceType: ['album'], |
|
|
|
// success(res) { |
|
|
|
// let deleteLength = _this.uploadImageList.length; |
|
|
|
// const uploadImageList = []; |
|
|
|
// const endIndex = _this.uploadImageList.length; |
|
|
|
// res.tempFiles.forEach((item, index) => { |
|
|
|
// if (item.size <= 5242880) { |
|
|
|
// uploadImageList.push({ |
|
|
|
// uploaded: false, |
|
|
|
// ossUrl: { |
|
|
|
// url: item.tempFilePath |
|
|
|
// }, |
|
|
|
// imgUrl: item.tempFilePath, |
|
|
|
// imageId: ++_this.imageId, |
|
|
|
// format: 'image', |
|
|
|
// type: item.tempFilePath.substr(item.tempFilePath.length - 3, 3), |
|
|
|
// originFileName: 'image' + index + 1 |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// _this.showToast('图片上限5M,请压缩后重试~'); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList: [..._this.uploadImageList, ...uploadImageList] |
|
|
|
// }); |
|
|
|
// uploadImageList.forEach((item, index) => { |
|
|
|
// return (function (index) { |
|
|
|
// uni.uploadFile({ |
|
|
|
// url: `${config.BASEURL()}oss/file/uploadvariedfile`, |
|
|
|
// filePath: res.tempFiles[index].tempFilePath, |
|
|
|
// name: 'file', |
|
|
|
// header: { |
|
|
|
// 'Content-type': 'application/json;charset=UTF-8', |
|
|
|
// Authorization: uni.getStorageSync('token') |
|
|
|
// }, |
|
|
|
// success(fileRes) { |
|
|
|
// if (!JSON.parse(fileRes.data).data) { |
|
|
|
// _this.showToast('图片上传失败,请重试~'); |
|
|
|
// _this.uploadImageList.splice(deleteLength, _this.uploadImageList.length - deleteLength); |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList: _this.uploadImageList |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// uploadImageList[index].uploaded = true; |
|
|
|
// uploadImageList[index].ossUrl = JSON.parse(fileRes.data).data; |
|
|
|
// _this.uploadImageList = _this.uploadImageList.slice(0, endIndex); |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList: [..._this.uploadImageList, ...uploadImageList] |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// fail(fileRes) { |
|
|
|
// _this.setData({ |
|
|
|
// uploadImageList: [] |
|
|
|
// }); |
|
|
|
// _this.showToast('图片上传失败,请重试~'); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// })(index); |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// return true; |
|
|
|
// }, |
|
|
|
// cancelText: '取消', |
|
|
|
// cancel() {}, |
|
|
|
// destructiveButtonClicked() {} |
|
|
|
// }); |
|
|
|
}, |
|
|
|
|
|
|
|
pickerChange: function (e) { |
|
|
|
this.setData({ |
|
|
|
checkResultFlag: e.detail.value, |
|
|
|
|