Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
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
fulixin
dsk-operate-sys-cscec
Commits
ed3c94f4
Commit
ed3c94f4
authored
Mar 27, 2024
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge 成本汇总 导出excel
parent
792aba24
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
469 additions
and
125 deletions
+469
-125
index.js
dsk-operate-ui/src/api/projectCostLedger/index.js
+46
-1
request.js
dsk-operate-ui/src/utils/request.js
+97
-89
LockCostTip.vue
.../detail/components/CostSummary/components/LockCostTip.vue
+147
-0
index.vue
...projectCostLedger/detail/components/CostSummary/index.vue
+131
-13
AddActualCost.vue
...etail/components/FeedSummary/components/AddActualCost.vue
+4
-3
PushProjectUseDialog.vue
...omponents/FeedSummary/components/PushProjectUseDialog.vue
+17
-11
index.vue
...projectCostLedger/detail/components/FeedSummary/index.vue
+27
-8
No files found.
dsk-operate-ui/src/api/projectCostLedger/index.js
View file @
ed3c94f4
...
...
@@ -16,7 +16,7 @@ export function checkProjectCodeExist(data) {
return
request
({
url
:
'/cbProjectRecord/checkProjectCodeExist'
,
method
:
'get'
,
params
:
data
,
params
:
data
,
});
}
//新增项目
...
...
@@ -414,3 +414,48 @@ export const getCostSummaryListApi = (params = {}) => request({
params
});
/**
* 锁定成本前提示未填项
* @param {*} params
* @returns
*/
export
const
validateBeforeCostLockApi
=
(
params
=
{})
=>
request
({
url
:
"/cbSummary/getUnfilled"
,
method
:
"get"
,
params
});
/**
* 确定锁定成本
* @param {*} data
* @returns
*/
export
const
setCostLockApi
=
(
data
=
{})
=>
request
({
url
:
"/cbSummary/lockActual"
,
method
:
"post"
,
data
});
/**
* 获取已经锁定成本月份
* @param {*} params
* @returns
*/
export
const
getLockMonthListApi
=
(
params
=
{})
=>
request
({
url
:
"/cbSummary/expenseDateList/locked"
,
method
:
"get"
,
params
});
/**
* 成本汇总导出
* @param {*} data
* @returns
*/
export
const
exportCostLockExcelApi
=
(
data
=
{})
=>
request
({
url
:
"/cbSummary/export"
,
method
:
"post"
,
data
,
isFile
:
true
,
responseType
:
"blob"
});
dsk-operate-ui/src/utils/request.js
View file @
ed3c94f4
import
axios
from
'axios'
import
{
Notification
,
MessageBox
,
Message
,
Loading
}
from
'element-ui'
import
store
from
'@/store'
import
{
getToken
,
getTenantid
}
from
'@/utils/auth'
import
errorCode
from
'@/utils/errorCode'
import
axios
from
'axios'
;
import
{
Notification
,
MessageBox
,
Message
,
Loading
}
from
'element-ui'
;
import
store
from
'@/store'
;
import
{
getToken
,
getTenantid
}
from
'@/utils/auth'
;
import
errorCode
from
'@/utils/errorCode'
;
import
{
tansParams
,
blobValidate
}
from
"@/utils/ruoyi"
;
import
cache
from
'@/plugins/cache'
import
{
saveAs
}
from
'file-saver'
import
cache
from
'@/plugins/cache'
;
import
{
saveAs
}
from
'file-saver'
;
let
downloadLoadingInstance
;
// 是否显示重新登录
export
let
isRelogin
=
{
show
:
false
};
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
;
// 创建axios实例
const
service
=
axios
.
create
({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// 超时
timeout
:
20000
})
})
;
// request拦截器
service
.
interceptors
.
request
.
use
(
config
=>
{
// 是否需要设置 token
const
isToken
=
(
config
.
headers
||
{}).
isToken
===
false
const
isToken
=
(
config
.
headers
||
{}).
isToken
===
false
;
// 是否需要防止数据重复提交
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
;
if
(
getToken
()
&&
!
isToken
)
{
config
.
headers
[
'Authorization'
]
=
'Bearer '
+
getToken
()
// 让每个请求携带自定义token 请根据实际情况自行修改
config
.
headers
[
'tenantid'
]
=
getTenantid
()
//携带租户id
config
.
headers
[
'Authorization'
]
=
'Bearer '
+
getToken
()
;
// 让每个请求携带自定义token 请根据实际情况自行修改
config
.
headers
[
'tenantid'
]
=
getTenantid
()
;
//携带租户id
}
// get请求映射params参数
if
(
config
.
method
===
'get'
&&
config
.
params
)
{
...
...
@@ -64,119 +64,127 @@ service.interceptors.request.use(config => {
// }
// }
// }
return
config
return
config
;
},
error
=>
{
console
.
log
(
error
)
if
(
error
.
message
.
indexOf
(
'timeout'
)
<
0
)
{
//超时报错不提示
Promise
.
reject
(
error
)
console
.
log
(
error
);
if
(
error
.
message
.
indexOf
(
'timeout'
)
<
0
)
{
//超时报错不提示
Promise
.
reject
(
error
)
;
}
})
})
;
//频繁发送请求时,返回慢的数据覆盖了返回快的数据
let
pending
=
[]
let
CancelToken
=
axios
.
CancelToken
let
pending
=
[]
;
let
CancelToken
=
axios
.
CancelToken
;
let
cancelPending
=
(
config
)
=>
{
pending
.
forEach
((
item
,
index
)
=>
{
if
(
config
)
{
// if (item.UrlPath === '/combine/info/memberList' || item.UrlPath === '/combine/info/businessList' || item.UrlPath === '/combine/info/bidPage') {
if
(
item
.
UrlPath
===
config
.
url
&&
[
'/combine/info/memberList'
,
'/combine/info/businessList'
,
'/combine/info/bidPage'
].
includes
(
config
.
url
))
{
item
.
Cancel
()
// 取消请求
pending
.
splice
(
index
,
1
)
// 移除当前请求记录
if
(
item
.
UrlPath
===
config
.
url
&&
[
'/combine/info/memberList'
,
'/combine/info/businessList'
,
'/combine/info/bidPage'
].
includes
(
config
.
url
))
{
item
.
Cancel
()
;
// 取消请求
pending
.
splice
(
index
,
1
)
;
// 移除当前请求记录
};
}
else
{
item
.
Cancel
()
// 取消请求
pending
.
splice
(
index
,
1
)
// 移除当前请求记录
item
.
Cancel
()
;
// 取消请求
pending
.
splice
(
index
,
1
)
;
// 移除当前请求记录
}
})
}
})
;
}
;
// 响应拦截器
service
.
interceptors
.
response
.
use
(
res
=>
{
const
apiList
=
[
'/login'
,
'/system/user/profile/updatePwd'
]
//需要提示错误的接口
// 未设置状态码则默认成功状态
const
code
=
res
.
data
.
code
||
200
;
// 获取错误信息
const
msg
=
errorCode
[
code
]
||
res
.
data
.
msg
||
errorCode
[
'default'
]
// 二进制数据则直接返回
if
(
res
.
request
.
responseType
===
'blob'
||
res
.
request
.
responseType
===
'arraybuffer'
)
{
return
res
.
data
}
if
(
code
===
401
)
{
if
(
!
isRelogin
.
show
)
{
isRelogin
.
show
=
true
;
MessageBox
.
confirm
(
'登录状态已过期,您可以继续留在该页面,或者重新登录'
,
'系统提示'
,
{
confirmButtonText
:
'重新登录'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
isRelogin
.
show
=
false
;
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
sessionStorage
.
removeItem
(
'views'
)
location
.
href
=
'/index/gys'
;
})
const
{
config
,
headers
}
=
res
;
const
apiList
=
[
'/login'
,
'/system/user/profile/updatePwd'
];
//需要提示错误的接口
// 未设置状态码则默认成功状态
const
code
=
res
.
data
.
code
||
200
;
// 获取错误信息
const
msg
=
errorCode
[
code
]
||
res
.
data
.
msg
||
errorCode
[
'default'
];
// 文件下载
if
(
config
.
isFile
)
{
return
{
data
:
res
.
data
,
fileName
:
headers
[
"content-disposition"
]
};
}
// 二进制数据则直接返回
if
(
res
.
request
.
responseType
===
'blob'
||
res
.
request
.
responseType
===
'arraybuffer'
)
{
return
res
.
data
;
}
if
(
code
===
401
)
{
if
(
!
isRelogin
.
show
)
{
isRelogin
.
show
=
true
;
MessageBox
.
confirm
(
'登录状态已过期,您可以继续留在该页面,或者重新登录'
,
'系统提示'
,
{
confirmButtonText
:
'重新登录'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
isRelogin
.
show
=
false
;
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
sessionStorage
.
removeItem
(
'views'
);
location
.
href
=
'/index/gys'
;
});
}).
catch
(()
=>
{
isRelogin
.
show
=
false
;
});
}
return
Promise
.
reject
(
'无效的会话,或者会话已过期,请重新登录。'
)
}
else
if
(
code
===
500
)
{
Message
({
message
:
msg
,
type
:
'error'
})
return
Promise
.
reject
(
new
Error
(
msg
))
}
else
if
(
code
===
601
)
{
Message
({
message
:
msg
,
type
:
'warning'
})
return
Promise
.
reject
(
'error'
)
}
else
if
(
code
!==
200
)
{
Notification
.
error
({
title
:
msg
})
return
Promise
.
reject
(
'error'
)
}
else
{
// cancelPending(res.config)
return
res
.
data
}
},
error
=>
{
console
.
log
(
error
);
console
.
log
(
'err'
+
error
)
let
{
message
}
=
error
;
/*if (message == "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}*/
if
(
message
==
'数据正在处理,请勿重复提交'
){
//重复提交,提示样式特殊处理
Message
({
message
:
message
,
type
:
'warning'
,
duration
:
5
*
1000
})
}
else
{
// Message({ message: message, type: 'error', duration: 5 * 1000 })
}
if
(
error
.
message
.
indexOf
(
'timeout'
)
<
0
){
//超时报错不提示
return
Promise
.
reject
(
error
)
return
Promise
.
reject
(
'无效的会话,或者会话已过期,请重新登录。'
);
}
else
if
(
code
===
500
)
{
Message
({
message
:
msg
,
type
:
'error'
});
return
Promise
.
reject
(
new
Error
(
msg
));
}
else
if
(
code
===
601
)
{
Message
({
message
:
msg
,
type
:
'warning'
});
return
Promise
.
reject
(
'error'
);
}
else
if
(
code
!==
200
)
{
Notification
.
error
({
title
:
msg
});
return
Promise
.
reject
(
'error'
);
}
else
{
// cancelPending(res.config)
return
res
.
data
;
}
},
error
=>
{
console
.
log
(
error
);
console
.
log
(
'err'
+
error
);
let
{
message
}
=
error
;
/*if (message == "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}*/
if
(
message
==
'数据正在处理,请勿重复提交'
)
{
//重复提交,提示样式特殊处理
Message
({
message
:
message
,
type
:
'warning'
,
duration
:
5
*
1000
});
}
else
{
// Message({ message: message, type: 'error', duration: 5 * 1000 })
}
// return Promise.reject(error)
if
(
error
.
message
.
indexOf
(
'timeout'
)
<
0
)
{
//超时报错不提示
return
Promise
.
reject
(
error
);
}
)
// return Promise.reject(error)
}
);
// 通用下载方法
export
function
download
(
url
,
params
,
filename
,
config
)
{
downloadLoadingInstance
=
Loading
.
service
({
text
:
"正在下载数据,请稍候"
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
,
})
downloadLoadingInstance
=
Loading
.
service
({
text
:
"正在下载数据,请稍候"
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
,
})
;
return
service
.
post
(
url
,
params
,
{
transformRequest
:
[(
params
)
=>
{
return
tansParams
(
params
)
}],
transformRequest
:
[(
params
)
=>
{
return
tansParams
(
params
)
;
}],
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
responseType
:
'blob'
,
...
config
}).
then
(
async
(
data
)
=>
{
const
isBlob
=
blobValidate
(
data
);
if
(
isBlob
)
{
const
blob
=
new
Blob
([
data
])
saveAs
(
blob
,
filename
)
const
blob
=
new
Blob
([
data
])
;
saveAs
(
blob
,
filename
)
;
}
else
{
const
resText
=
await
data
.
text
();
const
rspObj
=
JSON
.
parse
(
resText
);
const
errMsg
=
errorCode
[
rspObj
.
code
]
||
rspObj
.
msg
||
errorCode
[
'default'
]
const
errMsg
=
errorCode
[
rspObj
.
code
]
||
rspObj
.
msg
||
errorCode
[
'default'
]
;
Message
.
error
(
errMsg
);
}
downloadLoadingInstance
.
close
();
}).
catch
((
r
)
=>
{
console
.
error
(
r
)
Message
.
error
(
'下载文件出现错误,请联系管理员!'
)
console
.
error
(
r
)
;
Message
.
error
(
'下载文件出现错误,请联系管理员!'
)
;
downloadLoadingInstance
.
close
();
})
})
;
}
export
default
service
export
default
service
;
dsk-operate-ui/src/views/projectCostLedger/detail/components/CostSummary/components/LockCostTip.vue
0 → 100644
View file @
ed3c94f4
<
template
>
<el-dialog
title=
"提示"
width=
"480px"
:visible=
"comLockCostTipDialog"
:close-on-click-modal=
"false"
class=
"lock-cost-tip-container"
@
close=
"dialogClose"
:destroy-on-close=
"true"
>
<div
class=
"lock-cost-tip-content"
>
{{
tipContent
}}
</div>
<!-- 底部按钮 -->
<div
class=
"lock-cost-tip-footer"
>
<div
class=
"cancel-btn"
@
click=
"cancel"
>
取消
</div>
<div
class=
"ok-btn"
@
click=
"ok"
>
确定锁定
</div>
</div>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
"lockCostTip"
,
model
:
{
prop
:
"lockCostTipDialog"
,
event
:
"update:lockCostTipDialog"
},
props
:
{
lockCostTipDialog
:
{
type
:
Boolean
,
default
:
false
},
tipContent
:
{
type
:
String
,
default
:
""
}
},
watch
:
{
lockCostTipDialog
:
{
handler
(
newValue
)
{
this
.
comLockCostTipDialog
=
newValue
;
}
}
},
data
()
{
return
{
comLockCostTipDialog
:
this
.
lockCostTipDialog
};
},
//可访问data属性
created
()
{
},
//计算集
computed
:
{
},
//方法集
methods
:
{
dialogClose
()
{
this
.
$emit
(
"update:lockCostTipDialog"
,
false
);
},
cancel
()
{
this
.
comLockCostTipDialog
=
false
;
},
ok
()
{
this
.
$emit
(
"ok"
);
}
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.lock-cost-tip-container
{
::v-deep
.el-dialog
{
min-height
:
240px
;
margin-top
:
0px
!
important
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
border-radius
:
4px
;
.el-dialog__header
{
padding
:
0px
20px
;
height
:
56px
;
box-sizing
:
border-box
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
border-bottom
:
1px
solid
#eeeeee
;
.el-dialog__title
{
color
:
#232323
;
font-size
:
16px
;
font-weight
:
bold
;
}
.el-dialog__headerbtn
{
position
:
static
;
width
:
16px
;
height
:
16px
;
}
}
.el-dialog__body
{
padding
:
0px
;
.lock-cost-tip-content
{
min-height
:
120px
;
padding
:
24px
20px
;
box-sizing
:
border-box
;
color
:
rgba
(
35
,
35
,
35
,
0
.8
);
line-height
:
20px
;
font-size
:
14px
;
font-weight
:
350
;
}
.lock-cost-tip-footer
{
height
:
64px
;
width
:
100%
;
border-top
:
1px
solid
#eeeeee
;
padding
:
0px
20px
;
box-sizing
:
border-box
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
.cancel-btn
,
.ok-btn
{
height
:
32px
;
padding
:
0px
16px
;
border-radius
:
4px
;
box-sizing
:
border-box
;
font-size
:
14px
;
font-weight
:
350
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
cursor
:
pointer
;
}
.cancel-btn
{
margin-right
:
12px
;
color
:
rgba
(
35
,
35
,
35
,
0
.8
);
border
:
1px
solid
#dcdfe6
;
}
.ok-btn
{
background
:
#0081ff
;
color
:
#fff
;
}
}
}
}
}
</
style
>
dsk-operate-ui/src/views/projectCostLedger/detail/components/CostSummary/index.vue
View file @
ed3c94f4
...
...
@@ -26,8 +26,12 @@
</el-option>
</el-select>
</div>
<!-- 锁定成本 导出excel 编辑成本 -->
<div
class=
"project-table-list-haeder-right"
>
<div
class=
"lock-cost-btn"
:class=
"{'current-month-lock' : currentMonthLock}"
@
click=
"!currentMonthLock ? lockCostHandler() : ''"
>
锁定成本
</div>
<div
class=
"export-excel-btn"
@
click=
"exportExcel"
>
导出Excel表
</div>
<div
class=
"edit-cost-btn"
>
{{addActualCostEditStatus ? "保存成本" : "编辑成本"}}
</div>
</div>
</div>
<!-- 数据列表部分 -->
...
...
@@ -42,13 +46,19 @@
</div>
</div>
</div>
<!-- 锁定前提示 -->
<lock-cost-tip
v-model=
"lockCostTipDialog"
:tip-content=
"lockCostTipDialogContent"
@
ok=
"okLock"
@
update:lockCostTipDialog=
"lockCostTipDialogClose"
></lock-cost-tip>
</div>
</template>
<
script
>
import
ProjectSideMenu
from
"@/views/projectCostLedger/detail/components/ProjectSideMenu"
;
import
DskSkeleton
from
"@/components/DskSkeleton"
;
import
CustomTable
from
"@/components/CustomTable"
;
import
{
getCostSummaryMenuTreeApi
,
getCostSummaryMonthListApi
,
getCostSummaryListApi
}
from
"@/api/projectCostLedger"
;
import
LockCostTip
from
"@/views/projectCostLedger/detail/components/CostSummary/components/LockCostTip"
;
import
{
getCostSummaryMenuTreeApi
,
getCostSummaryMonthListApi
,
getCostSummaryListApi
,
validateBeforeCostLockApi
,
getLockMonthListApi
,
setCostLockApi
,
exportCostLockExcelApi
}
from
"@/api/projectCostLedger"
;
import
{
v4
}
from
'uuid'
;
import
dayjs
from
"dayjs"
;
import
{
cloneDeep
}
from
"lodash-es"
;
...
...
@@ -97,7 +107,8 @@ export default {
components
:
{
ProjectSideMenu
,
DskSkeleton
,
CustomTable
CustomTable
,
LockCostTip
},
data
()
{
return
{
...
...
@@ -125,18 +136,30 @@ export default {
total
:
0
,
// 列表表头
formColum
:
[
{
label
:
'序号'
,
prop
:
"number"
,
minWidth
:
"
53
"
,
uid
:
v4
()
},
{
label
:
'序号'
,
prop
:
"number"
,
minWidth
:
"
80
"
,
uid
:
v4
()
},
{
label
:
'名称'
,
prop
:
"cbName"
,
width
:
"303"
,
uid
:
v4
(),
showOverflowTooltip
:
true
},
{
label
:
'不含税成本合价'
,
prop
:
"taxExclusiveTotal"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'成本税金合价'
,
prop
:
"cbTaxesTotal"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'含税成本合价'
,
prop
:
"taxInclusiveTotal"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'成本占比'
,
prop
:
"cbProportion"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'含税成本平米指标'
,
prop
:
"taxInclusivePmTarget"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'备注'
,
prop
:
"remark"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'本月费用(含税)'
,
prop
:
"taxInclusiveExpense"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'本月费用(不含税)'
,
prop
:
"taxExclusiveExpense"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'截止本月费用(含税)'
,
prop
:
"taxInclusiveExpenseTotal"
,
width
:
"182"
,
uid
:
v4
()
},
{
label
:
'截止本月费用(不含税)'
,
prop
:
"taxExclusiveExpenseTotal"
,
width
:
"182"
,
uid
:
v4
()
},
],
monthList
:
[],
// 源数据月份
originMonthList
:
[],
// 已经锁定的成本月份
lockMonthList
:
[],
rowKey
:
"id"
,
// 列表懒加载配置
treeOptions
:
{
children
:
"children"
,
hasChildren
:
"hasChildren"
},
// 源数据月份
originMonthList
:
[],
dataForm
:
{
// 数据列表源数据
tableDataList
:
[],
...
...
@@ -157,6 +180,10 @@ export default {
addActualCostEditStatus
:
false
,
// 当前选择的成本年份
selectActualCostTime
:
""
,
// 锁定成本前提示弹窗
lockCostTipDialog
:
false
,
// 锁定成本前提示弹窗文本内容
lockCostTipDialogContent
:
""
,
};
},
//可访问data属性
...
...
@@ -165,7 +192,10 @@ export default {
},
//计算集
computed
:
{
// 查看当前月是否是锁定状态 lock为true 不能锁定 反之可以
currentMonthLock
()
{
return
this
.
lockMonthList
.
includes
(
this
.
expenseDate
);
}
},
//方法集
methods
:
{
...
...
@@ -204,6 +234,7 @@ export default {
};
await
this
.
getCostSummaryMenuTree
(
params
);
await
this
.
getCostSummaryMonthList
(
params
);
await
this
.
getLockMonthList
(
params
);
await
this
.
initDefaultSetting
(
resetDate
);
}
catch
(
error
)
{
console
.
log
(
error
);
...
...
@@ -310,6 +341,17 @@ export default {
}
},
// 获得已锁定锁定成本月
async
getLockMonthList
(
params
)
{
try
{
const
lockMonth
=
await
getLockMonthListApi
(
params
);
if
(
lockMonth
.
code
==
200
&&
lockMonth
.
data
instanceof
Array
)
{
this
.
lockMonthList
=
lockMonth
.
data
;
}
}
catch
(
error
)
{
}
},
monthChange
(
month
)
{
// 当前月
const
_now
=
this
.
getNowMonth
();
...
...
@@ -364,7 +406,7 @@ export default {
return
item
;
});
}
console
.
log
(
_temp
);
//
console.log(_temp);
this
.
$set
(
this
.
dataForm
,
"tableDataList"
,
cloneDeep
(
_temp
));
this
.
originTableDataList
=
cloneDeep
(
_temp
);
this
.
total
=
_temp
.
length
;
...
...
@@ -403,8 +445,8 @@ export default {
this
.
$set
(
treeData
,
newKey
,
metaInfo
);
//lazyTreeNodeMap中 添加数据
this
.
$set
(
treeNodeMap
,
newKey
,
children
);
console
.
log
(
treeData
,
"treeData"
);
console
.
log
(
treeNodeMap
,
"treeNodeMap"
);
//
console.log(treeData, "treeData");
//
console.log(treeNodeMap, "treeNodeMap");
},
async
getCostSummaryListLazy
(
params
=
{})
{
try
{
...
...
@@ -472,6 +514,68 @@ export default {
const
params
=
this
.
createRequestConditions
(
this
.
expenseDate
);
this
.
getCostSummaryList
(
params
);
},
// 锁定成本
async
lockCostHandler
()
{
try
{
const
{
cbType
,
projectId
}
=
this
.
createRequestConditions
();
const
params
=
{
expenseDate
:
this
.
expenseDate
,
cbType
,
projectId
};
const
tip
=
await
validateBeforeCostLockApi
(
params
);
if
(
tip
.
code
==
200
&&
tip
.
data
==
500
)
{
console
.
log
(
tip
);
this
.
lockCostTipDialogContent
=
tip
.
msg
;
this
.
lockCostTipDialog
=
true
;
return
;
}
}
catch
(
error
)
{
}
},
// 锁定成本弹窗关闭
lockCostTipDialogClose
()
{
this
.
lockCostTipDialogContent
=
""
;
this
.
lockCostTipDialog
=
false
;
},
// 确定锁定成本
async
okLock
()
{
try
{
const
{
cbType
,
projectId
}
=
this
.
createRequestConditions
();
const
params
=
{
expenseDate
:
this
.
expenseDate
,
cbType
,
projectId
};
const
lockResult
=
await
setCostLockApi
(
params
);
if
(
lockResult
.
code
==
200
)
{
this
.
$message
.
success
(
"锁定成功"
);
this
.
lockCostTipDialog
=
false
;
}
}
catch
(
error
)
{
}
},
// 导出excel
async
exportExcel
()
{
try
{
const
{
cbType
,
projectId
}
=
this
.
createRequestConditions
();
const
params
=
{
expenseDate
:
this
.
expenseDate
,
cbType
,
projectId
};
let
{
data
,
fileName
}
=
await
exportCostLockExcelApi
(
params
);
console
.
log
(
data
,
fileName
);
if
(
data
&&
fileName
)
{
fileName
=
fileName
.
split
(
";"
)[
1
].
split
(
"filename="
)[
1
];
this
.
$download
.
saveAs
(
data
,
decodeURIComponent
(
fileName
));
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
},
}
</
script
>
...
...
@@ -584,13 +688,14 @@ export default {
display
:
flex
;
align-items
:
center
;
.actual-cost-btn
,
.unit-conversion-btn
{
.lock-cost-btn
,
.export-excel-btn
,
.edit-cost-btn
{
height
:
32px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
padding
:
0px
1
2
px
;
padding
:
0px
1
6
px
;
background-color
:
#0081ff
;
border-color
:
#0081ff
;
border-radius
:
4px
;
...
...
@@ -598,6 +703,19 @@ export default {
font-size
:
14px
;
font-weight
:
350
;
margin-right
:
16px
;
cursor
:
pointer
;
}
.lock-cost-btn
{
/* 当前月锁定 */
&
.current-month-lock
{
cursor
:
not
-
allowed
;
background
:
#66b3ff
;
}
}
.edit-cost-btn
{
margin-right
:
0px
;
}
}
}
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/components/AddActualCost.vue
View file @
ed3c94f4
<
template
>
<el-dialog
title=
"填写实际成本"
:visible=
"comDialogStatus"
class=
"add-actual-cost-container"
@
close=
"dialogClose"
>
<div
class=
"dialog-content-inner"
>
<el-dialog
title=
"填写实际成本"
:visible=
"comDialogStatus"
class=
"add-actual-cost-container"
@
close=
"dialogClose"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
>
<div
class=
" dialog-content-inner"
>
<!-- 成本年份 -->
<div
class=
"cost-year-container"
>
<span>
成本年份
</span>
...
...
@@ -93,7 +94,7 @@ export default {
// 当前项目月份 补0
const
_thresholdMonth
=
_thresholdTime
.
slice
(
4
);
// 是否小于当前项目年月 或 大于 当前项目年月 往后推五年
const
lastYearMonth
=
parseInt
(
`
${
parseInt
(
_thresholdYear
)
+
5
}${
_thresholdMonth
}
`
);
;
const
lastYearMonth
=
parseInt
(
`
${
parseInt
(
_thresholdYear
)
+
5
}${
_thresholdMonth
}
`
);
if
(
parseInt
(
_optionTime
)
<
parseInt
(
_thresholdTime
)
||
parseInt
(
_optionTime
)
>
lastYearMonth
)
{
return
true
;
}
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/components/PushProjectUseDialog.vue
View file @
ed3c94f4
...
...
@@ -4,17 +4,17 @@
<div
class=
"dialog-body-content"
>
<el-form
:model=
"pushForm"
ref=
"pushForm"
:rules=
"rules"
class=
"push-form"
>
<el-form-item
label=
"分包项目名称"
>
<el-input
:value=
"pushForm.project
DetailInfo.project
Name"
:disabled=
"true"
></el-input>
<el-input
:value=
"pushForm.projectName"
:disabled=
"true"
></el-input>
</el-form-item>
<el-form-item
label=
"本月实际工程量"
>
<el-input
:value=
"pushForm.totalQuantities"
:disabled=
"true"
></el-input>
</el-form-item>
<el-form-item
label=
"需推送工程量"
prop=
"pushQuantities"
:rules=
"pushQuantitiesValidator(pushForm.totalQuantities)"
>
<el-input
v-model=
"pushForm.pushQuantities"
placeholder=
"请填写需推送工程量"
></el-input>
<el-input
v-model=
"pushForm.pushQuantities"
@
input=
"pushQuantitiesIpt"
placeholder=
"请填写需推送工程量"
></el-input>
</el-form-item>
<!-- ipm项目编码 -->
<el-form-item
label=
"IPM项目编码"
>
<el-input
v-model=
"pushForm.
projectDetailInfo.ipmProjectNo
"
placeholder=
"请输入IPM项目编码"
></el-input>
<el-input
v-model=
"pushForm.
ipmProjectCode
"
placeholder=
"请输入IPM项目编码"
></el-input>
</el-form-item>
<!-- ipm合同编码 -->
<el-form-item
label=
"IPM合同编码"
>
...
...
@@ -34,7 +34,7 @@
</el-dialog>
</
template
>
<
script
>
import
{
subtract
,
targetIsNegative
}
from
"@/utils/decimal"
;
import
{
subtract
,
targetIsNegative
,
add
}
from
"@/utils/decimal"
;
import
{
cloneDeep
}
from
'lodash-es'
;
export
default
{
name
:
"pushProjectUseDialog"
,
...
...
@@ -80,15 +80,12 @@ export default {
comPushProjectUseDialog
:
this
.
pushProjectUseDialog
,
pushForm
:
{
id
:
""
,
projectName
:
""
,
totalQuantities
:
""
,
pushQuantities
:
""
,
ipmProjectCode
:
""
,
ipmContractCode
:
""
,
ipmBizCode
:
""
,
totalQuantities
:
""
,
projectDetailInfo
:
{
projectName
:
""
,
ipmProjectNo
:
""
}
},
rules
:
{}
};
...
...
@@ -115,11 +112,20 @@ export default {
}
}];
},
pushQuantitiesIpt
(
value
)
{
const
reg
=
/^
(?!
0
\d)(?!
0+$
)(?!
0*
\.
0*$
)\d
+
(\.\d
+
)?
$/
;
if
(
reg
.
test
(
value
))
{
this
.
pushForm
.
pushQuantities
=
add
(
0
,
value
);
}
},
clearValidate
()
{
const
form
=
this
.
$refs
[
"pushForm"
];
if
(
form
)
form
.
clearValidate
();
},
dialogClose
()
{
this
.
$emit
(
"dialogClose"
);
this
.
pushForm
=
this
.
$options
.
data
.
call
(
this
).
pushForm
;
const
form
=
this
.
$refs
[
"pushForm"
];
if
(
form
)
form
.
clearValidate
();
this
.
clearValidate
();
this
.
$emit
(
"close"
,
false
);
},
dialogOpen
()
{
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/index.vue
View file @
ed3c94f4
...
...
@@ -42,7 +42,7 @@
<
template
slot=
"action-field-bar"
slot-scope=
"scope"
>
<div
class=
"project-action-field-bar"
v-if=
"rowCanEditInput(scope.rowIndex,hasTarget)"
>
<span
class=
"push-project-use"
:class=
"
{'is-emty-quantities' : rowHasLastPush(scope.rowIndex)}"
@click="
parseFloat(scope.row.quantities
) ? pushProjectUse(scope.row) : ''">推送工程量
</span>
@click="
!rowHasLastPush(scope.rowIndex
) ? pushProjectUse(scope.row) : ''">推送工程量
</span>
</div>
<span
v-else
>
-
</span>
</
template
>
...
...
@@ -208,9 +208,9 @@ export default {
{
label
:
'指导价格'
,
prop
:
"guidePrice"
,
minWidth
:
"81"
,
uid
:
v4
()
},
{
label
:
'投标选用单价(不含税)'
,
prop
:
"bidUnitPrice"
,
minWidth
:
"179"
,
uid
:
v4
()
},
{
label
:
'单价差额'
,
prop
:
"unitPriceDifference"
,
minWidth
:
"81"
,
uid
:
v4
()
},
{
label
:
'数量'
,
prop
:
"quantity"
,
minWidth
:
"
53
"
,
uid
:
v4
()
},
{
label
:
'合价(不含税)'
,
prop
:
"combinedPrice"
,
minWidth
:
"1
23
"
,
uid
:
v4
()
},
{
label
:
'合价(含税)'
,
prop
:
"combinedPriceTax"
,
minWidth
:
"1
09
"
,
uid
:
v4
()
},
{
label
:
'数量'
,
prop
:
"quantity"
,
minWidth
:
"
150
"
,
uid
:
v4
()
},
{
label
:
'合价(不含税)'
,
prop
:
"combinedPrice"
,
minWidth
:
"1
50
"
,
uid
:
v4
()
},
{
label
:
'合价(含税)'
,
prop
:
"combinedPriceTax"
,
minWidth
:
"1
50
"
,
uid
:
v4
()
},
{
label
:
'品牌名称'
,
prop
:
"brandName"
,
minWidth
:
"81"
,
uid
:
v4
()
},
{
label
:
'投标选用来源'
,
prop
:
"bidSource"
,
minWidth
:
"109"
,
uid
:
v4
()
},
]
...
...
@@ -260,7 +260,16 @@ export default {
// 推送工程量弹窗
pushProjectUseDialog
:
false
,
// 推送工程量数据缓存
pushProjectUseTemp
:
{},
pushProjectUseTemp
:
{
id
:
""
,
pushQuantities
:
""
,
ipmProjectCode
:
""
,
ipmContractCode
:
""
,
ipmBizCode
:
""
,
totalQuantities
:
""
,
projectName
:
""
,
ipmProjectNo
:
""
},
checkRules
:
{
amountCheck
:
[
{
trigger
:
[
"change"
],
validator
:
amountCheckValidator
}
...
...
@@ -613,7 +622,7 @@ export default {
// 当前行源数据是否存在以推送工程量
rowHasLastPush
(
index
)
{
const
_tempRow
=
this
.
originTableDataList
[
index
];
return
!
parseFloat
(
_tempRow
.
quantities
)
return
!
parseFloat
(
_tempRow
.
quantities
)
;
},
// 保存
saveActualCost
()
{
...
...
@@ -651,13 +660,23 @@ export default {
pushProjectUse
(
row
)
{
if
(
!
row
.
id
)
return
;
// 打开推送推送弹窗
const
_temp
=
{
...
this
.
pushProjectUseTemp
,
...
cloneDeep
(
row
),
projectDetailInfo
:
cloneDeep
(
this
.
projectDetailInfo
)
};
const
_temp
=
{
...
this
.
pushProjectUseTemp
,
...{
id
:
row
.
id
,
projectName
:
this
.
projectDetailInfo
.
projectName
,
totalQuantities
:
row
.
totalQuantities
,
pushQuantities
:
""
,
ipmProjectCode
:
""
,
ipmContractCode
:
""
,
ipmBizCode
:
""
}
};
this
.
pushProjectUseTemp
=
_temp
;
this
.
pushProjectUseDialog
=
true
;
},
// 推送工程用量弹窗关闭
dialogClose
()
{
this
.
pushProjectUseTemp
=
{}
;
this
.
pushProjectUseTemp
=
this
.
$options
.
data
.
call
(
this
).
pushProjectUseTemp
;
},
differentCompare
()
{
const
originData
=
this
.
originTableDataList
;
...
...
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