Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
folacin-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ynby
folacin-front
Commits
44ff79a9
Commit
44ff79a9
authored
Jul 03, 2021
by
罗成兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供应商管理和知情同意书管理完善
parent
be966f93
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
304 additions
and
188 deletions
+304
-188
index.js
src/api/index.js
+31
-40
Home.vue
src/views/Home.vue
+1
-1
allAreaSelect.vue
src/views/components/allAreaSelect.vue
+80
-0
baiduEditor.vue
src/views/components/baiduEditor.vue
+5
-0
InformedConsent.vue
src/views/indexComponent/InformedConsent/InformedConsent.vue
+28
-19
inStockManage.vue
src/views/indexComponent/inStockManage/inStockManage.vue
+37
-22
addSupply.vue
...iews/indexComponent/supplyManage/components/addSupply.vue
+53
-54
supplyManage.vue
src/views/indexComponent/supplyManage/supplyManage.vue
+31
-33
common.js
src/views/utils/common.js
+38
-19
No files found.
src/api/index.js
View file @
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"
)
},
},
fetch
UploadFile
(
params
)
{
//上传文件
fetch
SupplyById
(
id
)
{
//根据id获取
return
fetch
(
'/basic-info/v1/basic-info/basic-pictures-info/file'
,
params
,
'post'
)
return
fetch
(
`/v1/folacin-admin/folacin-supplier-info/
${
id
}
`
)
},
},
fetch
BatchNumberByMedicalId
(
params
)
{
//根据药具id获取生产批次
fetch
SupplUpdate
(
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'
)
},
},
fetch
MedicalByBatchIds
(
params
)
{
//根据批次id集合获取药具信息
fetch
SupplDelete
(
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
)
},
},
fetchA
llMedicalSpecs
(
params
)
{
//获取药具规格全量查询
fetchA
reaByCode
(
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`
)
},
},
fetch
DispenserTypeByFactory
(
params
)
{
// 根据发放机厂家查询机器类型
fetch
AddConsentInfo
(
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"
)
}
}
},
},
//首页接口
//首页接口
...
@@ -80,7 +71,7 @@ export default {
...
@@ -80,7 +71,7 @@ export default {
return
fetch
(
`/stock-info/v1/stock-info/home/get-remind-and-waring`
,
params
);
return
fetch
(
`/stock-info/v1/stock-info/home/get-remind-and-waring`
,
params
);
},
},
updatePwd
(
params
)
{
//更新密码
updatePwd
(
params
)
{
//更新密码
return
fetch
(
`/basic-info/v1/basic-info/basic-sys-user/update-password`
,
params
,
'post'
,
'json'
)
return
fetch
(
`/basic-info/v1/basic-info/basic-sys-user/update-password`
,
params
,
'post'
,
'json'
)
},
},
fetchVisitStatistic
(
params
)
{
//回访统计接口
fetchVisitStatistic
(
params
)
{
//回访统计接口
return
fetch
(
`/stock-info/v1/stock-info/home/get-visit-statistic`
,
params
);
return
fetch
(
`/stock-info/v1/stock-info/home/get-visit-statistic`
,
params
);
...
@@ -253,7 +244,7 @@ export default {
...
@@ -253,7 +244,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
)
{
//仓库盘点列表
...
@@ -493,7 +484,7 @@ export default {
...
@@ -493,7 +484,7 @@ export default {
return
fetch
(
`/basic-info/v1/basic-info/basic-sys-enum/
${
params
.
id
}
`
,
params
)
return
fetch
(
`/basic-info/v1/basic-info/basic-sys-enum/
${
params
.
id
}
`
,
params
)
},
},
updateEnumerationType
(
params
)
{
//枚举类型修改
updateEnumerationType
(
params
)
{
//枚举类型修改
return
fetch
(
`/basic-info/v1/basic-info/basic-sys-enum/
${
params
.
id
}
`
,
params
,
"put"
,
'json'
)
return
fetch
(
`/basic-info/v1/basic-info/basic-sys-enum/
${
params
.
id
}
`
,
params
,
"put"
,
'json'
)
},
},
addEnumerationType
(
params
)
{
//新增枚举类型
addEnumerationType
(
params
)
{
//新增枚举类型
return
fetch
(
'/basic-info/v1/basic-info/basic-sys-enum'
,
params
,
"post"
,
"json"
)
return
fetch
(
'/basic-info/v1/basic-info/basic-sys-enum'
,
params
,
"post"
,
"json"
)
...
@@ -516,10 +507,10 @@ export default {
...
@@ -516,10 +507,10 @@ export default {
return
fetch
(
'/basic-info/v1/basic-info/basic-machine-factory-info'
,
params
,
"post"
,
"json"
)
return
fetch
(
'/basic-info/v1/basic-info/basic-machine-factory-info'
,
params
,
"post"
,
"json"
)
},
},
updateDispenserFactory
(
params
)
{
//发放机厂家修改
updateDispenserFactory
(
params
)
{
//发放机厂家修改
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-factory-info/
${
params
.
id
}
`
,
params
,
"put"
,
'json'
)
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-factory-info/
${
params
.
id
}
`
,
params
,
"put"
,
'json'
)
},
},
deleteDispenserFactory
(
params
)
{
//发放机厂家删除
deleteDispenserFactory
(
params
)
{
//发放机厂家删除
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-factory-info/
${
params
.
id
}
`
,
params
,
"delete"
,
'json'
)
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-factory-info/
${
params
.
id
}
`
,
params
,
"delete"
,
'json'
)
},
},
//机器类型设置
//机器类型设置
fetchDispenserTypeList
(
params
)
{
// 机器类型列表
fetchDispenserTypeList
(
params
)
{
// 机器类型列表
...
@@ -532,10 +523,10 @@ export default {
...
@@ -532,10 +523,10 @@ export default {
return
fetch
(
'/basic-info/v1/basic-info/basic-machine-type-info'
,
params
,
"post"
,
"json"
)
return
fetch
(
'/basic-info/v1/basic-info/basic-machine-type-info'
,
params
,
"post"
,
"json"
)
},
},
updateDispenserType
(
params
)
{
//机器类型修改
updateDispenserType
(
params
)
{
//机器类型修改
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-type-info/
${
params
.
id
}
`
,
params
,
"put"
,
'json'
)
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-type-info/
${
params
.
id
}
`
,
params
,
"put"
,
'json'
)
},
},
deleteDispenserTypeInfo
(
params
)
{
//机器类型删除
deleteDispenserTypeInfo
(
params
)
{
//机器类型删除
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-type-info/
${
params
.
id
}
`
,
params
,
"delete"
,
'json'
)
return
fetch
(
`/basic-info/v1/basic-info/basic-machine-type-info/
${
params
.
id
}
`
,
params
,
"delete"
,
'json'
)
},
},
// 生产批次管理
// 生产批次管理
fetchBatchNumberInfoList
(
params
)
{
// 生产批次管理列表
fetchBatchNumberInfoList
(
params
)
{
// 生产批次管理列表
...
@@ -561,7 +552,7 @@ export default {
...
@@ -561,7 +552,7 @@ export default {
return
fetch
(
'/stock-info/v1/stock-info/stock-plan-report'
,
params
);
return
fetch
(
'/stock-info/v1/stock-info/stock-plan-report'
,
params
);
},
},
addDemandPlanList
(
params
)
{
addDemandPlanList
(
params
)
{
return
fetch
(
'/stock-info/v1/stock-info/stock-plan-report'
,
params
,
'post'
,
'json'
)
return
fetch
(
'/stock-info/v1/stock-info/stock-plan-report'
,
params
,
'post'
,
'json'
)
},
},
fetchLatestDemandPlan
(
params
)
{
//获取需求计划模板(最新)
fetchLatestDemandPlan
(
params
)
{
//获取需求计划模板(最新)
return
fetch
(
'/basic-info/v1/basic-info/basic-plan-report-tb/get-year-plan-report'
,
params
)
return
fetch
(
'/basic-info/v1/basic-info/basic-plan-report-tb/get-year-plan-report'
,
params
)
...
@@ -582,7 +573,7 @@ export default {
...
@@ -582,7 +573,7 @@ export default {
return
fetch
(
`/stock-info/v1/stock-info/stock-plan-report/batch-save-submit`
,
params
,
'post'
,
'json'
);
return
fetch
(
`/stock-info/v1/stock-info/stock-plan-report/batch-save-submit`
,
params
,
'post'
,
'json'
);
},
},
deleteDemandPlanList
(
params
)
{
// 需求计划列表删除
deleteDemandPlanList
(
params
)
{
// 需求计划列表删除
return
fetch
(
`/stock-info/v1/stock-info/stock-plan-report/
${
params
.
id
}
`
,
params
,
'delete'
)
return
fetch
(
`/stock-info/v1/stock-info/stock-plan-report/
${
params
.
id
}
`
,
params
,
'delete'
)
},
},
fetchCheckReportStatus
(
params
)
{
//校验单位上报状态
fetchCheckReportStatus
(
params
)
{
//校验单位上报状态
return
fetch
(
'/stock-info/v1/stock-info/stock-plan-report/check-report'
,
params
)
return
fetch
(
'/stock-info/v1/stock-info/stock-plan-report/check-report'
,
params
)
...
@@ -603,7 +594,7 @@ export default {
...
@@ -603,7 +594,7 @@ export default {
return
fetch
(
`/stock-info/v1/stock-info/supply-distribution/query-distribution`
,
params
);
return
fetch
(
`/stock-info/v1/stock-info/supply-distribution/query-distribution`
,
params
);
},
},
fetchSubmitSupply
(
params
)
{
//提交供应商
fetchSubmitSupply
(
params
)
{
//提交供应商
return
fetch
(
'/stock-info/v1/stock-info/supply-distribution/submit-supply'
,
params
,
'post'
,
'json'
)
return
fetch
(
'/stock-info/v1/stock-info/supply-distribution/submit-supply'
,
params
,
'post'
,
'json'
)
},
},
updateDemandPlan
(
params
)
{
//修改需求计划
updateDemandPlan
(
params
)
{
//修改需求计划
return
fetch
(
`/stock-info/v1/stock-info/stock-plan-report/
${
params
.
id
}
`
,
params
,
'put'
,
'json'
)
return
fetch
(
`/stock-info/v1/stock-info/stock-plan-report/
${
params
.
id
}
`
,
params
,
'put'
,
'json'
)
...
...
src/views/Home.vue
View file @
44ff79a9
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
created
()
{
created
()
{
//获取妇幼权限和登录基本信息
//获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市
// document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市
document
.
cookie
=
'bGNnd3lwdF9hdA=
e3f0d190-7544-495a-a299-c575d4c51e5f
;'
//云南省
document
.
cookie
=
'bGNnd3lwdF9hdA=
30bdc0e7-445f-4429-b6ad-6390994da651
;'
//云南省
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
);
...
...
src/views/components/allAreaSelect.vue
0 → 100644
View file @
44ff79a9
<
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
>
src/views/components/baiduEditor.vue
View file @
44ff79a9
...
@@ -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
()
{
...
...
src/views/indexComponent/InformedConsent/InformedConsent.vue
View file @
44ff79a9
...
@@ -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,16 +39,23 @@
...
@@ -46,16 +39,23 @@
]
]
},
},
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
;
}
}
}
})
})
},
},
...
@@ -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
>
src/views/indexComponent/inStockManage/inStockManage.vue
View file @
44ff79a9
...
@@ -10,15 +10,18 @@
...
@@ -10,15 +10,18 @@
</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>
...
@@ -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
{
is
NotBlank
,
is
EmptyParams
}
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,19 +172,21 @@
...
@@ -164,19 +172,21 @@
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
})
})
...
@@ -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,7 +287,8 @@
...
@@ -273,7 +287,8 @@
.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;
...
...
src/views/indexComponent/supplyManage/components/addSupply.vue
View file @
44ff79a9
...
@@ -32,21 +32,19 @@
...
@@ -32,21 +32,19 @@
</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"
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>
...
@@ -66,81 +64,70 @@
...
@@ -66,81 +64,70 @@
</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"
:loading=
"subLoad"
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
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
,
batchNumber
:
undefined
,
medicalId
:
undefined
,
factoryId
:
undefined
,
supplyName
:
undefined
,
classify
:
undefined
,
unitPrice
:
undefined
,
batchId
:
undefined
,
produceDate
:
undefined
,
expireDate
:
undefined
,
stockNum
:
undefined
},
formRules
:
{
formRules
:
{
breedId
:
[
supplierName
:
[
{
required
:
true
,
message
:
'请选择分类'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择供应商名称'
,
trigger
:
'change'
},
],
batchNumber
:[
{
required
:
true
,
message
:
'请选择分类'
,
trigger
:
'change'
}
],
classify
:
[
{
required
:
true
,
message
:
'请选择入库类型'
,
trigger
:
'change'
}
],
],
medicalId
:
[
contactsName
:
[
{
required
:
true
,
message
:
'请
选择品种名称
'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请
输入联系人
'
,
trigger
:
'change'
}
],
],
factoryId
:
[
contactsPhone
:
[
{
required
:
true
,
message
:
'请选择生产厂家'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入联系人电话'
,
trigger
:
'change'
},
{
validator
:
checkPhone
},
],
],
batchId
:
[
areaCode
:
[
{
required
:
true
,
message
:
'请
输入生产批次
'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请
选择联系地址
'
,
trigger
:
'change'
}
],
],
stockNum
:
[
address
:
[
{
required
:
true
,
message
:
'请输入药具数量'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入详细地址'
,
trigger
:
'change'
}
],
produceDate
:
[
{
required
:
true
,
message
:
'请选择日期'
,
trigger
:
'change'
}
],
expireDate
:
[
{
required
:
true
,
message
:
'请选择日期'
,
trigger
:
'change'
}
],
unitPrice
:
[
{
required
:
true
,
message
:
'请输入单价'
}
],
],
},
},
queryParams
:
{},
}
}
},
},
created
()
{
created
()
{
this
.
queryParams
=
this
.
$route
.
query
;
if
(
this
.
queryParams
.
modeType
===
"update"
)
{
this
.
$api
.
common
.
fetchSupplyById
(
this
.
queryParams
.
id
).
then
(
res
=>
{
console
.
log
(
889
,
res
.
data
)
if
(
res
.
code
===
'SUCCESS'
)
{
this
.
formData
=
res
.
data
;
}
}).
catch
(()
=>
{
});
}
},
},
methods
:
{
methods
:
{
// 弹窗确定按钮
// 弹窗确定按钮
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
}
};
vm
.
$api
.
stockManage
.
addHistoryStock
(
par
).
then
(
res
=>
{
if
(
this
.
queryParams
.
modeType
===
'add'
)
{
vm
.
$api
.
common
.
fetchAddSupply
(
par
).
then
(
res
=>
{
this
.
subLoad
=
false
;
this
.
subLoad
=
false
;
if
(
res
.
code
===
'SUCCESS'
)
{
if
(
res
.
code
===
'SUCCESS'
)
{
vm
.
$message
.
success
(
'保存成功!'
)
vm
.
$message
.
success
(
'保存成功!'
)
...
@@ -150,10 +137,22 @@
...
@@ -150,10 +137,22 @@
this
.
subLoad
=
false
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
})
}
}
});
});
},
},
goBack
()
{
goBack
()
{
closedDetail
(
'/supplyManage/add'
,
'/Home/supplyManage'
)
closedDetail
(
'/supplyManage/add'
,
'/Home/supplyManage'
)
}
}
},
},
}
}
...
...
src/views/indexComponent/supplyManage/supplyManage.vue
View file @
44ff79a9
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
<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
.
factory
Name
}}
{{
item
.
enum
Name
}}
</a-select-option>
</a-select-option>
</a-select>
</a-select>
</a-form-item>
</a-form-item>
...
@@ -27,20 +27,16 @@
...
@@ -27,20 +27,16 @@
: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-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>
<a-button
type=
"link"
size=
"small"
@
click=
"deleteConfirm(record)"
>
删除
</a-button>
</
template
>
</
template
>
</a-table>
</a-table>
...
@@ -60,7 +56,6 @@
...
@@ -60,7 +56,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
:
'供应商名称'
,
...
@@ -90,12 +85,12 @@
...
@@ -90,12 +85,12 @@
{
{
title
:
'状态'
,
title
:
'状态'
,
width
:
70
,
width
:
70
,
scopedSlots
:
{
customRender
:
'statusInfo'
},
dataIndex
:
'statusName'
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
align
:
'center'
,
align
:
'center'
,
width
:
1
1
0
,
width
:
1
5
0
,
scopedSlots
:
{
customRender
:
'action'
},
scopedSlots
:
{
customRender
:
'action'
},
},
},
]
]
...
@@ -105,7 +100,7 @@
...
@@ -105,7 +100,7 @@
return
{
return
{
// 搜索框对象
// 搜索框对象
searchForm
:
{
searchForm
:
{
supplierName
:
undefined
,
supplierName
:
undefined
,
status
:
''
status
:
''
},
},
pagination
:
{
pagination
:
{
...
@@ -117,27 +112,28 @@
...
@@ -117,27 +112,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
.
get
InStock
List
()
this
.
get
Supply
List
()
},
},
get
InStock
List
()
{
get
Supply
List
()
{
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
.
fetchInStock
List
(
par
).
then
(({
data
=
{}})
=>
{
this
.
$api
.
common
.
fetchSupplyPage
List
(
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
...
@@ -149,30 +145,30 @@
...
@@ -149,30 +145,30 @@
showSizeChange
(
pageNum
,
pageSize
)
{
showSizeChange
(
pageNum
,
pageSize
)
{
this
.
pagination
.
pageIndex
=
1
;
this
.
pagination
.
pageIndex
=
1
;
this
.
pagination
.
pageSize
=
pageSize
;
this
.
pagination
.
pageSize
=
pageSize
;
this
.
get
InStock
List
()
this
.
get
Supply
List
()
},
},
change
(
pageNum
,
pageSize
)
{
change
(
pageNum
,
pageSize
)
{
this
.
pagination
.
pageIndex
=
pageNum
;
this
.
pagination
.
pageIndex
=
pageNum
;
this
.
pagination
.
pageSize
=
pageSize
;
this
.
pagination
.
pageSize
=
pageSize
;
this
.
get
InStock
List
()
this
.
get
Supply
List
()
},
},
restSearchForm
()
{
restSearchForm
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
idCar
:
undefined
idCar
:
undefined
}
}
this
.
searchList
()
this
.
searchList
()
},
},
toAdd
()
{
toAdd
()
{
this
.
$router
.
push
({
path
:
'/supplyManage/add'
})
this
.
$router
.
push
({
path
:
'/supplyManage/add'
,
query
:
{
modeType
:
"add"
}});
},
},
changeStatus
(
record
)
{
changeStatus
(
record
)
{
let
par
=
{
let
par
=
{
...
recor
d
,
id
:
record
.
i
d
,
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
.
get
InStock
List
()
this
.
get
Supply
List
()
}
}
})
})
},
},
...
@@ -182,13 +178,10 @@
...
@@ -182,13 +178,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
.
get
InStock
List
()
this
.
get
Supply
List
()
this
.
$message
.
success
(
'删除成功!'
)
this
.
$message
.
success
(
'删除成功!'
)
}
}
})
})
...
@@ -199,6 +192,10 @@
...
@@ -199,6 +192,10 @@
},
},
});
});
},
},
updateSupply
(
record
)
{
this
.
$router
.
push
({
path
:
'/supplyManage/add'
,
query
:
{
modeType
:
"update"
,
id
:
record
.
id
}});
console
.
log
()
}
},
},
}
}
</
script
>
</
script
>
...
@@ -217,6 +214,7 @@
...
@@ -217,6 +214,7 @@
.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);
...
...
src/views/utils/common.js
View file @
44ff79a9
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"
;
...
@@ -7,7 +6,7 @@ import router from "../../router";
...
@@ -7,7 +6,7 @@ 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,36 +54,38 @@ export const isEmptyParams = (obj) => {
...
@@ -55,36 +54,38 @@ 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
)
{
...
@@ -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
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment