From 663dbe4ddca1fa409e6acbc1f77d924c161b0c39 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 09 六月 2025 17:04:50 +0800
Subject: [PATCH] 提交一把订单

---
 company/src/components/business/OpearaCaseEntryWindow.vue |  757 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 389 insertions(+), 368 deletions(-)

diff --git a/company/src/components/business/OpearaCaseEntryWindow.vue b/company/src/components/business/OpearaCaseEntryWindow.vue
index b88bd92..dab49d4 100644
--- a/company/src/components/business/OpearaCaseEntryWindow.vue
+++ b/company/src/components/business/OpearaCaseEntryWindow.vue
@@ -11,8 +11,8 @@
                 <div class="box_item">
                     <div class="box_item_title">
                         <span>鍑洪櫓浜轰俊鎭�</span>
-                        <el-select v-model="ruleForm.status" style="width: 100px;" placeholder="璇烽�夋嫨">
-                            <el-option label="寰呯珛妗�" :value="2"></el-option>
+                        <el-select v-model="ruleForm.status" style="width: 100px;" placeholder="璇烽�夋嫨妗堜欢鐘舵��">
+                            <el-option label="宸叉姤妗�" :value="1"></el-option>
                             <el-option label="宸查��鍥�" :value="4"></el-option>
                             <el-option label="寰呭彈鐞�" :value="5"></el-option>
                             <el-option label="宸叉嫆缁�" :value="6"></el-option>
@@ -51,6 +51,7 @@
                                 <el-date-picker
                                     v-model="ruleForm.extData.memberBirthday"
                                     type="date"
+                                    @change="changeMemberBirthday"
                                     placeholder="閫夋嫨鏃ユ湡"
                                     format="yyyy 骞� MM 鏈� dd 鏃�"
                                     value-format="yyyy-MM-dd">
@@ -155,7 +156,7 @@
                                             <span>{{ item.name }}</span>
                                         </div>
                                     </div>
-                                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 7)" />
+                                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 7)" />
                                 </div>
                             </el-form-item>
                         </div>
@@ -182,20 +183,20 @@
                             </el-form-item>
                         </div>
                         <div class="box_item_list_row">
-                            <el-form-item label="鎶ユ鏃堕棿" prop="happenTime">
+                            <el-form-item label="鎶ユ鏃堕棿" prop="reportDate">
                                 <el-date-picker
-                                    v-model="ruleForm.happenTime"
+                                    v-model="ruleForm.extData.reportDate"
                                     type="date"
                                     placeholder="閫夋嫨鏃ユ湡"
-                                    format="yyyy-MM-dd"
-                                    value-format="yyyy-MM-dd">
+                                    format="yyyy-MM-dd HH:mm:ss"
+                                    value-format="yyyy-MM-dd HH:mm:ss">
                                 </el-date-picker>
                             </el-form-item>
                         </div>
                         <div class="box_item_list_row">
-                            <el-form-item label="鍑洪櫓鏃堕棿" prop="createDate">
+                            <el-form-item label="鍑洪櫓鏃堕棿" prop="happenTime">
                                 <el-date-picker
-                                    v-model="ruleForm.createDate"
+                                    v-model="ruleForm.happenTime"
                                     type="datetime"
                                     placeholder="閫夋嫨鏃ユ湡"
                                     format="yyyy-MM-dd hh:mm:ss"
@@ -227,8 +228,8 @@
                                     v-model="ruleForm.extData.logoffDate"
                                     type="date"
                                     placeholder="閫夋嫨鏃ユ湡"
-                                    format="yyyy 骞� MM 鏈� dd 鏃�"
-                                    value-format="yyyy-MM-dd">
+                                    format="yyyy-MM-dd HH:mm:ss"
+                                    value-format="yyyy-MM-dd HH:mm:ss">
                                 </el-date-picker>
                             </el-form-item>
                         </div>
@@ -295,7 +296,7 @@
                                             <span>{{ item.name }}</span>
                                         </div>
                                     </div>
-                                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 6)" />
+                                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 6)" />
                                 </div>
                             </el-form-item>
                         </div>
@@ -603,7 +604,7 @@
                                         <span>{{ item.name }}</span>
                                     </div>
                                 </div>
-                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 1)" />
+                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 1)" />
                             </div>
                         </div>
                         <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;">
