结算等功能完善

This commit is contained in:
BianLzhaoMin 2024-08-23 11:15:38 +08:00
parent 01b88dc252
commit bbd3ecf8b6
26 changed files with 3388 additions and 2039 deletions

View File

@ -300,6 +300,14 @@ export function auditAll(params) {
})
}
// 获取费用承担方
export function getCostBearingApi() {
return request({
url: '/material/base/dic/pid',
method: 'get',
})
}

View File

@ -55,6 +55,39 @@ export function settlementReview(query) {
params: query
})
}
/**
* 7.29
*/
/** 完工结算查询 */
export const getComSellQueryApi = (params) => {
return request.post('/material/sltAgreementInfo/getSltInfo', params)
}
/** 编辑后保存接口 */
export const editSaveApi = (params) => {
return request.post('/material/sltAgreementInfo/updateTrimDay', params)
}
/** 确认结算接口 01和03费用承担方单独结算接口*/
export const submitFeeBearApi = (params) => {
return request.post('/material/sltAgreementInfo/submitFeeBear', params)
}
/** 获取月结记录接口*/
export const getMonthRecordApi = (params) => {
return request.post('/material/sltAgreementInfo/getSltInfoMonth', params)
}
/** 确认结算接口所有结算*/
export const submitAllFeeBearApi = (params) => {
return request.post('/material/sltAgreementInfo/submitFee', params)
}
/** 结算审核通过接口*/
export const costAuditingPassApi = (params) => {
return request.get('/material/sltAgreementInfo/settlementReview', {
params
})
}

View File

@ -17,6 +17,7 @@
clearable
style="width: 240px"
:disabled="isEdit"
@change="leaseTypeChange"
>
<el-option
v-for="item in typeList"
@ -112,6 +113,27 @@
onkeyup="this.value = this.value.replace(/[^\d]/g,'');"
/>
</el-form-item>
<el-form-item
label="费用承担方"
prop="costBearingParty"
v-if="queryParams.leaseType && queryParams.leaseType == 0"
>
<el-select
v-model="queryParams.costBearingParty"
filterable
clearable
style="width: 240px"
placeholder="请选择费用承担方"
:disabled="isEdit"
>
<el-option
v-for="item in costBearingList"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="roleName">
<el-input
maxlength="100"
@ -248,6 +270,7 @@ import {
editLeaseApply,
getLeaseApplyListAll,
getLeaseApplyAuditListAll,
getCostBearingApi,
} from '@/api/claimAndRefund/receive'
import { getInfo } from '@/api/login'
export default {
@ -407,6 +430,13 @@ export default {
trigger: 'change',
},
],
costBearingParty: [
{
required: true,
message: '请选择费用承担方',
trigger: 'change',
},
],
// leasePerson: [
// {
// required: true, message: '', trigger: 'blur',
@ -462,6 +492,7 @@ export default {
},
],
},
costBearingList: [],
}
},
mounted() {
@ -471,6 +502,8 @@ export default {
this.GetProData()
this.getCostBearingFun()
this.GetDeviceTypeTree()
// this.getList();
if (this.$route.query.taskId && !this.$route.query.isBack) {
@ -565,6 +598,7 @@ export default {
this.queryParams.examineStatusId = '32'
}
this.queryParams.unitId = data.unitId
this.queryParams.costBearingParty = data.costBearingParty
this.queryParams.proId = data.proId
this.queryParams.leaseApplyInfo.phone =
data.leaseApplyInfoList[0].phone
@ -599,6 +633,7 @@ export default {
}
this.queryParams.unitId = data.unitId
this.queryParams.proId = data.proId
this.queryParams.costBearingParty = data.costBearingParty
this.queryParams.leaseApplyInfo.phone =
data.leaseApplyInfoList[0].phone
this.queryParams.leaseApplyInfo.leasePerson =
@ -836,7 +871,21 @@ export default {
return template
},
//
async getCostBearingFun() {
const { data: res } = await getCostBearingApi()
this.costBearingList = res
},
//
leaseTypeChange(val) {
if (val == 0) {
this.$set(this.queryParams, 'costBearingParty', '')
} else {
this.$delete(this.queryParams, 'costBearingParty')
}
},
},
}
</script>

View File

@ -16,6 +16,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 240px"
>
</el-date-picker>
</el-form-item>
@ -525,7 +526,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.download(
'/material/base/tm_task/applyExport',
'material/base/tm_task/applyExport',
{
...this.queryParams,
},

View File

@ -54,6 +54,15 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="费用承担方"
v-if="queryParams.leaseTypeName == '工程租赁'"
>
<el-input
v-model="queryParams.costBearingParty"
disabled
/>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">

View File

@ -656,6 +656,7 @@ export default {
outCodeList: [], //
outNumList: [], //
selectList: [],
leaseType: '', // 0 1
}
},
created() {
@ -762,6 +763,7 @@ export default {
this.isView = false
this.dialogQuery.id = row.id
this.resetDialogQuery()
this.leaseType = row.leaseType
// this.getDialogList()
},
@ -839,6 +841,7 @@ export default {
parentId: this.outObj.parentId,
outNum: 1,
taskId: this.outObj.taskId,
leaseType: this.leaseType,
}
return obj
})
@ -856,6 +859,7 @@ export default {
//
saveNumOut() {
this.outNumList[0].carCode = this.numOutForm.carCode
this.outNumList[0].leaseType = this.leaseType
let param = this.outNumList
submitNumOut(param).then((response) => {
this.$modal.msgSuccess('出库成功')

View File

@ -7,6 +7,7 @@
:rules="queryRules"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-row>
<el-form-item label="退料单位" prop="unitId">
@ -51,6 +52,7 @@
<el-input
v-model="queryParams.agreementCode"
disabled
style="width: 240px"
></el-input>
</el-form-item>
<el-form-item label="物品类型" prop="status">
@ -61,6 +63,7 @@
v-model="deviceType"
@change="deviceTypeChange"
ref="deviceTypeCascader"
style="width: 240px"
filterable
></el-cascader>
</el-form-item>
@ -69,6 +72,7 @@
v-model="queryParams.backPerson"
placeholder="请输入退料人"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -77,6 +81,7 @@
v-model="queryParams.backTime"
type="date"
value-format="yyyy-MM-dd"
style="width: 240px"
placeholder="选择时间"
>
</el-date-picker>
@ -154,18 +159,21 @@
label="类型名称"
prop="typeName"
min-width="200"
align="center"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
prop="typeCode"
min-width="200"
align="center"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计量单位"
prop="unitNames"
min-width="100"
align="center"
/>
<el-table-column

View File

@ -445,47 +445,6 @@
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column type="expand">
<template slot-scope="scope">
<div class="nested-table-container">
<el-table
:data="scope.row.maTypeDetails"
style="width: 100%"
>
<!-- 子表格的列 -->
<el-table-column
label="序号"
align="center"
type="index"
/>
<el-table-column
label="类型名称"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="typeModelName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单位"
align="center"
prop="unitName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="预领数量"
align="center"
prop="partNum"
:show-overflow-tooltip="true"
/>
</el-table>
</div>
</template>
</el-table-column>
<el-table-column
label="规格型号"
align="center"
@ -509,6 +468,7 @@
clearable
@input="checkNum(scope.row)"
style="width: 100%"
disabled
/>
</template>
</el-table-column>

View File

@ -0,0 +1,92 @@
<template>
<!-- 批量导出月结明细弹框 -->
<div>
<el-dialog
title="明细导出"
append-to-body
:visible.sync="exportDialogVisible"
:before-close="handleCloseDialog"
width="30%"
>
<el-form
:model="exportForm"
label-width="120px"
:rules="rules"
ref="formRef"
>
<!-- <el-form-item label="导出月份">
<el-date-picker
v-model="exportParams.dateMonth"
type="month"
placeholder="请选择导出月份"
value-format="yyyy-MM"
/>
</el-form-item> -->
<el-form-item label="费用承担方" prop="costBearingParty">
<el-checkbox-group v-model="exportForm.costBearingParty">
<el-checkbox label="01" name="01" />
<el-checkbox label="03" name="03" />
</el-checkbox-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" @click="handleSubmit"
> </el-button
>
<el-button size="mini" @click="handleCloseDialog"
> </el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
//
exportDialogVisible: {
type: Boolean,
default: () => false,
},
},
data() {
return {
exportForm: {
costBearingParty: ['01', '03'],
},
rules: {
costBearingParty: [
{ required: true, message: '请选择费用承担方' },
],
},
}
},
methods: {
/** 关闭 */
handleCloseDialog() {
this.$emit('handleCloseDialog')
},
/** 确定 */
handleSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$emit('handleSubmit', this.exportForm.costBearingParty)
}
})
},
},
watch: {
exportDialogVisible: {
handler(newVla) {
if (!newVla) {
// this.exportParams.dateMonth = ''
}
},
},
},
}
</script>

View File

