From 02bc3bfe47e3d5311a0bb041c94e70a34b1ca73c Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 09 四月 2024 09:03:01 +0800
Subject: [PATCH] git ch

---
 company/src/components/business/OpearaUnionApply.vue |  313 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 188 insertions(+), 125 deletions(-)

diff --git a/company/src/components/business/OpearaUnionApply.vue b/company/src/components/business/OpearaUnionApply.vue
index 915a281..b76e31c 100644
--- a/company/src/components/business/OpearaUnionApply.vue
+++ b/company/src/components/business/OpearaUnionApply.vue
@@ -9,28 +9,31 @@
     >
         <div class="list">
             <el-form :inline="true" ref="form" :model="form" :rules="rules" class="demo-form-inline">
-                <el-form-item label="淇濋櫓鏂规" prop="solutionsId">
-                    <el-select v-model="form.solutionsId" @change="selectSolutions" placeholder="璇烽�夋嫨">
+                <el-form-item label="淇濋櫓鏂规锛�" prop="baseSolutionId">
+                  <div style="display: flex; flex-direction: column;">
+                    <el-select v-model="form.baseSolutionId" @change="selectSolutions" placeholder="璇烽�夋嫨">
                         <el-option
                             v-for="item in solutions"
-                            :key="item.baseId"
+                            :key="item.id"
                             :label="item.name"
-                            :value="item.baseId">
+                            :value="item.id">
                         </el-option>
                     </el-select>
+                  <span style="color: #F95601; font-size: 14px;">锛�1. 璇峰厛閫夋嫨鏂规鏌ョ湅鐢宠璁板綍锛�</span>
+                  </div>
                 </el-form-item>
-                <el-form-item label="淇濋櫓鐢熸晥璧锋鏈�" prop="applyStartTime">
+                <el-form-item label="淇濋櫓鐢熸晥璧锋鏈燂細" prop="startDate" style="margin-left: 40px">
                     <div style="display: flex; flex-direction: column;">
                         <el-date-picker
                             @change="changeTime"
                             v-model="time"
                             type="daterange"
-                            value-format="yyyy-MM-dd HH:mm:ss"
-                            format="yyyy-MM-dd HH:mm:ss"
+                            format="yyyy 骞� MM 鏈� dd 鏃�"
+                            value-format="yyyy-MM-dd"
                             range-separator="鑷�"
                             start-placeholder="寮�濮嬫棩鏈�"
                             end-placeholder="缁撴潫鏃ユ湡" />
-                        <span style="color: #F95601; font-size: 14px;">锛堟鏃ョ敓鏁堟姇淇濊浜�17:30鍓嶆彁浜わ紝瓒呮椂鎻愪氦浠ヤ繚闄╁崟涓哄噯锛�</span>
+                        <span style="color: #F95601; font-size: 14px;">锛�2. 娆℃棩鐢熸晥鎶曚繚璇蜂簬17:30鍓嶆彁浜わ紝瓒呮椂鎻愪氦浠ヤ繚闄╁崟涓哄噯锛�</span>
                     </div>
                 </el-form-item>
                 <el-form-item label="璐圭敤" v-if="item">
@@ -48,14 +51,15 @@
         </div>
         <div class="btns">
             <div class="btns_item">
-                <el-button type="primary" @click="selectApplicationForm">閫夋嫨鐢宠鍗�</el-button>
-                <el-button type="primary" @click="$refs.employeeList.open('鎶曚繚鍛樺伐鍚嶅崟')">鏌ョ湅鍚嶅崟</el-button>
+<!--                <el-button type="primary" @click="selectAll">鏉冮檺</el-button>-->
+<!--                <el-button type="primary" @click="$refs.employeeList.open('鎶曚繚鍛樺伐鍚嶅崟')">鏌ョ湅鍚嶅崟</el-button>-->
             </div>
         </div>
         <el-table
             :data="list"
             border
             ref="multipleTable"
+            @selection-change="handleSelectionChange"
             style="width: 100%;margin-bottom: 15px;">
             <el-table-column
                 type="selection"
@@ -67,33 +71,33 @@
                 </template>
             </el-table-column>
             <el-table-column
-                prop="memberName"
+                prop="companyName"
                 label="琚繚闄╀汉">
             </el-table-column>
             <el-table-column
-                prop="idCard"
+                prop="applyStartTime"
                 label="鏈熸湜淇濋櫓鐢熸晥璧锋湡">
             </el-table-column>
             <el-table-column
-                prop="oldDuName"
+                prop="applyEndTime"
                 label="鏈熸湜淇濋櫓鐢熸晥姝㈡湡">
             </el-table-column>
             <el-table-column
-                prop="oldWorkTypeName"
+                prop="insureNum"
                 label="鎶曚繚浜烘暟">
             </el-table-column>
             <el-table-column
