Commit 2134568f authored by 罗成兵's avatar 罗成兵

Merge branch 'gcl' of http://gitlab.yiboshi.com/ynby/folacin-front into gcl

 Conflicts:
	.env.dev
	src/views/Home.vue
parents 629aacfb f037cbb7
NODE_ENV = dev NODE_ENV = dev
VUE_APP_BASE_URL1 = http://123.56.183.13:8083 VUE_APP_BASE_URL = http://123.56.183.13:8083
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'
...@@ -45,8 +45,8 @@ export default { ...@@ -45,8 +45,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() {//查询单位的知情同意书
...@@ -57,6 +57,9 @@ export default { ...@@ -57,6 +57,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`)
} }
}, },
...@@ -184,7 +187,13 @@ export default { ...@@ -184,7 +187,13 @@ 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', 'json')
},
fetchFolviteDistributionDetail(params) {//叶酸发放查看详情
return fetch(`/v1/folacin-admin/folacin-resident-info/grant-details/${params.residentId}`)
}, },
}, },
//物资调拨管理 //物资调拨管理
...@@ -229,8 +238,14 @@ export default { ...@@ -229,8 +238,14 @@ 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)
},
delFolviteApplyById(params) {//删除叶酸申请
return fetch(`/v1/folacin-admin/folacin-resident-info/delete/${params.id}`, params, 'delete', 'json');
}, },
addFolviteDistributionByApply(params) {//对申请记录进行发放
return fetch(`/v1/folacin-admin/folacin-resident-info/apply-grant/${params.applyId}`);
}
}, },
fyManage: { fyManage: {
//从妇幼系统获取菜单及用户信息 //从妇幼系统获取菜单及用户信息
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<a-layout> <a-layout>
<a-layout-content class="layout_container" style="background: #fff"> <a-layout-content class="layout_container" style="background: #fff">
<div style="padding: 24px;"> <div style="padding: 24px;">
<a-tabs type="card" :tabBarGutter="10" v-model="$store.state.activeKeyInfo" @change="onChange"> <a-tabs type="card" :tabBarGutter="10" v-model="$store.state.activeKeyInfo" @change="onChange">
<a-tab-pane v-for="(item, index) in $store.state.tabsInfo" :key="item.frontActionUrl"> <a-tab-pane v-for="(item, index) in $store.state.tabsInfo" :key="item.frontActionUrl" >
<span slot="tab"> <span slot="tab">
<span v-if="item.frontActionUrl != '/Home/distributionWarehousing' && item.frontActionUrl != '/Home/folviteApply'" <span v-if="item.frontActionUrl != '/Home/distributionWarehousing' && item.frontActionUrl != '/Home/folviteApply'"
>{{item.name}}</span> >{{item.name}}</span>
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
</span> </span>
<!--<span>{{item.name}}</span>--> <!--<span>{{item.name}}</span>-->
</span> </span>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<router-view></router-view> <router-view></router-view>
</div> </div>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
data() { data() {
return { return {
// 菜单 // 菜单
menuList: [], menuList:[],
// 选中的菜单 // 选中的菜单
activeItem: [], activeItem: [],
// tabs标签 // tabs标签
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
}) })
} else { } else {
console.log('没有token') console.log('没有token')
window.top.postMessage({messageType: "LOGOUT"}, '*')//给最顶层窗口发送token失效通知 window.top.postMessage({messageType:"LOGOUT"}, '*')//给最顶层窗口发送token失效通知
return return
} }
}, },
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
window.sessionStorage.setItem('activeItem', '/Home/inStock') window.sessionStorage.setItem('activeItem', '/Home/inStock')
} }
if (!window.sessionStorage.getItem('activeKey')) { if (!window.sessionStorage.getItem('activeKey')) {
this.$router.push({path: '/Home/inStock'}) this.$router.push({path:'/Home/inStock'})
this.$store.commit('changeActKey', '/Home/inStock') this.$store.commit('changeActKey', '/Home/inStock')
} }
const tabs = JSON.parse(window.sessionStorage.getItem('tabs')); const tabs = JSON.parse(window.sessionStorage.getItem('tabs'));
...@@ -122,29 +122,25 @@ ...@@ -122,29 +122,25 @@
<style lang="less"> <style lang="less">
.index_body { .index_body {
.ant-tabs-bar { .ant-tabs-bar {
border-bottom: 1px solid rgba(255, 77, 128, .2) !important; border-bottom: 1px solid rgba(255,77,128,.2)!important;
} }
.ant-tabs-nav-scroll { .ant-tabs-nav-scroll {
margin-left: 0px !important; margin-left: 0px!important;
} }
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container { .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container {
height: 35px !important; height: 35px!important;
} }
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab { .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab {
height: 35px !important; height: 35px!important;
color: #F8F8FF !important; color: #F8F8FF!important;
line-height: 35px !important; line-height: 35px!important;
background: rgba(255, 77, 128, .5); background: rgba(255,77,128, .5);
border-bottom: 0px solid #FF4D80; border-bottom: 0px solid #FF4D80;
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-top-right-radius: 10px; border-top-right-radius: 10px;
} }
.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active { .ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active {
height: 35px !important; height: 35px!important;
color: #fff; color: #fff;
background: #FF4D80; background: #FF4D80;
border-color: #FF4D80; border-color: #FF4D80;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
ready(editor) { ready(editor) {
//编辑器实例 //编辑器实例
this.UEditor = editor; this.UEditor = editor;
this.$emit('baiduEditorReady', true)
}, },
//获取内容 //获取内容
getContent() { getContent() {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<a-col :span="24"> <a-col :span="24">
<!--label="模板内容"--> <!--label="模板内容"-->
<a-form-model-item prop="content" :wrapper-col="{span: 24}"> <a-form-model-item prop="content" :wrapper-col="{span: 24}">
<baiduEditor ref="baiduEditor" v-model="formData.content"></baiduEditor> <baiduEditor @baiduEditorReady="getEditorreadyed" ref="baiduEditor" v-model="formData.content"></baiduEditor>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -45,21 +45,30 @@ ...@@ -45,21 +45,30 @@
created() { created() {
}, },
mounted() { mounted() {
let vm = this;
this.$api.common.fetchConsentInfo().then(res => {
if (res.code == 'SUCCESS') {
if (isBlank(res.data)) {
this.modeType = 'add';
} else {
vm.$refs.baiduEditor.setContent(res.data.content, false)
this.formData.content = res.data.content;
this.formData.id = res.data.id;
}
}
})
}, },
methods: { methods: {
getEditorreadyed(val) {
if (val) {
this.getEditorContent()
}
},
getEditorContent() {
let vm = this;
this.$api.common.fetchConsentInfo().then(res => {
if (res.code == 'SUCCESS') {
if (isBlank(res.data)) {
this.modeType = 'add';
} else {
// vm.$nextTick(() => {
vm.$refs.baiduEditor.setContent(res.data.content, false)
vm.formData.content = res.data.content;
vm.formData.id = res.data.id;
// })
}
}
})
},
// 弹窗确定按钮 // 弹窗确定按钮
submitForm() { submitForm() {
let vm = this; let vm = this;
......
...@@ -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>
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
{{record.expireDate | formatDate}} {{record.expireDate | formatDate}}
</template> </template>
<template slot="action" slot-scope="record"> <template slot="action" slot-scope="record">
<a-button type="link" size="small" @click="toDetail(record)">发放</a-button> <a-button type="link" size="small" @click="toDetail(record)" :disabled="record.status==0">发放</a-button>
<a-button type="link" size="small" @click="deleteConfirm(record)">删除</a-button> <a-button type="link" size="small" @click="deleteConfirm(record)" :disabled="record.status==0">删除</a-button>
</template> </template>
</a-table> </a-table>
<a-pagination <a-pagination
...@@ -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()
...@@ -194,10 +187,10 @@ ...@@ -194,10 +187,10 @@
let par = { let par = {
id: record.id id: record.id
} }
this.$api.systemManage.deleteRoleOneById(par).then(res => { this.$api.folviteApplyManage.delFolviteApplyById(par).then(res => {
if (res.code === 'SUCCESS') { if (res.code === 'SUCCESS') {
this.pagination.pageIndex = 1; this.pagination.pageIndex = 1;
this.getCondomInfoList() this.searchList()
this.$message.success('删除成功!') this.$message.success('删除成功!')
} }
}) })
...@@ -209,7 +202,11 @@ ...@@ -209,7 +202,11 @@
}); });
}, },
toDetail(record) { toDetail(record) {
this.$router.push({path:'/folviteApply/grant', query: record}) let params = {
...record,
routerFlag: 'update'
}
this.$router.push({path:'/folviteDistribution/add', query: params})
} }
}, },
} }
......
...@@ -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
}) })
......
...@@ -55,23 +55,17 @@ ...@@ -55,23 +55,17 @@
}, },
{ {
title: '姓名', title: '姓名',
dataIndex: 'residentId', dataIndex: 'womanName',
ellipsis: true ellipsis: true
}, },
{ {
title: '证件号码', title: '证件号码',
width: '120px', dataIndex: 'womenIdCard',
dataIndex: 'residentId',
ellipsis: true ellipsis: true
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'residentId', dataIndex: 'telephone',
ellipsis: true
},
{
title: '发放数量(瓶)',
dataIndex: 'number',
ellipsis: true ellipsis: true
}, },
/* { /* {
...@@ -81,12 +75,12 @@ ...@@ -81,12 +75,12 @@
},*/ },*/
{ {
title: '现住址', title: '现住址',
dataIndex: 'residentId', dataIndex: 'nowAddress',
ellipsis: true ellipsis: true
}, },
{ {
title: '登记人', title: '发放医生',
dataIndex: 'provideDoctorId', dataIndex: 'provideDoctorName',
ellipsis: true ellipsis: true
}, },
{ {
...@@ -157,7 +151,7 @@ ...@@ -157,7 +151,7 @@
this.searchList() this.searchList()
}, },
toAdd() { toAdd() {
this.$router.push({path:'/folviteDistribution/add'}) this.$router.push({path:'/folviteDistribution/add', query: {routerFlag: 'add'}})
}, },
toDetail(record) { toDetail(record) {
this.$router.push({path:'/folviteDistribution/detail', query: record}) this.$router.push({path:'/folviteDistribution/detail', query: record})
......
...@@ -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