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
58ecd244
Commit
58ecd244
authored
Jul 28, 2021
by
罗成兵
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gcl' of
http://gitlab.yiboshi.com/ynby/folacin-front
into gcl
parents
8f17935e
2e2c6cca
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
123 additions
and
24 deletions
+123
-24
main.js
src/main.js
+1
-0
index.js
src/router/index.js
+1
-1
Home.vue
src/views/Home.vue
+1
-1
Login.vue
src/views/Login.vue
+5
-3
addDistributionWarehousing.vue
...tionWarehousing/components/addDistributionWarehousing.vue
+1
-0
distributionWarehousingDetail.vue
...nWarehousing/components/distributionWarehousingDetail.vue
+26
-3
distributionWarehousing.vue
...onent/distributionWarehousing/distributionWarehousing.vue
+3
-3
sendRecord.vue
...ews/indexComponent/distributionWarehousing/sendRecord.vue
+1
-1
folviteDistributionDetail.vue
...viteDistribution/components/folviteDistributionDetail.vue
+9
-4
addStock.vue
...iews/indexComponent/inStockManage/components/addStock.vue
+3
-0
inStockManageDetail.vue
...omponent/inStockManage/components/inStockManageDetail.vue
+7
-3
inStockManage.vue
src/views/indexComponent/inStockManage/inStockManage.vue
+40
-5
remarkNum.js
src/views/utils/directives/remarkNum.js
+25
-0
No files found.
src/main.js
View file @
58ecd244
...
@@ -19,6 +19,7 @@ import './views/utils/directives/debounce'
...
@@ -19,6 +19,7 @@ import './views/utils/directives/debounce'
import
'./views/utils/directives/throttle'
import
'./views/utils/directives/throttle'
import
'./views/utils/directives/int'
import
'./views/utils/directives/int'
import
'./views/utils/directives/price'
import
'./views/utils/directives/price'
import
'./views/utils/directives/remarkNum'
import
{
message
,
modal
}
from
'ant-design-vue'
import
{
message
,
modal
}
from
'ant-design-vue'
const
{
confirm
}
=
modal
const
{
confirm
}
=
modal
...
...
src/router/index.js
View file @
58ecd244
...
@@ -28,7 +28,7 @@ const routes = [
...
@@ -28,7 +28,7 @@ const routes = [
//分配入库
//分配入库
{
path
:
'distributionWarehousing'
,
name
:
'分配入库列表'
,
component
:
()
=>
import
(
'@/views/indexComponent/distributionWarehousing/distributionWarehousing.vue'
)},
{
path
:
'distributionWarehousing'
,
name
:
'分配入库列表'
,
component
:
()
=>
import
(
'@/views/indexComponent/distributionWarehousing/distributionWarehousing.vue'
)},
//发货方分配记录
//发货方分配记录
{
path
:
'sendRecord'
,
name
:
'
分配入库列表
'
,
component
:
()
=>
import
(
'@/views/indexComponent/distributionWarehousing/sendRecord.vue'
)},
{
path
:
'sendRecord'
,
name
:
'
发货方分配记录
'
,
component
:
()
=>
import
(
'@/views/indexComponent/distributionWarehousing/sendRecord.vue'
)},
//出入库记录
//出入库记录
{
path
:
'stockTransfer'
,
name
:
'出入库记录'
,
component
:
()
=>
import
(
'@/views/indexComponent/stockTransfer/stockTransfer.vue'
)},
{
path
:
'stockTransfer'
,
name
:
'出入库记录'
,
component
:
()
=>
import
(
'@/views/indexComponent/stockTransfer/stockTransfer.vue'
)},
//叶酸申请管理
//叶酸申请管理
...
...
src/views/Home.vue
View file @
58ecd244
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
},
},
created
()
{
created
()
{
//获取妇幼权限和登录基本信息
//获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=ef814f88-005f-4820-830d-b834edb47a55
;'//昆明市
document
.
cookie
=
'bGNnd3lwdF9hdA=47ae90f0-18e0-4553-9983-22213c9d378e
;'
//昆明市
// document.cookie = 'bGNnd3lwdF9hdA=' + sessionStorage.getItem("loginToken") + ';'//云南省
// document.cookie = 'bGNnd3lwdF9hdA=' + sessionStorage.getItem("loginToken") + ';'//云南省
let
cookieToken
=
getCookie
(
'bGNnd3lwdF9hdA'
);
let
cookieToken
=
getCookie
(
'bGNnd3lwdF9hdA'
);
console
.
log
(
'tokenInfo'
,
cookieToken
)
console
.
log
(
'tokenInfo'
,
cookieToken
)
...
...
src/views/Login.vue
View file @
58ecd244
<!--
<template>
<template>
<div class="login_container">
<div class="login_container">
<div class="login_box">
<div class="login_box">
...
@@ -8,9 +9,9 @@
...
@@ -8,9 +9,9 @@
</div>
</div>
<a-form-model :model="formData" :rules="formRules" class="login_form" ref="formRef">
<a-form-model :model="formData" :rules="formRules" class="login_form" ref="formRef">
<a-form-model-item prop="username">
<a-form-model-item prop="username">
<!--
<a-input
placeholder=
"请输入用户名"
v-model=
"formData.username"
size=
"large"
@
keyup
.
enter=
"login"
>
-->
<!– <a-input placeholder="请输入用户名" v-model="formData.username" size="large" @keyup.enter="login">–>
<!--
<a-icon
slot=
"prefix"
type=
"user"
/>
-->
<!– <a-icon slot="prefix" type="user"/>–>
<!--
</a-input>
-->
<!– </a-input>–>
<a-select v-model="formData.username" size="large" @change="userChange">
<a-select v-model="formData.username" size="large" @change="userChange">
<a-select-option v-for="(i,index) in userList" :key="i.userName" :value="index">
<a-select-option v-for="(i,index) in userList" :key="i.userName" :value="index">
{{i.unitName+"("+i.userName+")"}}
{{i.unitName+"("+i.userName+")"}}
...
@@ -156,4 +157,5 @@
...
@@ -156,4 +157,5 @@
}
}
}
}
</style>
</style>
–>
-->
-->
src/views/indexComponent/distributionWarehousing/components/addDistributionWarehousing.vue
View file @
58ecd244
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
:wrapperCol="{span: 15}">
:wrapperCol="{span: 15}">
<a-textarea
<a-textarea
:rows=
"6"
:rows=
"6"
v-toRemarkNum
v-model=
"formData.remarks"
v-model=
"formData.remarks"
placeholder=
"请输入备注"
></a-textarea>
placeholder=
"请输入备注"
></a-textarea>
</a-form-model-item>
</a-form-model-item>
...
...
src/views/indexComponent/distributionWarehousing/components/distributionWarehousingDetail.vue
View file @
58ecd244
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<span
style=
"font-size: 18px;font-weight: 600;"
>
分配入库详情
</span>
<span
style=
"font-size: 18px;font-weight: 600;"
>
分配入库详情
</span>
</div>
</div>
<div
style=
"margin-top: 16px"
>
<div
style=
"margin-top: 16px"
>
<a-descriptions
bordered
:column=
"
{ sm: 2, xs: 1 }">
<a-descriptions
bordered
:column=
"
{ sm: 2, xs: 1 }"
class="dis_title"
>
<a-descriptions-item
label=
"发货单位"
>
<a-descriptions-item
label=
"发货单位"
>
{{
detailInfo
.
sendUnitName
||
'--'
}}
{{
detailInfo
.
sendUnitName
||
'--'
}}
</a-descriptions-item>
</a-descriptions-item>
...
@@ -42,7 +42,9 @@
...
@@ -42,7 +42,9 @@
</a-descriptions-item>
</a-descriptions-item>
<a-descriptions-item
label=
"入库状态"
>
<a-descriptions-item
label=
"入库状态"
>
{{
detailInfo
.
statusName
||
'--'
}}
<div
:class=
"detailInfo.statusName == '待入库' ? 'ready_stock' : 'in_stock'"
>
<span>
{{
detailInfo
.
statusName
||
'--'
}}
</span>
</div>
</a-descriptions-item>
</a-descriptions-item>
</a-descriptions>
</a-descriptions>
<a-form-model
ref=
"formRef"
<a-form-model
ref=
"formRef"
...
@@ -56,6 +58,7 @@
...
@@ -56,6 +58,7 @@
:wrapperCol="{span: 15}">
:wrapperCol="{span: 15}">
<a-textarea
<a-textarea
:disabled=
"true"
:disabled=
"true"
v-toRemarkNum
:rows=
"6"
:rows=
"6"
v-model=
"detailInfo.remarks"
v-model=
"detailInfo.remarks"
placeholder=
"请输入备注"
></a-textarea>
placeholder=
"请输入备注"
></a-textarea>
...
@@ -97,5 +100,25 @@
...
@@ -97,5 +100,25 @@
}
}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.dis_title {
.ant-descriptions-item-label {
width: 120px;
}
}
.ready_stock {
width: 52px;
text-align: center;
padding: 3px 8px;
background:#FFF7E6;
border: 1px solid #FFD591;
color: #FA8C16
}
.in_stock {
width: 52px;
text-align: center;
padding: 3px 8px;
background: #e4e7eb;
border: 1px solid greenyellow;
color: #52C41A
}
</
style
>
</
style
>
src/views/indexComponent/distributionWarehousing/distributionWarehousing.vue
View file @
58ecd244
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<date-range-picker
:date
.
sync=
"searchForm.date"
></date-range-picker>
<date-range-picker
:date
.
sync=
"searchForm.date"
></date-range-picker>
</a-form-item>
</a-form-item>
<a-button
type=
"primary"
class=
"search_btn"
icon=
"search"
@
click=
"searchList"
>
搜索
</a-button>
<a-button
type=
"primary"
class=
"search_btn"
icon=
"search"
@
click=
"searchList"
>
搜索
</a-button>
<a-button
class=
"search_btn"
style=
"margin-left: 10px"
icon=
"
close
"
@
click=
"restSearchForm"
>
清空
</a-button>
<a-button
class=
"search_btn"
style=
"margin-left: 10px"
icon=
"
sync
"
@
click=
"restSearchForm"
>
清空
</a-button>
<!--
<a-button
type=
"primary"
class=
"search_btn"
icon=
"download"
style=
"float: right"
@
click=
"downloadExcel"
>
-->
<!--
<a-button
type=
"primary"
class=
"search_btn"
icon=
"download"
style=
"float: right"
@
click=
"downloadExcel"
>
-->
<!-- 导出Excel-->
<!-- 导出Excel-->
<!--
</a-button>
-->
<!--
</a-button>
-->
...
@@ -143,13 +143,13 @@
...
@@ -143,13 +143,13 @@
methods
:
{
methods
:
{
getEnumListInfo
()
{
getEnumListInfo
()
{
if
(
window
.
sessionStorage
.
getItem
(
'allEnum'
))
{
if
(
window
.
sessionStorage
.
getItem
(
'allEnum'
))
{
this
.
statusList
=
getEnumByFlag
(
"folacin_
resident_info
_status"
);
this
.
statusList
=
getEnumByFlag
(
"folacin_
stock_record
_status"
);
}
else
{
}
else
{
let
par
=
{}
let
par
=
{}
this
.
$api
.
fyManage
.
fetchFYLoginUser
(
par
).
then
(({
data
})
=>
{
this
.
$api
.
fyManage
.
fetchFYLoginUser
(
par
).
then
(({
data
})
=>
{
window
.
sessionStorage
.
setItem
(
'allEnum'
,
JSON
.
stringify
(
data
.
enumValueList
))
window
.
sessionStorage
.
setItem
(
'allEnum'
,
JSON
.
stringify
(
data
.
enumValueList
))
window
.
sessionStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
data
.
userInfo
));
window
.
sessionStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
data
.
userInfo
));
this
.
statusList
=
getEnumByFlag
(
"folacin_
resident_info
_status"
);
this
.
statusList
=
getEnumByFlag
(
"folacin_
stock_record
_status"
);
})
})
}
}
},
},
...
...
src/views/indexComponent/distributionWarehousing/sendRecord.vue
View file @
58ecd244
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<dateRangePicker
:date
.
sync=
"searchForm.date"
></dateRangePicker>
<dateRangePicker
:date
.
sync=
"searchForm.date"
></dateRangePicker>
</a-form-item>
</a-form-item>
<a-button
type=
"primary"
class=
"search_btn"
icon=
"search"
@
click=
"searchList"
>
搜索
</a-button>
<a-button
type=
"primary"
class=
"search_btn"
icon=
"search"
@
click=
"searchList"
>
搜索
</a-button>
<a-button
class=
"search_btn"
style=
"margin-left: 10px"
icon=
"
close
"
@
click=
"restSearchForm"
>
清空
</a-button>
<a-button
class=
"search_btn"
style=
"margin-left: 10px"
icon=
"
sync
"
@
click=
"restSearchForm"
>
清空
</a-button>
<!--
<a-button
type=
"primary"
class=
"search_btn"
icon=
"download"
style=
"float: right"
@
click=
"downloadExcel"
>
-->
<!--
<a-button
type=
"primary"
class=
"search_btn"
icon=
"download"
style=
"float: right"
@
click=
"downloadExcel"
>
-->
<!-- 导出Excel-->
<!-- 导出Excel-->
<!--
</a-button>
-->
<!--
</a-button>
-->
...
...
src/views/indexComponent/folviteDistribution/components/folviteDistributionDetail.vue
View file @
58ecd244
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</div>
</div>
<div
style=
"clear: both"
></div>
<div
style=
"clear: both"
></div>
</div>
</div>
<a-descriptions
bordered
>
<a-descriptions
bordered
class=
"folvite_title"
>
<a-descriptions-item
label=
"姓名"
>
<a-descriptions-item
label=
"姓名"
>
{{
detailInfo
.
womanName
||
'--'
}}
{{
detailInfo
.
womanName
||
'--'
}}
</a-descriptions-item>
</a-descriptions-item>
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
</div>
</div>
<div
style=
"clear: both"
></div>
<div
style=
"clear: both"
></div>
</div>
</div>
<a-descriptions
bordered
>
<a-descriptions
bordered
class=
"folvite_title"
>
<a-descriptions-item
label=
"姓名"
>
<a-descriptions-item
label=
"姓名"
>
{{
detailInfo
.
manName
||
'--'
}}
{{
detailInfo
.
manName
||
'--'
}}
</a-descriptions-item>
</a-descriptions-item>
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
</div>
</div>
<div
style=
"clear: both"
></div>
<div
style=
"clear: both"
></div>
</div>
</div>
<a-descriptions
bordered
>
<a-descriptions
bordered
class=
"folvite_title"
>
<a-descriptions-item
label=
"联系电话"
>
<a-descriptions-item
label=
"联系电话"
>
{{
detailInfo
.
telephone
||
'--'
}}
{{
detailInfo
.
telephone
||
'--'
}}
</a-descriptions-item>
</a-descriptions-item>
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
<div
class=
"divider_my"
><span
class=
"midText"
>
发放信息
</span></div>
<div
class=
"divider_my"
><span
class=
"midText"
>
发放信息
</span></div>
</div>
</div>
<div
style=
"clear: both"
></div>
<div
style=
"clear: both"
></div>
<a-descriptions
bordered
:column=
"2"
>
<a-descriptions
bordered
:column=
"2"
class=
"folvite_title"
>
<a-descriptions-item
label=
"发放日期"
>
<a-descriptions-item
label=
"发放日期"
>
{{
detailInfo
.
provideDate
||
'--'
}}
{{
detailInfo
.
provideDate
||
'--'
}}
</a-descriptions-item>
</a-descriptions-item>
...
@@ -195,4 +195,9 @@
...
@@ -195,4 +195,9 @@
.no_border {
.no_border {
border-top: 0px;
border-top: 0px;
}
}
.folvite_title {
.ant-descriptions-item-label {
width: 140px;
}
}
</
style
>
</
style
>
src/views/indexComponent/inStockManage/components/addStock.vue
View file @
58ecd244
...
@@ -177,6 +177,9 @@
...
@@ -177,6 +177,9 @@
unitPrice
:
[
unitPrice
:
[
{
required
:
true
,
message
:
'请输入单价'
}
{
required
:
true
,
message
:
'请输入单价'
}
],
],
handler
:[
{
required
:
true
,
message
:
'请输入入库经手人'
}
],
remarks
:
[
remarks
:
[
{
required
:
false
,
message
:
'请输入备注'
}
{
required
:
false
,
message
:
'请输入备注'
}
],
],
...
...
src/views/indexComponent/inStockManage/components/inStockManageDetail.vue
View file @
58ecd244
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<span
style=
"font-size: 18px;font-weight: 600;"
>
药具详情
</span>
<span
style=
"font-size: 18px;font-weight: 600;"
>
药具详情
</span>
</div>
</div>
<div
style=
"margin-top: 16px"
>
<div
style=
"margin-top: 16px"
>
<a-descriptions
bordered
:column=
"
{ sm: 2, xs: 1 }">
<a-descriptions
bordered
:column=
"
{ sm: 2, xs: 1 }"
class="detail_title"
>
<a-descriptions-item
label=
"供应商"
>
<a-descriptions-item
label=
"供应商"
>
{{
detailInfo
.
supplierName
||
'--'
}}
{{
detailInfo
.
supplierName
||
'--'
}}
</a-descriptions-item>
</a-descriptions-item>
...
@@ -75,6 +75,10 @@
...
@@ -75,6 +75,10 @@
},
},
}
}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
>
.detail_title{
.ant-descriptions-item-label {
width: 120px;
}
}
</
style
>
</
style
>
src/views/indexComponent/inStockManage/inStockManage.vue
View file @
58ecd244
...
@@ -20,8 +20,7 @@
...
@@ -20,8 +20,7 @@
<a-form-item
label=
"入库日期"
>
<a-form-item
label=
"入库日期"
>
<dateRangePicker
:date
.
sync=
"searchForm.date"
></dateRangePicker>
<dateRangePicker
:date
.
sync=
"searchForm.date"
></dateRangePicker>
</a-form-item>
</a-form-item>
<a-button
type=
"primary"
icon=
"search"
class=
"search_btn"
@
click=
"searchList"
>
搜索
</a-button>
<a-button
class=
"search_btn"
icon=
"close"
style=
"margin-left: 10px"
@
click=
"restSearchForm"
>
清空
</a-button>
<!--
<div>
<!--
<div>
<a-button
type=
"primary"
icon=
"plus"
class=
"search_btn btn_space"
@
click=
"openModal"
>
库存录入
</a-button>
<a-button
type=
"primary"
icon=
"plus"
class=
"search_btn btn_space"
@
click=
"openModal"
>
库存录入
</a-button>
...
@@ -32,9 +31,12 @@
...
@@ -32,9 +31,12 @@
<a-button
type=
"primary"
icon=
"download"
class=
"search_btn btn_space"
@
click=
"downLoadExcel"
>
导出Excel
<a-button
type=
"primary"
icon=
"download"
class=
"search_btn btn_space"
@
click=
"downLoadExcel"
>
导出Excel
</a-button>
</a-button>
</div>
-->
</div>
-->
<div
style=
"clear: both"
></div>
</a-form>
</a-form>
<<<<<<<
HEAD
<div
style=
"display: flex;justify-content: space-between;align-items: center"
>
<div
style=
"margin-bottom: 10px"
>
<a-button
type=
"primary"
class=
"search_btn btn_space"
@
click=
"openModal"
>
库存录入
</a-button>
=======
<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"
...
@@ -67,13 +69,46 @@
...
@@ -67,13 +69,46 @@
<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"
v-if=
"unitInfo.level==3"
>
库存录入
<a-button
type=
"primary"
class=
"search_btn btn_space "
@
click=
"openModal"
v-if=
"unitInfo.level==3"
>
库存录入
</a-button>
</a-button>
>>>>>>> fbd12a958098f3e382d31073b40fdabcff46e375
<a-button
type=
"primary"
class=
"search_btn btn_space"
:disabled=
"selectedRowKeys.length
<
=
0
"
<a-button
type=
"primary"
class=
"search_btn btn_space"
:disabled=
"selectedRowKeys.length
<
=
0
"
v-if=
"unitInfo.level==3||unitInfo.level==4"
v-if=
"unitInfo.level==3||unitInfo.level==4"
@
click=
"toAdd"
>
调拨分配
@
click=
"toAdd"
>
调拨分配
</a-button>
</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
style=
"display: inline-block;line-height: 32px;background-color: #E6F7FF;cursor: pointer"
@
click=
"showSelectedMedical"
v-if=
"selectedRowKeys.length > 0"
>
<a-popover
v-model=
"selectedVisible"
trigger=
"click"
placement=
"bottomRight"
>
<div
slot=
"content"
style=
"min-width: 300px"
>
<div>
<span
style=
"padding: 5px 16px;color: #FF4D80"
>
已选择叶酸(
{{
selectedRowKeys
.
length
}}
)
</span>
</div>
<div
style=
"margin-top: 10px"
>
<a-list
item-layout=
"horizontal"
:data-source=
"selectedRowList"
>
<a-list-item
slot=
"renderItem"
slot-scope=
"item, index"
>
<a
slot=
"actions"
@
click=
"delSelectedKey(index)"
>
删除
</a>
<a-list-item-meta
:description=
"item.brandName"
>
</a-list-item-meta>
</a-list-item>
</a-list>
</div>
</div>
<span
style=
"padding: 5px 16px;color: #FF4D80"
>
已选择叶酸
{{
selectedRowKeys
.
length
}}
条
<a-icon
type=
"down"
style=
"margin-left:10px;font-size: 10px"
/>
</span>
</a-popover>
</div>
</div>
<div>
<a-button
type=
"primary"
icon=
"search"
class=
"search_btn"
@
click=
"searchList"
>
搜索
</a-button>
<a-button
class=
"search_btn"
icon=
"sync"
style=
"margin-left: 10px"
@
click=
"restSearchForm"
>
清空
</a-button>
</div>
</div>
</div>
<div
style=
"clear: both"
></div>
<div
style=
"clear: both"
></div>
<a-table
:dataSource=
"tableData"
<a-table
:dataSource=
"tableData"
:columns=
"columns"
:columns=
"columns"
...
...
src/views/utils/directives/remarkNum.js
0 → 100644
View file @
58ecd244
import
Vue
from
'vue'
//text-area 限制输入字数
//v-toRemarkNum= {num:4}
Vue
.
directive
(
'toRemarkNum'
,
{
// 指令的定义
inserted
:
function
(
el
,
binding
,
vnode
)
{
el
.
addEventListener
(
'keyup'
,
function
()
{
if
(
binding
.
value
)
{
checkValue
(
el
,
binding
.
value
.
num
)
}
else
{
checkValue
(
el
,
200
)
}
})
function
checkValue
(
el
,
defu
)
{
debugger
let
len
=
el
.
value
.
length
if
(
el
.
value
&&
len
>
defu
)
{
el
.
value
=
el
.
value
.
substring
(
0
,
defu
);
el
.
dispatchEvent
(
new
Event
(
"textarea"
));
//调用input事件使vue v-model绑定更新
}
}
}
})
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