Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
柳 佳乐
finance
Commits
17929662
Commit
17929662
authored
Nov 14, 2022
by
cx49085
Browse files
bug修复
parent
2423ec69
Changes
10
Show whitespace changes
Inline
Side-by-side
.env.development
View file @
17929662
...
...
@@ -3,7 +3,7 @@ ENV = 'development'
# base api 后端url
#VUE_APP_BASE_API = 'http://192.168.10.107:7080'
VUE_APP_BASE_API = 'http://192.168.10.109:11523'
#
VUE_APP_BASE_API = 'http://www.aishuhong.com:11549/prod-api/
·
'
#
VUE_APP_BASE_API = 'http://192.168.10.109:11523'
VUE_APP_BASE_API = 'http://www.aishuhong.com:11549/prod-api/'
#VUE_APP_BASE_API = 'http://192.168.31.100:7081'
src/utils/myValidate.js
View file @
17929662
...
...
@@ -122,3 +122,13 @@ export function money(rule, value, callback) {
callback
(
new
Error
(
"
金额格式错误
"
));
}
};
//校验账号密码,只允许数字和字母
export
function
account_password_valid
(
rule
,
value
,
callback
){
let
reg
=
/^
[
a-zA-Z0-9
]
*$/
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
"
格式错误,只允许输入数字和字母
"
));
}
}
\ No newline at end of file
src/views/contract/components/addContract.vue
View file @
17929662
...
...
@@ -6,74 +6,104 @@
<!--
<i
class=
"el-icon-close"
@
click=
"closeDrawer"
></i>
-->
</div>
<div
class=
"container"
>
<el-form>
<el-form
v-model=
"formData"
:rules=
"addFormValidRules"
ref=
"form"
>
<el-descriptions
:column=
"3"
border
class=
"contract-description-form"
>
<el-descriptions-item
label=
"母合同名称"
:span=
"3"
v-if=
"parseInt(formData.contractNature) === 2"
>
<el-select
v-model=
"formData.contractParent"
:style=
"
{ width: '100%' }" placeholder="请选择母合同名称">
<el-form-item
prop=
"contractParent"
>
<el-select
v-model=
"formData.contractParent"
:style=
"
{ width: '100%' }"
placeholder="请选择母合同名称">
<el-option
v-for=
"(item, index) in contractParentList"
:key=
"item.contractId"
:value=
"item.contractId"
:label=
"item.name"
></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同名称"
:span=
"2"
labelClassName=
"required"
content-class-name=
"my-content"
>
<el-form-item
prop=
"contractName"
>
<el-input
placeholder=
"请输入合同名称"
v-model=
"formData.contractName"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同性质"
labelClassName=
"required"
>
{{
contractNatures
[
formData
.
contractNature
]
}}
</el-descriptions-item>
<el-descriptions-item
label=
"合同乙方"
labelClassName=
"required"
>
<el-form-item
prop=
"contractPaetyb"
>
<el-input
placeholder=
"请输入合同名称合同乙方"
v-model=
"formData.contractPaetyb"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同编号"
labelClassName=
"required"
>
<el-form-item
prop=
"contractNumber"
>
<el-input
placeholder=
"请输入合同编号"
v-model=
"formData.contractNumber"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同类型"
labelClassName=
"required"
>
<el-form-item
prop=
"typeId"
>
<el-select
v-model=
"formData.typeId"
:style=
"
{ width: '100%' }" placeholder="请选择合同类型">
<el-option
v-for=
"(item, index) in contractTypeList"
:key=
"item.id"
:value=
"item.id"
:label=
"item.name"
></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"客户名称(甲方)"
labelClassName=
"required"
>
<el-form-item
prop=
"contractFirstParty"
>
<el-input
placeholder=
"请输入客户名称(甲方)"
v-model=
"formData.contractFirstParty"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"甲方签订人"
labelClassName=
"required"
>
<el-form-item
prop=
"firstParty"
>
<el-input
placeholder=
"请输入甲方签订人"
v-model=
"formData.firstParty"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"客户联系电话"
labelClassName=
"required"
>
<el-form-item
prop=
"firstPartyPhone"
>
<el-input
placeholder=
"请输入客户联系电话"
v-model=
"formData.firstPartyPhone"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"客户联系地址"
labelClassName=
"required"
>
<el-form-item
prop=
"firstPartyAddress"
>
<el-input
placeholder=
"请输入客户联系地址"
v-model=
"formData.firstPartyAddress"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同开始日期"
labelClassName=
"required"
>
<el-date-picker
align=
"right"
type=
"datetime"
:style=
"
{ width: '100%' }" placeholder="请输入合同签订时间"
format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
<el-form-item
prop=
"contractStartTime"
>
<el-date-picker
align=
"right"
type=
"datetime"
:style=
"
{ width: '100%' }"
placeholder="请输入合同签订时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="formData.contractStartTime">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同结束日期"
labelClassName=
"required"
>
<el-date-picker
align=
"right"
type=
"datetime"
:style=
"
{ width: '100%' }" placeholder="请输入合同签订时间"
v-model="formData.contractEndTime" format="yyyy-MM-dd HH:mm:ss"
<el-form-item
prop=
"contractEndTime"
>
<el-date-picker
align=
"right"
type=
"datetime"
:style=
"
{ width: '100%' }"
placeholder="请输入合同签订时间" v-model="formData.contractEndTime" format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同金额"
labelClassName=
"required"
>
<el-form-item
prop=
"contractMoney"
>
<el-input
placeholder=
"请输入合同金额"
type=
"number"
v-model=
"formData.contractMoney"
step=
“0.01”
>
</el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"是否含税"
labelClassName=
"required"
>
<el-form-item
prop=
"tax"
>
<el-radio-group
v-model=
"formData.tax"
>
<el-radio
label=
"0"
>
含税
</el-radio>
<el-radio
label=
"1"
>
不含税
</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"税点"
labelClassName=
"required"
>
<el-input
placeholder=
"请输入税点"
type=
"number"
v-model=
"formData.taxPoint"
min=
“0.00”
step=
“0.01”
>
<el-form-item
prop=
"taxPoint"
>
<el-input
placeholder=
"请输入税点"
type=
"number"
v-model=
"formData.taxPoint"
min=
“0.00”
step=
“0.01”
>
</el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同附件"
>
...
...
@@ -108,26 +138,36 @@
</div>
<el-descriptions
:column=
"3"
border
class=
"contract-description-form"
>
<el-descriptions-item
label=
"乙方签订人"
labelClassName=
"required"
>
<el-form-item
prop=
"partybName"
>
<el-input
placeholder=
"请输入乙方签订人"
v-model=
"formData.partybName"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同签订时间"
labelClassName=
"required"
>
<el-form-item
prop=
"signingTime"
>
<el-date-picker
v-model=
"formData.signingTime"
align=
"right"
type=
"datetime"
placeholder=
"请输入合同签订时间"
format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同制定人"
labelClassName=
"required"
>
<el-form-item
prop=
"preparedBy"
>
<el-input
placeholder=
"请输入合同制定人"
v-model=
"formData.preparedBy"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同保管人"
labelClassName=
"required"
>
<el-form-item
prop=
"safekeeping"
>
<el-input
placeholder=
"请输入合同保管人"
v-model=
"formData.safekeeping"
></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
<div
class=
"cell-border"
>
备注
</div>
<div
class=
"cell-border"
>
<el-form-item
prop=
"contarctRemarks"
>
<el-input
type=
"textarea"
v-model=
"formData.contarctRemarks"
></el-input>
</el-form-item>
</div>
<br
/>
<el-form-item>
...
...
@@ -145,6 +185,7 @@ import { deepClone } from '@/utils'
import
{
contractNatures
}
from
'
../contractStaticData
'
import
{
mapGetters
}
from
'
vuex
'
import
{
downloadPDFFile
}
from
'
@/utils/download
'
import
{
checkPhone
}
from
'
@/utils/myValidate
'
export
default
{
// props: ['drawerVisible'],
data
()
{
...
...
@@ -252,7 +293,7 @@ export default {
this
.
$message
.
success
(
"
成功添加合同
"
)
this
.
addContractFile
(
res
.
data
)
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
'
/contractList
'
})
this
.
$router
.
push
({
path
:
'
/contractList
'
})
},
1000
);
}
else
{
this
.
$message
.
warning
(
"
添加合同失败
"
)
...
...
@@ -264,7 +305,7 @@ export default {
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
成功修改合同
"
)
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
'
/contractList
'
})
this
.
$router
.
push
({
path
:
'
/contractList
'
})
},
1000
);
}
else
{
this
.
$message
.
warning
(
"
添加修改失败
"
)
...
...
@@ -329,16 +370,16 @@ export default {
})
},
handleDownload
(
file
)
{
let
{
name
,
filePath
}
=
file
let
{
name
,
filePath
}
=
file
let
url
=
process
.
env
.
VUE_APP_BASE_API
+
filePath
;
downloadPDFFile
(
url
,
name
)
},
handleRemove
(
file
)
{
deleteContract
(
file
).
then
(
res
=>
{
if
(
res
.
success
){
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
成功删除合同文件
"
)
this
.
getContractFiles
(
file
.
contractId
)
}
else
{
}
else
{
this
.
$message
.
warning
(
"
删除合同文件失败
"
)
}
})
...
...
@@ -348,13 +389,16 @@ export default {
delete
requiredParams
.
contractParentName
let
result
=
[]
delete
requiredParams
.
contarctRemarks
if
(
!
this
.
$route
.
query
.
checkedContractNature
||
this
.
$route
.
query
.
checkedContractNature
.
toString
()
!==
'
2
'
){
if
(
!
this
.
$route
.
query
.
checkedContractNature
||
this
.
$route
.
query
.
checkedContractNature
.
toString
()
!==
'
2
'
)
{
delete
requiredParams
.
contractParent
//非母合同
}
for
(
const
key
in
requiredParams
)
{
if
(
!
requiredParams
[
key
]
&&
requiredParams
[
key
]
!==
0
){
if
(
!
requiredParams
[
key
]
&&
requiredParams
[
key
]
!==
0
)
{
result
.
push
(
key
)
}
// else if(key === '' && !checkPhone(requiredParams[key])){
// }
}
return
result
}
...
...
src/views/contract/contractList.vue
View file @
17929662
...
...
@@ -16,14 +16,14 @@
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model=
"contractQuery.contractNature"
placeholder=
"合同
状态
"
>
<el-select
v-model=
"contractQuery.contractNature"
placeholder=
"合同
性质
"
>
<el-option
v-for=
"(item, index) in contractNatures"
:key=
"index"
:label=
"item"
:value=
"index"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"getContractList(true)"
>
查询
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"contractQuery =
{}">重置
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-refresh-right"
@
click=
"contractQuery =
{}
; getContractList(false)
">重置
</el-button>
<el-button
type=
"success"
icon=
"el-icon-circle-plus-outline"
@
click=
"dialogTableVisible = true"
>
添加合同
</el-button>
</el-form-item>
...
...
@@ -69,7 +69,7 @@
</div>
<div
class=
"footer"
>
<el-pagination
@
current-change=
"getContractList"
:current-page.sync=
"contractPageQuery.pageNum"
<el-pagination
@
current-change=
"getContractList
()
"
:current-page.sync=
"contractPageQuery.pageNum"
:page-size=
"contractPageQuery.pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</el-pagination>
</div>
...
...
@@ -122,13 +122,14 @@ export default {
},
contractNatures
:
deepClone
(
contractNatureList
),
dialogTableVisible
:
false
,
checkedContractNature
:
0
checkedContractNature
:
0
,
isConditionSelect
:
false
// drawerVisible: false,
}
},
mounted
()
{
this
.
getContractTypeList
()
this
.
getContractList
()
this
.
getContractList
(
false
)
},
methods
:
{
getContractTypeList
()
{
...
...
@@ -145,12 +146,22 @@ export default {
}
})
},
getContractList
(
isCondition
=
false
)
{
getContractList
(
isCondition
Select
)
{
const
params
=
{
...
this
.
contractPageQuery
,
companyId
:
this
.
companyId
||
this
.
$store
.
getters
.
companyId
}
isCondition
&&
Object
.
assign
(
params
,
this
.
contractQuery
)
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询,=== 切换分页时候
if
(
isConditionSelect
===
undefined
||
isConditionSelect
===
''
){
this
.
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
contractQuery
)
Object
.
assign
(
params
,
this
.
contractPageQuery
)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}
else
{
this
.
isConditionSelect
=
isConditionSelect
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
contractQuery
)
params
.
pageNum
=
1
this
.
contractPageQuery
.
pageNum
=
1
}
selectContractList
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
total
=
res
.
data
.
total
...
...
src/views/contract/contractStaticData.js
View file @
17929662
export
const
contractNatures
=
[
'
普通合同
'
,
'
框架合同
'
,
'
补充协议
'
,
'
其它合同
'
]
\ No newline at end of file
import
{
checkPhone
}
from
"
@/utils/myValidate
"
export
const
contractNatures
=
[
'
普通合同
'
,
'
框架合同
'
,
'
补充协议
'
,
'
其它合同
'
]
// firstParty: '',
// contractName: '',
// contractNature: this.$route.query.checkedContractNature,
// contarctRemarks: ' ',
// contractStartTime: '',
// contractFirstParty: '',
// contractMoney: "0",
// contractNumber: '',
// contractPaetyb: '',
// contractEndTime: '',
// signingTime: '',
// partybName: '',
// taxPoint: '',
// tax: '0',
// typeId: '',
// safekeeping: '',
// firstPartyAddress: '',
// preparedBy: '',
// contractParent: ''
export
const
addFormValidRules
=
{
firstPartyPhone
:
[
{
required
:
true
,
validator
:
checkPhone
,
trigger
:
[
'
blur
'
,
'
change
'
]
},
],
}
\ No newline at end of file
src/views/contract/contractType.vue
View file @
17929662
...
...
@@ -109,9 +109,6 @@ export default {
getContractTypeList
(
data
)
{
const
params
=
{
companyId
:
this
.
companyId
||
this
.
$store
.
getters
.
companyId
,
// "name": "string", //select
// "searchCount": true, //select
// "state": 0, //select
...
this
.
contractTypeQuey
,
...
data
}
...
...
src/views/pettyMoney/components/examinePetty.vue
View file @
17929662
...
...
@@ -61,10 +61,10 @@
<
template
slot-scope=
"scope"
>
<el-button-group>
<el-button
v-if=
"tag === 'unapprove'"
type=
"success"
size=
"mini"
@
click=
"controlDialogVisible('agree', scope.row)"
>
同意
@
click=
"controlDialog
Drawer
Visible('agree', scope.row)"
>
同意
</el-button>
<el-button
v-if=
"tag === 'unapprove'"
type=
"warning"
size=
"mini"
@
click=
"controlDialogVisible('reject', scope.row)"
>
驳回
@
click=
"controlDialog
Drawer
Visible('reject', scope.row)"
>
驳回
</el-button>
<el-button
size=
"mini"
v-if=
"tag === 'overview'"
:style=
"
{ background: '#5782df', color: '#fff', border: '1px solid #5782df' }"
...
...
@@ -85,15 +85,15 @@
:show-close=
"false"
>
<el-form
label-position=
"left"
:model=
"checkedRow"
label-width=
"100px"
ref=
"dialogForm"
>
<el-form-item
v-if=
"dialogVisible === 'agree'"
label=
"备用金名称"
:rules=
"{ required: true, message: '请输入备用金名称' }"
prop=
"pettyName"
>
:rules=
"{ required: true, message: '请输入备用金名称'
, trigger: 'blur'
}"
prop=
"pettyName"
>
<el-input
v-model=
"checkedRow.pettyName"
placeholder=
"请选择备用金名称"
/>
</el-form-item>
<el-form-item
v-else
label=
"驳回理由"
:rules=
"{ required: true, message: '请输入驳回理由' }"
prop=
"pettyReject"
>
<el-form-item
v-else
label=
"驳回理由"
:rules=
"{ required: true, message: '请输入驳回理由'
, trigger: 'blur'
}"
prop=
"pettyReject"
>
<el-input
v-model=
"checkedRow.pettyReject"
placeholder=
"请选择驳回理由"
/>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"controlDialogVisible('')"
>
取 消
</el-button>
<el-button
@
click=
"controlDialog
Drawer
Visible('')"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"operateConfirm"
>
确 定
</el-button>
</span>
</el-dialog>
...
...
@@ -201,13 +201,16 @@ export default {
...
this
.
examinePageQuery
,
companyId
:
this
.
companyId
}
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
,=== 切换分页时候
if
(
isConditionSelect
===
undefined
||
isConditionSelect
===
''
){
this
.
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
examineQuery
)
Object
.
assign
(
params
,
this
.
examinePageQuery
)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}
else
{
this
.
isConditionSelect
=
isConditionSelect
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
examineQuery
)
params
.
pageNum
=
1
this
.
examinePageQuery
.
pageNum
=
1
}
//组件重用,利用tag来区分查询条件
this
.
tag
===
'
unapprove
'
&&
(
params
.
pettyApproval
=
0
)
...
...
@@ -235,6 +238,7 @@ export default {
}
this
.
dialogVisible
=
dialogVisible
},
getRepayDetailList
()
{
const
params
=
{
pettyId
:
this
.
checkedRow
.
pettyId
...
...
@@ -257,7 +261,7 @@ export default {
agreePetty
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
操作成功
"
)
this
.
getexamineList
()
this
.
getexamineList
(
false
)
this
.
dialogVisible
=
false
}
else
{
this
.
$message
.
error
(
"
操作失败
"
)
...
...
@@ -273,8 +277,8 @@ export default {
rejectPetty
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
操作成功
"
)
this
.
getexamineList
()
this
.
controlDialogVisible
(
''
)
this
.
getexamineList
(
false
)
this
.
controlDialog
Drawer
Visible
(
''
)
}
else
{
this
.
$message
.
error
(
"
操作失败
"
)
}
...
...
src/views/pettyMoney/components/examineRepay.vue
View file @
17929662
...
...
@@ -122,13 +122,16 @@ export default {
...
this
.
examinePageQuery
,
companyId
:
this
.
companyId
}
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
,=== 切换分页时候
if
(
isConditionSelect
===
undefined
||
isConditionSelect
===
''
){
this
.
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
examineQuery
)
Object
.
assign
(
params
,
this
.
examinePageQuery
)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}
else
{
this
.
isConditionSelect
=
isConditionSelect
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
examineQuery
)
params
.
pageNum
=
1
this
.
examinePageQuery
.
pageNum
=
1
}
selectUnrepay
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
...
...
src/views/pettyMoney/pettyMoneyRecord.vue
View file @
17929662
...
...
@@ -44,7 +44,7 @@
<el-table-column
prop=
"pettyTime"
label=
"借款日期"
width=
"180px"
/>
<el-table-column
prop=
"pettyApproval"
label=
"审批状态"
width=
"100px"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"approveResult[scope.row.pettyApproval].type"
>
<el-tag
size=
"mini"
:type=
"approveResult[scope.row.pettyApproval].type"
>
{{
approveResult
[
scope
.
row
.
pettyApproval
].
text
}}
</el-tag>
</
template
>
</el-table-column>
...
...
@@ -58,7 +58,7 @@
<
template
slot-scope=
"scope"
>
<el-button-group>
<el-button
type=
"success"
size=
"mini"
v-if=
"parseInt(scope.row.pettyApproval) === 1"
@
click=
"controlDialogDrawerVisible('agree', scope.row)"
>
还款
@
click=
"controlDialogDrawerVisible('agree', scope.row)"
:disabled=
"parseInt(scope.row.pettySurplus) === 0"
>
{{
parseInt
(
scope
.
row
.
pettySurplus
)
===
0
?
'
已还清
'
:
'
还款
'
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
v-if=
"parseInt(scope.row.pettyApproval) === 0"
@
click=
"$router.push(
{ path: '/editPetty', query: { pettyId: String(scope.row.pettyId) } })">
...
...
@@ -198,13 +198,16 @@ export default {
companyId
:
this
.
companyId
,
userId
:
this
.
urId
}
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
,=== 切换分页时候
if
(
isConditionSelect
===
undefined
||
isConditionSelect
===
''
){
this
.
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
pettyMoneyQuery
)
Object
.
assign
(
params
,
this
.
pettyMoneyPageQuery
)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}
else
{
this
.
isConditionSelect
=
isConditionSelect
isConditionSelect
&&
Object
.
assign
(
params
,
this
.
pettyMoneyQuery
)
params
.
pageNum
=
1
this
.
pettyMoneyPageQuery
.
pageNum
=
1
}
selectSelfPettyRecord
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
...
...
src/views/staff/addStaff.vue
View file @
17929662
...
...
@@ -3,24 +3,13 @@
<div
class=
"container"
>
<el-row>
<el-col
:xl=
"8"
:lg=
"8"
:md=
"8"
:sm=
"12"
:xs=
"24"
>
<el-form
:model=
"staffData"
:rules=
"rules"
ref=
"form"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-form
:model=
"staffData"
:rules=
"rules"
ref=
"form"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"员工姓名"
prop=
"userName"
>
<el-input
v-model=
"staffData.userName"
></el-input>
</el-form-item>
<el-form-item
label=
"员工性别"
prop=
"userSex"
>
<el-select
v-model=
"staffData.userSex"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
...
...
@@ -44,7 +33,8 @@
</el-form-item>
<el-form-item
label=
"员工权限"
prop=
"roles"
>
<el-checkbox-group
v-model=
"staffData.roles"
>
<el-checkbox
v-for=
"item in rolesList"
:key=
"item.rlId"
:label=
"item.rlId"
name=
"type"
>
{{
item
.
rlName
}}
</el-checkbox>
<el-checkbox
v-for=
"item in rolesList"
:key=
"item.rlId"
:label=
"item.rlId"
name=
"type"
>
{{
item
.
rlName
}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item>
...
...
@@ -58,25 +48,25 @@
</
template
>
<
script
>
import
{
chinaIdentityValid
,
bankAccountValid
,
checkPhone
}
from
'
@/utils/myValidate
'
import
{
selectAllByCompanyId
}
from
'
@/api/role
'
import
{
insertStaff
}
from
'
@/api/user
'
import
{
chinaIdentityValid
,
bankAccountValid
,
checkPhone
,
account_password_valid
}
from
'
@/utils/myValidate
'
import
{
selectAllByCompanyId
}
from
'
@/api/role
'
import
{
insertStaff
}
from
'
@/api/user
'
export
default
{
data
()
{
return
{
staffData
:
{
companyId
:
null
,
userName
:
null
,
userSex
:
null
,
userAdmin
:
null
,
userPassword
:
null
,
userPhone
:
null
,
userIdentification
:
null
,
userBankNumber
:
null
,
userBankAddress
:
null
,
roles
:[],
companyId
:
null
,
userName
:
null
,
userSex
:
null
,
userAdmin
:
null
,
userPassword
:
null
,
userPhone
:
null
,
userIdentification
:
null
,
userBankNumber
:
null
,
userBankAddress
:
null
,
roles
:
[],
},
rolesList
:[],
rolesList
:
[],
options
:
[
{
value
:
1
,
...
...
@@ -97,59 +87,61 @@ export default {
{
required
:
true
,
message
:
"
请输入员工密码
"
,
trigger
:
"
blur
"
},
],
userPhone
:
[
{
required
:
true
,
validator
:
checkPhone
,
trigger
:
[
'
blur
'
,
'
change
'
]},
{
required
:
true
,
validator
:
checkPhone
,
trigger
:
[
'
blur
'
,
'
change
'
]
},
],
userIdentification
:
[
{
required
:
true
,
validator
:
chinaIdentityValid
,
trigger
:
'
blur
'
},
{
required
:
true
,
validator
:
chinaIdentityValid
,
trigger
:
'
blur
'
},
],
userBankNumber
:
[
{
required
:
true
,
validator
:
bankAccountValid
,
trigger
:
'
blur
'
},
{
required
:
true
,
validator
:
bankAccountValid
,
trigger
:
'
blur
'
},
],
userBankAddress
:
[
{
required
:
true
,
message
:
"
请输入员工开户行
"
,
trigger
:
"
blur
"
},
],
roles
:[
userAdmin
:
[{
required
:
true
,
validator
:
account_password_valid
,
trigger
:
"
blur
"
}],
userPassword
:
[{
required
:
true
,
validator
:
account_password_valid
,
trigger
:
"
blur
"
}],
roles
:
[
{
type
:
'
array
'
,
required
:
true
,
message
:
'
请至少选择一个角色
'
,
trigger
:
'
change
'
}
]
},
}
},
created
(){
this
.
staffData
.
companyId
=
this
.
$store
.
getters
.
companyId
;
created
()
{
this
.
staffData
.
companyId
=
this
.
$store
.
getters
.
companyId
;
//获取权限
this
.
getRoles
();
},
methods
:{
methods
:
{
getRoles
()
{
selectAllByCompanyId
({
companyId
:
this
.
$store
.
getters
.
companyId
}).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
){
selectAllByCompanyId
({
companyId
:
this
.
$store
.
getters
.
companyId
}).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
)
{
this
.
rolesList
=
res
.
data
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
)
}
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
查询角色失败
"
)
})
},
//重置数据
reset
(){
reset
()
{
this
.
$refs
.
form
.
resetFields
()
},
//提交数据
update
(){
update
()
{
//先校验
this
.
$refs
.
form
.
validate
((
valida
)
=>
{
if
(
valida
){
this
.
$refs
.
form
.
validate
((
valida
)
=>
{
if
(
valida
)
{
//提交
insertStaff
(
this
.
staffData
).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
){
insertStaff
(
this
.
staffData
).
then
((
res
)
=>
{
if
(
res
.
status
==
"
success
"
)
{
this
.
$message
.
success
(
"
添加成功
"
)
this
.
$store
.
dispatch
(
'
tagsView/delView
'
,
this
.
$route
)
this
.
$router
.
push
(
"
/staffList
"
)
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
)
}
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
this
.
$message
.
error
(
"
添加失败
"
)
})
}
...
...
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