Commit f90a7fe0 authored by gengchunlei's avatar gengchunlei

居民重新申请

parent c1225cc8
...@@ -57,6 +57,16 @@ export const getUserCollectRecord = params => { ...@@ -57,6 +57,16 @@ export const getUserCollectRecord = params => {
return apiInstance.get(`/stock-info/v1/api/phone-h5/stock-provide-record/page`, {params}) return apiInstance.get(`/stock-info/v1/api/phone-h5/stock-provide-record/page`, {params})
} }
//获取用户领取记录(可申领)
export const getUserLossReportRecord = params => {
return apiInstance.get(`/stock-info/v1/api/phone-h5/stock-provide-record/anew-page`, {params})
}
//药具重新申领申请
export const addLossReport = params => {
return apiInstance.post(`/stock-info/v1/api/phone-h5/stock-provide-record/anew`, params)
}
//根据领取单号获取领取记录 //根据领取单号获取领取记录
export const getUserCollectRecordByNo = params => { export const getUserCollectRecordByNo = params => {
return apiInstance.get(`/stock-info/v1/api/phone-h5/stock-provide-record/query-by-no/${params.no}`, {params}) return apiInstance.get(`/stock-info/v1/api/phone-h5/stock-provide-record/query-by-no/${params.no}`, {params})
......
import Vue from 'vue' import Vue from 'vue'
import {Button, Popup, Field } from "vant"; import {Button, Popup, Form, Field, Stepper, Notify } from "vant";
Vue.use(Button); Vue.use(Button);
Vue.use(Popup); Vue.use(Popup);
Vue.use(Form)
Vue.use(Field); Vue.use(Field);
Vue.use(Stepper)
Vue.use(Notify)
<template> <template>
<div> <div>
<mt-header title="领取记录"> <mt-header title="领取记录">
<div slot="left" @click="goBack"> <div slot="left" @click="goBack">
<mt-button icon="back"></mt-button> <mt-button icon="back"></mt-button>
</div> </div>
<div slot="right" @click="toLossReport" v-if="!lossVisible">
<div class="nar_right">
<span>重新申领</span>
</div>
</div>
<div slot="right" @click="cancelLossReport" v-if="lossVisible">
<div class="nar_right">
<span>取消</span>
</div>
</div>
</mt-header> </mt-header>
<div> <div>
...@@ -12,14 +22,64 @@ ...@@ -12,14 +22,64 @@
v-infinite-scroll="loadMore" v-infinite-scroll="loadMore"
:infinite-scroll-disabled="loading" :infinite-scroll-disabled="loading"
infinite-scroll-distance="10" infinite-scroll-distance="10"
id="collectListIds"
v-if="!lossVisible"
> >
<div class="content" v-for="item in detailInfo" :key="item.id"> <div class="content" v-for="item in detailInfo" :key="item.id">
<!-- 领取记录-->
<div>
<div class="title" style="display:flex;justify-content: space-between;align-items: center">
<div><span>{{item.medicalName}}</span></div>
<div v-if="item.lossAuditStatus === 0" style="min-width: 42px">
<div style="color: #FA8C16;">待审核</div>
</div>
<div v-if="item.lossAuditStatus === 1" style="min-width: 42px">
<div style="color: #F5222D;">已报损</div>
</div>
<div v-if="item.lossAuditStatus === 2" style="min-width: 42px">
<div style="color: #F5222D;">已驳回</div>
</div>
</div>
<div class="details">
<div class="item">
<label class="item-left">规格:</label>
<label class="item-right">{{item.specs || '--'}}</label>
</div>
<div class="item">
<label class="item-left">领取数量:</label>
<label class="item-right">{{item.receivedNum || '--'}} {{item.receivedUnit}}</label>
</div>
<div class="item">
<label class="item-left">领取时间:</label>
<label class="item-right">{{item.created || '--'}}</label>
</div>
<div class="item">
<label class="item-left">领取站点:</label>
<label class="item-right">{{item.netName || '--'}}</label>
</div>
<div class="item">
<label class="item-left">站点类型:</label>
<label class="item-right">{{item.netTypeName || '--'}}</label>
</div>
</div>
</div>
</div>
</div>
<div
class="list-data"
v-infinite-scroll="loadLossReportMore"
:infinite-scroll-disabled="lossLoading"
infinite-scroll-distance="10"
id="collectListId"
v-show="lossVisible"
>
<div class="content" v-for="item in lossDetailInfo" :key="item.id">
<!--可重新申领列表-->
<div class="title" style="display:flex;justify-content: space-between;align-items: center"> <div class="title" style="display:flex;justify-content: space-between;align-items: center">
<div><span>{{item.medicalName}}</span></div> <div><span>{{item.medicalName}}</span></div>
<div v-if="item.lossReportStatus === 0&&!item.lossAuditStatus && item.lossAuditStatus !==0 && item.isVisit != 1" style="min-width: 46px">
<div style="border: 1px solid #26a2ff;color: #26a2ff;padding: 0px 8px" @click="toLossReport(item)">报损</div>
</div>
<div v-if="item.lossAuditStatus === 0" style="min-width: 42px"> <div v-if="item.lossAuditStatus === 0" style="min-width: 42px">
<div style="color: #FA8C16;">待审核</div> <div style="color: #FA8C16;">待审核</div>
</div> </div>
...@@ -27,32 +87,39 @@ ...@@ -27,32 +87,39 @@
<div style="color: #F5222D;">已报损</div> <div style="color: #F5222D;">已报损</div>
</div> </div>
<div v-if="item.lossAuditStatus === 2" style="min-width: 60px"> <div v-if="item.lossAuditStatus === 2" style="min-width: 60px">
<div style="border: 1px solid #F5222D;color: #F5222D;padding: 0px 8px" @click="toLossReport(item)">已驳回</div> <div style="border: 1px solid #F5222D;color: #F5222D;padding: 0px 8px">已驳回</div>
</div> </div>
</div> </div>
<div class="details"> <div class="flex_center" @click="getCheckLossInfo(item)">
<div class="item"> <div class="lossUncheck" v-if="!item.checked"></div>
<label class="item-left">规格:</label> <div class="losscheck" v-if="item.checked">
<label class="item-right">{{item.specs || '--'}}</label> <div class="circle"></div>
</div> </div>
<div class="item"> <div class="details" style="flex: 1;">
<label class="item-left">领取数量:</label> <div class="item">
<label class="item-right">{{item.receivedNum || '--'}} {{item.receivedUnit}}</label> <label class="item-left">规格:</label>
</div> <label class="item-right">{{item.specs || '--'}}</label>
<div class="item"> </div>
<label class="item-left">领取时间:</label> <div class="item">
<label class="item-right">{{item.created || '--'}}</label> <label class="item-left">领取数量:</label>
</div> <label class="item-right">{{item.receivedNum || '--'}} {{item.receivedUnit}}</label>
<div class="item"> </div>
<label class="item-left">领取站点:</label> <div class="item">
<label class="item-right">{{item.netName || '--'}}</label> <label class="item-left">领取时间:</label>
</div> <label class="item-right">{{item.created || '--'}}</label>
<div class="item"> </div>
<label class="item-left">站点类型:</label> <div class="item">
<label class="item-right">{{item.netTypeName || '--'}}</label> <label class="item-left">领取站点:</label>
<label class="item-right">{{item.netName || '--'}}</label>
</div>
<div class="item">
<label class="item-left">站点类型:</label>
<label class="item-right">{{item.netTypeName || '--'}}</label>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="loading" v-if="loading"> <div class="loading" v-if="loading">
<span id="load-text">{{loadText}}</span> <span id="load-text">{{loadText}}</span>
...@@ -62,63 +129,56 @@ ...@@ -62,63 +129,56 @@
</div> </div>
<van-popup <van-popup
v-model="popupVisible" v-model="popupVisible"
position="right" position="bottom"
:style="{ width: '100%', height: '100%' }" :round="false"
closeable :overlay="false"
:style="{ height: otherReasonShow ? '240px' :'158px' }"
> >
<div> <div class="popForm">
<div style="margin-top: 16px;text-align: center;font-size: 18px;color: rgba(69, 90, 100, 0.85);">报损申请</div> <div class="first">
<div> <div class="require title">重新申领数量</div>
<div class="flex_start" style="background: #FAAD14;height: 40px" v-if="clickInfo.lossAuditStatus == 2"> <div>
<van-stepper v-model.number="formData.anewNumber" min="1" :max="clickInfo.receivedNum" integer/>
<img src="../assets/img/warn_icon.png" style="display: inline-block;width: 20px;height: 20px;margin-left: 16px">
<div style="font-size: 13px;color: #ffffff;margin-left: 6px">{{clickInfo.lossReportReasonAdmin}}</div>
</div>
<div style="margin-top: 12px;font-size: 16px;font-weight: bold;margin-left: 15px;color: rgba(69, 90, 100, 0.6)">领取信息</div>
<div class="content_detail">
<div class="title">
<div><span>{{clickInfo.medicalName}}</span></div>
</div>
<div class="details">
<div class="item">
<label class="item-left">规格:</label>
<label class="item-right">{{clickInfo.specs || '--'}}</label>
</div>
<div class="item">
<label class="item-left">领取数量:</label>
<label class="item-right">{{clickInfo.receivedNum || '--'}} {{clickInfo.receivedUnit}}</label>
</div>
<div class="item">
<label class="item-left">领取时间:</label>
<label class="item-right">{{clickInfo.created || '--'}}</label>
</div>
<div class="item">
<label class="item-left">领取站点:</label>
<label class="item-right">{{clickInfo.netName || '--'}}</label>
</div>
<div class="item">
<label class="item-left">站点类型:</label>
<label class="item-right">{{clickInfo.netTypeName || '--'}}</label>
</div>
</div>
</div> </div>
</div>
<div> <div class="require title" style="margin-top: 10px">重新申领原因</div>
<div style="margin-top: 12px;font-size: 16px;font-weight: bold;margin-left: 15px;color: rgba(69, 90, 100, 0.6)">报损原因</div> <div class="flex_start_wrap">
<van-field <div v-for="(item, index) in adverseReaction"
v-model="lossReportReasonUser" class="unselected_c_adv adv"
rows="3" :style="{marginLeft: index == 0 ? '0px' : '10px'}"
autosize :key="item.value"
type="textarea" @click="getAdverse(item)"
style="border: 1px solid #F3F3F3;width: 90%;margin: 10px auto 0px;padding: 10px;" :id="item.value"
placeholder="请输入报损原因" >
/> <span style="line-height: 24px;margin: 0px 5px">{{item.label}}</span>
<div style="width: 200px;margin: 15px auto;">
<mt-button type="primary" @click="addDestroyReport" size="large"> 提交</mt-button>
</div>
</div> </div>
</div>
<div>
<van-field
v-if="otherReasonShow"
v-model="formData.otherReason"
rows="2"
autosize
type="textarea"
style="border: 1px solid #F3F3F3;margin: 12px auto 0px;"
placeholder="请输入其他重新申领的原因"
/>
</div>
<div class="flex_center" style="margin-top: 12px">
<van-button type="primary" block plain style="margin-right: 20px;border-radius: 6px;"
size="small" @click="cancelLossReport">取消
</van-button>
<van-button type="primary"
block
style="background: #00C99D;border-radius: 6px" size="small"
:loading="btnLoad"
@click="addLossReport"
>提交申请
</van-button>
</div> </div>
</div> </div>
</van-popup> </van-popup>
</div> </div>
...@@ -127,27 +187,48 @@ ...@@ -127,27 +187,48 @@
</template> </template>
<script> <script>
import {getUserCollectRecord, addDestroyApply} from '../utils/api'; import {getUserCollectRecord, getUserLossReportRecord, addLossReport} from '../utils/api';
import NoData from "./component/noData"; import NoData from "./component/noData";
import { Toast } from 'mint-ui'; import {Toast} from 'mint-ui';
import { Indicator } from 'mint-ui'; import {Indicator} from 'mint-ui';
const adverseReaction = [
{value: '1', label: '药具污染', checked: false},
{value: '2', label: '药具报废', checked: false},
{value: '3', label: '其他原因', checked: false},
]
export default { export default {
name: "collectRecords", name: "collectRecords",
components: {NoData}, components: {NoData},
data() { data() {
return { return {
loading: false, loading: false,
btnLoad: false,
lossLoading: false,
detailInfo: [], detailInfo: [],
loadText:'加载中...', lossDetailInfo: [],
loadText: '加载中...',
noDataShow: false, noDataShow: false,
lossVisible: false,
popupVisible: false, popupVisible: false,
lossReportReasonUser: undefined, lossReportReasonUser: undefined,
clickInfo: {}, clickInfo: {},
adverseReaction,
otherReasonShow: false,
param: { param: {
telephone: undefined, telephone: undefined,
pageIndex: 0, pageIndex: 0,
pageSize: 10 pageSize: 10
},
lossParam: {
telephone: undefined,
pageIndex: 0,
pageSize: 10
},
formData: {
anewNumber: undefined,
otherReason: undefined,
lossReportReasonUser: undefined,
} }
} }
}, },
...@@ -156,6 +237,9 @@ ...@@ -156,6 +237,9 @@
Indicator.open(); Indicator.open();
this.param.telephone = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).phone this.param.telephone = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).phone
getUserCollectRecord(this.param).then(({data = {}}) => { getUserCollectRecord(this.param).then(({data = {}}) => {
if (this.param.pageIndex == 1) {
this.detailInfo = []
}
const {dataList = []} = data.data const {dataList = []} = data.data
this.detailInfo = this.detailInfo.concat(dataList) this.detailInfo = this.detailInfo.concat(dataList)
if (this.detailInfo.length == 0) { if (this.detailInfo.length == 0) {
...@@ -178,6 +262,40 @@ ...@@ -178,6 +262,40 @@
this.loading = false this.loading = false
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
Indicator.close();
})
},
getLossRRecordInfo(callBack) {
Indicator.open();
this.lossParam.telephone = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).phone
let par = {
...this.lossParam,
lossAuditStatus: -1,
lossReportStatus: 0
}
getUserLossReportRecord(par).then(({data = {}}) => {
const {dataList = []} = data.data
if (this.lossParam.pageIndex == 1) {
this.lossDetailInfo = []
}
dataList.forEach(item => item['checked'] = false)
this.lossDetailInfo = this.lossDetailInfo.concat(dataList)
if (this.lossDetailInfo.length == 0) {
this.noDataShow = true
} else {
this.noDataShow = false
// document.getElementById("collectListId").setAttribute('class', 'list-data-pop')
}
if (data.data && data.data.length < this.lossParam.pageSize) {
this.loadText = '暂无更多数据'
} else {
this.lossLoading = false
}
Indicator.close();
callBack && callBack()
}).finally(() => {
this.lossLoading = false
Indicator.close();
}) })
}, },
loadMore() { loadMore() {
...@@ -185,59 +303,240 @@ ...@@ -185,59 +303,240 @@
this.param.pageIndex += 1 this.param.pageIndex += 1
this.getRecordInfo() this.getRecordInfo()
}, },
loadLossReportMore() {
this.lossLoading = true
this.lossParam.pageIndex += 1
this.getLossRRecordInfo()
},
goBack() { goBack() {
window.history.go(-1) window.history.go(-1)
}, },
getCheckLossInfo(val) {
this.clickInfo = val
this.formData.anewNumber = val.receivedNum
if (val.checked) {
this.lossDetailInfo.forEach(item => {
if (item.id == val.id) {
item.checked = false
this.popupVisible = false
document.getElementById("collectListId").setAttribute('class', 'list-data')
}
})
this.lossDetailInfo = [...this.lossDetailInfo]
} else {
if (!this.popupVisible) {
this.popupVisible = true
document.getElementById("collectListId").setAttribute('class', 'list-data-pop')
}
this.lossDetailInfo.forEach(item => {
item.checked = false
if (item.id == val.id) {
item.checked = true
}
})
}
},
//报损 //报损
toLossReport(item) { toLossReport() {
this.clickInfo = item // this.lossDetailInfo = []
this.popupVisible = true this.lossParam.pageIndex = 0
this.lossVisible = true
this.loadLossReportMore()
}, },
addDestroyReport() { cancelLossReport() {
if (!this.lossReportReasonUser) { // this.detailInfo = []
Toast({ this.clickInfo = {}
message: '请输入报损原因', this.param.pageIndex = 0
duration: 2000, this.loadMore()
className: 'toastIndex', this.lossVisible = false
}) this.popupVisible = false
return this.otherReasonShow = false
} this.formData = {
const {telephone, ...others} = this.clickInfo anewNumber: undefined,
let par = { otherReason: undefined,
...others, lossReportReasonUser: undefined,
lossAuditStatus: 0, }
lossReportReasonUser: this.lossReportReasonUser, this.adverseReaction.forEach(item => {
} item.checked = false
addDestroyApply(par).then(({data}) => { document.getElementById(item.value).setAttribute('class', 'unselected_c_adv adv')
})
this.adverseReaction = [...this.adverseReaction]
document.getElementById("collectListId").setAttribute('class', 'list-data')
},
addLossReport() {
let checkInfo = this.lossDetailInfo.filter(item => item.checked == true)
if (!checkInfo.length) {
Toast({
message: '请选择领取记录!',
duration: 2000,
className: 'toastIndex',
})
return
}
if (!this.formData.lossReportReasonUser) {
Toast({
message: '请选择重新申领原因!',
duration: 2000,
className: 'toastIndex',
})
return
}
this.btnLoad = true
if (this.formData.lossReportReasonUser == '其他原因') {
this.formData.lossReportReasonUser = this.formData.otherReason
}
let par = {
...this.clickInfo,
...this.formData,
lossAuditStatus: 0
}
console.log(JSON.stringify(par))
addLossReport(par).then(({data}) => {
this.btnLoad = false
if (data.code == 'SUCCESS') { if (data.code == 'SUCCESS') {
this.detailInfo.forEach(item => { this.toLossReport()
if (item.id == this.clickInfo.id) { // 成功通知
item.lossAuditStatus = 0 this.$notify({ type: 'success', message: '申请成功!' ,className: 'toastIndex',});
item.lossReportReasonUser = this.lossReportReasonUser
}
})
this.detailInfo = [...this.detailInfo]
this.popupVisible = false
} else { } else {
Toast({ this.$notify({ type: 'danger', message: '申请失败!' , className: 'toastIndex',});
message: '申请失败!',
duration: 2000,
className: 'toastIndex',
})
} }
}).finally(() => {
this.btnLoad = false
}) })
},
} getAdverse(val) {
if (val.value == 3) {
this.otherReasonShow = true
document.getElementById("collectListId").setAttribute('class', 'list-data-other')
} else {
this.otherReasonShow = false
document.getElementById("collectListId").setAttribute('class', 'list-data-pop')
}
if (val.checked) {
this.adverseReaction.forEach(item => {
if (item.value == val.value) {
item.checked = false
}
})
document.getElementById(val.value).setAttribute('class', 'unselected_c_adv adv')
this.adverseReaction = [...this.adverseReaction]
} else {
this.adverseReaction.forEach(item => {
if (item.value == val.value) {
item.checked = true
this.formData.lossReportReasonUser = item.label
document.getElementById(val.value).setAttribute('class', 'selected_c_adv adv')
} else {
item.checked = false
document.getElementById(item.value).setAttribute('class', 'unselected_c_adv adv')
}
})
this.adverseReaction = [...this.adverseReaction]
}
},
}, },
beforeDestroy() { beforeDestroy() {
this.detailInfo = [] this.detailInfo = []
} }
} }
</script> </script>
<style> <style lang="less">
.van-stepper__minus, .van-stepper__plus {
width: 20px!important;
height: 20px!important;
color:#03053D!important;
background-color: #ffffff!important;
}
.toastIndex { .toastIndex {
z-index: 9999!important; z-index: 9999 !important;
}
.nar_right {
font-size: 12px;
line-height: 15px;
color: #1890FF;
}
.require {
&::before {
content: '*';
color: #FF4D4F;
margin-right: 4px;
}
}
.popForm {
padding: 0px 16px;
.first {
display: flex;
justify-content: space-between;
align-items: center;
}
.title {
font-size: 11px;
line-height: 14px;
color: #595959;
}
}
.flex_start_wrap {
flex-wrap: wrap;
display: flex;
justify-content: flex-start;
align-items: center;
}
.adv {
display: inline-block;
margin-left: 10px;
margin-top: 15px;
font-size: 13px;
}
.unselected_c_adv {
background: #F5F5F5;
padding: 0px 8px;
font-size: 14px;
border-radius: 4px;
color: #8C8C8C;
}
.selected_c_adv {
background: #E6F7FF;
padding: 0px 8px;
font-size: 14px;
border-radius: 4px;
color: #1890FF;
}
.lossUncheck {
width: 16px;
height: 16px;
border: 1px solid #D9D9D9;
border-radius: 100px;
margin: 0px 12px 0px 6px;
}
.losscheck {
width: 16px;
height: 16px;
border: 1px solid #1890FF;
border-radius: 100px;
margin: 0px 12px 0px 6px;
padding: 3px;
.circle {
width: 8px;
height: 8px;
background: #1890FF;
border-radius: 20px;
}
} }
</style> </style>
<style scoped> <style scoped>
...@@ -249,6 +548,7 @@ ...@@ -249,6 +548,7 @@
border-radius: 1rem; border-radius: 1rem;
box-shadow: darkgrey 0px 2px 20px -10px; box-shadow: darkgrey 0px 2px 20px -10px;
} }
.content_detail { .content_detail {
width: 90%; width: 90%;
margin: 10px auto 0px; margin: 10px auto 0px;
...@@ -258,10 +558,11 @@ ...@@ -258,10 +558,11 @@
border-radius: 1rem; border-radius: 1rem;
/*box-shadow: darkgrey 0px 2px 20px -10px;*/ /*box-shadow: darkgrey 0px 2px 20px -10px;*/
} }
.content .title { .content .title {
font-weight: bold; font-weight: bold;
line-height: 1.5; line-height: 1.5;
font-size: 14px!important; font-size: 14px !important;
border-bottom: 1px solid #F3F3F3; border-bottom: 1px solid #F3F3F3;
padding: 0px 0px 3px 0px; padding: 0px 0px 3px 0px;
} }
...@@ -269,7 +570,7 @@ ...@@ -269,7 +570,7 @@
.content_detail .title { .content_detail .title {
font-weight: bold; font-weight: bold;
line-height: 1.5; line-height: 1.5;
font-size: 14px!important; font-size: 14px !important;
border-bottom: 1px solid #F3F3F3; border-bottom: 1px solid #F3F3F3;
padding: 0px 0px 3px 0px; padding: 0px 0px 3px 0px;
} }
...@@ -281,6 +582,7 @@ ...@@ -281,6 +582,7 @@
.content_detail .details .item .item-right { .content_detail .details .item .item-right {
float: right; float: right;
} }
.content .details .item { .content .details .item {
line-height: 24px; line-height: 24px;
} }
...@@ -288,15 +590,27 @@ ...@@ -288,15 +590,27 @@
.content .details .item .item-right { .content .details .item .item-right {
float: right; float: right;
} }
.list-data{
/*height: calc(100% - 40px);*/ .list-data {
max-height: calc(100vh - 40px); max-height: calc(100vh - 60px);
overflow-y: auto;
}
.list-data-other {
max-height: calc(100vh - 300px);
overflow-y: auto;
}
.list-data-pop {
max-height: calc(100vh - 218px);
overflow-y: auto; overflow-y: auto;
} }
.loading{
.loading {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.bottom_btn { .bottom_btn {
/*position: fixed;*/ /*position: fixed;*/
/*z-index: 2;*/ /*z-index: 2;*/
......
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