master
lion 9 months ago
parent 6bf2569b46
commit 8ccd204819

@ -24,6 +24,7 @@
"element-ui": "^2.15.13",
"file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"less": "^3.13.1",
"less-loader": "^5.0.0",
"moment": "^2.29.2",
"normalize.css": "7.0.0",

@ -1,203 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>axupimgs</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<style>
html,body{height:100%;margin:0;padding:0;background:#fff;}
ul{margin:0;padding:0;list-style:none;}
#wrap{padding:10px;}
#topbar{padding:10px 0;border-bottom:1px solid #ccc;text-align:right;}
#topbar button {margin:0;margin-left:5px;outline:none;padding: 4px 16px;box-sizing: border-box;
display:inline-block;border:none;border-radius:3px;text-align:center;cursor:pointer;
font-size:14px;line-height:1.5;background-color:#f0f0f0;color:#223;
}
#topbar button.primary{background-color:#3d97d4;color:#fff;}
#topbar button:hover{background-color:#207ab7;color:#fff;}
#topbar button.removeall{float:left}
#file_list {display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));padding-top:10px;}
#file_list:empty:after{content:'可以直接拖拽文件到这里';color:#777;font-size:0.8em;}
#file_list li{position:relative;display:block;vertical-align:top;padding:5px 5px;border-radius:5px;}
#file_list li.up-over {}
#file_list li.up-now {}
#file_list li.up-now:after{content:'';position:absolute;top:0;left:0;display:block;width:100%;height:100%;background:rgba(255,255,255,0.8) url(loading.gif) center center no-repeat;border-radius:5px;z-index:999;}
#file_list li:hover{background-color:#ddd;}
#file_list li .picbox {display:flex;flex:0 0 auto;justify-content:center;overflow:hidden;position:relative;width:100%;padding-top:100%;align-items:center;}
#file_list li .picbox img {display:block;max-width:100%;max-height:100%;position:absolute;
top:50%;left:50%;transform:translateX(-50%) translateY(-50%);}
#file_list li.up-over .picbox:after{content:url('data:image/svg+xml;%20charset=utf8,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M512%200C229.376%200%200%20229.376%200%20512s229.376%20512%20512%20512%20512-229.376%20512-512S794.624%200%20512%200z%22%20fill%3D%22%234AC711%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M855.552%20394.752l-358.4%20358.4a50.9952%2050.9952%200%200%201-72.192%200l-204.8-204.8c-18.944-19.968-18.944-51.2%200-71.168a50.5344%2050.5344%200%200%201%2072.192-1.024L460.8%20644.608l322.048-322.048c19.968-18.944%2051.2-18.944%2071.168%200%2020.48%2019.456%2020.992%2051.712%201.536%2072.192z%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');position:absolute;bottom:2px;right:2px;z-index:9;}
#file_list li .tools {display:none;position:absolute;bottom:5px;right:5px;z-index:99;}
#file_list li:hover .tools {display:block;}
#file_list li .tools .remove{cursor:pointer;}
#file_list li .tools .remove:after{content:url('data:image/svg+xml;%20charset=utf8,%3Csvg%20width=%2224%22%20height=%2224%22%20viewBox=%220%200%2024%2024%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath%20d=%22M17%206h3a1%201%200%200%201%200%202h-1v11a3%203%200%200%201-3%203H8a3%203%200%200%201-3-3V8H4a1%201%200%201%201%200-2h3V5a3%203%200%200%201%203-3h4a3%203%200%200%201%203%203v1zm-2%200V5a1%201%200%200%200-1-1h-4a1%201%200%200%200-1%201v1h6zm2%202H7v11a1%201%200%200%200%201%201h8a1%201%200%200%200%201-1V8zm-8%203a1%201%200%200%201%202%200v6a1%201%200%200%201-2%200v-6zm4%200a1%201%200%200%201%202%200v6a1%201%200%200%201-2%200v-6z%22%3E%3C/path%3E%3C/svg%3E');}
#file_list li .namebox {font-size:14px;line-height:20px;max-height:40px;overflow:hidden;padding:5px 10px;text-align:center;display:flex;justify-content:center;align-items:flex-start;}
#file_list li .namebox span{word-break:break-all;vertical-align:top;}
</style>
</head>
<body>
<div id="wrap">
<div id="topbar"><button class="addfile primary">+ 添加文件</button><button class="upall primary">全部上传</button><button class="removeall">清空列表</button></div>
<ul id="file_list"></ul>
</div>
<script>
var editor=parent.tinymce.activeEditor;
var axupimgs=parent.axupimgs;
axupimgs.res = []; //存放本地文件的数组
var blobInfo = {file:null}
blobInfo.blob = function(){return this.file;}
var upload_handler = axupimgs.images_upload_handler;
var upload_base_path = axupimgs.images_upload_base_path;
//为列表添加排序
function reSort(){
document.querySelectorAll('#file_list li').forEach((el,i)=>{
el.setAttribute('data-num',i);
});
}
function addList(files){
var files_sum = files.length;
var vDom = document.createDocumentFragment();
for(let i=0;i<files_sum;i++){
let file = files[i];
let blobUrl = window.URL.createObjectURL(file)
axupimgs.res.push({file:file,blobUrl:blobUrl,url:''});
let li = document.createElement('li');
li.setAttribute('class','up-no');
li.setAttribute('data-time',file.lastModified);
li.innerHTML='<div class="picbox"><img src="'+blobUrl+'"></div><div class="namebox"><span>'+file.name+'</span></div><div class="tools"><a class="remove"></a></div>';
vDom.appendChild(li);
}
document.querySelector('#file_list').appendChild(vDom);
//reSort();
}
//清空列表
document.querySelector('#topbar .removeall').addEventListener('click',()=>{
axupimgs.res=[]
document.querySelectorAll('#file_list li').forEach((el,i)=>{
el.parentNode.removeChild(el)
});
});
//拖拽添加
document.addEventListener('dragover', (e)=>{
e.stopPropagation();
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';
});
document.addEventListener('drop', (e)=>{
e.stopPropagation();
e.preventDefault();
if(!e.dataTransfer.files){return false;}
var dropfiles = e.dataTransfer.files;
if(!(dropfiles.length>0)){return false;}
var exts=axupimgs.axupimgs_filetype.replace(/(\s)+/g,'').toLowerCase().split(',');
var files=[];
for( let file of dropfiles ){
ext = file.name.split('.');
ext = '.'+ext[ext.length-1];
for(let s of exts){
if(s==ext){
files.push(file);
break;
}
}
}
if(files.length>0){ addList(files) }
});
//添加文件
document.querySelector('#topbar .addfile').addEventListener('click',()=>{
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('multiple', 'multiple');
input.setAttribute('accept', axupimgs.axupimgs_filetype);
input.click();
input.onchange = function() {
var files = this.files;
addList(files);
}
});
var file_i = 0;
function upAllFiles(n){
var len = axupimgs.res.length;
file_i = n;
if(len == n){
file_i=0;
document.querySelector('#topbar .upall').innerText='全部上传';
return true;
}
if( axupimgs.res[n].url!='' ){
n++;
upAllFiles(n)
}else{
blobInfo.file=axupimgs.res[n].file;
upload_handler(blobInfo,function(url){
if(upload_base_path){
if(upload_base_path.slice(-1)=='/' && url.substr(0,1)=='/' ){
url = upload_base_path + url.slice(1);
}else if(upload_base_path.slice(-1)!='/' && url.substr(0,1)!='/' ){
url = upload_base_path + '/' + url;
}else{
url = upload_base_path + url;
}
}
axupimgs.res[file_i].url = url;
filename = url.split('/').pop();
var li = document.querySelectorAll('#file_list li')[file_i];
li.setAttribute('class','up-over');
li.querySelector('.namebox span').innerText = filename;
n++
upAllFiles(n);
},function(err){
document.querySelector('#topbar .upall').innerText='全部上传';
document.querySelectorAll('#file_list li.up-now').forEach((el,i)=>{
el.setAttribute('class','up-no');
});
alert(err);
});
}
}
document.querySelector('#topbar .upall').addEventListener('click',(e)=>{
if(e.target.innerText!='全部上传'){return false;}
if(axupimgs.res.length>0){
document.querySelectorAll('#file_list li.up-no').forEach((el,i)=>{
el.classList ? el.classList.add('up-now') : el.className+=' up-now';
});
e.target.innerText='上传中...';
upAllFiles(0);
}
});
var observ_flist = new MutationObserver( (muList,observe)=>{
if(muList[0].addedNodes.length>0){
muList[0].addedNodes.forEach((el)=>{
el.querySelector('.remove').addEventListener('click',(e)=>{
var li = e.target.parentNode.parentNode;
var n = li.getAttribute('data-num');
var el = document.querySelectorAll('#file_list li')[n];
el.parentNode.removeChild(el);
axupimgs.res.splice(n,1);
});
});
}
reSort();
});
observ_flist.observe(document.querySelector('#file_list'),{childList:true});
</script>
</body>
</html>

