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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
254 additions
and
128 deletions
+254
-128
index.js
src/api/index.js
+0
-0
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
+30
-21
inStockManage.vue
src/views/indexComponent/inStockManage/inStockManage.vue
+47
-32
addSupply.vue
...iews/indexComponent/supplyManage/components/addSupply.vue
+0
-0
supplyManage.vue
src/views/indexComponent/supplyManage/supplyManage.vue
+38
-40
common.js
src/views/utils/common.js
+53
-34
No files found.
src/api/index.js
View file @
44ff79a9
This diff is collapsed.
Click to expand it.
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,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
>
src/views/indexComponent/inStockManage/inStockManage.vue
View file @
44ff79a9
...
@@ -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
{
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,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
>
src/views/indexComponent/supplyManage/components/addSupply.vue
View file @
44ff79a9
This diff is collapsed.
Click to expand it.
src/views/indexComponent/supplyManage/supplyManage.vue
View file @
44ff79a9
...
@@ -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
.
factory
Name
}}
{{
item
.
enum
Name
}}
</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,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,10 +214,11 @@
...
@@ -217,10 +214,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
>
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"
;
...
@@ -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
)
}
}
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