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
43dd450d
Commit
43dd450d
authored
Nov 15, 2022
by
柳 佳乐
Browse files
202211151
parents
149f135a
4d6bb737
Changes
14
Hide whitespace changes
Inline
Side-by-side
.env.development
View file @
43dd450d
...
...
@@ -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/api/contract.js
View file @
43dd450d
...
...
@@ -37,6 +37,15 @@ export function updateContractType(data) {
})
}
// 更新合同类型状态
export
function
updateContractTypeState
(
data
)
{
return
request
({
url
:
'
/contractType/updateBystate
'
,
method
:
'
post
'
,
data
})
}
/************* 合同管理 ************/
// 获取合同列表
...
...
src/styles/element-ui.scss
View file @
43dd450d
...
...
@@ -97,7 +97,11 @@
.el-range-separator
{
box-sizing
:
content-box
;
}
.contract-form
{
.el-form-item
{
margin-bottom
:
12px
;
}
}
.contract-description-form
{
.required
{
&
::after
{
...
...
@@ -105,6 +109,9 @@
color
:
red
;
}
}
.el-descriptions-item__cell
{
padding-bottom
:
10px
;
}
}
.petty-data-simple
{
.el-badge__content.is-fixed
{
...
...
src/utils/myValidate.js
View file @
43dd450d
...
...
@@ -89,6 +89,7 @@ export function bankAccountValid (rule, value, callback) {
// 电话号码验证
export
function
checkPhone
(
rule
,
value
,
callback
)
{
if
(
!
value
)
{
console
.
log
(
1
)
return
callback
(
new
Error
(
'
手机号不能为空
'
));
}
else
{
const
reg
=
/
(
^1
\d{10}
$
)
|
(
^
[
0-9
]\d{7}
$
)
/
...
...
@@ -115,10 +116,41 @@ export function pathValid (rule, value, callback) {
}
//定义金额校验
export
function
money
(
rule
,
value
,
callback
)
{
<<<<<<<
HEAD
let
RegExp
=
/
(
^
([
-
]?)[
1-9
]([
0-9
]
+
)?(\.[
0-9
]{1,6})?
$
)
|
(
^
([
-
]?)(
0
){1}
$
)
|
(
^
([
-
]?)[
0-9
]\.[
0-9
]([
0-9
])?
$
)
/
;
if
(
RegExp
.
test
(
value
))
{
=======
let
RegExp
=
/^
(([
1-9
]{1}\d
*
)
|
(
0
{1}))(\.\d{1,2})?
$/
;
if
(
value
===
null
||
value
===
undefined
||
value
===
''
)
{
callback
(
new
Error
(
'
金额不能为空
'
))
}
else
if
(
RegExp
.
test
(
value
))
{
>>>>>>>
4
d6bb737cd8f5c1dac548efd85ccb5f2d8bff4da
callback
();
}
else
{
callback
(
new
Error
(
"
金额格式错误
"
));
}
};
\ No newline at end of file
};
//校验账号密码,只允许数字和字母
export
function
account_password_valid
(
rule
,
value
,
callback
){
let
reg
=
/^
[
a-zA-Z0-9
]
*$/
if
(
value
===
null
||
value
===
undefined
||
value
===
''
)
{
callback
(
new
Error
(
'
请填写正确信息,不能为空
'
))
}
else
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
"
格式错误,只允许输入数字和字母
"
));
}
}
//只允许数字
export
function
number_valid
(
rule
,
value
,
callback
){
let
reg
=
/^
[
0-9
]
*$/
if
(
value
===
null
||
value
===
undefined
||
value
===
''
)
{
return
callback
(
new
Error
(
'
不能为空
'
))
}
else
if
(
reg
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
"
只允许输入数字
"
));
}
}
\ No newline at end of file
src/views/company/addcompany.vue
View file @
43dd450d
...
...
@@ -78,7 +78,7 @@
</
template
>
<
script
>
import
{
chinaIdentityValid
,
bankAccountValid
,
checkPhone
}
from
'
@/utils/myValidate
'
import
{
chinaIdentityValid
,
bankAccountValid
,
checkPhone
,
account_password_valid
}
from
'
@/utils/myValidate
'
import
{
register
}
from
'
@/api/company
'
export
default
{
...
...
@@ -127,10 +127,10 @@ export default {
{
required
:
true
,
message
:
'
请选择性别
'
,
trigger
:
'
change
'
},
],
userAdmin
:[
{
required
:
true
,
message
:
'
请输入账号
'
,
trigger
:
'
blur
'
},
{
required
:
true
,
validator
:
account_password_valid
,
trigger
:
'
blur
'
},
],
userPassword
:[
{
required
:
true
,
message
:
'
请输入密码
'
,
trigger
:
'
blur
'
},
{
required
:
true
,
validator
:
account_password_valid
,
trigger
:
'
blur
'
},
],
userPhone
:[
{
required
:
true
,
validator
:
checkPhone
,
trigger
:
[
'
blur
'
,
'
change
'
]},
...
...
src/views/contract/components/addContract.vue
View file @
43dd450d
...
...
@@ -6,74 +6,105 @@
<!--
<i
class=
"el-icon-close"
@
click=
"closeDrawer"
></i>
-->
</div>
<div
class=
"container"
>
<el-form>
<el-form
:model=
"formData"
:rules=
"addFormValidRules"
ref=
"form"
class=
"contract-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-option
v-for=
"(item, index) in contractParentList"
:key=
"item.contractId"
:value=
"item.contractId"
:label=
"item.name"
></el-option>
</el-select>
<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-input
placeholder=
"请输入合同名称"
v-model=
"formData.contractName"
></el-input>
<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-input
placeholder=
"请输入合同名称合同乙方"
v-model=
"formData.contractPaetyb"
></el-input>
<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-input
placeholder=
"请输入合同编号"
v-model=
"formData.contractNumber"
></el-input>
<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-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
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-input
placeholder=
"请输入客户名称(甲方)"
v-model=
"formData.contractFirstParty"
></el-input>
<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-input
placeholder=
"请输入甲方签订人"
v-model=
"formData.firstParty"
></el-input>
<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-input
placeholder=
"请输入客户联系电话"
v-model=
"formData.firstPartyPhone"
></el-input>
<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-input
placeholder=
"请输入客户联系地址"
v-model=
"formData.firstPartyAddress"
></el-input>
<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"
v-model="formData.contractStartTime">
</el-date-picker>
<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"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
<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-input
placeholder=
"请输入合同金额"
type=
"number"
v-model=
"formData.contractMoney"
step=
“0.01”
>
</el-input>
<el-form-item
prop=
"contractMoney"
>
<el-input
placeholder=
"请输入合同金额"
type=
"number"
v-model=
"formData.contractMoney"
step=
“0.01”
:min=
"0"
>
</el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"是否含税"
labelClassName=
"required"
>
<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
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-input>
<el-form-item
prop=
"taxPoint"
>
<el-input
placeholder=
"请输入税点"
type=
"number"
v-model=
"formData.taxPoint"
min=
“0.00”
:min=
"0"
step=
“0.01”
>
</el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
label=
"合同附件"
>
...
...
@@ -108,30 +139,41 @@
</div>
<el-descriptions
:column=
"3"
border
class=
"contract-description-form"
>
<el-descriptions-item
label=
"乙方签订人"
labelClassName=
"required"
>
<el-input
placeholder=
"请输入乙方签订人"
v-model=
"formData.partybName"
></el-input>
<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-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
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-input
placeholder=
"请输入合同制定人"
v-model=
"formData.preparedBy"
></el-input>
<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-input
placeholder=
"请输入合同保管人"
v-model=
"formData.safekeeping"
></el-input>
<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-input
type=
"textarea"
v-model=
"formData.contarctRemarks"
></el-input>
<el-form-item
prop=
"contarctRemarks"
>
<el-input
type=
"textarea"
v-model=
"formData.contarctRemarks"
></el-input>
</el-form-item>
</div>
<br
/>
<el-form-item>
<el-button
type=
"primary"
@
click=
"addContract"
>
{{
!
isEdit
?
'
立即创建
'
:
'
修改
'
}}
</el-button>
<el-button
@
click=
"$store.dispatch('tagsView/delView', $route);$router.back();"
>
返回
</el-button>
<!--
<el-button
@
click=
"closeDrawer"
>
取消
</el-button>
-->
</el-form-item>
</el-form>
...
...
@@ -142,9 +184,10 @@
<
script
>
import
{
selectAllContractTypeList
,
selectAllContractList
,
addContract
,
getContractById
,
updateContract
,
selectContractFiles
,
deleteContract
}
from
'
@/api/contract
'
import
{
deepClone
}
from
'
@/utils
'
import
{
contractNatures
}
from
'
../contractStaticData
'
import
{
contractNatures
,
addFormValidRules
}
from
'
../contractStaticData
'
import
{
mapGetters
}
from
'
vuex
'
import
{
downloadPDFFile
}
from
'
@/utils/download
'
// import { checkPhone } from '@/utils/myValidate'
export
default
{
// props: ['drawerVisible'],
data
()
{
...
...
@@ -178,6 +221,7 @@ export default {
contractParentList
:
[],
contractNatures
:
deepClone
(
contractNatures
),
isEdit
:
false
,
addFormValidRules
,
action
:
''
,
uploadChange
:
false
}
...
...
@@ -204,7 +248,7 @@ export default {
this
.
isEdit
=
true
;
this
.
getContractDetail
(
contractId
)
this
.
getContractFiles
(
contractId
)
//获取合同文件
// 添加
// 添加
}
else
if
(
this
.
$route
.
path
.
indexOf
(
'
/addContract
'
)
>=
0
&&
this
.
$route
.
query
.
checkedContractNature
!==
undefined
)
{
this
.
isEdit
=
false
;
if
(
this
.
$route
.
query
.
checkedContractNature
.
toString
()
===
'
2
'
)
{
...
...
@@ -232,46 +276,52 @@ export default {
})
},
addContract
()
{
let
validRes
=
this
.
validFormData
()
if
(
validRes
.
length
)
{
this
.
$message
.
warning
(
"
带 * 号必填,请正确填写信息
"
)
return
}
const
params
=
{
companyId
:
this
.
companyId
||
this
.
$store
.
getters
.
companyId
,
...
this
.
formData
}
// const toNumberKeys = ['contractNature','contractParent','contractMoney']
// toNumberKeys.forEach(key => {
// params[key] = Number(params[key])
// })
!
this
.
formData
.
contarctRemarks
&&
(
params
.
contarctRemarks
=
'
'
)
if
(
!
this
.
isEdit
)
{
addContract
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
成功添加合同
"
)
this
.
addContractFile
(
res
.
data
)
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
'
/contractList
'
})
},
1000
);
}
else
{
this
.
$message
.
warning
(
"
添加合同失败
"
)
// let validRes = this.validFormData()
// if (validRes.length) {
// this.$message.warning("带 * 号必填,请正确填写信息")
// return
// }
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
const
params
=
{
companyId
:
this
.
companyId
||
this
.
$store
.
getters
.
companyId
,
...
this
.
formData
}
})
}
else
{
this
.
addContractFile
(
this
.
formData
.
contractId
)
updateContract
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
成功修改合同
"
)
setTimeout
(()
=>
{
this
.
$router
.
push
({
path
:
'
/contractList
'
})
},
1000
);
// const toNumberKeys = ['contractNature','contractParent','contractMoney']
// toNumberKeys.forEach(key => {
// params[key] = Number(params[key])
// })
!
this
.
formData
.
contarctRemarks
&&
(
params
.
contarctRemarks
=
'
'
)
if
(
!
this
.
isEdit
)
{
addContract
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
成功添加合同
"
)
this
.
addContractFile
(
res
.
data
)
setTimeout
(()
=>
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
'
/contractList
'
})
},
1000
);
}
else
{
this
.
$message
.
warning
(
"
添加合同失败
"
)
}
})
}
else
{
this
.
$message
.
warning
(
"
添加修改失败
"
)
this
.
addContractFile
(
this
.
formData
.
contractId
)
updateContract
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
成功修改合同
"
)
setTimeout
(()
=>
{
this
.
$store
.
dispatch
(
"
tagsView/delView
"
,
this
.
$route
);
this
.
$router
.
push
({
path
:
'
/contractList
'
})
},
1000
);
}
else
{
this
.
$message
.
warning
(
"
添加修改失败
"
)
}
})
}
})
}
}
});
},
uploadOnchange
(
file
,
fileList
)
{
this
.
uploadChange
=
true
...
...
@@ -329,16 +379,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 +398,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 @
43dd450d
...
...
@@ -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 @
43dd450d
export
const
contractNatures
=
[
'
普通合同
'
,
'
框架合同
'
,
'
补充协议
'
,
'
其它合同
'
]
\ No newline at end of file
import
{
checkPhone
,
money
as
contractMoneyValid
,
number_valid
}
from
"
@/utils/myValidate
"
export
const
contractNatures
=
[
'
普通合同
'
,
'
框架合同
'
,
'
补充协议
'
,
'
其它合同
'
]
export
const
addFormValidRules
=
{
firstParty
:
[{
required
:
true
,
message
:
'
甲方签订人不能为空
'
,
trigger
:
'
blur
'
}],
contractName
:
[{
required
:
true
,
message
:
'
合同名称不能为空
'
,
trigger
:
'
blur
'
}],
// contractNature: this.$route.query.checkedContractNature,
// contarctRemarks: [{required: true, message: '不能为空', trigger: 'blur'}],
contractStartTime
:
[{
required
:
true
,
message
:
'
合同开始日期不能为空
'
,
trigger
:
'
blur
'
}],
contractFirstParty
:
[{
required
:
true
,
message
:
'
客户名称(甲方)不能为空
'
,
trigger
:
'
blur
'
}],
contractMoney
:
[{
required
:
true
,
message
:
'
合同金额不能为空
'
,
trigger
:
'
blur
'
}],
contractNumber
:
[{
required
:
true
,
validator
:
number_valid
,
trigger
:
[
'
change
'
,
'
blur
'
]}],
contractPaetyb
:
[{
required
:
true
,
message
:
'
合同乙方不能为空
'
,
trigger
:
'
blur
'
}],
contractEndTime
:
[{
required
:
true
,
message
:
'
合同结束日期不能为空
'
,
trigger
:
'
blur
'
}],
signingTime
:
[{
required
:
true
,
message
:
'
合同签订时间不能为空
'
,
trigger
:
'
blur
'
}],
partybName
:
[{
required
:
true
,
message
:
'
乙方签订人不能为空
'
,
trigger
:
'
blur
'
}],
tax
:
[{
required
:
true
,
message
:
'
是否含税不能为空
'
,
trigger
:
'
blur
'
}],
taxPoint
:
[{
required
:
true
,
validator
:
function
(
rule
,
value
,
callback
){
if
(
value
===
null
||
value
===
undefined
||
value
===
''
){
callback
(
new
Error
(
'
税点不能为空
'
))
}
else
if
(
Number
(
value
)
===
NaN
||
Number
(
value
)
<
0
){
callback
(
new
Error
(
'
请输入正确格式
'
))
}
else
{
callback
()
}
},
trigger
:
'
blur
'
}],
typeId
:
[{
required
:
true
,
message
:
'
合同类型不能为空
'
,
trigger
:
'
blur
'
}],
safekeeping
:
[{
required
:
true
,
message
:
'
合同保管人不能为空
'
,
trigger
:
'
blur
'
}],
firstPartyAddress
:
[{
required
:
true
,
message
:
'
客户联系地址不能为空
'
,
trigger
:
'
blur
'
}],
preparedBy
:
[{
required
:
true
,
message
:
'
合同制定人不能为空
'
,
trigger
:
'
blur
'
}],
contractParent
:
[{
required
:
true
,
message
:
'
母合同名称不能为空
'
,
trigger
:
'
blur
'
}],
firstPartyPhone
:
[
{
required
:
true
,
validator
:
checkPhone
,
trigger
:
[
'
change
'
,
'
blur
'
]
},
],
contractMoney
:
[
{
validator
:
contractMoneyValid
,
trigger
:
[
'
blur
'
]
}
]
}
\ No newline at end of file
src/views/contract/contractType.vue
View file @
43dd450d
...
...
@@ -16,7 +16,7 @@
<el-table-column
prop=
"state"
label=
"启用状态"
width=
"100px"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.state"
@
change=
"update(
{ ...scope.row, state: Math.abs(scope.row.state - 1) })"
@
change=
"update
State
(
{ ...scope.row, state: Math.abs(scope.row.state - 1) })"
active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</
template
>
...
...
@@ -67,7 +67,8 @@
import
{
selectContractTypeList
,
addContractType
as
insert
,
updateContractType
updateContractType
,
updateContractTypeState
}
from
'
@/api/contract
'
import
{
mapGetters
}
from
'
vuex
'
...
...
@@ -109,9 +110,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
}
...
...
@@ -127,7 +125,7 @@ export default {
})
},
update
(
data
)
{
function
updateCore
(
)
{
if
(
this
.
$refs
.
form
)
{
const
params
=
{
companyId
:
this
.
companyId
||
this
.
$store
.
getters
.
companyId
,
...
data
...
...
@@ -140,17 +138,21 @@ export default {
this
.
getContractTypeList
()
}
})
}
},
updateState
(
data
){
const
params
=
{
companyId
:
this
.
companyId
||
this
.
$store
.
getters
.
companyId
,
...
data
}
if
(
this
.
$refs
.
form
)
{
this
.
$refs
.
form
.
validate
((
valida
)
=>
{
if
(
valida
)
{
updateCore
.
call
(
this
)
!
Number
.
isInteger
(
data
.
state
)
&&
(
params
.
state
=
Number
(
!
data
.
state
))
updateContractTypeState
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$message
.
success
(
"
修改成功
"
)
// this.dialogFormVisible && (this.dialogFormVisible = false)
this
.
getContractTypeList
()
}
})
}
else
{
updateCore
.
call
(
this
)
}
},
addContractType
()
{
this
.
$refs
.
form
.
validate
((
valida
)
=>
{
...
...
src/views/personal/personal.vue
View file @
43dd450d
...
...
@@ -77,7 +77,7 @@
</template>
<
script
>
import
{
chinaIdentityValid
,
checkPhone
}
from
'
@/utils/myValidate
'
import
{
chinaIdentityValid
,
checkPhone
,
account_password_valid
}
from
'
@/utils/myValidate
'
import
{
getOneself
,
update
,
passwordReset
}
from
"
@/api/user
"
export
default
{
...
...
@@ -121,7 +121,7 @@ export default {
{
required
:
true
,
message
:
'
请选择性别
'
,
trigger
:
'
change
'
},
],
userAdmin
:[
{
required
:
true
,
message
:
'
请输入账号
'
,
trigger
:
'
blur
'
},
{
required
:
true
,
validator
:
account_password_valid
,
trigger
:
'
blur
'
},
],
userPhone
:[
{
required
:
true
,
validator
:
checkPhone
,
trigger
:
[
'
blur
'
,
'
change
'
]},
...
...
src/views/pettyMoney/components/examinePetty.vue
View file @
43dd450d
...
...
@@ -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 @
43dd450d
...
...
@@ -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 @
43dd450d
...
...
@@ -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 @
43dd450d
...
...
@@ -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
,
...
...
@@ -92,64 +82,66 @@ export default {
{
required
:
true
,
message
:
"
请输入员工姓名
"
,
trigger
:
"
blur
"
},
],
userSex
:
[{
required
:
true
,
message
:
"
请选择员工性别
"
,
trigger
:
"
change
"
}],
userAdmin
:
[{
required
:
true
,
message
:
"
请输入员工账号
"
,
trigger
:
"
blur
"
}],
userAdmin
:
[{
required
:
true
,
validator
:
account_password_valid
,
trigger
:
"
blur
"
}],
userPassword
:
[
{
required
:
true
,
message
:
"
请输入员工密码
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
validator
:
account_password_valid
,
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