Commit c4040746 authored by gengchunlei's avatar gengchunlei

接口对接

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