@ -0,0 +1,414 @@
<template>
<!-- 完工结算和结算明细页面 -->
<div>
<PageHeader :pageContent="pageContent" @goBack="goBack" />
<div class="row-header">
<div>领用单位{{ currRowInfo.unitName }}</div>
<div>工程名称{{ currRowInfo.projectName }}</div>
<div>总合计{{ totalAmount }}</div>
<div>
<el-button size="mini" type="primary" @click="handleExportAll()"
>导出全部明细表</el-button
>
</div>
</div>
<!-- 01承担方 -->
<FinishTable
:tableColumns="settleTableColumns"
:tableTitle="`设备结算清单`"
:isCostBear="true"
:constBear="1"
:totalPrice="settleTotalPrice_01"
:tableData="settleTableData_01"
:isSettle="isSettle_01"
:listType="1"
@submitSell="submitSell"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess"
v-if="settleTableData_01.length > 0"
/>
<!-- 03承担方 -->
<FinishTable
:tableColumns="settleTableColumns"
:tableTitle="`设备结算清单`"
:isCostBear="true"
:constBear="3"
:totalPrice="settleTotalPrice_03"
:tableData="settleTableData_03"
:isSettle="isSettle_03"
:listType="2"
@submitSell="submitSell"
@handleExport="handleExport"
@handelSaveSuccess="handelSaveSuccess"
v-if="settleTableData_03.length > 0"
/>
<FinishTable
:tableColumns="repairTableColumns"
:tableTitle="`设备维修清单`"
:isRepair="true"
:totalPrice="repairTotalPrice"
:tableData="repairTableData"
:currRowInfo="currRowInfo"
:listType="3"
@handleExport="handleExport"
@onChangeRepairPrice="onChangeRepairPrice"
/>
<FinishTable
:tableColumns="noReturnTableColumns"
:tableTitle="`工机具未还赔偿清单`"
:tableData="noReturnTableData"
:totalPrice="noReturnTotalPrice"
:listType="4"
@handleExport="handleExport"
/>
<FinishTable
:tableColumns="scrapTableColumns"
:tableTitle="`工机具报废赔偿清单`"
:tableData="scrapTableData"
:totalPrice="scrapTotalPrice"
:listType="5"
@handleExport="handleExport"
/>
<FinishTable
:tableColumns="stayScrapTableColumns"
:tableTitle="`工机具待报废清单`"
:tableData="stayScrapTableData"
:listType="6"
@handleExport="handleExport"
/>
<el-row class="submit-btn">
<el-button
size="mini"
type="primary"
@click="submitComSett"
v-if="currRowInfo.isSlt == 0"
>确认完工结算</el-button
>
</el-row>
</div>
</template>
<script>
import PageHeader from '@/components/pageHeader'
import FinishTable from './finishTable.vue'
import {
getComSellQueryApi,
submitFeeBearApi,
submitAllFeeBearApi,
} from '@/api/cost/cost.js'
export default {
components: {
PageHeader,
FinishTable,
},
props: {
//
pageContent: {
type: String,
default: () => '完工结算',
},
//
currRowInfo: {
type: Object,
default: () => null,
},
},
computed: {
totalAmount() {
return (
this.settleTotalPrice_01 * 1 +
this.settleTotalPrice_03 * 1 +
this.repairTotalPrice * 1 +
this.noReturnTotalPrice * 1 +
this.scrapTotalPrice * 1
)
},
},
data() {
return {
//
settleTableColumns: [
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '计量单位' },
{ t_prop: 'num', t_label: '数量' },
{ t_prop: 'leasePrice', t_label: '台班费单价(元/天)' },
{ t_prop: 'startTime', t_label: '起租日期' },
{ t_prop: 'endTime', t_label: '终止日期', t_slot: 't_date' },
{ t_prop: 'leaseDays', t_label: '应结算天数' },
{ t_prop: 'costs', t_label: '应结算金额(元)' },
{ t_prop: 'trimDay', t_label: '调整天数', t_slot: 't_ipt' },
{ t_prop: 'realDays', t_label: '实际结算天数' },
{ t_prop: 'realCosts', t_label: '实际结算金额(元)' },
// { t_prop: '', t_label: '' },
// { t_prop: '', t_label: '' },
],
//
repairTableColumns: [
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '计量单位' },
{ t_prop: 'partName', t_label: '维修配件名称' },
{ t_prop: 'partModelName', t_label: '维修配件型号' },
{ t_prop: 'partNum', t_label: '使用数量' },
{ t_prop: 'partPrice', t_label: '配件单价' },
{ t_prop: 'partAllCosts', t_label: '配件总价' },
// { t_prop: '', t_label: '' },
// { t_prop: '', t_label: '' },
],
//
noReturnTableColumns: [
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '计量单位' },
{ t_prop: 'maCode', t_label: '设备编码' },
{ t_prop: 'num', t_label: '未还数量' },
{ t_prop: 'buyPrice', t_label: '赔偿单价' },
{ t_prop: 'costs', t_label: '赔偿金额' },
],
//
scrapTableColumns: [
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '计量单位' },
{ t_prop: 'maCode', t_label: '设备编码' },
{ t_prop: 'num', t_label: '报废数量' },
{ t_prop: 'costs', t_label: '赔偿单价' },
{ t_prop: 'buyPrice', t_label: '赔偿金额' },
],
//
stayScrapTableColumns: [
{ t_prop: 'typeName', t_label: '设备名称' },
{ t_prop: 'modelName', t_label: '规格型号' },
{ t_prop: 'nuitName', t_label: '计量单位' },
{ t_prop: 'maCode', t_label: '设备编码' },
{ t_prop: 'num', t_label: '报废数量' },
{ t_prop: '', t_label: '状态', t_slot: 'status' },
],
// 01
settleTableData_01: [],
// 03
settleTableData_03: [],
//
repairTableData: [],
//
noReturnTableData: [],
//
scrapTableData: [],
//
stayScrapTableData: [],
//
settleTotalPrice_01: 0,
settleTotalPrice_03: 0,
repairTotalPrice: 0,
noReturnTotalPrice: 0,
scrapTotalPrice: 0,
//
isSettle_01: 0,
isSettle_03: 0,
//
repairSelectList: [],
}
},
created() {
this.getComSellList()
},
methods: {
/** 获取结算信息 */
async getComSellList() {
const { data: res } = await getComSellQueryApi([
{ agreementId: this.currRowInfo.agreementId },
])
this.settleTableData_01 = res.leaseListOne // 01
this.settleTableData_03 = res.leaseListThree // 03
this.repairTableData = res.repairList //
this.noReturnTableData = res.loseList //
this.scrapTableData = res.scrapList //
this.stayScrapTableData = res.preScrapList //
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.isSettle_01 = res.relations[0].isSltOne
this.isSettle_03 = res.relations[0].isSltThree
},
/** 确认结算 01或03 */
async submitSell(type) {
const sellParams = {
agreementId: this.currRowInfo.agreementId,
costBearingParty: type,
}
const res = await submitFeeBearApi(sellParams)
if (res.code == 200) {
this.$message.success('结算成功!')
this.getComSellList()
}
},
/** 确认完工结算 */
submitComSett() {
this.$confirm(
'确定后则会生成财务报表,数据将不可修改,请确认检查无误',
'提示',
{
confirmButtonText: '确定',
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()
}
})
}
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)
})
}
// 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, '参数---')
const res = await submitAllFeeBearApi(params)
if (res.code === 200) {
this.$message.success('结算成功!')
this.$emit('closeCurrPage', true)
}
console.log(res, '结果结果')
})
},
//
handelSaveSuccess() {
this.getComSellList()
},
/** 全部导出 */
handleExportAll() {
for (let i = 1; i < 7; i++) {
this.handleExport(i)
}
},
/** 单个导出 */
handleExport(type) {
let exportUrl = 'material/sltAgreementInfo/'
let exportTitle = ''
switch (type) {
case 1:
exportUrl += 'exportLeaseOne'
exportTitle = '设备结算清单(费用承担方01)'
break
case 2:
exportUrl += 'exportLeaseThree'
exportTitle = '设备结算清单(费用承担方03)'
break
case 3:
exportUrl += 'exportRepair'
exportTitle = '设备维修清单'
break
case 4:
exportUrl += 'exportLose'
exportTitle = '工机具未还赔偿清单'
break
case 5:
exportUrl += 'exportScrap'
exportTitle = '工机具报废赔偿清单'
break
case 6:
exportUrl += 'exportPreScrap'
exportTitle = '工机具待报废清单'
break
}
this.downloadJson(
exportUrl,
JSON.stringify([{ agreementId: this.currRowInfo.agreementId }]),
`${exportTitle}-${new Date().getTime()}.xlsx`,
)
},
/** 维修费用选择时 */
onChangeRepairPrice(val, list) {
this.repairTotalPrice = val
this.repairSelectList = list
},
/** 返回按钮 关闭当前页面 */
goBack() {
this.$emit('closeCurrPage')
},
},
}
</script>
<style scoped lang="scss">
.row-header {
margin-top: 20px;
display: flex;
align-items: center;
font-size: 16px;
font-weight: bold;
div {
margin-right: 30px;
}
& div:nth-child(3) {
margin-right: 15px;
color: rgb(255, 0, 0);
}
}
.submit-btn {
margin-top: 20px;
text-align: right;
.el-button {
padding: 10px 14px;
}
}
</style>

View File

