Commit be966f93 authored by gengchunlei's avatar gengchunlei

在库管理接口对接

parent 313b3b3b
NODE_ENV = dev NODE_ENV = dev
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'
...@@ -28,16 +28,12 @@ export default { ...@@ -28,16 +28,12 @@ export default {
fetchFullAreaNameInfo(params) {//获取地区全名称 fetchFullAreaNameInfo(params) {//获取地区全名称
return fetch(`/basic-info/v1/basic-info/basic-area-info/get-area-code-info/${params.areaCode}`, params) return fetch(`/basic-info/v1/basic-info/basic-area-info/get-area-code-info/${params.areaCode}`, params)
}, },
fetchAllFactory(params) {//获取生产厂家 fetchAllSupply(params) {//获取所有供应商
return fetch('/basic-info/v1/basic-info/basic-factory-info/all', params) return fetch('/v1/folacin-admin/folacin-supplier-info/enable', params)
}, },
fetchAllBatch(params) {//获取批次 fetchAllBatch(params) {//获取批次
return fetch('/basic-info/v1/basic-info/basic-batch-info/all', params) return fetch('/basic-info/v1/basic-info/basic-batch-info/all', params)
}, },
fetchAllSupply(params) {//获取所有供应商
return fetch('/basic-info/v1/basic-info/basic-supply-info/all', params)
},
fetchUploadImg(params) {//上传图片 fetchUploadImg(params) {//上传图片
return fetch('/basic-info/v1/basic-info/basic-pictures-info/pictures', params, 'post') return fetch('/basic-info/v1/basic-info/basic-pictures-info/pictures', params, 'post')
}, },
...@@ -65,6 +61,9 @@ export default { ...@@ -65,6 +61,9 @@ export default {
fetchDispenserTypeByFactory(params) { // 根据发放机厂家查询机器类型 fetchDispenserTypeByFactory(params) { // 根据发放机厂家查询机器类型
return fetch('/basic-info/v1/basic-info/basic-machine-type-info/query-by-factory-id', params) return fetch('/basic-info/v1/basic-info/basic-machine-type-info/query-by-factory-id', params)
}, },
fetchMaterialDisUnitInfo(params) {//获取物资分配下拉
return fetch('/v1/folacin-admin/folacin-send-record/send-record', params)
}
}, },
//首页接口 //首页接口
homeManage: { homeManage: {
...@@ -170,10 +169,10 @@ export default { ...@@ -170,10 +169,10 @@ export default {
stockManage: { stockManage: {
/*在库管理*/ /*在库管理*/
fetchInStockList(params) {//在库管理列表 fetchInStockList(params) {//在库管理列表
return fetch('/stock-info/v1/stock-info/stock-basic-info/basic-info', params) return fetch('/v1/folacin-admin/folacin-stock-record', params)
}, },
fetchInStockLisDetail(params) {//在库管理详情 fetchInStockDetail(params) {//在库管理详情
return fetch(`/stock-info/v1/stock-info/stock-basic-info/${params.id}`, params) return fetch(`/v1/folacin-admin/folacin-stock-record/${params.id}`, params)
}, },
fetchMedicineByType(params) {//根据药具品类获取药具 fetchMedicineByType(params) {//根据药具品类获取药具
return fetch('/basic-info/v1/basic-info/basic-medical-info/query-breed', params) return fetch('/basic-info/v1/basic-info/basic-medical-info/query-breed', params)
...@@ -185,10 +184,10 @@ export default { ...@@ -185,10 +184,10 @@ export default {
return fetch('/basic-info/v1/basic-info/basic-batch-info/breed-medical', params) return fetch('/basic-info/v1/basic-info/basic-batch-info/breed-medical', params)
}, },
addHistoryStock(params) {//在库管理-历史库存录入 addHistoryStock(params) {//在库管理-历史库存录入
return fetch('/stock-info/v1/stock-info/stock-basic-info/history-stock-input', params, 'post', 'json') return fetch('/v1/folacin-admin/folacin-purchase-record', params, 'post', 'json')
}, },
fetchMedicalListByIds(params) { fetchMedicalListByIds(params) {
return fetch(`/stock-info/v1/stock-info/stock-basic-info/query-ids/${params.idList}`, params) return fetch(`/v1/folacin-admin/folacin-stock-record/query-ids`, params)
}, },
/*入库管理*/ /*入库管理*/
...@@ -209,7 +208,7 @@ export default { ...@@ -209,7 +208,7 @@ export default {
return fetch('/stock-info/v1/stock-info/stock-send-record', params); return fetch('/stock-info/v1/stock-info/stock-send-record', params);
}, },
fetchDispatchGoods(params) {//分配物资 fetchDispatchGoods(params) {//分配物资
return fetch('/stock-info/v1/stock-info/stock-send-record', params, 'post', 'json'); return fetch('/v1/folacin-admin/folacin-send-record', params, 'post', 'json');
}, },
fetchDispatchdeGoods(params) {//获取在库信息 fetchDispatchdeGoods(params) {//获取在库信息
return fetch('/stock-info/v1/stock-info/stock-basic-info/basic-info', params); return fetch('/stock-info/v1/stock-info/stock-basic-info/basic-info', params);
...@@ -614,7 +613,7 @@ export default { ...@@ -614,7 +613,7 @@ export default {
fyManage: { fyManage: {
//从妇幼系统获取菜单及用户信息 //从妇幼系统获取菜单及用户信息
fetchFYLoginUser(params) { fetchFYLoginUser(params) {
return fetch('/basic-info/v1/basic-info/fy/get-menu-and-user', params); return fetch('/v1/folacin-admin/sys-login/getLoginInfo', params);
}, },
}, },
//常用工具 //常用工具
......
<template> <template>
<a-layout class="home_layout index_body" style="width: 100%"> <a-layout class="home_layout index_body" style="width: 100%">
<a-layout> <a-layout>
<a-layout-content class="layout_container"> <a-layout-content class="layout_container" style="background: #fff">
<a-card> <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">
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<router-view></router-view> <router-view></router-view>
</a-card> </div>
</a-layout-content> </a-layout-content>
<div style="clear: both"></div> <div style="clear: both"></div>
...@@ -56,17 +55,15 @@ ...@@ -56,17 +55,15 @@
created() { created() {
//获取妇幼权限和登录基本信息 //获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市 // document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市
document.cookie = 'bGNnd3lwdF9hdA=d12537dd-b03f-4d61-8fee-29bcb09081b0;'//云南省 document.cookie = 'bGNnd3lwdF9hdA=e3f0d190-7544-495a-a299-c575d4c51e5f;'//云南省
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);
let par = {} let par = {}
this.$api.fyManage.fetchFYLoginUser(par).then(({data}) => { this.$api.fyManage.fetchFYLoginUser(par).then(({data}) => {
window.sessionStorage.setItem('menuList', JSON.stringify(data.menuList)); // window.sessionStorage.setItem('menuList', JSON.stringify(data.menuList));
window.sessionStorage.setItem('userInfo', JSON.stringify(data.userInfo)); window.sessionStorage.setItem('userInfo', JSON.stringify(data.userInfo));
window.sessionStorage.setItem('networkInfo', JSON.stringify(data.orgInfo)); window.sessionStorage.setItem('allEnum', JSON.stringify(data.enumValueList))
// window.sessionStorage.setItem('activeItem', '/Home/inStock');
// this.getAllEnum()
this.setInitMenuInfo() this.setInitMenuInfo()
this.showChildren = true this.showChildren = true
}) })
...@@ -77,17 +74,9 @@ ...@@ -77,17 +74,9 @@
} }
}, },
methods: { methods: {
getAllEnum() {
let par= {}
this.$api.common.fetchAllEnum(par).then(({data, code}) => {
if (code == 'SUCCESS') {
window.sessionStorage.setItem('allEnum', JSON.stringify(data))
}
})
},
setInitMenuInfo() {//设置默认菜单和菜单缓存 setInitMenuInfo() {//设置默认菜单和菜单缓存
this.menuList = JSON.parse(window.sessionStorage.getItem('menuList')); // this.menuList = JSON.parse(window.sessionStorage.getItem('menuList'));
// this.menuList = this.menuTest this.menuList = this.menuTest
if (!window.sessionStorage.getItem("tabs")) { if (!window.sessionStorage.getItem("tabs")) {
window.sessionStorage.setItem('tabs', JSON.stringify(this.menuTest)); window.sessionStorage.setItem('tabs', JSON.stringify(this.menuTest));
this.$store.commit('changeTabs', this.menuTest) this.$store.commit('changeTabs', this.menuTest)
......
...@@ -219,10 +219,10 @@ ...@@ -219,10 +219,10 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
.search_form { /*.search_form {
margin-top: -17px; margin-top: -17px;
border: 1px solid rgba(255,77,128, .2); border: 1px solid rgba(255,77,128, .2);
border-top: 0px; border-top: 0px;
padding: 30px; padding: 30px;
} }*/
</style> </style>
...@@ -242,10 +242,10 @@ ...@@ -242,10 +242,10 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
.search_form { /* .search_form {
margin-top: -17px; margin-top: -17px;
border: 1px solid rgba(255,77,128, .2); border: 1px solid rgba(255,77,128, .2);
border-top: 0px; border-top: 0px;
padding: 30px; padding: 30px;
} }*/
</style> </style>
...@@ -180,10 +180,10 @@ ...@@ -180,10 +180,10 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
.search_form { /* .search_form {
margin-top: -16px; margin-top: -16px;
border: 1px solid rgba(255,77,128, .2); border: 1px solid rgba(255,77,128, .2);
border-top: 0px; border-top: 0px;
padding: 30px; padding: 30px;
} }*/
</style> </style>
<template> <template>
<div> <div class="addMaterialDistribution">
<a-spin tip="加载中..." :spinning="spinning"> <a-spin tip="加载中..." :spinning="spinning">
<a-card> <a-card>
<div style="font-size: 18px;font-weight: 600"> <div style="font-size: 18px;font-weight: 600">
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item label="收货人" prop="sendContact"> <a-form-model-item label="收货人" prop="receiver">
<a-input placeholder="请填写收货人" v-model="formData.sendContact"></a-input> <a-input placeholder="请填写收货人" v-model="formData.receiver"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item label="收货人电话" prop="purchasePhone"> <a-form-model-item label="收货人电话" prop="receivePhone">
<a-input placeholder="请填写收货人电话" v-model="formData.purchasePhone"></a-input> <a-input placeholder="请填写收货人电话" v-model="formData.receivePhone"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
</a-divider> </a-divider>
</div> </div>
<a-table :dataSource="formData.detailedList" rowKey="id" :pagination="false" class="modal_table" bordered> <a-table :dataSource="formData.detailedList" rowKey="id" :pagination="false" class="modal_table" bordered>
<a-table-column title="品牌" data-index="typeName" ></a-table-column> <a-table-column title="品牌" data-index="brandName" ></a-table-column>
<a-table-column title="供应商名称" data-index="factoryName" ></a-table-column> <a-table-column title="供应商名称" data-index="supplierName" ></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'" :rules="formRules.sendNum" class="tab_input_r"> <a-form-model-item :prop="'detailedList.' + index + '.sendNum'" :rules="formRules.sendNum" class="tab_input_r">
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</a-form-model> </a-form-model>
<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" @click="addMaterialDis" :loading="subLoad" style="margin-left: 8px">调拨分配</a-button>
</div> </div>
</a-card> </a-card>
</a-spin> </a-spin>
...@@ -111,9 +111,10 @@ ...@@ -111,9 +111,10 @@
export default { export default {
data() { data() {
return { return {
unitInfo: JSON.parse(window.sessionStorage.getItem('networkInfo')), unitInfo: JSON.parse(window.sessionStorage.getItem('userInfo')),
routerParams: [], routerParams: [],
spinning: false, spinning: false,
subLoad: false,
// 弹窗内表单 // 弹窗内表单
formData: { formData: {
detailedList: [], detailedList: [],
...@@ -123,18 +124,15 @@ ...@@ -123,18 +124,15 @@
sendDate: undefined, sendDate: undefined,
sendContact: undefined, sendContact: undefined,
sendPhone: undefined, sendPhone: undefined,
relationType: undefined, receivePhone: undefined,
purchasePhone: undefined, receiver: undefined
}, },
childUnitList: [], childUnitList: [],
formRules: { formRules: {
sendUnitName: [ sendUnitName: [
{required: true, message: '请选择发货单位'} {required: true, message: '请选择发货单位'}
], ],
relationType: [ receivePhone: [
{required: true, message: '请选择出库类型'}
],
purchasePhone: [
{required: true, message: '请填写收货人电话'}, {required: true, message: '请填写收货人电话'},
{validator: checkPhone}, {validator: checkPhone},
], ],
...@@ -142,7 +140,7 @@ ...@@ -142,7 +140,7 @@
{required: true, message: '请选择收货单位'} {required: true, message: '请选择收货单位'}
], ],
sendDate: [ sendDate: [
{required: true, message: '请选择出库日期'} {required: true, message: '请选择发货日期'}
], ],
sendNum: [ sendNum: [
{required: true, message: '请填写分配数量'}, {required: true, message: '请填写分配数量'},
...@@ -151,7 +149,7 @@ ...@@ -151,7 +149,7 @@
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('超出当前库存!'));
...@@ -162,17 +160,19 @@ ...@@ -162,17 +160,19 @@
sendContact: [ sendContact: [
{required: true, message: '请填写发货人'} {required: true, message: '请填写发货人'}
], ],
receiver: [
{required: true, message: '请填写收货人'}
],
sendPhone: [ sendPhone: [
{required: true, message: '请填写联系电话'}, {required: true, message: '请填写联系电话'},
{validator: checkPhone}, {validator: checkPhone},
], ],
}, },
// changeRecordInfo: {}//更改分配数量的record信息
} }
}, },
created() { created() {
this.getSelectedMedical() this.getSelectedMedical()
this.formData.sendUnitId = this.unitInfo.id this.formData.sendUnitId = this.unitInfo.unitId
this.formData.sendUnitName = this.unitInfo.unitName this.formData.sendUnitName = this.unitInfo.unitName
}, },
methods: { methods: {
...@@ -195,29 +195,13 @@ ...@@ -195,29 +195,13 @@
}, },
// 获取当前单位的下级单位 // 获取当前单位的下级单位
getChildUnitList() { getChildUnitList() {
if (this.formData.relationType == 11) { let params = {}
let par = { this.childUnitList = [{id:1, unitName:'gcl'}]
areaCode: JSON.parse(window.sessionStorage.getItem('networkInfo')).areaCode, // this.$api.common.fetchMaterialDisUnitInfo(params).then(({code, data}) => {
} // if (code === 'SUCCESS') {
this.$api.networkManage.fetchNetworkListByAreaCode(par).then(({code, data}) => { // this.childUnitList = data;
if (code === 'SUCCESS') { // }
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() {//调拨分配
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
...@@ -225,62 +209,32 @@ ...@@ -225,62 +209,32 @@
if (this.formData.detailedList.length === 0) { if (this.formData.detailedList.length === 0) {
this.$message.warning('分配物资不能为空!'); this.$message.warning('分配物资不能为空!');
} else { } else {
this.spinning = true; this.subLoad = true;
let reviceUnitName = undefined
let receiveNetworkId = undefined
let receiveNetworkName = undefined
let params = {} let params = {}
if (this.formData.relationType == 11) { let reviceUnitName = this.childUnitList.filter(item => item.id == this.formData.receiveUnitId)[0].unitName
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 = { params = {
...this.formData, ...this.formData,
sendDate: moment(this.formData.sendDate).format('yyyy-MM-DD'), sendDate: moment(this.formData.sendDate).format('yyyy-MM-DD'),
purchaseUnitId: this.formData.receiveUnitId,
purchaseUnitName: reviceUnitName,
receiveUnitName: reviceUnitName receiveUnitName: reviceUnitName
}; };
}
let detailedList = []; let detailedList = [];
this.formData.detailedList.forEach(item => { this.formData.detailedList.forEach(item => {
detailedList.push({ detailedList.push({
medicalId: item.medicalId, ...item,
breedId: item.breedId, stockId: item.id
batchId: item.batchId,
batchNumber: item.batchNumber,
produceDate: item.produceDate,
expireDate: item.expireDate,
sendNum: item.sendNum,
matSpecs:item.specs
}); });
}); });
params.detailedList = detailedList; params.detailedList = detailedList;
this.$api.stockManage.fetchDispatchGoods(params).then(({code}) => { this.$api.stockManage.fetchDispatchGoods(params).then(({code}) => {
this.spinning = false; this.subLoad = 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.subLoad = false;
})
} }
} else {
return false;
} }
}); });
}, },
...@@ -291,6 +245,10 @@ ...@@ -291,6 +245,10 @@
} }
</script> </script>
<style scoped> <style lang="less">
.addMaterialDistribution {
.ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 10px!important;
}
}
</style> </style>
...@@ -11,32 +11,33 @@ ...@@ -11,32 +11,33 @@
> >
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="供应商" prop="medicalId"> <a-form-model-item label="供应商" prop="supplierId">
<a-select v-model="formData.medicalId" <a-select v-model="formData.supplierId"
placeholder="请选择" placeholder="请选择"
:dropdownMatchSelectWidth="false" :dropdownMatchSelectWidth="false"
@click.native="getAllSupply"
> >
<a-select-option v-for="item in medicalNameList" :key="item.id" <a-select-option v-for="item in allSupplyInfo" :key="item.id"
:value="item.id">{{item.medicineName}} :value="item.id">{{item.supplierName}}
</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="medicalId"> <a-form-model-item label="品牌" prop="brandId">
<a-select v-model="formData.medicalId" <a-select v-model="formData.brandId"
placeholder="品牌名称" placeholder="品牌名称"
:dropdownMatchSelectWidth="false" :dropdownMatchSelectWidth="false"
> >
<a-select-option v-for="item in medicalNameList" :key="item.id" <a-select-option v-for="item in brandNameList" :key="item.enumValue"
:value="item.id">{{item.medicineName}} :value="item.enumValue">{{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="batchId"> <a-form-model-item label="批次号" prop="batchNumber">
<a-input v-model="formData.stockNum" <a-input v-model="formData.batchNumber"
placeholder="请输入批次号"></a-input> placeholder="请输入批次号"></a-input>
</a-form-model-item> </a-form-model-item>
...@@ -62,39 +63,49 @@ ...@@ -62,39 +63,49 @@
</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="expireDate"> <a-form-model-item label="采购日期" prop="purchDate">
<a-date-picker v-model="formData.expireDate" format="YYYY-MM-DD" style="width: 100%" <a-date-picker v-model="formData.purchDate" 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="stockNum"> <a-form-model-item label="数量" prop="number">
<a-input v-toInt <a-input v-toInt
v-model="formData.stockNum" v-model="formData.number"
placeholder="请输入数量"></a-input> placeholder="请输入数量">
<a-select slot="addonAfter" v-model="formData.specs" default-value="瓶" style="width: 60px">
<a-select-option value="瓶">
</a-select-option>
<a-select-option value="盒">
</a-select-option>
</a-select>
</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="expireDate"> <a-form-model-item label="入库时间" prop="enterDate">
<a-date-picker v-model="formData.expireDate" format="YYYY-MM-DD" style="width: 100%" <a-date-picker v-model="formData.enterDate" 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="stockNum"> <a-form-model-item label="入库经手人" prop="handler">
<a-input <a-input
v-model="formData.stockNum" v-model="formData.handler"
placeholder="请输入入库经手人"></a-input> placeholder="请输入入库经手人"></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="备注" <a-form-model-item label="备注"
prop="stockNum" prop="remarks"
:labelCol="{span: 3}" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-textarea <a-textarea
:rows="6" :rows="6"
v-model="formData.stockNum" v-model="formData.remarks"
placeholder="请输入备注"></a-textarea> placeholder="请输入备注"></a-textarea>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -103,72 +114,72 @@ ...@@ -103,72 +114,72 @@
</div> </div>
<div style="text-align: center"> <div style="text-align: center">
<a-button class="search_btn btn_space" @click="goBack">取消</a-button> <a-button class="search_btn btn_space" @click="goBack">取消</a-button>
<a-button type="primary" class="search_btn btn_space" style="margin-left: 10px" @click="submitForm">库存录入</a-button> <a-button type="primary" class="search_btn btn_space" :loading="subLoad" style="margin-left: 10px" @click="submitForm">库存录入</a-button>
</div> </div>
</a-card> </a-card>
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import {closedDetail} from "../../../utils/common"; import {closedDetail, getEnumByFlag} from "../../../utils/common";
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
medicalNameList: [], brandNameList: [],
medicalFatoryList: [], subLoad:false,
productionBatch: [],
// form表单 // form表单
formData: { formData: {
breedId: undefined, brandId: undefined,
batchNumber: undefined, batchNumber: undefined,
medicalId: undefined, supplierId: undefined,
factoryId: undefined,
supplyName: undefined,
classify: undefined,
unitPrice: undefined, unitPrice: undefined,
batchId: undefined,
produceDate: undefined, produceDate: undefined,
expireDate: undefined, expireDate: undefined,
stockNum: undefined purchDate: undefined,
enterDate:undefined,
handler: undefined,
number: undefined,
specs: '瓶',
remarks: undefined
}, },
formRules: { formRules: {
breedId: [ brandId: [
{required: true, message: '请选择分类', trigger: 'change'} {required: true, message: '请选择品牌'}
], ],
batchNumber:[ batchNumber:[
{required: true, message: '请选择分类', trigger: 'change'} {required: true, message: '请输入批次号'}
],
classify: [
{required: true, message: '请选择入库类型', trigger: 'change'}
],
medicalId: [
{required: true, message: '请选择品种名称', trigger: 'change'}
], ],
factoryId: [ supplierId: [
{required: true, message: '请选择生产厂家', trigger: 'change'} {required: true, message: '请选择供应商'}
], ],
batchId: [ number: [
{required: true, message: '请输入生产批次', trigger: 'change'} {required: true, message: '请输入数量'}
],
stockNum: [
{required: true, message: '请输入药具数量', trigger: 'change'}
], ],
produceDate: [ produceDate: [
{required: true, message: '请选择日期', trigger: 'change'} {required: true, message: '请选择日期'}
], ],
expireDate: [ expireDate: [
{required: true, message: '请选择日期', trigger: 'change'} {required: true, message: '请选择日期'}
],
purchDate: [
{required: true, message: '请选择日期'}
],
enterDate: [
{required: true, message: '请选择日期'}
], ],
unitPrice: [ unitPrice: [
{required: true, message: '请输入单价'} {required: true, message: '请输入单价'}
], ],
remarks:[
{required: false, message: '请输入备注'}
],
}, },
allSupplyInfo:[] allSupplyInfo:[]
} }
}, },
created() { created() {
this.brandNameList = getEnumByFlag('folacin_stock_record_brand_id')
}, },
methods: { methods: {
getAllSupply() { getAllSupply() {
...@@ -177,43 +188,29 @@ ...@@ -177,43 +188,29 @@
this.allSupplyInfo = data this.allSupplyInfo = data
}) })
}, },
getAllBatch() {
this.productionBatch = []
if (this.formData.medicalId) {
let par = {
idList:[this.formData.medicalId]
}
this.$api.common.fetchBatchNumberByMedicalId(par).then(({data = []}) => {
this.productionBatch = data
})
}
},
// 弹窗确定按钮 // 弹窗确定按钮
submitForm() { submitForm() {
let vm = this let vm = this
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
this.subLoad = true
let pars = {} let pars = {}
Object.assign(pars, vm.formData) Object.assign(pars, vm.formData)
pars['company'] = JSON.parse(vm.formData.factoryId).factoryName pars.produceDate = moment(vm.formData.produceDate).format('YYYY-MM-DD')
pars['companyId'] = JSON.parse(vm.formData.factoryId).id pars.expireDate = moment(vm.formData.expireDate).format('YYYY-MM-DD')
pars['batchNumber'] = JSON.parse(vm.formData.batchId).batchNumber pars.purchDate = moment(vm.formData.purchDate).format('YYYY-MM-DD')
pars['batchId'] = JSON.parse(vm.formData.batchId).id pars.enterDate = moment(vm.formData.enterDate).format('YYYY-MM-DD')
pars.produceDate = moment(vm.formData.produceDate).format('YYYY-MM-DD 00:00:00')
pars.expireDate = moment(vm.formData.expireDate).format('YYYY-MM-DD 00:00:00')
pars['isHistory'] = 1
const {factoryId, ...others} = pars
let par = { let par = {
...others ...pars
} }
this.spinning = true;
vm.$api.stockManage.addHistoryStock(par).then(res => { vm.$api.stockManage.addHistoryStock(par).then(res => {
this.spinning = false;
if (res.code === 'SUCCESS') { if (res.code === 'SUCCESS') {
vm.subLoad = false
vm.$message.success('录入成功!') vm.$message.success('录入成功!')
vm.goBack() vm.goBack()
} }
}).catch(() => {
vm.subLoad = false
}) })
} }
}); });
......
<template> <template>
<div> <div style="padding: 24px">
<a-card>
<div> <div>
<div> <div>
<span style="font-size: 18px;font-weight: 600;"> 药具详情</span> <span style="font-size: 18px;font-weight: 600;"> 药具详情</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<div style="margin-top: 16px"> <div style="margin-top: 16px">
<a-descriptions bordered :column="{ sm: 2, xs: 1 }"> <a-descriptions bordered :column="{ sm: 2, xs: 1 }">
<a-descriptions-item label="供应商"> <a-descriptions-item label="供应商">
{{detailInfo.medicalName || '--'}} {{detailInfo.supplierName || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="品牌"> <a-descriptions-item label="品牌">
{{detailInfo.breedName || '--'}} {{detailInfo.breedName || '--'}}
...@@ -17,26 +16,26 @@ ...@@ -17,26 +16,26 @@
{{detailInfo.batchNumber || '--'}} {{detailInfo.batchNumber || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="生产日期"> <a-descriptions-item label="生产日期">
{{detailInfo.expireDate || '--'}} {{detailInfo.produceDate || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="有效期至"> <a-descriptions-item label="有效期至">
{{detailInfo.expireDate || '--'}} {{detailInfo.expireDate || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="单价"> <a-descriptions-item label="单价">
{{detailInfo.unit || '--'}}<span></span> {{detailInfo.unitPrice || '--'}}<span></span>
</a-descriptions-item>
<a-descriptions-item label="数量">
{{detailInfo.unit || '--'}}
</a-descriptions-item> </a-descriptions-item>
<!-- <a-descriptions-item label="数量">
{{detailInfo.number || '&#45;&#45;'}}
</a-descriptions-item>-->
<a-descriptions-item label="规格"> <a-descriptions-item label="规格">
{{detailInfo.specs || '--'}} {{detailInfo.specs || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="库存总数"> <a-descriptions-item label="库存总数">
{{detailInfo.stockNum || '--'}} {{detailInfo.number || '--'}}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="入库时间"> <a-descriptions-item label="入库时间">
{{detailInfo.stockNum || '--'}} {{detailInfo.created || '--'}}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
...@@ -44,7 +43,6 @@ ...@@ -44,7 +43,6 @@
<div style="text-align: center;margin-top: 40px"> <div style="text-align: center;margin-top: 40px">
<a-button @click="goBack">关闭</a-button> <a-button @click="goBack">关闭</a-button>
</div> </div>
</a-card>
</div> </div>
</template> </template>
<script> <script>
...@@ -67,7 +65,7 @@ ...@@ -67,7 +65,7 @@
let par = { let par = {
id: this.routerParams.id id: this.routerParams.id
} }
this.$api.stockManage.fetchInStockLisDetail(par).then(({data = [], code}) => { this.$api.stockManage.fetchInStockDetail(par).then(({data = [], code}) => {
this.detailInfo = data this.detailInfo = data
}) })
}, },
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<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.supplierId" 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 allSupplyInfo" :key="item.id" :value="item.id">
{{item.factoryName}} {{item.supplierName}}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="品牌"> <a-form-item label="品牌">
<!--v-price="{digit:4}"--> <!--v-price="{digit:4}"-->
<a-input v-model="searchForm.medicalName" placeholder="请输入品牌" style="width: 250px"></a-input> <a-input v-model="searchForm.brandName" placeholder="请输入品牌" style="width: 250px"></a-input>
</a-form-item> </a-form-item>
<a-form-item label="入库日期"> <a-form-item label="入库日期">
<a-date-picker v-model="searchForm.produceDate" format="YYYY-MM-DD" style="width: 250px" <a-date-picker v-model="searchForm.enterDate" format="YYYY-MM-DD" style="width: 250px"
/> />
</a-form-item> </a-form-item>
<a-button class="search_btn" style="float: right;margin-left: 10px" @click="restSearchForm">清空</a-button> <a-button class="search_btn" style="float: right;margin-left: 10px" @click="restSearchForm">清空</a-button>
...@@ -22,6 +22,34 @@ ...@@ -22,6 +22,34 @@
<div style="clear: both"></div> <div style="clear: both"></div>
</a-form> </a-form>
<div style="clear: both"></div>
<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>
<div style="margin-top: 16px;margin-bottom: 10px"> <div style="margin-top: 16px;margin-bottom: 10px">
<a-button type="primary" class="search_btn btn_space" @click="openModal">库存录入</a-button> <a-button type="primary" class="search_btn btn_space" @click="openModal">库存录入</a-button>
<a-button type="primary" class="search_btn btn_space" :disabled="selectedRowKeys.length <= 0" @click="toAdd">调拨分配</a-button> <a-button type="primary" class="search_btn btn_space" :disabled="selectedRowKeys.length <= 0" @click="toAdd">调拨分配</a-button>
...@@ -36,7 +64,9 @@ ...@@ -36,7 +64,9 @@
:pagination="false" :pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
> >
<template slot="produceDateS" slot-scope="record">
{{record.produceDate | formatDate}}
</template>
<template slot="expireDateS" slot-scope="record"> <template slot="expireDateS" slot-scope="record">
{{record.expireDate | formatDate}} {{record.expireDate | formatDate}}
</template> </template>
...@@ -65,29 +95,24 @@ ...@@ -65,29 +95,24 @@
const columns = [ const columns = [
{ {
title: '品牌', title: '品牌',
dataIndex: 'medicineName', dataIndex: 'brandName',
ellipsis: true ellipsis: true
}, },
{ {
title: '供应商名称', title: '供应商名称',
dataIndex: 'typeName', dataIndex: 'supplierName',
ellipsis: true ellipsis: true
}, },
{ {
title: '批次号', title: '批次号',
width: '120px', width: '120px',
dataIndex: 'factoryName',
ellipsis: true
},
{
title: '生产批次',
dataIndex: 'batchNumber', dataIndex: 'batchNumber',
ellipsis: true ellipsis: true
}, },
{ {
title: '生产日期', title: '生产日期',
dataIndex: 'specs', // dataIndex: 'produceDate',
ellipsis: true scopedSlots: {customRender: 'produceDateS'},
}, },
{ {
title: '有效期', title: '有效期',
...@@ -96,7 +121,7 @@ ...@@ -96,7 +121,7 @@
}, },
{ {
title: '单价(元)', title: '单价(元)',
dataIndex: 'isHistoryName', dataIndex: 'unitPrice',
ellipsis: true ellipsis: true
}, },
{ {
...@@ -106,12 +131,12 @@ ...@@ -106,12 +131,12 @@
}, },
{ {
title: '库存总数', title: '库存总数',
dataIndex: 'stockNum', dataIndex: 'number',
ellipsis: true ellipsis: true
}, },
{ {
title: '入库日期', title: '入库日期',
dataIndex: 'isHistoryName', dataIndex: 'enterDate',
ellipsis: true ellipsis: true
}, },
{ {
...@@ -126,12 +151,10 @@ ...@@ -126,12 +151,10 @@
return { return {
// 搜索框对象 // 搜索框对象
searchForm: { searchForm: {
breedId: undefined, brandName: '',
medicalName: '', supplierId: '',
factoryId: '', enterDate: undefined
produceDate: undefined
}, },
allFactoryInfo: [],
pagination: { pagination: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
...@@ -142,12 +165,14 @@ ...@@ -142,12 +165,14 @@
tableData: [], tableData: [],
loading: false, loading: false,
allSupplyInfo:[], allSupplyInfo:[],
selectedRowKeys:[] selectedRowKeys:[],
selectedVisible: false,
selectedRowList:[],
} }
}, },
created() { created() {
this.getInStockList() this.getInStockList()
this.getAllFactory() this.getAllSupply()
}, },
methods: { methods: {
getAllSupply() { getAllSupply() {
...@@ -156,12 +181,6 @@ ...@@ -156,12 +181,6 @@
this.allSupplyInfo = data this.allSupplyInfo = data
}) })
}, },
getAllFactory() {
let par = {}
this.$api.common.fetchAllFactory(par).then(({data = []}) => {
this.allFactoryInfo = data
})
},
searchList() { searchList() {
this.pagination.pageIndex = 1 this.pagination.pageIndex = 1
this.getInStockList() this.getInStockList()
...@@ -179,7 +198,7 @@ ...@@ -179,7 +198,7 @@
this.tableData = dataList this.tableData = dataList
this.pagination.total = total this.pagination.total = total
this.loading = false this.loading = false
}).finally(() => { }).catch(() => {
this.loading = false this.loading = false
}) })
}, },
...@@ -194,12 +213,32 @@ ...@@ -194,12 +213,32 @@
this.pagination.pageSize = pageSize; this.pagination.pageSize = pageSize;
this.getInStockList() 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() { restSearchForm() {
this.searchForm = { this.searchForm = {
breedId: undefined, brandName: '',
medicalName: '', supplierId: '',
factoryId: '', enterDate: undefined
produceDate: undefined
} }
this.searchList() this.searchList()
}, },
...@@ -234,10 +273,10 @@ ...@@ -234,10 +273,10 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
.search_form { /* .search_form {
margin-top: -17px; margin-top: -17px;
border: 1px solid rgba(255,77,128, .2); border: 1px solid rgba(255,77,128, .2);
border-top: 0px; border-top: 0px;
padding: 30px; padding: 30px;
} }*/
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div> <div>
<span style="font-size: 16px;font-weight: bold">添加供应商</span> <span style="font-size: 16px;font-weight: bold">添加供应商</span>
</div> </div>
<div style="width:85%;margin: 0 auto;margin-top: 20px"> <div style="width:75%;margin: 0 auto;margin-top: 20px">
<a-form-model ref="formRef" :model="formData" :rules="formRules" <a-form-model ref="formRef" :model="formData" :rules="formRules"
:labelCol="{span: 6}" :labelCol="{span: 6}"
:wrapperCol="{span: 16}" :wrapperCol="{span: 16}"
...@@ -12,32 +12,32 @@ ...@@ -12,32 +12,32 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="供应商名称" <a-form-model-item label="供应商名称"
prop="medicalId" prop="supplierName"
:labelCol="{span: 3}" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-input v-model="formData.stockNum" <a-input v-model="formData.supplierName"
placeholder="请输入供应商名称"></a-input> placeholder="请输入供应商名称"></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="medicalId"> <a-form-model-item label="联系人" prop="contactsName">
<a-input v-model="formData.stockNum" <a-input v-model="formData.contactsName"
placeholder="请输入联系人"></a-input> placeholder="请输入联系人"></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="batchId"> <a-form-model-item label="联系人电话" prop="contactsPhone">
<a-input v-model="formData.stockNum" <a-input v-model="formData.contactsPhone"
placeholder="请输入联系人电话"></a-input> placeholder="请输入联系人电话"></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="联系地址" <a-form-model-item label="联系地址"
prop="batchId" prop="address"
:labelCol="{span: 3}" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-input v-model="formData.stockNum" <a-input v-model="formData.address"
placeholder="请输入联系地址"></a-input> placeholder="请输入联系地址"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="备注" <a-form-model-item label="备注"
prop="stockNum" prop="remarks"
:labelCol="{span: 3}" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-textarea <a-textarea
:rows="6" :rows="6"
v-model="formData.stockNum" v-model="formData.remarks"
placeholder="请输入备注"></a-textarea> placeholder="请输入备注"></a-textarea>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
</div> </div>
<div style="text-align: center"> <div style="text-align: center">
<a-button class="search_btn btn_space" @click="goBack">取消</a-button> <a-button class="search_btn btn_space" @click="goBack">取消</a-button>
<a-button type="primary" class="search_btn btn_space" style="margin-left: 10px" @click="submitForm">保存</a-button> <a-button type="primary" class="search_btn btn_space" :loading="subLoad" style="margin-left: 10px" @click="submitForm">保存</a-button>
</div> </div>
</a-card> </a-card>
</div> </div>
...@@ -78,9 +78,7 @@ ...@@ -78,9 +78,7 @@
components: {}, components: {},
data() { data() {
return { return {
medicalNameList: [], subLoad: false,
medicalFatoryList: [],
productionBatch: [],
// form表单 // form表单
formData: { formData: {
breedId: undefined, breedId: undefined,
...@@ -127,56 +125,29 @@ ...@@ -127,56 +125,29 @@
{required: true, message: '请输入单价'} {required: true, message: '请输入单价'}
], ],
}, },
allSupplyInfo:[]
} }
}, },
created() { created() {
}, },
methods: { methods: {
getAllSupply() {
let par= {}
this.$api.common.fetchAllSupply(par).then(({data = []}) => {
this.allSupplyInfo = data
})
},
getAllBatch() {
this.productionBatch = []
if (this.formData.medicalId) {
let par = {
idList:[this.formData.medicalId]
}
this.$api.common.fetchBatchNumberByMedicalId(par).then(({data = []}) => {
this.productionBatch = data
})
}
},
// 弹窗确定按钮 // 弹窗确定按钮
submitForm() { submitForm() {
let vm = this let vm = this
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
let pars = {} vm.subLoad = true
Object.assign(pars, vm.formData)
pars['company'] = JSON.parse(vm.formData.factoryId).factoryName
pars['companyId'] = JSON.parse(vm.formData.factoryId).id
pars['batchNumber'] = JSON.parse(vm.formData.batchId).batchNumber
pars['batchId'] = JSON.parse(vm.formData.batchId).id
pars.produceDate = moment(vm.formData.produceDate).format('YYYY-MM-DD 00:00:00')
pars.expireDate = moment(vm.formData.expireDate).format('YYYY-MM-DD 00:00:00')
pars['isHistory'] = 1
const {factoryId, ...others} = pars
let par = { let par = {
...others ...vm.formData
} }
this.spinning = true;
vm.$api.stockManage.addHistoryStock(par).then(res => { vm.$api.stockManage.addHistoryStock(par).then(res => {
this.spinning = false; this.subLoad = false;
if (res.code === 'SUCCESS') { if (res.code === 'SUCCESS') {
vm.$message.success('录入成功!') vm.$message.success('保存成功!')
vm.goBack() vm.goBack()
} }
}).catch(() => {
this.subLoad = false
}) })
} }
}); });
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
<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="供应商名称">
<!--v-price="{digit:4}"--> <a-input v-model="searchForm.supplierName" placeholder="请输入供应商名称" style="width: 250px"></a-input>
<a-input v-model="searchForm.idCar" placeholder="请输入供应商名称" style="width: 250px"></a-input>
</a-form-item> </a-form-item>
<a-form-item label="状态"> <a-form-item label="状态">
<a-select v-model="searchForm.status" placeholder="请选择" style="width: 250px"> <a-select v-model="searchForm.status" placeholder="请选择" style="width: 250px">
...@@ -29,8 +28,8 @@ ...@@ -29,8 +28,8 @@
:pagination="false" :pagination="false"
> >
<template slot="expireDateS" slot-scope="record"> <template slot="statusInfo" slot-scope="record">
{{record.expireDate | formatDate}} {{record.statusName}}
</template> </template>
<template slot="action" slot-scope="record"> <template slot="action" slot-scope="record">
<a-popconfirm <a-popconfirm
...@@ -64,49 +63,39 @@ ...@@ -64,49 +63,39 @@
import moment from 'moment' import moment from 'moment'
const columns = [ const columns = [
{ {
title: '发放日期', title: '供应商名称',
dataIndex: 'medicineName', dataIndex: 'supplierName',
ellipsis: true ellipsis: true
}, },
{ {
title: '姓名', title: '联系人',
dataIndex: 'typeName', dataIndex: 'contactsName',
ellipsis: true
},
{
title: '证件号码',
width: '120px',
dataIndex: 'factoryName',
ellipsis: true ellipsis: true
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'batchNumber', dataIndex: 'contactsPhone',
ellipsis: true ellipsis: true
}, },
{ {
title: '发放数量(瓶)', title: '联系地址',
dataIndex: 'specs', dataIndex: 'address',
ellipsis: true ellipsis: true
}, },
{ {
title: '发放时期', title: '备注',
width: '120px', dataIndex: 'remarks',
scopedSlots: {customRender: 'expireDateS'},
},
{
title: '现住址',
dataIndex: 'isHistoryName',
ellipsis: true ellipsis: true
}, },
{ {
title: '登记人', title: '状态',
dataIndex: 'specs', width: 70,
ellipsis: true scopedSlots: {customRender: 'statusInfo'},
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
width: 110,
scopedSlots: {customRender: 'action'}, scopedSlots: {customRender: 'action'},
}, },
] ]
...@@ -116,7 +105,7 @@ ...@@ -116,7 +105,7 @@
return { return {
// 搜索框对象 // 搜索框对象
searchForm: { searchForm: {
idCar:undefined, supplierName:undefined,
status: '' status: ''
}, },
pagination: { pagination: {
...@@ -228,10 +217,10 @@ ...@@ -228,10 +217,10 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
.search_form { /* .search_form {
margin-top: -16px; margin-top: -16px;
border: 1px solid rgba(255,77,128, .2); border: 1px solid rgba(255,77,128, .2);
border-top: 0px; border-top: 0px;
padding: 30px; padding: 30px;
} }*/
</style> </style>
...@@ -59,7 +59,7 @@ module.exports = { ...@@ -59,7 +59,7 @@ module.exports = {
warning: false, warning: false,
errors: false errors: false
}, },
https:true, // https:true,
}, },
chainWebpack: (config) => { chainWebpack: (config) => {
config.plugins.delete('preload') config.plugins.delete('preload')
......
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