|
@@ -20,7 +20,7 @@ import { required, mobileRequired, mobile, httpUrl, email } from '@/components/t
|
|
import { listPageV2 } from "@/api/workOrder/settlementStandardInstall";
|
|
import { listPageV2 } from "@/api/workOrder/settlementStandardInstall";
|
|
import { listPageV2 as listPageV2Repair } from "@/api/workOrder/settlementStandardRepair";
|
|
import { listPageV2 as listPageV2Repair } from "@/api/workOrder/settlementStandardRepair";
|
|
import { listPageV2 as listPageV2Other } from "@/api/workOrder/settlementStandardOther";
|
|
import { listPageV2 as listPageV2Other } from "@/api/workOrder/settlementStandardOther";
|
|
-import { orderBaseSettleNormDetail, orderBaseSettleNormConfirm, settleNormInstallQuery, settleNormOtherQuery } from "@/api/workOrderPool.js";
|
|
|
|
|
|
+import { orderBaseSettleNormDetail, orderBaseSettleNormConfirm, settleNormInstallQuery, settleNormOtherQuery, orderBaseSettleNormReset } from "@/api/workOrderPool.js";
|
|
import { EventBus } from '@/utils/eventBus'
|
|
import { EventBus } from '@/utils/eventBus'
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
@@ -182,8 +182,8 @@ export default {
|
|
return prev + curr;
|
|
return prev + curr;
|
|
})
|
|
})
|
|
var nou = this.formData?.normList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "NO")
|
|
var nou = this.formData?.normList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "NO")
|
|
- var qian = ((((Number(this.formData.normList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
|
|
|
|
- var rongyu = ((Number(this.formData.normList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
|
|
|
|
|
|
+ var qian = ((((Number(this.formData?.normList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
|
|
|
|
+ var rongyu = ((Number(this.formData?.normList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
|
|
nou.map((item, index) => {
|
|
nou.map((item, index) => {
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
|
|
item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
|
|
@@ -197,7 +197,11 @@ export default {
|
|
}
|
|
}
|
|
{
|
|
{
|
|
this.formData.settleStatus == 'YJS' && this.formData?.normList[row.pfuqinid]?.workerList.find(item => item.poolStatus == "NO") ? (
|
|
this.formData.settleStatus == 'YJS' && this.formData?.normList[row.pfuqinid]?.workerList.find(item => item.poolStatus == "NO") ? (
|
|
- <el-button type="text">确定</el-button>
|
|
|
|
|
|
+ <el-button type="text" onClick={
|
|
|
|
+ () => {
|
|
|
|
+ this.itemOrderBaseSettleNormReset(this.formData?.normList[row.pfuqinid])
|
|
|
|
+ }
|
|
|
|
+ }>确定</el-button>
|
|
) : null
|
|
) : null
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
@@ -306,8 +310,8 @@ export default {
|
|
return prev + curr;
|
|
return prev + curr;
|
|
})
|
|
})
|
|
var nou = this.formData?.otherNormList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "NO")
|
|
var nou = this.formData?.otherNormList[row.pfuqinid]?.workerList.filter(item => item.poolStatus == "NO")
|
|
- var qian = ((((Number(this.formData.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
|
|
|
|
- var rongyu = ((Number(this.formData.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
|
|
|
|
|
|
+ var qian = ((((Number(this.formData?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) / nou.length) * 100) / 100).toFixed(2)
|
|
|
|
+ var rongyu = ((Number(this.formData?.otherNormList[row.pfuqinid]["settleAmount"]) - yjsje) - (qian * nou.length)).toFixed(2)
|
|
nou.map((item, index) => {
|
|
nou.map((item, index) => {
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
|
|
item.settleAmount = (Number(qian) + Number(rongyu)).toFixed(2)
|
|
@@ -321,7 +325,11 @@ export default {
|
|
}
|
|
}
|
|
{
|
|
{
|
|
this.formData.settleStatus == 'YJS' && this.formData?.otherNormList[row.pfuqinid]?.workerList.find(item => item.poolStatus == "NO") ? (
|
|
this.formData.settleStatus == 'YJS' && this.formData?.otherNormList[row.pfuqinid]?.workerList.find(item => item.poolStatus == "NO") ? (
|
|
- <el-button type="text">确定</el-button>
|
|
|
|
|
|
+ <el-button type="text" onClick={
|
|
|
|
+ () => {
|
|
|
|
+ this.itemOrderBaseSettleNormReset(this.formData?.otherNormList[row.pfuqinid])
|
|
|
|
+ }
|
|
|
|
+ }>确定</el-button>
|
|
) : null
|
|
) : null
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
@@ -1103,6 +1111,26 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ itemOrderBaseSettleNormReset(data) {
|
|
|
|
+ if (data.settleAmount <= 0) {
|
|
|
|
+ this.$message.warning('请先选择费用结算项!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (Number([0, 0, 0, ...data.workerList.map(item => Number(item.settleAmount))].reduce(function (prev, curr, idx, arr) {
|
|
|
|
+ return prev + curr;
|
|
|
|
+ })) !== Number(data.settleAmount)) {
|
|
|
|
+ this.$message.warning('师傅分配金额合计少于费用结算总金额!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ orderBaseSettleNormReset(data).then(res => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '结算成功'
|
|
|
|
+ })
|
|
|
|
+ this.init()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
init() {
|
|
init() {
|
|
if (this.id) {
|
|
if (this.id) {
|
|
orderBaseSettleNormDetail({
|
|
orderBaseSettleNormDetail({
|