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

demo dev

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