@ -49,12 +49,14 @@
default: false,
},
plugins: {
type: [String, Array],
default: "code image axupimgs paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
type: [String, Array],
// axupimgs
default: "code image paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
},
toolbar: {
type: [String, Array],
default: ` undo redo restoredraft | code | image | axupimgs | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
type: [String, Array],
// axupimgs
default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat |
insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`,
},

@ -0,0 +1,740 @@
<template>
<div>
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增访视' : '编辑访视'"
:form="form" :rules="rules" @submit="submit">
<template v-slot:viewtext>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:1600px">
访视信息
</div>
</div>
</template>
<template v-slot:viewtime>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>访视时间
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.viewtime" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:viewscene>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>访视情景
</div>
<div class="xy-table-item-content">
<el-select v-model="form.viewscene" filterable style="width: 300px;" placeholder="请选择访视情景">
<el-option v-for="item in lists.viewsceneList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<!-- <template v-slot:viewstatus>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>人员状态
</div>
<div class="xy-table-item-content">
<el-select v-model="form.viewstatus" filterable style="width: 300px;" placeholder="请选择人员状态">
<el-option v-for="item in lists.viewstatusList" :key="item.value" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template> -->
<template v-slot:uploads>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>附件
</div>
<div class="xy-table-item-content">
<el-upload
class="upload-demo"
style="width: 800px;"
:action="actions"
:data='filedata'
:on-remove="handleRemove"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:on-success="handlesuccess"
:file-list="viewuploadsList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:infotext>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:1600px">
个人信息
</div>
</div>
</template>
<template v-slot:jiedao>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>所属街道
</div>
<div class="xy-table-item-content">
<el-select v-model="form.jiedao" filterable style="width: 300px;" placeholder="请选择所属街道">
<el-option v-for="item in lists.streetList" :key="item.value" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>姓名
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入姓名" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:nation>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>民族
</div>
<div class="xy-table-item-content">
<el-input v-model="form.nation" placeholder="请输入民族" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:sex>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>性别
</div>
<div class="xy-table-item-content">
<el-select v-model="form.sex" filterable style="width: 300px;" placeholder="请选择性别">
<el-option v-for="item in lists.sexList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:marry>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>婚姻状况
</div>
<div class="xy-table-item-content">
<el-select v-model="form.marry" filterable style="width: 300px;" placeholder="请选择婚姻状况">
<el-option v-for="item in lists.marryList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:birthday>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>出生年月
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.birthday" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:idcard>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>身份证
</div>
<div class="xy-table-item-content">
<el-input v-model="form.idcard" placeholder="请输入身份证" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:mobile>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>联系电话
</div>
<div class="xy-table-item-content">
<el-input v-model="form.mobile" placeholder="请输入联系电话" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:telephone>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>固话
</div>
<div class="xy-table-item-content">
<el-input v-model="form.telephone" placeholder="请输入固话" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:education>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>文化程度
</div>
<div class="xy-table-item-content">
<el-select v-model="form.education" filterable style="width: 300px;" placeholder="请选择文化程度">
<el-option v-for="item in lists.educationList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:hobily>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>特长
</div>
<div class="xy-table-item-content">
<el-input v-model="form.hobily" placeholder="请输入特长" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:isjob>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>就业情况
</div>
<div class="xy-table-item-content">
<el-input v-model="form.isjob" placeholder="请输入就业情况" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:company>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>就业单位
</div>
<div class="xy-table-item-content">
<el-input v-model="form.company" placeholder="请输入就业单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:household>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>户口性质
</div>
<div class="xy-table-item-content">
<el-input v-model="form.household" placeholder="请输入户口性质" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:address>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>户籍地址
</div>
<div class="xy-table-item-content">
<el-input v-model="form.address" placeholder="请输入户籍地址" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:reside>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>现居住地
</div>
<div class="xy-table-item-content">
<avue-input-map :params="mapparams" style="width: 300px;" placeholder="请选择地图" v-model="mapform"></avue-input-map>
<!-- <el-input v-model="form.reside" placeholder="请输入现居住地" clearable style="width: 300px;"></el-input> -->
</div>
</div>
</template>
<template v-slot:disabilitytext>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:1600px">
残疾证信息
</div>
</div>
</template>
<template v-slot:number>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>残疾证
</div>
<div class="xy-table-item-content">
<el-input v-model="form.number" placeholder="请输入残疾证" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:disabilitytype>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>残疾类别
</div>
<div class="xy-table-item-content">
<el-select v-model="form.disabilitytype" filterable style="width: 300px;" placeholder="请选择残疾类别">
<el-option v-for="item in lists.disabilitytypeList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:disabilitylevel>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>残疾等级
</div>
<div class="xy-table-item-content">
<el-select v-model="form.disabilitylevel" filterable style="width: 300px;" placeholder="请选择残疾等级">
<el-option v-for="item in lists.disabilitylevelList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:disabilitydetail>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>残疾详情
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="form.disabilitydetail" placeholder="请输入残疾详情" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:start_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>首次办证日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.start_time" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:validity>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>有效期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.validity" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>最后审核时间
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.end_time" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_change>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>最后修改日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 300px;" v-model="form.end_change" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:guardiantext>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:1600px">
监护人信息
</div>
</div>
</template>
<template v-slot:guardian>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>监护人
</div>
<div class="xy-table-item-content">
<el-input v-model="form.guardian" placeholder="请输入监护人" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:relationship>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>关系
</div>
<div class="xy-table-item-content">
<el-select v-model="form.relationship" filterable style="width: 300px;" placeholder="请选择关系">
<el-option v-for="item in lists.relationList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:guardian_mobile>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>联系电话
</div>
<div class="xy-table-item-content">
<el-input v-model="form.guardian_mobile" placeholder="请输入监护人联系电话" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:guardian_telephone>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>固话
</div>
<div class="xy-table-item-content">
<el-input v-model="form.guardian_telephone" placeholder="请输入监护人固话" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
getparameter
} from "@/api/system/dictionary";
import {
getToken
} from '@/utils/auth'
import {
save,
index,
show
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
import AvueMap from 'avue-plugin-map'
export default {
components: {
AvueMap
},
data() {
return {
isShow: false,
id: '',
person_id: '',
type: 'add',
tableName: 'viewrecords',
mapparams: {
zoom: 11,
},
mapform: [],
actions:`${process.env.VUE_APP_UPLOAD_API}`,
filedata: {
token: ""
},
viewuploadsList:[],
form: {
viewtext: '',
viewtime: "",
viewscene: "",
viewstatus: '',
uploads:'',
infotext: '',
jiedao:'',
name: '',
nation: '',
sex: "",
marry: "",
birthday: "",
idcard: "",
mobile: "",
telephone: "",
education: "",
hobily:"",
isjob:'',
company:"",
household: "",
address: "",
reside: "",
disabilitytext: "",
number: "",
disabilitytype: "",
disabilitylevel: "",
disabilitydetail: "",
start_time: "",
validity: "",
end_time: "",
end_change: "",
guardiantext: '',
guardian: "",
relationship: "",
guardian_mobile: "",
guardian_telephone: "",
remark: "",
},
rules: {},
lists:{
sexList: [],
marryList: [],
disabilitytypeList: [],
disabilitylevelList: [],
educationList: [],
relationList: [],
viewstatusList: [],
viewsceneList: [],
streetList:[]
}
}
},
created() {
this.filedata.token = getToken();
this.getLabel()
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getViewDetail()
} else {
this.getRecordDetail()
}
} else {
this.id = ''
this.type = ''
this.person_id = ''
this.mapform = []
this.viewuploadsList = []
this.$refs['dialog'].reset()
}
},
mapform(newVal){
if(newVal){
this.form.longitude = newVal[0]
this.form.latitude = newVal[1]
this.form.reside = newVal[2]
}
}
},
methods: {
async getLabel() {
let numbers = {
number:['streetList','sexList','marryList','disabilitylevelList','disabilitytypeList','educationList','relationList','viewsceneList','viewstatusList']
}
const res = await getparameter(numbers);
for(var k of res){
for(var m in this.lists){
if(m==k.number){
this.lists[m] = k.detail
}
}
}
},
//
handleRemove(file, fileList) {
for (var i = 0; i < this.viewuploadsList.length; i++) {
if (this.viewuploadsList[i].url == file.url) {
this.viewuploadsList.splice(i, 1)
}
}
console.log(this.viewuploadsList,file)
},
handleExceed(files, fileList) {},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.original_name }`);
},
handlesuccess(response, file, fileList) {
this.viewuploadsList = fileList;
},
async getRecordDetail() {
const res = await show({
id: this.person_id,
table_name: 'records'
})
this.form = {
viewtext: '',
viewtime: "",
viewscene: "",
viewstatus: '',
uploads:'',
infotext: '',
jiedao:res?.jiedao,
name: res?.name,
nation: res?.nation,
sex: res?.sex,
marry: res?.marry,
birthday: res?.birthday,
idcard: res?.idcard,
mobile: res?.mobile,
telephone: res?.telephone,
education: res?.education,
education: res?.education,
hobily:res?.hobily,
isjob:res?.isjob,
company:res?.company,
household: res?.household,
address: res?.address,
reside: res?.reside,
longitude: res?.longitude,
latitude:res?.latitude,
disabilitytext: '',
number: res?.number,
disabilitytype: res?.disabilitytype,
disabilitylevel: res?.disabilitylevel,
disabilitydetail: res?.disabilitydetail,
start_time: res?.start_time,
validity: res?.validity,
end_time: res?.end_time,
end_change: res?.end_change,
guardiantext: '',
guardian: res?.guardian,
relationship: res?.relationship,
guardian_mobile: res?.guardian_mobile,
guardian_telephone: res?.guardian_telephone,
remark: res?.remark,
}
this.mapform = [res.longitude,res.latitude,res.reside]
},
async getViewDetail() {
const res = await show({
id: this.id,
table_name: 'viewrecords'
})
this.form = {
viewtext: res?.viewtext,
viewtime: res?.viewtime,
viewscene: res?.viewscene,
viewstatus: res?.viewstatus,
person_id: res?.person_id,
checkstatus: res?.checkstatus,
uploads:res?.uploads,
infotext: res?.infotext,
jiedao:res?.jiedao,
name: res?.name,
nation: res?.nation,
sex: res?.sex,
marry: res?.marry,
birthday: res?.birthday,
idcard: res?.idcard,
mobile: res?.mobile,
telephone: res?.telephone,
education: res?.education,
education: res?.education,
hobily:res?.hobily,
isjob:res?.isjob,
company:res?.company,
household: res?.household,
address: res?.address,
reside: res?.reside,
longitude: res?.longitude,
latitude:res?.latitude,
disabilitytext: '',
number: res?.number,
disabilitytype: res?.disabilitytype,
disabilitylevel: res?.disabilitylevel,
disabilitydetail: res?.disabilitydetail,
start_time: res?.start_time,
validity: res?.validity,
end_time: res?.end_time,
end_change: res?.end_change,
guardiantext: '',
guardian: res?.guardian,
relationship: res?.relationship,
guardian_mobile: res?.guardian_mobile,
guardian_telephone: res?.guardian_telephone,
remark: res?.remark,
}
this.mapform = [res.longitude,res.latitude,res.reside]
for(var m in res.uploads_uploads_id_relation){
if(m=='name'){
res.uploads_uploads_id_relation[m] = res.uploads_uploads_id_relation['original_name']
}
}
if(res.uploads_uploads_id_relation){
this.viewuploadsList.push(res.uploads_uploads_id_relation)
}
console.log("this.viewuploadsList",this.viewuploadsList,this.form.uploads)
},
submit(val) {
if(this.viewuploadsList.length>0){
for (var m of this.viewuploadsList) {
if(m.response){
this.form.uploads = m.response.id
}else{
this.form.uploads = m.id
}
}
}else{
this.form.uploads = ''
}
// return
if (this.type === 'add') {
this.form.person_id = this.person_id
this.form.checkstatus = '待审核'
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '更新成功'
})
this.isShow = false
this.$emit('refresh')
})
}
}
},
}
</script>
<style>
</style>
Loading…
Cancel
Save