-                prop="duName"
+                prop="fee"
                 label="鎬昏垂鐢�">
             </el-table-column>
-            <el-table-column
-                label="鎿嶄綔">
-                <template slot-scope="scope">
-                    <el-button type="text" @click="$refs.employeeList.open('鎶曚繚鍛樺伐鍚嶅崟')">鏌ョ湅鍚嶅崟</el-button>
-                    <el-button type="text" style="color: #ff0000;">鍒犻櫎</el-button>
+            <el-table-column  label="鎿嶄綔">
+                <template slot-scope="{row}">
+                    <el-button type="text" @click="$refs.InsuranceDetails.open('鎶曚繚浜哄憳鍚嶅崟',row,2)">鏌ョ湅鍚嶅崟</el-button>
+<!--                    <el-button type="text" style="color: #ff0000;">鍒犻櫎</el-button>-->
                 </template>
             </el-table-column>
         </el-table>
+      <div style="color: #F95601; font-size: 14px;width: 100%;text-align: left">锛�3. 璇峰厛閫夋嫨鑷冲皯涓�鏉$敵璇峰悗鎻愪氦鎶曚繚鐢宠锛�</div>
         <div class="info" v-if="item">
             <span v-if="item.specialAgreement">{{item.specialAgreement}}</span>
             <span v-if="item.specialInfo">{{item.specialInfo}}</span>
@@ -103,116 +107,174 @@
         <selectApplicationForm ref="selectApplicationForm" @success="getValue" />
         <!--    鎶曚繚鍛樺伐鍚嶅崟    -->
         <employeeList ref="employeeList" />
+      <InsuranceDetails ref="InsuranceDetails" @success="getValue" />
     </GlobalWindow>
 </template>
 
 <script>
