Commit 1e97357a authored by gengchunlei's avatar gengchunlei

同意书、供应商合并

parents 4b70b3ec 44ff79a9
...@@ -16,53 +16,44 @@ export default { ...@@ -16,53 +16,44 @@ export default {
fetchAllMedicalName(params) {//获取所有品种名称(单位端) fetchAllMedicalName(params) {//获取所有品种名称(单位端)
return fetch('/basic-info/v1/basic-info/basic-medical-info/all', params) return fetch('/basic-info/v1/basic-info/basic-medical-info/all', params)
}, },
fetchMedicalNameByBreeidAndUnit(params) {//根据所属单位和药具分类获取品种名称
return fetch(`/stock-info/v1/stock-info/stock-basic-info/unit-breed/${params.unitId}/${params.breedId}`, params)
},
fetchAreaInfo(params) {//获取地区(父级:0)
return fetch(`/basic-info/v1/basic-info/basic-area-info/all-child/${params.id}`, params)
},
fetchUnitInfo(params) {//获取单位(父级) fetchUnitInfo(params) {//获取单位(父级)
return fetch(`/basic-info/v1/basic-info/basic-org-info/all-child/${params.id}`, params) return fetch(`/basic-info/v1/basic-info/basic-org-info/all-child/${params.id}`, params)
}, },
fetchFullAreaNameInfo(params) {//获取地区全名称 //供应商管理
return fetch(`/basic-info/v1/basic-info/basic-area-info/get-area-code-info/${params.areaCode}`, params)
},
fetchAllSupply(params) {//获取所有供应商 fetchAllSupply(params) {//获取所有供应商
return fetch('/v1/folacin-admin/folacin-supplier-info/enable', params) return fetch('/v1/folacin-admin/folacin-supplier-info/enable', params)
}, },
fetchAllBatch(params) {//获取批次 fetchAddSupply(params) {//新增供应商
return fetch('/basic-info/v1/basic-info/basic-batch-info/all', params) return fetch('/v1/folacin-admin/folacin-supplier-info', params, "post", "json")
},
fetchUploadImg(params) {//上传图片
return fetch('/basic-info/v1/basic-info/basic-pictures-info/pictures', params, 'post')
}, },
getMenuList(params) { fetchSupplyPageList(params) {//供应商分页查询
return fetch('/basic-info/v1/basic-info/basic-function-menu/getMenuList', params) return fetch('/v1/folacin-admin/folacin-supplier-info', params, "get")
}, },
fetchUploadFile(params) {//上传文件 fetchSupplyById(id) {//根据id获取
return fetch('/basic-info/v1/basic-info/basic-pictures-info/file', params, 'post') return fetch(`/v1/folacin-admin/folacin-supplier-info/${id}`)
}, },
fetchBatchNumberByMedicalId(params) {//根据药具id获取生产批次 fetchSupplUpdate(params) {//供应商分页查询
return fetch('/basic-info/v1/basic-info/basic-batch-info/query-medical-ids',params, 'get', 'json') return fetch(`/v1/folacin-admin/folacin-supplier-info/${params.id}`, params, "put", 'json')
}, },
fetchMedicalByBatchIds(params) { //根据批次id集合获取药具信息 fetchSupplDelete(id) {//供应商分页查询
return fetch('/basic-info/v1/basic-info/basic-batch-info/batch-ids',params, 'get', 'json') return fetch(`/v1/folacin-admin/folacin-supplier-info/${id}`, {}, "delete")
}, },
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)
}, },
fetchAllMedicalSpecs(params) {//获取药具规格全量查询 fetchAreaByCode(areaCode) {//根据区域编码获取下级地区
return fetch(`/basic-info/v1/basic-info/basic-medical-specs/all`, params) return fetch(`/v1/folacin-admin/sys-dict-area/child-area/${areaCode}`)
}, },
fetchDispenserFactoryAllList(params) { // 发放机厂家全量查询 //知情同意书
return fetch('/basic-info/v1/basic-info/basic-machine-factory-info/all', params) fetchConsentInfo() {//查询单位的知情同意书
return fetch(`/v1/folacin-admin/folacin-consent-info/consent`)
}, },
fetchDispenserTypeByFactory(params) { // 根据发放机厂家查询机器类型 fetchAddConsentInfo(params) {//新增单位的知情同意书
return fetch('/basic-info/v1/basic-info/basic-machine-type-info/query-by-factory-id', params) return fetch(`/v1/folacin-admin/folacin-consent-info`, params, "post", "json")
}, },
fetchMaterialDisUnitInfo(params) {//获取物资分配下拉 fetchUpdateConsentInfo(params) {//更新单位的知情同意书
return fetch('/v1/folacin-admin/folacin-send-record/send-record', params) console.log(params)
return fetch(`/v1/folacin-admin/folacin-consent-info/${params.id}`, params, "put", "json")
} }
}, },
...@@ -170,9 +161,9 @@ export default { ...@@ -170,9 +161,9 @@ export default {
fetchStockList(params) {//入库管理列表 fetchStockList(params) {//入库管理列表
return fetch('/stock-info/v1/stock-info/stock-send-record/receive-order', params); return fetch('/stock-info/v1/stock-info/stock-send-record/receive-order', params);
}, },
fetchTemplateByMedicalType(params) {//根据分类获取药具检查验收模板 fetchTemplateByMedicalType(params) {//根据分类获取药具检查验收模板
return fetch(`/basic-info/v1/basic-info/basic-template/query-breed/${params.breedId}`, params) return fetch(`/basic-info/v1/basic-info/basic-template/query-breed/${params.breedId}`, params)
}, },
fetchStockDetail(params) {//查看入库详情 fetchStockDetail(params) {//查看入库详情
return fetch(`/stock-info/v1/stock-info/stock-send-record/${params.id}`, params) return fetch(`/stock-info/v1/stock-info/stock-send-record/${params.id}`, params)
}, },
...@@ -229,7 +220,7 @@ export default { ...@@ -229,7 +220,7 @@ export default {
return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/${params.id}`, params); return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/${params.id}`, params);
}, },
deleteBeginStock(params) {//期初库存删除 deleteBeginStock(params) {//期初库存删除
return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/${params.id}`,params,'delete', 'json') return fetch(`/stock-info/v1/stock-info/stock-opening-inventory/${params.id}`, params, 'delete', 'json')
}, },
/*仓库盘点登记*/ /*仓库盘点登记*/
fetchStockInventoryList(params) {//仓库盘点列表 fetchStockInventoryList(params) {//仓库盘点列表
...@@ -285,309 +276,12 @@ export default { ...@@ -285,309 +276,12 @@ export default {
return fetch('/stock-info/v1/stock-info/stock-send-record', params, 'post', 'json'); return fetch('/stock-info/v1/stock-info/stock-send-record', params, 'post', 'json');
} }
}, },
//单位管理端-网点管理
networkManage: {
fetchNetworkList(params) {//列表
return fetch('/basic-info/v1/basic-info/basic-network-info', params)
},
fetchAddNetwork(params) {//新增网点
return fetch('/basic-info/v1/basic-info/basic-network-info', params, 'post', 'json')
},
fetchUpdateNetwork(params) {//停用网点
return fetch(`/basic-info/v1/basic-info/basic-network-info/${params.id}`, params, 'put', 'json')
},
fetchNetworkDetail(params) {// 查看详情
return fetch(`/basic-info/v1/basic-info/basic-network-info/${params.id}`, params)
},
fetchDownQRcode(params) {//下载二维码
return fetch(`/v1/basic-info/basic-network-info/net-qrcode/${params.unitId}`, params)
},
fetchNetworkAuditList(params) {//网点审核列表
return fetch('/basic-info/v1/basic-info/basic-network-info/get-network-info-audit-page', params)
},
fetchNetworkBatchAudit(params) {//网点批量审核通过
return fetch(`/basic-info/v1/basic-info/basic-network-info/network-info-batch-audit`, params)
},
fetchNetworkListByAreaCode(params) {// 获取所属地区下辖可用网点
return fetch(`/basic-info/v1/basic-info/basic-network-info/query-by-area-code`, params)
},
fetchNetworkStockInfoList(params) {//网点库存列表
return fetch('/basic-info/v1/basic-info/basic-network-info/query-network-stock-page', params)
},
fetchNetworkStockDetail(params) {// 网点库存查看详情入库分页
return fetch(`/stock-info/v1/stock-info/stock-transfer-record/get-network-change-list`, params)
},
fetchNetworkOutRecord(params) {// 网点库存查看详情手工调整分页
return fetch(`/stock-info/v1/stock-info/stock-network-change-record`, params)
},
//网点调整库存
fetchAdjustStockInfoList(params) {//网点调整库存列表
return fetch('/basic-info/v1/basic-info/basic-network-info/get-network-change-list', params)
},
fetchAdjustStockInfoBatch(params) {//网点调整库存批量
return fetch('/stock-info/v1/stock-info/stock-basic-info/network-batch-change', params, 'post', 'json')
},
fetchAdjustStockUpDown(params) {//网点调整库存上架下架
return fetch('/stock-info/v1/stock-info/stock-basic-info/network-stock-load-unload', params)
}
},
//单位管理端-预警管理
warningManage: {
fetchValidityWarnList(params) {//有效期预警列表
return fetch('/medicalStockInfo/expired', JSON.stringify(params), 'post')
},
fetchStockWarnList(params) {//库存预警列表
return fetch('/medicalStockInfo/inventoryWarn', JSON.stringify(params), 'post')
}
},
//随访管理
followupManage: {
fetchFollowUpList(params) {//随访列表
return fetch('/stock-info/v1/stock-info/stock-visit-info', params);
},
fetchIdFollowUp(params) {
return fetch(`/stock-info/v1/stock-info/stock-visit-info/${params.id}`, params);
},
addFollowUpInfo(params) {
return fetch(`/stock-info/v1/stock-info/stock-visit-info`, params, 'post', 'json');
},
},
//系统管理
systemManage: {
/*菜单管理*/
getPageInfoList(params) {
return fetch('/basic-info/v1/basic-info/basic-function-menu', params)
},
getOneById(params) {
return fetch(`/basic-info/v1/basic-info/basic-function-menu/${params.id}`, '', 'get', 'json')
},
getAllMenuList() {
return fetch('/basic-info/v1/basic-info/basic-function-menu/getAllMenuList', '', 'get', 'json')
},
addOne(params) {
return fetch('/basic-info/v1/basic-info/basic-function-menu', params, 'post', 'json')
},
updateOne(params) {
return fetch(`/basic-info/v1/basic-info/basic-function-menu/${params.id}`, params, 'put', 'json')
},
deleteById(params) {
return fetch(`/basic-info/v1/basic-info/basic-function-menu/deleteById/${params.id}`, '', 'get', 'json')
},
/*角色管理*/
getRolePageList(params) {
return fetch('/basic-info/v1/basic-info/basic-sys-role', params)
},
getRoleOneById(params) {
return fetch(`/basic-info/v1/basic-info/basic-sys-role/${params.id}`, '', 'get', 'json')
},
addRoleOne(params) {
return fetch('/basic-info/v1/basic-info/basic-sys-role', params, 'post', 'json')
},
updateRoleOne(params) {
return fetch(`/basic-info/v1/basic-info/basic-sys-role/${params.id}`, params, 'put', 'json')
},
deleteRoleOneById(params) {
return fetch(`/basic-info/v1/basic-info/basic-sys-role/deleteById/${params.id}`, '', 'get', 'json')
},
/*药具有效期预警管理*/
fetchValidityWarnManageList(params) { // 药具有效期预警管理列表
return fetch('/basic-info/v1/basic-info/basic-medical-validity-warning', params)
},
fetchValidityWarnManageDetail(params) {//获取药具有效期预警单条详情
return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/${params.id}`, params)
},
addValidityWarnManage(params) { //新增药具有效期预警
return fetch('/basic-info/v1/basic-info/basic-medical-validity-warning/insert-batch', params, 'post', 'json')
},
updateValidityWarnManage(params) { //修改药具有效期预警
return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/${params.id}`, params, 'put', 'json')
},
deleteValidityWarnManage(id) { //删除药具有效期预警
return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/${id}`, {}, "delete")
},
fetchLeftValidityWarnManage(params) {//选择未设置有效期预警的药具
return fetch(`/basic-info/v1/basic-info/basic-medical-validity-warning/get-warning-medical`, params)
},
/*需求计划上报表单管理*/
fetchDemandPlanFormManageList(params) { // 需求计划上报表单管理列表
return fetch('/basic-info/v1/basic-info/basic-plan-report-tb', params)
},
fetchDemandPlanFormManageDetail(params) {//获取需求计划上报表单详情
return fetch(`/basic-info/v1/basic-info/basic-plan-report-tb/${params.id}`, params)
},
deleteDemandPlanFormManageT(params) {//删除需求计划上报表单管理列表
return fetch(`/basic-info/v1/basic-info/basic-plan-report-tb/${params.id}`, params, 'delete', 'json')
},
addDemandPlanFormManage(params) { //新增需求计划上报表单
return fetch('/basic-info/v1/basic-info/basic-plan-report-tb', params, 'post', 'json')
},
/*入库验收模板管理-列表*/
getTemplateList(params) {
return fetch('/basic-info/v1/basic-info/basic-template', params)
},
/*入库验收模板管理-新增*/
addTemplate(params) {
return fetch('/basic-info/v1/basic-info/basic-template', params, "post", "json")
},
/*入库验收模板管理-详情*/
getTemplateById(id) {
return fetch(`/basic-info/v1/basic-info/basic-template/${id}`)
},
/*入库验收模板管理-更新*/
updateTemplate(params) {
return fetch(`/basic-info/v1/basic-info/basic-template/${params.id}`, params, "put", "json");
},
/*规格管理*/
fetchSpecManageList(params) { // 规格管理列表
return fetch('/basic-info/v1/basic-info/basic-medical-specs', params)
},
deleteSpecOneById(params) {// 删除规格
return fetch(`/basic-info/v1/basic-info/basic-medical-specs/${params.id}`, '', 'delete', 'json')
},
judgeSpecRepeat(params) {//判断当前规格是否重复
return fetch('/basic-info/v1/basic-info/basic-medical-specs/check-only-one', params, "post", "json")
},
addSpec(params) { //新增规格型号
return fetch('/basic-info/v1/basic-info/basic-medical-specs/batch-save', params, "post", "json")
},
// 枚举类型管理
fetchEnumerationManageList(params) { // 枚举类型管理列表
return fetch('/basic-info/v1/basic-info/basic-sys-enum', params)
},
fetchEnumerationTypeDetail(params) { // 枚举类型主键查询
return fetch(`/basic-info/v1/basic-info/basic-sys-enum/${params.id}`, params)
},
updateEnumerationType(params) {//枚举类型修改
return fetch(`/basic-info/v1/basic-info/basic-sys-enum/${params.id}`, params,"put", 'json')
},
addEnumerationType(params) { //新增枚举类型
return fetch('/basic-info/v1/basic-info/basic-sys-enum', params, "post", "json")
},
//枚举管理
fetchEnumerationDetailList(params) { // 枚举管理列表
return fetch('/basic-info/v1/basic-info/basic-sys-enum-value', params)
},
addEnumeration(params) { //新增枚举
return fetch('/basic-info/v1/basic-info/basic-sys-enum-value', params, "post", "json")
},
//发放机厂家设置
fetchDispenserFactoryList(params) { // 发放机厂家列表
return fetch('/basic-info/v1/basic-info/basic-machine-factory-info', params)
},
fetchDispenserFactoryDetail(params) { // 发放机厂家主键查询
return fetch(`/basic-info/v1/basic-info/basic-machine-factory-info/${params.id}`)
},
addDispenserFactory(params) { //新增发放机厂家
return fetch('/basic-info/v1/basic-info/basic-machine-factory-info', params, "post", "json")
},
updateDispenserFactory(params) {//发放机厂家修改
return fetch(`/basic-info/v1/basic-info/basic-machine-factory-info/${params.id}`, params,"put", 'json')
},
deleteDispenserFactory(params) {//发放机厂家删除
return fetch(`/basic-info/v1/basic-info/basic-machine-factory-info/${params.id}`, params,"delete", 'json')
},
//机器类型设置
fetchDispenserTypeList(params) { // 机器类型列表
return fetch('/basic-info/v1/basic-info/basic-machine-type-info', params)
},
fetchDispenserTypeDetail(params) { // 发放机厂家主键查询
return fetch(`/basic-info/v1/basic-info/basic-machine-type-info/${params.id}`)
},
addDispenserTypeInfo(params) { //新增发机器类型
return fetch('/basic-info/v1/basic-info/basic-machine-type-info', params, "post", "json")
},
updateDispenserType(params) {//机器类型修改
return fetch(`/basic-info/v1/basic-info/basic-machine-type-info/${params.id}`, params,"put", 'json')
},
deleteDispenserTypeInfo(params) {//机器类型删除
return fetch(`/basic-info/v1/basic-info/basic-machine-type-info/${params.id}`, params,"delete", 'json')
},
// 生产批次管理
fetchBatchNumberInfoList(params) { // 生产批次管理列表
return fetch('/basic-info/v1/basic-info/basic-batch-info/unit-query-page', params)
},
addBatchNumberInfo(params) { //新增生产批次管理
return fetch('/basic-info/v1/basic-info/basic-batch-info/unit-insert', params, "post", "json")
},
updateBatchNumberInfo(params) { //修改生产批次管理
return fetch(`/basic-info/v1/basic-info/basic-batch-info/${params.id}`, params, "put", "json")
},
fetchBatchNumberInfoDeatail(params) { // 生产批次管理主键查询
return fetch(`/basic-info/v1/basic-info/basic-batch-info/${params.id}`, params)
},
deleteBatchNumberInfo(params) {//删除生产批次
return fetch(`/basic-info/v1/basic-info/basic-batch-info/${params.id}`, params, 'delete', 'json')
}
},
//需求计划管理
demandPlanManage: {
/*需求计划管理*/
fetchDemandPlanList(params) { //获取需求计划列表
return fetch('/stock-info/v1/stock-info/stock-plan-report', params);
},
addDemandPlanList(params) {
return fetch('/stock-info/v1/stock-info/stock-plan-report',params, 'post','json')
},
fetchLatestDemandPlan(params) {//获取需求计划模板(最新)
return fetch('/basic-info/v1/basic-info/basic-plan-report-tb/get-year-plan-report', params)
},
fetchTempalteById(params) {//根据模板id获取需求计划模板
return fetch('/basic-info/v1/basic-info/basic-plan-report-tb/query-By-plan-report-id', params)
},
fetchDemandPlanDetailById(params) {//根据planid获取需求计划详情
return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params)
},
fetchUnitAuditTree(params) {//获取县级及以上审核树
return fetch('/stock-info/v1/stock-info/stock-plan-report/get-report-unit-and-status', params)
},
onlyAddDemandPlan(params) {//批量保存
return fetch(`/stock-info/v1/stock-info/stock-plan-report/batch-save`, params, 'post', 'json');
},
addDemandPlanAndCommit(params) {//批量保存并提交
return fetch(`/stock-info/v1/stock-info/stock-plan-report/batch-save-submit`, params, 'post', 'json');
},
deleteDemandPlanList(params) {// 需求计划列表删除
return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params,'delete')
},
fetchCheckReportStatus(params) {//校验单位上报状态
return fetch('/stock-info/v1/stock-info/stock-plan-report/check-report', params)
},
fetchSummaryReport(params) {//汇总上报
return fetch(`/stock-info/v1/stock-info/stock-plan-report/summary-report`, params, 'post', 'json');
},
fetchSummaryAndGenerateTransfer(params) {//省级汇总并生成物资分配单
return fetch(`/stock-info/v1/stock-info/stock-plan-report/summary-and-generate-transfer`, params, 'post', 'json');
},
fetchSummaryReportTransfer(params) {//省级汇总并生成物资分配单(科)
return fetch(`/stock-info/v1/stock-info/stock-plan-report/create-supply-distribution/${params.templateId}`, params, 'put');
},
updateDemandPlanInfo(params) { //修改需求计划
return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params, 'put', 'json')
},
fetchQueryDistribution(params) {//获取物资分配单
return fetch(`/stock-info/v1/stock-info/supply-distribution/query-distribution`, params);
},
fetchSubmitSupply(params) {//提交供应商
return fetch('/stock-info/v1/stock-info/supply-distribution/submit-supply', params, 'post','json')
},
updateDemandPlan(params) { //修改需求计划
return fetch(`/stock-info/v1/stock-info/stock-plan-report/${params.id}`, params, 'put', 'json')
},
},
fyManage: { fyManage: {
//从妇幼系统获取菜单及用户信息 //从妇幼系统获取菜单及用户信息
fetchFYLoginUser(params) { fetchFYLoginUser(params) {
return fetch('/v1/folacin-admin/sys-login/getLoginInfo', params); return fetch('/v1/folacin-admin/sys-login/getLoginInfo', params);
}, },
}, },
supplyManage: {//供应商管理
fetchSupplyDetail(params) {// 查看详情
return fetch(`/v1/folacin-admin/folacin-supplier-info/${params.id}`, params)
},
},
//常用工具 //常用工具
utils: { utils: {
//直接下载文件,不让浏览器直接打开 //直接下载文件,不让浏览器直接打开
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
created() { created() {
//获取妇幼权限和登录基本信息 //获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市 // document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市
document.cookie = 'bGNnd3lwdF9hdA=5028cd4d-4491-4351-9448-4b357d8f1591;'//云南省 document.cookie = 'bGNnd3lwdF9hdA=5028cd4d-4491-4351-9448-4b357d8f1591;'//云南省
let cookieToken = getCookie('bGNnd3lwdF9hdA') let cookieToken = getCookie('bGNnd3lwdF9hdA')
if (cookieToken) {//根据cookie获取token并调用接口获取菜单并设置初始选中菜单 if (cookieToken) {//根据cookie获取token并调用接口获取菜单并设置初始选中菜单
......
<template>
<a-tree-select
v-model="value"
tree-data-simple-mode
allowClear
:tree-data="treeData"
placeholder="请选择"
:load-data="onLoadData"
/>
</template>
<script>
/**
* 所有地区选择控件
*/
export default {
name: "allAreaSelect",
created() {
this.getDataList(53);
},
data() {
return {
value: undefined,
treeData: [],
};
},
watch: {
value(value) {
this.$emit('input', value);
},
},
methods: {
getDataList(areaCode) {
let treeData = [];
this.$api.common.fetchAreaByCode(areaCode).then(({code, data}) => {
if (code === "SUCCESS") {
data.forEach(x => {
let item = {
id: x.areaCode,
pId: 0,
value: x.areaCode,
title: x.areaName,
isLeaf: x.areaLevel == 5 ? true : false
};
treeData.push(item);
});
this.treeData = treeData;
}
});
},
onLoadData(treeNode) {
let that = this;
return new Promise(resolve => {
this.$api.common.fetchAreaByCode(treeNode.value).then(({code, data}) => {
let treeData = [];
if (code === "SUCCESS") {
console.log(data)
data.forEach(x => {
let item = {
id: x.areaCode,
pId: treeNode.value,
value: x.areaCode,
title: x.areaName,
isLeaf: x.areaLevel == 5 ? true : false
};
treeData.push(item);
});
that.treeData = that.treeData.concat(treeData);
resolve();
}
});
});
},
},
}
</script>
<style scoped>
</style>
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
name: "baiduEditor", name: "baiduEditor",
created() { created() {
}, },
watch: {
content(content) {
this.$emit('input', content);
}
},
beforeDestroy() { beforeDestroy() {
}, },
data() { data() {
......
...@@ -2,18 +2,10 @@ ...@@ -2,18 +2,10 @@
<div> <div>
<div style="text-align: center;font-size: 16px;font-weight: bold;"><span>知情同意书</span></div> <div style="text-align: center;font-size: 16px;font-weight: bold;"><span>知情同意书</span></div>
<a-form-model ref="formRef" :model="formData" :rules="formRules" style="margin-top: 20px"> <a-form-model ref="formRef" :model="formData" :rules="formRules" style="margin-top: 20px">
<a-row>
<!-- <a-col :span="11">
<a-form-model-item label="模板名称" prop="name" :label-col="{span: 5}"
:wrapper-col="{span: 18}">
<a-input placeholder="请输入模板名称" :disabled="formDisabled" v-model="formData.name"></a-input>
</a-form-model-item>
</a-col>-->
</a-row>
<a-row> <a-row>
<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 ref="baiduEditor" v-model="formData.content"></baiduEditor>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -29,7 +21,7 @@ ...@@ -29,7 +21,7 @@
<script> <script>
import typeSelect from "../../components/commonSelect/typeSelect"; import typeSelect from "../../components/commonSelect/typeSelect";
import baiduEditor from "../../components/baiduEditor"; import baiduEditor from "../../components/baiduEditor";
import {closedDetail} from "../../utils/common"; import {closedDetail, isBlank} from "../../utils/common";
export default { export default {
components: {typeSelect, baiduEditor}, components: {typeSelect, baiduEditor},
...@@ -38,6 +30,7 @@ ...@@ -38,6 +30,7 @@
return { return {
// form表单 // form表单
formData: { formData: {
id: "",
content: "" content: ""
}, },
formRules: { formRules: {
...@@ -46,18 +39,25 @@ ...@@ -46,18 +39,25 @@
] ]
}, },
formDisabled: false, formDisabled: false,
modeType: "update"
} }
}, },
created() { created() {
let that = this; let vm = this;
this.$api.systemManage.getTemplateById(1).then(res => { this.$api.common.fetchConsentInfo().then(res => {
if (res.code == 'SUCCESS') { if (res.code == 'SUCCESS') {
this.formData = res.data; if (isBlank(res.data)) {
this.modeType = 'add';
} else {
setTimeout(function () { setTimeout(function () {
that.$refs.baiduEditor.setContent(that.formData.content, that.formDisabled); vm.$refs.baiduEditor.setContent(res.data.content,false)
}, 300) },500);
this.formData.content = res.data.content;
this.formData.id = res.data.id;
} }
})
}
})
}, },
methods: { methods: {
// 弹窗确定按钮 // 弹窗确定按钮
...@@ -70,12 +70,20 @@ ...@@ -70,12 +70,20 @@
title: '确定提交吗?', title: '确定提交吗?',
okType: 'success', okType: 'success',
onOk: () => { onOk: () => {
if (this.modeType === "add") {
vm.$api.systemManage.addTemplate(this.formData).then(res => { vm.$api.common.fetchAddConsentInfo(this.formData).then(res => {
if (res.code === 'SUCCESS') { if (res.code === 'SUCCESS') {
vm.$message.success('操作成功!') vm.$message.success('操作成功!')
} }
}) })
} else {
vm.$api.common.fetchUpdateConsentInfo(this.formData).then(res => {
if (res.code === 'SUCCESS') {
vm.$message.success('操作成功!')
}
})
}
}, },
onCancel: () => { onCancel: () => {
}, },
...@@ -92,9 +100,10 @@ ...@@ -92,9 +100,10 @@
<style lang="less"> <style lang="less">
.edui-default .edui-toolbar .edui-combox .edui-combox-body { .edui-default .edui-toolbar .edui-combox .edui-combox-body {
line-height: 21px!important; line-height: 21px !important;
} }
.edui-default .edui-button-body, .edui-splitbutton-body, .edui-menubutton-body, .edui-combox-body { .edui-default .edui-button-body, .edui-splitbutton-body, .edui-menubutton-body, .edui-combox-body {
line-height: 20px!important; line-height: 20px !important;
} }
</style> </style>
...@@ -10,24 +10,27 @@ ...@@ -10,24 +10,27 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="品牌"> <a-form-item label="品牌">
<!--v-price="{digit:4}"--> <a-select v-model="searchForm.brandId" placeholder="请选择" style="width: 250px">
<a-input v-model="searchForm.brandName" placeholder="请输入品牌" style="width: 250px"></a-input> <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>
<a-form-item label="入库日期"> <a-form-item label="入库日期">
<a-date-picker v-model="searchForm.enterDate" 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 type="primary" class="search_btn" @click="searchList">搜索</a-button>
<a-button type="primary" class="search_btn" style="float: right" @click="searchList">搜索</a-button> <a-button class="search_btn" style="margin-left: 10px" @click="restSearchForm">清空</a-button>
<div style="clear: both"></div> <div style="clear: both"></div>
</a-form> </a-form>
<div style="clear: both"></div> <div style="clear: both"></div>
<div style="float: right;line-height: 32px;background-color: #E6F7FF;margin-top: 16px;cursor: pointer" <div style="float: right;line-height: 32px;background-color: #E6F7FF;margin-top: 16px;cursor: pointer"
@click="showSelectedMedical" @click="showSelectedMedical"
v-if="selectedRowKeys.length > 0" v-if="selectedRowKeys.length > 0"
> >
<a-popover v-model="selectedVisible" trigger="click" placement="bottomRight"> <a-popover v-model="selectedVisible" trigger="click" placement="bottomRight">
<div slot="content" style="min-width: 300px"> <div slot="content" style="min-width: 300px">
<div> <div>
<span style="padding: 5px 16px;color: #FF4D80">已选择叶酸({{selectedRowKeys.length}})</span> <span style="padding: 5px 16px;color: #FF4D80">已选择叶酸({{selectedRowKeys.length}})</span>
...@@ -47,12 +50,15 @@ ...@@ -47,12 +50,15 @@
</a-list> </a-list>
</div> </div>
</div> </div>
<span style="padding: 5px 16px;color: #FF4D80">已选择叶酸{{selectedRowKeys.length}}<a-icon type="down" style="margin-left:10px;font-size: 10px"/> </span> <span style="padding: 5px 16px;color: #FF4D80">已选择叶酸{{selectedRowKeys.length}}<a-icon type="down"
style="margin-left:10px;font-size: 10px"/> </span>
</a-popover> </a-popover>
</div> </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>
<a-button type="primary" class="search_btn btn_space">导出Excel</a-button> <a-button type="primary" class="search_btn btn_space">导出Excel</a-button>
</div> </div>
...@@ -90,8 +96,9 @@ ...@@ -90,8 +96,9 @@
</div> </div>
</template> </template>
<script> <script>
import {isEmptyParams} from "../../utils/common"; import {isNotBlank, isEmptyParams} from "../../utils/common";
import moment from 'moment' import moment from 'moment'
const columns = [ const columns = [
{ {
title: '品牌', title: '品牌',
...@@ -153,6 +160,7 @@ ...@@ -153,6 +160,7 @@
searchForm: { searchForm: {
brandName: '', brandName: '',
supplierId: '', supplierId: '',
brandId:'',
enterDate: undefined enterDate: undefined
}, },
pagination: { pagination: {
...@@ -164,22 +172,24 @@ ...@@ -164,22 +172,24 @@
columns, columns,
tableData: [], tableData: [],
loading: false, loading: false,
allSupplyInfo:[], allSupplyInfo: [],
selectedRowKeys:[], brandList: [],
selectedRowKeys: [],
selectedVisible: false, selectedVisible: false,
selectedRowList:[], selectedRowList: [],
} }
}, },
created() { created() {
this.getInStockList() this.getInStockList();
this.getAllSupply() this.getAllSupply();
this.brandList = JSON.parse(sessionStorage.getItem("allEnum"))["folacin_stock_record_brand_id"];
}, },
methods: { methods: {
getAllSupply() { getAllSupply() {
let par= {} let par = {}
this.$api.common.fetchAllSupply(par).then(({data = []}) => { this.$api.common.fetchAllSupply(par).then(({data = []}) => {
this.allSupplyInfo = data this.allSupplyInfo = data
}) })
}, },
searchList() { searchList() {
this.pagination.pageIndex = 1 this.pagination.pageIndex = 1
...@@ -187,12 +197,16 @@ ...@@ -187,12 +197,16 @@
}, },
getInStockList() { getInStockList() {
this.loading = true this.loading = true
let pars = isEmptyParams(this.searchForm) let pars = isEmptyParams(this.searchForm);
if (isNotBlank( pars.enterDate)){
pars.enterDate = moment(pars.enterDate).format('YYYY-MM-DD')
}
let par = { let par = {
...pars, ...pars,
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize pageSize: this.pagination.pageSize
} }
console.log(par);
this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => { this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data const {dataList = [], total = 0} = data
this.tableData = dataList this.tableData = dataList
...@@ -228,8 +242,8 @@ ...@@ -228,8 +242,8 @@
} }
}, },
delSelectedKey(index) { delSelectedKey(index) {
this.selectedRowKeys.splice(index,1) this.selectedRowKeys.splice(index, 1)
this.selectedRowList.splice(index,1) this.selectedRowList.splice(index, 1)
if (this.selectedRowKeys.length == 0) { if (this.selectedRowKeys.length == 0) {
this.selectedVisible = false this.selectedVisible = false
} }
...@@ -247,13 +261,13 @@ ...@@ -247,13 +261,13 @@
}, },
// 库存录入按钮 // 库存录入按钮
openModal() { openModal() {
this.$router.push({path:'/inStock/add', query:{}}) this.$router.push({path: '/inStock/add', query: {}})
}, },
toAdd() { toAdd() {
this.$router.push({path:'/inStock/addMaterialDistribution', query: {selected:this.selectedRowKeys}}) this.$router.push({path: '/inStock/addMaterialDistribution', query: {selected: this.selectedRowKeys}})
}, },
toDetail(record) { toDetail(record) {
this.$router.push({path:'/inStock/inStockManageDetail', query: record}) this.$router.push({path: '/inStock/inStockManageDetail', query: record})
} }
}, },
} }
...@@ -273,10 +287,11 @@ ...@@ -273,10 +287,11 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
/* .search_form {
margin-top: -17px; /* .search_form {
border: 1px solid rgba(255,77,128, .2); margin-top: -17px;
border-top: 0px; border: 1px solid rgba(255,77,128, .2);
padding: 30px; border-top: 0px;
}*/ padding: 30px;
}*/
</style> </style>
<template> <template>
<div class="inStockAdd"> <div class="inStockAdd">
<a-card style="height: 100vh"> <a-card style="height: 100vh">
<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:75%;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}"
> >
<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="supplierName" prop="supplierName"
:labelCol="{span: 3}" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<a-input v-model="formData.supplierName" <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="contactsName"> <a-form-model-item label="联系人" prop="contactsName">
<a-input v-model="formData.contactsName" <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="contactsPhone"> <a-form-model-item label="联系人电话" prop="contactsPhone">
<a-input v-model="formData.contactsPhone" <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="12">
<a-form-model-item label="联系地址" <a-form-model-item label="联系地址"
prop="address" prop="areaCode">
:labelCol="{span: 3}" <allAreaSelect v-model="formData.areaCode"></allAreaSelect>
:wrapperCol="{span: 20}"> {{formData.areaName}}
<a-input v-model="formData.address" </a-form-model-item>
placeholder="请输入联系地址"></a-input> </a-col>
</a-form-model-item> <a-col :span="24">
</a-col> <a-form-model-item label="详细地址"
<a-col :span="24"> prop="address"
<a-form-model-item label="详细地址" :labelCol="{span: 3}"
prop="batchId" :wrapperCol="{span: 20}">
:labelCol="{span: 3}" <a-input v-model="formData.address"
:wrapperCol="{span: 20}"> placeholder="请输入详细地址"></a-input>
<a-input v-model="formData.stockNum" </a-form-model-item>
placeholder="请输入详细地址"></a-input> </a-col>
</a-form-model-item> <a-col :span="24">
</a-col> <a-form-model-item label="备注"
<a-col :span="24"> prop="remarks"
<a-form-model-item label="备注" :labelCol="{span: 3}"
prop="remarks" :wrapperCol="{span: 20}">
:labelCol="{span: 3}" <a-textarea
:wrapperCol="{span: 20}"> :rows="6"
<a-textarea v-model="formData.remarks"
:rows="6" placeholder="请输入备注"></a-textarea>
v-model="formData.remarks" </a-form-model-item>
placeholder="请输入备注"></a-textarea> </a-col>
</a-form-model-item> </a-row>
</a-col> </a-form-model>
</a-row> </div>
</a-form-model> <div style="text-align: center">
</div> <a-button class="search_btn btn_space" @click="goBack">取消</a-button>
<div style="text-align: center"> <a-button type="primary" class="search_btn btn_space" :loading="subLoad" style="margin-left: 10px"
<a-button class="search_btn btn_space" @click="goBack">取消</a-button> @click="submitForm">保存
<a-button type="primary" class="search_btn btn_space" :loading="subLoad" style="margin-left: 10px" @click="submitForm">保存</a-button> </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 allAreaSelect from '../../../components/allAreaSelect'
import {checkPhone, closedDetail} from "../../../utils/common";
export default { export default {
components: {}, components: {allAreaSelect},
data() { data() {
return { return {
subLoad: false, subLoad: false,
// form表单 // form表单
formData: { formData: {
breedId: undefined, // supplierName: undefined,
batchNumber: undefined, // contactsName: undefined,
medicalId: undefined, // contactsPhone: undefined,
factoryId: undefined,
supplyName: undefined,
classify: undefined,
unitPrice: undefined,
batchId: undefined,
produceDate: undefined,
expireDate: undefined,
stockNum: undefined,
supplierName: undefined,
contactsName: undefined,
contactsPhone: undefined,
}, },
formRules: { formRules: {
supplierName: [ supplierName: [
{required: true, message: '请输入供应商名称'} {required: true, message: '请选择供应商名称', trigger: 'change'},
], ],
contactsName:[ contactsName: [
{required: true, message: '请输入联系人'} {required: true, message: '请输入联系人', trigger: 'change'}
], ],
contactsPhone: [ contactsPhone: [
{required: true, message: '请输入联系人电话'} {required: true, message: '请输入联系人电话', trigger: 'change'},
], {validator: checkPhone},
medicalId: [
{required: true, message: '请选择品种名称'}
],
factoryId: [
{required: true, message: '请选择生产厂家', trigger: 'change'}
],
batchId: [
{required: true, message: '请输入生产批次', trigger: 'change'}
],
stockNum: [
{required: true, message: '请输入药具数量', trigger: 'change'}
], ],
produceDate: [ areaCode: [
{required: true, message: '请选择日期', trigger: 'change'} {required: true, message: '请选择联系地址', trigger: 'change'}
], ],
expireDate: [ address: [
{required: true, message: '请选择日期', trigger: 'change'} {required: true, message: '请输入详细地址', trigger: 'change'}
],
unitPrice: [
{required: true, message: '请输入单价'}
], ],
}, },
routerParams: {} queryParams: {}
} }
}, },
created() { created() {
this.routerParams = this.$route.query this.queryParams = this.$route.query;
if (this.routerParams.flag == 'update') { if (this.queryParams.modeType === "update") {
this.getSupplyDetail(this.routerParams) this.$api.common.fetchSupplyById(this.queryParams.id).then(res => {
if (res.code === 'SUCCESS') {
this.formData = res.data;
}
}).catch(() => {
});
} }
}, },
methods: { methods: {
getSupplyDetail(record) {
let par = {
id: record.id
}
this.$api.supplyManage.fetchSupplyDetail(par).then(({data}) => {
})
},
// 弹窗确定按钮 // 弹窗确定按钮
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
let par = { let par = {
...vm.formData ...vm.formData
};
if (this.queryParams.modeType === 'add') {
vm.$api.common.fetchAddSupply(par).then(res => {
this.subLoad = false;
if (res.code === 'SUCCESS') {
vm.$message.success('保存成功!')
vm.goBack()
}
}).catch(() => {
this.subLoad = false
})
}
if (this.queryParams.modeType === 'update') {
vm.$api.common.fetchSupplUpdate(par).then(res => {
this.subLoad = false;
if (res.code === 'SUCCESS') {
vm.$message.success('修改成功!')
vm.goBack()
}
}).catch(() => {
this.subLoad = false
})
} }
vm.$api.stockManage.addHistoryStock(par).then(res => {
this.subLoad = false;
if (res.code === 'SUCCESS') {
vm.$message.success('保存成功!')
vm.goBack()
}
}).catch(() => {
this.subLoad = false
})
} }
}); });
}, },
goBack() { goBack() {
closedDetail('/supplyManage/add','/Home/supplyManage') closedDetail('/supplyManage/add', '/Home/supplyManage')
} }
}, },
} }
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<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">
<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 allFactoryInfo" :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>
<a-form-item> <a-form-item>
<a-button type="primary" class="search_btn" style="margin-left: 10px" @click="searchList">搜索</a-button> <a-button type="primary" class="search_btn" style="margin-left: 10px" @click="searchList">搜索</a-button>
<a-button class="search_btn" style="margin-left: 10px" @click="restSearchForm">清空</a-button> <a-button class="search_btn" style="margin-left: 10px" @click="restSearchForm">清空</a-button>
</a-form-item> </a-form-item>
<a-button type="primary" class="search_btn" style="float: right" @click="toAdd">添加供应商</a-button> <a-button type="primary" class="search_btn" style="float: right" @click="toAdd">添加供应商</a-button>
<div style="clear: both"></div> <div style="clear: both"></div>
...@@ -27,22 +27,19 @@ ...@@ -27,22 +27,19 @@
:loading="loading" :loading="loading"
:pagination="false" :pagination="false"
> >
<template slot="statusInfo" slot-scope="record">
{{record.statusName}}
</template>
<template slot="action" slot-scope="record"> <template slot="action" slot-scope="record">
<a-button type="link" size="small" @click="toUpdate(record)">修改</a-button> <!--<a-button type="link" size="small" @click="toUpdate(record)">修改</a-button>-->
<a-popconfirm <a-popconfirm
:title="'确定' + (record.status === 0 ? '禁用' : '启用') + '该供应商吗?'" :title="'确定' + (record.status === 1 ? '停用' : '启用') + '该供应商吗?'"
ok-text="是" ok-text="是"
cancel-text="否" cancel-text="否"
@confirm="changeStatus(record)" @confirm="changeStatus(record)"
:disabled="record.status == '0'"
> >
<a href="#">{{record.status === 0 ? '禁用' : '启用'}}</a> <a href="#">{{record.status === 1 ? '停用' : '启用'}}</a>
</a-popconfirm> </a-popconfirm>
<a-button type="link" size="small" @click="updateSupply(record)">修改</a-button>
<a-button type="link" size="small" @click="deleteConfirm(record)">删除</a-button>
</template> </template>
</a-table> </a-table>
<a-pagination <a-pagination
...@@ -61,7 +58,6 @@ ...@@ -61,7 +58,6 @@
</template> </template>
<script> <script>
import {isEmptyParams} from "../../utils/common"; import {isEmptyParams} from "../../utils/common";
import moment from 'moment'
const columns = [ const columns = [
{ {
title: '供应商名称', title: '供应商名称',
...@@ -91,12 +87,12 @@ ...@@ -91,12 +87,12 @@
{ {
title: '状态', title: '状态',
width: 70, width: 70,
scopedSlots: {customRender: 'statusInfo'}, dataIndex: 'statusName'
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
width: 110, width: 150,
scopedSlots: {customRender: 'action'}, scopedSlots: {customRender: 'action'},
}, },
] ]
...@@ -106,7 +102,7 @@ ...@@ -106,7 +102,7 @@
return { return {
// 搜索框对象 // 搜索框对象
searchForm: { searchForm: {
supplierName:undefined, supplierName: undefined,
status: '' status: ''
}, },
pagination: { pagination: {
...@@ -118,27 +114,28 @@ ...@@ -118,27 +114,28 @@
columns, columns,
tableData: [], tableData: [],
loading: false, loading: false,
allFactoryInfo:[] allFactoryInfo: []
} }
}, },
created() { created() {
this.getInStockList() this.getSupplyList();
this.allFactoryInfo = JSON.parse(sessionStorage.getItem("allEnum"))["public_state"];
}, },
methods: { methods: {
searchList() { searchList() {
this.pagination.pageIndex = 1 this.pagination.pageIndex = 1;
this.getInStockList() this.getSupplyList()
}, },
getInStockList() { getSupplyList() {
this.loading = true this.loading = true;
let pars = isEmptyParams(this.searchForm) let pars = isEmptyParams(this.searchForm)
let par = { let par = {
...pars, ...pars,
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize pageSize: this.pagination.pageSize
} }
this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => { this.$api.common.fetchSupplyPageList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data const {dataList = [], total = 0} = data;
this.tableData = dataList this.tableData = dataList
this.pagination.total = total this.pagination.total = total
this.loading = false this.loading = false
...@@ -150,37 +147,30 @@ ...@@ -150,37 +147,30 @@
showSizeChange(pageNum, pageSize) { showSizeChange(pageNum, pageSize) {
this.pagination.pageIndex = 1; this.pagination.pageIndex = 1;
this.pagination.pageSize = pageSize; this.pagination.pageSize = pageSize;
this.getInStockList() this.getSupplyList()
}, },
change(pageNum, pageSize) { change(pageNum, pageSize) {
this.pagination.pageIndex = pageNum; this.pagination.pageIndex = pageNum;
this.pagination.pageSize = pageSize; this.pagination.pageSize = pageSize;
this.getInStockList() this.getSupplyList()
}, },
restSearchForm() { restSearchForm() {
this.searchForm = { this.searchForm = {
idCar:undefined idCar: undefined
} }
this.searchList() this.searchList()
}, },
toAdd() { toAdd() {
this.$router.push({path:'/supplyManage/add', query: {flag: 'add'}}) this.$router.push({path:'/supplyManage/add'})
},
toUpdate(record) {
let par = {
...record,
flag: 'update'
}
this.$router.push({path:'/supplyManage/add',query: par})
}, },
changeStatus(record) { changeStatus(record) {
let par = { let par = {
...record, id: record.id,
status: record.status === 0 ? 1 : 0, status: record.status === 0 ? 1 : 0,
} }
this.$api.networkManage.fetchUpdateNetwork(par).then(res => { this.$api.common.fetchSupplUpdate(par).then(res => {
if (res.code === 'SUCCESS') { if (res.code === 'SUCCESS') {
this.getInStockList() this.getSupplyList()
} }
}) })
}, },
...@@ -190,13 +180,10 @@ ...@@ -190,13 +180,10 @@
title: '确定删除该条数据吗?', title: '确定删除该条数据吗?',
okType: 'danger', okType: 'danger',
onOk: () => { onOk: () => {
let par = { this.$api.common.fetchSupplDelete(record.id).then(res => {
id: record.id
}
this.$api.systemManage.deleteRoleOneById(par).then(res => {
if (res.code === 'SUCCESS') { if (res.code === 'SUCCESS') {
this.pagination.pageIndex = 1; this.pagination.pageIndex = 1;
this.getInStockList() this.getSupplyList()
this.$message.success('删除成功!') this.$message.success('删除成功!')
} }
}) })
...@@ -207,6 +194,9 @@ ...@@ -207,6 +194,9 @@
}, },
}); });
}, },
updateSupply(record) {
this.$router.push({path: '/supplyManage/add', query: {modeType: "update", id: record.id}});
}
}, },
} }
</script> </script>
...@@ -225,10 +215,11 @@ ...@@ -225,10 +215,11 @@
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
/* .search_form {
margin-top: -16px; /* .search_form {
border: 1px solid rgba(255,77,128, .2); margin-top: -16px;
border-top: 0px; border: 1px solid rgba(255,77,128, .2);
padding: 30px; border-top: 0px;
}*/ padding: 30px;
}*/
</style> </style>
import moment from 'moment'; import moment from 'moment';
import storeInfo from '../../store/index' import storeInfo from '../../store/index'
import router from "../../router"; import router from "../../router";
...@@ -6,8 +5,8 @@ import router from "../../router"; ...@@ -6,8 +5,8 @@ import router from "../../router";
//对象、一维数组去重(返回一个新数组) //对象、一维数组去重(返回一个新数组)
export const singleArr = (arr, val) => { export const singleArr = (arr, val) => {
let newArr = arr.concat() let newArr = arr.concat()
let len = newArr.length; let len = newArr.length;
if (val){ if (val) {
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
for (let j = i + 1; j < len; j++) { for (let j = i + 1; j < len; j++) {
if (newArr[i][val] == newArr[j][val]) { if (newArr[i][val] == newArr[j][val]) {
...@@ -33,21 +32,21 @@ export const singleArr = (arr, val) => { ...@@ -33,21 +32,21 @@ export const singleArr = (arr, val) => {
} }
//删除关闭详情的页面 //删除关闭详情的页面
export const closedDetail = (url, goToUrl) => { export const closedDetail = (url, goToUrl) => {
if (goToUrl) { if (goToUrl) {
window.sessionStorage.setItem('activeItem', goToUrl) window.sessionStorage.setItem('activeItem', goToUrl)
window.sessionStorage.setItem('activeKey', goToUrl) window.sessionStorage.setItem('activeKey', goToUrl)
storeInfo.commit('changeActKey', goToUrl) storeInfo.commit('changeActKey', goToUrl)
router.push(goToUrl) router.push(goToUrl)
} }
} }
//判断对象values是否为空 并返回不为空对象 //判断对象values是否为空 并返回不为空对象
export const isEmptyParams = (obj) => { export const isEmptyParams = (obj) => {
let obje = {} let obje = {}
Object.assign(obje, obj) Object.assign(obje, obj)
for ( let key in obje ){ for (let key in obje) {
if (obje[key] === '' || typeof obje[key] === 'undefined' || obje[key] === null || obje[key].length == 0){ if (obje[key] === '' || typeof obje[key] === 'undefined' || obje[key] === null || obje[key].length == 0) {
delete obje[key] delete obje[key]
} }
} }
...@@ -55,41 +54,43 @@ export const isEmptyParams = (obj) => { ...@@ -55,41 +54,43 @@ export const isEmptyParams = (obj) => {
} }
//数组转为树形结构 //数组转为树形结构
// toTree(数组,父id,父id属性key, id当前节点id key) // toTree(数组,父id,父id属性key, id当前节点id key)
export const toTree = (list,parId,pId,id) => { export const toTree = (list, parId, pId, id) => {
let len = list.length let len = list.length
function loop(parId){
function loop(parId) {
let res = []; let res = [];
for(let i = 0; i < len; i++){ for (let i = 0; i < len; i++) {
let item = list[i] let item = list[i]
if(item[pId] == parId){ if (item[pId] == parId) {
item.children = loop(item[id]) item.children = loop(item[id])
res.push(item) res.push(item)
} }
} }
return res return res
} }
return loop(parId) return loop(parId)
} }
//树形数据转数组 //树形数据转数组
export const treeToArray = (source) => { export const treeToArray = (source) => {
let res = [] let res = []
const fn = (source)=>{ const fn = (source) => {
source.forEach(el=>{ source.forEach(el => {
res.push(el) res.push(el)
el.children && el.children.length>0 ? fn(el.children) : "" el.children && el.children.length > 0 ? fn(el.children) : ""
}) })
} }
return res return res
} }
//删除树状结构数据中空children //删除树状结构数据中空children
export const removeEmptyChildren = (data) => { export const removeEmptyChildren = (data) => {
data.forEach(item => { data.forEach(item => {
if (item.children === null || item.children.length === 0) { if (item.children === null || item.children.length === 0) {
delete item.children delete item.children
} else { } else {
removeEmptyChildren(item.children) removeEmptyChildren(item.children)
} }
}) })
...@@ -156,10 +157,28 @@ export const getEnumByFlag = (enumFlag) => { ...@@ -156,10 +157,28 @@ export const getEnumByFlag = (enumFlag) => {
//读取cookie //读取cookie
export const getCookie = name => { export const getCookie = name => {
let arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); let arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if(arr=document.cookie.match(reg)) if (arr = document.cookie.match(reg))
return unescape(arr[2]); return unescape(arr[2]);
else else
return null; return null;
};
//判断一对象是否是空白
export const isBlank = obj => {
if (obj == null || obj == undefined || obj == '' || obj == ' ') {
return true;
}
if (obj === null || obj === undefined || obj === '' || obj === ' ') {
return true;
}
if (obj == {} || obj == []) {
return true
}
return false;
};
export const isNotBlank = obj => {
return !isBlank(obj)
} }
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