Browse Source

完善维修单结算

master
yunuo970428 6 months ago
parent
commit
8d65b89150
  1. 72
      yxt-as-ui/src/views/operation/settleAccounts/settleAccountsAdd.vue
  2. 70
      yxt-as-ui/src/views/workFlow/jiesuanFlow/settleAccountsEdit.vue

72
yxt-as-ui/src/views/operation/settleAccounts/settleAccountsAdd.vue

@ -102,11 +102,11 @@
<el-row>
<el-col :span="12">
<div class="span-sty">成本合计</div>
<el-form-item><span class="addinputInfo">{{ formobj.costAmount }}</span></el-form-item>
<el-form-item><span class="addinputInfo">{{ totalCost }}</span></el-form-item>
</el-col>
<el-col :span="12">
<div class="span-sty">利润额</div>
<el-form-item><span class="addinputInfo">{{ formobj.profit }}</span></el-form-item>
<el-form-item><span class="addinputInfo">{{ amountOfProfit }}</span></el-form-item>
</el-col>
</el-row>
<div class="title">维修项目</div>
@ -247,8 +247,6 @@ export default {
viewTitle: '',
viewState: 1,
submitdisabled: false,
totalCost: '', // ()
amountOfProfit: '', // ()
tableKey: 0,
index: 0,
// service
@ -314,6 +312,56 @@ export default {
rules: {}
}
},
computed: {
// -- = + + ( + + + )
totalCost() {
let cost = '0'
//
if (this.formobj.sitemVos.length > 0) {
this.formobj.sitemVos.forEach((e) => {
cost = Math.round((parseFloat(cost) + parseFloat(e.sitemCost !== '' ? e.sitemCost : 0)) * 100) / 100
})
}
//
if (this.formobj.goodsDetailsVos.length > 0) {
this.formobj.goodsDetailsVos.forEach((e) => {
cost = Math.round((parseFloat(cost) + parseFloat(e.goodsCost !== '' ? e.goodsCost : 0)) * 100) / 100
})
}
//
if (this.formobj.aitemVos.length > 0) {
this.formobj.aitemVos.forEach((e) => {
cost = Math.round((parseFloat(cost) + parseFloat(e.aitemCost !== '' ? e.aitemCost : 0)) * 100) / 100
})
}
cost = Math.round((parseFloat(cost) + parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0) + parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0) + parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100
return cost
},
// -- = + + ( + + + )
amountOfProfit() {
let print = '0'
//
if (this.formobj.sitemVos.length > 0) {
this.formobj.sitemVos.forEach((e) => {
print = Math.round((parseFloat(print) + parseFloat(e.sitemPrint !== '' ? e.sitemPrint : 0)) * 100) / 100
})
}
//
if (this.formobj.goodsDetailsVos.length > 0) {
this.formobj.goodsDetailsVos.forEach((e) => {
print = Math.round((parseFloat(print) + parseFloat(e.goodsPrint !== '' ? e.goodsPrint : 0)) * 100) / 100
})
}
//
if (this.formobj.aitemVos.length > 0) {
this.formobj.aitemVos.forEach((e) => {
print = Math.round((parseFloat(print) + parseFloat(e.aitemPrint !== '' ? e.aitemPrint : 0)) * 100) / 100
})
}
print = Math.round((parseFloat(print) + parseFloat(this.formobj.outPrint !== '' ? this.formobj.outPrint : 0) + parseFloat(this.formobj.subsidyPrint !== '' ? this.formobj.subsidyPrint : 0) + parseFloat(this.formobj.rescuePrint !== '' ? this.formobj.rescuePrint : 0)) * 100) / 100
return print
}
},
methods: {
getNumber(val, limit) {
val = val.replace(/[^0-9.]/g, '') //
@ -341,8 +389,6 @@ export default {
req.busrepairbillInit({ sid: row.sid, userSid: window.sessionStorage.getItem('userSid'), orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
if (res.success) {
this.formobj = res.data
this.totalCost = this.formobj.costAmount
this.amountOfProfit = this.formobj.profit
}
})
},
@ -360,31 +406,23 @@ export default {
// -- -- = -
outPrintInput() {
this.formobj.outPrint = Math.round((parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : 0) - parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0)) * 100) / 100
this.costAmountAndPrint()
},
// -- -- = -
subsidyPrintInput() {
this.formobj.subsidyPrint = Math.round((parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : 0) - parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0)) * 100) / 100
this.costAmountAndPrint()
},
// -- -- = -
rescuePrintInput() {
this.formobj.rescuePrint = Math.round((parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : 0) - parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100
this.costAmountAndPrint()
},
handleOpen(value) {
window.open(value, '_blank')
},
// --
costAmountAndPrint() {
// = +
this.formobj.costAmount = Math.round((parseFloat(this.totalCost !== '' ? this.totalCost : 0) + parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0) + parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0) + parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100
// = +
this.formobj.profit = Math.round((parseFloat(this.amountOfProfit !== '' ? this.amountOfProfit : 0) + parseFloat(this.formobj.outPrint !== '' ? this.formobj.outPrint : 0) + parseFloat(this.formobj.subsidyPrint !== '' ? this.formobj.subsidyPrint : 0) + parseFloat(this.formobj.rescuePrint !== '' ? this.formobj.rescuePrint : 0)) * 100) / 100
},
submit() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.formobj.costAmount = this.totalCost
this.formobj.profit = this.amountOfProfit
this.submitdisabled = true
req.submit(this.formobj).then((res) => {
if (res.success) {
@ -457,8 +495,6 @@ export default {
taskId: '',
instanceId: ''
}
this.totalCost = ''
this.amountOfProfit = ''
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')

70
yxt-as-ui/src/views/workFlow/jiesuanFlow/settleAccountsEdit.vue

@ -101,11 +101,11 @@
<el-row>
<el-col :span="12">
<div class="span-sty">成本合计</div>
<el-form-item><span class="addinputInfo">{{ formobj.costAmount }}</span></el-form-item>
<el-form-item><span class="addinputInfo">{{ totalCost }}</span></el-form-item>
</el-col>
<el-col :span="12">
<div class="span-sty">利润额</div>
<el-form-item><span class="addinputInfo">{{ formobj.profit }}</span></el-form-item>
<el-form-item><span class="addinputInfo">{{ amountOfProfit }}</span></el-form-item>
</el-col>
</el-row>
<div class="title">维修项目</div>
@ -246,8 +246,6 @@ export default {
viewTitle: '',
viewState: 1,
submitdisabled: false,
totalCost: '', // ()
amountOfProfit: '', // ()
tableKey: 0,
index: 0,
// service
@ -330,6 +328,56 @@ export default {
}
}, '*')
},
computed: {
// -- = + + ( + + + )
totalCost() {
let cost = '0'
//
if (this.formobj.sitemVos.length > 0) {
this.formobj.sitemVos.forEach((e) => {
cost = Math.round((parseFloat(cost) + parseFloat(e.sitemCost !== '' ? e.sitemCost : 0)) * 100) / 100
})
}
//
if (this.formobj.goodsDetailsVos.length > 0) {
this.formobj.goodsDetailsVos.forEach((e) => {
cost = Math.round((parseFloat(cost) + parseFloat(e.goodsCost !== '' ? e.goodsCost : 0)) * 100) / 100
})
}
//
if (this.formobj.aitemVos.length > 0) {
this.formobj.aitemVos.forEach((e) => {
cost = Math.round((parseFloat(cost) + parseFloat(e.aitemCost !== '' ? e.aitemCost : 0)) * 100) / 100
})
}
cost = Math.round((parseFloat(cost) + parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0) + parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0) + parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100
return cost
},
// -- = + + ( + + + )
amountOfProfit() {
let print = '0'
//
if (this.formobj.sitemVos.length > 0) {
this.formobj.sitemVos.forEach((e) => {
print = Math.round((parseFloat(print) + parseFloat(e.sitemPrint !== '' ? e.sitemPrint : 0)) * 100) / 100
})
}
//
if (this.formobj.goodsDetailsVos.length > 0) {
this.formobj.goodsDetailsVos.forEach((e) => {
print = Math.round((parseFloat(print) + parseFloat(e.goodsPrint !== '' ? e.goodsPrint : 0)) * 100) / 100
})
}
//
if (this.formobj.aitemVos.length > 0) {
this.formobj.aitemVos.forEach((e) => {
print = Math.round((parseFloat(print) + parseFloat(e.aitemPrint !== '' ? e.aitemPrint : 0)) * 100) / 100
})
}
print = Math.round((parseFloat(print) + parseFloat(this.formobj.outPrint !== '' ? this.formobj.outPrint : 0) + parseFloat(this.formobj.subsidyPrint !== '' ? this.formobj.subsidyPrint : 0) + parseFloat(this.formobj.rescuePrint !== '' ? this.formobj.rescuePrint : 0)) * 100) / 100
return print
}
},
methods: {
getNumber(val, limit) {
val = val.replace(/[^0-9.]/g, '') //
@ -357,39 +405,29 @@ export default {
req.fetchBySid(sid).then((res) => {
if (res.success) {
this.formobj = res.data
this.totalCost = this.formobj.costAmount
this.amountOfProfit = this.formobj.profit
}
})
},
// -- -- = -
outPrintInput() {
this.formobj.outPrint = Math.round((parseFloat(this.formobj.outAmount !== '' ? this.formobj.outAmount : 0) - parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0)) * 100) / 100
this.costAmountAndPrint()
},
// -- -- = -
subsidyPrintInput() {
this.formobj.subsidyPrint = Math.round((parseFloat(this.formobj.subsidyAmount !== '' ? this.formobj.subsidyAmount : 0) - parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0)) * 100) / 100
this.costAmountAndPrint()
},
// -- -- = -
rescuePrintInput() {
this.formobj.rescuePrint = Math.round((parseFloat(this.formobj.rescueAmount !== '' ? this.formobj.rescueAmount : 0) - parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100
this.costAmountAndPrint()
},
handleOpen(value) {
window.open(value, '_blank')
},
// --
costAmountAndPrint() {
// = +
this.formobj.costAmount = Math.round((parseFloat(this.totalCost !== '' ? this.totalCost : 0) + parseFloat(this.formobj.outCost !== '' ? this.formobj.outCost : 0) + parseFloat(this.formobj.subsidyCost !== '' ? this.formobj.subsidyCost : 0) + parseFloat(this.formobj.rescueCost !== '' ? this.formobj.rescueCost : 0)) * 100) / 100
// = +
this.formobj.profit = Math.round((parseFloat(this.amountOfProfit !== '' ? this.amountOfProfit : 0) + parseFloat(this.formobj.outPrint !== '' ? this.formobj.outPrint : 0) + parseFloat(this.formobj.subsidyPrint !== '' ? this.formobj.subsidyPrint : 0) + parseFloat(this.formobj.rescuePrint !== '' ? this.formobj.rescuePrint : 0)) * 100) / 100
},
submit() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.formobj.costAmount = this.totalCost
this.formobj.profit = this.amountOfProfit
this.submitdisabled = true
req.submit(this.formobj).then((res) => {
if (res.success) {

Loading…
Cancel
Save