@@ -627,7 +628,7 @@
                                         <span>{{ item.name }}</span>
                                     </div>
                                 </div>
-                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 2)" />
+                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 2)" />
                             </div>
                         </div>
                         <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;">
@@ -651,7 +652,7 @@
                                         <span>{{ item.name }}</span>
                                     </div>
                                 </div>
-                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 3)" />
+                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 3)" />
                             </div>
                         </div>
                         <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;">
@@ -675,7 +676,7 @@
                                         <span>{{ item.name }}</span>
                                     </div>
                                 </div>
-                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 4)" />
+                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 4)" />
                             </div>
                         </div>
                         <div class="box_item_list_row" style="width: 100%; margin-bottom: 30px;">
@@ -699,7 +700,7 @@
                                         <span>{{ item.name }}</span>
                                     </div>
                                 </div>
-                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="SETTLE_FILE" @success="claimsUploadFile($event, 5)" />
+                                <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 5)" />
                             </div>
                         </div>
                     </div>
@@ -710,368 +711,388 @@
 </template>
 
 <script>
-    import BaseOpera from '@/components/base/BaseOpera'
-    import GlobalWindow from '@/components/common/GlobalWindow'
-    import upload from '@/components/common/upload'
-    import { getCompensation } from '@/api/business/settleRisk'
-    import { createSys } from '@/api/business/settleClaims'
-    import { findById } from '@/api/business/settleClaimsMovement'
-    export default {
-        name: 'OpearaCaseEntryWindow',
-        extends: BaseOpera,
-        components: { GlobalWindow, upload },
-        data () {
-            return {
-                ruleForm: {
-                    id: null,
-                    extData: {
-                        memberName: '',
-                        memberIdcardType: '',
-                        memberIdcard: '',
-                        memberBirthday: '',
-                        memberAge: '',
-                        memberSex: 0,
-                        memberPhone: '',
-                        memberAddr: '',
-                        bxName: '',
-                        bxCode: '',
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import upload from '@/components/common/upload'
+import { getCompensation } from '@/api/business/settleRisk'
+import { createSys } from '@/api/business/settleClaims'
+import { findById } from '@/api/business/settleClaimsMovement'
+export default {
+  name: 'OpearaCaseEntryWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow, upload },
+  data () {
+    return {
+      ruleForm: {
+        id: null,
+        extData: {
+          memberName: '',
+          memberIdcardType: '',
+          memberIdcard: '',
+          memberBirthday: '',
+          memberAge: '',
+          memberSex: 0,
+          memberPhone: '',
+          memberAddr: '',
+          bxName: '',
+          bxCode: '',
+          reportDate:null,
+          bxDate: [],
+          bxStartdate: '',
+          bxEnddate: '',
+          bxTbName: '',
+          bxBbName: '',
+          bxOrg: '',
+          bxYsMoney: '',
+          bxSsMoney: '',
 
-                        bxDate: [],
-                        bxStartdate: '',
-                        bxEnddate: '',
-                        bxTbName: '',
-                        bxBbName: '',
-                        bxOrg: '',
-                        bxYsMoney: '',
-                        bxSsMoney: '',
+          rsAttr: '',
+          rsInfo: '',
+          rsZlStatus: '',
+          rsLossMoney: '',
+          rsJzInfo: '',
+          rsCyDate: '',
+          rsYlOrg: '',
+          rsDeathDate: '',
 
-                        rsAttr: '',
-                        rsInfo: '',
-                        rsZlStatus: '',
-                        rsLossMoney: '',
-                        rsJzInfo: '',
-                        rsCyDate: '',
-                        rsYlOrg: '',
-                        rsDeathDate: '',
+          jzHospital: '',
+          jzZyCode: '',
+          jzZyKs: '',
+          jzZyDate: '',
+          jzCyDate: '',
+          jzZyDays: '',
 
-                        jzHospital: '',
-                        jzZyCode: '',
-                        jzZyKs: '',
-                        jzZyDate: '',
-                        jzCyDate: '',
-                        jzZyDays: '',
+          zdZlInfo: '',
+          zdSqInfo: '',
+          zdLczd: '',
+          zdSsName: '',
+          zdHxProject: '',
+          zdJwb: '',
 
-                        zdZlInfo: '',
-                        zdSqInfo: '',
-                        zdLczd: '',
-                        zdSsName: '',
-                        zdHxProject: '',
-                        zdJwb: '',
+          hzBdhCl: '',
+          hzDutyRate: '',
 
-                        hzBdhCl: '',
-                        hzDutyRate: '',
+          jdInfo: '',
+          jdChannel: '',
+          jdOrg: '',
+          jdUser: '',
+          jdPdDate: '',
+          jdScLevel: '',
+          jdTerms: '',
+          jdXishu: '',
+          jdJsldht: 1,
+          jdZrpctkRel: 0,
 
-                        jdInfo: '',
-                        jdChannel: '',
-                        jdOrg: '',
-                        jdUser: '',
-                        jdPdDate: '',
-                        jdScLevel: '',
-                        jdTerms: '',
-                        jdXishu: '',
-                        jdJsldht: 1,
-                        jdZrpctkRel: 0,
-
-                        logoff: 1,
-                        logoffUser: '',
-                        logoffDate: ''
-                    },
-                    informantName: '',
-                    informantPhone: '',
-                    reportNum: '',
-                    areaInfo: '',
-                    type: 0,
-                    hospital: '',
-                    inHospital: 1,
-                    hurtType: 0,
-                    payForYbwyy: 1,
-
-                    relationFileList: [],
-                    outpatientFileList: [],
-                    hospitalFileList: [],
-                    disabilityFileList: [],
-                    otherFileList: [],
-                    reportFileList: [],
-
-                    accountList: [],
-                    dzbdFileList: [],
-
-                    status: '',
-                    medicalInsurance: 1,
-                    content: '',
-                    happenTime: '',
-                    createDate: ''
-                },
-                rules: {
-                    'extData.memberName': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.memberIdcardType': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.memberIdcard': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.memberSex': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.memberPhone': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.bxName': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.bxCode': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.bxDate': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.bxTbName': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.bxBbName': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    'extData.bxOrg': [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ],
-                    informantPhone: [
-                        { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
-                    ]
-                },
-                uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload?folder=SETTLE_FILE',
-                totalPrice: 0,
-                list1: [],
-                list2: [],
-                list3: [],
-            }
+          logoff: 1,
+          logoffUser: '',
+          logoffDate: ''
         },
-        created () {
-            this.config({
-                api: '/business/company',
-                'field.id': 'id'
-            })
-        },
-        methods: {
-            open (title, id) {
-                this.title = title
-                if (id) {
-                    findById(id)
-                        .then(res => {
-                            console.log(res)
-                            this.ruleForm.id = id
-                            this.$nextTick(() => {
-                                for (const key in this.ruleForm) {
-                                    this.ruleForm[key] = res[key]
-                                }
-                                if (this.ruleForm.accountList && this.ruleForm.accountList.length > 0) {
-                                    this.list1 = this.ruleForm.accountList.filter(item => item.type === 0)
-                                    this.list2 = this.ruleForm.accountList.filter(item => item.type === 1)
-                                    this.list3 = this.ruleForm.accountList.filter(item => item.type === 2)
-                                    this.changeFee()
-                                }
-                                if (res.extData.bxStartdate && res.extData.bxEnddate) {
-                                    this.ruleForm.extData.bxDate = [res.extData.bxStartdate, res.extData.bxEnddate]
-                                }
-                            })
-                            this.visible = true
-                        })
-                } else {
-                    this.visible = true
-                    this.ruleForm = {
-                        id: null,
-                        extData: {
-                            memberName: '',
-                            memberIdcardType: '',
-                            memberIdcard: '',
-                            memberBirthday: '',
-                            memberAge: '',
-                            memberSex: 0,
-                            memberPhone: '',
-                            memberAddr: '',
-                            bxName: '',
-                            bxCode: '',
+        informantName: '',
+        informantPhone: '',
+        reportNum: '',
+        areaInfo: '',
+        type: 0,
+        hospital: '',
+        inHospital: 1,
+        hurtType: 0,
+        payForYbwyy: 1,
 
-                            bxDate: [],
-                            bxStartdate: '',
-                            bxEnddate: '',
-                            bxTbName: '',
-                            bxBbName: '',
-                            bxOrg: '',
-                            bxYsMoney: '',
-                            bxSsMoney: '',
+        relationFileList: [],
+        outpatientFileList: [],
+        hospitalFileList: [],
+        disabilityFileList: [],
+        otherFileList: [],
+        reportFileList: [],
 
-                            rsAttr: '',
-                            rsInfo: '',
-                            rsZlStatus: '',
-                            rsLossMoney: '',
-                            rsJzInfo: '',
-                            rsCyDate: '',
-                            rsYlOrg: '',
-                            rsDeathDate: '',
+        accountList: [],
+        dzbdFileList: [],
 
-                            jzHospital: '',
-                            jzZyCode: '',
-                            jzZyKs: '',
-                            jzZyDate: '',
-                            jzCyDate: '',
-                            jzZyDays: '',
-
-                            zdZlInfo: '',
-                            zdSqInfo: '',
-                            zdLczd: '',
-                            zdSsName: '',
-                            zdHxProject: '',
-                            zdJwb: '',
-
-                            hzBdhCl: '',
-                            hzDutyRate: '',
-
-                            jdInfo: '',
-                            jdChannel: '',
-                            jdOrg: '',
-                            jdUser: '',
-                            jdPdDate: '',
-                            jdScLevel: '',
-                            jdTerms: '',
-                            jdXishu: '',
-                            jdJsldht: 1,
-                            jdZrpctkRel: 0,
-
-                            logoff: 1,
-                            logoffUser: '',
-                            logoffDate: ''
-                        },
-                        informantName: '',
-                        informantPhone: '',
-                        reportNum: '',
-                        areaInfo: '',
-                        type: 0,
-                        hospital: '',
-                        inHospital: 1,
-                        hurtType: 0,
-                        payForYbwyy: 1,
-
-                        relationFileList: [],
-                        outpatientFileList: [],
-                        hospitalFileList: [],
-                        disabilityFileList: [],
-                        otherFileList: [],
-                        reportFileList: [],
-
-                        accountList: [],
-                        dzbdFileList: [],
-
-                        status: '',
-                        medicalInsurance: 1,
-                        content: '',
-                        happenTime: '',
-                        createDate: ''
-                    }
-                }
-                this.getCompensations()
-            },
-            confirm() {
-                this.$refs.ruleForm.validate((valid) => {
-                    if (!valid) return
-                    this.isWorking = true
-                    let obj = JSON.parse(JSON.stringify(this.ruleForm))
-                    obj.accountList = [...this.list1, ...this.list2, ...this.list3]
-                    createSys(obj)
-                        .then(() => {
-                            this.visible = false
-                            if (!obj.id) {
-                                this.$tip.apiSuccess('鏂板缓鎴愬姛')
-                            } else {
-                                this.$tip.apiSuccess('缂栬緫鎴愬姛')
-                            }
-                            this.$emit('success')
-                        })
-                        .catch(e => {
-                            this.$tip.apiFailed(e)
-                        })
-                        .finally(() => {
-                            this.isWorking = false
-                        })
-                })
-            },
-            changeFee() {
-                let arr = [...this.list1, ...this.list2]
-                let price = 0
-                arr.forEach(item => {
-                    if (item.fee) {
-                        price += Number(item.fee)
-                    }
-                })
-                this.totalPrice = price
-            },
-            delFile (index, type) {
-                if (type === 1) {
-                    this.ruleForm.relationFileList.splice(index, 1)
-                } else if (type === 2) {
-                    this.ruleForm.outpatientFileList.splice(index, 1)
-                } else if (type === 3) {
-                    this.ruleForm.hospitalFileList.splice(index, 1)
-                } else if (type === 4) {
-                    this.ruleForm.disabilityFileList.splice(index, 1)
-                } else if (type === 5) {
-                    this.ruleForm.otherFileList.splice(index, 1)
-                } else if (type === 6) {
-                    this.ruleForm.reportFileList.splice(index, 1)
-                } else if (type === 7) {
-                    this.ruleForm.dzbdFileList.splice(index, 1)
-                }
-            },
-            claimsUploadFile(file, type) {
-                file.fileurl = file.imgaddr
-                file.name = file.originname
-                if (type === 1) {
-                    this.ruleForm.relationFileList.push(file)
-                } else if (type === 2) {
-                    this.ruleForm.outpatientFileList.push(file)
-                } else if (type === 3) {
-                    this.ruleForm.hospitalFileList.push(file)
-                } else if (type === 4) {
-                    this.ruleForm.disabilityFileList.push(file)
-                } else if (type === 5) {
-                    this.ruleForm.otherFileList.push(file)
-                } else if (type === 6) {
-                    this.ruleForm.reportFileList.push(file)
-                } else if (type === 7) {
-                    this.ruleForm.dzbdFileList.push(file)
-                }
-            },
-            changeBxDate(e) {
-                if (e.length > 1) {
-                    this.ruleForm.extData.bxStartdate = e[0]
-                    this.ruleForm.extData.bxEnddate = e[1]
-                } else {
-                    this.ruleForm.extData.bxStartdate = ''
-                    this.ruleForm.extData.bxEnddate = ''
-                }
-            },
-            getCompensations() {
-                getCompensation({ type: 1 })
-                    .then(res => {
-                        console.log(res)
-                        this.list1 = res.filter(item => item.type === 0)
-                        this.list2 = res.filter(item => item.type === 1)
-                        this.list3 = res.filter(item => item.type === 2)
-                    })
-            }
-        }
+        status: '',
+        medicalInsurance: 1,
+        content: '',
+        happenTime: '',
+        createDate: ''
+      },
+      rules: {
+        'extData.memberName': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.memberIdcardType': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.memberIdcard': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.memberSex': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.memberPhone': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.bxName': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.bxCode': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.bxDate': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.bxTbName': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.bxBbName': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        'extData.bxOrg': [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
+        informantPhone: [
+          { required: true, message: '涓嶈兘涓虹┖', trigger: 'blur' }
+        ]
+      },
+      uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload?folder=settle',
+      totalPrice: 0,
+      list1: [],
+      list2: [],
+      list3: []
     }
+  },
+  created () {
+    this.config({
+      api: '/business/company',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    open (title, id) {
+      this.title = title
+      if (id) {
+        findById(id)
+          .then(res => {
+            console.log(res)
+            this.ruleForm.id = id
+            this.$nextTick(() => {
+              for (const key in this.ruleForm) {
+                this.ruleForm[key] = res[key]
+              }
+              if (this.ruleForm.accountList && this.ruleForm.accountList.length > 0) {
+                this.list1 = this.ruleForm.accountList.filter(item => item.type === 0)
+                this.list2 = this.ruleForm.accountList.filter(item => item.type === 1)
+                this.list3 = this.ruleForm.accountList.filter(item => item.type === 2)
+                this.changeFee()
+              }
+              if (res.extData.bxStartdate && res.extData.bxEnddate) {
+                this.ruleForm.extData.bxDate = [res.extData.bxStartdate, res.extData.bxEnddate]
+              }
+            })
+            this.visible = true
+          })
+      } else {
+        this.visible = true
+        this.ruleForm = {
+          id: null,
+          extData: {
+            memberName: '',
+            memberIdcardType: '',
+            memberIdcard: '',
+            memberBirthday: '',
+            memberAge: '',
+            memberSex: 0,
+            memberPhone: '',
+            memberAddr: '',
+            bxName: '',
+            bxCode: '',
+
+            bxDate: [],
+            bxStartdate: '',
+            bxEnddate: '',
+            bxTbName: '',
+            bxBbName: '',
+            bxOrg: '',
+            bxYsMoney: '',
+            bxSsMoney: '',
+
+            rsAttr: '',
+            rsInfo: '',
+            rsZlStatus: '',
+            rsLossMoney: '',
+            rsJzInfo: '',
+            rsCyDate: '',
+            rsYlOrg: '',
+            rsDeathDate: '',
+
+            jzHospital: '',
+            jzZyCode: '',
+            jzZyKs: '',
+            jzZyDate: '',
+            jzCyDate: '',
+            jzZyDays: '',
+
+            zdZlInfo: '',
+            zdSqInfo: '',
+            zdLczd: '',
+            zdSsName: '',
+            zdHxProject: '',
+            zdJwb: '',
+
+            hzBdhCl: '',
+            hzDutyRate: '',
+
+            jdInfo: '',
+            jdChannel: '',
+            jdOrg: '',
+            jdUser: '',
+            jdPdDate: '',
+            jdScLevel: '',
+            jdTerms: '',
+            jdXishu: '',
+            jdJsldht: 1,
+            jdZrpctkRel: 0,
+
+            logoff: 1,
+            logoffUser: '',
+            logoffDate: ''
+          },
+          informantName: '',
+          informantPhone: '',
+          reportNum: '',
+          areaInfo: '',
+          type: 0,
+          hospital: '',
+          inHospital: 1,
+          hurtType: 0,
+          payForYbwyy: 1,
+
+          relationFileList: [],
+          outpatientFileList: [],
+          hospitalFileList: [],
+          disabilityFileList: [],
+          otherFileList: [],
+          reportFileList: [],
+
+          accountList: [],
+          dzbdFileList: [],
+
+          status: '',
+          medicalInsurance: 1,
+          content: '',
+          happenTime: '',
+          createDate: ''
+        }
+      }
+      this.getCompensations()
+    },
+      changeMemberBirthday(e) {
+          if (!e) {
+              this.ruleForm.extData.memberAge = ''
+          } else {
+              this.ruleForm.extData.memberAge = this.calculateAge(e)
+          }
+      },
+      calculateAge(birthDate) {
+          const today = new Date();
+          const birthDateObject = new Date(birthDate);
+
+          let age = today.getFullYear() - birthDateObject.getFullYear();
+          const monthDiff = today.getMonth() - birthDateObject.getMonth();
+
+          if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDateObject.getDate())) {
+              age--;
+          }
+
+          return age;
+      },
+    confirm () {
+      this.$refs.ruleForm.validate((valid) => {
+        if (!valid) return
+        this.isWorking = true
+        const obj = JSON.parse(JSON.stringify(this.ruleForm))
+        obj.accountList = [...this.list1, ...this.list2, ...this.list3]
+        createSys(obj)
+          .then(() => {
+            this.visible = false
+            if (!obj.id) {
+              this.$tip.apiSuccess('鏂板缓鎴愬姛')
+            } else {
+              this.$tip.apiSuccess('缂栬緫鎴愬姛')
+            }
+            this.$emit('success')
+          })
+          .catch(e => {
+            this.$tip.apiFailed(e)
+          })
+          .finally(() => {
+            this.isWorking = false
+          })
+      })
+    },
+    changeFee () {
+      const arr = [...this.list1, ...this.list2]
+      let price = 0
+      arr.forEach(item => {
+        if (item.fee) {
+          price += Number(item.fee)
+        }
+      })
+      this.totalPrice = price
+    },
+    delFile (index, type) {
+      if (type === 1) {
+        this.ruleForm.relationFileList.splice(index, 1)
+      } else if (type === 2) {
+        this.ruleForm.outpatientFileList.splice(index, 1)
+      } else if (type === 3) {
+        this.ruleForm.hospitalFileList.splice(index, 1)
+      } else if (type === 4) {
+        this.ruleForm.disabilityFileList.splice(index, 1)
+      } else if (type === 5) {
+        this.ruleForm.otherFileList.splice(index, 1)
+      } else if (type === 6) {
+        this.ruleForm.reportFileList.splice(index, 1)
+      } else if (type === 7) {
+        this.ruleForm.dzbdFileList.splice(index, 1)
+      }
+    },
+    claimsUploadFile (file, type) {
+      file.fileurl = file.imgaddr
+      file.name = file.originname
+      if (type === 1) {
+        this.ruleForm.relationFileList.push(file)
+      } else if (type === 2) {
+        this.ruleForm.outpatientFileList.push(file)
+      } else if (type === 3) {
+        this.ruleForm.hospitalFileList.push(file)
+      } else if (type === 4) {
+        this.ruleForm.disabilityFileList.push(file)
+      } else if (type === 5) {
+        this.ruleForm.otherFileList.push(file)
+      } else if (type === 6) {
+        this.ruleForm.reportFileList.push(file)
+      } else if (type === 7) {
+        this.ruleForm.dzbdFileList.push(file)
+      }
+    },
+    changeBxDate (e) {
+      if (e.length > 1) {
+        this.ruleForm.extData.bxStartdate = e[0]
+        this.ruleForm.extData.bxEnddate = e[1]
+      } else {
+        this.ruleForm.extData.bxStartdate = ''
+        this.ruleForm.extData.bxEnddate = ''
+      }
+    },
+    getCompensations () {
+      getCompensation({ type: 1 })
+        .then(res => {
+          console.log(res)
+          this.list1 = res.filter(item => item.type === 0)
+          this.list2 = res.filter(item => item.type === 1)
+          this.list3 = res.filter(item => item.type === 2)
+        })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

--
Gitblit v1.9.3