Commit c4040746 authored by gengchunlei's avatar gengchunlei

接口对接

parent 7ecd2625
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<script> <script>
import {addMedicalRecord, getStockInfo} from "../utils/api"; import {addMedicalRecord, getStockInfo} from "../utils/api";
import {callMobile} from "../utils/common"; import {callMobile} from "../utils/common";
import { MessageBox } from 'mint-ui'; import { Toast } from 'mint-ui';
export default { export default {
name: "choiceContraceptives", name: "choiceContraceptives",
data(){ data(){
...@@ -109,6 +109,12 @@ ...@@ -109,6 +109,12 @@
window.history.go(-1) window.history.go(-1)
}, },
receiveContraceptives(){ receiveContraceptives(){
if(this.checkedMedical == '') {
return Toast({
message: '请先选择药具!',
duration: 2000
});
}
let pars = JSON.parse(this.checkedMedical) let pars = JSON.parse(this.checkedMedical)
let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')) let info = JSON.parse(window.sessionStorage.getItem('mobileTokenIno'))
const {phone = '', userId =''} = info const {phone = '', userId =''} = info
...@@ -117,20 +123,16 @@ ...@@ -117,20 +123,16 @@
residentId: userId, residentId: userId,
telephone: phone, telephone: phone,
networkId: this.routerDetail, networkId: this.routerDetail,
number: 1,
...other ...other
} }
console.log(JSON.stringify(par))
addMedicalRecord(par).then(({data}) => { addMedicalRecord(par).then(({data}) => {
if (data.code == 'SUCCESS') { if (data.code == 'SUCCESS') {
Toast({
message: '领取成功!',
position: 'bottom',
duration: 2000
});
this.$router.push("/receiveSuccess"); this.$router.push("/receiveSuccess");
} else { } else {
Toast({ Toast({
message: '系统异常,请联系管理员!', message: '系统异常,请联系客服!',
position: 'bottom',
duration: 2000 duration: 2000
}); });
} }
......
...@@ -89,8 +89,7 @@ ...@@ -89,8 +89,7 @@
callBack && callBack() callBack && callBack()
}).catch(res => { }).catch(res => {
Toast({ Toast({
message: res, message: '系统异常,请联系客服!',
position: 'top',
duration: 2000 duration: 2000
}); });
}).finally(() => { }).finally(() => {
......
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
this.$router.push({path: `/choiceContraceptives`,query:{info:result}}); this.$router.push({path: `/choiceContraceptives`,query:{info:result}});
}, },
toCollectRecords() { toCollectRecords() {
// this.$router.push({path: `/choiceContraceptives`,query:{info:1986}});
this.$router.push('/collectRecords'); this.$router.push('/collectRecords');
}, },
toRealHome() { toRealHome() {
...@@ -180,7 +179,7 @@ ...@@ -180,7 +179,7 @@
}); });
let markers = []; let markers = [];
this.machines.forEach(x => { this.machines.forEach(x => {
if(x.netType===0){ if(x.netType==2){
let marker = new AMap.Marker({ let marker = new AMap.Marker({
map: map, map: map,
icon: personIcon, icon: personIcon,
......
...@@ -137,14 +137,12 @@ ...@@ -137,14 +137,12 @@
if (data.code == 'SUCCESS') { if (data.code == 'SUCCESS') {
Toast({ Toast({
message: '填写成功!', message: '填写成功!',
position: 'bottom',
duration: 2000 duration: 2000
}); });
window.history.go(-1) window.history.go(-1)
} else { } else {
Toast({ Toast({
message: '失败,请联系管理员!', message: '系统异常,请联系客服!',
position: 'bottom',
duration: 2000 duration: 2000
}); });
} }
......
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