提交 173b5882 编写于 作者: 张磊's avatar 张磊

auto commit

上级 989c5cc4
......@@ -53,3 +53,38 @@ export const operationSubmit = (data) => {
withCredentials: true,
});
};
// 签署协议
export const signDetection = (data) => {
return request({
method: 'post',
url: '/smartcontract/protocol/sign/detection',
data: data
});
};
// 获取协议名称
export const getProtocolContent = (data) => {
return request({
url: `/smartcontract/protocol/content?type=${data.id}`,
method: 'get',
});
};
// 获取协议内容
export const getProtocolName = (data) => {
return request({
url: `/smartcontract/protocol/name?type=${data.id}`,
method: 'GET',
});
};
// 绑定条码
export const sampleCodeValidate = (data) => {
return request({
method: 'post',
url: '/trade/detection/sampleCode/validate',
data: data,
withCredentials: true,
});
};
......@@ -16,11 +16,9 @@ const loading = {
Vue.prototype.$loading = {
show: () => {
console.log('show');
instance.show = true;
},
hide: () => {
console.log('hide');
instance.show = false;
},
};
......
import { router, store, vueApp } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto';
import '@/router';
import { PicaArea } from 'pica-area';
console.log('router, store, vueApp: ', router, store, vueApp);
const { Vue } = window;
import Loading from '@/components/loading/loading.js';
import commonJs from '@/utils/common';
import '@/assets/js/flexible';
Vue.use(Loading);
Vue.use(PicaArea);
Vue.prototype.$commonJs = commonJs;
import {PicaArea} from 'pica-area';
console.log('PicaArea', PicaArea);
// 禁用双指放大
var lastTouchEnd = 0;
document.addEventListener('touchstart', function (event) {
......@@ -40,5 +35,6 @@ document.documentElement.addEventListener(
);
vueApp.$rocNative.appInit();
window.Vue.use(PicaArea);
console.log('router, store, vueApp: ', router, store, vueApp);
console.log('window :>> ', window);
import Vue from 'vue';
import picaGuideApp from '@pica-kit/pica-ui-component/lib/pica-guide-app';
import PageModel from '@pica-kit/page-model';
import { Dialog, Field } from 'vant';
import { Dialog, Field, Overlay, Button} from 'vant';
import Loading from '@/components/loading/loading';
Vue.use(Loading);
// Vue.use(PicaArea);
Vue.use(picaGuideApp);
Vue.use(PageModel);
Vue.use(Dialog);
Vue.use(Field);
Vue.use(Overlay);
Vue.use(Button);
......@@ -15,7 +15,7 @@
type="text"
class="code"
>
{{ checkName || '' }}
{{ detectionData.checkName || '' }}
</div>
<div class="code-input-item-r">
<div
......@@ -56,7 +56,7 @@
<img
class="clear-img"
src="https://files.yunqueyi.com/icon/2022/clear.png"
/>
>
</div>
<div
class="scan-qr-img-container-code"
......@@ -65,7 +65,7 @@
<img
class="scan-qr-img"
src="https://files.yunqueyi.com/image/png/common/20221128114549858.png"
/>
>
<span>扫码识别</span>
</div>
</div>
......@@ -90,13 +90,13 @@
class="check-area"
src="https://files.yunqueyi.com/h5/detection/is-check.png"
@click="setSignDetection()"
/>
>
<img
v-else
class="check-area"
src="https://files.yunqueyi.com/h5/detection/check.png"
@click="setSignDetection()"
/>
>
<span class="notification-text1">我已阅读并同意</span>
<span
class="notification-text2"
......@@ -114,11 +114,32 @@
提交
</div>
</div>
<van-overlay
z-index="11"
:show="showProtocol"
@click="showProtocol = false"
>
<div class="protocol-content">
<div class="block70">
知情同意书
</div>
<div
class="protocol-text"
v-html="agreeText"
/>
<van-button
class="btn"
@click="subProtocol"
>
知情并提交
</van-button>
</div>
</van-overlay>
</div>
</template>
<script>
import { signDetection, getProtocolContent, getProtocolName, sampleCodeValidate} from '@/api/detection.js';
export default {
data() {
return {
......@@ -136,13 +157,6 @@ export default {
protocolName: '',
prototypeId: '',
prototypeLogId: '',
isLoading: false,
recordInfo: {
name: '',
sex: '',
date: '',
checkName: ''
},
goodsId: '',
status: '',
errorMessage: '',
......@@ -155,6 +169,23 @@ export default {
computed: {
},
created() {
// 11073
const mock = {
checkName: '博厚检测2',
doctorId: 0,
equipmentVariety: null,
examQuestionnaireId: 0,
goodsId: 23911,
goodsName: null,
hospitalId: 439487,
hospitalProjectId: 678,
pprotocolType: 31,
projectId: 9,
serviceCheckType: 1,
validateIdNo: 0,
};
this.detectionData = mock;
this.getProtocolName();
},
methods: {
triggerEditModal() {
......@@ -179,16 +210,93 @@ export default {
this.barCode = '';
},
scanCode() {},
toggleBindingInfo() {},
setSignDetection() {},
goProtocol() {}
toggleBindingInfo() {
if(!this.isCheck && this.detectionData.pprotocolType) {
this.goProtocol();
}else{
const o = {
projectId: this.detectionData.projectId,
sampleCode: this.barCode,
hospitalId:this.detectionData.hospitalId
};
this.$loading.show();
sampleCodeValidate(o).then(res => {
const {code, message} = res.data;
if (code !== '000000') {
this.errorMessage = message;
return;
}
this.errorMessage = '';
}).finally(() => {
this.$loading.hide();
});
}
},
setSignDetection() {
const obj = {
protocolType: this.detectionData.pprotocolType,
patientId: 212773027
};
signDetection(obj).then(res => {
if (res.code !== '000000') {
return this.$toast(res.message);
}
this.prototypeLogId = res.data;
this.isCheck = !this.isCheck;
});
},
goProtocol() {
const obj = {
// id: this.detectionData.pprotocolType,
id: 31,
};
getProtocolContent(obj).then(res => {
if (res.code !== '000000') {
return this.$toast(res.message);
}
this.showProtocol = true;
const protoData = res.data;
this.agreeText = protoData;
this.agreeText = this.agreeText.replace('【', '[');
this.agreeText = this.agreeText.replace('】', ']');
this.agreeText = this.agreeText.substr(
this.agreeText.indexOf('<p'),
this.agreeText.lastIndexOf('</p>') - this.agreeText.indexOf('<p')
);
});
},
getProtocolName() {
const d = {
id: this.detectionData.pprotocolType
};
getProtocolName(d).then( res => {
if (res.code !== '000000') {
return this.$toast(res.message);
}
this.protocolName = res.data;
});
},
subProtocol() {
const obj = {
protocolType: this.detectionData.pprotocolType,
patientId: 212773027
};
signDetection(obj).then(res => {
if (res.code !== '000000') {
return this.$toast(res.message);
}
this.prototypeLogId = res.data;
this.isCheck = true;
this.showProtocol = false;
this.toggleBindingInfo();
});
}
}
};
</script>
<style lang="scss" scoped>
.insurance-binding-code-container{
width: 100%;
background-color: #F5F6F8;
......@@ -220,6 +328,13 @@ export default {
align-items: center;
border-radius: 6px;
}
.code-input-item{
padding: 0 10px;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 6px;
}
.code-input-item-l{
display: flex;
flex-flow: column;
......@@ -265,6 +380,9 @@ export default {
padding: 0;
height: 31px;
line-height: 31px;
&::after{
border: none;
}
}
}
.code{
......@@ -374,6 +492,41 @@ export default {
margin-top:7px;
}
}
.protocol-content{
width: 100%;
height: 500PX;
background-color: #ffffff;
position: fixed;
bottom: 0;
font-size: 12px;
color: #676869;
.block70{
height: 40px;
line-height: 30px;
text-align: center;
font-size: 15px;
font-weight: bold;
}
.protocol-text{
height: 400PX;
overflow: scroll;
line-height: 2;
padding: 0px 4px;
}
.btn{
background-color: #00BDA5;
color: #ffffff;
width: 300px;
height: 40px;
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
margin: 0 auto;
margin-top: 10px;
}
}
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册