Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
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
刘文虎
account-book
Commits
da64e275
Commit
da64e275
authored
Sep 28, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记工时-新建项目跳转
parent
770041c3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
30 deletions
+107
-30
manifest.json
manifest.json
+1
-1
index.vue
pages/index/index.vue
+6
-6
create.vue
pages/workpoint/workpoint-create/create.vue
+60
-16
bill.js
store/modules/bill.js
+22
-0
login.js
store/modules/login.js
+3
-4
workpoint.js
store/modules/workpoint.js
+10
-1
common.js
utils/common.js
+5
-2
No files found.
manifest.json
View file @
da64e275
{
"name"
:
"
account-book
"
,
"name"
:
"
扳手记账
"
,
"appid"
:
"__UNI__EDB8C7C"
,
"description"
:
""
,
"versionName"
:
"1.0.9"
,
...
...
pages/index/index.vue
View file @
da64e275
...
...
@@ -219,11 +219,6 @@ export default {
path
:
'/pages/card/payee-code'
,
name
:
'收款码'
},
{
image
:
this
.
baseUrl
+
'jigongshi@3x.png'
,
path
:
'/pages/workpoint/project/index'
,
name
:
'记工时'
},
{
image
:
this
.
baseUrl
+
'famingpian@3x.png'
,
path
:
'/pages/card/index'
,
...
...
@@ -239,7 +234,12 @@ export default {
image
:
this
.
baseUrl
+
'chaqianzhang@3x.png'
,
path
:
'/pages/bill/debit-note/debit-note'
,
name
:
'查欠账'
}
},
{
image
:
this
.
baseUrl
+
'jigongshi@3x.png'
,
path
:
'/pages/workpoint/project/index'
,
name
:
'记工时'
},
];
},
paddingTop
()
{
...
...
pages/workpoint/workpoint-create/create.vue
View file @
da64e275
...
...
@@ -260,6 +260,7 @@ import BillingCategory from '../components/billing-category.vue';
import
{
checkOpenPermission
,
checkOpenService
}
from
'@/utils/app-plus-auth.js'
;
import
{
getMembers
,
getProject
,
getProjectList
,
update
}
from
'@/api/workpoint/index.js'
;
import
{
getBillInfo
,
deleteBill
}
from
'@/api/workpoint/project-bill.js'
;
import
{
updateProject
}
from
'@/api/project/index.js'
;
import
{
formatCount
}
from
'@/utils/common.js'
;
import
{
baseUrl
,
billBaseUrl
}
from
'@/utils/config.js'
;
import
{
...
...
@@ -353,7 +354,7 @@ export default {
'background-color'
:
'#f6f7fa'
,
'border-radius'
:
'8rpx'
},
unitCustomStyle
:{
unitCustomStyle
:
{
'font-size'
:
'28rpx'
,
textAlign
:
'right'
,
width
:
'76rpx'
,
...
...
@@ -501,12 +502,13 @@ export default {
},
onShow
()
{
if
(
!
this
.
recordId
)
{
this
.
initData
();
console
.
log
(
'------onShow-------'
);
this
.
initData
(
'onshow'
);
}
},
methods
:
{
async
initData
()
{
await
this
.
getProjectList
();
async
initData
(
text
)
{
await
this
.
getProjectList
(
text
);
if
(
this
.
projectId
)
{
await
this
.
getMembersOptions
();
}
...
...
@@ -567,7 +569,7 @@ export default {
console
.
log
(
e
);
}
},
async
getProjectList
()
{
async
getProjectList
(
text
)
{
try
{
let
{
data
}
=
await
getProjectList
();
this
.
projectList
=
data
;
...
...
@@ -583,14 +585,13 @@ export default {
}
else
{
if
(
data
[
0
])
{
this
.
projectId
=
data
[
0
].
id
+
''
;
this
.
form
.
projectId
=
data
[
0
].
id
+
''
;
this
.
form
.
projectName
=
data
[
0
].
name
;
}
}
}
data
.
map
((
item
,
index
)
=>
{
this
.
projectList
.
map
((
item
,
index
)
=>
{
if
(
item
.
id
==
this
.
projectId
)
{
this
.
defaultProject
=
[
index
];
this
.
form
.
projectId
=
item
.
id
+
''
;
this
.
form
.
projectName
=
item
.
name
;
}
});
}
catch
(
e
)
{
...
...
@@ -602,12 +603,15 @@ export default {
if
(
this
.
recordId
)
{
return
false
;
}
this
.
selectShow
=
true
;
},
toAddProject
()
{
this
.
$u
.
route
({
url
:
'/pages/workpoint/project/project-edit'
this
.
projectList
.
map
((
item
,
index
)
=>
{
if
(
item
.
id
==
this
.
projectId
)
{
this
.
defaultProject
=
[
index
];
}
});
console
.
log
(
'open===defaultProject'
,
this
.
defaultProject
);
setTimeout
(()
=>
{
this
.
selectShow
=
true
;
},
1000
);
},
selectConfirm
(
e
)
{
console
.
log
(
e
);
...
...
@@ -623,7 +627,46 @@ export default {
this
.
getMembersOptions
();
}
this
.
$refs
.
uForm
.
validate
();
console
.
log
(
'confirm====defaultProject'
,
this
.
defaultProject
);
},
toAddProject
()
{
this
.
$u
.
route
({
url
:
'/pages/mine/input/input'
,
type
:
'navigateTo'
,
params
:
{
type
:
'project-create'
}
});
uni
.
$once
(
'input-sure-project-create'
,
res
=>
{
console
.
log
(
res
);
this
.
updateProject
({
name
:
res
.
content
});
});
},
updateProject
(
params
)
{
updateProject
(
params
)
.
then
(
res
=>
{
let
{
data
,
code
}
=
res
;
console
.
log
(
'------updateProject-------'
,
data
);
if
(
code
===
0
&&
data
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'项目创建成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
projectId
=
data
;
this
.
initData
();
}
});
this
.
projectId
=
data
;
}
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
},
handleChangeUnit
(
e
)
{
this
.
form
.
unit
=
e
;
},
...
...
@@ -645,7 +688,7 @@ export default {
this
.
normalNumberFocus
=
false
;
}
},
onBlurNormalNumber
(){
onBlurNormalNumber
()
{
this
.
normalNumberFocus
=
false
;
},
overtimeTypeChange
(
item
)
{
...
...
@@ -659,7 +702,7 @@ export default {
this
.
overNumberFocus
=
false
;
}
},
onBlurOverNumber
(){
onBlurOverNumber
()
{
this
.
overNumberFocus
=
false
;
},
tabChange
(
item
)
{
...
...
@@ -1088,6 +1131,7 @@ export default {
align-items
:
center
;
justify-content
:
space-between
;
font-size
:
28rpx
;
margin-top
:
8rpx
;
&
-label
{
color
:
$default-color
;
display
:
flex
;
...
...
store/modules/bill.js
View file @
da64e275
import
{
setBillType
,
getBillType
,
removeBillType
,
setCustomId
,
getCustomId
,
removeCustomId
,
}
from
"@/utils/common.js"
...
...
@@ -16,10 +18,18 @@ const mutations = {
state
.
billType
=
data
setBillType
(
data
)
},
REMOVE_BILL_TYPE
:
(
state
,
data
)
=>
{
state
.
billType
=
null
removeBillType
()
},
SAVE_CUSTOM_ID
:
(
state
,
data
)
=>
{
state
.
customId
=
data
setCustomId
(
data
)
},
REMOVE_CUSTOM_ID
:
(
state
,
data
)
=>
{
state
.
customId
=
null
removeCustomId
()
},
}
const
actions
=
{
...
...
@@ -29,12 +39,24 @@ const actions = {
},
data
)
=>
{
commit
(
"SAVE_BILL_TYPE"
,
data
)
},
Remove_bill_type
:({
state
,
commit
})
=>
{
commit
(
"REMOVE_BILL_TYPE"
)
},
Save_custom_id
:({
state
,
commit
},
data
)
=>
{
commit
(
"SAVE_CUSTOM_ID"
,
data
)
},
Remove_custom_id
:({
state
,
commit
})
=>
{
commit
(
"REMOVE_CUSTOM_ID"
)
},
}
export
default
{
...
...
store/modules/login.js
View file @
da64e275
...
...
@@ -8,8 +8,6 @@ import {
removeCodeTimetamp
,
removeRefreshToken
,
removeTimetamp
,
removeCustomId
,
removeProjectId
,
setTimetamp
,
setChannel
,
getChannel
,
...
...
@@ -248,8 +246,9 @@ const actions = {
removeTimetamp
()
removeCodeTimetamp
()
removeRefreshToken
()
removeCustomId
()
removeProjectId
()
// dispatch("Remove_bill_type")
dispatch
(
"Remove_custom_id"
)
dispatch
(
"Remove_project_id"
)
},
// 获取图片域名
GetHost
({
...
...
store/modules/workpoint.js
View file @
da64e275
...
...
@@ -14,6 +14,10 @@ const mutations = {
state
.
prevProjectId
=
data
setProjectId
(
data
)
},
REMOVE_PROJECT_ID
:
(
state
,
data
)
=>
{
state
.
prevProjectId
=
null
removeProjectId
()
},
}
const
actions
=
{
...
...
@@ -23,7 +27,12 @@ const actions = {
},
data
)
=>
{
commit
(
"SAVE_PROJECT_ID"
,
data
||
''
)
},
Remove_project_id
:({
state
,
commit
})
=>
{
commit
(
"REMOVE_PROJECT_ID"
)
},
}
export
default
{
...
...
utils/common.js
View file @
da64e275
...
...
@@ -107,6 +107,9 @@ export function setBillType(data) {
export
function
getBillType
()
{
return
uni
.
getStorageSync
(
"BILLTYPE"
)
||
''
}
export
function
removeBillType
()
{
uni
.
removeStorageSync
(
"BILLTYPE"
)
}
export
function
setEyeFill
(
data
)
{
uni
.
setStorageSync
(
"EYEFILL"
,
data
);
...
...
@@ -136,7 +139,7 @@ export function getCustomId() {
}
export
function
removeCustomId
()
{
return
uni
.
removeStorageSync
(
"CUSTOM-ID"
)
uni
.
removeStorageSync
(
"CUSTOM-ID"
)
}
export
function
setProjectId
(
data
)
{
...
...
@@ -148,7 +151,7 @@ export function getProjectId() {
}
export
function
removeProjectId
()
{
return
uni
.
removeStorageSync
(
"PROJECT-ID"
)
uni
.
removeStorageSync
(
"PROJECT-ID"
)
}
export
function
checkLoginAndVip
(
callback
)
{
...
...
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