-    import BaseOpera from '@/components/base/BaseOpera'
-    import GlobalWindow from '@/components/common/GlobalWindow'
-    import selectApplicationForm from '@/components/business/selectApplicationForm'
-    import employeeList from '@/components/business/employeeList'
-    import { all } from '@/api/business/solutions'
-    export default {
-        name: 'factoryChange',
-        extends: BaseOpera,
-        components: { GlobalWindow, selectApplicationForm, employeeList },
-        data () {
-            return {
-                form: {
-                    id: null,
-                    solutionsId: '',
-                    applyStartTime: '',
-                    applyEndTime: ''
-                },
-                solutions: [],
-                list: [],
-                endTime: '',
-                item: null,
-                time: [],
-                // 楠岃瘉瑙勫垯
-                rules: {
-                    applyStartTime: [
-                        { required: true, message: '璇烽�夋嫨淇濋櫓鐢熸晥璧锋湡' }
-                    ],
-                    solutionsName: [
-                        { required: true, message: '璇烽�夋嫨淇濋櫓鏂规' }
-                    ]
-                }
-            }
-        },
-        created () {
-            this.config({
-                api: '/business/insuranceApply',
-                'field.id': 'id'
-            })
-        },
-        methods: {
-            confirm() {
-                this.$confirm('纭鎻愪氦锛岃浠旂粏鏍稿淇℃伅銆�', '鎻愮ず', {
-                    confirmButtonText: '纭畾',
-                    cancelButtonText: '鍙栨秷',
-                    type: 'warning',
-                    center: true
-                }).then(() => {
-                    this.$message({
-                        type: 'success',
-                        message: '纭畾!'
-                    });
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '鍙栨秷'
-                    });
-                });
-            },
-            getValue(e) {
-                console.log(e)
-            },
-            selectApplicationForm() {
-                if (!this.form.solutionsId) return this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
-                this.$refs.selectApplicationForm.open('閫夋嫨鐢宠鍗�', this.form.solutionsId)
-            },
-            changeTime(e) {
-                if (e.length > 0) {
-                    this.form.applyStartTime = e[0]
-                    this.form.applyEndTime = e[1]
-                } else {
-                    this.form.applyStartTime = ''
-                    this.form.applyEndTime = ''
-                }
-            },
-            open (title, target) {
-                this.getSolutions()
-                this.title = title
-                if (target) {
-                    this.$nextTick(() => {
-                        this.$refs.form.resetFields()
-                    })
-                } else {
-                    this.$nextTick(() => {
-                        this.$refs.form.resetFields()
-                        this.form[this.configData['field.id']] = null
-                    })
-                }
-                this.visible = true
-            },
-            // 鏌ヨ鍏ㄩ儴鏂规
-            getSolutions() {
-                all({})
-                    .then(res => {
-                        this.solutions = res
-                    })
-            },
-            // 閫夋嫨淇濋櫓鍗�
-            selectSolutions(id) {
-                this.solutions.forEach(item => {
-                    if (item.id === id) {
-                        this.item = item
-                    }
-                })
-            }
-        }
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import selectApplicationForm from '@/components/business/selectApplicationForm'
+import employeeList from '@/components/business/employeeList'
+import { all } from '@/api/business/solutions'
+import { findAllApply } from '@/api/business/insuranceApply'
+import InsuranceDetails from '@/components/business/InsuranceDetails'
+import { merge } from '@/api/business/unionApply'
+export default {
+  name: 'OpearaUnionApply',
+  extends: BaseOpera,
+  components: { GlobalWindow, InsuranceDetails,selectApplicationForm, employeeList },
+  data () {
+    return {
+      form: {
+        baseSolutionId: null,
+        applyIds: [],
+        startDate: null,
+        endDate: null
+      },
+      solutions: [],
+      list: [],
+      endTime: '',
+      item: null,
+      time: [],
+      // 楠岃瘉瑙勫垯
+      rules: {
+        baseSolutionId: [
+          { required: true, message: '璇烽�夋嫨淇濋櫓鏂规' }
+        ],
+        startDate: [
+          { required: true, message: '璇烽�夋嫨淇濋櫓鐢熸晥璧锋湡' }
+        ]
+      }
     }
+  },
+  created () {
+    this.config({
+      api: '/business/insuranceApply',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    handleSelectionChange (val) {
+      // this.multipleSelection = val;
+      this.form.applyIds = []
+      // 鍋囪鍙栧嚭 id 瀛楁
+      val.forEach(item => {
+        const id = item.id
+        if ( this.form.applyIds.indexOf(id) === -1) {
+          this.form.applyIds.push(id)
+        }
+      })
+    },
+    confirm () {
+      this.$refs.form.validate((valid) => {
+        // debugger
+        if (!valid) {
+          return
+        }
+        if(this.form.applyIds == null || this.form.applyIds.length ===0){
+          this.$tip.apiFailed({
+            type: 'error',
+            message: '璇烽�夋嫨鑷冲皯涓�鏉$敵璇疯褰曡繘琛屾姇淇濈敵璇凤紒!'
+          })
+          return;
+        }
+        this.$confirm('纭鎻愪氦锛岃浠旂粏鏍稿淇℃伅銆�', '鎻愮ず', {
+          confirmButtonText: '纭畾',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning',
+          center: true
+        }).then(() => {
+          merge(this.form)
+            .then(response => {
+              this.$message({
+                type: 'success',
+                message: '鎻愪氦鎴愬姛!'
+              })
+              this.visible = false
+              this.$emit('success')
+            }).catch(err => {
+              this.$tip.apiFailed(err)
+            })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '鍙栨秷'
+          })
+        })
+      })
+    },
+    getValue (e) {
+      console.log(e)
+    },
+    selectApplicationForm () {
+      if (!this.form.solutionsId) return this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
+      this.$refs.selectApplicationForm.open('閫夋嫨鐢宠鍗�', this.form.solutionsId)
+    },
+    changeTime (e) {
+      if (e.length > 0) {
+        this.form.startDate = e[0]
+        this.form.endDate = e[1]
+      } else {
+        this.form.startDate = ''
+        this.form.endDate = ''
+      }
+    },
+    open (title, target) {
+      this.getSolutions()
+      this.title = title
+      this.solutions= []
+      this.list= []
+      this.item= null
+      this.time= []
+      if (target) {
+        this.$nextTick(() => {
+          this.$refs.form.resetFields()
+        })
+      } else {
+        this.$nextTick(() => {
+          this.$refs.form.resetFields()
+          this.form[this.configData['field.id']] = null
+        })
+      }
+      this.visible = true
+    },
+    // 鏌ヨ鍏ㄩ儴鏂规
+    getSolutions () {
+      all({ dataType: 0, type: 1 })
+        .then(res => {
+          this.solutions = res
+        })
+    },
+    search () {
+      this.currentPage = 1
+      this.getList()
+    },
+    getList () {
+      findAllApply({
+          baseSolutionId: this.form.baseSolutionId,
+          status: 23
+      }).then(res => {
+        this.list = res
+        this.total=this.list ?this.list.length:0
+        this.$nextTick(() => {
+          if (this.$refs.table && this.$refs.table.doLayout) {
+            this.$refs.table.doLayout()
+          }
+        })
+      })
+    },
+    // 閫夋嫨淇濋櫓鍗�
+    selectSolutions (id) {
+      this.search()
+      this.solutions.forEach(item => {
+        if (item.id === id) {
+          this.item = item
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -242,6 +304,7 @@
         margin-bottom: 10px;
     }
     .info {
+      margin-top: 30px;
         width: 100%;
         font-size: 14px;
         color: black;

--
Gitblit v1.9.3