From 3011b9800d6c5bee031d87bc4e225b5b1fb52571 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期六, 23 十一月 2024 09:19:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

---
 company/src/components/business/OperaSolutionsBaseWindow.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/company/src/components/business/OperaSolutionsBaseWindow.vue b/company/src/components/business/OperaSolutionsBaseWindow.vue
index e7f597e..bbb4437 100644
--- a/company/src/components/business/OperaSolutionsBaseWindow.vue
+++ b/company/src/components/business/OperaSolutionsBaseWindow.vue
@@ -25,7 +25,7 @@
             </el-form-item>
             <el-form-item label="鎶曚繚骞撮緞" prop="minAge">
                 <div style="display: flex; align-items: center;">
-                    <el-select v-model="form.minAge" style="flex: 1;" placeholder="璇烽�夋嫨">
+                    <el-select v-model="form.minAge" @change="changeMinAge" style="flex: 1;" placeholder="璇烽�夋嫨">
                         <el-option
                             v-for="item in 80"
                             :key="item"
@@ -34,7 +34,7 @@
                         </el-option>
                     </el-select>
                     <span style="margin: 0 30px;">鑷�</span>
-                    <el-select v-model="form.maxAge" style="flex: 1;" placeholder="璇烽�夋嫨">
+                    <el-select v-model="form.maxAge" @change="changeMaxAge" style="flex: 1;" placeholder="璇烽�夋嫨">
                         <el-option
                             v-for="item in 80"
                             :key="item"
@@ -87,7 +87,11 @@
                     placeholder="璇烽�夋嫨鎵规敼鎻愰啋鏃堕棿">
                 </el-time-picker>
             </el-form-item>
-            <el-button type="primary" @click="add" style="margin-bottom: 10px;">娣诲姞宸ョ</el-button>
+            <div style="display: flex; align-items: center;">
+                <el-button type="primary" @click="add" style="margin-bottom: 10px;">娣诲姞宸ョ</el-button>
+                <el-button type="primary" @click="impor" style="margin-bottom: 10px;">瀵煎叆宸ョ</el-button>
+                <el-button type="text" @click="exprot">瀵煎叆妯$増xls</el-button>
+            </div>
             <el-table
                 :data="form.worktypeIdList"
                 border
@@ -133,6 +137,8 @@
                 <RichEditor :richData="form.ortherInfo" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor2" :readonly="false"/>
             </el-form-item>
         </el-form>
+        <!--    涓婁紶宸ョ    -->
+        <input type="file" @change="getFile" style="opacity: 0;" ref="upload" accept=".xlsx" />
     </GlobalWindow>
 </template>
 
@@ -140,7 +146,7 @@
   import BaseOpera from '@/components/base/BaseOpera'
   import GlobalWindow from '@/components/common/GlobalWindow'
   import { all } from '@/api/business/insurance'
-  import { all as allWorktype } from '@/api/business/worktype'
+  import { all as allWorktype, importExcelForSolution } from '@/api/business/worktype'
   import { solutionsBaseId } from '@/api/business/solutionsBase'
   import { pageAll as shopList } from '@/api/business/company'
   import UploadFile from '@/components/common/UploadFile'
@@ -233,6 +239,37 @@
       })
     },
     methods: {
+      // 瀵煎叆宸ョ妯℃澘
+      getFile(e) {
+        const formdate = new FormData()
+        formdate.append('file', e.target.files[0])
+        formdate.append('insuranceId', this.form.insuranceId)
+        importExcelForSolution(formdate)
+          .then(res => {
+            console.log(res)
+            res.forEach(id => {
+              if (this.form.worktypeIdList.length === 1 && !this.form.worktypeIdList[0].worktypeId) {
+                this.form.worktypeIdList[0].worktypeId = id
+              } else {
+                this.form.worktypeIdList.push({ worktypeId: id })
+              }
+            })
+          })
+          .catch(err => {
+            this.$message.error(err.message)
+          })
+          .finally(() => {
+            this.$refs.upload.value = null
+          })
+      },
+      impor() {
+        if (!this.form.insuranceId) return this.$message.warning('璇峰厛閫夋嫨浼佷笟')
+        this.$refs.upload.click()
+      },
+      // 瀵煎嚭妯℃澘
+      exprot() {
+        window.open(process.env.VUE_APP_TYPEWORK_URL)
+      },
       getWangedditor(val){
         this.form.specialAgreement = val;
       },
@@ -242,7 +279,18 @@
       getWangedditor2(val){
         this.form.ortherInfo = val;
       },
-
+      changeMinAge(e) {
+        if (this.form.maxAge && this.form.maxAge >= 0 && e > this.form.maxAge) {
+          this.form.minAge = ''
+          this.$message.warning('璧峰骞撮緞涓嶈兘澶т簬鎴骞撮緞锛�')
+        }
+      },
+      changeMaxAge(e) {
+        if (this.form.minAge && this.form.minAge >= 0 && e < this.form.minAge) {
+          this.form.maxAge = ''
+          this.$message.warning('鎴骞撮緞涓嶈兘澶т簬璧峰骞撮緞锛�')
+        }
+      },
       handNumberInput (value) {
         const regex = /^[-+]?\d*$/
         if (!regex.test(value)) {
@@ -338,7 +386,6 @@
                 this.form[key] = res[key]
               }
               this.form.correctWarnTime = `${this.form.correctWarnTime}:00`
-              console.log(this.form.correctWarnTime)
               if (res.worktypeList) {
                 this.form.worktypeIdList = res.worktypeList.map(item => {
                   return {

--
Gitblit v1.9.3