Merge branch 'dev-sy-9-24'

This commit is contained in:
BianLzhaoMin 2024-09-27 15:09:33 +08:00
commit d3b5732238
7 changed files with 392 additions and 106 deletions

View File

@ -14,67 +14,75 @@
</div>
<!-- 01承担方 -->
<FinishTable
:tableColumns="settleTableColumns"
:tableTitle="`设备结算清单`"
:isCostBear="true"
:constBear="1"
:totalPrice="settleTotalPrice_01"
:tableData="settleTableData_01"
:isSettle="isSettle_01"
:listType="1"
:constBear="1"
:isCostBear="true"
:isSettle="isSettle_01"
@submitSell="submitSell"
:tableTitle="`设备结算清单`"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess"
:tableData="settleTableData_01"
:totalPrice="settleTotalPrice_01"
:tableColumns="settleTableColumns"
v-if="settleTableData_01.length > 0"
@handelSaveSuccess="handelSaveSuccess"
/>
<!-- 03承担方 -->
<FinishTable
:tableColumns="settleTableColumns"
:tableTitle="`设备结算清单`"
:isCostBear="true"
:constBear="3"
:totalPrice="settleTotalPrice_03"
:tableData="settleTableData_03"
:isSettle="isSettle_03"
:listType="2"
:constBear="3"
:isCostBear="true"
:isSettle="isSettle_03"
@submitSell="submitSell"
:tableTitle="`设备结算清单`"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess"
:tableData="settleTableData_03"
:totalPrice="settleTotalPrice_03"
:tableColumns="settleTableColumns"
v-if="settleTableData_03.length > 0"
@handelSaveSuccess="handelSaveSuccess"
/>
<FinishTable
:tableColumns="repairTableColumns"
:tableTitle="`设备维修清单`"
:isRepair="true"
:totalPrice="repairTotalPrice"
:tableData="repairTableData"
:currRowInfo="currRowInfo"
:listType="3"
:isRepair="true"
:tableTitle="`设备维修清单`"
:currRowInfo="currRowInfo"
:tableData="repairTableData"
@handleExport="handleExport"
:totalPrice="repairTotalPrice"
:tableColumns="repairTableColumns"
@onChangeRepairPrice="onChangeRepairPrice"
/>
<FinishTable
:tableColumns="noReturnTableColumns"
:tableTitle="`工机具未还赔偿清单`"
:tableData="noReturnTableData"
:totalPrice="noReturnTotalPrice"
:listType="4"
@handleExport="handleExport"
:tableData="noReturnTableData"
:tableTitle="`工机具未还赔偿清单`"
:totalPrice="noReturnTotalPrice"
:tableColumns="noReturnTableColumns"
/>
<FinishTable
:tableColumns="scrapTableColumns"
:tableTitle="`工机具报废赔偿清单`"
:tableData="scrapTableData"
:totalPrice="scrapTotalPrice"
:listType="5"
@handleExport="handleExport"
:tableData="scrapTableData"
:totalPrice="scrapTotalPrice"
:tableTitle="`工机具报废赔偿清单`"
:tableColumns="scrapTableColumns"
/>
<FinishTable
:tableColumns="stayScrapTableColumns"
:tableTitle="`工机具待报废清单`"
:tableData="stayScrapTableData"
:listType="6"
@handleExport="handleExport"
:tableTitle="`工机具待报废清单`"
:tableData="stayScrapTableData"
:tableColumns="stayScrapTableColumns"
/>
<OtherCost
ref="otherCostRef"
:addCost="addCost"
:pageContent="pageContent"
@setOtherCostPrice="setOtherCostPrice"
:otherCostListDetailsNew="otherCostListDetails"
/>
<el-row class="submit-btn">
@ -92,6 +100,7 @@
<script>
import PageHeader from '@/components/pageHeader'
import FinishTable from './finishTable.vue'
import OtherCost from './other-cost.vue'
import {
getComSellQueryApi,
submitFeeBearApi,
@ -101,6 +110,7 @@ export default {
components: {
PageHeader,
FinishTable,
OtherCost,
},
props: {
//
@ -121,7 +131,8 @@ export default {
this.settleTotalPrice_03 * 1 +
this.repairTotalPrice * 1 +
this.noReturnTotalPrice * 1 +
this.scrapTotalPrice * 1
this.scrapTotalPrice * 1 +
this.addCost
)
},
},
@ -198,6 +209,8 @@ export default {
scrapTableData: [],
//
stayScrapTableData: [],
//
otherCostListDetails: [],
//
settleTotalPrice_01: 0,
settleTotalPrice_03: 0,
@ -209,6 +222,7 @@ export default {
isSettle_03: 0,
//
repairSelectList: [],
addCost: 0,
}
},
created() {
@ -227,12 +241,14 @@ export default {
this.noReturnTableData = res.loseList //
this.scrapTableData = res.scrapList //
this.stayScrapTableData = res.preScrapList //
this.otherCostListDetails = res.addCostList
this.settleTotalPrice_01 = res.relations[0].leaseCostOne
this.settleTotalPrice_03 = res.relations[0].leaseCostThree
this.scrapTotalPrice = res.relations[0].scrapCost
this.noReturnTotalPrice = res.relations[0].loseCost
this.repairTotalPrice = res.relations[0].repairCost
this.addCost = res.relations[0].addCost
this.isSettle_01 = res.relations[0].isSltOne
this.isSettle_03 = res.relations[0].isSltThree
},
@ -251,6 +267,9 @@ export default {
},
/** 确认完工结算 */
submitComSett() {
// if (this.$refs.otherCostRef.isFailed) return
const isCheckPass = this.$refs.otherCostRef.onCheckOtherCost()
if (!isCheckPass) return
this.$confirm(
'确定后则会生成财务报表,数据将不可修改,请确认检查无误',
'提示',
@ -259,70 +278,74 @@ export default {
cancelButtonText: '取消',
type: 'warning',
},
).then(async () => {
// 1. 01 03
this.$message.closeAll()
let isFlag = false
try {
// 1.1
if (this.settleTableData_01.length > 0) {
this.settleTableData_01.map((e, v) => {
if (!e.endTime) {
this.$message.error(
'结算清单内终止日期不能有空值!',
)
isFlag = true
throw new Error()
}
)
.then(async () => {
// 1. 01 03
this.$message.closeAll()
let isFlag = false
try {
// 1.1
if (this.settleTableData_01.length > 0) {
this.settleTableData_01.map((e, v) => {
if (!e.endTime) {
this.$message.error(
'结算清单内终止日期不能有空值!',
)
isFlag = true
throw new Error()
}
})
}
if (this.settleTableData_03.length > 0) {
this.settleTableData_03.map((e, v) => {
if (!e.endTime) {
this.$message.error(
'结算清单内终止日期不能有空值!',
)
isFlag = true
throw new Error()
}
})
}
} catch {}
if (isFlag) return
let repairIds = []
// 2. ids
if (this.repairSelectList.length > 0) {
this.repairSelectList.forEach((e) => {
repairIds.push(e.id)
})
}
if (this.settleTableData_03.length > 0) {
this.settleTableData_03.map((e, v) => {
if (!e.endTime) {
this.$message.error(
'结算清单内终止日期不能有空值!',
)
isFlag = true
throw new Error()
}
})
// 3.
const params = {
repairIds: repairIds.join(','),
agreementId: this.currRowInfo.agreementId,
relation: {
leaseCostOne: this.settleTotalPrice_01, // 01
leaseCostThree: this.settleTotalPrice_03, // 0.
repairCos: this.repairTotalPrice, //
scrapCost: this.scrapTotalPrice, //
loseCost: this.noReturnTotalPrice, //
cost: this.totalAmount, //
applyRelation:
this.$refs.otherCostRef.addOtherCostList, //
},
}
} catch {}
if (isFlag) return
let repairIds = []
// 2. ids
if (this.repairSelectList.length > 0) {
this.repairSelectList.forEach((e) => {
repairIds.push(e.id)
})
}
// 3.
const params = {
repairIds: repairIds.join(','),
agreementId: this.currRowInfo.agreementId,
relation: {
leaseCostOne: this.settleTotalPrice_01, // 01
leaseCostThree: this.settleTotalPrice_03, // 0.
repairCos: this.repairTotalPrice, //
scrapCost: this.scrapTotalPrice, //
loseCost: this.noReturnTotalPrice, //
cost: this.totalAmount, //
},
}
// 4.
console.log(params, '参数---')
// 4.
console.log(params, '参数---')
const res = await submitAllFeeBearApi(params)
const res = await submitAllFeeBearApi(params)
if (res.code === 200) {
this.$message.success('结算成功!')
this.$emit('closeCurrPage', true)
}
console.log(res, '结果结果')
})
if (res.code === 200) {
this.$message.success('结算成功!')
this.$emit('closeCurrPage', true)
}
console.log(res, '结果结果')
})
.catch(() => {})
},
//
handelSaveSuccess() {
@ -381,6 +404,11 @@ export default {
goBack() {
this.$emit('closeCurrPage')
},
/* 其他费用变化时事件 */
setOtherCostPrice(val) {
this.addCost = val
},
},
}
</script>

View File

@ -114,7 +114,7 @@
type="date"
placeholder="选择日期"
v-if="t.t_slot === 't_date'"
value-format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
:ref="`editTime_${scope.$index}`"
:class="{
active: activeIndexTime === scope.$index,
@ -374,6 +374,7 @@ export default {
}
.title {
margin: auto 0;
text-align: center;
font-size: 20px;
font-weight: bold;

View File

@ -0,0 +1,230 @@
<template>
<div style="margin-top: 60px">
<el-row class="table-title" type="flex">
<el-col :span="5" class="cost-bear">
<span></span>
<span>合计{{ totalPrice }}</span>
</el-col>
<el-col :span="14" class="title">
其他费用
<el-button
type="text"
v-if="pageContent === '完工结算'"
@click="onAddOtherCost"
>添加</el-button
>
</el-col>
<el-col :span="5"></el-col>
</el-row>
<el-table :data="addOtherCostList" border>
<el-table-column align="center" label="费用描述">
<template slot-scope="scope">
<el-input
:rows="2"
type="textarea"
placeholder="请输入费用描述"
v-model="scope.row.costRemark"
v-if="pageContent === '完工结算'"
:ref="`costRemark_${scope.$index}`"
:class="{
active: activeIndexCostRemark === scope.$index,
}"
/>
<span v-else>{{ scope.row.costRemark }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="金额" width="280">
<template slot-scope="scope">
<el-input
placeholder="请输入金额"
@blur="onAddCostChange"
v-model="scope.row.addCost"
:ref="`addCost_${scope.$index}`"
v-if="pageContent === '完工结算'"
:class="{
active: activeIndex === scope.$index,
}"
/>
<span v-else>{{ scope.row.addCost }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="120"
v-if="pageContent === '完工结算'"
>
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="onDeleteItems(scope.$index)"
icon="el-icon-delete-solid"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
pageContent: {
type: String,
default: () => {},
},
addCost: {
type: [Number, String],
default: () => {},
},
otherCostListDetailsNew: {
type: Array,
default: () => [],
},
},
data() {
return {
totalPrice: 0,
activeIndex: '',
addOtherCostList: [],
activeIndexCostRemark: '',
}
},
methods: {
/* 添加 */
onAddOtherCost() {
const addOtherCostItems = {
addCost: '',
costRemark: '',
}
this.addOtherCostList.push(addOtherCostItems)
},
/* 删除 */
onDeleteItems(index) {
this.addOtherCostList.splice(index, 1)
this.getSumTotalPrice()
},
/* 金额输入框事件 */
onAddCostChange() {
this.getSumTotalPrice()
},
/* 求和 */
getSumTotalPrice() {
if (this.addOtherCostList.length > 0) {
this.totalPrice = this.addOtherCostList.reduce(
(sum, e) => sum + e.addCost * 1,
0,
)
} else {
this.totalPrice = 0
}
this.$emit('setOtherCostPrice', this.totalPrice)
},
/* 确认结算之前的校验 */
onCheckOtherCost() {
let isCheck = true
if (this.addOtherCostList.length > 0) {
try {
this.addOtherCostList.forEach((e, index) => {
const regex_1 = /^(?!\s*$).{1,100}$/
if (!regex_1.test(e.costRemark)) {
this.$message.error(
'费用描述不能为空且不能超过100个字符!',
)
this.activeIndexCostRemark = index
this.$refs[`costRemark_${index}`].focus()
isCheck = false
throw new Error()
} else {
this.activeIndexCostRemark = ''
}
const regex_2 =
/^(?!\s*$)(?:[1-9][0-9]{0,7}|100000000)$/
if (!regex_2.test(e.addCost)) {
this.$modal.msgError(
'金额不能为空不能为小数不能以0开头不能大于1亿',
)
this.activeIndex = index
this.$refs[`addCost_${index}`].focus()
isCheck = false
throw new Error()
} else {
this.activeIndex = ''
this.getSumTotalPrice()
}
})
} catch (error) {}
}
return isCheck
},
},
watch: {
otherCostListDetailsNew: {
handler(newValue) {
if (newValue.length > 0) {
this.addOtherCostList = [...newValue]
}
},
deep: true,
},
addCost: {
handler(newValue) {
if (newValue > 0) {
this.totalPrice = newValue
}
},
deep: true,
},
},
}
</script>
<style scoped lang="scss">
.table-title {
position: relative;
min-height: 48px;
border: 1px solid #7e7e7e;
background: linear-gradient(to right, #b4b3b3, #edebeb);
align-items: center !important;
justify-content: space-around;
.cost-bear {
display: flex;
padding-left: 12px;
font-weight: bold;
color: red;
span {
width: 50%;
}
}
.title {
margin: auto 0;
text-align: center;
font-size: 20px;
font-weight: bold;
letter-spacing: 4px;
}
}
::v-deep .active {
.el-input__inner:focus {
border-color: #f56c6c;
}
.el-textarea__inner:focus {
border-color: #f56c6c;
}
}
</style>

View File

@ -149,7 +149,7 @@
size="mini"
:type="row.isSlt == 1 ? 'success' : 'primary'"
style="padding: 5px 10px"
@click="handleFinishCostAndDetails(row)"
@click="handleFinishCostAndDetails(row, row.isSlt)"
>{{
row.isSlt == 1 ? '结算明细' : '完工结算'
}}</el-button
@ -376,9 +376,12 @@ export default {
this.monthRecordDialogVisible = true
},
/** 完工结算 结算明细*/
handleFinishCostAndDetails(row) {
handleFinishCostAndDetails(row, isSlt) {
this.currRowInfo = row
this.pageContent = '结算明细'
// this.pageContent = ''
isSlt == 1
? (this.pageContent = '结算明细')
: (this.pageContent = '完工结算')
this.isHome = false
},
/** 关闭月结记录弹框 */

View File

@ -67,7 +67,7 @@
</el-row>
</el-form>
<VueEasyPrint ref="vueEasyPrintRef">
<VueEasyPrint tableShow ref="vueEasyPrintRef">
<el-table :data="tableList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column
@ -100,7 +100,9 @@
label="设备编号"
align="center"
/>
<el-table-column label="备注" align="center" />
<el-table-column label="备注" align="center">
<div class="remarks"></div>
</el-table-column>
</el-table>
<h1> 以上工机具均确认完好无误能够正常使用 </h1>
@ -244,4 +246,8 @@ h1 {
font-size: 16px;
letter-spacing: 4px;
}
.remarks {
color: transparent;
}
</style>

View File

@ -8,7 +8,7 @@
v-show="showSearch"
label-width="80px"
>
<el-form-item label="退料日期">
<!-- <el-form-item label="退料日期">
<el-date-picker
v-model="queryParams.time"
type="daterange"
@ -19,12 +19,11 @@
style="width: 240px"
>
</el-date-picker>
</el-form-item>
</el-form-item> -->
<el-form-item label="选择单位">
<el-select
v-model="queryParams.unitId"
clearable
@change="GetProData"
style="width: 240px"
placeholder="请选择"
>
@ -41,7 +40,6 @@
<el-select
v-model="queryParams.proId"
clearable
@change="GetUnitData"
style="width: 240px"
placeholder="请选择"
>
@ -94,7 +92,11 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item prop="isUseChecked">
<el-checkbox @change="onChangeChecked" v-model="isUseChecked"
>在用</el-checkbox
>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@ -256,9 +258,13 @@ export default {
proId: null, //id
types: 1, // 1 2
useFlag: 0,
},
unitList: [], //
proList: [], //
tableList: [],
isUseChecked: false,
}
},
created() {
@ -282,12 +288,13 @@ export default {
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
useFlag: this.queryParams.useFlag,
}
const res = await usingRecord(params)
console.log('工程机具在用', res)
this.loading = false
this.leaseAuditList = res.data.rows
this.total = res.data.total
},
@ -331,6 +338,8 @@ export default {
this.queryParams.time = []
this.queryParams.unitId = ''
this.queryParams.proId = ''
this.isUseChecked = false
this.queryParams.useFlag = 0
this.resetForm('queryForm')
this.handleQuery()
},
@ -345,6 +354,15 @@ export default {
`综合查询_退料记录_${new Date().getTime()}.xlsx`,
)
},
onChangeChecked(val) {
if (val) {
this.queryParams.useFlag = 1
} else {
this.queryParams.useFlag = 0
}
this.getList()
},
},
}
</script>

View File

@ -165,7 +165,7 @@
</template>
</el-table-column>
<el-table-column
<!-- <el-table-column
label="状态"
align="center"
prop="status"
@ -174,7 +174,7 @@
<template slot-scope="scope">
<el-switch v-model="scope.row.status"> </el-switch>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column
label="操作"
align="center"
@ -529,4 +529,4 @@ export default {
width: 60px !important;
margin-bottom: 10px;
}
</style>
</style>