Commit f90a7fe0 authored by gengchunlei's avatar gengchunlei

居民重新申请

parent c1225cc8
......@@ -57,6 +57,16 @@ export const getUserCollectRecord = 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 => {
return apiInstance.get(`/stock-info/v1/api/phone-h5/stock-provide-record/query-by-no/${params.no}`, {params})
......
import Vue from 'vue'
import {Button, Popup, Field } from "vant";
import {Button, Popup, Form, Field, Stepper, Notify } from "vant";
Vue.use(Button);
Vue.use(Popup);
Vue.use(Form)
Vue.use(Field);
Vue.use(Stepper)
Vue.use(Notify)
<template>
<div>
<mt-header title="领取记录">
<div slot="left" @click="goBack">
<div slot="left" @click="goBack">
<mt-button icon="back"></mt-button>
</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>
<div>
......@@ -12,14 +22,64 @@
v-infinite-scroll="loadMore"
:infinite-scroll-disabled="loading"
infinite-scroll-distance="10"
id="collectListIds"
v-if="!lossVisible"
>
<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><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 style="color: #FA8C16;">待审核</div>
</div>
......@@ -27,32 +87,39 @@
<div style="color: #F5222D;">已报损</div>
</div>
<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 class="details">
<div class="item">
<label class="item-left">规格:</label>
<label class="item-right">{{item.specs || '--'}}</label>
<div class="flex_center" @click="getCheckLossInfo(item)">
<div class="lossUncheck" v-if="!item.checked"></div>
<div class="losscheck" v-if="item.checked">
<div class="circle"></div>
</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 class="details" style="flex: 1;">
<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="loading" v-if="loading">
<span id="load-text">{{loadText}}</span>
......@@ -62,63 +129,56 @@
</div>
<van-popup
v-model="popupVisible"
position="right"
:style="{ width: '100%', height: '100%' }"
closeable
position="bottom"
:round="false"
:overlay="false"
:style="{ height: otherReasonShow ? '240px' :'158px' }"
>
<div>
<div style="margin-top: 16px;text-align: center;font-size: 18px;color: rgba(69, 90, 100, 0.85);">报损申请</div>
<div>
<div class="flex_start" style="background: #FAAD14;height: 40px" v-if="clickInfo.lossAuditStatus == 2">
<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 class="popForm">
<div class="first">
<div class="require title">重新申领数量</div>
<div>
<van-stepper v-model.number="formData.anewNumber" min="1" :max="clickInfo.receivedNum" integer/>
</div>
</div>
<div>
<div style="margin-top: 12px;font-size: 16px;font-weight: bold;margin-left: 15px;color: rgba(69, 90, 100, 0.6)">报损原因</div>
<van-field
v-model="lossReportReasonUser"
rows="3"
autosize
type="textarea"
style="border: 1px solid #F3F3F3;width: 90%;margin: 10px auto 0px;padding: 10px;"
placeholder="请输入报损原因"
/>
<div style="width: 200px;margin: 15px auto;">
<mt-button type="primary" @click="addDestroyReport" size="large"> 提交</mt-button>
</div>
<div class="require title" style="margin-top: 10px">重新申领原因</div>
<div class="flex_start_wrap">
<div v-for="(item, index) in adverseReaction"
class="unselected_c_adv adv"
:style="{marginLeft: index == 0 ? '0px' : '10px'}"
:key="item.value"
@click="getAdverse(item)"
:id="item.value"
>
<span style="line-height: 24px;margin: 0px 5px">{{item.label}}</span>
</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>
</van-popup>
</div>
......@@ -127,27 +187,48 @@
</template>
<script>
import {getUserCollectRecord, addDestroyApply} from '../utils/api';
import {getUserCollectRecord, getUserLossReportRecord, addLossReport} from '../utils/api';
import NoData from "./component/noData";
import { Toast } from 'mint-ui';
import { Indicator } from 'mint-ui';
import {Toast} 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 {
name: "collectRecords",
components: {NoData},
data() {
return {
loading: false,
btnLoad: false,
lossLoading: false,
detailInfo: [],
loadText:'加载中...',
lossDetailInfo: [],
loadText: '加载中...',
noDataShow: false,
lossVisible: false,
popupVisible: false,
lossReportReasonUser: undefined,
clickInfo: {},
adverseReaction,
otherReasonShow: false,
param: {
telephone: undefined,
pageIndex: 0,
pageSize: 10
},
lossParam: {
telephone: undefined,
pageIndex: 0,
pageSize: 10
},
formData: {
anewNumber: undefined,
otherReason: undefined,
lossReportReasonUser: undefined,
}
}
},
......@@ -156,6 +237,9 @@
Indicator.open();
this.param.telephone = JSON.parse(window.sessionStorage.getItem('mobileTokenIno')).phone
getUserCollectRecord(this.param).then(({data = {}}) => {
if (this.param.pageIndex == 1) {
this.detailInfo = []
}
const {dataList = []} = data.data
this.detailInfo = this.detailInfo.concat(dataList)
if (this.detailInfo.length == 0) {
......@@ -178,6 +262,40 @@
this.loading = false
}).finally(() => {
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() {
......@@ -185,59 +303,240 @@
this.param.pageIndex += 1
this.getRecordInfo()
},
loadLossReportMore() {
this.lossLoading = true
this.lossParam.pageIndex += 1
this.getLossRRecordInfo()
},
goBack() {
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) {
this.clickInfo = item
this.popupVisible = true
toLossReport() {
// this.lossDetailInfo = []
this.lossParam.pageIndex = 0
this.lossVisible = true
this.loadLossReportMore()
},
addDestroyReport() {
if (!this.lossReportReasonUser) {
Toast({
message: '请输入报损原因',
duration: 2000,
className: 'toastIndex',
})
return
}
const {telephone, ...others} = this.clickInfo
let par = {
...others,
lossAuditStatus: 0,
lossReportReasonUser: this.lossReportReasonUser,
}
addDestroyApply(par).then(({data}) => {
cancelLossReport() {
// this.detailInfo = []
this.clickInfo = {}
this.param.pageIndex = 0
this.loadMore()
this.lossVisible = false
this.popupVisible = false
this.otherReasonShow = false
this.formData = {
anewNumber: undefined,
otherReason: undefined,
lossReportReasonUser: undefined,
}
this.adverseReaction.forEach(item => {
item.checked = false
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') {
this.detailInfo.forEach(item => {
if (item.id == this.clickInfo.id) {
item.lossAuditStatus = 0
item.lossReportReasonUser = this.lossReportReasonUser
}
})
this.detailInfo = [...this.detailInfo]
this.popupVisible = false
this.toLossReport()
// 成功通知
this.$notify({ type: 'success', message: '申请成功!' ,className: 'toastIndex',});
} else {
Toast({
message: '申请失败!',
duration: 2000,
className: 'toastIndex',
})
this.$notify({ type: 'danger', message: '申请失败!' , 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() {
this.detailInfo = []
}
}
</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 {
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 scoped>
......@@ -249,6 +548,7 @@
border-radius: 1rem;
box-shadow: darkgrey 0px 2px 20px -10px;
}
.content_detail {
width: 90%;
margin: 10px auto 0px;
......@@ -258,10 +558,11 @@
border-radius: 1rem;
/*box-shadow: darkgrey 0px 2px 20px -10px;*/
}
.content .title {
font-weight: bold;
line-height: 1.5;
font-size: 14px!important;
font-size: 14px !important;
border-bottom: 1px solid #F3F3F3;
padding: 0px 0px 3px 0px;
}
......@@ -269,7 +570,7 @@
.content_detail .title {
font-weight: bold;
line-height: 1.5;
font-size: 14px!important;
font-size: 14px !important;
border-bottom: 1px solid #F3F3F3;
padding: 0px 0px 3px 0px;
}
......@@ -281,6 +582,7 @@
.content_detail .details .item .item-right {
float: right;
}
.content .details .item {
line-height: 24px;
}
......@@ -288,15 +590,27 @@
.content .details .item .item-right {
float: right;
}
.list-data{
/*height: calc(100% - 40px);*/
max-height: calc(100vh - 40px);
.list-data {
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;
}
.loading{
.loading {
width: 100%;
text-align: center;
}
.bottom_btn {
/*position: fixed;*/
/*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