|
|
@@ -82,14 +82,17 @@
|
|
|
<date-cell v-if="canRecord() && !selectedUser.arrivalTime" required title="到达时间" :max-date="maxData" :min-date='minDate' :is-row="true" v-model="formData.arrivalTime" date-type="datetime" />
|
|
|
<date-cell v-if="canRecord() && selectedUser.arrivalTime && !selectedUser.departureTime" required title="离开时间" :max-date="maxData" :min-date='minDate' :is-row="true" v-model="formData.departureTime" date-type="datetime" />
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<van-action-sheet v-model="showSign" title="签名" class="sheet">
|
|
|
- <writingPad ref="esign" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
|
|
|
+ <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
|
|
|
</van-action-sheet>
|
|
|
<div v-if="canRecord() &&!selectedUser.departureTime" class="big-btn-box" >
|
|
|
<van-button type="info" size="large" @click="onSubmit">确认登记</van-button>
|
|
|
</div>
|
|
|
</van-panel>
|
|
|
+ <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
|
|
|
+ <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
|
|
|
+ </van-dialog>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
@@ -130,7 +133,10 @@ export default {
|
|
|
checkImage:null,
|
|
|
accompanyingPerson:null,
|
|
|
},
|
|
|
- dicts:['out_in_approve_status','out_in_type','letter_id_type']
|
|
|
+ dicts:['out_in_approve_status','out_in_type','letter_id_type'],
|
|
|
+ oldSignatureSeal:"",
|
|
|
+ confirmShow:false,
|
|
|
+ this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -140,6 +146,9 @@ export default {
|
|
|
this.visitId = this.$route.query.id;
|
|
|
this.getUserInfo();
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
|
|
|
+ },
|
|
|
methods:{
|
|
|
imgUrl,formatDate,
|
|
|
canRecord(){
|
|
|
@@ -166,13 +175,13 @@ export default {
|
|
|
this.$toast('请选择离开时间');
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(departureTime){
|
|
|
this.signatureHandler();
|
|
|
}
|
|
|
else{
|
|
|
this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage);
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl)
|
|
|
{
|
|
|
@@ -195,7 +204,7 @@ export default {
|
|
|
data.accompanyingPerson=accompanyingPerson;
|
|
|
}
|
|
|
if(checkImage)
|
|
|
- {
|
|
|
+ {
|
|
|
data.checkImage=checkImage.map(v=>{return v.imgPath}).toString(',');
|
|
|
}
|
|
|
if(signImgUrl)
|
|
|
@@ -219,27 +228,40 @@ export default {
|
|
|
{
|
|
|
this.showSign=false;
|
|
|
},
|
|
|
+ confirmSignImg(){
|
|
|
+ this.cancelSign();
|
|
|
+ //this.submitSign(this.oldSignatureSeal);
|
|
|
+ let {arrivalTime,departureTime,accompanyingPerson,checkImage} = this.formData;
|
|
|
+ let signImgUrl = this.oldSignatureSeal;
|
|
|
+ this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl);
|
|
|
+ },
|
|
|
//上传签名图到服务器
|
|
|
- resultImg(img) {
|
|
|
- let obj = base64ToBlob(img)
|
|
|
- let formData = new FormData()
|
|
|
+ resultImg(img,oldImgUrl) {
|
|
|
+ if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
|
|
|
+ //this.submitSign(oldImgUrl)
|
|
|
+ this.confirmShow =true;
|
|
|
+ this.oldSignatureSeal = oldImgUrl;
|
|
|
+ }else {
|
|
|
+ let obj = base64ToBlob(img)
|
|
|
+ let formData = new FormData()
|
|
|
|
|
|
- obj.name = '签名.jpg'
|
|
|
- formData.append('file', base64ToBlob(img))
|
|
|
+ obj.name = '签名.jpg'
|
|
|
+ formData.append('file', base64ToBlob(img))
|
|
|
|
|
|
- upload(formData, 'image')
|
|
|
- .then(res => {
|
|
|
- console.log(process.env.NODE_ENV)
|
|
|
- /*上传成功*/
|
|
|
- let signImgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
|
|
|
- // this.submitSign(imgUrl)
|
|
|
- let {arrivalTime,departureTime,accompanyingPerson,checkImage} = this.formData;
|
|
|
- this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl);
|
|
|
- // this.$emit("imgUrl", res.data.url);
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- /*上传失败*/
|
|
|
- })
|
|
|
+ upload(formData, 'image')
|
|
|
+ .then(res => {
|
|
|
+ console.log(process.env.NODE_ENV)
|
|
|
+ /*上传成功*/
|
|
|
+ let signImgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
|
|
|
+ // this.submitSign(imgUrl)
|
|
|
+ let {arrivalTime,departureTime,accompanyingPerson,checkImage} = this.formData;
|
|
|
+ this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl);
|
|
|
+ // this.$emit("imgUrl", res.data.url);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ /*上传失败*/
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
getUserInfo(){
|
|
|
userDetails(this.visitId).then(res=>{
|
|
|
@@ -266,7 +288,7 @@ export default {
|
|
|
{
|
|
|
this.minDate = new Date(minDate)
|
|
|
// 苹果手机下 某些版本 new Date(minDate) 对格式有严格要求
|
|
|
- if(!this.minDate){
|
|
|
+ if(!this.minDate){
|
|
|
// console.log("objStart",minDate,this.minDate)
|
|
|
let objStart=minDate.replace(/-/g,"/");
|
|
|
// console.log("objStart",objStart,this.minDate)
|
|
|
@@ -275,7 +297,7 @@ export default {
|
|
|
}
|
|
|
else{
|
|
|
this.minDate = new Date(null);
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
previewFile(file){
|