From d2bc6e096f0806b78ea92d4b90a21d3627d406c7 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 08 三月 2024 18:28:42 +0800
Subject: [PATCH] mrshi
---
company/src/components/enterprise/additionSubtractionApplication.vue | 142 +++++++++++++++++++++++++++++++++++------------
1 files changed, 106 insertions(+), 36 deletions(-)
diff --git a/company/src/components/enterprise/additionSubtractionApplication.vue b/company/src/components/enterprise/additionSubtractionApplication.vue
index 9a62700..d241b4e 100644
--- a/company/src/components/enterprise/additionSubtractionApplication.vue
+++ b/company/src/components/enterprise/additionSubtractionApplication.vue
@@ -78,7 +78,7 @@
<el-table-column
prop="currentFee"
align="center"
- label="浜х敓璐圭敤(鍏�)">
+ label="宸蹭骇鐢熻垂鐢�(鍏�)">
</el-table-column>
<el-table-column
prop="fee"
@@ -148,7 +148,7 @@
label="璐圭敤">
<template slot-scope="{row}">
<span v-if="activeName === '0'">{{row.fee}}</span>
- <span v-else>-{{row.fee}}</span>
+ <span v-else>{{row.fee ? '-' + row.fee : ''}}</span>
</template>
</el-table-column>
<el-table-column
@@ -171,6 +171,8 @@
<importEmployees ref="importEmployees" @result="getValue" />
<!-- 纭宸ョ -->
<confirmJobType ref="confirmJobType" @result="getUser" />
+ <!-- 璇︽儏 -->
+ <ApplyChangeDetails1 ref="ApplyChangeDetails1" @success="success" />
</GlobalWindow>
</template>
@@ -181,13 +183,16 @@
import addEmployee from '@/components/enterprise/addEmployee'
import importEmployees from '@/components/enterprise/importEmployees'
import confirmJobType from '@/components/enterprise/confirmJobType'
+ import ApplyChangeDetails1 from '@/components/business/ApplyChangeDetails1'
import { all } from '@/api/business/solutions'
import { getDetail } from '@/api/business/insuranceApply'
import { create, getChangeCountCyclePriceVO } from '@/api/business/applyChange'
+ import { getDate, compareDates, getTomorrow } from '@/utils/util'
+ import { mapState } from 'vuex'
export default {
name: 'additionSubtractionApplication',
extends: BaseOpera,
- components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType },
+ components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType, ApplyChangeDetails1 },
data () {
return {
form: {
@@ -214,6 +219,9 @@
},
list: []
}
+ },
+ computed: {
+ ...mapState(['userInfo'])
},
created () {
this.config({
@@ -279,16 +287,31 @@
getDetail(this.form.id)
.then(res => {
this.list.push(res)
+ this.item = res
this.endTime = res.endTime
this.form.solutionId = res.solutionId
this.form.solutionsName = res.solutionsName
this.pickerOptions = {
disabledDate(time) {
- // - 8.64e7
- return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date().getTime()
+ // 褰撳墠鏃ユ湡澶т簬绛変簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
+ if ([1,3].includes(compareDates(getDate(), res.startTime)) && !res.lastChangeDate) {
+ return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(getTomorrow()).getTime()
+ // 褰撳墠鏃ユ湡灏忎簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
+ } else if (compareDates(getDate(), res.startTime) === 2 && !res.lastChangeDate) {
+ return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(res.startTime).getTime()
+ // 鏈�鍚庝竴娆℃搷浣滄椂闂存湁鍊�
+ } else if (res.lastChangeDate) {
+ // 褰撳墠鏃ユ湡澶т簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+ if ([1,3].includes(compareDates(getDate(), res.lastChangeDate))) {
+ return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(getTomorrow()).getTime()
+ // 褰撳墠鏃堕棿灏忎簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+ } else if (compareDates(getDate(), res.lastChangeDate) === 2) {
+ return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(res.lastChangeDate).getTime()
+ }
+ }
}
};
- this.changeSolution1(res.solutionId)
+ // this.changeSolution1(res.solutionId)
})
},
getSummaries(param) {
@@ -304,13 +327,15 @@
this.form.addDetailList.forEach(item => {
total += item.fee
})
+ sums[index] = total
+ return
} else {
this.form.delDetailList.forEach(item => {
total += item.fee
})
+ sums[index] = '-' + total
+ return
}
- sums[index] = '-' + total
- return
}
})
return sums
@@ -338,6 +363,34 @@
})
}
},
+ success() {
+ this.form.addDetailList.forEach(item => {
+ item.idcardNo = item.idCard
+ })
+ this.form.delDetailList.forEach(item => {
+ item.idcardNo = item.idCard
+ })
+ // let arr = JSON.parse(JSON.stringify(this.form.addDetailList))
+ // arr.forEach(item => {
+ // item.idcardNo = item.idCard
+ // })
+ this.isWorking = true
+ create({
+ applyId: this.form.id,
+ addDetailList: this.form.addDetailList,
+ delDetailList: this.form.delDetailList,
+ validTime: this.form.applyStartTime,
+ type: 0
+ }).then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ this.$emit('success')
+ }).catch(e => {
+ this.$tip.apiFailed(e)
+ }).finally(() => {
+ this.isWorking = false
+ })
+ },
confirm() {
this.$refs.form.validate((valid) => {
if (valid) {
@@ -357,32 +410,44 @@
return
}
}
- this.form.addDetailList.forEach(item => {
- item.idcardNo = item.idCard
+
+ this.$refs.ApplyChangeDetails1.open('鍔犲噺淇濊鍗�', this.form.addDetailList, this.form.delDetailList, {
+ companyName: this.userInfo.company.name,
+ solutionsName: this.form.solutionsName,
+ code: this.list[0].code,
+ startTime: this.list[0].startTime,
+ endTime: this.list[0].endTime,
+ applyStartTime: this.form.applyStartTime
})
- this.form.delDetailList.forEach(item => {
- item.idcardNo = item.idCard
- })
- // let arr = JSON.parse(JSON.stringify(this.form.addDetailList))
- // arr.forEach(item => {
+
+ // return
+
+ // this.form.addDetailList.forEach(item => {
// item.idcardNo = item.idCard
// })
- this.isWorking = true
- create({
- applyId: this.form.id,
- addDetailList: this.form.addDetailList,
- delDetailList: this.form.delDetailList,
- validTime: this.form.applyStartTime,
- type: 0
- }).then(() => {
- this.visible = false
- this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
- this.$emit('success')
- }).catch(e => {
- this.$tip.apiFailed(e)
- }).finally(() => {
- this.isWorking = false
- })
+ // this.form.delDetailList.forEach(item => {
+ // item.idcardNo = item.idCard
+ // })
+ // // let arr = JSON.parse(JSON.stringify(this.form.addDetailList))
+ // // arr.forEach(item => {
+ // // item.idcardNo = item.idCard
+ // // })
+ // this.isWorking = true
+ // create({
+ // applyId: this.form.id,
+ // addDetailList: this.form.addDetailList,
+ // delDetailList: this.form.delDetailList,
+ // validTime: this.form.applyStartTime,
+ // type: 0
+ // }).then(() => {
+ // this.visible = false
+ // this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ // this.$emit('success')
+ // }).catch(e => {
+ // this.$tip.apiFailed(e)
+ // }).finally(() => {
+ // this.isWorking = false
+ // })
}
})
},
@@ -391,10 +456,14 @@
this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
return
}
+ if (!this.form.applyStartTime) {
+ this.$message.warning('璇峰厛閫夋嫨鎵瑰崟鐢熸晥璧锋湡')
+ return
+ }
if (this.activeName === '0') {
- this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.addDetailList, price: this.price, notInInsuranceApplyId: this.form.id })
+ this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.addDetailList, price: this.price, notInInsuranceApplyId: this.form.id, validTime: this.form.applyStartTime })
} else {
- this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id })
+ this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id, validTime: this.form.applyStartTime })
}
},
addUser() {
@@ -422,7 +491,9 @@
// 鍒囨崲鏂规
changeSolution1(e) {
this.company.forEach(item => {
+ console.log(item.id + '-----' + e)
if (item.id === e) {
+ console.log(item)
this.item = item
}
})
@@ -472,11 +543,11 @@
this.$message.warning('璇烽�夋嫨鍛樺伐')
return
}
- this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.form.solutionId })
+ this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.item.newVersionSolutionId })
},
// 鏌ヨ鍏ㄩ儴鏂规
getCompany() {
- all({})
+ all({ dataType: 2 })
.then(res => {
this.company = res
})
@@ -509,7 +580,6 @@
this.seleData = e.map(item => item.name)
},
getValue(list) {
- console.log(list)
if (this.activeName === '0') {
this.form.addDetailList.push(...list)
} else {
--
Gitblit v1.9.3