Commit 96f118f8 authored by 罗成兵's avatar 罗成兵

获取用户信息

parent 2f6e221d
...@@ -34,3 +34,4 @@ ...@@ -34,3 +34,4 @@
/folacin-pc/folacin-pc-dist/ /folacin-pc/folacin-pc-dist/
/folacin-pc/folacin-pc-dist.zip /folacin-pc/folacin-pc-dist.zip
/folacin-app/dist/
...@@ -3,15 +3,14 @@ NODE_ENV = dev ...@@ -3,15 +3,14 @@ NODE_ENV = dev
VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com
VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com
VUE_APP_BASE_URL4 = http://59.230.237.90:8115 VUE_APP_BASE_URL4 = http://59.230.237.90:8115
VUE_APP_BASE_URL = http://127.0.0.1:8083 VUE_APP_BASE_URL =
VUE_APP_BASE_URL33 = https://beta-cqbp-yesuan.yiboshi.com:86/service-api VUE_APP_BASE_URL33 = https://beta-cqbp-yesuan.yiboshi.com:86/service-api
VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION2 = https://beta-yesuan.yiboshi.com/#/ VUE_APP_LOCATION2 = https://beta-yesuan.yiboshi.com/#/
VUE_APP_LOCATION1 = https://yesuan.yiboshi.com/#/ VUE_APP_LOCATION1 = https://yesuan.yiboshi.com/#/
VUE_APP_LOCATION = http://127.0.0.1:8080/#/ VUE_APP_LOCATION = http://192.168.1.174:8089/#/
VUE_APP_LOCATION = http://127.0.0.1:8080/#/
VUE_APP_SERVICE_API= VUE_APP_SERVICE_API=
#区域编码末尾是否填充0 #区域编码末尾是否填充0
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"pc-insatll": "yarn install", "npm-insatll": "npm install",
"pc-dev": "vue-cli-service serve --mode dev", "yarn-insatll": "yarn install",
"serve-dev": "vue-cli-service serve --mode dev",
"serve-yy": "vue-cli-service serve --mode yueyang", "serve-yy": "vue-cli-service serve --mode yueyang",
"build:test": "vue-cli-service build --mode test", "build:test": "vue-cli-service build --mode test",
"build:prod": "vue-cli-service build --mode prod --report", "build:prod": "vue-cli-service build --mode prod --report",
......
This diff is collapsed.
/*! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */
;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'<h3 style="'+(a?c.title[1]:"")+'">'+(a?c.title[0]:c.title)+"</h3>":""}(),j=function(){"string"==typeof c.btn&&(c.btn=[c.btn]);var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a='<span yes type="1">'+c.btn[0]+"</span>",2===b&&(a='<span no type="0">'+c.btn[1]+"</span>"+a),'<div class="layui-m-layerbtn">'+a+"</div>"):""}();if(c.fixed||(c.top=c.hasOwnProperty("top")?c.top:100,c.style=c.style||"",c.style+=" top:"+(b.body.scrollTop+c.top)+"px"),2===c.type&&(c.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(c.content||"")+"</p>"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerHTML=(c.shade?"<div "+("string"==typeof c.shade?'style="'+c.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(c.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(c.skin?"layui-m-layer-"+c.skin+" ":"")+(c.className?c.className:"")+" "+(c.anim?"layui-m-anim-"+c.anim:"")+'" '+(c.style?'style="'+c.style+'"':"")+">"+g+'<div class="layui-m-layercont">'+c.content+"</div>"+j+"</div></div></div>",!c.type||2===c.type){var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getAttribute("index"))}document.body.appendChild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;a.time&&(g.timer[c.index]=setTimeout(function(){layer.close(c.index)},1e3*a.time));var e=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn)for(var f=b[d]("layui-m-layerbtn")[0].children,h=f.length,i=0;h>i;i++)g.touch(f[i],e);if(a.shade&&a.shadeClose){var j=b[d]("layui-m-layershade")[0];g.touch(j,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"2.0",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerHTML="",b.body.removeChild(c),clearTimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeAll:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c++)layer.close(0|a[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var a=document.scripts,c=a[a.length-1],d=c.src,e=d.substring(0,d.lastIndexOf("/")+1);c.getAttribute("merge")||document.head.appendChild(function(){var a=b.createElement("link");return a.href=e+"need/layer.css?2.0",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}())}()}(window);
\ No newline at end of file
.layui-m-layer{position:relative;z-index:19891014}.layui-m-layer *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.layui-m-layermain,.layui-m-layershade{position:fixed;left:0;top:0;width:100%;height:100%}.layui-m-layershade{background-color:rgba(0,0,0,.7);pointer-events:auto}.layui-m-layermain{display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none}.layui-m-layermain .layui-m-layersection{display:table-cell;vertical-align:middle;text-align:center}.layui-m-layerchild{position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.layui-m-anim-scale{animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale}@-webkit-keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.layui-m-anim-up{-webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up}.layui-m-layer0 .layui-m-layerchild{width:90%;max-width:640px}.layui-m-layer1 .layui-m-layerchild{border:none;border-radius:0}.layui-m-layer2 .layui-m-layerchild{width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff}.layui-m-layerchild h3{padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center}.layui-m-layerbtn span,.layui-m-layerchild h3{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-m-layercont{padding:50px 30px;line-height:22px;text-align:center}.layui-m-layer1 .layui-m-layercont{padding:0;text-align:left}.layui-m-layer2 .layui-m-layercont{text-align:center;padding:0;line-height:0}.layui-m-layer2 .layui-m-layercont i{width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-m-layerbtn,.layui-m-layerbtn span{position:relative;text-align:center;border-radius:0 0 5px 5px}.layui-m-layer2 .layui-m-layercont p{margin-top:20px}@-webkit-keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}@keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s}.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay:-.16s;animation-delay:-.16s}.layui-m-layer2 .layui-m-layercont>div{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui"/>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache, must-revalidate">
<meta http-equiv="Cache-control" content="no-cache, must-revalidate">
<meta http-equiv="Cache" content="no-cache, must-revalidate">
<title>手机扫码上传</title>
<style>
* {
margin: 0;
padding: 0;
}
.main {
padding: 0 16px;
}
h3 {
font-size: 18px;
color: #333;
text-align: center;
line-height: 60px;
}
.uploadBox {
width: 80px;
height: 80px;
position: relative;
margin: 10px 5px;
}
.imgBox {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
overflow: hidden;
}
.picList {
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
}
.uploadBox img {
width: 100%;
}
.uploadBox #choiceBtn {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
opacity: 0;
top: 0;
left: 0;
}
#uploadBtn {
width: 80%;
height: 40px;
line-height: 40px;
color: #fff;
margin: 20px auto 0;
text-align: center;
background: rgba(239, 89, 132, 1);
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
border-radius: 22px;
}
.main .tips {
margin-top: 20px;
line-height: 20px;
color: #666666;
font-size: 14px;
}
.close {
display: none;
width: 16px !important;
height: 16px !important;
position: absolute;
z-index: 10;
right: -8px;
top: -8px;
}
</style>
</head>
<body>
<div class="main">
<h3>选择图片</h3>
<div class="picList">
<div class="uploadBox" id="add">
<img src='lib/upload_close.png' alt="" class="close" onclick="deleteChoiceImg(0)">
<div class="imgBox">
<img src='lib/upload.png' alt="" class="preview">
</div>
<input type="file" multiple onchange="choiceImg()" id="choiceBtn">
</div>
</div>
<div id="uploadBtn" onclick="uploadImg()">点击上传</div>
<p class="tips">支持图片格式为:jpg、jpeg、png;<br/>上传图片完成后,请在PC端点击加载手机图片 <br/>当前最多上传1张图片
</p>
</div>
</body>
<script src='lib/jquery1.11.3.min.js'></script>
<script src='lib/layer/layer.js'></script>
<script>
let picList = []
let loading = false
const maxLength = getUrlParams('length') || 1
const envName = getUrlParams('env') || 'dev'
function getUrlParams(name) {
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
let r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
function deleteChoiceImg(i) {
$("#add_" + i).remove()
picList.forEach((item, index) => {
if (item.indexF == i) {
picList.splice(index, 1)
}
})
if (picList.length < maxLength) {
if ($("#add").length == 0) {
let div2 = "<div class='uploadBox' id='add'>" +
"<img src='lib/upload_close.png' alt='' class='close'>" +
"<div class='imgBox'>" +
"<img src='lib/upload.png' alt='' class='preview'>" +
"</div>" +
"<input type='file' multiple onchange=\"choiceImg()\" id='choiceBtn'>" +
"</div>"
$(".picList").append(div2)
} else {
$("#add").css("display", 'block')
}
}
if (picList.length >= maxLength) {
$("#add").css("display", 'none')
}
}
function choiceImg() {
if (picList.length >= maxLength) {
layer.open({
type: 0,
skin: "msg",
content: "最多只能上传一个文件",
time: 2
});
return false
}
var file = $("#choiceBtn")[0].files;
var newFile = Array.prototype.slice.call(file)
picList = picList.concat(newFile)
picList.forEach((item, index) => {
item['indexF'] = index
})
madeDom(picList)
}
function madeDom(data) {
$(".picList").empty()
$.each(data, function (i, t) {
var div1 = "<div class='uploadBox' id='add_" + i + "'>" +
"<img src='lib/upload_close.png' alt='' class='close' id='close_" + i + "' onclick=\"deleteChoiceImg(" + i + ")\">" +
"<div class='imgBox'>" +
"<img src='lib/upload.png' alt='' class='preview' id='preview_" + i + "'>" +
"</div>" +
"</div>"
$(".picList").append(div1)
$("#preview_" + i).attr("src", window.URL.createObjectURL(t))
$("#close_" + i).show();
})
if (data.length == 0) {
var div2 = "<div class='uploadBox' id='add'>" +
"<img src='lib/upload_close.png' alt='' class='close'>" +
"<div class='imgBox'>" +
"<img src='lib/upload.png' alt='' class='preview'>" +
"</div>" +
"<input type='file' multiple onchange=\"choiceImg()\" id='choiceBtn'>" +
"</div>"
$(".picList").append(div2)
}
if (data.length < 9) {
if ($("#add").length == 0) {
var div2 = "<div class='uploadBox' id='add'>" +
"<img src='lib/upload_close.png' alt='' class='close'>" +
"<div class='imgBox'>" +
"<img src='lib/upload.png' alt='' class='preview'>" +
"</div>" +
"<input type='file' multiple onchange=\"choiceImg()\" id='choiceBtn'>" +
"</div>"
$(".picList").append(div2)
}
}
}
function uploadImg() {
if (loading) {
layer.open({
type: 1,
skin: "msg",
content: "上传中",
time: 1
})
return
}
loading = true
if (picList.length == 0) {
layer.open({
type: 0,
skin: "msg",
content: "未添加图片,请先添加图片然后再点击上传!",
time: 2
});
return false
}
let data = new FormData();
let url = '/v1/folacin-admin/sys-pictures-info/upload-img'
if (envName == "prod") {
url = 'https://ys-service.zmnyjk.com' + url
}
picList.forEach(item => {
data.append("file", item)
})
data.append("fileId", getUrlParams(`fileId`))
console.log(url, data)
$.ajax({
url: url,
type: "post",
data: data,
cache: false,
contentType: false,
//取消帮我们格式化数据,是什么就是什么
processData: false,
headers: {
"Authorization": getUrlParams("token"),
"ch-ua-platform": "app"
},
success: function (data) {
if (data.code == 'SUCCESS') {
layer.open({
type: 1,
time: 2,
skin: "msg",
content: "图片上传成功"
});
} else {
layer.open({
type: 1,
time: 2,
skin: "msg",
content: data.msg
});
}
loading = false
},
error: function () {
layer.open({
type: 1,
time: 2,
skin: "msg",
content: "图片上传失败,请稍后重试!"
});
loading = false
}
})
}
</script>
</html>
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
}, },
/*查询入库单详情*/ /*查询入库单详情*/
fetchReceiveDetails(params) { fetchReceiveDetails(params) {
return fetch(`/v1/folacin-admin/folacin-send-record/receive-details/${params.id}`,params); return fetch(`/v1/folacin-admin/folacin-send-record/receive-details/${params.id}`, params);
}, },
/*确认入库*/ /*确认入库*/
fetchReceiveConfirm(params) { fetchReceiveConfirm(params) {
...@@ -209,13 +209,13 @@ export default { ...@@ -209,13 +209,13 @@ export default {
return fetch(`/v1/folacin-admin/folacin-resident-info/upload-consent/${params.id}/${params.consentId}`, {}, 'post') return fetch(`/v1/folacin-admin/folacin-resident-info/upload-consent/${params.id}/${params.consentId}`, {}, 'post')
}, },
fetchFolviteDelete(id) {//删除记录 fetchFolviteDelete(id) {//删除记录
return fetch(`/v1/folacin-admin/folacin-resident-info/${id}`,{},"delete") return fetch(`/v1/folacin-admin/folacin-resident-info/${id}`, {}, "delete")
}, },
fetchLastRecord(idCard) {//查询最近一次发放记录 fetchLastRecord(idCard) {//查询最近一次发放记录
return fetch(`/v1/folacin-admin/folacin-resident-info/resident/${idCard}`) return fetch(`/v1/folacin-admin/folacin-resident-info/resident/${idCard}`)
}, },
fetchResidentByCard(params) {//查询最近一次发放记录 fetchResidentByCard(params) {//查询最近一次发放记录
return fetch(`/v1/folacin-admin/folacin-resident-info/resident-by-card`,params) return fetch(`/v1/folacin-admin/folacin-resident-info/resident-by-card`, params)
}, },
}, },
//物资调拨管理 //物资调拨管理
...@@ -283,6 +283,11 @@ export default { ...@@ -283,6 +283,11 @@ export default {
downInstance.get(`/v1/folacin-admin/folacin-stock-record/download`, {params}); downInstance.get(`/v1/folacin-admin/folacin-stock-record/download`, {params});
} }
}, },
picturesInfo: {
queryFileId(params) {//下载库存信息
return fetch(`/v1/folacin-admin/sys-pictures-info/query-fileId`, params);
}
},
//常用工具 //常用工具
utils: { utils: {
//直接下载文件,不让浏览器直接打开 //直接下载文件,不让浏览器直接打开
......
...@@ -15,6 +15,7 @@ import Print from 'vue-print-nb' ...@@ -15,6 +15,7 @@ import Print from 'vue-print-nb'
import './antd/register' import './antd/register'
import api from './api'; import api from './api';
// import {optionalChaining} from "./views/utils/common"; // import {optionalChaining} from "./views/utils/common";
import Moment from 'moment'; import Moment from 'moment';
import './views/utils/directives/debounce' import './views/utils/directives/debounce'
...@@ -24,6 +25,7 @@ import './views/utils/directives/price' ...@@ -24,6 +25,7 @@ import './views/utils/directives/price'
import './views/utils/directives/remarkNum' import './views/utils/directives/remarkNum'
import './views/utils/directives/inputNum' import './views/utils/directives/inputNum'
import {message, modal} from 'ant-design-vue' import {message, modal} from 'ant-design-vue'
import {ApiUtils} from "./utils/ApiUtils" import {ApiUtils} from "./utils/ApiUtils"
const {confirm} = modal const {confirm} = modal
Vue.prototype.ApiUtils = ApiUtils; Vue.prototype.ApiUtils = ApiUtils;
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
}, },
created() { created() {
//获取妇幼权限和登录基本信息 //获取妇幼权限和登录基本信息
let cookieToken = "44c1ef4e-de9e-4d32-9af4-3c0196e1ec83"; let cookieToken = "d01df82b-efa3-47c9-9b41-6ceb730a16d2";
if (process.env.NODE_ENV != "dev") { if (process.env.NODE_ENV != "dev") {
cookieToken = getCookie('bGNnd3lwdF9hdA'); cookieToken = getCookie('bGNnd3lwdF9hdA');
} }
......
...@@ -78,37 +78,6 @@ ...@@ -78,37 +78,6 @@
</a-button> </a-button>
</template> </template>
</a-table> </a-table>
<a-modal title="上传知情同意书" :visible="visible" @cancel="onCancel" @ok="onsubmit"
:maskClosable="false"
width="600px">
<span>上传知情同意书:</span>
<a-upload
style="display: inline"
name="file"
list-type="picture-card"
accept=".jpg,.png"
:multiple="true"
:action="uploadAction"
:headers="headers"
@reject="handleReject"
@preview="preview"
@change="handleChange"
:file-list="fileList"
>
<div>
<!--<a-icon type="plus"/>-->
<div class="ant-upload-text">
上传本地文件
</div>
</div>
</a-upload>
<div>
<br/>
温馨提示:请上传JPG、PNG格式图片,图片大小不超过5M
<br/>
</div>
</a-modal>
<!--:getContainer="getContainer"--> <!--:getContainer="getContainer"-->
<a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" cancelText="关闭" <a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" cancelText="关闭"
:footer="null" :footer="null"
...@@ -163,15 +132,15 @@ ...@@ -163,15 +132,15 @@
<center @click="qrCodePrint" style="cursor: pointer"> <center @click="qrCodePrint" style="cursor: pointer">
<a-button>打印</a-button> <a-button>打印</a-button>
</center> </center>
</a-modal> </a-modal>
<upload-consent ref="uploadConsent" @change="getDataList"></upload-consent>
</div> </div>
</template> </template>
<script> <script>
import QRCode from 'qrcode' import QRCode from 'qrcode'
import {GetUserInfoByCardDevice, isEmptyParams} from "../../utils/common"; import {GetUserInfoByCardDevice, isEmptyParams} from "../../utils/common";
import dateRangePicker from "../../components/dateRangePicker.vue"; import dateRangePicker from "../../components/dateRangePicker.vue";
import uploadConsent from "./uploadConsent.vue";
const columns = [ const columns = [
{ {
title: '发放日期', title: '发放日期',
...@@ -237,7 +206,7 @@ const columns = [ ...@@ -237,7 +206,7 @@ const columns = [
}, },
] ]
export default { export default {
components: {dateRangePicker}, components: {dateRangePicker,uploadConsent},
data() { data() {
return { return {
// 搜索框对象 // 搜索框对象
...@@ -265,7 +234,6 @@ export default { ...@@ -265,7 +234,6 @@ export default {
headers: { headers: {
Authorization: sessionStorage.getItem("token") Authorization: sessionStorage.getItem("token")
}, },
uploadAction: process.env.VUE_APP_BASE_URL + process.env.VUE_APP_SERVICE_API + "/v1/folacin-admin/sys-pictures-info/upload-img",
fileList: [], fileList: [],
formData: { formData: {
consentId: "", consentId: "",
...@@ -277,7 +245,7 @@ export default { ...@@ -277,7 +245,7 @@ export default {
qrCodeUrl: "", qrCodeUrl: "",
unitInfo: {unitName: ""}, unitInfo: {unitName: ""},
printDisplay: 'none', printDisplay: 'none',
showQrCode: process.env.VUE_APP_SHOW_QR_CODE == 'true' showQrCode: process.env.VUE_APP_SHOW_QR_CODE == 'true',
} }
}, },
created() { created() {
...@@ -386,11 +354,13 @@ export default { ...@@ -386,11 +354,13 @@ export default {
}, },
uploadConsentInfo(row) { uploadConsentInfo(row) {
this.formData.id = row.id; this.formData.id = row.id;
this.$refs.uploadConsent.open(row.id);
this.visible = true; this.visible = true;
}, },
showConsentInfo(row) { showConsentInfo(row) {
this.currentRow = row; this.currentRow = row;
this.showVisible = true; this.showVisible = true;
this.consentUrl=null
let par = { let par = {
menuId: this.menuId, menuId: this.menuId,
residentId: row.id residentId: row.id
......
<template>
<div>
<a-modal title="上传知情同意书" :visible="visible" @cancel="onCancel" @ok="onsubmit"
:maskClosable="false"
width="600px">
<div>
<a-radio-group :options=" ['本地上传', '手机上传']" v-model:value="fileUploadType"/>
</div>
<br>
<div v-if="fileUploadType=='本地上传'">
<a-upload
style="display: inline"
name="file"
list-type="picture-card"
accept=".jpg,.png"
:multiple="true"
:action="uploadAction"
:headers="headers"
@reject="handleReject"
@preview="preview"
@change="handleChange"
:file-list="fileList"
>
<div>
<div class="ant-upload-text">
上传本地文件
</div>
</div>
</a-upload>
<br/>
温馨提示:请上传JPG、PNG格式图片,图片大小不超过10M
<br/>
</div>
<div v-if="fileUploadType=='手机上传'">
<a-button class="ant-table-btn" @click="loadMobileFile">
<a-icon type="appstore"/>
加载手机图片
</a-button>
<p style="color: gray;font-size: 13px;line-height: 40px">
温馨提示:请上传JPG、PNG格式图片,图片大小不超过10M,可通过手机扫码上传
</p>
<div>
<img width="100" height="100" :src="qrCodeUrl" @click="preview2(qrCodeUrl)">
<img width="100" v-if="consentMobileUrl" height="100" :src="consentMobileUrl"
@click="preview2(consentMobileUrl)">
</div>
</div>
</a-modal>
<a-modal :visible="visible1" @ok="onsubmit1" :closable="true" @cancel="onCancel1"
:maskClosable="true"
width="600px">
<img width="100%" height="100%" :src="showUrl">
<template slot="footer">
<a-button type="primary" @click="visible1=false">关闭</a-button>
</template>
</a-modal>
</div>
</template>
<script>
import QRCode from "qrcode";
export default {
components: {},
data() {
return {
visible: false,
visible1: false,
qrCodeUrl: "",
fileId: undefined,
consentUrl: "",
consentMobileUrl: "",
showUrl: undefined,
headers: {
Authorization: sessionStorage.getItem("token")
},
uploadAction: process.env.VUE_APP_BASE_URL + process.env.VUE_APP_SERVICE_API + "/v1/folacin-admin/sys-pictures-info/upload-img",
fileList: [],
formData: {
consentId: "",
id: ""
},
currentRow: {},
menuId: undefined,
qrCodeShow: false,
printDisplay: 'none',
fileUploadType: '本地上传',
}
},
created() {
this.routerParams = this.$route.query;
if (this.routerParams.menuId) {
window.sessionStorage.setItem('menuId', this.routerParams.menuId);
this.menuId = this.routerParams.menuId;
}
},
methods: {
open(id) {
this.formData.id = id;
this.fileId = this.generateUUID();
this.shareQRCode()
this.visible = true;
},
handleChange(info) {
let fileList = [...info.fileList];
fileList = fileList.slice(-1);
let isFail = false;
fileList = fileList.map(file => {
if (file.response) {
if (file.response.code != 'SUCCESS') {
isFail = true;
return;
}
this.consentUrl = file.response.data.trueDownloadUrl;
this.formData.consentId = file.response.data.id;
}
return file;
});
if (isFail) {
this.formData.consentId = "";
this.$message.warning("文件上传失败");
return;
}
if (fileList.length == 0) {
this.formData.consentId = "";
}
this.fileList = fileList;
},
handleReject(info) {
this.$message.warning('请上传JPG、PNG格式图片');
return false;
},
preview(val) {
this.preview2(val.response.data.trueDownloadUrl)
},
preview2(val) {
this.visible1 = true
this.showUrl = val
},
onCancel() {
this.visible = false;
this.fileList = [];
this.formData.consentId = null;
this.consentMobileUrl = null
},
onsubmit() {
if (this.currentRow.source == 1) {
this.visible = false;
return;
}
if (this.$api.utils.isBlank(this.formData.consentId)) {
this.$message.warning('请上传文件');
return;
}
let par = {
...this.formData,
menuId: this.menuId
}
this.$api.folviteDistributionManage.fetchFolviteUploadConsent(par).then(res => {
if (res.code === 'SUCCESS') {
this.fileList = [];
this.formData.consentId = "";
this.consentMobileUrl = null
this.visible = false;
this.$emit("change");
}
})
},
onsubmit1() {
this.visible1 = false
},
onCancel1(){
this.visible1 = false
},
loadMobileFile() {
this.$api.picturesInfo.queryFileId({fileId: this.fileId}).then(res => {
if (res.code === 'SUCCESS') {
this.fileList = [];
if (res.data.length > 0) {
this.consentMobileUrl = res.data[0].trueDownloadUrl
this.formData.consentId = res.data[0].id;
} else {
this.$message.warning('未加载到文件');
}
}
})
},
shareQRCode() {
this.qrCodeShow = true;
//不是一个链接APP不给回调,就用一下公司域名吧
let host = process.env.VUE_APP_LOCATION;
host = host.replaceAll("#/", "");
let url = host + "uploadImg.html?token=" + window.sessionStorage.getItem('token') + "&fileId=" + this.fileId + "&env=" + process.env.NODE_ENV;
let deUrl = encodeURI(url);
console.log(deUrl);
QRCode.toDataURL(deUrl, {width: 500, height: 400, margin: 2})
.then(qrCodeUrl => {
this.qrCodeUrl = qrCodeUrl;
}).catch(err => {
console.error(err);
});
},
generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
},
mounted() {
}
}
</script>
<style scoped lang="less">
</style>
\ No newline at end of file
...@@ -18,48 +18,25 @@ module.exports = { ...@@ -18,48 +18,25 @@ module.exports = {
indexPath: "index.html", indexPath: "index.html",
publicPath: '/', // 设置打包文件相对路径 publicPath: '/', // 设置打包文件相对路径
outputDir: 'folacin-pc-dist', outputDir: 'folacin-pc-dist',
/* configureWebpack: {
//关闭 webpack 的性能提示
performance: {
hints: false
},
output: { // 输出重构 打包编译后的 文件名称 【版本号】
filename: `js/[name].${Version}.js`,
chunkFilename: `js/[name].${Version}.js`,
}
},*/
// productionSourceMap: isRrod ? false : true,
productionSourceMap: false, productionSourceMap: false,
// devServer: {
// port: 8089,
// open: true,
// proxy: { //配置跨域
// '/api': {
// target: 'http://123.56.183.13:8889', //真实的后台接口
// changOrigin: true, //允许跨域
// pathRewrite: {
// /* 重写路径,当我们在浏览器中看到请求的地址为:http://localhost:8080/api/core/getData/userInfo 时
// 实际上访问的地址是:http://121.121.67.254:8185/core/getData/userInfo,因为重写了 /api
// */
// '^/api': ''
// }
// },
// '/checkApi': {
// target: 'https://beta-yac.yiboshi.com', //真实的后台接口
// changOrigin: true, //允许跨域
// pathRewrite: {
// '^/checkApi': ''
// }
// },
// }
// },
devServer: { devServer: {
allowedHosts: ['all'],
port: 8089,
open: true, open: true,
https:false,
overlay: { overlay: {
warning: false, warning: false,
errors: false errors: false
}, },
https:false, proxy: { //配置跨域
'/v1/folacin-admin': {
target: 'http://192.168.1.174:8083',
changOrigin: true, //允许跨域
pathRewrite: {
'^/v1/folacin-admin': '/v1/folacin-admin'
}
},
}
}, },
chainWebpack: (config) => { chainWebpack: (config) => {
config.plugins.delete('preload') config.plugins.delete('preload')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment