Commit 2b9d35f7 authored by gengchunlei's avatar gengchunlei

新增发放登记以及查看详情

parent edf897c7
NODE_ENV = dev NODE_ENV = dev
VUE_APP_BASE_URL2 = http://123.56.183.13:8083 VUE_APP_BASE_URL = http://192.168.1.242:8082
VUE_APP_BASE_URL = http://127.0.0.1:8082 VUE_APP_BASE_URL2 = http://127.0.0.1:8082
VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
NODE_ENV = prod NODE_ENV = prod
VUE_APP_BASE_URL = https://beta-yjservice.yiboshi.com VUE_APP_BASE_URL = http://123.56.183.13:8083
VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
...@@ -53,6 +53,9 @@ export default { ...@@ -53,6 +53,9 @@ export default {
}, },
fetchUpdateConsentInfo(params) {//更新单位的知情同意书 fetchUpdateConsentInfo(params) {//更新单位的知情同意书
return fetch(`/v1/folacin-admin/folacin-consent-info/${params.id}`, params, "put", "json") return fetch(`/v1/folacin-admin/folacin-consent-info/${params.id}`, params, "put", "json")
},
fetchAllDoctor() {//查询当前单位下的所有医生
return fetch(`/v1/folacin-admin/folacin-provide-record/doctor`)
} }
}, },
...@@ -174,9 +177,12 @@ export default { ...@@ -174,9 +177,12 @@ export default {
fetchFolviteDistributionList(params) {//叶酸发放登记列表 fetchFolviteDistributionList(params) {//叶酸发放登记列表
return fetch('/v1/folacin-admin/folacin-resident-info/grant-page', params) return fetch('/v1/folacin-admin/folacin-resident-info/grant-page', params)
}, },
fetchAddFolviteDistribution(params) { fetchAddFolviteDistribution(params) {//叶酸发放
return fetch('/v1/folacin-admin/folacin-resident-info/direct-grant', params,'post', 'josn') return fetch('/v1/folacin-admin/folacin-resident-info/direct-grant', params,'post', 'json')
} },
fetchFolviteDistributionDetail(params) {//叶酸发放查看详情
return fetch(`/v1/folacin-admin/folacin-resident-info/grant-details/${params.residentId}`)
},
}, },
//物资调拨管理 //物资调拨管理
allocationManagement: { allocationManagement: {
......
...@@ -74,8 +74,7 @@ ...@@ -74,8 +74,7 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="证件类型" prop="menCertificateType"> <a-form-model-item label="证件类型" prop="menCertificateType">
<a-select v-model="formData.menCertificateType" placeholder="请选择" <a-select v-model="formData.menCertificateType" placeholder="请选择">
@click.native="getChildUnitList">
<a-select-option v-for="item in certificateTypeList" <a-select-option v-for="item in certificateTypeList"
:key="item.enumValue" :value="item.enumValue" :key="item.enumValue" :value="item.enumValue"
> >
...@@ -107,7 +106,14 @@ ...@@ -107,7 +106,14 @@
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}" <a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-input placeholder="请输入现住地址" v-model="formData.presentCode"></a-input> <!--<a-input placeholder="请输入现住地址" v-model="formData.presentCode"></a-input>-->
<a-cascader v-model="formData.presentCode"
change-on-select
:options="areaInfo"
:fieldNames="fieldNames"
:load-data="loadAreaData"
@click.native="initLoadAreaData"
placeholder="请选择"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -148,7 +154,7 @@ ...@@ -148,7 +154,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="21" :offset="3"> <!-- <a-col :span="21" :offset="3">
<a-form-model-item :wrapperCol="{span: 23}"> <a-form-model-item :wrapperCol="{span: 23}">
<div style="border: 1px dashed #EEEEEE"> <div style="border: 1px dashed #EEEEEE">
<div class="sign">签字</div> <div class="sign">签字</div>
...@@ -165,7 +171,7 @@ ...@@ -165,7 +171,7 @@
</div> </div>
</div> </div>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>-->
</a-row> </a-row>
</a-card> </a-card>
<div style="margin: 30px 0px"> <div style="margin: 30px 0px">
...@@ -180,11 +186,11 @@ ...@@ -180,11 +186,11 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="发放医生" prop="provideDoctorId"> <a-form-model-item label="发放医生" prop="provideDoctorId">
<a-select v-model="formData.provideDoctorId" placeholder="请选择" @click.native="getChildUnitList"> <a-select v-model="formData.provideDoctorId" placeholder="请选择">
<a-select-option v-for="item in certificateTypeList" <a-select-option v-for="item in doctorInfoList"
:key="item.enumValue" :value="item.enumValue" :key="item.id" :value="item.id"
> >
{{item.enumName}} {{item.staffName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
...@@ -192,20 +198,20 @@ ...@@ -192,20 +198,20 @@
<a-col :span="21" :offset="3"> <a-col :span="21" :offset="3">
<a-form-model-item :wrapperCol="{span: 23}"> <a-form-model-item :wrapperCol="{span: 23}">
<a-button type="primary" @click="openStockModel" style="margin-bottom: 10px">请选择要发放的叶酸种类</a-button> <a-button type="primary" @click="openStockModel" style="margin-bottom: 10px">请选择要发放的叶酸种类</a-button>
<a-table :dataSource="formData.detailedList" rowKey="id" :pagination="false" class="modal_table" <a-table :dataSource="formData.provideRecordList" rowKey="id" :pagination="false" class="table_input tab_error"
bordered> bordered>
<a-table-column title="供应商名称" data-index="typeName"></a-table-column> <a-table-column title="供应商名称" data-index="supplierName"></a-table-column>
<a-table-column title="品牌" data-index="factoryName"></a-table-column> <a-table-column title="品牌" data-index="brandName"></a-table-column>
<a-table-column title="批次号" data-index="batchNumber"></a-table-column> <a-table-column title="批次号" data-index="batchNumber"></a-table-column>
<a-table-column title="当前库存" data-index="stockNum"></a-table-column> <a-table-column title="当前库存" data-index="number"></a-table-column>
<a-table-column title="发放数量" width="190px" fixed="right"> <a-table-column title="发放数量" width="190px" fixed="right">
<template slot-scope="text, record, index"> <template slot-scope="text, record, index">
<a-form-model-item :prop="'detailedList.' + index + '.sendNum'" <a-form-model-item :prop="'provideRecordList.' + index + '.sendNumber'"
:rules="formRules.sendNum" class="tab_input_r"> :rules="formRules.sendNumber" class="tab_input_r">
<a-input type="number" <a-input type="number"
v-toInt v-toInt
v-model="record.sendNum" v-model="record.sendNumber"
placeholder="请输入分配数量" placeholder="请输入发放数量"
style="width: 150px;margin-top: 20px" style="width: 150px;margin-top: 20px"
@change="getChangeRecord(record)" @change="getChangeRecord(record)"
> >
...@@ -236,9 +242,14 @@ ...@@ -236,9 +242,14 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-form-model> </a-form-model>
<!-- 选择叶酸种类弹框-->
<div>
<in-stock-manage-info ref="inStockManageInfo" @selectedIdList="getChecked" v-if="readyGetChecked"></in-stock-manage-info>
</div>
<div style="text-align: center;margin-top: 16px"> <div style="text-align: center;margin-top: 16px">
<a-button @click="goBack">取消</a-button> <a-button @click="goBack">取消</a-button>
<a-button type="primary" @click="addMaterialDis" style="margin-left: 8px">发放</a-button> <a-button type="primary" :loading="spinning" @click="addMaterialDis" style="margin-left: 8px">发放</a-button>
</div> </div>
</a-card> </a-card>
</a-spin> </a-spin>
...@@ -249,11 +260,12 @@ ...@@ -249,11 +260,12 @@
<script> <script>
import {checkPhone, closedDetail, getEnumByFlag} from "../../../utils/common"; import {checkPhone, closedDetail, getEnumByFlag} from "../../../utils/common";
import moment from 'moment' import moment from 'moment'
import InStockManageInfo from "./inStockManageInfo";
let vm = this let vm = this
let recordInfo = {} let recordInfo = {}
export default { export default {
components: {}, components: {InStockManageInfo},
data() { data() {
return { return {
unitInfo: JSON.parse(window.sessionStorage.getItem('networkInfo')), unitInfo: JSON.parse(window.sessionStorage.getItem('networkInfo')),
...@@ -326,14 +338,14 @@ ...@@ -326,14 +338,14 @@
provideDoctorId: [ provideDoctorId: [
{required: true, message: '请选择发放医生'} {required: true, message: '请选择发放医生'}
], ],
sendNum: [ sendNumber: [
{required: true, message: '请填写分配数量'}, {required: true, message: '请输入发放数量'},
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (value == '' || value == undefined) { if (value == '' || value == undefined) {
callback() callback()
} }
if (value <= recordInfo.stockNum) { if (value <= recordInfo.number) {
callback() callback()
} else { } else {
callback(new Error('超出当前库存!')); callback(new Error('超出当前库存!'));
...@@ -351,122 +363,120 @@ ...@@ -351,122 +363,120 @@
}, },
certificateTypeList: [], certificateTypeList: [],
signedModeList: [], signedModeList: [],
bookHtmlContent: '' bookHtmlContent: '',
modalinfo: {
selectedRowKeys: []
},
readyGetChecked: true,
doctorInfoList: [],
areaInfo:[],
fieldNames: {
label: 'areaName',
value: 'areaCode',
children: 'children'
},
} }
}, },
created() { created() {
this.certificateTypeList = getEnumByFlag('folacin_resident_info_certificate_type') this.certificateTypeList = getEnumByFlag('folacin_resident_info_certificate_type')
this.signedModeList = getEnumByFlag('folacin_resident_info_signed_mode') this.signedModeList = getEnumByFlag('folacin_resident_info_signed_mode')
this.getSelectedMedical()
this.getBookHtmlContent() this.getBookHtmlContent()
this.getAllDoctorList()
this.initLoadAreaData()
}, },
methods: { methods: {
initLoadAreaData() {
this.areaInfo = []
this.loadAreaData([{areaCode: 0}])
},
loadAreaData(selectedOptions) {
const targetOption = selectedOptions[selectedOptions.length - 1];
targetOption.loading = true;
this.$api.common.fetchAreaByCode({areaCode: targetOption.areaCode}).then(({data = []}) => {
targetOption.loading = false;
data.forEach(item => {
item['isLeaf'] = false
})
if (targetOption.areaCode == 0) {
this.areaInfo = [...data]
} else {
targetOption.children = [...data]
this.areaInfo = [...this.areaInfo]
}
})
},
getBookHtmlContent() {//获取用户知情书模板 getBookHtmlContent() {//获取用户知情书模板
this.$api.common.fetchConsentInfo().then(({data}) => { this.$api.common.fetchConsentInfo().then(({data}) => {
this.bookHtmlContent = data this.bookHtmlContent = data
}) })
}, },
getAllDoctorList() {
this.$api.common.fetchAllDoctor().then(({data}) => {
this.doctorInfoList = data
})
},
//------签字----------- //------签字-----------
reWrite() { reWrite() {
this.$refs.signaturePad.clearSignature(); this.$refs.signaturePad.clearSignature();
}, },
save() { save() {
const {isEmpty, data} = this.$refs.signaturePad.saveSignature(); const {isEmpty, data} = this.$refs.signaturePad.saveSignature();
console.log(isEmpty); // console.log(isEmpty);
console.log(data); // console.log(data);
},
getChecked(val) {
this.readyGetChecked = false
this.$refs.inStockManageInfo.visible = false
this.modalinfo.selectedRowKeys = [...val]
this.getSelectedMedical(val)
}, },
// 删除药具 // 删除药具
confirm(index) { confirm(index) {
this.formData.detailedList.splice(index, 1); this.formData.provideRecordList.splice(index, 1);
}, },
//获取改变的当前项 //获取改变的当前项
getChangeRecord(record) { getChangeRecord(record) {
recordInfo = record recordInfo = record
}, },
getSelectedMedical() {//获取被选中的药具 getSelectedMedical(val) {//获取被选中的药具
let par = { if (val.length > 0) {
idList: this.$route.query.selected
}
this.$api.stockManage.fetchMedicalListByIds(par).then(({data = []}) => {
this.formData.detailedList = data
})
},
// 获取当前单位的下级单位
getChildUnitList() {
if (this.formData.relationType == 11) {
let par = { let par = {
areaCode: JSON.parse(window.sessionStorage.getItem('networkInfo')).areaCode, idList: val.join(',')
} }
this.$api.networkManage.fetchNetworkListByAreaCode(par).then(({code, data}) => { this.$api.stockManage.fetchMedicalListByIds(par).then(({data = []}) => {
if (code === 'SUCCESS') { this.formData.provideRecordList = data
data.forEach(item => {
item['unitName'] = item.netName
})
this.childUnitList = data;
}
}) })
} else {
let params = {
id: JSON.parse(window.sessionStorage.getItem('userInfo')).unitId,
};
this.$api.common.fetchUnitInfo(params).then(({code, data}) => {
if (code === 'SUCCESS') {
this.childUnitList = data;
}
});
} }
}, },
addMaterialDis() {//发放 addMaterialDis() {//发放
let vm = this
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
if (this.formData.detailedList.length === 0) { if (this.formData.provideRecordList.length === 0) {
this.$message.warning('分配物资不能为空!'); this.$message.warning('发放叶酸不能为空!');
} else { } else {
this.spinning = true; this.spinning = true;
let reviceUnitName = undefined this.formData.provideRecordList.forEach(item => {
let receiveNetworkId = undefined item.stockId = item.id
let receiveNetworkName = undefined
let params = {}
if (this.formData.relationType == 11) {
receiveNetworkId = this.formData.receiveUnitId
receiveNetworkName = this.childUnitList.filter(item => item.id == this.formData.receiveUnitId)[0].unitName
this.formData.receiveUnitId = undefined
reviceUnitName = undefined
params = {
...this.formData,
sendDate: moment(this.formData.sendDate).format('yyyy-MM-DD'),
purchaseUnitId: receiveNetworkId,
purchaseUnitName: receiveNetworkName,
receiveNetworkId: receiveNetworkId,
receiveNetworkName: receiveNetworkName
};
} else {
reviceUnitName = this.childUnitList.filter(item => item.id == this.formData.receiveUnitId)[0].unitName
params = {
...this.formData,
sendDate: moment(this.formData.sendDate).format('yyyy-MM-DD'),
purchaseUnitId: this.formData.receiveUnitId,
purchaseUnitName: reviceUnitName,
receiveUnitName: reviceUnitName
};
}
let detailedList = [];
this.formData.detailedList.forEach(item => {
detailedList.push({
medicalId: item.medicalId,
breedId: item.breedId,
batchId: item.batchId,
batchNumber: item.batchNumber,
produceDate: item.produceDate,
expireDate: item.expireDate,
sendNum: item.sendNum,
matSpecs: item.specs
});
}); });
params.detailedList = detailedList; const {parentDate, provideDate,presentCode,provideDoctorId, ...others} = vm.formData
let parentTime = moment(parentDate).format('YYYY-MM-DD')
let provideTme = moment(provideDate).format('YYYY-MM-DD')
let presentCodeInfo = presentCode[presentCode.length -1]
let provideDoctorInfo = vm.doctorInfoList.filter(item => item.id == provideDoctorId)
let params ={
parentDate: parentTime,
provideDate: provideTme,
presentCode: presentCodeInfo,
provideDoctorId: provideDoctorInfo[0].id,
provideDoctorName: provideDoctorInfo[0].staffName,
...others
}
this.$api.folviteDistributionManage.fetchAddFolviteDistribution(params).then(({code}) => { this.$api.folviteDistributionManage.fetchAddFolviteDistribution(params).then(({code}) => {
this.spinning = false; this.spinning = false;
if (code === 'SUCCESS') { if (code === 'SUCCESS') {
...@@ -490,6 +500,11 @@ ...@@ -490,6 +500,11 @@
}, },
//打开库存弹框 //打开库存弹框
openStockModel() { openStockModel() {
this.readyGetChecked = true
let vm = this
this.$nextTick(() => {
vm.$refs.inStockManageInfo.visible = true
})
}, },
goBack() { goBack() {
...@@ -539,4 +554,11 @@ ...@@ -539,4 +554,11 @@
float: right; float: right;
margin-top: 10px; margin-top: 10px;
} }
.table_input {
.ant-table-tbody > tr > td {
padding: 5px!important;
overflow-wrap: break-word;
}
}
</style> </style>
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
</div> </div>
<a-descriptions bordered> <a-descriptions bordered>
<a-descriptions-item label="姓名"> <a-descriptions-item label="姓名">
{{detailInfo.medicalName || '--'}} {{detailInfo.womanName || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="证件类型"> <a-descriptions-item label="证件类型">
{{detailInfo.breedName || '--'}} {{detailInfo.womenCertificateType || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="证件号码"> <a-descriptions-item label="证件号码">
{{detailInfo.batchNumber || '--'}} {{detailInfo.womenIdCard || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="是否曾经怀孕"> <a-descriptions-item label="是否曾经怀孕">
{{detailInfo.expireDate || '--'}} {{detailInfo.oncePregnant || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="孕次"> <a-descriptions-item label="孕次">
{{detailInfo.expireDate || '--'}} {{detailInfo.pregnantNum || '--'}}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<div class="detail_title" style="border-top: 0px"> <div class="detail_title" style="border-top: 0px">
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
</div> </div>
<a-descriptions bordered> <a-descriptions bordered>
<a-descriptions-item label="姓名"> <a-descriptions-item label="姓名">
{{detailInfo.medicalName || '--'}} {{detailInfo.manName || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="证件类型"> <a-descriptions-item label="证件类型">
{{detailInfo.breedName || '--'}} {{detailInfo.menCertificateType || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="证件号码"> <a-descriptions-item label="证件号码">
{{detailInfo.batchNumber || '--'}} {{detailInfo.menIdCard || '--'}}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<div class="detail_title" style="border-top: 0px"> <div class="detail_title" style="border-top: 0px">
...@@ -59,19 +59,19 @@ ...@@ -59,19 +59,19 @@
</div> </div>
<a-descriptions bordered> <a-descriptions bordered>
<a-descriptions-item label="联系电话"> <a-descriptions-item label="联系电话">
{{detailInfo.medicalName || '--'}} {{detailInfo.telephone || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="现在住址"> <a-descriptions-item label="现在住址">
{{detailInfo.breedName || '--'}} {{detailInfo.presentCode || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="详细地址"> <a-descriptions-item label="详细地址">
{{detailInfo.batchNumber || '--'}} {{detailInfo.nowAddress || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签署方式"> <a-descriptions-item label="签署方式">
{{detailInfo.batchNumber || '--'}} {{detailInfo.signedMode || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签署日期"> <a-descriptions-item label="签署日期">
{{detailInfo.batchNumber || '--'}} {{detailInfo.parentDate || '--'}}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<a-descriptions bordered layout="vertical" class="no_border"> <a-descriptions bordered layout="vertical" class="no_border">
...@@ -87,13 +87,13 @@ ...@@ -87,13 +87,13 @@
<div style="clear: both"></div> <div style="clear: both"></div>
<a-descriptions bordered :column="2"> <a-descriptions bordered :column="2">
<a-descriptions-item label="发放日期"> <a-descriptions-item label="发放日期">
{{detailInfo.medicalName || '--'}} {{detailInfo.provideDate || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="发放医生"> <a-descriptions-item label="发放医生">
{{detailInfo.breedName || '--'}} {{detailInfo.provideDoctorName || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="备注"> <a-descriptions-item label="备注">
{{detailInfo.breedName || '--'}} {{detailInfo.remarks || '--'}}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<div class="detail_title" style="border-top: 0px"> <div class="detail_title" style="border-top: 0px">
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div> </div>
<a-table :dataSource="detailInfo.tableData" <a-table :dataSource="detailInfo.provideRecordList"
:columns="columns" :columns="columns"
rowKey="id" rowKey="id"
:pagination="false" :pagination="false"
...@@ -123,17 +123,17 @@ ...@@ -123,17 +123,17 @@
const columns = [ const columns = [
{ {
title: '供应商', title: '供应商',
dataIndex: 'medicineName', dataIndex: 'supplierName',
ellipsis: true ellipsis: true
}, },
{ {
title: '品牌', title: '品牌',
dataIndex: 'typeName', dataIndex: 'brandName',
ellipsis: true ellipsis: true
}, },
{ {
title: '批次号', title: '批次号',
dataIndex: 'factoryName', dataIndex: 'batchNumber',
ellipsis: true ellipsis: true
}, },
{ {
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
ellipsis: true ellipsis: true
}, },
{ {
title: '发放数量(瓶)', title: '发放数量',
dataIndex: 'specs', dataIndex: 'sendNumber',
ellipsis: true ellipsis: true
}, },
] ]
...@@ -164,9 +164,9 @@ ...@@ -164,9 +164,9 @@
getStockListDetail() { getStockListDetail() {
this.spinning = true this.spinning = true
let par = { let par = {
id: this.routerParams.id residentId: this.routerParams.id
} }
this.$api.stockManage.fetchInStockLisDetail(par).then(({data = [], code}) => { this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => {
this.spinning = false this.spinning = false
this.detailInfo = data this.detailInfo = data
}) })
......
<template>
<div class="inStockManage">
<a-modal title="选择要发放的叶酸种类" v-if="visible" :visible="visible" @cancel="visible = false" @ok="getChecked" :maskClosable="false"
width="1100px" >
<a-form layout="inline" class="search_form">
<a-form-item label="供应商名称">
<a-select v-model="searchForm.supplierId" placeholder="请选择" style="width: 250px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in allSupplyInfo" :key="item.id" :value="item.id">
{{item.supplierName}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="品牌">
<a-select v-model="searchForm.brandId" placeholder="请选择" style="width: 250px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in brandList" :key="item.enumValue" :value="item.enumValue">
{{item.enumName}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="入库日期">
<a-date-picker v-model="searchForm.enterDate" format="YYYY-MM-DD" style="width: 250px"/>
</a-form-item>
<a-button type="primary" class="search_btn" @click="searchList">搜索</a-button>
<a-button class="search_btn" style="margin-left: 10px" @click="restSearchForm">清空</a-button>
<div style="float: right;line-height: 32px;background-color: #E6F7FF;margin-top: 16px;cursor: pointer"
@click="showSelectedMedical"
v-if="selectedRowKeys.length > 0"
>
<a-popover v-model="selectedVisible" trigger="click" placement="bottomRight">
<div slot="content" style="min-width: 300px">
<div>
<span style="padding: 5px 16px;color: #FF4D80">已选择叶酸({{selectedRowKeys.length}})</span>
</div>
<div style="margin-top: 10px">
<a-list
item-layout="horizontal"
:data-source="selectedRowList"
>
<a-list-item slot="renderItem" slot-scope="item, index">
<a slot="actions" @click="delSelectedKey(index)">删除</a>
<a-list-item-meta
:description="item.brandName"
>
</a-list-item-meta>
</a-list-item>
</a-list>
</div>
</div>
<span style="padding: 5px 16px;color: #FF4D80">已选择叶酸{{selectedRowKeys.length}}<a-icon type="down"
style="margin-left:10px;font-size: 10px"/> </span>
</a-popover>
</div>
</a-form>
<div style="clear: both"></div>
<a-table :dataSource="tableData"
:columns="columns"
rowKey="id"
:loading="loading"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
>
<template slot="produceDateS" slot-scope="record">
{{record.produceDate | formatDate}}
</template>
<template slot="expireDateS" slot-scope="record">
{{record.expireDate | formatDate}}
</template>
</a-table>
<a-pagination
v-if="pagination.total > 0"
:total="pagination.total"
show-size-changer
show-quick-jumper
v-model="pagination.pageIndex"
:page-size="pagination.pageSize"
:page-size-options="pagination.pageSizeOptions"
@showSizeChange="showSizeChange"
@change="change"
:showTotal="() => `共 ${pagination.total} 条`"
/>
<div style="clear: both"></div>
</a-modal>
</div>
</template>
<script>
import {isNotBlank, isEmptyParams} from "../../../utils/common";
import moment from 'moment'
const columns = [
{
title: '品牌',
dataIndex: 'brandName',
ellipsis: true
},
{
title: '供应商名称',
dataIndex: 'supplierName',
ellipsis: true
},
{
title: '批次号',
width: '120px',
dataIndex: 'batchNumber',
ellipsis: true
},
{
title: '生产日期',
// dataIndex: 'produceDate',
scopedSlots: {customRender: 'produceDateS'},
},
{
title: '有效期',
width: '120px',
scopedSlots: {customRender: 'expireDateS'},
},
{
title: '单价(元)',
dataIndex: 'unitPrice',
ellipsis: true
},
{
title: '规格',
dataIndex: 'specs',
ellipsis: true
},
{
title: '库存总数',
dataIndex: 'number',
ellipsis: true
},
{
title: '入库日期',
dataIndex: 'enterDate',
ellipsis: true
},
]
export default {
components: {},
data() {
return {
// 搜索框对象
searchForm: {
brandName: '',
supplierId: '',
brandId:'',
enterDate: undefined
},
pagination: {
pageIndex: 1,
pageSize: 10,
total: 0,
pageSizeOptions: ['10', '20', '30', '40', '50'],
},
columns,
tableData: [],
loading: false,
allSupplyInfo: [],
brandList: [],
selectedRowKeys: [],
selectedVisible: false,
selectedRowList: [],
visible: false
}
},
created() {
this.getInStockList();
this.getAllSupply();
this.brandList = JSON.parse(sessionStorage.getItem("allEnum"))["folacin_stock_record_brand_id"];
},
methods: {
getAllSupply() {
let par = {}
this.$api.common.fetchAllSupply(par).then(({data = []}) => {
this.allSupplyInfo = data
})
},
searchList() {
this.pagination.pageIndex = 1
this.getInStockList()
},
getInStockList() {
this.loading = true
let pars = isEmptyParams(this.searchForm);
if (isNotBlank( pars.enterDate)){
pars.enterDate = moment(pars.enterDate).format('YYYY-MM-DD')
}
let par = {
...pars,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
console.log(par);
this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data
this.tableData = dataList
this.pagination.total = total
this.loading = false
}).catch(() => {
this.loading = false
})
},
// 分页
showSizeChange(pageNum, pageSize) {
this.pagination.pageIndex = 1;
this.pagination.pageSize = pageSize;
this.getInStockList()
},
change(pageNum, pageSize) {
this.pagination.pageIndex = pageNum;
this.pagination.pageSize = pageSize;
this.getInStockList()
},
showSelectedMedical() {//显示选中的药具
let par = {
idList: this.selectedRowKeys
}
this.$api.stockManage.fetchMedicalListByIds(par).then(({data = []}) => {
this.selectedRowList = data
})
},
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys;
if (this.selectedRowKeys.length == 0) {
this.selectedVisible = false
}
},
delSelectedKey(index) {
this.selectedRowKeys.splice(index, 1)
this.selectedRowList.splice(index, 1)
if (this.selectedRowKeys.length == 0) {
this.selectedVisible = false
}
},
restSearchForm() {
this.searchForm = {
brandName: '',
supplierId: '',
enterDate: undefined
}
this.searchList()
},
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys;
},
getChecked() {
this.$emit('selectedIdList', this.selectedRowKeys)
}
},
}
</script>
<style lang="less" scoped>
// 文件上传样式
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 6px;
color: #666;
}
.btn_space {
margin-right: 5px;
}
/* .search_form {
margin-top: -17px;
border: 1px solid rgba(255,77,128, .2);
border-top: 0px;
padding: 30px;
}*/
</style>
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
}, },
{ {
title: '证件号码', title: '证件号码',
width: '120px',
dataIndex: 'womenIdCard', dataIndex: 'womenIdCard',
ellipsis: true ellipsis: true
}, },
...@@ -69,11 +68,6 @@ ...@@ -69,11 +68,6 @@
dataIndex: 'telephone', dataIndex: 'telephone',
ellipsis: true ellipsis: true
}, },
{
title: '发放数量',
dataIndex: 'number',
ellipsis: true
},
/* { /* {
title: '发放时期', title: '发放时期',
width: '120px', width: '120px',
......
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