Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
project
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
高宇
project
Commits
27cee777
Commit
27cee777
authored
Apr 23, 2019
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成销售合同;
parent
d83b3ce2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
20 deletions
+60
-20
singleUpload.vue
src/components/common/singleUpload.vue
+2
-1
addContract.vue
src/components/contract/operation/addContract.vue
+19
-6
editContract.vue
src/components/contract/operation/editContract.vue
+22
-6
operationContract.vue
src/components/contract/operation/operationContract.vue
+15
-7
viewHelper.js
src/lib/viewHelper.js
+2
-0
No files found.
src/components/common/singleUpload.vue
View file @
27cee777
...
...
@@ -26,7 +26,8 @@
<el-progress
:percentage=
"progress"
v-if=
"progress > 0 && progress
<
100
"
></el-progress>
</div>
</el-upload>
<span
class=
"tips"
><em>
{{
tips
}}
</em></span>
<span
class=
"tips"
>
{{
tips
}}
<span
class=
"text-danger"
>
当有新文件上传时, 之前上传的文件将会被删除
</span></span>
</el-col>
<el-col
:span=
"6"
>
<slot
name=
"formError"
></slot>
...
...
src/components/contract/operation/addContract.vue
View file @
27cee777
...
...
@@ -13,12 +13,12 @@
</
template
>
<
script
>
//
import {
//
requestAPI,
//
api
//
} from '@/lib/commonMixin'
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
operationContract
from
'./operationContract'
//
import {setModule} from '../../../lib/viewHelper'
import
{
setModule
}
from
'../../../lib/viewHelper'
export
default
{
name
:
''
,
components
:
{
...
...
@@ -32,7 +32,20 @@
methods
:
{
saveContract
()
{
let
form
=
this
.
$refs
.
operationContract
.
getForm
()
console
.
log
(
form
)
let
subData
=
setModule
(
form
.
SalesContracts
,
'SalesContracts'
)
requestAPI
(
api
.
saveContractAdd
,
{
data
:
{...
subData
}
}).
then
(
res
=>
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
})
this
.
close
(
true
)
},
error
=>
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$set
(
this
.
errorData
,
item
.
name
,
item
.
error
)
})
})
},
close
(
getList
)
{
this
.
$emit
(
'close'
,
getList
)
...
...
src/components/contract/operation/editContract.vue
View file @
27cee777
...
...
@@ -13,12 +13,12 @@
</
template
>
<
script
>
//
import {
//
requestAPI,
//
api
//
} from '@/lib/commonMixin'
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
operationContract
from
'./operationContract'
//
import {setModule} from '../../../lib/viewHelper'
import
{
setModule
}
from
'../../../lib/viewHelper'
export
default
{
name
:
''
,
components
:
{
...
...
@@ -30,7 +30,23 @@
}
},
methods
:
{
saveContract
()
{},
saveContract
()
{
let
form
=
this
.
$refs
.
operationContract
.
getForm
()
let
subData
=
setModule
(
form
.
SalesContracts
,
'SalesContracts'
)
requestAPI
(
api
.
saveContractEdit
,
{
data
:
{...
subData
}
}).
then
(
res
=>
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
})
this
.
close
(
true
)
},
error
=>
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$set
(
this
.
errorData
,
item
.
name
,
item
.
error
)
})
})
},
close
(
getList
)
{
this
.
$emit
(
'close'
,
getList
)
},
...
...
src/components/contract/operation/operationContract.vue
View file @
27cee777
...
...
@@ -86,7 +86,7 @@
<el-form-item
:show-message=
"false"
:error=
"errorData['contract_scan'] ? errorData['contract_scan'] : ''"
>
<single-upload
label=
"上传合同"
tips=
"只能上传 jpg,png,pdf 类型文件, 文件不能超过50M
, 当有新文件上传时, 之前上传的文件将会被删除
"
tips=
"只能上传 jpg,png,pdf 类型文件, 文件不能超过50M"
:form-item=
"SalesContracts.contract_scan"
:file-name=
"getFileName('contractScan')"
@
update:item=
"val =>
{SalesContracts.contract_scan = val}">
...
...
@@ -99,7 +99,7 @@
<single-upload
label=
"上传签收单"
:file-name=
"getFileName('receiptScan')"
tips=
"只能上传 jpg,png,pdf 类型文件, 文件不能超过50M
, 当有新文件上传时, 之前上传的文件将会被删除
"
tips=
"只能上传 jpg,png,pdf 类型文件, 文件不能超过50M"
:form-item=
"SalesContracts.receipt_scan"
@
update:item=
"val =>
{SalesContracts.receipt_scan = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
...
...
@@ -259,7 +259,7 @@
description
:
''
,
contract_scan
:
''
,
receipt_scan
:
''
,
contract_type
:
2
,
contract_type
:
1
,
project_id
:
''
,
// 服务截止
expire_date
:
''
,
...
...
@@ -379,10 +379,7 @@
initAdd
()
{
requestAPI
(
api
.
getContractNewOptions
).
then
(
res
=>
{
Object
.
keys
(
res
.
options
).
forEach
(
key
=>
{
console
.
log
(
this
.
options
[
key
],
key
)
// res.options[key].value.forEach(i => {
// this.options[key].value.push(i)
// })
this
.
$set
(
this
.
options
,
key
,
res
.
options
[
key
])
})
})
},
...
...
@@ -392,12 +389,23 @@
id
}
}).
then
(
res
=>
{
if
(
res
.
model
.
client
)
{
Object
.
keys
(
res
.
model
.
client
).
forEach
(
item
=>
{
this
.
$set
(
this
.
client
,
item
,
res
.
model
.
client
[
item
])
})
}
this
.
options
[
'SalesContracts[project_id]'
].
value
.
push
(
res
.
model
.
project
)
this
.
searchText
=
this
.
client
.
name
Object
.
keys
(
res
.
options
).
forEach
(
key
=>
{
this
.
$set
(
this
.
options
,
key
,
res
.
options
[
key
])
})
Object
.
keys
(
this
.
SalesContracts
).
forEach
(
item
=>
{
this
.
SalesContracts
[
item
]
=
res
.
model
[
item
]
})
Object
.
keys
(
this
.
files
).
forEach
(
item
=>
{
this
.
files
[
item
].
name
=
res
.
model
[
item
].
orig_name
})
console
.
log
(
this
.
files
)
})
}
},
...
...
src/lib/viewHelper.js
View file @
27cee777
...
...
@@ -33,6 +33,8 @@ export let setModule = (obj, key, options) => {
}
else
{
ob
[
key
+
'['
+
item
+
']['
+
arr
.
key
+
']'
]
=
arr
.
name
}
}
else
if
(
arr
.
name
)
{
ob
[
key
+
'['
+
item
+
']['
+
arr
.
name
+
']'
]
=
arr
.
value
}
else
if
(
Object
.
keys
(
arr
).
length
>
0
)
{
Object
.
keys
(
arr
).
forEach
(
i
=>
{
ob
[
key
+
'['
+
item
+
']['
+
i
+
']'
]
=
arr
[
i
]
...
...
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