提交 67afd87c 编写于 作者: 张磊's avatar 张磊

demo dev

上级 4a5e5d1b
......@@ -42,6 +42,14 @@ export const getTypeCodeList = () => {
withCredentials: true,
});
};
export const getTypeCodeListDemo = () => {
return request({
url: 'basic-data/constants/app?typeCodeList=P332',
method: 'get',
withCredentials: true,
});
};
// 跟进报告提交
// /trade/detection/record/operation/submit
......
......@@ -53,6 +53,14 @@ const routerConfig = [
title: '问卷结果页面',
},
},
{
path: '/insuranceQuestionResultPay',
name: 'insuranceQuestionResultPay',
component: () => import('@/views/insurance-question-result-pay/insuranceQuestionResult.vue'),
meta: {
title: '问卷结果页面',
},
},
{
path: '/insuranceQuestionBack',
name: 'insuranceQuestionBack',
......
......@@ -140,9 +140,15 @@
</template>
<script>
import {getDetectionName, appointment} from '@/api/appoint';
import { appointment} from '@/api/appoint';
import { getTypeCodeListDemo } from '@/api/detection.js';
import SelectTime from '@/components/selectTime/index.vue';
import dayjs from 'dayjs';
import {createOrder} from '@/api/question';
// 1. 创建订单
// 2。 预约接口
// 3。 详情接口
export default {
components: {
SelectTime,
......@@ -185,51 +191,39 @@ export default {
},
showSelectTime:false,
locationAreaCode: [],
hospitalId: '',
hospitalId: '139136',
projectEquityNo: '',
yunOrderNo: '',
isDisabled: false,
buttonStatus: false,
buttonText: '',
appointmentTimeShadow: '',
currentProject: '1',
orgData: [
{value: '大便潜血检测(肠癌风险)', no:'1'},
{value: '幽门螺杆菌检测(胃癌风险)', no:'2'},
{value: '甲胎蛋白指尖血检测(肝癌风险)', no:'3'},
]
currentProject: null,
orgData: []
};
},
computed: {
canSubmit() {
// this.dectionForm.goodsId &&
return (
this.dectionForm.appointmentTime &&
this.dectionForm.goodsId &&
this.dectionForm.hospitalName &&
this.hospitalId &&
this.yunOrderNo &&
this.buttonStatus
this.currentProject
);
},
},
mounted() {
this.$loading.show();
const { yunOrderNo, projectEquityNo } = this.$route.query;
this.yunOrderNo = yunOrderNo;
const { projectEquityNo } = this.$route.query;
this.projectEquityNo = projectEquityNo;
console.log('yunOrderNo', yunOrderNo);
this.getDetectionName(yunOrderNo);
this.getDetectionName();
},
methods: {
// 目前是配置一个检测信息,可能会拓展,所以返回的是一个list
getDetectionName(yunOrderNo) {
getDetectionName(yunOrderNo).then(res => {
if (res.code === '000000' && res.data) {
const dectionData = res.data[0] || {};
console.log('getDetectionName', dectionData);
this.dectionData = dectionData;
this.dectionForm.detectName = dectionData.detectionName;
this.dectionForm.goodsId = dectionData.goodsId;
getDetectionName() {
getTypeCodeListDemo().then(res => {
if (res.code == '000000' && res.data) {
console.log('--res', res);
this.orgData = res.data;
}
});
},
......@@ -267,29 +261,32 @@ export default {
this[name] = false;
},
appointment() {
this.$refs.dectionForm.validate().then(result => {
this.$refs.dectionForm.validate().then(async result => {
console.log('this.dectionForm', result);
const order = await this.createOrder();
console.log('--', order);
if(order) {
const data = {
appointmentTime: this.dectionForm.appointmentTime,
goodsId: this.dectionForm.goodsId,
hospitalId: this.hospitalId,
hospitalName: this.dectionForm.hospitalName,
yunOrderNo:this.yunOrderNo,
yunOrderNo:order.yunOrderNo,
};
appointment(data).then(res => {
if (res.code === '000000') {
this.$router.push({
path: '/appoint-details',
query: {
yunOrderNo: this.yunOrderNo,
projectEquityNo:this.projectEquityNo
}
});
// this.$router.push({
// path: '/appoint-details',
// query: {
// yunOrderNo: order.yunOrderNo,
// projectEquityNo:this.projectEquityNo
// }
// });
} else {
res.message && this.$toast(res.message);
}
});
}
}).catch(err => {
console.log(err);
});
......@@ -297,6 +294,23 @@ export default {
companySelect(i) {
console.log('9', i);
},
createOrder() {
return new Promise((resolve, reject) => {
const { projectEquityNo, externalOrderNo} = this.$route.query;
const data = {
projectEquityNo: projectEquityNo,
externalOrderNo: externalOrderNo || '123123',
insuranceMerchantProjectDetectionId: this.currentProject
};
createOrder(data).then(res => {
if (res.code == '000000') {
resolve(res.data);
}
}).catch(err => {
reject(err);
});
});
},
},
};
</script>
......
......@@ -151,7 +151,11 @@ export default {
if (this.hasQuestionnaire) {
this.query.needDetect = 1;
console.log('this.query.needDetect', this.query);
this.turnToPage('/insuranceQuestionResult', this.query);
// 是否付费
// payFlag "付费免费标识 -1未出结果 0无推荐 1免费 2付费
const {payFlag} = res.data;
const path = (payFlag && payFlag == 2) ? '/insuranceQuestionResultPay' : '/insuranceQuestionResult';
this.turnToPage(path, this.query);
} else {
this.turnToPage('/appoint', this.query);
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册