|
|
@@ -4,120 +4,177 @@
|
|
|
<div class="page-container">
|
|
|
<!-- 基本信息 -->
|
|
|
<div class="card">
|
|
|
- <van-panel title="来访信息">
|
|
|
+ <van-panel title="来访信息" >
|
|
|
+ <template #header>
|
|
|
+ <van-cell title="状态">
|
|
|
+ <template #extra>
|
|
|
+ <span :style="{color:getState(approveStatus)}">
|
|
|
+ {{getDictLabel(approveStatus,'out_in_approve_status') }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </template>
|
|
|
<div class="panel-box">
|
|
|
- <van-cell title="来访类型" :value="visitType"></van-cell>
|
|
|
+ <van-cell title="来访类型" :value="getDictLabel(visitInfo.type,'out_in_type')"></van-cell>
|
|
|
<van-cell title="到访机构" :value="visitInfo.orgName"></van-cell>
|
|
|
- <van-cell title="来访事由" :value="visitInfo.description"></van-cell>
|
|
|
- <van-cell title="访问日期" :value="visitInfo.submitTime"></van-cell>
|
|
|
- <van-cell title="结束日期" :value="visitInfo.questionDesc"></van-cell>
|
|
|
- <van-cell title="介绍信上传" :value="visitInfo.images"></van-cell>
|
|
|
- <van-cell title="备注信息" :value="visitInfo.description"></van-cell>
|
|
|
+ <van-cell title="来访事由" :value="visitInfo.reasons"></van-cell>
|
|
|
+ <van-cell title="访问日期" :value="visitInfo.startTimeStr"></van-cell>
|
|
|
+ <van-cell title="结束日期" :value="visitInfo.endTimeStr"></van-cell>
|
|
|
+ <div class="upload-box">
|
|
|
+ <span>介绍信文件</span>
|
|
|
+ <van-cell v-if="visitInfo.letterFile">
|
|
|
+ <div
|
|
|
+ class="nfc-img van-hairline--surround"
|
|
|
+ v-for="(v, i) in visitInfo.letterFile"
|
|
|
+ :key="v.imgPath"
|
|
|
+ @click="preView(v.imgPath)">
|
|
|
+ <img :src="imgUrl(v.imgPath)" alt="" />
|
|
|
+ </div>
|
|
|
+ <!-- <img class="nfc-img" v-for="v in item.imgData" :src="imgUrl(v.imgPath)" alt="" :key="v.id">-->
|
|
|
+ </van-cell>
|
|
|
+ </div>
|
|
|
+ <van-cell v-if="visitInfo.description" title="备注信息" :value="visitInfo.description"></van-cell>
|
|
|
</div>
|
|
|
</van-panel>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 人员列表 -->
|
|
|
- <div class="card" v-for="(v,i) in pList" :key="i">
|
|
|
- <div class="goods-card">
|
|
|
- <div class="card-img-box" @click="preView('https://img01.yzcdn.cn/vant/cat.jpeg')">
|
|
|
- <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
|
|
|
- </div>
|
|
|
- <div class="card-cell-box">
|
|
|
- <van-cell title="出入人员" value="出入人员"></van-cell>
|
|
|
- <van-cell title="身份证" value="123456789012345678"></van-cell>
|
|
|
- <van-cell title="单位" value="高新兴讯美科技有限公司"></van-cell>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="card" v-for="(v,i) in pList" :key="i">
|
|
|
+ <!-- 人员列表 -->
|
|
|
+ <div class="card" v-for="(v,i) in userInfos" :key="i">
|
|
|
<div class="goods-card">
|
|
|
- <div class="card-img-box" @click="preView('https://img01.yzcdn.cn/vant/cat.jpeg')">
|
|
|
- <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
|
|
|
+ <div class="card-img-box" v-if="v.imgFile && v.imgFile.length > 0" @click="preView(v.imgFile)">
|
|
|
+ <img :src="imgUrl(v.imgFile[0])" alt="">
|
|
|
</div>
|
|
|
<div class="card-cell-box">
|
|
|
- <van-cell title="出入人员" value="出入人员"></van-cell>
|
|
|
- <van-cell title="身份证" value="123456789012345678"></van-cell>
|
|
|
- <van-cell title="单位" value="高新兴讯美科技有限公司"></van-cell>
|
|
|
+ <van-cell title="出入人员" :value="v.userName"></van-cell>
|
|
|
+ <van-cell title="身份证" :value="v.idCard"></van-cell>
|
|
|
+ <van-cell title="单位" :value="v.companyName"></van-cell>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="flex-box">
|
|
|
- <van-button type="default" style="width: 48%" plain @click="refuse">拒绝</van-button>
|
|
|
+ <div v-show="showInput" class="input-box">
|
|
|
+ <van-field
|
|
|
+ v-model="formData.description"
|
|
|
+ rows="1"
|
|
|
+ autosize
|
|
|
+ :maxlength="200"
|
|
|
+ label="审批说明"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入"/>
|
|
|
+ </div>
|
|
|
+ <div v-if="approveRemark" class="input-box">
|
|
|
+ <van-cell title="审批说明" :value="approveRemark"></van-cell>
|
|
|
+ </div>
|
|
|
+ <div v-if="approveStatus == 0" class="flex-box">
|
|
|
+ <van-button type="info" style="width: 48%" plain @click="refuse">拒绝</van-button>
|
|
|
<van-button type="info" style="width: 48%" @click="accredit">同意</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <org-picker
|
|
|
- :show="showPicker"
|
|
|
- @cancel="cancelPicker"
|
|
|
- @confirm="changeOrg">
|
|
|
- </org-picker>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import {defineComponent} from "vue";
|
|
|
-import SelectCell from "@/components/selectCell/index.vue";
|
|
|
import DateCell from "@/components/dateCell/index.vue";
|
|
|
import Uploader from "@/components/upload/gxuploader.vue";
|
|
|
-import OrgPicker from "@/components/OrgPicker/index.vue";
|
|
|
import {formatDate} from "@/filters/filter";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import {imgUrl} from "@/utils";
|
|
|
import { ImagePreview } from 'vant'
|
|
|
-export default defineComponent({
|
|
|
- components: {SelectCell,Uploader,DateCell,OrgPicker},
|
|
|
+import {visitDetails,visitCheck} from './api'
|
|
|
+export default {
|
|
|
+ components: {Uploader, DateCell},
|
|
|
data(){
|
|
|
return {
|
|
|
- activeNames:[1],
|
|
|
- checked:false,
|
|
|
+ visitId:null,
|
|
|
+ approveStatus:null,
|
|
|
+ approveRemark:null,
|
|
|
+ activeNames:['1'],
|
|
|
visitInfo: {},
|
|
|
- formData:{},
|
|
|
- //人员的单词:
|
|
|
- prop:{
|
|
|
- label:'name',
|
|
|
- value:'value'
|
|
|
+ userInfos:[],
|
|
|
+ formData:{
|
|
|
+
|
|
|
},
|
|
|
- visitType:1,
|
|
|
- typeList:[
|
|
|
- {
|
|
|
- name:'职能部门来访',
|
|
|
- value:1
|
|
|
- },
|
|
|
- {
|
|
|
- name:'临时来访',
|
|
|
- value:2
|
|
|
- },
|
|
|
- {
|
|
|
- name:'紧急来访',
|
|
|
- value:3
|
|
|
- }
|
|
|
- ],
|
|
|
- personnel:{},
|
|
|
- pList:[{}],
|
|
|
- showPicker:false,
|
|
|
+ showInput:false,
|
|
|
+ dicts:['out_in_approve_status','out_in_type']
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(['orgId','id','dictionary'])
|
|
|
},
|
|
|
+ mounted(){
|
|
|
+ this.visitId = this.$route.query.id;
|
|
|
+ console.log(this.visitId,'idddddddd')
|
|
|
+ this.getInfo();
|
|
|
+ },
|
|
|
methods:{
|
|
|
- formatDate,
|
|
|
+ imgUrl,formatDate,
|
|
|
+ // 拒绝
|
|
|
refuse(){
|
|
|
-
|
|
|
+ if(this.showInput){
|
|
|
+ let data = {
|
|
|
+ approveStatus:2,
|
|
|
+ approveRemark:this.formData.description,
|
|
|
+ id:this.visitInfo.approveLog.id
|
|
|
+ }
|
|
|
+ visitCheck(data).then(res=>{
|
|
|
+ this.$toast('操作成功');
|
|
|
+ this.$router.replace({
|
|
|
+ path:'/visitCheck',
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.showInput = true;
|
|
|
},
|
|
|
+ // 同意
|
|
|
accredit(){
|
|
|
-
|
|
|
+ let data = {
|
|
|
+ approveStatus:1,
|
|
|
+ id:this.visitInfo.approveLog.id
|
|
|
+ }
|
|
|
+ visitCheck(data).then(res=>{
|
|
|
+ this.$toast('操作成功');
|
|
|
+ this.$router.replace({
|
|
|
+ path:'/visitCheck',
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
- preView(url) {
|
|
|
- // this.preViewImages.images = this.nfcImage.map(v => imgUrl(v.img))
|
|
|
- // this.preViewImages.startPosition = i
|
|
|
- ImagePreview(url)
|
|
|
+ getState(state){
|
|
|
+ console.log(state,'state')
|
|
|
+ switch (state){
|
|
|
+ case 0:
|
|
|
+ return '#008cd6';
|
|
|
+ case 1:
|
|
|
+ return '#009240';
|
|
|
+ case 2:
|
|
|
+ return '#bc9f71';
|
|
|
+ case 3:
|
|
|
+ return '#D7000F';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getInfo(){
|
|
|
+ visitDetails(this.visitId).then(res=>{
|
|
|
+ this.visitInfo = res.data;
|
|
|
+ this.approveStatus = this.visitInfo.approveLog.approveStatus;
|
|
|
+ this.approveRemark = this.visitInfo.approveLog.approveRemark;
|
|
|
+ if(res.data.letterFile){
|
|
|
+ let imgArr = res.data.letterFile.map(v=>{
|
|
|
+ return JSON.parse(v)
|
|
|
+ })
|
|
|
+ this.visitInfo.letterFile = imgArr;
|
|
|
+ }
|
|
|
+ let users = res.data.userInfos.map(v=>{
|
|
|
+ v.imgFile = v.imgFile.split(',');
|
|
|
+ return v
|
|
|
+ });
|
|
|
+ console.log(users,'users')
|
|
|
+ this.userInfos = users;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ preView(val) {
|
|
|
+ ImagePreview(val);
|
|
|
},
|
|
|
}
|
|
|
-})
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
.intro-add{
|
|
|
@@ -137,7 +194,7 @@ export default defineComponent({
|
|
|
flex:.25;
|
|
|
}
|
|
|
.van-cell__value{
|
|
|
- flex:.75;
|
|
|
+ flex:.75;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -151,6 +208,7 @@ export default defineComponent({
|
|
|
height: calc(100vh - 94px);
|
|
|
overflow: auto;
|
|
|
padding: 20px;
|
|
|
+
|
|
|
}
|
|
|
.flex-box{
|
|
|
display: flex;
|
|
|
@@ -223,4 +281,36 @@ export default defineComponent({
|
|
|
.big-btn-box{
|
|
|
padding-bottom: 20px;
|
|
|
}
|
|
|
+.nfc-img {
|
|
|
+ display: inline-block;
|
|
|
+ width: 140px;
|
|
|
+ height: 140px;
|
|
|
+ margin: 0 10px;
|
|
|
+ position: relative;
|
|
|
+ > img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ > span {
|
|
|
+ position: absolute;
|
|
|
+ padding: 0 10px;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ background-color: rgba(0, 0, 0, 0.2);
|
|
|
+ color: #eaeaea;
|
|
|
+ font-size: 20px;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ line-height: 30px;
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+.input-box{
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
</style>
|