费用结算
This commit is contained in:
parent
d1c404535b
commit
5ea3c5211c
|
|
@ -13,12 +13,15 @@ export function parseTime(time, pattern) {
|
|||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '')
|
||||
time = time
|
||||
.replace(new RegExp(/-/gm), '/')
|
||||
.replace('T', ' ')
|
||||
.replace(new RegExp(/\.[\d]{3}/gm), '')
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
if (typeof time === 'number' && time.toString().length === 10) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
|
|
@ -56,9 +59,10 @@ export function resetForm(refName) {
|
|||
// 添加日期范围
|
||||
export function addDateRange(params, dateRange, propName) {
|
||||
let search = params
|
||||
search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}
|
||||
search.params =
|
||||
typeof search.params === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}
|
||||
dateRange = Array.isArray(dateRange) ? dateRange : []
|
||||
if (typeof (propName) === 'undefined') {
|
||||
if (typeof propName === 'undefined') {
|
||||
search.params['beginTime'] = dateRange[0]
|
||||
search.params['endTime'] = dateRange[1]
|
||||
} else {
|
||||
|
|
@ -74,8 +78,8 @@ export function selectDictLabel(datas, value) {
|
|||
return ''
|
||||
}
|
||||
var actions = []
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].value == ('' + value)) {
|
||||
Object.keys(datas).some(key => {
|
||||
if (datas[key].value == '' + value) {
|
||||
actions.push(datas[key].label)
|
||||
return true
|
||||
}
|
||||
|
|
@ -97,10 +101,10 @@ export function selectDictLabels(datas, value, separator) {
|
|||
var actions = []
|
||||
var currentSeparator = undefined === separator ? ',' : separator
|
||||
var temp = value.split(currentSeparator)
|
||||
Object.keys(value.split(currentSeparator)).some((val) => {
|
||||
Object.keys(value.split(currentSeparator)).some(val => {
|
||||
var match = false
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].value == ('' + temp[val])) {
|
||||
Object.keys(datas).some(key => {
|
||||
if (datas[key].value == '' + temp[val]) {
|
||||
actions.push(datas[key].label + currentSeparator)
|
||||
match = true
|
||||
}
|
||||
|
|
@ -114,8 +118,10 @@ export function selectDictLabels(datas, value, separator) {
|
|||
|
||||
// 字符串格式化(%s )
|
||||
export function sprintf(str) {
|
||||
var args = arguments, flag = true, i = 1
|
||||
str = str.replace(/%s/g, function() {
|
||||
var args = arguments,
|
||||
flag = true,
|
||||
i = 1
|
||||
str = str.replace(/%s/g, function () {
|
||||
var arg = args[i++]
|
||||
if (typeof arg === 'undefined') {
|
||||
flag = false
|
||||
|
|
@ -211,10 +217,10 @@ export function tansParams(params) {
|
|||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName]
|
||||
var part = encodeURIComponent(propName) + '='
|
||||
if (value !== null && value !== '' && typeof (value) !== 'undefined') {
|
||||
if (value !== null && value !== '' && typeof value !== 'undefined') {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
if (value[key] !== null && value[key] !== '' && typeof (value[key]) !== 'undefined') {
|
||||
if (value[key] !== null && value[key] !== '' && typeof value[key] !== 'undefined') {
|
||||
let params = propName + '[' + key + ']'
|
||||
var subPart = encodeURIComponent(params) + '='
|
||||
result += subPart + encodeURIComponent(value[key]) + '&'
|
||||
|
|
@ -237,3 +243,41 @@ export function blobValidate(data) {
|
|||
export function indexContinuation(num, size) {
|
||||
return (num - 1) * size + 1
|
||||
}
|
||||
|
||||
export function toChineseAmount(n) {
|
||||
const fraction = ['角', '分']
|
||||
const digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
|
||||
const unit = [
|
||||
['元', '万', '亿'],
|
||||
['', '拾', '佰', '仟']
|
||||
]
|
||||
let head = n < 0 ? '负' : ''
|
||||
n = Math.abs(n)
|
||||
|
||||
let s = ''
|
||||
|
||||
// 处理小数部分
|
||||
for (let i = 0; i < fraction.length; i++) {
|
||||
s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '')
|
||||
}
|
||||
s = s || '整'
|
||||
|
||||
// 处理整数部分
|
||||
n = Math.floor(n)
|
||||
for (let i = 0; i < unit[0].length && n > 0; i++) {
|
||||
let p = ''
|
||||
for (let j = 0; j < unit[1].length && n > 0; j++) {
|
||||
p = digit[n % 10] + unit[1][j] + p
|
||||
n = Math.floor(n / 10)
|
||||
}
|
||||
s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s
|
||||
}
|
||||
|
||||
return (
|
||||
head +
|
||||
s
|
||||
.replace(/(零.)*零元/, '元')
|
||||
.replace(/(零.)+/g, '零')
|
||||
.replace(/^整$/, '零元整')
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,13 +87,13 @@
|
|||
@click="handleApplyList"
|
||||
>批量结算</el-button
|
||||
>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="mini"
|
||||
@click="openPrintDialog"
|
||||
>协议书</el-button
|
||||
>
|
||||
> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="协议编号" align="center" prop="agreementCode" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="结算单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="结算工程" align="center" prop="projectName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
|
|
@ -135,9 +135,14 @@
|
|||
@click="handleApply(scope.row)"
|
||||
v-if="scope.row.sltStatus == '0' || (scope.row.sltStatus == '3')"
|
||||
>结算申请</el-button>
|
||||
<!-- <el-button size="mini" type="danger" icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>撤销申请</el-button> -->
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="mini"
|
||||
@click="openPrintDialog(scope.row)"
|
||||
>协议书</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -162,42 +167,46 @@
|
|||
<div class="item" style=" width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;">
|
||||
</div>
|
||||
<div class="item" style=" width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;">
|
||||
<span>协议号:</span>
|
||||
<span>协议号:{{ agreementContent.agreementCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">工程名称:</div>
|
||||
<div class="columnContent" style="width: 80%;">金上-湖北线路工程(川12标)</div>
|
||||
<div class="columnContent" style="width: 80%;">{{ agreementContent.projectName }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">承租单位:</div>
|
||||
<div class="columnContent" style="width: 40%;">金上-湖北线路工程(川12标)项目部</div>
|
||||
<div class="columnContent" style="width: 40%;">{{ agreementContent.unitName }}</div>
|
||||
<div class="columnLabel" style="width: 10%;border-left: 1px solid #9c9c9c;">日期:</div>
|
||||
<div class="columnContent" style="width: 30%;">2024-12-01</div>
|
||||
<div class="columnContent" style="width: 30%;">{{ agreementContent.applyTime || newData }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 100%;">结算项目及金额(元)</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">一、施工机具有偿使用费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.leaseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">二、施工机具维修费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.repairCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">三、施工机具丢失费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.loseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">四、施工机具损坏赔偿费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.scrapCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">五、施工机具租赁减免费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.reductionCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">费用合计金额(大写):</div>
|
||||
<div class="columnContent" style="width: 40%;">贰仟肆佰伍拾陆万伍仟肆佰捌拾玖元肆角伍分</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 24565489.45</div>
|
||||
<div class="columnContent" style="width: 40%;">{{ agreementContent.costAllUpper }}</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.costAll }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">说明:</div>
|
||||
|
|
@ -247,7 +256,8 @@ import {
|
|||
getUnitList,
|
||||
// getAgreementInfoById,
|
||||
} from '@/api/back/index.js'
|
||||
import { getSltAgreementInfo,getProjectListByUnitIds,getAgreementInfoById } from '@/api/cost/cost'
|
||||
import { getSltAgreementInfo,getProjectListByUnitIds,getAgreementInfoById, getSltInfo } from '@/api/cost/cost'
|
||||
import { toChineseAmount } from '@/utils/bonus.js'
|
||||
import vueEasyPrint from "vue-easy-print";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
|
@ -299,7 +309,21 @@ export default {
|
|||
agreementId: [],
|
||||
agreementCode: '',
|
||||
},
|
||||
openPrint:false
|
||||
openPrint:false,
|
||||
// 协议书内容
|
||||
agreementContent: {
|
||||
agreementCode: '',
|
||||
projectName: '',
|
||||
unitName: '',
|
||||
leaseCost: '', // 租赁费用
|
||||
repairCost: '', // 维修费用
|
||||
loseCost: '', // 丢失费用
|
||||
scrapCost: '', // 报废费用
|
||||
reductionCost: '', // 减免费用
|
||||
costAll: '', // 合计费用
|
||||
costAllUpper: '', // 合计费用大写
|
||||
},
|
||||
newData: new Date().toISOString().split('T')[0],
|
||||
}
|
||||
},
|
||||
// updated() {
|
||||
|
|
@ -474,8 +498,20 @@ export default {
|
|||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
openPrintDialog(){
|
||||
async openPrintDialog(row){
|
||||
this.openPrint = true
|
||||
try {
|
||||
const res = await getSltInfo([row])
|
||||
console.log('🚀 ~ openPrintDialog ~ res:', res)
|
||||
if (!res.data) return
|
||||
this.agreementContent = res.data
|
||||
this.agreementContent.agreementCode = row.agreementCode
|
||||
this.agreementContent.costAll = Number(res.data.leaseCost) + Number(res.data.repairCost) + Number(res.data.scrapCost) + Number(res.data.loseCost) - Number(res.data.reductionCost)
|
||||
// costAllUpper 中文大写
|
||||
this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2))
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ openPrintDialog ~ error:', error)
|
||||
}
|
||||
},
|
||||
//维修任务单打印
|
||||
print() {
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@
|
|||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" >查询</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" >重置</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="mini"
|
||||
@click="openPrintDialog"
|
||||
>协议书</el-button
|
||||
>
|
||||
> -->
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结算单编号" align="center" prop="agreementCode" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="结算单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="结算工程" align="center" prop="projectName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
|
|
@ -102,6 +102,13 @@
|
|||
<!-- <el-button size="mini" type="danger" icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>撤销申请</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="mini"
|
||||
@click="openPrintDialog(scope.row)"
|
||||
>协议书</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -143,42 +150,46 @@
|
|||
<div class="item" style=" width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;">
|
||||
</div>
|
||||
<div class="item" style=" width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px;">
|
||||
<span>协议号:</span>
|
||||
<span>协议号:{{ agreementContent.agreementCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">工程名称:</div>
|
||||
<div class="columnContent" style="width: 80%;">金上-湖北线路工程(川12标)</div>
|
||||
<div class="columnContent" style="width: 80%;">{{ agreementContent.projectName }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">承租单位:</div>
|
||||
<div class="columnContent" style="width: 40%;">金上-湖北线路工程(川12标)项目部</div>
|
||||
<div class="columnContent" style="width: 40%;">{{ agreementContent.unitName }}</div>
|
||||
<div class="columnLabel" style="width: 10%;border-left: 1px solid #9c9c9c;">日期:</div>
|
||||
<div class="columnContent" style="width: 30%;">2024-12-01</div>
|
||||
<div class="columnContent" style="width: 30%;">{{ agreementContent.applyTime }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 100%;">结算项目及金额(元)</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">一、施工机具有偿使用费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.leaseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">二、施工机具维修费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.repairCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">三、施工机具丢失费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.loseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">四、施工机具损坏赔偿费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 13144247. 44</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.scrapCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%;">五、施工机具租赁减免费:</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.reductionCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">费用合计金额(大写):</div>
|
||||
<div class="columnContent" style="width: 40%;">贰仟肆佰伍拾陆万伍仟肆佰捌拾玖元肆角伍分</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ 24565489.45</div>
|
||||
<div class="columnContent" style="width: 40%;">{{ agreementContent.costAllUpper }}</div>
|
||||
<div class="columnContent" style="width: 40%;">¥ {{ agreementContent.costAll }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%;">说明:</div>
|
||||
|
|
@ -226,7 +237,8 @@ import {
|
|||
getUnitList,
|
||||
getAgreementInfoById,
|
||||
} from '@/api/back/index.js'
|
||||
import { getSltList,costExamine } from '@/api/cost/cost'
|
||||
import { getSltList,costExamine, getSltInfo } from '@/api/cost/cost'
|
||||
import { toChineseAmount } from '@/utils/bonus.js'
|
||||
import vueEasyPrint from "vue-easy-print";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
|
@ -286,6 +298,19 @@ export default {
|
|||
applyVisible: false,
|
||||
id: '',
|
||||
agreementIdTemp: '',
|
||||
// 协议书内容
|
||||
agreementContent: {
|
||||
agreementCode: '',
|
||||
projectName: '',
|
||||
unitName: '',
|
||||
leaseCost: '', // 租赁费用
|
||||
repairCost: '', // 维修费用
|
||||
loseCost: '', // 丢失费用
|
||||
scrapCost: '', // 报废费用
|
||||
reductionCost: '', // 减免费用
|
||||
costAll: '', // 合计费用
|
||||
costAllUpper: '', // 合计费用大写
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -439,8 +464,20 @@ export default {
|
|||
this.aform = { status: '2' };
|
||||
},
|
||||
|
||||
openPrintDialog(){
|
||||
async openPrintDialog(row){
|
||||
this.openPrint = true
|
||||
try {
|
||||
const res = await getSltInfo([row])
|
||||
console.log('🚀 ~ openPrintDialog ~ res:', res)
|
||||
if (!res.data) return
|
||||
this.agreementContent = res.data
|
||||
this.agreementContent.agreementCode = row.agreementCode
|
||||
this.agreementContent.costAll = Number(res.data.leaseCost) + Number(res.data.repairCost) + Number(res.data.scrapCost) + Number(res.data.loseCost) - Number(res.data.reductionCost)
|
||||
// costAllUpper 中文大写
|
||||
this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2))
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ openPrintDialog ~ error:', error)
|
||||
}
|
||||
},
|
||||
//维修任务单打印
|
||||
print() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue