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/OperaSolutionsBaseWindow.vue |  926 +++++++++++++++++++++++++++++++++------------------------
 1 files changed, 534 insertions(+), 392 deletions(-)

diff --git a/company/src/components/business/OperaSolutionsBaseWindow.vue b/company/src/components/business/OperaSolutionsBaseWindow.vue
index b305086..cc85ee2 100644
--- a/company/src/components/business/OperaSolutionsBaseWindow.vue
+++ b/company/src/components/business/OperaSolutionsBaseWindow.vue
@@ -6,452 +6,594 @@
         :confirm-working="isWorking"
         @confirm="confirm"
     >
+      <div>
         <el-form :model="form" ref="form" :rules="rules">
+        <el-tabs type="border-card"    :before-leave="beforeTabClick"  v-model="form.saveType">
+          <el-tab-pane label="鏂规鍩虹淇℃伅" name="0">
             <el-form-item label="鏂规鍚嶇О" prop="name">
-                <el-input v-model="form.name" placeholder="璇疯緭鍏�" v-trim/>
+              <el-input v-model="form.name" placeholder="璇疯緭鍏�" v-trim/>
             </el-form-item>
             <el-form-item label="淇濋櫓鍏徃" prop="insuranceId">
-                <el-select v-model="form.insuranceId" filterable @change="getAllWorktype1" placeholder="璇烽�夋嫨">
-                    <el-option
-                        v-for="item in company"
-                        :key="item.id"
-                        :label="item.name"
-                        :value="item.id">
-                    </el-option>
-                </el-select>
+              <el-select v-model="form.insuranceId" filterable @change="getAllWorktype1" placeholder="璇烽�夋嫨">
+                <el-option
+                    v-for="item in company"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                </el-option>
+              </el-select>
             </el-form-item>
             <el-form-item label="鎵夸繚鍏徃" prop="companyName">
-                <el-input v-model="form.companyName" placeholder="璇疯緭鍏�" v-trim/>
+              <el-input v-model="form.companyName" placeholder="璇疯緭鍏�" v-trim/>
             </el-form-item>
-            <el-form-item label="鎶曚繚骞撮緞" prop="minAge">
-                <div style="display: flex; align-items: center;">
-                    <el-select v-model="form.minAge" @change="changeMinAge" style="flex: 1;" placeholder="璇烽�夋嫨">
-                        <el-option
-                            v-for="item in 80"
-                            :key="item"
-                            :label="item"
-                            :value="item">
-                        </el-option>
-                    </el-select>
-                    <span style="margin: 0 30px;">鑷�</span>
-                    <el-select v-model="form.maxAge" @change="changeMaxAge" style="flex: 1;" placeholder="璇烽�夋嫨">
-                        <el-option
-                            v-for="item in 80"
-                            :key="item"
-                            :label="item"
-                            :value="item">
-                        </el-option>
-                    </el-select>
-                </div>
+            <el-form-item label="鎶曚繚骞撮緞" required="true" >
+              <div style="display: flex; align-items: center;">
+                <el-form-item label="" prop="minAge" style="flex: 1;">
+                <el-select v-model="form.minAge" @change="changeMinAge" style="flex: 1;" placeholder="璇烽�夋嫨">
+                  <el-option
+                      v-for="item in 80"
+                      :key="item"
+                      :label="item"
+                      :value="item">
+                  </el-option>
+                </el-select>
+                </el-form-item>
+                <span style="margin: 0 30px;padding-bottom: 20px;">鑷�</span>
+                <el-form-item label="" prop="maxAge" style="flex: 1;">
+                <el-select v-model="form.maxAge" @change="changeMaxAge"  placeholder="璇烽�夋嫨">
+                  <el-option
+                      v-for="item in 80"
+                      :key="item"
+                      :label="item"
+                      :value="item">
+                  </el-option>
+                </el-select>
+                </el-form-item>
+              </div>
             </el-form-item>
             <el-form-item label="鐢熸晥鏃堕棿" prop="validTypeNum">
-                <div style="width: 100%; display: flex; align-items: center;">
-                    <div style="flex-shrink: 0;">
-                        <el-radio-group v-model="form.validType" @change="changeValidType">
-                            <el-radio :label="0">鏃ュ悗鐢熸晥</el-radio>
-                            <el-radio :label="1">娆℃湀鐢熸晥</el-radio>
-                        </el-radio-group>
-                    </div>
-                    <el-input style="margin-left: 20px;" type="number" v-model="form.validTypeNum"   placeholder="璇疯緭鍏ュ欢杩熷ぉ鏁�" v-if="form.validType === 0"></el-input>
+              <div style="width: 100%; display: flex; align-items: center;">
+                <div style="flex-shrink: 0;">
+                  <el-radio-group v-model="form.validType" @change="changeValidType">
+                    <el-radio :label="0">鏃ュ悗鐢熸晥</el-radio>
+                    <el-radio :label="1">娆℃湀鐢熸晥</el-radio>
+                  </el-radio-group>
                 </div>
+                <el-input style="margin-left: 20px;" type="number" v-model="form.validTypeNum"   placeholder="璇疯緭鍏ュ欢杩熷ぉ鏁�" v-if="form.validType === 0"></el-input>
+              </div>
             </el-form-item>
             <el-form-item label="鎵规敼鏀寔" prop="canAdd">
-                <div style="width: 100%; display: flex; align-items: center;">
-                    <el-checkbox :true-label="1" :false-label="0" v-model="form.canAdd">鍔犱繚</el-checkbox>
-                    <el-checkbox :true-label="1" :false-label="0" v-model="form.canReduce">鍑忎繚</el-checkbox>
-                    <el-checkbox :true-label="1" :false-label="0" v-model="form.canChangeUnit">鏇存崲娲鹃仯鍗曚綅</el-checkbox>
-                </div>
+              <div style="width: 100%; display: flex; align-items: center;">
+                <el-checkbox :true-label="1" :false-label="0" v-model="form.canAdd">鍔犱繚</el-checkbox>
+                <el-checkbox :true-label="1" :false-label="0" v-model="form.canReduce">鍑忎繚</el-checkbox>
+                <el-checkbox :true-label="1" :false-label="0" v-model="form.canChangeUnit">鏇存崲娲鹃仯鍗曚綅</el-checkbox>
+              </div>
             </el-form-item>
             <el-form-item label="鎵瑰噺浠呮敮鎸佹浛鎹紙鍑忎繚鎵规敼浠呮敮鎸佹浛鎹汉鍛樺嵆鍑忎繚浜哄憳灏戜簬鍔犱繚浜哄憳锛�" prop="delOnlyReplace">
-                <div style="width: 100%; display: flex; align-items: center;">
-                    <el-radio-group v-model="form.delOnlyReplace">
-                        <el-radio :label="1">鏄�</el-radio>
-                        <el-radio :label="0">鍚�</el-radio>
-                    </el-radio-group>
-                </div>
+              <div style="width: 100%; display: flex; align-items: center;">
+                <el-radio-group v-model="form.delOnlyReplace">
+                  <el-radio :label="1">鏄�</el-radio>
+                  <el-radio :label="0">鍚�</el-radio>
+                </el-radio-group>
+              </div>
             </el-form-item>
             <el-form-item label="鎵瑰鐢熸晥锛堝ぉ鏁帮級" prop="addValidDays" v-if="form.delOnlyReplace != 1">
-                <div style="width: 100%; display: flex; align-items: center;">
-                    <el-input style="margin-left: 0px;" type="number" v-model="form.addValidDays"   placeholder="璇疯緭鍏ユ壒澧炵敓鏁堟椂闂达紙澶╂暟锛�" ></el-input>
-                </div>
+              <div style="width: 100%; display: flex; align-items: center;">
+                <el-input style="margin-left: 0px;" type="number" v-model="form.addValidDays"   placeholder="璇疯緭鍏ユ壒澧炵敓鏁堟椂闂达紙澶╂暟锛�" ></el-input>
+              </div>
             </el-form-item>
             <el-form-item label="鎵瑰噺鐢熸晥锛堝ぉ鏁帮級" prop="delValidDays">
-                <div style="width: 100%; display: flex; align-items: center;">
-                    <el-input style="margin-left: 0px;" type="number" v-model="form.delValidDays"   placeholder="璇疯緭鍏ユ壒鍑忕敓鏁堟椂闂达紙澶╂暟锛�" ></el-input>
-                </div>
+              <div style="width: 100%; display: flex; align-items: center;">
+                <el-input style="margin-left: 0px;" type="number" v-model="form.delValidDays"   placeholder="璇疯緭鍏ユ壒鍑忕敓鏁堟椂闂达紙澶╂暟锛�" ></el-input>
+              </div>
             </el-form-item>
             <el-form-item label="鎵规敼鎻愰啋鏃堕棿" prop="correctWarnTime">
-                <el-time-picker
-                    value-format="HH:mm"
-                    v-model="form.correctWarnTime"
-                    placeholder="璇烽�夋嫨鎵规敼鎻愰啋鏃堕棿">
-                </el-time-picker>
+              <el-time-picker
+                  value-format="HH:mm"
+                  v-model="form.correctWarnTime"
+                  placeholder="璇烽�夋嫨鎵规敼鎻愰啋鏃堕棿">
+              </el-time-picker>
             </el-form-item>
             <div style="width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #ececec;">
-                <div style="display: flex; align-items: center; margin-bottom: 10px;">
-                    <el-select filterable multiple style="width: 800px;" v-model="worktypeId" placeholder="璇烽�夋嫨">
-                        <el-option
-                            v-for="item in typeWorkCopy"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                        </el-option>
-                    </el-select>
-                    <el-button type="primary" @click="add" :disabled="worktypeId.length === 0" style="margin-left: 10px;">娣诲姞宸ョ</el-button>
-                    <el-button type="primary" @click="impor">瀵煎叆宸ョ</el-button>
-                    <el-button type="text" @click="exprot">瀵煎叆妯$増xls</el-button>
-                </div>
+              <div style="display: flex; align-items: center; margin-bottom: 10px;">
+                <el-select filterable multiple style="width: 800px;" v-model="worktypeId" placeholder="璇烽�夋嫨">
+                  <el-option
+                      v-for="item in typeWorkCopy"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id">
+                  </el-option>
+                </el-select>
+                <el-button type="primary" @click="add" :disabled="worktypeId.length === 0" style="margin-left: 10px;">娣诲姞宸ョ</el-button>
+                <el-button type="primary" @click="impor">瀵煎叆宸ョ</el-button>
+                <el-button type="text" @click="exprot">瀵煎叆妯$増xls</el-button>
+              </div>
+              <el-form-item label="宸叉坊鍔犲伐绉�" prop="worktypeIdList">
                 <u-table
                     :data="form.worktypeIdList"
                     border
                     use-virtual
                     style="width: 100%; margin-bottom: 20px;">
-                    <u-table-column
-                        label="搴忓彿"
-                        width="80">
-                        <template slot-scope="scope">
-                            <span>{{scope.$index + 1}}</span>
-                        </template>
-                    </u-table-column>
-                    <u-table-column
-                        prop="worktypeName"
-                        label="鎵�灞炲伐绉�">
-                    </u-table-column>
-                    <u-table-column
-                        label="鎿嶄綔"
-                        width="100">
-                        <template slot-scope="scope">
-                            <el-button type="text" size="small" style="color: red;" @click="dele(scope.$index)">鍒犻櫎</el-button>
-                        </template>
-                    </u-table-column>
+                  <u-table-column
+                      label="搴忓彿"
+                      width="80">
+                    <template slot-scope="scope">
+                      <span>{{scope.$index + 1}}</span>
+                    </template>
+                  </u-table-column>
+                  <u-table-column
+                      prop="worktypeName"
+                      label="鎵�灞炲伐绉�">
+                  </u-table-column>
+                  <u-table-column
+                      label="鎿嶄綔"
+                      width="100">
+                    <template slot-scope="scope">
+                      <el-button type="text" size="small" style="color: red;" @click="dele(scope.$index)">鍒犻櫎</el-button>
+                    </template>
+                  </u-table-column>
                 </u-table>
+              </el-form-item>
             </div>
             <el-form-item label="鐗瑰埆绾﹀畾" prop="specialAgreement">
-                <RichEditor :richData="form.specialAgreement" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor" :readonly="false"/>
+              <RichEditor :richData="form.specialAgreement" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor" :readonly="false"/>
             </el-form-item>
             <el-form-item label="鐗瑰埆璇存槑" prop="specialInfo">
-                <RichEditor :richData="form.specialInfo" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor1" :readonly="false"/>
+              <RichEditor :richData="form.specialInfo" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor1" :readonly="false"/>
             </el-form-item>
             <el-form-item label="鍏朵粬璇存槑" prop="ortherInfo">
-                <RichEditor :richData="form.ortherInfo" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor2" :readonly="false"/>
+              <RichEditor :richData="form.ortherInfo" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor2" :readonly="false"/>
             </el-form-item>
+          </el-tab-pane>
+          <el-tab-pane label="椋庨櫓璁剧疆" name="1" >
+            <el-form-item label="椋庨櫓璁剧疆" prop="risk">
+              <div class="tx">
+                <div class="tx_item">
+                  <div class="tx_item_head">
+                    <span>寤惰繜鎶ユ鎻愰啋</span>
+                    <el-switch :active-value="1" :inactive-value="0" v-model="form.riskDelayStatus"></el-switch>
+                  </div>
+                  <div class="tx_item_content">
+                    <span>瑙勫垯璁剧疆锛氬綋鎶ユ鏃堕棿瓒呰繃妗堝彂鏃堕棿</span>
+                    <el-input-number style="margin: 0 15px;" :disabled="form.riskDelayStatus === 0" v-model="form.riskDelayTime" :min="1"></el-input-number>
+                    <el-select v-model="form.riskDelayUnit" :disabled="form.riskDelayStatus === 0" style="width: 100px; margin-right: 15px;" placeholder="璇烽�夋嫨">
+                      <el-option label="鍒嗛挓" :value="0"></el-option>
+                      <el-option label="灏忔椂" :value="1"></el-option>
+                      <el-option label="澶�" :value="2"></el-option>
+                    </el-select>
+                    <span>鏃讹紝杩涜鎻愰啋銆�</span>
+                  </div>
+                </div>
+                <div class="tx_item">
+                  <div class="tx_item_head">
+                    <span>鍏佽瀵规柊鍛樺伐宸叉姇淇濇湭鐢熸晥淇濋櫓杩涜淇濋殰</span>
+                    <el-switch :active-value="1" :inactive-value="0" v-model="form.riskNewUserStatus"></el-switch>
+                  </div>
+                  <div class="tx_item_content">
+                    <span>瑙勫垯璁剧疆锛氬厑璁稿嚭闄╂椂闂村湪淇濆崟鐢熸晥鍓�</span>
+                    <el-input-number style="margin: 0 15px;" :disabled="form.riskNewUserStatus === 0"   v-model="form.riskNewUserTime" :min="1"></el-input-number>
+                    <el-select v-model="form.riskNewUserUnit"  :disabled="form.riskNewUserStatus === 0"  style="width: 100px; margin-right: 15px;" placeholder="璇烽�夋嫨">
+                      <el-option label="灏忔椂" :value="1"></el-option>
+                      <el-option label="澶�" :value="2"></el-option>
+                    </el-select>
+                  </div>
+                </div>
+              </div>
+            </el-form-item>
+          </el-tab-pane>
+        </el-tabs>
         </el-form>
         <!--    涓婁紶宸ョ    -->
         <input type="file" @change="getFile" style="opacity: 0;" ref="upload" accept=".xlsx" />
+      </div>
     </GlobalWindow>
 </template>
 
 <script>
