Commit eac1da0a authored by gengchunlei's avatar gengchunlei

叶酸发放登记

parent 928fec35
...@@ -41,8 +41,8 @@ export default { ...@@ -41,8 +41,8 @@ export default {
fetchAllEnum(params) {//获取所有枚举值 fetchAllEnum(params) {//获取所有枚举值
return fetch(`/basic-info/v1/basic-info/basic-sys-enum/all-enum`, params) return fetch(`/basic-info/v1/basic-info/basic-sys-enum/all-enum`, params)
}, },
fetchAreaByCode(areaCode) {//根据区域编码获取下级地区 fetchAreaByCode(params) {//根据区域编码获取下级地区
return fetch(`/v1/folacin-admin/sys-dict-area/child-area/${areaCode}`) return fetch(`/v1/folacin-admin/sys-dict-area/child-area/${params.areaCode}`)
}, },
//知情同意书 //知情同意书
fetchConsentInfo() {//查询单位的知情同意书 fetchConsentInfo() {//查询单位的知情同意书
...@@ -168,8 +168,11 @@ export default { ...@@ -168,8 +168,11 @@ export default {
//叶酸发放登记 //叶酸发放登记
folviteDistributionManage: { folviteDistributionManage: {
fetchFolviteDistributionList(params) {//叶酸发放登记列表 fetchFolviteDistributionList(params) {//叶酸发放登记列表
return fetch('/stock-info/v1/stock-info/stock-apply-record', params) return fetch('/v1/folacin-admin/folacin-resident-info/grant-page', params)
}, },
fetchAddFolviteDistribution(params) {
return fetch('/v1/folacin-admin/folacin-resident-info/direct-grant', params,'post', 'josn')
}
}, },
//物资调拨管理 //物资调拨管理
allocationManagement: { allocationManagement: {
...@@ -213,7 +216,7 @@ export default { ...@@ -213,7 +216,7 @@ export default {
}, },
folviteApplyManage: { folviteApplyManage: {
fetchFolviteApplyList(params) {//叶酸申请列表 fetchFolviteApplyList(params) {//叶酸申请列表
return fetch('/v1/folacin-admin/folacin-resident-apply', params) return fetch('/v1/folacin-admin/folacin-resident-info/apply', params)
}, },
}, },
fyManage: { fyManage: {
......
...@@ -55,8 +55,7 @@ ...@@ -55,8 +55,7 @@
created() { created() {
//获取妇幼权限和登录基本信息 //获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市 // document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市
document.cookie = 'bGNnd3lwdF9hdA=15b5e2ce-5b70-48ab-9731-42397aabfec6;'//云南省
document.cookie = 'bGNnd3lwdF9hdA=a551a5a0-aa58-45fe-be4a-9304aa60b594;'//云南省
let cookieToken = getCookie('bGNnd3lwdF9hdA') let cookieToken = getCookie('bGNnd3lwdF9hdA')
if (cookieToken) {//根据cookie获取token并调用接口获取菜单并设置初始选中菜单 if (cookieToken) {//根据cookie获取token并调用接口获取菜单并设置初始选中菜单
window.sessionStorage.setItem('token','bearer'+' ' + cookieToken); window.sessionStorage.setItem('token','bearer'+' ' + cookieToken);
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<div class="inStockManage"> <div class="inStockManage">
<a-form layout="inline" class="search_form"> <a-form layout="inline" class="search_form">
<a-form-item label="领取状态"> <a-form-item label="领取状态">
<a-select v-model="searchForm.factoryId" placeholder="请选择" style="width: 250px"> <a-select v-model="searchForm.status" placeholder="请选择" style="width: 250px">
<a-select-option value="">全部</a-select-option> <a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in allFactoryInfo" :key="item.id" :value="item.id"> <a-select-option v-for="item in statusList" :key="item.enumValue" :value="item.enumValue">
{{item.factoryName}} {{item.enumName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
...@@ -53,53 +53,53 @@ ...@@ -53,53 +53,53 @@
</div> </div>
</template> </template>
<script> <script>
import {isEmptyParams} from "../../utils/common"; import {getEnumByFlag, isEmptyParams} from "../../utils/common";
import moment from 'moment' import moment from 'moment'
const columns = [ const columns = [
{ {
title: '女方姓名', title: '女方姓名',
dataIndex: 'medicineName', dataIndex: 'womanName',
ellipsis: true ellipsis: true
}, },
{ {
title: '证件类型', title: '证件类型',
dataIndex: 'typeName', dataIndex: 'womenCertificateType',
ellipsis: true ellipsis: true
}, },
{ {
title: '证件号码', title: '证件号码',
width: '120px', width: '120px',
dataIndex: 'factoryName', dataIndex: 'womenIdCard',
ellipsis: true ellipsis: true
}, },
{ {
title: '男方姓名', title: '男方姓名',
dataIndex: 'batchNumber', dataIndex: 'manName',
ellipsis: true ellipsis: true
}, },
{ {
title: '证件类型', title: '证件类型',
dataIndex: 'specs', dataIndex: 'menCertificateType',
ellipsis: true ellipsis: true
}, },
{ {
title: '证件号码', title: '证件号码',
width: '120px', width: '120px',
scopedSlots: {customRender: 'expireDateS'}, dataIndex: 'menIdCard'
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'isHistoryName', dataIndex: 'telephone',
ellipsis: true ellipsis: true
}, },
{ {
title: '领取状态', title: '领取状态',
dataIndex: 'specs', dataIndex: 'statusName',
ellipsis: true ellipsis: true
}, },
{ {
title: '领取日期', title: '领取日期',
dataIndex: 'stockNum', dataIndex: 'provideDate',
ellipsis: true ellipsis: true
}, },
{ {
...@@ -116,11 +116,9 @@ ...@@ -116,11 +116,9 @@
return { return {
// 搜索框对象 // 搜索框对象
searchForm: { searchForm: {
medicalName: '', status: '',
factoryId: '',
produceDate: undefined
}, },
allFactoryInfo: [], statusList: [],
pagination: { pagination: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
...@@ -133,16 +131,11 @@ ...@@ -133,16 +131,11 @@
} }
}, },
created() { created() {
this.statusList = getEnumByFlag('folacin_resident_info_status')
this.getFolviteApplyList() this.getFolviteApplyList()
this.getAllFactory()
}, },
methods: { methods: {
getAllFactory() {
let par = {}
this.$api.common.fetchAllFactory(par).then(({data = []}) => {
this.allFactoryInfo = data
})
},
searchList() { searchList() {
this.pagination.pageIndex = 1 this.pagination.pageIndex = 1
this.getFolviteApplyList() this.getFolviteApplyList()
......
...@@ -20,31 +20,30 @@ ...@@ -20,31 +20,30 @@
<a-button slot="extra">身份证识别</a-button> <a-button slot="extra">身份证识别</a-button>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="姓名" prop="sendContact"> <a-form-model-item label="姓名" prop="womanName">
<a-input placeholder="请输入姓名" v-model="formData.sendContact"></a-input> <a-input placeholder="请输入姓名" v-model="formData.womanName"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="证件类型" prop="sendPhone"> <a-form-model-item label="证件类型" prop="womenCertificateType">
<a-select v-model="formData.receiveUnitId" placeholder="请选择" <a-select v-model="formData.womenCertificateType" placeholder="请选择">
@click.native="getChildUnitList"> <a-select-option v-for="item in certificateTypeList"
<a-select-option v-for="item in childUnitList" :key="item.enumValue" :value="item.enumValue"
:key="item.id" :value="item.id"
> >
{{item.unitName}} {{item.enumName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="证件号码" prop="sendDate"> <a-form-model-item label="证件号码" prop="womenIdCard">
<a-input placeholder="请输入证件号码" v-model="formData.sendContact"></a-input> <a-input placeholder="请输入证件号码" v-model="formData.womenIdCard"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="是否曾经怀孕" prop="receiveUnitId"> <a-form-model-item label="是否曾经怀孕" prop="oncePregnant">
<a-radio-group v-model="formData.sendContact" @change="onChangePregnant"> <a-radio-group v-model="formData.oncePregnant" @change="onChangePregnant">
<a-radio :value="1"> <a-radio :value="1">
</a-radio> </a-radio>
...@@ -55,8 +54,8 @@ ...@@ -55,8 +54,8 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="孕次" prop="sendContact" v-if="womanPregnant"> <a-form-model-item label="孕次" prop="pregnantNum" v-if="womanPregnant">
<a-input v-toInt placeholder="请输入" v-model="formData.sendContact"></a-input> <a-input v-toInt placeholder="请输入" v-model="formData.pregnantNum"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -69,26 +68,26 @@ ...@@ -69,26 +68,26 @@
<a-button slot="extra">身份证识别</a-button> <a-button slot="extra">身份证识别</a-button>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="姓名" prop="sendContact"> <a-form-model-item label="姓名" prop="manName">
<a-input placeholder="请输入姓名" v-model="formData.sendContact"></a-input> <a-input placeholder="请输入姓名" v-model="formData.manName"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="证件类型" prop="sendPhone"> <a-form-model-item label="证件类型" prop="menCertificateType">
<a-select v-model="formData.receiveUnitId" placeholder="请选择" <a-select v-model="formData.menCertificateType" placeholder="请选择"
@click.native="getChildUnitList"> @click.native="getChildUnitList">
<a-select-option v-for="item in childUnitList" <a-select-option v-for="item in certificateTypeList"
:key="item.id" :value="item.id" :key="item.enumValue" :value="item.enumValue"
> >
{{item.unitName}} {{item.enumName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="证件号码" prop="sendDate"> <a-form-model-item label="证件号码" prop="menIdCard">
<a-input placeholder="请输入证件号码" v-model="formData.sendContact"></a-input> <a-input placeholder="请输入证件号码" v-model="formData.menIdCard"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -100,39 +99,38 @@ ...@@ -100,39 +99,38 @@
</div> </div>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="联系电话" prop="sendContact" :labelCol="{span: 3}" <a-form-model-item label="联系电话" prop="telephone" :labelCol="{span: 3}"
:wrapperCol="{span: 8}"> :wrapperCol="{span: 8}">
<a-input placeholder="请输入联系电话" v-model="formData.sendContact"></a-input> <a-input placeholder="请输入联系电话" v-model="formData.telephone"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="现住地址" prop="sendPhone" :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.sendPhone"></a-input> <a-input placeholder="请输入现住地址" v-model="formData.presentCode"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="详细地址" prop="sendDate" :labelCol="{span: 3}" <a-form-model-item label="详细地址" prop="nowAddress" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-input placeholder="请输入详细地址" v-model="formData.sendPhone"></a-input> <a-input placeholder="请输入详细地址" v-model="formData.nowAddress"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="签署方式" prop="receiveUnitId"> <a-form-model-item label="签署方式" prop="signedMode">
<a-select v-model="formData.receiveUnitId" placeholder="请选择" <a-select v-model="formData.signedMode" placeholder="请选择" disabled>
@click.native="getChildUnitList"> <a-select-option v-for="item in signedModeList"
<a-select-option v-for="item in childUnitList" :key="item.enumValue" :value="item.enumValue"
:key="item.id" :value="item.id"
> >
{{item.unitName}} {{item.enumName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="签署日期" prop="sendContact"> <a-form-model-item label="签署日期" prop="parentDate">
<a-date-picker v-model="formData.produceDate" format="YYYY-MM-DD" style="width: 100%"/> <a-date-picker v-model="formData.parentDate" format="YYYY-MM-DD" style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="21" :offset="3"> <a-col :span="21" :offset="3">
...@@ -141,6 +139,11 @@ ...@@ -141,6 +139,11 @@
<div slot="title" style="text-align: center;padding: 10px 0px"> <div slot="title" style="text-align: center;padding: 10px 0px">
<span style="color: #262626;font-size: 14px">知情同意书</span> <span style="color: #262626;font-size: 14px">知情同意书</span>
</div> </div>
<div>
<div v-html="bookHtmlContent.content">
</div>
</div>
</a-card> </a-card>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -171,17 +174,17 @@ ...@@ -171,17 +174,17 @@
<div style="clear: both"></div> <div style="clear: both"></div>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="发放日期" prop="sendContact"> <a-form-model-item label="发放日期" prop="provideDate">
<a-date-picker v-model="formData.produceDate" format="YYYY-MM-DD" style="width: 100%"/> <a-date-picker v-model="formData.provideDate" format="YYYY-MM-DD" style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="发放医生" prop="receiveUnitId"> <a-form-model-item label="发放医生" prop="provideDoctorId">
<a-select v-model="formData.receiveUnitId" placeholder="请选择" @click.native="getChildUnitList"> <a-select v-model="formData.provideDoctorId" placeholder="请选择" @click.native="getChildUnitList">
<a-select-option v-for="item in childUnitList" <a-select-option v-for="item in certificateTypeList"
:key="item.id" :value="item.id" :key="item.enumValue" :value="item.enumValue"
> >
{{item.unitName}} {{item.enumName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
...@@ -228,8 +231,8 @@ ...@@ -228,8 +231,8 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="备注" prop="sendDate" :labelCol="{span: 3}" :wrapperCol="{span: 20}"> <a-form-model-item label="备注" prop="remarks" :labelCol="{span: 3}" :wrapperCol="{span: 20}">
<a-textarea placeholder="请输入备注" v-model="formData.sendPhone" :rows="5"></a-textarea> <a-textarea placeholder="请输入备注" v-model="formData.remarks" :rows="5"></a-textarea>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-form-model> </a-form-model>
...@@ -244,7 +247,7 @@ ...@@ -244,7 +247,7 @@
</template> </template>
<script> <script>
import {checkPhone, closedDetail} from "../../../utils/common"; import {checkPhone, closedDetail, getEnumByFlag} from "../../../utils/common";
import moment from 'moment' import moment from 'moment'
let vm = this let vm = this
...@@ -258,33 +261,70 @@ ...@@ -258,33 +261,70 @@
spinning: false, spinning: false,
// 弹窗内表单 // 弹窗内表单
formData: { formData: {
detailedList: [], womanName: undefined,
sendUnitId: undefined, womenCertificateType: '1',
sendUnitName: undefined, womenIdCard: undefined,
receiveUnitId: undefined, oncePregnant: 1,
sendDate: undefined, pregnantNum: undefined,
sendContact: undefined, manName: undefined,
sendPhone: undefined, menCertificateType: '1',
relationType: undefined, menIdCard: undefined,
purchasePhone: undefined, telephone: undefined,
presentCode: undefined,
nowAddress: undefined,
signedMode: '1',
parentDate: undefined,
provideDate: undefined,
provideDoctorId: undefined,
provideRecordList: [],
remarks: undefined,
}, },
childUnitList: [],
formRules: { formRules: {
sendUnitName: [ womanName: [
{required: true, message: '请选择发货单位'} {required: true, message: '请输入姓名'}
],
womenCertificateType: [
{required: true, message: '请选择证件类型'}
],
womenIdCard: [
{required: true, message: '请输入证件号码'}
],
oncePregnant: [
{required: true, message: '请选择是否曾经怀孕'}
],
pregnantNum: [
{required: true, message: '请输入孕次'}
],
manName: [
{required: true, message: '请输入姓名'}
],
menCertificateType: [
{required: true, message: '请选择证件类型'}
], ],
relationType: [ menIdCard: [
{required: true, message: '请选择出库类型'} {required: true, message: '请输入证件号码'}
], ],
purchasePhone: [ telephone: [
{required: true, message: '请填写收货人电话'}, {required: true, message: '请输入联系电话'},
{validator: checkPhone}, {validator: checkPhone},
], ],
receiveUnitId: [ presentCode: [
{required: true, message: '请选择收货单位'} {required: true, message: '请选择选择现住地址'}
], ],
sendDate: [ nowAddress: [
{required: true, message: '请选择出库日期'} {required: true, message: '请输入详细地址'}
],
signedMode: [
{required: true, message: '请选择签署方式'}
],
parentDate: [
{required: true, message: '请选择签署日期'}
],
provideDate: [
{required: true, message: '请选择发放日期'}
],
provideDoctorId: [
{required: true, message: '请选择发放医生'}
], ],
sendNum: [ sendNum: [
{required: true, message: '请填写分配数量'}, {required: true, message: '请填写分配数量'},
...@@ -301,26 +341,31 @@ ...@@ -301,26 +341,31 @@
}, },
}, },
], ],
sendContact: [ remarks: [
{required: true, message: '请填写发货人'} {required: true, message: '请输入备注'}
],
sendPhone: [
{required: true, message: '请填写联系电话'},
{validator: checkPhone},
], ],
}, },
womanPregnant: false,//是否怀孕 womanPregnant: false,//是否怀孕
options: { options: {
penColor: "#000",//画笔颜色 penColor: "#000",//画笔颜色
}, },
certificateTypeList: [],
signedModeList: [],
bookHtmlContent: ''
} }
}, },
created() { created() {
this.certificateTypeList = getEnumByFlag('folacin_resident_info_certificate_type')
this.signedModeList = getEnumByFlag('folacin_resident_info_signed_mode')
this.getSelectedMedical() this.getSelectedMedical()
this.formData.sendUnitId = this.unitInfo.id this.getBookHtmlContent()
this.formData.sendUnitName = this.unitInfo.unitName
}, },
methods: { methods: {
getBookHtmlContent() {//获取用户知情书模板
this.$api.common.fetchConsentInfo().then(({data}) => {
this.bookHtmlContent = data
})
},
//------签字----------- //------签字-----------
reWrite() { reWrite() {
this.$refs.signaturePad.clearSignature(); this.$refs.signaturePad.clearSignature();
...@@ -422,19 +467,16 @@ ...@@ -422,19 +467,16 @@
}); });
}); });
params.detailedList = detailedList; params.detailedList = detailedList;
this.$api.stockManage.fetchDispatchGoods(params).then(({code}) => { this.$api.folviteDistributionManage.fetchAddFolviteDistribution(params).then(({code}) => {
this.spinning = false; this.spinning = false;
if (code === 'SUCCESS') { if (code === 'SUCCESS') {
this.$message.success('调拨分配成功!'); this.$message.success('发放成功!');
// window.history.go(-1)
this.goBack() this.goBack()
} else {
// this.$message.error('调拨分配失败!')
} }
}); }).catch(() => {
this.spinning = false
})
} }
} else {
return false;
} }
}); });
}, },
......
...@@ -55,22 +55,22 @@ ...@@ -55,22 +55,22 @@
}, },
{ {
title: '姓名', title: '姓名',
dataIndex: 'residentId', dataIndex: 'womanName',
ellipsis: true ellipsis: true
}, },
{ {
title: '证件号码', title: '证件号码',
width: '120px', width: '120px',
dataIndex: 'residentId', dataIndex: 'womenIdCard',
ellipsis: true ellipsis: true
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'residentId', dataIndex: 'telephone',
ellipsis: true ellipsis: true
}, },
{ {
title: '发放数量(瓶)', title: '发放数量',
dataIndex: 'number', dataIndex: 'number',
ellipsis: true ellipsis: true
}, },
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
},*/ },*/
{ {
title: '现住址', title: '现住址',
dataIndex: 'residentId', dataIndex: 'nowAddress',
ellipsis: true ellipsis: true
}, },
{ {
title: '登记人', title: '发放医生',
dataIndex: 'provideDoctorId', dataIndex: 'provideDoctorName',
ellipsis: true ellipsis: true
}, },
{ {
......
...@@ -35,8 +35,15 @@ ...@@ -35,8 +35,15 @@
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="联系地址" <a-form-model-item label="联系地址"
prop="areaCode"> prop="areaCode">
<allAreaSelect v-model="formData.areaCode"></allAreaSelect> <!-- <allAreaSelect v-model="formData.areaCode"></allAreaSelect>
{{formData.areaName}} {{formData.areaName}}-->
<a-cascader v-model="formData.areaCode"
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>
<a-col :span="24"> <a-col :span="24">
...@@ -105,31 +112,67 @@ ...@@ -105,31 +112,67 @@
{required: true, message: '请输入详细地址', trigger: 'change'} {required: true, message: '请输入详细地址', trigger: 'change'}
], ],
}, },
queryParams: {} queryParams: {},
areaInfo: [],
fieldNames: {
label: 'areaName',
value: 'areaCode',
children: 'children'
},
} }
}, },
created() { created() {
this.queryParams = this.$route.query; this.queryParams = this.$route.query;
if (this.queryParams.modeType === "update") { if (this.queryParams.modeType === "update") {
this.$api.common.fetchSupplyById(this.queryParams.id).then(res => { this.$api.common.fetchSupplyById(this.queryParams.id).then(({data, code}) => {
if (res.code === 'SUCCESS') { if (code === 'SUCCESS') {
this.formData = res.data; this.areaInfo = [{areaCode: data.areaCode, areaName: data.areaName}]
const {areaCode, ...others} = data
this.formData = {...others};
this.formData.areaCode = [areaCode]
} }
}).catch(() => { }).catch(() => {
}); });
} else {
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]
}
console.log(this.areaInfo)
})
},
// 弹窗确定按钮 // 弹窗确定按钮
submitForm() { submitForm() {
let vm = this; let vm = this;
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
vm.subLoad = true vm.subLoad = true
const {areaCode, areaName, ...others} = vm.formData
let areaInfo = areaCode[areaCode.length -1]
let par = { let par = {
...vm.formData areaCode: areaInfo,
...others
}; };
if (this.queryParams.modeType === 'add') { if (this.queryParams.modeType === 'add') {
vm.$api.common.fetchAddSupply(par).then(res => { vm.$api.common.fetchAddSupply(par).then(res => {
......
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