Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
f37edf9c
Commit
f37edf9c
authored
Aug 18, 2022
by
黄卓
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
59dcc3ea
9d7e2f8d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1168 additions
and
40 deletions
+1168
-40
financial.js
src/api/ecw/financial.js
+69
-1
dict.js
src/utils/dict.js
+1
-0
myAchievement.vue
src/views/ecw/deptTarget/myAchievement.vue
+340
-0
creatCollection.vue
src/views/ecw/financial/creatCollection.vue
+1
-1
creatPayment.vue
src/views/ecw/financial/creatPayment.vue
+105
-16
payable.vue
src/views/ecw/financial/payable.vue
+1
-5
paymentExamine.vue
src/views/ecw/financial/paymentExamine.vue
+287
-0
paymentVoucher.vue
src/views/ecw/financial/paymentVoucher.vue
+55
-17
printPaymentVoucher.vue
src/views/ecw/financial/printPaymentVoucher.vue
+309
-0
No files found.
src/api/ecw/financial.js
View file @
f37edf9c
...
...
@@ -80,4 +80,72 @@ export function getPaymentList(query) {
method
:
'
get
'
,
params
:
query
})
}
\ No newline at end of file
}
// 获取付款单详情
export
function
getPaymentInfoByIds
(
query
)
{
return
request
({
url
:
'
/ecw/payment/get
'
,
method
:
'
get
'
,
params
:
query
})
}
// 获得付款单付款明细
export
function
getPaymentItem
(
query
)
{
return
request
({
url
:
'
/ecw/payment/getPaymentItem
'
,
method
:
'
get
'
,
params
:
query
})
}
// 更新付款单
export
function
updatePayment
(
data
)
{
return
request
({
url
:
'
/ecw/payment/update
'
,
method
:
'
put
'
,
data
:
data
})
}
// 删除付款单
export
function
deletePayment
(
id
)
{
return
request
({
url
:
'
/ecw/payment/delete?id=
'
+
id
,
method
:
'
delete
'
})
}
// 审核付款单
export
function
paymentVerify
(
query
)
{
return
request
({
url
:
'
/ecw/payment/verify
'
,
method
:
'
post
'
,
data
:
query
})
}
// 核销付款单
export
function
paymentVerification
(
id
)
{
return
request
({
url
:
'
/ecw/payment/verification/
'
+
id
,
method
:
'
GET
'
})
}
// 反核销付款单
export
function
paymentVerificationCancel
(
id
)
{
return
request
({
url
:
'
/ecw/payment/verificationCancel/
'
+
id
,
method
:
'
GET
'
})
}
// 反审核付款单
export
function
paymentVerifyCancel
(
id
)
{
return
request
({
url
:
'
/ecw/payment/verifyCancel/
'
+
id
,
method
:
'
GET
'
})
}
src/utils/dict.js
View file @
f37edf9c
...
...
@@ -103,6 +103,7 @@ export const DICT_TYPE = {
ECW_BEGINTIME_TYPE_ENDTIME
:
'
begintime_type_endtime
'
,
// 时间筛选字段(订单)
ECW_CUSTOM_DRAWEE
:
'
custom_drawee
'
,
// 自定义付款人费用类型
ECW_IS_DRAFT
:
'
is_draft
'
,
// 草稿发布状态
ECW_PAYMENT_STATE
:
'
payment_state
'
,
//付款单状态
ECW_PRICE_TYPE
:
'
price_type
'
,
//--------ecw---------
CUSTOMER_STATUS
:
'
customer_status
'
,
...
...
src/views/ecw/deptTarget/myAchievement.vue
0 → 100644
View file @
f37edf9c
<
template
>
<div
class=
"app-container"
>
<!-- 搜索工作栏 -->
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"运输方式"
prop=
"transportType"
>
<dict-selector
:type=
"DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model=
"queryParams.transportType"
formatter=
"number"
/>
</el-form-item>
<el-form-item
label=
"出货渠道"
prop=
"shippingChannel"
>
<el-select
v-model=
"queryParams.shippingChannel"
placeholder=
"请选择出货渠道"
>
<el-option
v-for=
"item in channelList"
:label=
"item.nameZh"
:value=
"item.channelId"
:key=
"item.channelId"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"开始时间"
prop=
"beginStartTime"
>
<el-date-picker
v-model=
"queryParams.beginStartTime"
placeholder=
"请选择开始时间"
value-format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
<el-form-item
label=
"结束时间"
prop=
"endStartTime"
>
<el-date-picker
v-model=
"queryParams.endStartTime"
placeholder=
"请选择结束时间"
value-format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
搜索
</el-button>
</el-form-item>
</el-form>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"目标名称"
align=
"center"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deptName
}}{{
scope
.
row
.
targetPeriodName
}}
目标
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"部门"
align=
"center"
prop=
"deptName"
/>
<el-table-column
label=
"目标类型"
align=
"center"
prop=
"targetType"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.TARGET_TYPE"
:value=
"scope.row.targetType"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"时间范围"
align=
"center"
prop=
"targetPeriodName"
>
<
template
slot-scope=
"scope"
>
<span>
{{
dateFormat
(
scope
.
row
.
startTime
)
}}
~
{{
dateFormat
(
scope
.
row
.
endTime
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"部门人数"
align=
"center"
prop=
"deptEmpCount"
/>
<el-table-column
label=
"目标方数"
align=
"center"
prop=
"cubeNum"
/>
<el-table-column
label=
"运输方式"
align=
"center"
prop=
"transportType"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.TRANSPORT_TYPE"
:value=
"scope.row.transportType"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"出货渠道"
align=
"center"
prop=
"shippingChannel"
>
<
template
slot-scope=
"scope"
>
<span>
{{
getShipChannelName
(
scope
.
row
.
shippingChannel
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"已完成方数"
align=
"center"
prop=
"completeCubeNum"
/>
<el-table-column
label=
"完成比例"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
{{
(
scope
.
row
.
completeCubeNum
/
scope
.
row
.
cubeNum
*
100
).
toFixed
(
2
)
+
'
%
'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['ecw:dept-target:update']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['ecw:dept-target:delete']"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-search"
@
click=
"handleView(scope.row)"
v-hasPermi=
"['ecw:dept-target:create']"
></el-button>
</
template
>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show=
"total > 0"
:total=
"total"
:page.sync=
"queryParams.pageNo"
:limit.sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</div>
</template>
<
script
>
import
{
createDeptTarget
,
updateDeptTarget
,
deleteDeptTarget
,
getDeptTarget
,
getDeptTargetPage
,
exportDeptTargetExcel
,
getCreateInitData
,
getPersonTargetPage
}
from
"
@/api/ecw/deptTarget
"
;
import
{
listSimpleDepts
}
from
"
@/api/system/dept
"
;
import
{
getChannelList
}
from
'
@/api/ecw/channel
'
;
import
dayjs
from
"
dayjs
"
;
export
default
{
name
:
"
DeptTarget
"
,
components
:
{},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 导出遮罩层
exportLoading
:
false
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
tableTotal
:
0
,
// 部门业绩目标设置列表
list
:
[],
tableList
:
[],
// 弹出层标题
title
:
""
,
detail
:
{
deptName
:
null
,
targetType
:
null
,
cubeNum
:
null
,
shippingChannel
:
null
,
transportType
:
null
,
},
// 是否显示弹出层
open
:
false
,
tableOpen
:
false
,
dateRangeCreateTime
:
[],
dateRangeStartTime
:
[],
dateRangeEndTime
:
[],
deptData
:
[],
deptArr
:
[],
channelList
:
[],
monthList
:
[],
quarterList
:
[],
yearList
:
[],
targetPeriod
:
[],
// 查询参数
queryParams
:
{
pageNo
:
1
,
pageSize
:
10
,
deptId
:
null
,
targetType
:
null
,
targetPeriodName
:
null
,
transportType
:
null
,
shippingChannel
:
null
,
cubeNum
:
null
,
},
tableQueryParams
:
{
pageNo
:
1
,
pageSize
:
10
,
id
:
null
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
deptId
:
[{
required
:
true
,
message
:
"
部门ID不能为空
"
,
trigger
:
"
blur
"
}],
targetType
:
[{
required
:
true
,
message
:
"
目标类型不能为空
"
,
trigger
:
"
change
"
}],
cubeNum
:
[{
required
:
true
,
message
:
"
立方数不能为空
"
,
trigger
:
"
blur
"
}],
}
};
},
computed
:
{
getShipChannelName
()
{
return
shippingChannelId
=>
{
for
(
let
index
in
this
.
channelList
)
{
let
channelItem
=
this
.
channelList
[
index
];
if
(
channelItem
.
channelId
==
shippingChannelId
)
{
return
channelItem
.
nameZh
;
}
}
return
'
/
'
}
}
},
created
()
{
this
.
getChannelList
();
this
.
getList
();
},
methods
:
{
getChannelList
()
{
getChannelList
().
then
(
res
=>
this
.
channelList
=
res
.
data
)
},
dateFormat
(
val
)
{
return
dayjs
(
val
).
format
(
"
YYYY-MM-DD
"
);
},
changeList
(
val
)
{
if
(
val
===
1
)
{
this
.
form
.
targetPeriodName
=
undefined
;
this
.
targetPeriod
=
this
.
monthList
;
}
else
if
(
val
===
2
)
{
this
.
form
.
targetPeriodName
=
undefined
;
this
.
targetPeriod
=
this
.
quarterList
;
}
else
{
this
.
form
.
targetPeriodName
=
undefined
;
this
.
targetPeriod
=
this
.
yearList
;
}
},
setTime
(
item
)
{
this
.
targetPeriod
.
forEach
((
i
,
index
)
=>
{
if
(
i
.
name
===
item
)
{
this
.
form
.
startTime
=
i
.
startDate
;
this
.
form
.
endTime
=
i
.
endDate
;
}
})
},
/** 查询列表 */
getList
()
{
this
.
loading
=
true
;
// 执行查询
getDeptTargetPage
(
params
).
then
(
response
=>
{
this
.
list
=
response
.
data
.
list
;
this
.
total
=
response
.
data
.
total
;
this
.
loading
=
false
;
});
},
/** 取消按钮 */
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
/** 表单重置 */
reset
()
{
this
.
form
=
{
id
:
undefined
,
deptId
:
undefined
,
targetType
:
undefined
,
targetPeriodName
:
undefined
,
startTime
:
undefined
,
endTime
:
undefined
,
transportType
:
undefined
,
shippingChannel
:
undefined
,
cubeNum
:
undefined
,
};
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNo
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
dateRangeCreateTime
=
[];
this
.
dateRangeStartTime
=
[];
this
.
dateRangeEndTime
=
[];
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
targetPeriod
=
this
.
monthList
;
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"
添加部门业绩目标设置
"
;
},
/** 查看人员目标情况 */
handleView
(
row
)
{
this
.
detail
=
row
;
this
.
tableQueryParams
.
id
=
row
.
id
;
this
.
getTableList
();
this
.
tableOpen
=
true
;
},
getTableList
()
{
getPersonTargetPage
(
this
.
tableQueryParams
).
then
(
res
=>
{
this
.
tableList
=
res
.
data
.
list
;
this
.
tableTotal
=
res
.
data
.
total
;
});
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
;
getDeptTarget
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
if
(
response
.
data
.
targetType
===
1
)
{
this
.
targetPeriod
=
this
.
monthList
;
}
else
if
(
response
.
data
.
targetType
===
2
)
{
this
.
targetPeriod
=
this
.
quarterList
;
}
else
{
this
.
targetPeriod
=
this
.
yearList
;
}
this
.
open
=
true
;
this
.
title
=
"
修改部门业绩目标设置
"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
!
valid
)
{
return
;
}
// 修改的提交
if
(
this
.
form
.
id
!=
null
)
{
updateDeptTarget
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
return
;
}
// 添加的提交
createDeptTarget
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
id
=
row
.
id
;
this
.
$modal
.
confirm
(
'
是否确认删除部门业绩目标设置编号为"
'
+
id
+
'
"的数据项?
'
).
then
(
function
()
{
return
deleteDeptTarget
(
id
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{
});
},
/** 导出按钮操作 */
handleExport
()
{
// 处理查询参数
let
params
=
{...
this
.
queryParams
};
params
.
pageNo
=
undefined
;
params
.
pageSize
=
undefined
;
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeCreateTime
,
'
createTime
'
);
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeStartTime
,
'
startTime
'
);
this
.
addBeginAndEndTime
(
params
,
this
.
dateRangeEndTime
,
'
endTime
'
);
// 执行导出
this
.
$modal
.
confirm
(
'
是否确认导出所有部门业绩目标设置数据项?
'
).
then
(()
=>
{
this
.
exportLoading
=
true
;
return
exportDeptTargetExcel
(
params
);
}).
then
(
response
=>
{
this
.
$download
.
excel
(
response
,
'
${table.classComment}.xls
'
);
this
.
exportLoading
=
false
;
}).
catch
(()
=>
{
});
}
}
};
</
script
>
src/views/ecw/financial/creatCollection.vue
View file @
f37edf9c
...
...
@@ -404,7 +404,7 @@
border
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
>
</el-table-column>
<el-table-column
type=
"selection"
width=
"55"
:reserve-selection=
"true"
>
</el-table-column>
<el-table-column
label=
"订单号"
align=
"center"
prop=
"orderNo"
/>
<el-table-column
label=
"唛头"
align=
"center"
prop=
"marks"
/>
<el-table-column
label=
"品名"
align=
"center"
prop=
"title"
>
...
...
src/views/ecw/financial/creatPayment.vue
View file @
f37edf9c
...
...
@@ -162,7 +162,7 @@
size=
"mini"
@
click=
"handleAdd"
style=
"padding: 10px; margin-bottom: 10px"
>
添加
供应商未付
款项
</el-button
>
添加
未付供应商
款项
</el-button
>
</el-col>
<el-table
v-loading=
"loadings"
:data=
"list"
border
:show-summary=
"!!list.length"
:summary-method=
"getSummaries"
>
...
...
@@ -175,15 +175,27 @@
></dict-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"发票号码"
align=
"center"
prop=
"invoiceNumber"
/>
<el-table-column
label=
"发票号码"
align=
"center"
prop=
"invoiceNumber"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.invoiceNumber"
></el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"应付金额"
align=
"center"
prop=
"totalAmount"
/>
<el-table-column
label=
"币种"
align=
"center"
prop=
"currencyId"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.BOX_SHIPPING_PRICE_UNIT"
:value=
"scope.row.currencyId"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"汇率"
align=
"center"
prop=
"exchangeRate"
/>
<el-table-column
label=
"税率"
align=
"center"
prop=
"taxRate"
/>
<el-table-column
label=
"汇率"
align=
"center"
prop=
"exchangeRate"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exchangeRate"
></el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"税率%"
align=
"center"
prop=
"taxRate"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.taxRate"
@
keyup.native=
"scope.row.taxRate = oninput(scope.row.taxRate)"
></el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"价税合计(RMB)"
align=
"center"
prop=
"total"
/>
</el-table>
...
...
@@ -232,12 +244,12 @@
</el-form>
</el-card>
<div
slot=
"footer"
style=
"margin: 20px 0"
>
<el-button
type=
"primary"
@
click=
"submit
Form
"
>
保 存
</el-button>
<el-button
type=
"primary"
@
click=
"submit
Draft
"
>
保 存
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm"
>
新 增
</el-button>
</div>
<el-dialog
:visible.sync=
"open"
title=
"添加未
收客户
款项"
title=
"添加未
付供应商
款项"
width=
"80%"
append-to-body
@
open=
"openDialog"
...
...
@@ -356,7 +368,7 @@
@
selection-change=
"handleSelectionChange"
row-key=
"id"
>
<el-table-column
type=
"selection"
width=
"55"
>
</el-table-column>
<el-table-column
type=
"selection"
width=
"55"
:reserve-selection=
"true"
>
</el-table-column>
<el-table-column
label=
"自编号"
align=
"center"
prop=
"payableNo"
/>
<el-table-column
label=
"货柜号"
align=
"center"
prop=
"containerNo"
/>
<el-table-column
label=
"供应商"
align=
"center"
prop=
"supplierName"
/>
...
...
@@ -383,7 +395,7 @@
@
pagination=
"getList"
/>
<!-- </el-card> -->
<div
slot=
"footer"
class=
"dialog-footer
"
>
<div
slot=
"footer"
style=
"margin: 20px 0; text-align: center;
"
>
<el-button
type=
"primary"
@
click=
"saveSelectList"
>
确认添加
</el-button>
<el-button
@
click=
"hiddenDialog"
>
取 消
</el-button>
</div>
...
...
@@ -402,7 +414,7 @@ import { getBankAccountPage } from "@/api/ecw/bankAccount";
import
{
listSimpleDepts
}
from
"
@/api/system/dept
"
;
import
{
getTradeCityList
}
from
"
@/api/ecw/region
"
;
import
{
getSupplierPage
}
from
"
@/api/ecw/supplier
"
;
import
{
getPayableList
,
getPayableInfoByIds
,
createPayment
}
from
"
@/api/ecw/financial
"
import
{
getPayableList
,
getPayableInfoByIds
,
createPayment
,
getPaymentInfoByIds
,
getPaymentItem
,
updatePayment
}
from
"
@/api/ecw/financial
"
export
default
{
name
:
"
CreatPayment
"
,
components
:
{
...
...
@@ -411,6 +423,7 @@ export default {
data
()
{
return
{
id
:
0
,
payableId
:
0
,
orderData
:
[],
total
:
0
,
loadings
:
false
,
...
...
@@ -418,6 +431,7 @@ export default {
form
:
{},
creatorData
:
[],
list
:
[],
defaultList
:
[],
channelList
:
[],
loading
:
""
,
bankData
:
[],
...
...
@@ -438,13 +452,29 @@ export default {
},
created
()
{
let
that
=
this
;
if
(
that
.
$route
.
query
.
id
&&
that
.
$route
.
query
.
i
d
!==
'
0
'
)
{
this
.
id
=
this
.
$route
.
query
.
i
d
;
getPayableInfoByIds
({
id
:
this
.
i
d
}).
then
(
res
=>
{
if
(
that
.
$route
.
query
.
payableId
&&
that
.
$route
.
query
.
payableI
d
!==
'
0
'
)
{
this
.
payableId
=
this
.
$route
.
query
.
payableI
d
;
getPayableInfoByIds
({
id
:
this
.
payableI
d
}).
then
(
res
=>
{
this
.
list
=
[{...
res
.
data
}]
this
.
$set
(
this
.
form
,
'
supplierId
'
,
res
.
data
.
supplierId
)
})
}
if
(
that
.
$route
.
query
.
id
&&
that
.
$route
.
query
.
id
!==
'
0
'
)
{
this
.
id
=
this
.
$route
.
query
.
id
;
getPaymentInfoByIds
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
form
=
{
...
res
.
data
,
latestPayAt
:
this
.
parseTime
(
res
.
data
.
latestPayAt
,
'
{y}-{m}-{d}
'
),
applicationAt
:
this
.
parseTime
(
res
.
data
.
applicationAt
,
'
{y}-{m}-{d}
'
),
supplierBankAccount
:
Number
(
res
.
data
.
supplierBankAccount
),
invoiceStatus
:
String
(
res
.
data
.
invoiceStatus
),
}
})
getPaymentItem
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
list
=
[...
res
.
data
]
this
.
defaultList
=
[...
res
.
data
]
})
}
userList
(
"
salesman
"
).
then
((
res
)
=>
(
that
.
creatorData
=
res
.
data
));
getChannelList
().
then
((
res
)
=>
(
that
.
channelList
=
res
.
data
));
getTradeCityList
().
then
((
res
)
=>
(
that
.
tradeCityList
=
res
.
data
));
...
...
@@ -524,14 +554,41 @@ export default {
if
(
this
.
list
&&
this
.
list
.
length
>
0
)
{
params
.
payableReqVOList
=
[...
this
.
list
]
}
createPayment
(
params
).
then
(
res
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
})
if
(
params
.
payableReqVOList
.
length
===
0
)
{
this
.
$modal
.
msgError
(
"
请选择供应商未付款项
"
);
return
}
if
(
this
.
id
&&
this
.
id
!==
'
0
'
)
{
updatePayment
(
params
).
then
(
res
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
$router
.
back
();
})
}
else
{
createPayment
(
params
).
then
(
res
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
$router
.
back
();
})
}
}
})
}
})
},
submitDraft
()
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
const
params
=
{...
this
.
form
}
if
(
this
.
list
&&
this
.
list
.
length
>
0
)
{
params
.
payableReqVOList
=
[...
this
.
list
]
}
if
(
params
.
payableReqVOList
.
length
===
0
)
{
this
.
$modal
.
msgError
(
"
请选择供应商未付款项
"
);
return
}
// console.log(params, '-----params---------')
}
})
},
selectChange
(
val
)
{
const
t
=
this
.
allSupplier
.
find
(
v
=>
v
.
id
==
val
)
t
&&
(
this
.
form
.
supplierName
=
t
.
companyZh
)
...
...
@@ -544,7 +601,11 @@ export default {
this
.
open
=
false
;
},
saveSelectList
()
{
this
.
list
=
this
.
multipleSelection
if
(
this
.
id
&&
this
.
id
!==
'
0
'
)
{
this
.
list
=
[...
this
.
defaultList
,
...
this
.
multipleSelection
]
}
else
{
this
.
list
=
this
.
multipleSelection
}
this
.
open
=
false
;
},
convertCurrency
(
money
)
{
...
...
@@ -638,6 +699,34 @@ export default {
},
openDialog
()
{
this
.
getList
()
},
oninput
(
num
)
{
let
str
=
num
let
len1
=
str
.
substr
(
0
,
1
)
let
len2
=
str
.
substr
(
1
,
1
)
//如果第一位是0,第二位不是点,就用数字把点替换掉
if
(
str
.
length
>
1
&&
len1
==
0
&&
len2
!=
'
.
'
)
{
str
=
str
.
substr
(
1
,
1
)
}
//第一位不能是.
if
(
len1
==
'
.
'
)
{
str
=
''
}
//限制只能输入一个小数点
if
(
str
.
indexOf
(
'
.
'
)
!=
-
1
)
{
let
str_
=
str
.
substr
(
str
.
indexOf
(
'
.
'
)
+
1
)
if
(
str_
.
indexOf
(
'
.
'
)
!=
-
1
)
{
str
=
str
.
substr
(
0
,
str
.
indexOf
(
'
.
'
)
+
str_
.
indexOf
(
'
.
'
)
+
1
)
}
else
{
// if (str_.length > 2) {
// str = str.substr(0, str.indexOf('.') + 1) + str_.substr(0, 2)
// }
}
}
//正则替换
str
=
str
.
replace
(
/
[^\d
^
\.]
+/g
,
''
)
// 保留数字和小数点
// str = str.replace(/\.\d\d\d$/,'') // 小数点后只能输两位
return
str
}
},
};
...
...
src/views/ecw/financial/payable.vue
View file @
f37edf9c
...
...
@@ -290,7 +290,7 @@ export default {
},
/** 新增按钮操作 */
handleAdd
(
id
)
{
return
this
.
$router
.
push
(
"
creatPayment?
i
d=
"
+
id
);
return
this
.
$router
.
push
(
"
creatPayment?
payableI
d=
"
+
id
);
},
submitEditForm
()
{
const
params
=
{
...
...
@@ -328,10 +328,6 @@ export default {
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{});
// deletePayable({ id: row.id }).then(res => {
// this.getList()
// this.$modal.msgSuccess("删除成功");
// })
},
},
};
...
...
src/views/ecw/financial/paymentExamine.vue
0 → 100644
View file @
f37edf9c
<
template
>
<div
class=
"app-container examine-wrap"
>
<el-card>
<div
slot=
"header"
class=
"card-title"
>
审核请款单
</div>
<el-descriptions
:column=
"3"
class=
"card"
border
>
<el-descriptions-item
label=
"供应商"
>
{{
detail
.
supplierName
}}
</el-descriptions-item>
<el-descriptions-item
label=
"部门"
>
{{
findDepartmentName
(
detail
.
departmentId
)
}}
</el-descriptions-item>
<el-descriptions-item
label=
"业务员"
>
{{
detail
.
salesmanName
}}
</el-descriptions-item>
<el-descriptions-item
label=
"申请日期"
>
{{
detail
.
applicationAt
}}
</el-descriptions-item>
<el-descriptions-item
label=
"供应商银行账号"
style=
"width: 50%"
>
{{
findBank
(
detail
.
supplierBankAccount
)
}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column=
"3"
class=
"card"
border
>
<el-descriptions-item
label=
"最后付款日期"
>
{{
detail
.
latestPayAt
}}
</el-descriptions-item>
<el-descriptions-item
label=
"结算方式"
>
<!--
{{
detail
.
settlementType
}}
-->
<dict-tag
:type=
"DICT_TYPE.CUSTOMER_BALANCE"
:value=
"detail.settlementType"
></dict-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card
class=
"card"
>
<div
slot=
"header"
class=
"card-title"
>
费用信息
</div>
<el-table
v-loading=
"loadings"
:data=
"list"
border
:show-summary=
"!!list.length"
:summary-method=
"getSummaries"
>
<el-table-column
label=
"自编号"
align=
"center"
prop=
"payableNo"
/>
<el-table-column
label=
"费用类型"
align=
"center"
prop=
"feeType"
>
<template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.FEE_TYPE"
:value=
"scope.row.feeType"
></dict-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"发票号码"
align=
"center"
prop=
"invoiceNumber"
>
<!-- <template slot-scope="scope">
<el-input v-model="scope.row.invoiceNumber"></el-input>
</template> -->
</el-table-column>
<el-table-column
label=
"应付金额"
align=
"center"
prop=
"totalAmount"
/>
<el-table-column
label=
"币种"
align=
"center"
prop=
"currencyId"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.BOX_SHIPPING_PRICE_UNIT"
:value=
"scope.row.currencyId"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"汇率"
align=
"center"
prop=
"exchangeRate"
>
<!-- <template slot-scope="scope">
<el-input v-model="scope.row.exchangeRate"></el-input>
</template> -->
</el-table-column>
<el-table-column
label=
"税率"
align=
"center"
prop=
"taxRate"
>
<!-- <template slot-scope="scope">
<el-input v-model="scope.row.taxRate"></el-input>
</template> -->
</el-table-column>
<el-table-column
label=
"价税合计(RMB)"
align=
"center"
prop=
"total"
/>
</el-table>
<el-descriptions
:column=
"1"
class=
"card"
border
>
<el-descriptions-item
label=
"账单号"
>
{{ detail.accountNumber }}
</el-descriptions-item>
<el-descriptions-item
label=
"发票"
>
{{ detail.invoiceStatus == 0 ? '未开票' : '已开票' }}
</el-descriptions-item>
<el-descriptions-item
label=
"审核备注"
>
<el-input
type=
"textarea"
:rows=
"2"
v-model=
"notes"
>
</el-input>
</el-descriptions-item>
</el-descriptions>
</el-card>
<div
slot=
"footer"
style=
"margin: 20px 0"
>
<el-button
type=
"primary"
@
click=
"examine('y')"
>
审核通过
</el-button>
<el-button
type=
"danger"
@
click=
"examine('n')"
>
审核驳回
</el-button>
</div>
</div>
</template>
<
script
>
import
{
getBankAccountPage
}
from
"
@/api/ecw/bankAccount
"
;
import
{
listSimpleDepts
}
from
"
@/api/system/dept
"
;
import
{
getPaymentInfoByIds
,
getPaymentItem
,
paymentVerify
}
from
"
@/api/ecw/financial
"
export
default
{
name
:
"
CreatPayment
"
,
components
:
{
// CustomerSelector
},
data
()
{
return
{
id
:
0
,
loadings
:
false
,
detail
:
{},
list
:
[],
bankData
:
[],
params
:
{
page
:
1
,
rows
:
20
,
},
deptData
:
[],
deptArr
:
[],
notes
:
''
};
},
created
()
{
let
that
=
this
;
if
(
that
.
$route
.
query
.
id
&&
that
.
$route
.
query
.
id
!==
'
0
'
)
{
this
.
id
=
this
.
$route
.
query
.
id
;
getPaymentInfoByIds
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
detail
=
{
...
res
.
data
,
latestPayAt
:
this
.
parseTime
(
res
.
data
.
latestPayAt
,
'
{y}-{m}-{d}
'
),
applicationAt
:
this
.
parseTime
(
res
.
data
.
applicationAt
,
'
{y}-{m}-{d}
'
),
supplierBankAccount
:
Number
(
res
.
data
.
supplierBankAccount
),
invoiceStatus
:
String
(
res
.
data
.
invoiceStatus
),
}
})
getPaymentItem
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
list
=
[...
res
.
data
]
})
}
getBankAccountPage
(
that
.
params
).
then
((
res
)
=>
(
that
.
bankData
=
res
.
data
.
list
));
listSimpleDepts
().
then
((
res
)
=>
{
res
.
data
.
forEach
((
item
)
=>
{
if
(
item
.
parentId
==
0
)
{
that
.
deptArr
.
push
(
item
);
}
else
{
that
.
deptData
.
push
(
item
);
}
});
that
.
deptData
.
forEach
((
value
)
=>
{
var
dept
=
that
.
deptArr
.
filter
((
itt
)
=>
itt
.
id
==
value
.
parentId
);
if
(
dept
.
length
>
0
)
{
value
.
name
=
dept
[
0
].
name
+
"
|
"
+
value
.
name
;
}
});
});
},
methods
:
{
getSummaries
(
param
)
{
const
{
columns
,
data
}
=
param
;
const
sums
=
new
Array
(
columns
.
length
).
map
(
v
=>
''
);
const
index
=
sums
.
length
-
1
sums
[
index
-
1
]
=
'
价税合计大写
'
const
t
=
data
.
map
(
v
=>
v
.
total
).
reduce
((
prev
,
curr
)
=>
{
return
prev
+
curr
;
},
0
)
sums
[
index
]
=
this
.
convertCurrency
(
t
)
return
sums
;
},
examine
(
status
)
{
const
params
=
{
notes
:
this
.
notes
,
paymentId
:
this
.
detail
.
id
,
verifyStatus
:
status
}
paymentVerify
(
params
).
then
(
res
=>
{
this
.
$modal
.
msgSuccess
(
"
操作成功
"
);
this
.
$router
.
back
();
})
},
convertCurrency
(
money
)
{
//汉字的数字
var
cnNums
=
new
Array
(
'
零
'
,
'
壹
'
,
'
贰
'
,
'
叁
'
,
'
肆
'
,
'
伍
'
,
'
陆
'
,
'
柒
'
,
'
捌
'
,
'
玖
'
);
//基本单位
var
cnIntRadice
=
new
Array
(
''
,
'
拾
'
,
'
佰
'
,
'
仟
'
);
//对应整数部分扩展单位
var
cnIntUnits
=
new
Array
(
''
,
'
万
'
,
'
亿
'
,
'
兆
'
);
//对应小数部分单位
var
cnDecUnits
=
new
Array
(
'
角
'
,
'
分
'
,
'
毫
'
,
'
厘
'
);
//整数金额时后面跟的字符
var
cnInteger
=
'
整
'
;
//整型完以后的单位
var
cnIntLast
=
'
元
'
;
//最大处理的数字
var
maxNum
=
999999999999999.9999
;
//金额整数部分
var
integerNum
;
//金额小数部分
var
decimalNum
;
//输出的中文金额字符串
var
chineseStr
=
''
;
//分离金额后用的数组,预定义
var
parts
;
// 传入的参数为空情况
if
(
money
===
''
)
{
return
''
;
}
money
=
parseFloat
(
money
)
if
(
money
>=
maxNum
){
return
''
}
// 传入的参数为0情况
if
(
money
===
0
)
{
chineseStr
=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
return
chineseStr
}
// 转为字符串
money
=
money
.
toString
();
// indexOf 检测某字符在字符串中首次出现的位置 返回索引值(从0 开始) -1 代表无
if
(
money
.
indexOf
(
'
.
'
)
==
-
1
)
{
integerNum
=
money
;
decimalNum
=
''
}
else
{
parts
=
money
.
split
(
'
.
'
);
integerNum
=
parts
[
0
];
decimalNum
=
parts
[
1
].
substr
(
0
,
4
);
}
//转换整数部分
if
(
parseInt
(
integerNum
,
10
)
>
0
){
let
zeroCount
=
0
;
let
IntLen
=
integerNum
.
length
for
(
let
i
=
0
;
i
<
IntLen
;
i
++
){
let
n
=
integerNum
.
substr
(
i
,
1
);
let
p
=
IntLen
-
i
-
1
;
let
q
=
p
/
4
;
let
m
=
p
%
4
;
if
(
n
==
'
0
'
){
zeroCount
++
;
}
else
{
if
(
zeroCount
>
0
){
chineseStr
+=
cnNums
[
0
]
}
zeroCount
=
0
;
chineseStr
+=
cnNums
[
parseInt
(
n
)]
+
cnIntRadice
[
m
];
}
if
(
m
==
0
&&
zeroCount
<
4
){
chineseStr
+=
cnIntUnits
[
q
];
}
}
// 最后+ 元
chineseStr
+=
cnIntLast
;
}
// 转换小数部分
if
(
decimalNum
!=
''
){
let
decLen
=
decimalNum
.
length
;
for
(
let
i
=
0
;
i
<
decLen
;
i
++
){
let
n
=
decimalNum
.
substr
(
i
,
1
);
if
(
n
!=
'
0
'
){
chineseStr
+=
cnNums
[
Number
(
n
)]
+
cnDecUnits
[
i
]
}
}
}
if
(
chineseStr
==
''
){
chineseStr
+=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
}
else
if
(
decimalNum
==
''
){
chineseStr
+=
cnInteger
;
}
return
chineseStr
},
findDepartmentName
(
val
)
{
return
this
.
deptData
.
find
(
v
=>
v
.
id
==
val
)
?
this
.
deptData
.
find
(
v
=>
v
.
id
==
val
).
name
:
''
},
findBank
(
val
)
{
const
t
=
this
.
bankData
.
find
(
v
=>
v
.
id
==
val
)
return
t
?
t
.
baAccountName
+
'
(
'
+
t
.
baAccountNum
+
'
)
'
:
''
}
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.examine-wrap
{
::v-deep
.is-bordered-label
{
width
:
200px
;
}
}
.card
{
margin-top
:
20px
;
}
.dialog-footer
{
padding
:
40px
;
}
.card-title
{
font-size
:
18px
;
font-weight
:
bold
;
}
</
style
>
src/views/ecw/financial/paymentVoucher.vue
View file @
f37edf9c
...
...
@@ -53,7 +53,7 @@
</el-select>
</el-form-item>
<el-form-item
label=
"状态:"
>
<dict-selector
:type=
"DICT_TYPE.ECW_
RECEIP
T_STATE"
v-model=
"queryParams.state"
/>
<dict-selector
:type=
"DICT_TYPE.ECW_
PAYMEN
T_STATE"
v-model=
"queryParams.state"
/>
</el-form-item>
</el-row>
<el-row
:span=
"24"
>
...
...
@@ -101,12 +101,12 @@
<el-table-column
label=
"供应商"
align=
"center"
prop=
"supplierName"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
<span>
{{
parseTime
(
scope
.
row
.
createTime
,
'
{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"
最后付款时间
"
align
=
"
center
"
prop
=
"
latestPayAt
"
>
<
template
slot
-
scope
=
"
scope
"
>
<span>
{{
parseTime
(
scope
.
row
.
latestPayAt
)
}}
</span>
<
span
>
{{
parseTime
(
scope
.
row
.
latestPayAt
,
'
{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"
发票
"
align
=
"
center
"
prop
=
"
invoiceStatus
"
>
...
...
@@ -116,11 +116,10 @@
<
/el-table-column
>
<
el
-
table
-
column
label
=
"
状态
"
align
=
"
center
"
>
<
template
slot
-
scope
=
"
scope
"
>
<span>
{{
stateMap
(
scope
.
row
.
state
)
}}
</span>
<!--
<dict-tag
:type=
"DICT_TYPE.ECW_RECEIPT_STATE"
<
dict
-
tag
:
type
=
"
DICT_TYPE.ECW_PAYMENT_STATE
"
:
value
=
"
scope.row.state
"
/>
-->
/>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
...
...
@@ -130,16 +129,16 @@
>
<
template
slot
-
scope
=
"
scope
"
>
<
el
-
button
v
-
if
=
"
scope.row.state == 1 || scope.row.state == 3
"
size
=
"
mini
"
@
click
=
"
handleAdd(scope.row.id)
"
type
=
"
text
"
>
编辑
<
/el-button
>
<el-button
v-if=
"scope.row.state == 1 || scope.row.state == 3"
size=
"mini"
type=
"text"
>
审核
</el-button>
<
el
-
button
v
-
if
=
"
scope.row.state == 1 || scope.row.state == 3
"
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
examineClick(scope.row.id)
"
>
审核
<
/el-button
>
<el-button
v-if=
"scope.row.state == 2"
size=
"mini"
type=
"text"
>
反审核
</el-button>
<el-button
v-if=
"scope.row.state == 2"
size=
"mini"
type=
"text"
>
核销
</el-button>
<
el
-
button
v
-
if
=
"
scope.row.state == 2
"
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
verifyCancelClick(scope.row)
"
>
反审核
<
/el-button
>
<
el
-
button
v
-
if
=
"
scope.row.state == 2
"
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
verificationClick(scope.row)
"
>
核销
<
/el-button
>
<el-button
v-if=
"scope.row.state == 4"
size=
"mini"
type=
"text"
>
反核销
</el-button>
<
el
-
button
v
-
if
=
"
scope.row.state == 4
"
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
verificationCancelClick(scope.row)
"
>
反核销
<
/el-button
>
<!--
<
el
-
button
v
-
if
=
"
scope.row.state == 3
"
size
=
"
mini
"
type
=
"
text
"
>
开票
<
/el-button> --
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
toprint(scope.row.id)
"
>
打印
<
/el-button
>
<el-button
v-if=
"scope.row.state == 1 || scope.row.state == 3"
size=
"mini"
type=
"text"
>
删除
</el-button>
<
el
-
button
v
-
if
=
"
scope.row.state == 1 || scope.row.state == 3
"
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
deleteClick(scope.row)
"
>
删除
<
/el-button
>
<!--
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
@
click
=
"
open = true
"
>
导出订单
<
/el-button> --
>
<
/template
>
<
/el-table-column
>
...
...
@@ -189,7 +188,7 @@ import { userList } from "@/api/system/user";
import
{
DICT_TYPE
}
from
"
@/utils/dict
"
;
import
CustomerSelector
from
"
@/components/CustomerSelector
"
;
import
{
getSupplierPage
}
from
"
@/api/ecw/supplier
"
;
import
{
getPaymentList
}
from
"
@/api/ecw/financial
"
import
{
getPaymentList
,
deletePayment
,
paymentVerification
,
paymentVerificationCancel
,
paymentVerifyCancel
}
from
"
@/api/ecw/financial
"
export
default
{
name
:
"
paymentVoucher
"
,
...
...
@@ -268,17 +267,56 @@ export default {
case
2
:
return
'
已审核待核销
'
case
3
:
return
'
已核销
'
case
4
:
return
'
审批驳回
'
case
4
:
return
'
已核销
'
}
}
,
/** 新增按钮操作 */
handleAdd
(
id
)
{
return
this
.
$router
.
push
(
"
creatCollection?id=
"
+
id
);
return
this
.
$router
.
push
(
"
creatPayment?id=
"
+
id
);
}
,
examineClick
(
id
)
{
return
this
.
$router
.
push
(
"
paymentExamine?id=
"
+
id
);
}
,
deleteClick
(
row
)
{
const
id
=
row
.
id
;
this
.
$modal
.
confirm
(
'
是否确认删除该应付款?
'
).
then
(
function
()
{
return
deletePayment
(
id
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}
).
catch
(()
=>
{
}
);
}
,
verificationClick
(
row
)
{
const
id
=
row
.
id
;
this
.
$modal
.
confirm
(
'
您确认要核销吗?
'
).
then
(
function
()
{
return
paymentVerification
(
id
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
核销成功
"
);
}
).
catch
(()
=>
{
}
);
}
,
verificationCancelClick
(
row
)
{
const
id
=
row
.
id
;
this
.
$modal
.
confirm
(
'
您确认要反核销吗?
'
).
then
(
function
()
{
return
paymentVerificationCancel
(
id
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
反核销成功
"
);
}
).
catch
(()
=>
{
}
);
}
,
verifyCancelClick
(
row
)
{
const
id
=
row
.
id
;
this
.
$modal
.
confirm
(
'
您确认要反审核吗?
'
).
then
(
function
()
{
return
paymentVerifyCancel
(
id
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
反审核成功
"
);
}
).
catch
(()
=>
{
}
);
}
,
toprint
(
id
)
{
return
this
.
$router
.
push
(
"
printVoucher?id=
"
+
id
);
return
this
.
$router
.
push
(
"
print
Payment
Voucher?id=
"
+
id
);
}
,
submitForm
()
{
this
.
open
=
false
;
...
...
src/views/ecw/financial/printPaymentVoucher.vue
0 → 100644
View file @
f37edf9c
<
template
>
<div
class=
"app-container"
>
<div
id=
"print"
style=
"font-size: 18px;"
>
<div
style=
"text-align: center;font-weight: bold;font-size: 20px;"
>
付款单
</div>
<div
style=
"margin-top: 20px;"
>
<div
style=
"display: flex;width: 80%;align-items: center;margin-bottom: 10px;"
>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
付款单号:
</div><span>
{{
form
.
paymentNo
||
'
无
'
}}
</span></div>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
最后付款日:
</div>
<span>
{{
form
.
latestPayAt
||
'
无
'
}}
</span></div>
</div>
<div
style=
"display: flex;width: 80%;align-items: center;margin-bottom: 10px;"
>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
申请日期:
</div>
<span>
{{
form
.
applicationAt
||
'
无
'
}}
</span></div>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
结算方式:
</div><span>
{{
form
.
settlementType
||
'
无
'
}}
</span></div>
</div>
<div
style=
"display: flex;width: 80%;align-items: center;margin-bottom: 10px;"
>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
付款公司:
</div><span>
{{
form
.
supplierName
||
'
无
'
}}
</span></div>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
银行户名:
</div><span>
{{
findBank
(
form
.
supplierBankAccount
).
baAccountName
||
'
无
'
}}
</span></div>
</div>
<div
style=
"display: flex;width: 80%;align-items: center;margin-bottom: 10px;"
>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
银行名称:
</div><span>
{{
findBank
(
form
.
supplierBankAccount
).
baBankName
||
'
无
'
}}
</span></div>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
银行账号:
</div><span>
{{
findBank
(
form
.
supplierBankAccount
).
baAccountNum
||
'
无
'
}}
</span></div>
</div>
<!--
<div
style=
"display: flex;width: 80%;align-items: center;margin-bottom: 10px;"
>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;"
>
水单号:
</div><span>
{{
form
?
form
.
accountBank
:
'
无
'
}}
</span></div>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;"
>
手续费:
</div><span>
{{
form
?
form
.
accountBank
:
'
无
'
}}
</span></div>
</div>
-->
<div
style=
"display: flex;width: 80%;align-items: center;"
>
<div
style=
"flex:1"
><div
style=
"width: 120px;text-align: right;display:inline-block;"
>
备注:
</div><span>
{{
form
.
notes
||
'
无
'
}}
</span></div>
</div>
</div>
<table
border=
"1"
style=
"margin-top: 20px;width: 100%;text-align: center;border-collapse: collapse;line-height: 2 "
>
<tr>
<th
style=
"width: 4%;"
>
序号
</th>
<th
style=
"width: 15%;"
>
自编号
</th>
<th
style=
"width: 15%;"
>
费用类型
</th>
<th
style=
"width: 15%;"
>
币别
</th>
<th
style=
"width: 12%;"
>
汇率
</th>
<th
style=
"width: 15%;"
>
发票号
</th>
<th
style=
"width: 12%;"
>
应付金额
</th>
<th
style=
"width: 12%;"
>
申请金额
</th>
</tr>
<tr
v-for=
"(item, index) in list"
:key=
"index"
>
<td>
{{
index
+
1
}}
</td>
<td>
{{
item
.
payableNo
}}
</td>
<td>
<dict-tag
:type=
"DICT_TYPE.FEE_TYPE"
:value=
"item.feeType"
></dict-tag>
</td>
<td>
<dict-tag
:type=
"DICT_TYPE.BOX_SHIPPING_PRICE_UNIT"
:value=
"item.currencyId"
/>
</td>
<td>
{{
item
.
exchangeRate
}}
</td>
<td>
{{
item
.
invoiceNumber
}}
</td>
<td>
{{
item
.
totalAmount
}}
</td>
<td>
{{
item
.
total
}}
</td>
</tr>
<tr>
<td
colspan=
"2"
>
合计(大写)
</td>
<td
colspan=
"2"
>
{{
convertCurrency
(
totalMoney
())
}}
</td>
<td
colspan=
"2"
>
合计付款
</td>
<td>
{{
totalMoney
()
}}
</td>
</tr>
</table>
<div
style=
"margin-top: 20px;"
>
<div
style=
"display: flex;width: 100%;align-items: center;"
>
<div
style=
"flex:1"
><span
style=
"width: 120px;"
>
主管:
</span></div>
<div
style=
"flex:1"
><span
style=
"width: 120px;"
>
会计:
</span></div>
<div
style=
"flex:1"
><span
style=
"width: 120px;"
>
出纳:
</span></div>
<div
style=
"flex:1"
><span
style=
"width: 120px;"
>
经手人:
</span></div>
</div>
</div>
</div>
<div
slot=
"footer"
class=
"card"
>
<el-button
type=
"primary"
@
click=
"print"
>
确订打印
</el-button>
</div>
</div>
</
template
>
<
script
>
import
{
userList
}
from
"
@/api/system/user
"
import
{
DICT_TYPE
}
from
'
@/utils/dict
'
import
CustomerSelector
from
'
@/components/CustomerSelector
'
import
{
getBankAccountPage
}
from
"
@/api/ecw/bankAccount
"
;
import
{
listSimpleDepts
}
from
"
@/api/system/dept
"
// import { getReceipt} from "@/api/ecw/receipt";
import
{
getPaymentInfoByIds
,
getPaymentItem
}
from
"
@/api/ecw/financial
"
import
lodop
from
'
@/utils/lodop
'
export
default
{
name
:
"
PrintVoucher
"
,
components
:
{
CustomerSelector
},
data
()
{
return
{
loadings
:
false
,
form
:{},
title
:
'
收款单
'
,
creatorData
:[],
list
:[],
fileList
:[],
bankData
:[],
params
:{
page
:
1
,
rows
:
20
,
},
// deptData:[],
// deptArr:[],
id
:
0
}
},
created
()
{
let
that
=
this
if
(
that
.
$route
.
query
.
id
){
that
.
id
=
that
.
$route
.
query
.
id
that
.
getCollectionData
()
}
userList
(
'
salesman
'
).
then
(
res
=>
that
.
creatorData
=
res
.
data
)
getBankAccountPage
(
that
.
params
).
then
(
res
=>
that
.
bankData
=
res
.
data
.
list
)
// listSimpleDepts().then(res =>{
// res.data.forEach((item)=>{
// if(item.parentId==0){
// that.deptArr.push(item)
// }else{
// that.deptData.push(item)
// }
// })
// that.deptData.forEach((value)=>{
// var dept = that.deptArr.filter(itt=>itt.id==value.parentId)
// if(dept.length>0){
// value.name =dept[0].name+' | '+ value.name
// }
// })
// })
},
methods
:
{
getCollectionData
(){
let
that
=
this
getPaymentInfoByIds
({
id
:
that
.
id
}).
then
(
res
=>
{
that
.
form
=
{
...
res
.
data
,
latestPayAt
:
this
.
parseTime
(
res
.
data
.
latestPayAt
,
'
{y}-{m}-{d}
'
),
applicationAt
:
this
.
parseTime
(
res
.
data
.
applicationAt
,
'
{y}-{m}-{d}
'
)
}
})
getPaymentItem
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
list
=
[...
res
.
data
]
})
},
print
(){
lodop
().
then
(
LODOP
=>
{
LODOP
.
PRINT_INIT
();
LODOP
.
SET_PRINT_STYLE
(
"
FontSize
"
,
18
);
LODOP
.
SET_PRINT_STYLE
(
"
Bold
"
,
1
);
// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
// var stylePrint = "
<
style
>
table
th
,
td
{
padding
:
0
;
margin
:
0
;
border
:
1
px
solid
#
000000
;
border
-
collapse
:
collapse
;}
<
/style>
"
var
htmlContent
=
"
<body>
"
+
document
.
getElementById
(
"
print
"
).
innerHTML
+
"
</body>
"
LODOP
.
ADD_PRINT_HTM
(
"
6mm
"
,
"
6mm
"
,
"
RightMargin:6mm
"
,
"
BottomMargin:6mm
"
,
htmlContent
);
LODOP
.
PRINT
();
// this.$alert('已发起打印任务');
// LODOP.PREVIEW(); // 预览
/* LODOP.PRINTA(); // 选择打印机
// 直接打印 */
console
.
log
(
'
打印哦
'
)
}).
catch
(
err
=>
{
console
.
error
(
'
lodop异常
'
,
err
)
alert
(
'
请检查LODOP打印控件是否安装并启动
'
);
})
},
findBank
(
val
)
{
const
t
=
this
.
bankData
.
find
(
v
=>
v
.
id
==
val
)
return
t
||
{}
},
totalMoney
()
{
const
t
=
this
.
list
.
map
(
v
=>
v
.
total
).
reduce
((
prev
,
curr
)
=>
{
return
prev
+
curr
;
},
0
)
return
t
},
convertCurrency
(
money
)
{
//汉字的数字
var
cnNums
=
new
Array
(
'
零
'
,
'
壹
'
,
'
贰
'
,
'
叁
'
,
'
肆
'
,
'
伍
'
,
'
陆
'
,
'
柒
'
,
'
捌
'
,
'
玖
'
);
//基本单位
var
cnIntRadice
=
new
Array
(
''
,
'
拾
'
,
'
佰
'
,
'
仟
'
);
//对应整数部分扩展单位
var
cnIntUnits
=
new
Array
(
''
,
'
万
'
,
'
亿
'
,
'
兆
'
);
//对应小数部分单位
var
cnDecUnits
=
new
Array
(
'
角
'
,
'
分
'
,
'
毫
'
,
'
厘
'
);
//整数金额时后面跟的字符
var
cnInteger
=
'
整
'
;
//整型完以后的单位
var
cnIntLast
=
'
元
'
;
//最大处理的数字
var
maxNum
=
999999999999999.9999
;
//金额整数部分
var
integerNum
;
//金额小数部分
var
decimalNum
;
//输出的中文金额字符串
var
chineseStr
=
''
;
//分离金额后用的数组,预定义
var
parts
;
// 传入的参数为空情况
if
(
money
===
''
)
{
return
''
;
}
money
=
parseFloat
(
money
)
if
(
money
>=
maxNum
){
return
''
}
// 传入的参数为0情况
if
(
money
===
0
)
{
chineseStr
=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
return
chineseStr
}
// 转为字符串
money
=
money
.
toString
();
// indexOf 检测某字符在字符串中首次出现的位置 返回索引值(从0 开始) -1 代表无
if
(
money
.
indexOf
(
'
.
'
)
==
-
1
)
{
integerNum
=
money
;
decimalNum
=
''
}
else
{
parts
=
money
.
split
(
'
.
'
);
integerNum
=
parts
[
0
];
decimalNum
=
parts
[
1
].
substr
(
0
,
4
);
}
//转换整数部分
if
(
parseInt
(
integerNum
,
10
)
>
0
){
let
zeroCount
=
0
;
let
IntLen
=
integerNum
.
length
for
(
let
i
=
0
;
i
<
IntLen
;
i
++
){
let
n
=
integerNum
.
substr
(
i
,
1
);
let
p
=
IntLen
-
i
-
1
;
let
q
=
p
/
4
;
let
m
=
p
%
4
;
if
(
n
==
'
0
'
){
zeroCount
++
;
}
else
{
if
(
zeroCount
>
0
){
chineseStr
+=
cnNums
[
0
]
}
zeroCount
=
0
;
chineseStr
+=
cnNums
[
parseInt
(
n
)]
+
cnIntRadice
[
m
];
}
if
(
m
==
0
&&
zeroCount
<
4
){
chineseStr
+=
cnIntUnits
[
q
];
}
}
// 最后+ 元
chineseStr
+=
cnIntLast
;
}
// 转换小数部分
if
(
decimalNum
!=
''
){
let
decLen
=
decimalNum
.
length
;
for
(
let
i
=
0
;
i
<
decLen
;
i
++
){
let
n
=
decimalNum
.
substr
(
i
,
1
);
if
(
n
!=
'
0
'
){
chineseStr
+=
cnNums
[
Number
(
n
)]
+
cnDecUnits
[
i
]
}
}
}
if
(
chineseStr
==
''
){
chineseStr
+=
cnNums
[
0
]
+
cnIntLast
+
cnInteger
;
}
else
if
(
decimalNum
==
''
){
chineseStr
+=
cnInteger
;
}
return
chineseStr
},
},
}
</
script
>
<
style
scoped
id=
"printStyle"
>
.card
{
margin-top
:
20px
;
}
.dialog-footer
{
padding
:
40px
;
}
.card-title
{
font-size
:
18px
;
font-weight
:
bold
;
text-align
:
center
;
}
.header
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
.lastRow
{
border-top
:
1px
solid
#dfe6ec
;
display
:
flex
;
width
:
100%
;
height
:
44px
;
text-align
:
center
;
align-items
:
center
;
}
.lastRow
div
{
height
:
44px
;
line-height
:
44px
;
border-right
:
1px
solid
#dfe6ec
;
}
</
style
>
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