@ -0,0 +1,420 @@
<template>
<!-- 完工结算和结算明细页面的表格组件 -->
<div style="margin-top: 60px">
<el-row class="table-title" type="flex">
<div class="batch-system-day" v-if="isCostBear && isEdit">
调整天数批量设置
<el-input
v-model="batchNum"
ref="batchNumRef"
type="number"
clearable
style="width: 120px"
@change="iptChange"
/>
</div>
<span class="repair-tip" v-if="isRepair">
{{
currRowInfo.isSlt == 0
? '勾选需要赔偿的维修项目'
: '已选的维修赔偿项目'
}}</span
>
<el-col :span="5" class="cost-bear">
<span v-if="isCostBear">{{
constBear === 1 ? '费用承担方01' : '费用承担方03'
}}</span>
<span v-else />
<span v-if="totalPrice !== -1">合计{{ totalPrice }}</span>
</el-col>
<el-col :span="14" class="title">{{ tableTitle }}</el-col>
<el-col :span="5" class="btn-item">
<el-button
size="mini"
type="warning"
v-if="!isEdit"
@click="handleExport"
>导出</el-button
>
<el-button
size="mini"
type="primary"
v-if="
isSettle == 0 &&
(isCostBear || (isRepair && currRowInfo.isSlt == 0)) &&
tableData.length > 0
"
@click="handleEdit"
>{{ isEdit ? '取消编辑' : '编辑' }}</el-button
>
<el-button
size="mini"
type="success"
v-if="!isEdit && isCostBear && isSettle == 0"
@click="submitSell"
>确认结算</el-button
>
<el-button
size="mini"
type="success"
v-if="isEdit && isCostBear && isSettle == 0"
@click="handleSave"
>保存</el-button
>
</el-col>
</el-row>
<el-table
border
:data="tableData"
ref="tableRef"
:header-cell-class-name="setClassName"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
v-if="isRepair && currRowInfo.isSlt == 0"
:selectable="() => !this.selDisabled"
/>
<el-table-column
align="center"
width="55"
v-if="isRepair && currRowInfo.isSlt == 1"
>
<template slot-scope="{ row }">
<el-checkbox :checked="row.isSlt == 1" disabled />
</template>
</el-table-column>
<el-table-column
align="center"
v-for="(t, index) in tableColumns"
:key="index"
:label="t.t_label"
:width="t.t_slot === 't_date' ? '180' : ''"
show-overflow-tooltip
>
<template slot-scope="scope">
<template v-if="t.t_slot && isEdit">
<!-- 调整天数时的输入框 -->
<el-input
v-if="t.t_slot === 't_ipt'"
v-model.number="scope.row[t.t_prop]"
style="width: 80px"
type="number"
:ref="`editIpt_${scope.$index}`"
:class="{
active: activeIndex === scope.$index,
}"
/>
<!-- 调整终结日期的日期选择组件 -->
<el-date-picker
v-model="scope.row[t.t_prop]"
type="date"
placeholder="选择日期"
v-if="t.t_slot === 't_date'"
value-format="yyyy-MM-dd"
:ref="`editTime_${scope.$index}`"
:class="{
active: activeIndexTime === scope.$index,
}"
:picker-options="{
disabledDate: (time) => {
const currentDate = new Date(
scope.row.startTime || new Date(),
)
currentDate.setDate(
currentDate.getDate() - 1,
)
return (
time.getTime() < currentDate.getTime()
)
},
}"
style="width: 150px"
/>
</template>
<template v-else-if="t.t_slot && t.t_slot === 'status'">
<el-tag size="mini" type="warning">待报废</el-tag>
</template>
<template v-else>
{{ scope.row[t.t_prop] }}
</template>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { editSaveApi } from '@/api/cost/cost.js'
export default {
props: {
//
tableColumns: {
type: Array,
default: () => [],
},
//
tableTitle: {
type: String,
default: () => '',
},
//
isCostBear: {
type: Boolean,
default: () => false,
},
//
isRepair: {
type: Boolean,
default: () => false,
},
//
tableData: {
type: Array,
default: () => [],
},
// 01 03
constBear: {
type: Number,
default: () => 1,
},
//
totalPrice: {
type: [Number, String],
default: () => -1,
},
// 0 1
isSettle: {
type: [Number, String],
default: () => 0,
},
// 1 01 2 03 3 4 5 6
listType: {
type: Number,
default: () => 0,
},
//
currRowInfo: {
type: Object,
default: () => null,
},
},
data() {
return {
isEdit: false, //
batchNum: '', //
activeIndex: '', // index class
activeIndexTime: '', // index class
selDisabled: true,
}
},
methods: {
/** 编辑按钮 */
handleEdit() {
this.isEdit = !this.isEdit
if (!this.isEdit) {
this.batchNum = ''
this.$emit('handelSaveSuccess')
}
if (this.isRepair) {
this.$refs.tableRef.clearSelection()
this.selDisabled = !this.selDisabled
}
},
/** 调整天数 */
iptChange(val) {
const regex = /^-?\d+$/
const isNum = regex.test(val)
if (!isNum) {
this.$message.error('请输入正整数或负整数或0')
return
}
this.tableData.map((e) => {
e.trimDay = val
})
},
/** 保存按钮 */
async handleSave() {
const regex = /^-?\d+$/
let isNum = false
try {
// 1.
this.tableData.map((e, v) => {
console.log(e)
this.$message.closeAll()
if (!e.endTime) {
this.$message.error('请选择终结日期!')
this.activeIndexTime = v
this.$refs[`editTime_${v}`][0].focus()
isNum = true
throw new Error()
}
if (!regex.test(e.trimDay)) {
this.$message.error('请输入正整数或负整数或0')
this.activeIndex = v
this.$refs[`editIpt_${v}`][0].focus()
isNum = true
throw new Error()
}
if (e.trimDay < 0 && Math.abs(e.trimDay) > e.leaseDays) {
this.$message.error('减免天数不能大于应结算天数!')
this.activeIndex = v
this.$refs[`editIpt_${v}`][0].focus()
isNum = true
throw new Error()
}
})
if (isNum) return
// 2.
let saveParams = []
this.tableData.map((e) => {
const item = {
agreementId: e.agreementId, // id
id: e.id,
typeId: e.typeId, // id
trimDay: e.trimDay, //
maId: e.maId || '',
endTime: e.endTime, //
}
saveParams.push(item)
})
// 3.
const res = await editSaveApi(saveParams)
if (res.code == 200) {
this.$message.success('保存成功!')
this.activeIndex = ''
this.activeIndexTime = ''
this.batchNum = ''
this.isEdit = false
this.$emit('handelSaveSuccess')
}
} catch {}
},
/** 单个列表确认结算 */
submitSell() {
let isFlag = false
this.$message.closeAll()
try {
// 1.
this.tableData.map((e, v) => {
if (!e.endTime) {
this.$message.error('终止日期不能有空值!')
isFlag = true
throw new Error()
}
})
if (isFlag) return
// 2.
this.$confirm(
'确定后则会生成财务报表,数据将不可修改,请确认检查无误',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
).then(() => {
this.$emit('submitSell', `0${this.constBear}`)
})
} catch {}
},
/** 导出按钮 */
handleExport() {
this.$emit('handleExport', this.listType)
},
setClassName({ column }) {
// ,
if (column.type == 'selection' && this.selDisabled) {
return 'all-disabled'
}
},
/** 列表复选框选择事件 */
handleSelectionChange(list) {
let repairPriceAmount = 0
console.log(list, 'list')
list.forEach((e) => {
repairPriceAmount += e.partAllCosts * 1
})
this.$emit('onChangeRepairPrice', repairPriceAmount, list)
},
},
}
</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 {
text-align: center;
font-size: 20px;
font-weight: bold;
letter-spacing: 4px;
}
.btn-item {
text-align: right;
padding-right: 12px;
.el-button {
padding: 6px 10px;
}
}
//
.repair-tip {
position: absolute;
left: 2px;
bottom: 2px;
color: red;
font-size: 12px;
}
//
.batch-system-day {
position: absolute;
top: -50px;
right: 30px;
height: 36px;
line-height: 36px;
}
}
::v-deep .active {
.el-input__inner:focus {
border-color: #f56c6c;
}
}
::v-deep .all-disabled .el-checkbox__input .el-checkbox__inner {
background-color: #edf2fc;
border-color: #dcdfe6;
cursor: not-allowed;
}
</style>

View File

@ -0,0 +1,347 @@
<template>
<!-- 月结记录弹框 -->
<div>
<el-dialog
title="月结记录"
append-to-body
:visible.sync="monthRecordDialogVisible"
:before-close="handleCloseMonthRecordDialog"
width="80%"
>
<el-form inline :model="monthRecordParams" ref="monthRecordFormRef">
<el-form-item label="结算月份" prop="dateMonth">
<el-date-picker
v-model="dateMonth"
type="month"
placeholder="请选择月份"
value-format="yyyy-MM"
@change="onChangeTime"
/>
</el-form-item>
<el-form-item label="费用承担方" prop="costBearingParty">
<el-select
v-model="monthRecordParams.costBearingParty"
clearable
>
<el-option
v-for="item in costBearList"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<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
type="primary"
plain
size="mini"
@click="handelExport(null)"
>批量导出</el-button
>
</el-form-item>
</el-form>
<el-table
border
:data="monthRecordList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" align="center" />
<el-table-column
prop="unitName"
align="center"
label="单位名称"
/>
<el-table-column
prop="projectName"
align="center"
label="工程名称"
/>
<el-table-column prop="month" align="center" label="结算月份" />
<el-table-column
prop="costBearingParty"
align="center"
label="费用承担方"
/>
<el-table-column prop="costs" align="center" label="结算金额" />
<el-table-column align="center" label="操作">
<template slot-scope="{ row }">
<el-button type="text" @click="previewDetails(row)"
>明细</el-button
>
<el-button type="text" @click="handelExport(row)"
>导出明细表</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
:total="monthRecordTotal"
:page.sync="monthRecordParams.pageNum"
:limit.sync="monthRecordParams.pageSize"
@pagination="getMonthRecordList"
/>
<!-- 内层弹框 -->
<el-dialog
width="75%"
title="明细"
:visible.sync="innerVisible"
append-to-body
:before-close="handleCloseMInnerDialog"
>
<el-row :gutter="20" class="title-row">
<el-col :span="12">
领用单位{{ monthDetailsInfo.unitName || '' }}
</el-col>
<el-col :span="12" class="pl-col">
月结月份
{{ monthDetailsInfo.month || '' }}</el-col
>
</el-row>
<el-row :gutter="20" class="title-row">
<el-col :span="12">
工程名称{{ monthDetailsInfo.projectName || '' }}
</el-col>
<el-col :span="12" class="pl-col" style="color: red">
费用承担方{{
monthDetailsInfo.costBearingParty || ''
}}
{{
monthDetailsInfo.costBearingParty == '01'
? '(项目)'
: '(分包)'
}}
</el-col>
</el-row>
<el-table border :data="monthDetails" max-height="600">
<el-table-column
label="序号"
align="center"
type="index"
width="55"
/>
<el-table-column
prop="typeName"
label="设备名称"
align="center"
/>
<el-table-column
prop="modelName"
label="规格型号"
align="center"
/>
<el-table-column
prop="nuitName"
label="计量单位"
align="center"
/>
<el-table-column prop="num" label="数量" align="center" />
<el-table-column
prop="leasePrice"
label="台班费单价 (元/天)"
align="center"
/>
<el-table-column
prop="startTime"
label="开始日期"
align="center"
/>
<el-table-column
prop="endTime"
label="结算日期"
align="center"
/>
<el-table-column
prop="leaseDays"
label="结算天数"
align="center"
/>
<el-table-column
prop="costs"
label="结算金额"
align="center"
/>
<el-table-column
prop="realCosts"
label="本月暂记金额(元)"
align="center"
/>
</el-table>
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import { getMonthRecordApi } from '@/api/cost/cost.js'
export default {
props: {
monthRecordDialogVisible: {
type: Boolean,
default: () => false,
},
agreementId: {
type: [String, Number],
default: () => '',
},
},
data() {
return {
//
costBearList: [
{ id: 1, label: '全部', value: '' },
{ id: 2, label: '01', value: '01' },
{ id: 3, label: '03', value: '03' },
],
//
monthRecordParams: {
startTime: '',
endTime: '',
agreementId: '',
costBearingParty: '',
pageNum: 1,
pageSize: 10,
},
//
monthRecordList: [],
//
selectList: [],
//
innerVisible: false,
//
monthRecordTotal: 1,
//
dateMonth: '',
//
monthDetailsInfo: {},
//
monthDetails: [],
}
},
created() {
this.getMonthRecordList()
},
methods: {
/** 获取月结记录列表数据 */
async getMonthRecordList() {
this.monthRecordParams.agreementId = this.agreementId
// Api
const res = await getMonthRecordApi([this.monthRecordParams])
this.monthRecordList = res.data
},
/** 查询 */
handleQuery() {
this.getMonthRecordList()
},
/** 重置 */
resetQuery() {
this.resetForm('monthRecordFormRef')
this.monthRecordParams.startTime = ''
this.monthRecordParams.endTime = ''
this.dateMonth = ''
this.getMonthRecordList()
},
/** 导出按钮 */
handelExport(row) {
// row null
const { startTime, endTime, agreementId, costBearingParty } =
this.monthRecordParams
let exportList = [
{
codeNum: '',
startTime,
endTime,
agreementId,
costBearingParty,
},
]
if (!row && this.selectList.length < 1) {
this.$message.error('请勾选需要导出的数据!')
return
} else if (!row && this.selectList.length > 0) {
this.selectList.map((e) => {
exportList[0].codeNum += e.codeNum + ','
})
exportList[0].codeNum = exportList[0].codeNum.slice(0, -1)
} else {
exportList[0].codeNum = row.codeNum
}
this.downloadJson(
'material/sltAgreementInfo/exportSltInfoMonth',
JSON.stringify(exportList),
`月结明细${new Date().getTime()}.xlsx`,
)
},
/** 列表勾选 */
handleSelectionChange(list) {
this.selectList = list
},
/** 关闭外侧弹框*/
handleCloseMonthRecordDialog() {
this.$emit('handleCloseMonthRecordDialog')
},
/** 关闭内测弹框 */
handleCloseMInnerDialog() {
this.innerVisible = false
},
/** 明细按钮 */
previewDetails(row) {
const { unitName, month, projectName, costBearingParty } = row
this.monthDetailsInfo = {
unitName,
month,
projectName,
costBearingParty,
}
console.log(row, '明细')
this.monthDetails = row.node
this.innerVisible = true
},
/** 时间变化 */
onChangeTime(val) {
let startTime = ''
if (val.split('-')[1] == 1) {
startTime = `${val.split('-')[0] * 1 - 1}-12-21`
} else {
startTime = `${val.split('-')[0]}-0${
val.split('-')[1] * 1 - 1
}-21`
}
let endTime = val + '-20'
this.monthRecordParams.startTime = startTime
this.monthRecordParams.endTime = endTime
},
},
}
</script>
<style scoped>
.title-row {
min-height: 38px;
line-height: 38px;
font-size: 16px;
}
.pl-col {
padding-left: 180px !important;
}
</style>

