Commit ee60e74d authored by gengchunlei's avatar gengchunlei

一期

parent c70a20de
This diff is collapsed.
...@@ -10,8 +10,11 @@ ...@@ -10,8 +10,11 @@
"dependencies": { "dependencies": {
"axios": "^0.20.0", "axios": "^0.20.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"less": "^3.12.2",
"less-loader": "^7.0.2",
"mint-ui": "^2.2.13", "mint-ui": "^2.2.13",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-qrcode-reader": "^2.3.14",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0" "vuex": "^3.4.0"
}, },
......
...@@ -5,7 +5,11 @@ import store from './store' ...@@ -5,7 +5,11 @@ import store from './store'
import MintUI from 'mint-ui' import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css' import 'mint-ui/lib/style.css'
import './assets/elGlobal.css' import './assets/elGlobal.css'
import Router from 'vue-router'
import { InfiniteScroll } from 'mint-ui';
Vue.use(InfiniteScroll);
Vue.use(Router)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(MintUI) Vue.use(MintUI)
......
...@@ -7,6 +7,8 @@ import ReturnVisit from '../views/returnVisit' ...@@ -7,6 +7,8 @@ import ReturnVisit from '../views/returnVisit'
import ChoiceContraceptives from '../views/choiceContraceptives' import ChoiceContraceptives from '../views/choiceContraceptives'
import SiteDetails from '../views/siteDetails' import SiteDetails from '../views/siteDetails'
import ReceiveSuccess from '../views/receiveSuccess' import ReceiveSuccess from '../views/receiveSuccess'
import qrcodeReader from "../views/scanComponent/qrcodeReader"
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [
...@@ -17,10 +19,12 @@ const routes = [ ...@@ -17,10 +19,12 @@ const routes = [
{path: '/choiceContraceptives', name: 'choiceContraceptives', component: ChoiceContraceptives}, {path: '/choiceContraceptives', name: 'choiceContraceptives', component: ChoiceContraceptives},
{path: '/siteDetails', name: 'siteDetails', component: SiteDetails}, {path: '/siteDetails', name: 'siteDetails', component: SiteDetails},
{path: '/receiveSuccess', name: 'receiveSuccess', component: ReceiveSuccess}, {path: '/receiveSuccess', name: 'receiveSuccess', component: ReceiveSuccess},
{path:'/qrcodeReader', name: 'qrcodeReader', component: qrcodeReader},
] ]
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'hash',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}) })
......
import axios from 'axios'; import axios from 'axios';
var apiInstance=axios.create({ var apiInstance=axios.create({
baseURL:process.env.VUE_APP_PATH, baseURL:'',
timeout:10000, timeout:10000,
withCredentials:true withCredentials:true
}) })
...@@ -19,7 +19,32 @@ apiInstance.interceptors.request.use(config=>{ ...@@ -19,7 +19,32 @@ apiInstance.interceptors.request.use(config=>{
// 请求错误后把我们的error返回回去 // 请求错误后把我们的error返回回去
return Promise.reject(error); return Promise.reject(error);
}) })
/*获取列表*/ /*获取网点*/
export const getNetworkInfo = params =>{ export const getNetworkInfo = params =>{
return apiInstance.get(`/basic-info/v1/basic-info/basic-network-info/get-network-info`,{params}); return apiInstance.get(`/api/basic-info/v1/basic-info/basic-network-info/get-network-info`,{params});
}; };
\ No newline at end of file
//获取用领取记录
export const getUserCollectRecord = params => {
return apiInstance.get(`/api/stock-info/v1/stock-info/stock-provide-record`, {params})
}
//获取库存信息
export const getStockInfo = params => {
return apiInstance.get(`/api/stock-info/v1/stock-info/stock-basic-info/basic-info`, {params})
}
//用户领取次数
export const getUserReceiveNum = params => {
return apiInstance.get(`/api/stock-info/v1/stock-info/stock-provide-record/number/${params.residentId}`, {params})
}
//填写随访记录
export const addVisitRecord = params => {
return apiInstance.post(`/api/stock-info/v1/stock-info/stock-visit-info`, params)
}
//确认领取药具
export const getMedical = params => {
return apiInstance.post(`/api/stock-info/v1/stock-info/stock-provide-record`, params)
}
// 判断
export function isIOSWebKit() {
const aa = window.navigator.userAgent;
if (aa.indexOf('client-iOS') !== -1){// ios端
return true;
}else if(aa.indexOf('Android') !== -1 || aa.indexOf('Adr') !== -1){// 安卓端
return false;
}
}
//当前方法传参数两种 字符串或者map
export function callMobile(handlerInterface,parameters){
let classStr = Object.prototype.toString.call(parameters);
if(classStr === '[object String]' || classStr === '[object Object]'){
let param = parameters;
if(classStr === "[object Object]"){ //判断传参是str ,还是object
//handlerInterface由iOS addScriptMessageHandler与andorid addJavascriptInterface 代码注入而来。
param = JSON.stringify(parameters);//参数必须转化成json格式
}
try {
if (isIOSWebKit()){//ios
if(window.webkit!==undefined){
window.webkit.messageHandlers[handlerInterface].postMessage(param);
}
}else if(isIOSWebKit() === false){
//安卓传输不了js json对象,只能传输string
window.ecloud[handlerInterface](param);
}
}catch (e) {
}
}
}
...@@ -5,42 +5,38 @@ ...@@ -5,42 +5,38 @@
<mt-button icon="back"></mt-button> <mt-button icon="back"></mt-button>
</router-link> </router-link>
</mt-header> </mt-header>
<div class="content-list" v-if="dataList && dataList.length>0"> <div class="content-list" v-if="!noDataShow">
<div class="content-item ui-flex justify-center center"> <div
<div class="cell"> class="list-data"
<img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1926305167,3823812322&fm=26&gp=0.jpg"/> v-infinite-scroll="loadMore"
</div> :infinite-scroll-disabled="loading"
<div class="tradeInfo"> infinite-scroll-distance="10"
<div class="tradeName">天然乳胶避孕套超薄装天然乳胶避孕套超薄装</div> >
<div style="margin-top: 5px"><label style="float: left;margin-bottom: 0">数量:86</label><label style="float: right;margin-right: 15px;margin-bottom: 0">规格:10只/盒</label><div style="clear: both"></div></div> <div class="content-item ui-flex justify-center center"
<div>有效期至:2023-11-22</div> v-for="item in detailInfo"
<div>生产厂家:程程药业有限公司</div> :key="item.id"
</div> >
<div class="check-btn"> <div class="check-btn">
<input type="radio" id="1" value="1" > <input type="radio" id="1" :value="JSON.stringify(item)" v-model="checkedMedical">
</div> </div>
<div style="clear: both"></div>
</div>
<div class="content-item ui-flex justify-center center">
<div class="cell"> <div class="cell">
<img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1926305167,3823812322&fm=26&gp=0.jpg"/> <img :src="item.imgUrl"/>
</div> </div>
<div class="tradeInfo"> <div class="tradeInfo">
<div class="tradeName">天然乳胶避孕套超薄装天然乳胶避孕套超薄装</div> <div class="tradeName">{{item.medicineName}}</div>
<div style="margin-top: 5px"><label style="float: left;margin-bottom: 0">数量:86</label><label style="float: right;margin-right: 15px;margin-bottom: 0">规格:10只/盒</label><div style="clear: both"></div></div> <div style="margin-top: 5px"><label style="float: left;margin-bottom: 0">数量:{{item.stockNum}}</label><label style="float: right;margin-right: 15px;margin-bottom: 0">规格:{{item.specs}}</label><div style="clear: both"></div></div>
<div>有效期至:2023-11-22</div> <div>有效期至:{{item.expireDate}}</div>
<div>生产厂家:程程药业有限公司</div> <div>生产厂家:{{item.factoryName}}</div>
</div>
<div class="check-btn">
<input type="radio" id="2" value="2" >
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div> </div>
</div>
</div> </div>
<div class="sub-badReaction" v-if="dataList && dataList.length>0"> <div class="sub-badReaction" v-if="!noDataShow">
<mt-button type="primary" @click="receiveContraceptives">确认领取</mt-button> <mt-button type="primary" @click="receiveContraceptives">确认领取</mt-button>
</div> </div>
<div v-if="dataList && dataList.length===0"> <div v-if="noDataShow">
<div class="success-img"> <div class="success-img">
<img src="../assets/img/noHave.png"/> <img src="../assets/img/noHave.png"/>
<div class="tips"> <div class="tips">
...@@ -57,20 +53,72 @@ ...@@ -57,20 +53,72 @@
</template> </template>
<script> <script>
import {getMedical, getStockInfo} from "../utils/api";
export default { export default {
name: "choiceContraceptives", name: "choiceContraceptives",
data(){ data(){
return{ return{
dataList:[] loading: false,
checkedMedical:'',
detailInfo: [],
loadText:'加载中...',
noDataShow: false,
param: {
pageIndex: 0,
pageSize: 10
}
} }
}, },
methods:{ methods:{
getStockListInfo(callBack) {
let par = {
relationId: 4,
...this.param
}
getStockInfo(par).then(({data = {}}) => {
const {dataList = []} = data.data
this.detailInfo = this.detailInfo.concat(dataList)
if (this.detailInfo.length == 0) {
this.noDataShow = true
} else {
this.noDataShow = false
}
if (data.data && data.data.length < this.param.pageSize) {
this.loadText = '暂无更多数据'
} else {
this.loading = false
}
callBack && callBack()
}).finally(() => {
this.loading = false
})
},
loadMore() {
this.loading = true
this.param.pageIndex += 1
this.getStockListInfo()
},
backHome(){ backHome(){
this.$router.push("/"); this.$router.push("/");
}, },
receiveContraceptives(){ receiveContraceptives(){
this.$router.push("/receiveSuccess"); let pars = JSON.parse(this.checkedMedical)
let par = {
residentId: 1,
networkId: 4,
...pars
}
getMedical(par).then(({data}) => {
if (data.code == 'SUCCESS') {
this.$router.push("/receiveSuccess");
}
})
} }
},
beforeDestroy() {
this.detailInfo = []
} }
} }
</script> </script>
...@@ -217,4 +265,9 @@ ...@@ -217,4 +265,9 @@
border-radius: 50%; border-radius: 50%;
z-index: 1; z-index: 1;
} }
</style> .list-data{
\ No newline at end of file /*height: calc(100% - 40px);*/
max-height: calc(100vh - 40px);
overflow-y: auto;
}
</style>
...@@ -5,62 +5,100 @@ ...@@ -5,62 +5,100 @@
<mt-button icon="back"></mt-button> <mt-button icon="back"></mt-button>
</router-link> </router-link>
</mt-header> </mt-header>
<div class="content">
<div class="title">天然乳胶避孕套超薄装</div> <div>
<div class="details"> <div
<div class="item"> class="list-data"
<label class="item-left">规格:</label> v-infinite-scroll="loadMore"
<label class="item-right">10支/盒</label> :infinite-scroll-disabled="loading"
</div> infinite-scroll-distance="10"
<div class="item">
<label class="item-left">领取数量:</label> >
<label class="item-right">1盒</label> <div class="content" v-for="item in detailInfo" :key="item.id">
</div> <div class="title">{{item.medicalName}}</div>
<div class="item"> <div class="details">
<label class="item-left">领取时间:</label> <div class="item">
<label class="item-right">2022-07-22 12:33:12</label> <label class="item-left">规格:</label>
</div> <label class="item-right">{{item.productSpecs || '--'}}</label>
<div class="item"> </div>
<label class="item-left">领取站点:</label> <div class="item">
<label class="item-right">五华区人民路自助发放机</label> <label class="item-left">领取数量:</label>
</div> <label class="item-right">{{item.number || '--'}}</label>
<div class="item"> </div>
<label class="item-left">站点类型:</label> <div class="item">
<label class="item-right">自助发放机</label> <label class="item-left">领取时间:</label>
<label class="item-right">{{item.createDate || '--'}}</label>
</div>
<div class="item">
<label class="item-left">领取站点:</label>
<label class="item-right">{{item.netName || '--'}}</label>
</div>
<div class="item">
<label class="item-left">站点类型:</label>
<label class="item-right">{{item.netTypeName || '--'}}</label>
</div>
</div>
</div> </div>
</div> </div>
</div> <div class="loading" v-if="loading">
<div class="content"> <span id="load-text">{{loadText}}</span>
<div class="title">天然乳胶避孕套超薄装</div> </div>
<div class="details"> <div v-if="noDataShow">
<div class="item"> <NoData></NoData>
<label class="item-left">规格:</label>
<label class="item-right">10支/盒</label>
</div>
<div class="item">
<label class="item-left">领取数量:</label>
<label class="item-right">1盒</label>
</div>
<div class="item">
<label class="item-left">领取时间:</label>
<label class="item-right">2022-07-22 12:33:12</label>
</div>
<div class="item">
<label class="item-left">领取站点:</label>
<label class="item-right">五华区人民路自助发放机</label>
</div>
<div class="item">
<label class="item-left">站点类型:</label>
<label class="item-right">自助发放机</label>
</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import {getUserCollectRecord} from '../utils/api';
import NoData from "./component/noData";
export default { export default {
name: "collectRecords" name: "collectRecords",
components: {NoData},
data() {
return {
loading: false,
detailInfo: [],
loadText:'加载中...',
noDataShow: false,
param: {
pageIndex: 0,
pageSize: 10
}
}
},
methods: {
getRecordInfo(callBack) {
getUserCollectRecord(this.param).then(({data = {}}) => {
const {dataList = []} = data.data
this.detailInfo = this.detailInfo.concat(dataList)
if (this.detailInfo.length == 0) {
this.noDataShow = true
} else {
this.noDataShow = false
}
if (data.data && data.data.length < this.param.pageSize) {
this.loadText = '暂无更多数据'
} else {
this.loading = false
}
callBack && callBack()
}).finally(() => {
this.loading = false
})
},
loadMore() {
this.loading = true
this.param.pageIndex += 1
this.getRecordInfo()
}
},
beforeDestroy() {
this.detailInfo = []
}
} }
</script> </script>
...@@ -73,15 +111,27 @@ ...@@ -73,15 +111,27 @@
border-radius: 1rem; border-radius: 1rem;
box-shadow: darkgrey 0px 2px 20px -10px; box-shadow: darkgrey 0px 2px 20px -10px;
} }
.content .title { .content .title {
font-weight: bold; font-weight: bold;
line-height: 30px; line-height: 30px;
border-bottom: 1px solid #F3F3F3; border-bottom: 1px solid #F3F3F3;
} }
.content .details .item{
.content .details .item {
line-height: 24px; line-height: 24px;
} }
.content .details .item .item-right{
.content .details .item .item-right {
float: right; float: right;
} }
</style> .list-data{
\ No newline at end of file /*height: calc(100% - 40px);*/
max-height: calc(100vh - 40px);
overflow-y: auto;
}
.loading{
width: 100%;
text-align: center;
}
</style>
<template>
<div>
<div class="success-img">
<img src="./../../assets/img/noHave.png"/>
<div class="tips">
暂无数据...
</div>
</div>
<div class="backHome">
<mt-button type="primary" @click="backHome">返回首页</mt-button>
</div>
</div>
</template>
<script>
export default {
name: "noData",
methods: {
backHome(){
this.$router.push("/");
},
}
}
</script>
<style scoped>
.tips{
color: #747971;
font-size: 14px;
padding: 10px 30px 20px;
margin: 0 auto;
}
.success-img{
text-align: center;
padding-top: 100px;
}
.backHome {
position: fixed;
z-index: 2;
left: calc(50% - 155px);
}
.backHome .mint-button {
width: 311px;
height: 44px;
background: linear-gradient(242deg, #dff9b9 -27%, #1bd09f 85%);
border-radius: 22px;
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
}
</style>
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
import presonImg from '../assets/img/preson.png'; import presonImg from '../assets/img/preson.png';
import sharpImg from '../assets/img/sharp.png'; import sharpImg from '../assets/img/sharp.png';
import { MessageBox } from 'mint-ui'; import { MessageBox } from 'mint-ui';
import {getNetworkInfo} from '../utils/api'; import {getNetworkInfo, getUserReceiveNum} from '../utils/api';
import {callMobile} from "../utils/common";
import { Toast } from 'mint-ui';
export default { export default {
name: "myMap", name: "myMap",
data() { data() {
...@@ -51,18 +53,36 @@ ...@@ -51,18 +53,36 @@
machines: [] machines: []
} }
}, },
created() {
},
methods: { methods: {
ScanCode() { ScanCode() {
/*先判断是否有没有回访的领取记录*/ let pars = {
let isReturn=false; 'callback': 'qrcodeContent',
if(isReturn){
this.$router.push('/returnVisit');
}else{
this.$router.push('/choiceContraceptives');
/*打开摄像头扫码*/
/*扫描成功拿到发货机id跳转到选择药具页面*/
/*扫描失败弹出提示信息*/
} }
// window.android.qrcode()
callMobile("qrcode", pars);
/*先判断是否有没有回访的领取记录*/
let par = {residentId: 1}
getUserReceiveNum(par).then(({data}) => {
if (data.data < 0) {
this.$router.push('/returnVisit');
} else {
this.$router.push('/choiceContraceptives');
// this.$router.push('/returnVisit');
/*打开摄像头扫码*/
/*扫描成功拿到发货机id跳转到选择药具页面*/
/*扫描失败弹出提示信息*/
}
})
},
subscanQRCallBack(result){
alert('扫码结果:'+result);
Toast({
message: '测试'+result,
position: 'bottom',
duration: 5000
});
}, },
toCollectRecords() { toCollectRecords() {
this.$router.push('/collectRecords'); this.$router.push('/collectRecords');
...@@ -154,7 +174,7 @@ ...@@ -154,7 +174,7 @@
infoButton.className = "text-button"; infoButton.className = "text-button";
infoButton.value = "详情" infoButton.value = "详情"
infoButton.onclick = function () { infoButton.onclick = function () {
_that.jumpInfo(info.id) _that.jumpInfo(info)
}; };
let navigationButton = document.createElement("input"); let navigationButton = document.createElement("input");
navigationButton.type = "button"; navigationButton.type = "button";
...@@ -214,14 +234,17 @@ ...@@ -214,14 +234,17 @@
} }
/*this.$router.push({path: '/navigation', query: {Lng: Lng, Lat: Lat}})*/ /*this.$router.push({path: '/navigation', query: {Lng: Lng, Lat: Lat}})*/
}, },
jumpInfo(id) { jumpInfo(info) {
let Lng=this.lngLat[0]; this.$router.push({path: `/siteDetails`,query:{info:JSON.stringify(info)}});
let Lat=this.lngLat[1];
this.$router.push({path: `/siteDetails`,query:{id:id,Lng: Lng, Lat: Lat}});
}, },
}, },
mounted() { mounted() {
this.createMap(); this.createMap();
// 将subscanQRCallBack方法绑定到window下面,提供给外部调用
document.addEventListener("qrcodeContent",this.subscanQRCallBack);
},
beforeDestroy() {
document.removeEventListener("qrcodeContent",this.subscanQRCallBack);
}, },
} }
</script> </script>
...@@ -426,4 +449,4 @@ ...@@ -426,4 +449,4 @@
width: 0px !important; width: 0px !important;
height: 0px !important; height: 0px !important;
} }
</style> </style>
\ No newline at end of file
...@@ -14,27 +14,29 @@ ...@@ -14,27 +14,29 @@
title="使用是否满意" title="使用是否满意"
align="left" align="left"
v-model="formData.isAgree" v-model="formData.isAgree"
:options="options1"> :options="options1" @change="changeAgree">
</mt-radio> </mt-radio>
<div v-if="formData.isAgree==='1'"> <div v-if="formData.isAgree==='1'" style="margin-top: 8px">
<input type="text" v-model.trim="formData.disagreeReason" @blur="blurDisagreeReason" placeholder="请填写原因"/> <input type="text" style="height: 33px" v-model.trim="formData.disagreeReason" @blur="blurDisagreeReason" placeholder="请填写原因"/>
<label class="checkMsg" v-if="formData.checkDisagreeReason">请填写不满意原因</label> <label class="checkMsg" v-if="formData.checkDisagreeReason">请填写不满意原因</label>
</div> </div>
<mt-radio <mt-radio
title="有无不良反应" title="有无不良反应"
align="left" align="left"
v-model="formData.isBadReaction" v-model="formData.isBadReaction"
:options="options2"> :options="options2"
@change="changeBad"
>
</mt-radio> </mt-radio>
<div v-if="formData.isBadReaction==='1'" class="badReaction"> <div v-if="formData.isBadReaction==='1'" class="badReaction">
<div style="font-weight: bold; color: #888">请选择不良反应(多选):</div> <div style="font-weight: bold; color: #888">请选择不良反应(多选):</div>
<div v-for="item in options3" :key="item.value" style="margin-top: 10px"> <div v-for="item in options3" :key="item.value" style="margin-top: 7px">
<input type="checkbox" v-model="formData.badReaction" @change="changeBadReaction" :id="item.value" :value="item.value" class="hidden"/> <input type="checkbox" v-model="formData.badReaction" @change="changeBadReaction" :id="item.value" :value="item.value" class="hidden"/>
<span></span> <span></span>
<span class="txt">{{item.label}}</span> <span class="txt">{{item.label}}</span>
</div> </div>
<label class="checkMsg" v-if="formData.checkBadReaction">请选择不良反应</label> <label class="checkMsg" v-if="formData.checkBadReaction">请选择不良反应</label>
<div v-if="formData.badReaction.includes(5)"> <div v-if="formData.badReaction.includes(9)">
<input type="text" v-model="formData.otherBadReaction" @blur="blurOtherBadReaction" placeholder="请填写其他不良反应"/> <input type="text" v-model="formData.otherBadReaction" @blur="blurOtherBadReaction" placeholder="请填写其他不良反应"/>
<label class="checkMsg" v-if="formData.checkOtherBadReaction">请填写其他不良反应</label> <label class="checkMsg" v-if="formData.checkOtherBadReaction">请填写其他不良反应</label>
</div> </div>
...@@ -48,23 +50,28 @@ ...@@ -48,23 +50,28 @@
</template> </template>
<script> <script>
import {addVisitRecord} from "../utils/api";
import { Toast } from 'mint-ui';
export default { export default {
name: "returnVisit", name: "returnVisit",
data() { data() {
return { return {
options1: [{label: '满意', value: '0'}, {label: '不满意', value: '1'}], options1: [{label: '满意', value: '0'}, {label: '不满意', value: '1'}],
options2: [{label: '没有', value: '0'}, {label: '不满意', value: '1'}], options2: [{label: '没有', value: '0'}, {label: '', value: '1'}],
options3: [ options3: [
{label: '恶心呕吐', value: 0}, {label: '恶心呕吐', value: 1},
{label: '阴道点滴出血', value: 1}, {label: '阴道点滴出血', value: 2},
{label: '月经过少或闭经', value: 2}, {label: '月经过少或闭经', value: 3},
{label: '面部色素沉着', value: 3}, {label: '面部色素沉着', value: 4},
{label: '体重增加', value: 4}, {label: '体重增加', value: 5},
{label: '其他', value: 5}], {label: '其他', value: 9}],
formData: { formData: {
isAgree:'0', isAgree:'0',
disagreeReason: '',
isBadReaction:'0', isBadReaction:'0',
badReaction: [], badReaction: [],
otherBadReaction: '',
checkDisagreeReason:false, checkDisagreeReason:false,
checkOtherBadReaction:false, checkOtherBadReaction:false,
checkBadReaction:false checkBadReaction:false
...@@ -72,12 +79,23 @@ ...@@ -72,12 +79,23 @@
} }
}, },
methods:{ methods:{
changeAgree() {
if(this.formData.isAgree == 0) {
this.formData.disagreeReason = ''
}
},
blurDisagreeReason(){ blurDisagreeReason(){
this.formData.checkDisagreeReason=this.formData.disagreeReason===''||this.formData.disagreeReason===undefined; this.formData.checkDisagreeReason=this.formData.disagreeReason===''||this.formData.disagreeReason===undefined;
}, },
blurOtherBadReaction(){ blurOtherBadReaction(){
this.formData.checkOtherBadReaction=this.formData.otherBadReaction===''||this.formData.otherBadReaction===undefined; this.formData.checkOtherBadReaction=this.formData.otherBadReaction===''||this.formData.otherBadReaction===undefined;
}, },
changeBad() {
if (this.formData.isBadReaction == 0) {
this.formData.badReaction = []
this.formData.otherBadReaction = ''
}
},
changeBadReaction(){ changeBadReaction(){
this.formData.checkBadReaction=this.formData.badReaction.length<1|| this.formData.badReaction===undefined; this.formData.checkBadReaction=this.formData.badReaction.length<1|| this.formData.badReaction===undefined;
}, },
...@@ -94,7 +112,7 @@ ...@@ -94,7 +112,7 @@
if(this.formData.checkBadReaction){ if(this.formData.checkBadReaction){
flag=false; flag=false;
} }
if(this.formData.badReaction.includes(5)){ if(this.formData.badReaction.includes(9)){
this.blurOtherBadReaction(); this.blurOtherBadReaction();
if(this.formData.checkOtherBadReaction){ if(this.formData.checkOtherBadReaction){
flag=false; flag=false;
...@@ -103,7 +121,30 @@ ...@@ -103,7 +121,30 @@
} }
/*验证完毕*/ /*验证完毕*/
if(flag){ if(flag){
console.log(this.formData); let badInfo = this.formData.badReaction.join()
let par = {
satisfied: this.formData.isAgree,
satisfiedReason: this.formData.disagreeReason,
bad: this.formData.isBadReaction,
badReason: badInfo,
badOther: this.formData.otherBadReaction
}
addVisitRecord(par).then(({data}) => {
if (data.code == 'SUCCESS') {
Toast({
message: '填写成功!',
position: 'bottom',
duration: 2000
});
this.$router.push("/");
} else {
Toast({
message: '失败,请联系管理员!',
position: 'bottom',
duration: 2000
});
}
})
}else { }else {
return false; return false;
} }
...@@ -112,7 +153,8 @@ ...@@ -112,7 +153,8 @@
} }
</script> </script>
<style> <style lang="less">
.checkMsg{ .checkMsg{
color: red; color: red;
} }
...@@ -123,6 +165,8 @@ ...@@ -123,6 +165,8 @@
.subject { .subject {
padding: 5px 0px 5px 20px; padding: 5px 0px 5px 20px;
height: calc(100vh - 144px);
overflow: auto;
} }
.subject .mint-cell:not(:last-child) { .subject .mint-cell:not(:last-child) {
...@@ -136,11 +180,15 @@ ...@@ -136,11 +180,15 @@
padding-left: 5px; padding-left: 5px;
border-bottom: 1px solid #F0F0F0; border-bottom: 1px solid #F0F0F0;
color: #6E6166; color: #6E6166;
outline: none;
} }
.badReaction { .badReaction {
width: 100%; width: 100%;
/*
border-top: 1px solid #F0F0F0; border-top: 1px solid #F0F0F0;
*/
padding-top: 10px; padding-top: 10px;
padding-left: 5px; padding-left: 5px;
} }
...@@ -180,4 +228,4 @@ ...@@ -180,4 +228,4 @@
border-radius: 22px; border-radius: 22px;
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.1);
} }
</style> </style>
\ No newline at end of file
<!--
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-08-18 10:13:28
* @LastEditTime: 2019-08-18 15:24:32
* @LastEditors: Please set LastEditors
-->
<template>
<div>
<p class="error">{{ error }}</p>
<p class="decode-result">
Last result:
<b>{{ result }}</b>
</p>
<QrcodeStream @decode="onDecode" @init="onInit" :camera="camera"/>
</div>
</template>
<script>
import { QrcodeStream } from "vue-qrcode-reader";
export default {
components: { QrcodeStream },
data() {
return {
result: "",
camera: 'auto',
error: ""
};
},
methods: {
onDecode(result) {
this.result = result;
},
async onInit(promise) {
try {
await promise;
} catch (error) {
if (error.name === "NotAllowedError") {
this.error = "ERROR: you need to grant camera access permisson";
} else if (error.name === "NotFoundError") {
this.error = "ERROR: no camera on this device";
} else if (error.name === "NotSupportedError") {
this.error = "ERROR: secure context required (HTTPS, localhost)";
} else if (error.name === "NotReadableError") {
this.error = "ERROR: is the camera already in use?";
} else if (error.name === "OverconstrainedError") {
this.error = "ERROR: installed cameras are not suitable";
} else if (error.name === "StreamApiNotSupportedError") {
this.error = "ERROR: Stream API is not supported in this browser";
}
}
}
}
};
</script>
<style scoped>
.error {
font-weight: bold;
color: red;
}
</style>
...@@ -6,70 +6,116 @@ ...@@ -6,70 +6,116 @@
</router-link> </router-link>
</mt-header> </mt-header>
<div class="siteDetailInfo"> <div class="siteDetailInfo">
<div class="siteName">{{siteDetail.name}}</div> <div class="siteName">{{siteDetail.netName}}</div>
<div><label style="font-size: 15px">距离:{{distance}}km</label><label style="margin-left: 20px;font-size: 15px">类型:人工发放网点</label></div> <div><label style="font-size: 15px">距离:{{siteDetail.distance}}km</label><label
style="margin-left: 20px;font-size: 15px">类型:{{siteDetail.netTypeName}}</label></div>
<div class="ui-flex justify-center center" style="line-height: 29px">地址: <div class="ui-flex justify-center center" style="line-height: 29px">地址:
<label class="btn" @click="clickAddress">{{siteDetail.address}}</label><div class="cell"><img src="../assets/img/phone.png"/></div> <label class="btn" @click="clickAddress">{{siteDetail.netAddress}}</label>
<div class="cell"><img src="../assets/img/phone.png"/></div>
</div> </div>
<div class="ui-flex justify-center center">联系电话: <div class="ui-flex justify-center center">联系电话:
<label class="btn" @click="clickPhone">{{siteDetail.phone}}</label><div class="cell"><img src="../assets/img/phone.png"/></div> <label class="btn" @click="clickPhone">{{siteDetail.netPhone}}</label>
<div class="cell"><img src="../assets/img/phone.png"/></div>
</div> </div>
</div> </div>
<div style="padding:0 20px;font-size: 15px">该网点当前可领取的药具</div> <div style="padding:0 20px;font-size: 15px">该网点当前可领取的药具</div>
<div class="content-list"> <div class="content-list">
<div class="content-item ui-flex justify-center center"> <div
<div class="cell"> class="list-data"
<img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1926305167,3823812322&fm=26&gp=0.jpg"/> v-infinite-scroll="loadMore"
</div> :infinite-scroll-disabled="loading"
<div class="tradeInfo"> infinite-scroll-distance="10"
<div class="tradeName">天然乳胶避孕套超薄装天然乳胶避孕套超薄装</div>
<div style="margin-top: 5px"><label style="float: left;margin-bottom: 0">数量:86</label><label style="float: right;margin-right: 15px;margin-bottom: 0">规格:10只/盒</label><div style="clear: both"></div></div> >
<div>有效期至:2023-11-22</div> <div class="content-item ui-flex justify-center center"
<div>生产厂家:程程药业有限公司</div> v-for="item in stockInfo"
:key="item.id"
>
<div class="cell">
<img :src=item.imgUrl />
</div>
<div class="tradeInfo">
<div class="tradeName">{{item.medicineName}}</div>
<div style="margin-top: 5px"><label style="float: left;margin-bottom: 0">数量:{{item.stockNum}}</label><label
style="float: right;margin-right: 15px;margin-bottom: 0">规格:{{item.specs}}</label>
<div style="clear: both"></div>
</div>
<div>有效期至:{{item.expireDate}}</div>
<div>生产厂家:{{item.factoryName}}</div>
</div>
<div style="clear: both"></div>
</div> </div>
<div style="clear: both"></div>
</div> </div>
<div class="content-item ui-flex justify-center center"> </div>
<div class="cell"> <div v-if="noDataShow">
<img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1926305167,3823812322&fm=26&gp=0.jpg"/> <NoData></NoData>
</div>
<div class="tradeInfo">
<div class="tradeName">天然乳胶避孕套超薄装天然乳胶避孕套超薄装</div>
<div style="margin-top: 5px"><label style="float: left;margin-bottom: 0">数量:86</label><label style="float: right;margin-right: 15px;margin-bottom: 0">规格:10只/盒</label><div style="clear: both"></div></div>
<div>有效期至:2023-11-22</div>
<div>生产厂家:程程药业有限公司</div>
</div>
<div style="clear: both"></div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import {getStockInfo} from "../utils/api";
import NoData from "./component/noData";
export default { export default {
name: "siteDetails", name: "siteDetails",
components: {NoData},
data() { data() {
return { return {
distance: 0, siteDetail: {},
siteDetail: { loading: false,
id: 4, relationId: '',
name: "大悦城发放机", stockInfo: [],
LngLat: [102.714625, 25.02158], loadText: '加载中...',
address: "大悦城发放机发放点详细地址", noDataShow: false,
contacts: "梨花", param: {
phone: "13669772255" pageIndex: 0,
}, pageSize: 10
}
} }
}, },
created() { created() {
/*发请求通过this.$route.query.id*/ /*发请求通过this.$route.query.id*/
this.distance = this.getDistance(this.$route.query.Lat, this.$route.query.Lng, this.siteDetail.LngLat[1], this.siteDetail.LngLat[0]); this.siteDetail = JSON.parse(this.$route.query.info)
this.relationId = this.siteDetail.id
// this.getMedicalInfoList()
}, },
methods: { methods: {
clickAddress(){ loadMore() {
this.loading = true
this.param.pageIndex += 1
this.getMedicalInfoList()
},
getMedicalInfoList(callBack) {
let par = {
relationId: this.relationId,
...this.param
}
getStockInfo(par).then(({data}) => {
const {dataList = []} = data.data
this.stockInfo = this.stockInfo.concat(dataList)
if (this.stockInfo.length == 0) {
this.noDataShow = true
} else {
this.noDataShow = false
}
if (data.data && data.data.length < this.param.pageSize) {
this.loadText = '暂无更多数据'
} else {
this.loading = false
}
callBack && callBack()
}).finally(() => {
this.loading = false
})
},
clickAddress() {
console.log(123); console.log(123);
}, },
clickPhone(){ clickPhone() {
console.log(456); console.log(456);
}, },
getDistance(latFrom, lngFrom, latTo, lngTo) { getDistance(latFrom, lngFrom, latTo, lngTo) {
...@@ -86,22 +132,28 @@ ...@@ -86,22 +132,28 @@
distance = Math.round(distance * 10000) / 10000; distance = Math.round(distance * 10000) / 10000;
return parseFloat(distance.toFixed(0)); return parseFloat(distance.toFixed(0));
}, },
},
beforeDestroy() {
this.relationId = ''
this.stockInfo = []
} }
} }
</script> </script>
<style scoped> <style scoped>
.siteDetailInfo{ .siteDetailInfo {
font-size: 15px; font-size: 15px;
padding: 10px 20px; padding: 10px 20px;
border-top: 1px solid #F5F6F8; border-top: 1px solid #F5F6F8;
border-bottom: 5px solid #F5F6F8; border-bottom: 5px solid #F5F6F8;
} }
.siteName{
.siteName {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.btn { .btn {
color: #00CA9D; color: #00CA9D;
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -112,9 +164,11 @@ ...@@ -112,9 +164,11 @@
font-family: "宋体"; font-family: "宋体";
font-size: 15px; font-size: 15px;
} }
.btn:focus { .btn:focus {
outline: none; outline: none;
} }
.ui-flex { .ui-flex {
display: -webkit-box !important; display: -webkit-box !important;
display: -webkit-flex !important; display: -webkit-flex !important;
...@@ -133,6 +187,7 @@ ...@@ -133,6 +187,7 @@
-webkit-box-pack: center; -webkit-box-pack: center;
-ms-flex-pack: center; -ms-flex-pack: center;
} }
.ui-flex.center { .ui-flex.center {
-webkit-box-pack: center; -webkit-box-pack: center;
-ms-flex-pack: center; -ms-flex-pack: center;
...@@ -141,31 +196,43 @@ ...@@ -141,31 +196,43 @@
-ms-flex-align: center; -ms-flex-align: center;
align-items: center align-items: center
} }
.content-list{
.content-list {
width: 100%; width: 100%;
height: calc(100% - 185px); height: calc(100% - 185px);
} }
.content-item{
.content-item {
padding: 10px 10px 0 20px; padding: 10px 10px 0 20px;
border-bottom: 5px solid #F5F6F8; border-bottom: 5px solid #F5F6F8;
height: 150px; height: 150px;
} }
.content-item:first-child{
.content-item:first-child {
padding-top: 0; padding-top: 0;
} }
.content-item img{
.content-item img {
width: 85px; width: 85px;
max-height: 100px; max-height: 100px;
float: left; float: left;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
.tradeName{
.tradeName {
font-size: 14px; font-size: 14px;
} }
.tradeInfo{
.tradeInfo {
float: left; float: left;
width:calc(100% - 90px); width: calc(100% - 90px);
padding-left: 10px; padding-left: 10px;
} }
</style>
\ No newline at end of file .list-data {
/*height: calc(100% - 40px);*/
max-height: calc(100vh - 200px);
overflow-y: auto;
}
</style>
...@@ -22,6 +22,28 @@ module.exports = { ...@@ -22,6 +22,28 @@ module.exports = {
} }
}, },
productionSourceMap: IsProd ? false : true, productionSourceMap: IsProd ? false : true,
lintOnSave:false,
devServer: {
port: 8082,
open: true,
overlay: {
warning: false,
errors: false
},
// https: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': ''
}
},
}
},
chainWebpack:(config)=>{ chainWebpack:(config)=>{
config.plugins.delete('preload'); config.plugins.delete('preload');
config.plugins.delete('prefetch'); config.plugins.delete('prefetch');
......
This diff is collapsed.
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