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

auto commit

上级 989c5cc4
...@@ -53,3 +53,38 @@ export const operationSubmit = (data) => { ...@@ -53,3 +53,38 @@ export const operationSubmit = (data) => {
withCredentials: true, 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 = { ...@@ -16,11 +16,9 @@ const loading = {
Vue.prototype.$loading = { Vue.prototype.$loading = {
show: () => { show: () => {
console.log('show');
instance.show = true; instance.show = true;
}, },
hide: () => { hide: () => {
console.log('hide');
instance.show = false; instance.show = false;
}, },
}; };
......
import { router, store, vueApp } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto'; import { router, store, vueApp } from '@pica-cli/vue-cli-plugin-pica-cli-plugin/auto';
import '@/router'; import '@/router';
import { PicaArea } from 'pica-area';
console.log('router, store, vueApp: ', router, store, vueApp); 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'; import '@/assets/js/flexible';
Vue.use(Loading); import {PicaArea} from 'pica-area';
Vue.use(PicaArea); console.log('PicaArea', PicaArea);
Vue.prototype.$commonJs = commonJs;
// 禁用双指放大 // 禁用双指放大
var lastTouchEnd = 0; var lastTouchEnd = 0;
document.addEventListener('touchstart', function (event) { document.addEventListener('touchstart', function (event) {
...@@ -40,5 +35,6 @@ document.documentElement.addEventListener( ...@@ -40,5 +35,6 @@ document.documentElement.addEventListener(
); );
vueApp.$rocNative.appInit(); vueApp.$rocNative.appInit();
window.Vue.use(PicaArea);
console.log('router, store, vueApp: ', router, store, vueApp); console.log('router, store, vueApp: ', router, store, vueApp);
console.log('window :>> ', window); console.log('window :>> ', window);
import Vue from 'vue'; import Vue from 'vue';
import picaGuideApp from '@pica-kit/pica-ui-component/lib/pica-guide-app'; import picaGuideApp from '@pica-kit/pica-ui-component/lib/pica-guide-app';
import PageModel from '@pica-kit/page-model'; 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(picaGuideApp);
Vue.use(PageModel); Vue.use(PageModel);
Vue.use(Dialog); Vue.use(Dialog);
Vue.use(Field); Vue.use(Field);
Vue.use(Overlay);
Vue.use(Button);
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
type="text" type="text"
class="code" class="code"
> >
{{ checkName || '' }} {{ detectionData.checkName || '' }}
</div> </div>
<div class="code-input-item-r"> <div class="code-input-item-r">
<div <div
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<img <img
class="clear-img" class="clear-img"
src="https://files.yunqueyi.com/icon/2022/clear.png" src="https://files.yunqueyi.com/icon/2022/clear.png"
/> >
</div> </div>
<div <div
class="scan-qr-img-container-code" class="scan-qr-img-container-code"
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<img <img
class="scan-qr-img" class="scan-qr-img"
src="https://files.yunqueyi.com/image/png/common/20221128114549858.png" src="https://files.yunqueyi.com/image/png/common/20221128114549858.png"
/> >
<span>扫码识别</span> <span>扫码识别</span>
</div> </div>
</div> </div>
...@@ -90,13 +90,13 @@ ...@@ -90,13 +90,13 @@
class="check-area" class="check-area"
src="https://files.yunqueyi.com/h5/detection/is-check.png" src="https://files.yunqueyi.com/h5/detection/is-check.png"
@click="setSignDetection()" @click="setSignDetection()"
/> >
<img <img
v-else v-else
class="check-area" class="check-area"
src="https://files.yunqueyi.com/h5/detection/check.png" src="https://files.yunqueyi.com/h5/detection/check.png"
@click="setSignDetection()" @click="setSignDetection()"
/> >
<span class="notification-text1">我已阅读并同意</span> <span class="notification-text1">我已阅读并同意</span>
<span <span
class="notification-text2" class="notification-text2"
...@@ -114,11 +114,32 @@ ...@@ -114,11 +114,32 @@
提交 提交
</div> </div>
</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> </div>
</template> </template>
<script> <script>
import { signDetection, getProtocolContent, getProtocolName, sampleCodeValidate} from '@/api/detection.js';
export default { export default {
data() { data() {
return { return {
...@@ -136,13 +157,6 @@ export default { ...@@ -136,13 +157,6 @@ export default {
protocolName: '', protocolName: '',
prototypeId: '', prototypeId: '',
prototypeLogId: '', prototypeLogId: '',
isLoading: false,
recordInfo: {
name: '',
sex: '',
date: '',
checkName: ''
},
goodsId: '', goodsId: '',
status: '', status: '',
errorMessage: '', errorMessage: '',
...@@ -155,6 +169,23 @@ export default { ...@@ -155,6 +169,23 @@ export default {
computed: { computed: {
}, },
created() { 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: { methods: {
triggerEditModal() { triggerEditModal() {
...@@ -179,16 +210,93 @@ export default { ...@@ -179,16 +210,93 @@ export default {
this.barCode = ''; this.barCode = '';
}, },
scanCode() {}, scanCode() {},
toggleBindingInfo() {}, toggleBindingInfo() {
setSignDetection() {}, if(!this.isCheck && this.detectionData.pprotocolType) {
goProtocol() {} 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.insurance-binding-code-container{ .insurance-binding-code-container{
width: 100%; width: 100%;
background-color: #F5F6F8; background-color: #F5F6F8;
...@@ -220,6 +328,13 @@ export default { ...@@ -220,6 +328,13 @@ export default {
align-items: center; align-items: center;
border-radius: 6px; 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{ .code-input-item-l{
display: flex; display: flex;
flex-flow: column; flex-flow: column;
...@@ -265,6 +380,9 @@ export default { ...@@ -265,6 +380,9 @@ export default {
padding: 0; padding: 0;
height: 31px; height: 31px;
line-height: 31px; line-height: 31px;
&::after{
border: none;
}
} }
} }
.code{ .code{
...@@ -374,6 +492,41 @@ export default { ...@@ -374,6 +492,41 @@ export default {
margin-top:7px; 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> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册