From da2f967549510050954682c0372927647257fb11 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 26 五月 2025 18:15:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1
---
company/src/components/business/adjustment.vue | 108 ++++++++++++++++++++++++++++++++++-------------------
1 files changed, 69 insertions(+), 39 deletions(-)
diff --git a/company/src/components/business/adjustment.vue b/company/src/components/business/adjustment.vue
index 3a87412..03fef14 100644
--- a/company/src/components/business/adjustment.vue
+++ b/company/src/components/business/adjustment.vue
@@ -2,13 +2,13 @@
<GlobalWindow
:title="title"
width="100%"
- :text="`${type === 1 ? '瀹屾垚鐞嗙畻' : '瀹屾垚鏍歌禂'}`"
+ :text="`${title === '淇敼閲戦' ? '鎻愪氦' : type === 1 ? '瀹屾垚鐞嗙畻' : '瀹屾垚鏍歌禂'}`"
:visible.sync="visible"
:confirm-working="isWorking"
@confirm="confirm"
>
<div class="box">
- <el-form :model="form" ref="ruleForm" label-width="150px" class="demo-ruleForm">
+ <el-form :model="form" ref="form" :rules="rules" label-width="150px" class="demo-ruleForm">
<div class="box_item">
<div class="box_item_desc">涓昏璧斾粯椤�</div>
<div class="box_item_list">
@@ -37,6 +37,9 @@
<span>楼{{totalPrice}}</span>
</div>
</div>
+ <el-form-item label="淇敼璇存槑" prop="describe" v-if="title === '淇敼閲戦'">
+ <el-input v-model="form.describe" placeholder="璇疯緭鍏�" type="textarea" row="5"></el-input>
+ </el-form-item>
</el-form>
</div>
</GlobalWindow>
@@ -45,7 +48,7 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
- import { compensation, getCompensation, nuclearCompensation } from '@/api/business/settleRisk'
+ import { compensation, getCompensation, nuclearCompensation, updFee } from '@/api/business/settleRisk'
export default {
name: 'acceptance',
extends: BaseOpera,
@@ -53,7 +56,13 @@
data () {
return {
form: {
- id: null
+ id: null,
+ describe: ''
+ },
+ rules: {
+ describe: [
+ { required: true, message: '淇敼璇存槑涓嶈兘涓虹┖', trigger: 'blur' }
+ ]
},
type: '',
list1: [],
@@ -66,6 +75,9 @@
this.type = type
this.title = title
this.form.id = id
+ this.$nextTick(() => {
+ this.$refs.form.resetFields();
+ })
getCompensation({ type, id: this.form.id })
.then(res => {
res.forEach(item => {
@@ -90,42 +102,60 @@
this.totalPrice = price
},
confirm() {
- let arr = [...this.list1, ...this.list2]
- for (let i = 0; i < arr.length; i++) {
- if (!arr[i].fee && arr[i].fee !== 0) {
- return this.$message.warning(`璇峰厛瀹屽杽${arr[i].name}閲戦`)
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ let arr = [...this.list1, ...this.list2]
+ for (let i = 0; i < arr.length; i++) {
+ if (!arr[i].fee && arr[i].fee !== 0) {
+ return this.$message.warning(`璇峰厛瀹屽杽${arr[i].name}閲戦`)
+ }
+ }
+ this.isWorking = true
+ let compensationJson = JSON.stringify(arr)
+ if (this.title === '淇敼閲戦') {
+ updFee({ id: this.form.id, compensationJson, describe: this.form.describe })
+ .then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ this.$emit('success')
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
+ return
+ }
+ if (this.type === 1) {
+ compensation({ id: this.form.id, compensationJson })
+ .then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ this.$emit('success')
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
+ } else if (this.type === 2) {
+ nuclearCompensation({ id: this.form.id, compensationJson })
+ .then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ this.$emit('success')
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
+ }
}
- }
- this.isWorking = true
- let compensationJson = JSON.stringify(arr)
- if (this.type === 1) {
- compensation({ id: this.form.id, compensationJson })
- .then(() => {
- this.visible = false
- this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
- this.$emit('success')
- })
- .catch(e => {
- this.$tip.apiFailed(e)
- })
- .finally(() => {
- this.isWorking = false
- })
- } else if (this.type === 2) {
- nuclearCompensation({ id: this.form.id, compensationJson })
- .then(() => {
- this.visible = false
- this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
- this.$emit('success')
- })
- .catch(e => {
- this.$tip.apiFailed(e)
- })
- .finally(() => {
- this.isWorking = false
- })
- }
-
+ });
}
}
}
--
Gitblit v1.9.3