View File

@ -34,8 +34,9 @@
<div style="color: rgb(217, 0, 27); font-weight: 700; padding: 20px 0">
结算费用合计¥{{ costAll }}租赁费用¥{{ leaseCost }}维修费用¥{{
repairCost
}}报废费用¥{{ scrapCost }}丢失费用{{ loseCost }}
}}报废费用¥{{ scrapCost }}丢失费用{{ loseCost }}
</div>
<div>
<el-table
:data="leaseList"
@ -111,7 +112,7 @@
:show-overflow-tooltip="true"
/>
<el-table-column
label="租赁费用"
label="外部租赁费用"
align="center"
prop="costs"
:show-overflow-tooltip="true"
@ -172,14 +173,14 @@
prop="repairStatus"
:show-overflow-tooltip="true"
>
<!-- <template slot-scope="scope">
<template slot-scope="scope">
<span v-if="scope.row.repairStatus == 0"
>未审核</span
>
<span v-if="scope.row.repairStatus == 1"
>已审核</span
>
</template> -->
</template>
</el-table-column>
<el-table-column
label="维修数量"
@ -199,10 +200,10 @@
prop="partType"
:show-overflow-tooltip="true"
>
<!-- <template slot-scope="scope">
<template slot-scope="scope">
<span v-if="scope.row.partType == 0">不收费</span>
<span v-if="scope.row.partType == 1">收费</span>
</template> -->
</template>
</el-table-column>
</el-table-column>
</el-table>
@ -351,7 +352,7 @@
title="费用结算提交"
align="center"
:visible.sync="applyVisible"
width="80%"
width="1200px"
>
<div>
<el-table
@ -359,7 +360,6 @@
show-summary
sum-text="合计"
:summary-method="getSummaries"
border
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column
@ -384,6 +384,7 @@
label="租赁费用"
align="center"
prop="leaseCost"
:show-overflow-tooltip="true"
/>
<el-table-column
label="维修费用"
@ -408,62 +409,34 @@
label="增项费用"
align="center"
prop="addCost"
width="180"
:show-overflow-tooltip="true"
width="150"
>
<template slot-scope="scope">
<!-- <el-input-number
<el-input-number
v-model="scope.row.addCost"
controls-position="right"
style="width: 100%"
:min="0"
:max="100000000"
@input="countNum(scope.row)"
></el-input-number> -->
<!-- <el-input-number
controls-position="right"
style="width: 150px"
v-model="scope.row.addCost"
:min="0"
:max="99999999"
@change="onAddChange(scope.row)"
></el-input-number> -->
<el-input
v-model="scope.row.addCost"
clearable
@change="onAddChange(scope.row)"
/>
></el-input-number>
</template>
</el-table-column>
<el-table-column
label="减免费用"
align="center"
prop="subCost"
width="180"
:show-overflow-tooltip="true"
width="150"
>
<template slot-scope="scope">
<!-- <el-input-number
<el-input-number
v-model="scope.row.subCost"
controls-position="right"
style="width: 100%"
:min="0"
:max="scope.row.cost"
@input="countNum(scope.row)"
></el-input-number> -->
<!-- <el-input-number
controls-position="right"
style="width: 150px"
v-model="scope.row.subCost"
:min="0"
:max="subCostFlag"
@change="onSubChange(scope.row)"
></el-input-number> -->
<el-input
v-model="scope.row.subCost"
clearable
@change="onSubChange(scope.row)"
/>
></el-input-number>
</template>
</el-table-column>
<el-table-column
@ -478,8 +451,6 @@
v-model="scope.row.remark"
style="width: 100%"
maxlength="50"
type="textarea"
:rows="6"
></el-input>
</template>
</el-table-column>
@ -501,407 +472,322 @@
</template>
<script>
import {
getAgreementList,
getUnitList,
getProjectList,
} from '@/api/claimAndRefund/receive'
import { getSltInfo, submitFee, exportLease } from '@/api/cost/cost'
import {
getAgreementList,
getUnitList,
getProjectList,
} from '@/api/claimAndRefund/receive'
import { getSltInfo, submitFee, exportLease } from '@/api/cost/cost'
export default {
name: 'Agreement',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
unitList: [],
//
projectList: [],
statusList: [
{ id: '0', name: '请选择' },
{ id: '1', name: '已结算' },
{ id: '2', name: '未结算' },
{ id: '3', name: '待审核' },
], //
//
agreementList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
},
//
form: {},
//
uploadHeader: process.env.VUE_APP_BASE_API,
imageUrl: '',
imageName: '',
fileList: [],
field101fileList: [],
dialogImageUrl: '',
dialogVisible: false,
//
// uploadUrl:'http://192.168.0.14:21624/system',//线+system
// uploadUrl:'http://112.29.103.165:21626/system',//线+system
uploadUrl: process.env.VUE_APP_BASE_API + '/system', //
//
rules: {
contractCode: [
{
required: true,
message: '合同编号不能为空',
trigger: 'blur',
},
],
signTime: [
{
required: true,
message: '签订日期不能为空',
trigger: 'blur',
},
],
unitName: [
{
required: true,
message: '往来单位不能为空',
trigger: 'blur',
},
],
projectName: [
{
required: true,
message: '工程名称不能为空',
trigger: 'blur',
},
],
},
peopleOpen: false,
noticeOpen: false,
nform: {
notice: '',
},
nrules: {
notice: [
{
required: true,
message: '通知内容不能为空',
trigger: 'blur',
},
],
},
leaseList: [], //
leaseCost: 0,
repairList: [], //
repairCost: 0,
scrapList: [], //
scrapCost: 0,
loseList: [], //
loseCost: 0,
costAll: 0,
deptName: undefined,
applyVisible: false,
applyList: [],
}
},
mounted() {
let arr = JSON.parse(this.$route.query.rowData)
this.rowData = arr
this.getDataAll()
// this.getUnitList();
// this.getProjectList();
},
methods: {
// ,getUnitList, getProjectList
getUnitList() {
getUnitList().then((response) => {
this.unitList = response.data
})
},
getProjectList() {
getProjectList().then((response) => {
this.projectList = response.data
})
},
/** 查询列表 */
getDataAll() {
getSltInfo(this.rowData).then((response) => {
// this.agreementList = response.rows;
this.leaseList = response.data.leaseList //
this.leaseCost = this.countCost(this.leaseList)
this.repairList = response.data.repairList //
this.repairCost = this.countCost(this.repairList)
this.scrapList = response.data.scrapList //
this.scrapCost = this.countCost(this.scrapList)
this.loseList = response.data.loseList //
this.loseCost = this.countCost(this.loseList)
this.applyList = response.data.relations
this.applyList.forEach((item) => {
item.leaseCost = Number(item.leaseCost)
item.repairCost = Number(item.repairCost)
item.scrapCost = Number(item.scrapCost)
item.loseCost = Number(item.loseCost)
item.cost =
Number(item.leaseCost) +
Number(item.repairCost) +
Number(item.scrapCost) +
Number(item.loseCost) +
Number(item.addCost) -
Number(item.subCost)
})
let costSum =
Number(this.leaseCost) +
Number(this.repairCost) +
Number(this.scrapCost) +
Number(this.loseCost)
this.costAll = costSum
this.subCostFlag = costSum
})
},
//1
countCost(list) {
let arrCost = 0
list.forEach((item) => {
// arrCost += parseInt(item.costs)
console.log(item)
if (item.partType != 0 && item.scrapType != 0) {
arrCost = arrCost + Number(item.costs)
}
})
return arrCost.toFixed(2)
},
//
handleAdd() {
this.getDataAll()
this.applyVisible = true
},
//el-table-
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 9) {
sums[index] = '最终费用'
return
}
const values = data.map((item) => Number(item[column.property]))
// amount
if (column.property === 'cost') {
if (!values.every((value) => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
// sums[index] += ' ';
} else {
sums[index] = '---'
}
}
})
return sums
},
countNum(row) {
row.cost =
Number(row.leaseCost) +
Number(row.repairCost) +
Number(row.scrapCost) +
Number(row.loseCost) +
Number(row.addCost || 0) -
Number(row.subCost || 0)
},
/** 费用增项时触发的事件 */
onAddChange(row) {
this.$message.closeAll()
const isRegex = this.isNumRegex(row.addCost)
if (!isRegex && row.addCost != '') {
this.$message.error('请输入大于等于0或包含两位小数点的数字')
row.addCost = 0
}
if (row.addCost * 1 >= 100000000) {
this.$message.error('增项费用不能超过1亿')
row.addCost = 99999999
}
// 0
if (
row.leaseCost +
row.repairCost +
row.scrapCost +
row.loseCost +
row.addCost * 1 <
row.subCost * 1
) {
row.subCost = 0
}
row.addCost = row.addCost * 1
this.$nextTick(() => {
row.cost = (
row.leaseCost +
row.repairCost +
row.scrapCost +
row.loseCost +
row.addCost * 1 -
row.subCost * 1
).toFixed(2)
})
},
/** 费用减项时触发事件 */
onSubChange(row) {
this.$message.closeAll()
const isRegex = this.isNumRegex(row.subCost)
if (!isRegex && row.subCost != '') {
this.$message.error('请输入大于等于0或包含两位小数点的数字')
row.subCost = 0
}
row.subCost = row.subCost * 1
if (row.subCost > row.cost && this.costAll <= row.cost) {
this.$message.error('减免费用不能超过小计费用')
row.subCost = row.cost
}
if (row.subCost > row.cost && this.costAll > row.cost) {
this.$message.error('减免费用不能超过小计费用')
row.subCost = this.costAll
}
if (row.cost == 0 && row.subCost != '') {
this.$message.error('小计费用已为0无法再减免')
row.subCost = 0
}
this.$nextTick(() => {
row.cost = (
row.leaseCost +
row.repairCost +
row.scrapCost +
row.loseCost +
row.addCost * 1 -
row.subCost * 1
).toFixed(2)
})
},
isNumRegex(val) {
const regex = /^(0|[1-9]\d*)(\.\d{2})?$/
const isNum = regex.test(val)
return isNum
},
//
submitApply() {
let costAll = 0
this.applyList.forEach((item) => {
costAll = costAll + item.cost
})
console.log(costAll)
let param = {
relations: this.applyList,
cost: costAll,
}
console.log(param)
submitFee(param).then((res) => {
console.log(res)
if (res.code == 200) {
this.$tab.closeOpenPage({
path: '/cost/cost/costApplyList',
})
}
})
},
//
handleBack() {
this.$tab.closeOpenPage({
path: '/cost/cost/costApplyList',
query: {
isEdit: true,
export default {
name: 'Agreement',
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
unitList: [],
//
projectList: [],
statusList: [
{ id: '0', name: '请选择' },
{ id: '1', name: '已结算' },
{ id: '2', name: '未结算' },
{ id: '3', name: '待审核' },
], //
//
agreementList: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
},
})
//
form: {},
//
uploadHeader: process.env.VUE_APP_BASE_API,
imageUrl: '',
imageName: '',
fileList: [],
field101fileList: [],
dialogImageUrl: '',
dialogVisible: false,
//
// uploadUrl:'http://192.168.0.14:21624/system',//线+system
// uploadUrl:'http://112.29.103.165:21626/system',//线+system
uploadUrl: process.env.VUE_APP_BASE_API + '/system', //
//
rules: {
contractCode: [
{
required: true,
message: '合同编号不能为空',
trigger: 'blur',
},
],
signTime: [
{
required: true,
message: '签订日期不能为空',
trigger: 'blur',
},
],
unitName: [
{
required: true,
message: '往来单位不能为空',
trigger: 'blur',
},
],
projectName: [
{
required: true,
message: '工程名称不能为空',
trigger: 'blur',
},
],
},
peopleOpen: false,
noticeOpen: false,
nform: {
notice: '',
},
nrules: {
notice: [
{
required: true,
message: '通知内容不能为空',
trigger: 'blur',
},
],
},
leaseList: [], //
leaseCost: 0,
repairList: [], //
repairCost: 0,
scrapList: [], //
scrapCost: 0,
loseList: [], //
loseCost: 0,
costAll: 0,
deptName: undefined,
applyVisible: false,
applyList: [],
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.agreementId)
this.single = selection.length != 1
this.multiple = !selection.length
mounted() {
let arr = JSON.parse(this.$route.query.rowData)
this.rowData = arr
this.getDataAll()
// this.getUnitList();
// this.getProjectList();
},
/** 导出按钮操作 */
//
handleExport1() {
this.downloadJson(
'material/sltAgreementInfo/exportLease',
JSON.stringify(this.rowData),
`租赁费用明细_${new Date().getTime()}.xlsx`,
)
methods: {
// ,getUnitList, getProjectList
getUnitList() {
getUnitList().then((response) => {
this.unitList = response.data
})
},
getProjectList() {
getProjectList().then((response) => {
this.projectList = response.data
})
},
/** 查询列表 */
getDataAll() {
getSltInfo(this.rowData).then((response) => {
// this.agreementList = response.rows;
this.leaseList = response.data.leaseList //
this.leaseCost = this.countCost(this.leaseList)
this.repairList = response.data.repairList //
this.repairCost = this.countCost(this.repairList)
this.scrapList = response.data.scrapList //
this.scrapCost = this.countCost(this.scrapList)
this.loseList = response.data.loseList //
this.loseCost = this.countCost(this.loseList)
this.applyList = response.data.relations
this.applyList.forEach((item) => {
item.cost =
Number(item.leaseCost) +
Number(item.repairCost) +
Number(item.scrapCost) +
Number(item.loseCost) +
Number(item.addCost) -
Number(item.subCost)
})
let costSum =
Number(this.leaseCost) +
Number(this.repairCost) +
Number(this.scrapCost) +
Number(this.loseCost)
this.costAll = costSum.toFixed(2)
})
},
//1
countCost(list) {
let arrCost = 0
list.forEach((item) => {
// arrCost += parseInt(item.costs)
console.log(item)
if (item.partType != 0 && item.scrapType != 0) {
arrCost = arrCost + Number(item.costs)
}
})
return arrCost.toFixed(2)
},
//
handleAdd() {
this.applyVisible = true
},
//el-table-
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 9) {
sums[index] = '最终费用'
return
}
const values = data.map((item) =>
Number(item[column.property]),
)
// amount
if (column.property === 'cost') {
if (!values.every((value) => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
// sums[index] += ' ';
} else {
sums[index] = '---'
}
}
})
return sums
},
countNum(row) {
row.cost =
Number(row.leaseCost) +
Number(row.repairCost) +
Number(row.scrapCost) +
Number(row.loseCost) +
Number(row.addCost) -
Number(row.subCost)
},
//
submitApply() {
let costAll = 0
this.applyList.forEach((item) => {
costAll = costAll + item.cost
})
console.log(costAll)
let param = {
relations: this.applyList,
cost: costAll,
}
console.log(param)
submitFee(param).then((res) => {
console.log(res)
if (res.code == 200) {
this.$tab.closeOpenPage({
path: '/cost/cost/costApplyList',
})
}
})
},
//
handleBack() {
this.$tab.closeOpenPage({
path: '/cost/cost/costApplyList',
query: {
isEdit: true,
},
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.agreementId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 导出按钮操作 */
//
handleExport1() {
this.downloadJson(
'material/sltAgreementInfo/exportLease',
JSON.stringify(this.rowData),
`租赁费用明细_${new Date().getTime()}.xlsx`,
)
},
//
handleExport2() {
this.downloadJson(
'material/sltAgreementInfo/exportLose',
JSON.stringify(this.rowData),
`丢失费用明细_${new Date().getTime()}.xlsx`,
)
},
//
handleExport3() {
this.downloadJson(
'material/sltAgreementInfo/exportRepair',
JSON.stringify(this.rowData),
`维修费用明细_${new Date().getTime()}.xlsx`,
)
},
//
handleExport4() {
this.downloadJson(
'material/sltAgreementInfo/exportScrap',
JSON.stringify(this.rowData),
`报废费用明细_${new Date().getTime()}.xlsx`,
)
},
handleExportAll() {
this.handleExport1()
this.handleExport2()
this.handleExport3()
this.handleExport4()
},
},
//
handleExport2() {
this.downloadJson(
'material/sltAgreementInfo/exportLose',
JSON.stringify(this.rowData),
`丢失费用明细_${new Date().getTime()}.xlsx`,
)
},
//
handleExport3() {
this.downloadJson(
'material/sltAgreementInfo/exportRepair',
JSON.stringify(this.rowData),
`维修费用明细_${new Date().getTime()}.xlsx`,
)
},
//
handleExport4() {
this.downloadJson(
'material/sltAgreementInfo/exportScrap',
JSON.stringify(this.rowData),
`报废费用明细_${new Date().getTime()}.xlsx`,
)
},
handleExportAll() {
this.handleExport1()
this.handleExport2()
this.handleExport3()
this.handleExport4()
},
},
}
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 80px !important;
margin-bottom: 10px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 80px !important;
margin-bottom: 10px;
}
</style>