-  import BaseOpera from '@/components/base/BaseOpera'
-  import GlobalWindow from '@/components/common/GlobalWindow'
-  import { all } from '@/api/business/insurance'
-  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'
-  import { numRule } from '@/utils/form'
-  import RichEditor from '@/components/common/RichEditor'
-  import { UTable, UTableColumn } from 'umy-ui'
-  export default {
-    name: 'OperaSolutionsBaseWindow',
-    extends: BaseOpera,
-    components: { GlobalWindow, UploadFile, RichEditor, UTable, UTableColumn },
-    data () {
-      var validType = (rule, value, callback) => {
-        if (this.form.validType === 0 && !value) {
-          return callback(new Error('寤惰繜澶╂暟涓嶈兘涓虹┖'))
-        } else if (this.form.validType === 0 && !/^[0-9]*[1-9][0-9]*$/.test(value)) {
-          return callback(new Error('寤惰繜澶╂暟鍙兘涓烘鏁存暟'))
-        }
-        callback()
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import { all } from '@/api/business/insurance'
+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'
+import { numRule } from '@/utils/form'
+import RichEditor from '@/components/common/RichEditor'
+import { UTable, UTableColumn } from 'umy-ui'
+import {getChangeMemberListOnlineSignLink} from "@/api/business/applyChange";
+export default {
+  name: 'OperaSolutionsBaseWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow, UploadFile, RichEditor, UTable, UTableColumn },
+  data () {
+    var validatorWorktype = (rule, value, callback) => {
+      if (!this.form.worktypeIdList || this.form.worktypeIdList.length === 0) {
+        callback(new Error('璇峰畬鍠勫伐绉嶄俊鎭�!'));
+      } else {
+        callback();
       }
-      var canAddFun = (rule, value, callback) => {
-        if (!this.form.canAdd && !form.canReduce && !form.canChangeUnit) {
-          return callback(new Error('鎵规敼鏀寔涓嶈兘涓虹┖'))
-        }
-        callback()
+    };
+    var validType = (rule, value, callback) => {
+      if (this.form.validType === 0 && !value) {
+        return callback(new Error('寤惰繜澶╂暟涓嶈兘涓虹┖'))
+      } else if (this.form.validType === 0 && !/^[0-9]*[1-9][0-9]*$/.test(value)) {
+        return callback(new Error('寤惰繜澶╂暟鍙兘涓烘鏁存暟'))
       }
-      return {
-        // 琛ㄥ崟鏁版嵁
-        form: {
-          id: null,
-          name: '',
-          companyName: '',
-          insuranceId: '',
-          validType: 0,
-          minAge: '',
-          maxAge: '',
-          specialAgreement: '',
-          specialInfo: '',
-          ortherInfo: '',
-          validTypeNum: '',
-          canReduce: 0,
-          canChangeUnit: 0,
-          addValidDays: 0,
-          delValidDays: 0,
-          delOnlyReplace: 0,
-          canAdd: 0,
-          correctWarnTime: '',
-          worktypeIdList: []
-        },
-        worktypeId: [],
-        // 楠岃瘉瑙勫垯
-        rules: {
-          name: [
-            { required: true, message: '璇疯緭鍏ユ柟妗堝悕绉�' }
-          ],
-          delOnlyReplace: [
-            { required: true, message: '璇烽�夋嫨' }
-          ],
-          addValidDays: [
-            { required: true, validator: numRule }
-          ],
-          delValidDays: [
-            { required: true, validator: numRule }
-          ],
-          insuranceId: [
-            { required: true, message: '璇烽�夋嫨淇濋櫓鍏徃' }
-          ],
-          companyName: [
-            { required: true, message: '璇疯緭鍏ユ壙淇濆叕鍙�' }
-          ],
-          minAge: [
-            { required: true, message: '璇烽�夋嫨鎶曚繚骞撮緞' }
-          ],
-          validTypeNum: [
-            { required: true, validator: validType }
-          ],
-          correctWarnTime: [
-            { required: true, message: '璇疯緭鍏ユ壒鏀规彁閱掓椂闂�' }
-          ],
-          canAdd: [
-            { required: true, validator: canAddFun }
-          ]
-        },
-        shops: [],
-        company: [],
-        typeWork: [],
-        typeWorkCopy: []
+      callback()
+    }
+    var canAddFun = (rule, value, callback) => {
+      if (!this.form.canAdd && !this.form.canReduce && !this.form.canChangeUnit) {
+        return callback(new Error('鎵规敼鏀寔涓嶈兘涓虹┖'))
       }
-    },
-    created () {
-      this.config({
-        api: '/business/solutionsBase',
-        'field.id': 'id'
-      })
-    },
-    methods: {
-      // 瀵煎叆宸ョ妯℃澘
-      getFile(e) {
-        const formdate = new FormData()
-        formdate.append('file', e.target.files[0])
-        formdate.append('insuranceId', this.form.insuranceId)
-        importExcelForSolution(formdate)
-          .then(res => {
-            let arr = []
-            res.forEach(item => {
-              arr.push({ worktypeId: item.id, worktypeName: item.name })
-            })
-            this.form.worktypeIdList = [...arr, ...this.form.worktypeIdList]
-            let valData = this.form.worktypeIdList.map(item => item.worktypeName)
-            this.typeWorkCopy = this.typeWorkCopy.filter(item => !valData.includes(item.name))
-          })
-          .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;
-      },
-      getWangedditor1(val){
-        this.form.specialInfo = val;
-      },
-      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('璧峰骞撮緞涓嶈兘澶т簬鎴骞撮緞锛�')
+      callback()
+    }
+    var riskRule = (rule, value, callback) => {
+      if (this.form.riskDelayStatus === '1') {
+        if (!this.form.riskDelayTime || !this.form.riskDelayUnit) {
+          return callback(new Error('璇峰畬鍠勫唴瀹�'))
         }
-      },
-      changeMaxAge(e) {
-        if (this.form.minAge && this.form.minAge >= 0 && e < this.form.minAge) {
-          this.form.maxAge = ''
-          this.$message.warning('鎴骞撮緞涓嶈兘澶т簬璧峰骞撮緞锛�')
+      }
+      if (this.form.riskNewUserStatus === '1') {
+        if (!this.form.riskNewUserTime || !this.form.riskNewUserUnit) {
+          return callback(new Error('璇峰畬鍠勫唴瀹�'))
         }
+      }
+      callback()
+    }
+    return {
+      // 琛ㄥ崟鏁版嵁
+      form: {
+        id: null,
+        name: '',
+        companyName: '',
+        insuranceId: '',
+        validType: 0,
+        minAge: '',
+        maxAge: '',
+        specialAgreement: '',
+        specialInfo: '',
+        ortherInfo: '',
+        validTypeNum: '',
+        canReduce: 0,
+        canChangeUnit: 0,
+        addValidDays: 0,
+        delValidDays: 0,
+        delOnlyReplace: 0,
+        canAdd: 0,
+        saveType: '0',
+        correctWarnTime: '',
+        worktypeIdList: [],
+
+        riskDelayStatus: 0,
+        riskDelayTime: 1,
+        riskDelayUnit: 0,
+        riskNewUserStatus: 0,
+        riskNewUserTime: 1,
+        riskNewUserUnit: 1
       },
-      handNumberInput (value) {
-        const regex = /^[-+]?\d*$/
-        if (!regex.test(value)) {
-          // 濡傛灉杈撳叆鐨勪笉鏄暣鏁帮紝鍒欒缃负涓婁竴涓湁鏁堢殑鏁存暟鍊�
-          this.form.addValidDays = value.replace(/[^0-9]/g, '')
-          this.form.addValidDays = value.replace(/[^0-9]/g, '')
-          this.form.delValidDays = value.replace(/[^0-9]/g, '')
-        }
+      value: '',
+      options: [],
+      worktypeId: [],
+      // 楠岃瘉瑙勫垯
+      rules: {
+        name: [
+          { required: true, message: '璇疯緭鍏ユ柟妗堝悕绉�' }
+        ],
+        delOnlyReplace: [
+          { required: true, message: '璇烽�夋嫨' }
+        ],
+        addValidDays: [
+          { required: true, validator: numRule }
+        ],
+        delValidDays: [
+          { required: true, validator: numRule }
+        ],
+        risk: [
+          { required: true, validator: riskRule }
+        ],
+        insuranceId: [
+          { required: true, message: '璇烽�夋嫨淇濋櫓鍏徃' }
+        ],
+        companyName: [
+          { required: true, message: '璇疯緭鍏ユ壙淇濆叕鍙�' }
+        ],
+        minAge: [
+          { required: true, message: '璇烽�夋嫨鎶曚繚鏈�灏忓勾榫�' }
+        ],
+        maxAge: [
+          { required: true, message: '璇烽�夋嫨鎶曚繚鏈�澶у勾榫�' }
+        ],
+        validTypeNum: [
+          { required: true, validator: validType }
+        ],
+        correctWarnTime: [
+          { required: true, message: '璇疯緭鍏ユ壒鏀规彁閱掓椂闂�' }
+        ],
+        worktypeIdList: [
+          { required: true, validator: validatorWorktype }
+        ],
+        canAdd: [
+          { required: true, validator: canAddFun }
+        ]
       },
-      // 鍒囨崲鍏徃
-      getAllWorktype1 () {
-        this.form.worktypeIdList = []
-        this.getAllWorktype()
-      },
-      changeValidType(e) {
-        if (e === 1) {
-          this.form.validTypeNum = 0
-        } else {
-          this.form.validTypeNum = ''
-        }
-      },
-      // 纭鏂板缓/淇敼
-      confirm () {
-        const data = JSON.parse(JSON.stringify(this.form))
-        data.worktypeIdList = data.worktypeIdList.map(item => item.worktypeId)
+      shops: [],
+      company: [],
+      typeWork: [],
+      typeWorkCopy: []
+    }
+  },
+  created () {
+    this.config({
+      api: '/business/solutionsBase',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    beforeTabClick(n,o){
+      let re = true
+      if( !this.form.id && n === '1'){
         this.$refs.form.validate((valid) => {
           if (!valid) {
-            return
+            re = false
           }
-          // 璋冪敤鏂板缓鎺ュ彛
-          this.isWorking = true
-          if (data.id == null || data.id === '') {
-            this.api.create(data)
-              .then(() => {
-                this.visible = false
-                this.$tip.apiSuccess('鏂板缓鎴愬姛')
-                this.$emit('success')
-              })
-              .catch(e => {
-                this.$tip.apiFailed(e)
-              })
-              .finally(() => {
-                this.isWorking = false
-              })
-          } else {
-            this.api.updateById(data)
-              .then(() => {
-                this.visible = false
-                this.$tip.apiSuccess('淇敼鎴愬姛')
-                this.$emit('success')
-              })
-              .catch(e => {
-                this.$tip.apiFailed(e)
-              })
-              .finally(() => {
-                this.isWorking = false
-              })
-          }
+          this.form.saveType = n
         })
-      },
-      open (title, target) {
-        this.title = title
-        this.visible = true
-        this.form.maxAge = ''
-        this.form.validTypeNum = ''
-        this.form.canReduce = 0
-        this.form.canChangeUnit = 0
-        this.form.addValidDays = 0
-        this.form.delOnlyReplace = 0
-        this.form.delValidDays = 0
-        this.form.canAdd = 0
-        this.form.worktypeIdList = []
-        this.typeWork = []
-        this.typeWorkCopy = []
-        // this.$refs['$upload'].clearFiles()//鍒濆鍖栧鍏ョ粍浠�
-        this.allCompany()
-        this.allShops()
-        // 鏂板缓
-        if (target == null) {
-          this.$nextTick(() => {
-            this.$refs.form.resetFields()
-            this.form.maxAge = ''
-            this.form.validTypeNum = ''
-            this.form.fanganFile = null
-            this.form.worktypeIdList = []
-            this.form[this.configData['field.id']] = null
-          })
-          return
-        }
-        // 缂栬緫
-        this.$nextTick(() => {
-          solutionsBaseId(target.id)
-            .then(res => {
-              for (const key in this.form) {
-                this.form[key] = res[key]
-              }
-              this.form.correctWarnTime = `${this.form.correctWarnTime}:00`
-              if (res.worktypeList) {
-                this.form.worktypeIdList = res.worktypeList.map(item => {
-                  return {
-                    worktypeId: item.worktypeId,
-                    worktypeName: item.worktypeName
-                  }
-                })
-              }
-              this.getAllWorktype()
-            })
-        })
-      },
-      // 鏌ヨ淇濋櫓鍏徃涓嬪叏閮ㄥ伐绉�
-      getAllWorktype () {
-        allWorktype({
-          insuranceId: this.form.insuranceId,
-          dataType: 2
-        }).then(res => {
-            this.typeWork = res
-            if (!this.form.id) {
-                this.typeWorkCopy = res
-            } else {
-                let valData = this.form.worktypeIdList.map(item => item.worktypeName)
-                this.typeWorkCopy = res.filter(item => !valData.includes(item.name))
-            }
-        })
-      },
-
-      // 鏌ヨ鍏ㄩ儴淇濋櫓鍏徃
-      allCompany () {
-        all({ dataType: 2, status: 0 })
-          .then(res => {
-            this.company = res
-          })
-      },
-      allShops () {
-        shopList({ type: 1, status: 0 })
-          .then(res => {
-            this.shops = res
-          })
-      },
-      add () {
-          let arr = this.typeWorkCopy.filter(item => this.worktypeId.includes(item.id))
-          let dataVal = arr.map(item => {
-              return {
-                  worktypeId: item.id,
-                  worktypeName: item.name
-              }
-          })
-          this.form.worktypeIdList = [ ...dataVal, ...this.form.worktypeIdList ]
-          let valData = this.form.worktypeIdList.map(item => item.worktypeName)
-          this.typeWorkCopy = this.typeWorkCopy.filter(item => !valData.includes(item.name))
-          this.worktypeId = []
-      },
-      dele (index) {
-        if (this.form.worktypeIdList.length === 1) {
-          this.$message.warning('鑷冲皯瑕佷繚鐣欎竴椤�')
-          return
-        }
-        let row = this.typeWork.filter(item => item.name === this.form.worktypeIdList[index].worktypeName)
-        this.typeWorkCopy.unshift(row[0])
-        this.form.worktypeIdList.splice(index, 1)
       }
+      return re
+    },
+    // 瀵煎叆宸ョ妯℃澘
+    getFile (e) {
+      const formdate = new FormData()
+      formdate.append('file', e.target.files[0])
+      formdate.append('insuranceId', this.form.insuranceId)
+      importExcelForSolution(formdate)
+        .then(res => {
+          const arr = []
+          res.forEach(item => {
+            arr.push({ worktypeId: item.id, worktypeName: item.name })
+          })
+          this.form.worktypeIdList = [...arr, ...this.form.worktypeIdList]
+          this.$refs.form.validate()
+          const valData = this.form.worktypeIdList.map(item => item.worktypeName)
+          this.typeWorkCopy = this.typeWorkCopy.filter(item => !valData.includes(item.name))
+          this.$refs.form.validate()
+        })
+        .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
+    },
+    getWangedditor1 (val) {
+      this.form.specialInfo = val
+    },
+    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)) {
+        // 濡傛灉杈撳叆鐨勪笉鏄暣鏁帮紝鍒欒缃负涓婁竴涓湁鏁堢殑鏁存暟鍊�
+        this.form.addValidDays = value.replace(/[^0-9]/g, '')
+        this.form.addValidDays = value.replace(/[^0-9]/g, '')
+        this.form.delValidDays = value.replace(/[^0-9]/g, '')
+      }
+    },
+    // 鍒囨崲鍏徃
+    getAllWorktype1 () {
+      this.form.worktypeIdList = []
+      this.getAllWorktype()
+    },
+    changeValidType (e) {
+      if (e === 1) {
+        this.form.validTypeNum = 0
+      } else {
+        this.form.validTypeNum = ''
+      }
+    },
+    // 纭鏂板缓/淇敼
+    confirm () {
+      const data = JSON.parse(JSON.stringify(this.form))
+      data.worktypeIdList = data.worktypeIdList.map(item => item.worktypeId)
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return
+        }
+        // 璋冪敤鏂板缓鎺ュ彛
+        this.isWorking = true
+        if (data.id == null || data.id === '') {
+          this.api.create(data)
+            .then(() => {
+              this.visible = false
+              this.$tip.apiSuccess('鏂板缓鎴愬姛')
+              this.$emit('success')
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking = false
+            })
+        } else {
+          this.api.updateById(data)
+            .then(() => {
+              this.visible = false
+              this.$tip.apiSuccess('淇敼鎴愬姛')
+              this.$emit('success')
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking = false
+            })
+        }
+      })
+    },
+    open (title, target) {
+      this.title = title
+      this.visible = true
+      this.form.maxAge = ''
+      this.form.validTypeNum = ''
+      this.form.canReduce = 0
+      this.form.canChangeUnit = 0
+      this.form.addValidDays = 0
+      this.form.delOnlyReplace = 0
+      this.form.delValidDays = 0
+      this.form.canAdd = 0
+      this.form.worktypeIdList = []
+      this.typeWork = []
+      this.typeWorkCopy = []
+      // this.$refs['$upload'].clearFiles()//鍒濆鍖栧鍏ョ粍浠�
+      this.allCompany()
+      this.allShops()
+      // 鏂板缓
+      if (target == null) {
+        this.$nextTick(() => {
+          this.$refs.form.resetFields()
+          this.form.maxAge = ''
+          this.form.validTypeNum = ''
+          this.form.fanganFile = null
+          this.form.worktypeIdList = []
+          this.form[this.configData['field.id']] = null
+          this.form.saveType = '0'
+        })
+        return
+      }
+      // 缂栬緫
+      this.$nextTick(() => {
+        solutionsBaseId(target.id)
+          .then(res => {
+            for (const key in this.form) {
+              this.form[key] = res[key]
+            }
+            this.form.saveType = '0'
+            this.form.correctWarnTime = `${this.form.correctWarnTime}:00`
+            if (res.worktypeList) {
+              this.form.worktypeIdList = res.worktypeList.map(item => {
+                return {
+                  worktypeId: item.worktypeId,
+                  worktypeName: item.worktypeName
+                }
+              })
+            }
+            this.getAllWorktype()
+          })
+      })
+    },
+    // 鏌ヨ淇濋櫓鍏徃涓嬪叏閮ㄥ伐绉�
+    getAllWorktype () {
+      allWorktype({
+        insuranceId: this.form.insuranceId,
+        dataType: 2
+      }).then(res => {
+        this.typeWork = res
+        if (!this.form.id) {
+          this.typeWorkCopy = res
+        } else {
+          const valData = this.form.worktypeIdList.map(item => item.worktypeName)
+          this.typeWorkCopy = res.filter(item => !valData.includes(item.name))
+        }
+      })
+    },
+
+    // 鏌ヨ鍏ㄩ儴淇濋櫓鍏徃
+    allCompany () {
+      all({ dataType: 2, status: 0 })
+        .then(res => {
+          this.company = res
+        })
+    },
+    allShops () {
+      shopList({ type: 1, status: 0 })
+        .then(res => {
+          this.shops = res
+        })
+    },
+    add () {
+      const arr = this.typeWorkCopy.filter(item => this.worktypeId.includes(item.id))
+      const dataVal = arr.map(item => {
+        return {
+          worktypeId: item.id,
+          worktypeName: item.name
+        }
+      })
+      this.form.worktypeIdList = [...dataVal, ...this.form.worktypeIdList]
+      const valData = this.form.worktypeIdList.map(item => item.worktypeName)
+      this.typeWorkCopy = this.typeWorkCopy.filter(item => !valData.includes(item.name))
+      this.worktypeId = []
+      this.$refs.form.validate()
+    },
+    dele (index) {
+      if (this.form.worktypeIdList.length === 1) {
+        this.$message.warning('鑷冲皯瑕佷繚鐣欎竴椤�')
+        return
+      }
+      const row = this.typeWork.filter(item => item.name === this.form.worktypeIdList[index].worktypeName)
+      this.typeWorkCopy.unshift(row[0])
+      this.form.worktypeIdList.splice(index, 1)
     }
   }
+}
 </script>
+
+<style lang="scss" scoped>
+    .tx {
+        width: 100%;
+        background-color: #ffffff;
+        display: flex;
+        flex-direction: column;
+        .tx_item {
+            width: 50%;
+            padding: 20px 20px;
+            box-sizing: border-box;
+            background-color: #ffffff;
+            border: 1px solid #ececec;
+            margin-bottom: 20px;
+            .tx_item_head {
+                display: flex;
+                align-items: center;
+                span {
+                    color: rgba(16,16,16,1);
+                    font-size: 16px;
+                    font-weight: bold;
+                    margin-right: 15px;
+                }
+            }
+            .tx_item_content {
+                display: flex;
+                align-items: start;
+                margin-top: 10px;
+                span {
+                    flex-shrink: 0;
+                    color: rgba(16,16,16,1);
+                    font-size: 14px;
+                }
+            }
+        }
+    }
+</style>

--
Gitblit v1.9.3