View File

@ -1,213 +1,217 @@
<template>
<!-- 费用结算页面 -->
<div class="app-container" id="costApplyList">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="结算单位" prop="unitId">
<el-select
v-model="queryParams.unitId"
placeholder="请选择往来单位"
clearable
filterable
>
<el-option
v-for="item in unitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="结算工程" prop="projectId">
<el-select
v-model="queryParams.projectId"
placeholder="请选择工程名称"
clearable
filterable
>
<el-option
v-for="item in projectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="结算状态" prop="sltStatus">
<el-select
v-model="queryParams.sltStatus"
placeholder="请选择结算状态"
clearable
filterable
>
<el-option
v-for="item in statusList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<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
type="primary"
plain
size="mini"
@click="handleApplyList"
>批量结算</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="agreementList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:selectable="(row) => row.sltStatus == 1"
/>
<el-table-column
label="序号"
align="center"
width="80"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
<template v-if="isHome">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<!-- <template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template> -->
</el-table-column>
<el-table-column
label="协议编号"
align="center"
prop="agreementCode"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="合同编号" align="center" prop="contractCode" :show-overflow-tooltip="true" />
<el-table-column label="附件图片" align="center" prop="fileName" :show-overflow-tooltip="true" />
<el-table-column label="签订日期" align="center" prop="signTime" :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="cost"
:show-overflow-tooltip="true"
/>
<el-table-column
label="结算状态"
align="center"
prop="sltStatus"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span v-if="scope.row.sltStatus == '1'">未结算</span>
<span v-if="scope.row.sltStatus == '2'">已结算</span>
<span v-if="scope.row.sltStatus == '3'">已审核</span>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="租赁期限(天)" align="center" prop="leaseDay" :show-overflow-tooltip="true" />
<el-table-column label="授权人" align="center" prop="authPerson" :show-overflow-tooltip="true" />
<el-table-column label="联系电话 " align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> -->
<el-table-column
label="操作"
align="center"
width="300"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleApply(scope.row)"
v-if="scope.row.sltStatus == '1'"
>结算申请</el-button
<el-form-item label="结算单位" prop="unitId">
<el-select
v-model="queryParams.unitId"
placeholder="请选择往来单位"
clearable
filterable
>
<!-- <el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>撤销申请</el-button> -->
</template>
</el-table-column>
</el-table>
<el-option
v-for="item in unitList"
:key="item.unitId"
:label="item.unitName"
:value="item.unitId"
/>
</el-select>
</el-form-item>
<el-form-item label="结算工程" prop="projectId">
<el-select
v-model="queryParams.projectId"
placeholder="请选择工程名称"
clearable
filterable
>
<el-option
v-for="item in projectList"
:key="item.projectId"
:label="item.projectName"
:value="item.projectId"
/>
</el-select>
</el-form-item>
<el-form-item label="结算状态" prop="sltStatus">
<el-select
v-model="queryParams.sltStatus"
placeholder="请选择结算状态"
clearable
filterable
>
<el-option
v-for="item in statusList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<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
type="primary"
plain
size="mini"
@click="handleBatchExport"
>批量导出月结明细表</el-button
>
</el-form-item>
</el-form>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-table
v-loading="loading"
:data="agreementList"
border
@selection-change="handleSelectionChange"
ref="tableRef"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(
queryParams.pageNum,
queryParams.pageSize,
)
"
/>
<el-table-column
label="协议编号"
align="center"
prop="agreementCode"
show-overflow-tooltipp
/>
<el-table-column
label="结算单位"
align="center"
prop="unitName"
show-overflow-tooltip
/>
<el-table-column
label="结算工程"
align="center"
prop="projectName"
show-overflow-tooltip
/>
<el-table-column
label="累计结算费用"
align="center"
prop="cost"
show-overflow-tooltip
/>
<el-table-column label="结算状态" align="center">
<template slot-scope="{ row }">
<!-- <span v-if="scope.row.sltStatus == '1'">未结算</span>
<span v-if="scope.row.sltStatus == '2'">已结算</span>
<span v-if="scope.row.sltStatus == '3'">待审核</span> -->
<el-tag type="warning" size="mini" v-if="row.isSlt == 0"
>结算中</el-tag
>
<el-tag type="success" size="mini" v-if="row.isSlt == 1"
>已结算</el-tag
>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button
size="mini"
type="primary"
style="padding: 5px 10px"
@click="handleMonthRecord(row)"
>月结记录</el-button
>
<el-button
size="mini"
:type="row.isSlt == 1 ? 'success' : 'primary'"
style="padding: 5px 10px"
@click="handleFinishCostAndDetails(row)"
>{{
row.isSlt == 1 ? '结算明细' : '完工结算'
}}</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 批量导出月结明细 -->
<ExportDialog
:exportDialogVisible="exportDialogVisible"
:exportParams="exportParams"
@handleCloseDialog="handleCloseDialog"
@handleSubmit="handleSubmit"
/>
<!-- 月结记录弹框 -->
<MonthRecord
v-if="monthRecordDialogVisible"
:monthRecordDialogVisible="monthRecordDialogVisible"
:agreementId="agreementId"
@handleCloseMonthRecordDialog="handleCloseMonthRecordDialog"
/>
</template>
<template v-else>
<FinishAndDetails
:currRowInfo="currRowInfo"
:pageContent="pageContent"
@closeCurrPage="closeCurrPage"
/>
</template>
</div>
</template>
<script>
import {
getAgreementList,
getUnitList,
getProjectList,
} from '@/api/claimAndRefund/receive'
import { getUnitList, getProjectList } from '@/api/claimAndRefund/receive'
import { getSltAgreementInfo } from '@/api/cost/cost'
import ExportDialog from './component/exportDialog.vue'
import MonthRecord from './component/monthRecord.vue'
import FinishAndDetails from './component/finishAndDetails.vue'
export default {
name: 'CostApplyList',
dicts: ['sys_normal_disable'],
components: {
ExportDialog,
MonthRecord,
FinishAndDetails,
},
data() {
return {
//
loading: true,
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
@ -217,12 +221,16 @@ export default {
//
projectList: [],
statusList: [
{ id: '1', name: '未结算' },
{ id: '2', name: '已结算' },
{ id: '3', name: '已审核' },
{ id: '', name: '请选择' },
{ id: '0', name: '结算中' },
{ id: '1', name: '已结算' },
], //
//
agreementList: [],
agreementList: [
{
agreementCode: '测试',
},
],
//
title: '',
//
@ -238,66 +246,20 @@ export default {
unitId: '',
projectId: '',
},
//
form: {},
//
uploadHeader: process.env.VUE_APP_BASE_API,
imageUrl: '',
imageName: '',
fileList: [],
field101fileList: [],
dialogImageUrl: '',
dialogVisible: false,
//
// uploadUrl:'http://192.168.0.14:21624/system',//线+system
// uploadUrl:'http://112.29.103.165:21626/system',//线+system
uploadUrl: process.env.VUE_APP_BASE_API + '/system', //
//
rules: {
contractCode: [
{
required: true,
message: '合同编号不能为空',
trigger: 'blur',
},
],
signTime: [
{
required: true,
message: '签订日期不能为空',
trigger: 'blur',
},
],
unitName: [
{
required: true,
message: '往来单位不能为空',
trigger: 'blur',
},
],
projectName: [
{
required: true,
message: '工程名称不能为空',
trigger: 'blur',
},
],
},
peopleOpen: false,
noticeOpen: false,
nform: {
notice: '',
},
nrules: {
notice: [
{
required: true,
message: '通知内容不能为空',
trigger: 'blur',
},
],
},
deptName: undefined,
//
exportDialogVisible: false,
//
monthRecordDialogVisible: false,
//
isHome: true,
//
currRowInfo: null,
//
pageContent: '',
//
agreementId: '',
//
exportParams: [],
}
},
created() {
@ -353,10 +315,6 @@ export default {
})
},
handleApplyList() {
if (this.ids.length < 1) {
this.$message.error('请候选需要结算的数据!')
return
}
if (this.ids.length > 0) {
let arr = this.ids
this.$tab.closeOpenPage({
@ -370,35 +328,70 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
// const agreementId = row.agreementId;
// let param = {
// agreementId:row.agreementId+''
// }
// this.$modal.confirm('').then(function() {
// return removeAgreement(param);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// }).catch(() => {});
/** 批量导出月结明细表 */
handleBatchExport() {
console.log('批量导出月结明细表')
this.exportParams = []
if (this.ids.length < 1) {
this.$message.error('请勾选需要导出的数据!')
return
}
// id
this.ids.forEach((e) => {
this.exportParams.push({
agreementId: e.agreementId,
costBearingParty: '',
})
})
this.exportDialogVisible = true
},
/** 导出按钮操作 */
handleExport() {
// this.download('material/agreementInfo/export', {
// ...this.queryParams
// }, `_${new Date().getTime()}.xlsx`)
/** 关闭弹框 */
handleCloseDialog() {
this.exportDialogVisible = false
},
/** 确定按钮 */
handleSubmit(form) {
if (form.length === 1) {
this.exportParams.forEach((e) => {
e.costBearingParty = form[0]
})
}
this.downloadJson(
'material/sltAgreementInfo/exportSltInfoMonth',
JSON.stringify(this.exportParams),
`月结明细${new Date().getTime()}.xlsx`,
)
this.exportDialogVisible = false
this.$refs.tableRef.clearSelection()
},
/** 月结记录 */
handleMonthRecord(row) {
this.agreementId = row.agreementId
this.monthRecordDialogVisible = true
},
/** 完工结算 结算明细*/
handleFinishCostAndDetails(row) {
this.currRowInfo = row
this.pageContent = '结算明细'
this.isHome = false
},
/** 关闭月结记录弹框 */
handleCloseMonthRecordDialog() {
this.monthRecordDialogVisible = false
},
/** 关闭完工结算或结算明细页面 */
closeCurrPage(isRefresh) {
this.isHome = true
if (isRefresh) {
this.getList()
}
},
},
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 80px !important;
margin-bottom: 10px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -80,29 +80,35 @@
v-loading="loading"
:data="agreementList"
@selection-change="handleSelectionChange"
border
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
<!-- <el-table-column
label="序号"
align="center"
width="80"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
>
<!-- <template slot-scope="scope">
<template scope="scope">
<span>{{
(queryParams.pageNum - 1) * 10 + scope.$index + 1
}}</span>
</template> -->
</el-table-column>
</template>
</el-table-column> -->
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<!-- <el-table-column
label="结算单编号"
align="center"
prop="code"
:show-overflow-tooltip="true"
/>
/> -->
<el-table-column
label="结算单位"
@ -129,25 +135,29 @@
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span v-if="scope.row.status == '0'">待审核</span>
<span v-if="scope.row.status == '1'">审核通过</span>
<span v-if="scope.row.status == '2'">审核驳回</span>
<el-tag
size="mini"
type="warning"
v-if="scope.row.status == '0'"
>待审核</el-tag
>
<el-tag
size="mini"
type="success"
v-if="scope.row.status == '1'"
>审核通过</el-tag
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="300"
class-name="small-padding fixed-width"
>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleExame(scope.row)"
v-if="scope.row.status == '0'"
v-if="scope.row.status == 0"
>审批</el-button
>
<!-- <el-button
@ -176,7 +186,7 @@ import {
getUnitList,
getProjectList,
} from '@/api/claimAndRefund/receive'
import { getSltExam } from '@/api/cost/cost'
import { getSltExam, costAuditingPassApi } from '@/api/cost/cost'
export default {
name: 'CostApplyList',
@ -200,9 +210,10 @@ export default {
//
projectList: [],
statusList: [
{ id: '', name: '请选择' },
{ id: '0', name: '待审核' },
{ id: '1', name: '审核通过' },
{ id: '2', name: '审核驳回' },
// { id: '2', name: '' },
], //
//
agreementList: [],
@ -324,13 +335,21 @@ export default {
},
//
handleExame(row) {
let arr = [row]
this.$tab.closeOpenPage({
path: '/cost/cost/costExame',
query: {
Id: row.id,
rowData: JSON.stringify(arr),
},
this.$confirm('是否确任通过审核, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const { agreementId } = row
const res = await costAuditingPassApi({
agreementId,
status: '1',
})
if (res.code === 200) {
this.$message.success('已通过')
this.getList()
}
})
},
handleApplyList() {

View File

@ -98,8 +98,9 @@
></el-input>
</el-form-item>
<el-form-item
v-if="domain.partType == 1"
:prop="'premiumList.' + index + '.partCost'"
label="配件费用"
label="配件单价"
:rules="{
required: false,
validator: meneyIntegerValidator,
@ -265,8 +266,9 @@
></el-input>
</el-form-item>
<el-form-item
v-if="domain.partType == 1"
:prop="'premiumListTwo.' + index + '.partCost'"
label="配件费用"
label="配件单价"
:rules="{
required: false,
validator: meneyIntegerValidator,
@ -444,7 +446,7 @@ export default {
// } else {
// callback(new Error('0'))
// }
if (this.isRequired && (value === '' || !reg.test(value))) {
callback(new Error('请输入大于0的正整数'))
} else {
@ -556,6 +558,12 @@ export default {
'this.dynamicValidateForm.premiumList1111)',
this.dynamicValidateForm.premiumList,
)
this.dynamicValidateForm.premiumList.forEach((e) => {
if (e.partType == 0) {
e.partCost = ''
}
})
let params = {
taskId: this.rowObj.taskId,
maId: this.rowObj.maId,
@ -591,6 +599,11 @@ export default {
submitTwo() {
this.$refs['dynamicValidateFormTwo'].validate((valid) => {
if (valid) {
this.dynamicValidateFormTwo.premiumListTwo.forEach((e) => {
if (e.partType == 0) {
e.partCost = ''
}
})
//
let params = {
taskId: this.rowObj.taskId,

File diff suppressed because it is too large Load Diff

View File

@ -917,7 +917,7 @@ export default {
handleExport() {
const dataCondition = this.selectionList.map((item) => item.taskId)
this.download(
'/material/base/repair/export',
'material/base/repair/export',
{
...this.queryParams,
dataCondition,

View File

@ -414,7 +414,7 @@ export default {
methods: {
/** 查询用户列表--采购员 */
getUserList() {
getUserByRoleList({ roleId: '104' }).then((response) => {
getUserByRoleList({ roleIds: [152] }).then((response) => {
this.userList = response.data
})
},
@ -697,4 +697,4 @@ export default {
::v-deep input[type='number'] {
-moz-appearance: textfield !important;
}
</style>
</style>

View File

@ -155,61 +155,55 @@
<el-dialog
:title="title"
:visible.sync="open"
v-if="open"
width="1000px"
append-to-body
:close-on-click-modal="false"
>
<el-row :gutter="24" class="mb8">
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="78px"
v-if="!isDetail"
>
<el-input v-model="form.typeId" disabled v-show="false" />
<el-col :span="7">
<el-form-item label="编码前缀" prop="exCode">
<el-input
v-model="form.exCode"
@change="fillingCodeList"
/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="后缀范围">
<div style="display: flex">
<el-input
v-model="form.str"
placeholder="0001"
maxlength="4"
@change="fillingCodeList"
></el-input>
-
<el-input
v-model="form.str1"
placeholder="0005"
maxlength="4"
@change="fillingCodeList"
></el-input>
</div>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="固定资产" prop="fixCode">
<el-select
v-model="form.fixCode"
placeholder="是否为固定资产"
@change="fillingCodeList"
clearable
allow-create
>
<el-option label="是" value="0" />
<el-option label="否" value="1" />
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="2">
<el-form
ref="formCodeRef"
:model="form"
:rules="codeRules"
:inline="true"
label-width="78px"
v-if="!isDetail"
>
<el-input v-model="form.typeId" disabled v-show="false" />
<el-form-item label="编码前缀" prop="exCode">
<el-input v-model="form.exCode" @change="fillingCodeList" />
</el-form-item>
<el-form-item label="后缀范围" prop="suffixOneCode">
<el-input
v-model="form.suffixOneCode"
placeholder="0001"
maxlength="4"
style="width: 100px"
/>
</el-form-item>
<el-form-item prop="suffixTwoCode">
<el-input
v-model="form.suffixTwoCode"
placeholder="0005"
maxlength="4"
style="width: 100px"
/>
</el-form-item>
<el-form-item label="固定资产" prop="fixCode">
<el-select
v-model="form.fixCode"
placeholder="是否为固定资产"
clearable
allow-create
style="width: 100px"
>
<el-option label="是" value="0" />
<el-option label="否" value="1" />
</el-select>
</el-form-item>
<!-- <el-col :span="2">
<el-button
type="primary"
plain
@ -217,16 +211,21 @@
@click="createCodeList"
>生成</el-button>
</el-col>-->
<el-col :span="2">
<el-button
type="primary"
plain
size="mini"
@click="fillingCodeList"
>填充</el-button
>
</el-col>
</el-form>
<el-form-item>
<el-button
type="primary"
plain
size="mini"
@click="fillingCodeList"
>填充</el-button
>
</el-form-item>
</el-form>
<el-row class="surplus-code">
剩余待编码数量<span style="color: red">{{
surplusNoBindNum
}}</span>
</el-row>
<el-table v-loading="loading" :data="codeList" height="400">
<!-- <el-table-column type="selection" width="50" align="center" /> -->
@ -253,10 +252,12 @@
>
<template slot-scope="scope">
<el-input
:ref="`inputRef-${scope.row.id}`"
v-if="!isDetail"
v-model="scope.row.maCode"
:disabled="scope.row.statusFlag == 0"
οninput="value=value.replace(/[^0-9.]/g,'')"
maxlength="24"
></el-input>
<span v-else>{{ scope.row.maCode }}</span>
</template>
@ -296,7 +297,11 @@
</el-table>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm" v-if="!isDetail"
<el-button
type="primary"
@click="submitForm"
v-if="!isDetail"
:loading="codingLoading"
> </el-button
>
<el-button @click="cancel"> </el-button>
@ -381,6 +386,9 @@ export default {
str1: '',
fixCode: '1',
typeId: '',
suffixOneCode: 0,
suffixTwoCode: 0,
},
codeList: [], //list
getCodeList: [], //list
@ -397,7 +405,37 @@ export default {
// { required: true, message: "", trigger: "blur" }
// ],
},
codeRules: {
suffixOneCode: [
{
required: true,
message: '请输入后缀范围',
trigger: 'blur',
},
// {
// pattern: /^[1-9]\d*$/,
// message: '',
// trigger: 'blur',
// },
],
suffixTwoCode: [
{
required: true,
message: '请输入后缀范围',
trigger: 'blur',
},
// {
// pattern: /^[1-9]\d*$/,
// message: '',
// trigger: 'blur',
// },
],
},
isDetail: false,
surplusNoBindNum: 0,
codingLoading: false,
}
},
mounted() {
@ -415,7 +453,6 @@ export default {
})
},
selectType(id) {
console.log(id)
getListByMaType({ typeId: id }).then((response) => {
this.modelList = response.data
})
@ -466,7 +503,7 @@ export default {
this.multiple = !selection.length
}, //getCodeList newCodeList
/** 编码按钮操作 */ handleCode(row) {
console.log(row, '编码管理---')
console.log(row)
this.reset()
this.form = row
@ -488,7 +525,7 @@ export default {
this.$set(
this.form,
'exCode',
'CSJJ' +
'NSJJ' +
this.form.typeCode +
this.form.specsCode +
arr[0][2] +
@ -509,6 +546,9 @@ export default {
// this.codeList = response.data;
// });
this.surplusNoBindNum =
parseInt(this.form.checkNum) - parseInt(this.form.bindNum)
},
//codeList
createCodeList() {
@ -532,15 +572,91 @@ export default {
},
//
fillingCodeList() {
console.log(Number(this.form.str))
this.codeList = []
let num = Number(this.form.str)
// console.log(Number(this.form.str1))
let num1 = Number(this.form.str1)
let count = num1 - num + 1 //
console.log()
let sum = count + this.form.bindNum
console.log(sum)
// console.log(Number(this.form.str))
// this.codeList = []
// let num = Number(this.form.str)
// // console.log(Number(this.form.str1))
// let num1 = Number(this.form.str1)
// let count = num1 - num + 1 //
// console.log()
// let sum = count + this.form.bindNum
// console.log(sum)
if (this.codeList.length === this.surplusNoBindNum) {
this.$modal.msgError('当前编码已填充,不可重复操作!')
return
}
this.$refs['formCodeRef'].validate((valid) => {
if (valid) {
if (
isNaN(this.form.suffixOneCode) ||
isNaN(this.form.suffixTwoCode) ||
parseInt(this.form.suffixOneCode) >
parseInt(this.form.suffixTwoCode)
) {
this.$modal.msgError('编码后缀范围输入格式不正确')
return
}
let suffixOneCode = parseInt(this.form.suffixOneCode)
let suffixTwoCode = parseInt(this.form.suffixTwoCode)
let sumNum = suffixTwoCode - suffixOneCode + 1
if (sumNum > this.surplusNoBindNum) {
this.$modal.msgError(
'当前选择的编码数量已超过剩余未编码数量!',
)
return
}
if (this.codeList.length === 0) {
for (let i = 0; i < sumNum; i++) {
let obj = {
typeName: this.form.typeName,
specificationType: this.form.specificationType,
typeId: this.form.typeId,
taskId: this.form.taskId,
maCode:
this.form.exCode +
('00000' + (suffixOneCode + i)).slice(-4),
assetsCode: '',
fixCode: this.form.fixCode,
id: ('00000' + (suffixOneCode + i)).slice(-4),
}
this.codeList.push(obj)
}
this.surplusNoBindNum -= this.codeList.length
} else {
for (let i = 0; i < sumNum; i++) {
let obj = {
typeName: this.form.typeName,
specificationType: this.form.specificationType,
typeId: this.form.typeId,
taskId: this.form.taskId,
maCode:
this.form.exCode +
('00000' + (suffixOneCode + i)).slice(-4),
assetsCode: '',
fixCode: this.form.fixCode,
id: ('00000' + (suffixOneCode + i)).slice(-4),
}
const isRepeat = this.codeList.every(
(e) => e.id != obj.id,
)
if (isRepeat) {
this.codeList.push(obj)
this.surplusNoBindNum -= 1
}
}
}
}
})
if (true) {
return
}
if (sum > this.form.checkNum) {
this.$modal.msgError(
'已绑定编码' +
@ -572,12 +688,23 @@ export default {
/** 提交按钮 */
submitForm: function () {
// console.log(this.codeList)
if (this.form.fixCode == 0) {
if (this.hasDuplicateField(this.codeList, 'assetsCode')) {
this.$modal.msgError('固定资产编码不能为空')
return false
}
// if (this.form.fixCode == 0) {
// if (this.hasDuplicateField(this.codeList, 'assetsCode')) {
// this.$modal.msgError('')
// return false
// }
// }
let noCode = this.codeList.filter((e) => e.maCode === '')
if (noCode.length > 0) {
this.$modal.msgError('编码不可为空')
noCode.map((e, index) => {
if (index === 0) {
this.$refs[`inputRef-${e.id}`].focus()
}
})
}
if (this.codeList.length == 0) {
this.$modal.msgError('无新增编码绑定')
} else {
@ -587,32 +714,36 @@ export default {
for (const item of this.codeList) {
const maCode = item.maCode
console.log(maCodeSet.has(maCode), '是否有编码')
if (maCodeSet.has(maCode)) {
hasDuplicates = true
break
}
maCodeSet.add(maCode)
}
console.log('codeList:', this.codeList)
if (hasDuplicates) {
this.$modal.msgError(
'编码绑定失败,存在重复编码,请重新输入',
)
return //
}
editPurchaseMacode(this.codeList).then((response) => {
console.log(this.codeList)
if (response.data && response.data.length > 0) {
this.codeList = response.data
this.$modal.msgError(
'编码绑定失败,存在重复编码,请重新输入',
)
} else {
this.$modal.msgSuccess('编码绑定成功')
this.open = false
this.getList()
}
})
this.codingLoading = true
editPurchaseMacode(this.codeList)
.then((response) => {
if (response.data && response.data.length > 0) {
this.codeList = response.data
this.$modal.msgError(
'编码绑定失败,存在重复编码,请重新输入',
)
} else {
this.$modal.msgSuccess('编码绑定成功')
this.open = false
this.getList()
}
})
.finally(() => {
this.codingLoading = false
})
}
},
hasDuplicateField(array, field) {
@ -644,6 +775,8 @@ export default {
this.codeList.splice(index, 1)
}
})
this.surplusNoBindNum += 1
// const maCode = row.maCode ;
// this.$modal.confirm('').then(function() {
// return delMacodeList(maCode);
@ -658,20 +791,33 @@ export default {
this.$tab.closeOpenPage(obj)
},
async handleBindDetails(row) {
console.log('🚀 ~ handleBindDetails ~ row:', row.taskId)
console.log('🚀 ~ handleBindDetails ~ row:', row.taskId, row)
this.surplusNoBindNum = row.checkNum - row.bindNum
this.open = true
this.isDetail = true
this.title = '编码绑定详情'
this.codeList = []
// const res = await getBindCodeDetails({ taskId: row.taskId })
const res = await getBindCodeDetails({
typeId: row.typeId,
taskId: row.taskId,
typeId: row.typeId,
})
console.log('🚀 ~ handleBindDetails ~ res:', res)
this.codeList = res.data
},
},
watch: {
open: {
handler(newValue) {
if (!newValue) {
this.form.suffixOneCode = ''
this.form.suffixTwoCode = ''
this.form.fixCode = '1'
}
},
deep: true,
},
},
}
</script>
@ -685,4 +831,10 @@ export default {
width: 60px !important;
margin-bottom: 10px;
}
.surplus-code {
padding-bottom: 10px;
padding-left: 8px;
font-size: 16px;
}
</style>

View File

@ -323,7 +323,7 @@
>
<span>供应商</span
><span v-if="printTableData.length > 0">{{
printTableData[0].supplier
supplierStr
}}</span>
</div>
</div>
@ -493,6 +493,8 @@ export default {
openPrint: false,
printData: {},
printTableData: [],
//
supplierStr: '',
}
},
created() {
@ -558,7 +560,6 @@ export default {
// .then(() => {
// this.$tab.refreshPage()
// })
this.$emit('queryTools', row.taskId)
},
/** 修改按钮操作 */
@ -605,6 +606,13 @@ export default {
getAcceptanceForm({ taskId: taskId }).then((response) => {
this.printData = response.data
this.printTableData = response.data.checkDetailsList
let supplierStr = ''
this.printTableData.forEach((e) => {
if (e.supplier) {
supplierStr += e.supplier + ','
}
})
this.supplierStr = supplierStr.slice(0, -1)
})
},
//

View File

@ -190,6 +190,7 @@
>
验收
</el-button>
<!-- <el-button
size="mini"
type="text"
@ -203,6 +204,7 @@
<el-dialog
:title="title"
:visible.sync="open"
v-if="open"
width="650px"
append-to-body
:close-on-click-modal="false"
@ -261,6 +263,9 @@
>
<!-- <img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar"> -->
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__tip" slot="tip"
>请上传pngjpgjpeg类型文件文件个数不能超过5个且单个文件不能超过5M</div
>
</el-upload>
</el-form-item>
</el-form>
@ -274,6 +279,7 @@
<el-dialog
:title="title"
:visible.sync="openAll"
v-if="openAll"
width="650px"
append-to-body
>
@ -305,6 +311,9 @@
>
<!-- <img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar"> -->
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__tip" slot="tip"
>请上传pngjpgjpeg类型文件文件个数不能超过5个且单个文件不能超过5M</div
>
</el-upload>
</el-form-item>
</el-form>
@ -320,6 +329,7 @@
<el-dialog
:title="title"
:visible.sync="noticeOpen"
v-if="noticeOpen"
width="1000px"
append-to-body
>
@ -414,6 +424,7 @@
<el-dialog
:title="title"
:visible.sync="peopleOpen"
v-if="peopleOpen"
width="1000px"
append-to-body
>
@ -424,13 +435,7 @@
height="450"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="序号"
align="center"
key="userId"
prop="userId"
type="index"
/>
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="人员账号"
align="center"
@ -775,6 +780,10 @@ export default {
},
//
addUser() {
if (this.chosenUserList.length < 1) {
this.$message.error('请选择人员!')
return
}
// console.log(this.chosenUserList,"chosenUserList")
addNoticeUser(this.chosenUserList).then((response) => {
if (response.code == 200) {
@ -994,8 +1003,7 @@ export default {
},
//
openImg(url) {
// this.dialogImageUrl = this.uploadUrl + url
this.dialogImageUrl = url
this.dialogImageUrl = this.uploadUrl + url
this.dialogVisible = true
},
//

View File

@ -71,6 +71,7 @@ export default {
/* 查询工机具 */
queryTools(taskId) {
this.isView = true
this.pageContent = '详情信息'
this.queryTaskId = taskId
this.isShowComponent = 'QueryTools'

View File

@ -247,15 +247,15 @@
<el-row :gutter="10" class="mb8" v-if="showHandle">
<el-col :span="1.5">
<el-button
type="primary"
type="success"
plain
size="mini"
:disabled="multiple"
@click="passAll"
>批量通过</el-button
:loading="passLoading"
>确认入库</el-button
>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
@ -264,7 +264,7 @@
:disabled="multiple"
>批量不通过</el-button
>
</el-col>
</el-col> -->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
@ -279,8 +279,8 @@
<el-table
v-loading="loading"
:data="detailTableList"
@selection-change="handleSelectionChange"
border
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
@ -345,7 +345,7 @@
</template>
</el-table-column>
<el-table-column
<!-- <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
@ -363,25 +363,19 @@
<el-button
size="mini"
type="text"
v-if="
scope.row.status == '0' &&
scope.row.userIds.includes(userId)
"
v-if="scope.row.status == '0'"
@click="pass(scope.row)"
>通过</el-button
>
<el-button
size="mini"
type="text"
v-if="
scope.row.status == '0' &&
scope.row.userIds.includes(userId)
"
v-if="scope.row.status == '0'"
@click="refused(scope.row)"
>不通过</el-button
>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<pagination
@ -612,6 +606,7 @@ export default {
],
},
userId: sessionStorage.getItem('userId'),
passLoading: false, // loading
}
},
created() {
@ -718,6 +713,8 @@ export default {
inputNum: row.checkNum,
maCode: row.maCode,
typeId: row.typeId,
num: row.num,
manageType: row.manageType,
}
let param = {
@ -727,17 +724,28 @@ export default {
}
changePutinStatus(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.$modal.msgSuccess('入库成功')
this.open = false
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
this.$modal.msgSuccess('入库失败')
}
})
},
passAll() {
console.log(this.query.taskId)
console.log(this.ids)
// const params = {
// pageNum: 1,
// pageSize: 9999,
// taskId: this.query.taskId,
// dictName: this.query.dictName,
// }
if (this.ids.length < 1) {
this.$message.error('请勾选需要入库的数据!')
return
}
this.ids.forEach((item) => {
item.taskId = this.query.taskId
item.typeId = item.typeId
@ -750,15 +758,24 @@ export default {
checkResult: '1',
inputRecordList: this.ids,
}
changePutinStatus(param).then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('审批成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('审批失败')
}
})
this.passLoading = true
changePutinStatus(param)
.then((response) => {
if (response.code == 200) {
this.$modal.msgSuccess('入库成功')
this.getDialogTable()
this.getList()
} else {
this.$modal.msgSuccess('入库失败')
}
})
.finally(() => {
this.passLoading = false
})
// getPutinDetailsList(params).then((res) => {
// let deviceList = res.rows
// })
},
//
refused(row) {
@ -771,6 +788,7 @@ export default {
maCode: row.maCode,
inputNum: row.checkNum,
typeId: row.typeId,
manageType: row.manageType,
}
let param = {

View File

@ -42,9 +42,9 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
// target: `http://192.168.2.151:48080`, //超
target: `http://192.168.2.135:49080`, //超
// target: `http://10.40.92.81:8080`, //韩/
target: `http://192.168.2.82:49080`,//旭/
// target: `http://192.168.2.82:49080`,//旭/
// target: `http://192.168.2.248:28080`, //帅
// target: `http://192.168.2.216:49080`, //福