From 09da100729793848bc01b51f7b05ca3f1e7ec64f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 20 六月 2024 14:05:35 +0800
Subject: [PATCH] 提交一把

---
 company/src/components/business/OperaSolutionsWindow.vue |  547 ++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 346 insertions(+), 201 deletions(-)

diff --git a/company/src/components/business/OperaSolutionsWindow.vue b/company/src/components/business/OperaSolutionsWindow.vue
index fcdce95..260c454 100644
--- a/company/src/components/business/OperaSolutionsWindow.vue
+++ b/company/src/components/business/OperaSolutionsWindow.vue
@@ -1,6 +1,7 @@
 <template>
     <GlobalWindow
         :title="title"
+        width="100%"
         :visible.sync="visible"
         :confirm-working="isWorking"
         @confirm="confirm"
@@ -26,7 +27,7 @@
                 <div style="display: flex; align-items: center;">
                     <el-select v-model="form.minAge" style="flex: 1;" placeholder="璇烽�夋嫨">
                         <el-option
-                            v-for="item in 60"
+                            v-for="item in 80"
                             :key="item"
                             :label="item"
                             :value="item">
@@ -35,7 +36,7 @@
                     <span style="margin: 0 30px;">鑷�</span>
                     <el-select v-model="form.maxAge" style="flex: 1;" placeholder="璇烽�夋嫨">
                         <el-option
-                            v-for="item in 60"
+                            v-for="item in 80"
                             :key="item"
                             :label="item"
                             :value="item">
@@ -43,48 +44,93 @@
                     </el-select>
                 </div>
             </el-form-item>
-            <el-form-item label="淇濋櫓璐圭敤" prop="price">
+            <el-form-item label="鏂规璐圭敤" prop="price">
                 <div style="display: flex; align-items: center;">
                     <el-input v-model="form.price" style="flex: 1;" placeholder="璇疯緭鍏�" v-trim/>
                     <span style="margin: 0 30px;">鍏�/浜�</span>
-                    <el-select v-model="form.timeUnit" style="flex: 1;" placeholder="璇烽�夋嫨">
+                    <el-select v-model="form.timeUnit" style="flex: 1;" placeholder="璇烽�夋嫨鍛ㄦ湡鍗曚綅" @change="changeTimeUnit">
                         <el-option label="澶�" :value="0"></el-option>
-                        <el-option label="鍗婃湀" :value="1"></el-option>
-                        <el-option label="鏈�" :value="2"></el-option>
-                        <el-option label="骞�" :value="3"></el-option>
+<!--                        <el-option label="鍗婃湀" :value="1"></el-option>-->
+                      <el-option label="鏈�" :value="2"></el-option>
+                      <el-option label="瀛e害" :value="3"></el-option>
+                      <el-option label="鍗婂勾" :value="4"></el-option>
+                      <el-option label="骞�" :value="5"></el-option>
                     </el-select>
                 </div>
             </el-form-item>
-            <el-form-item label="鎶曚繚鍛ㄦ湡" prop="insureCycle">
+            <el-form-item label="鎵规敼璁¤垂瑙勫垯" prop="insureCycleUnit">
                 <div style="display: flex; align-items: center;">
-                    <el-input v-model="form.insureCycle" style="flex: 1;" placeholder="璇疯緭鍏�" v-trim/>
-                    <span style="margin: 0 30px;"></span>
                     <el-select v-model="form.insureCycleUnit" style="flex: 1;" placeholder="璇烽�夋嫨">
-                        <el-option label="澶�" :value="0"></el-option>
-                        <el-option label="鍗婃湀" :value="1"></el-option>
-                        <el-option label="鏈�" :value="2"></el-option>
-                        <el-option label="骞�" :value="3"></el-option>
+                        <el-option  label="澶�" :value="0"></el-option>
+                        <el-option v-if="form.timeUnit>=1"  label="鍗婃湀" :value="1"></el-option>
+                        <el-option v-if="form.timeUnit>=2"  label="鏈�" :value="2"></el-option>
+                        <el-option v-if="form.timeUnit>=3"  label="瀛e害" :value="3"></el-option>
+                        <el-option  v-if="form.timeUnit>=4"  label="鍗婂勾" :value="4"></el-option>
+                        <el-option v-if="form.timeUnit>=5" label="骞�" :value="5"></el-option>
                     </el-select>
                 </div>
             </el-form-item>
-            <el-form-item label="鐢熸晥鏃堕棿" prop="validType">
-                <el-radio-group v-model="form.validType">
-                    <el-radio :label="0">鏃ュ悗鐢熸晥</el-radio>
-                    <el-radio :label="1">娆℃湀鐢熸晥</el-radio>
-                </el-radio-group>
+            <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="form.validTypeNum = ''">
+                            <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="鎵规敼鏀寔" >
+            <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" v-if="form.insureCycleUnit===0 || (form.insureCycleUnit===form.timeUnit)">
+            <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>
+          </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>
+          </el-form-item>
             <el-form-item label="鎶曚繚绫诲瀷" prop="type">
-                <el-radio-group v-model="form.type">
-                    <el-radio :label="0">鐩翠繚</el-radio>
+                <el-radio-group v-model="form.type" :disabled="form.id!=null">
+                    <el-radio :label="0" >鐩翠繚</el-radio>
                     <el-radio :label="1">濮旀墭鎶曚繚</el-radio>
                 </el-radio-group>
             </el-form-item>
+          <el-form-item label="濮旀墭鍟嗘埛" prop="shopId" v-if="form.type =='1'" :rules="form.type===1?[{required:true,message:'璇烽�夋嫨鍟嗘埛'}]:[{required:false}]">
+            <el-select v-model="form.shopId"  placeholder="璇烽�夋嫨濮旀墭鍟嗘埛">
+              <el-option
+                  v-for="item in shops"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="涓婁紶鏂规纭涔︼細" prop="fanganFile" v-if="form.type =='1'" :rules="form.type===1?[{required:true,message:'璇蜂笂浼犳柟妗堢‘璁や功'}]:[{required:false}]">
+            <UploadFile  @remove="deleFile" :uploadData="{ folder: 'apply',fileType:'.pdf' }" :fileList="form.fileList1" @uploadSuccess="editFanganFile" />
+          </el-form-item>
             <el-form-item label="鎺ユ敹鏂囦欢閭" prop="email">
                 <el-input v-model="form.email" placeholder="璇疯緭鍏�" v-trim/>
             </el-form-item>
-            <el-form-item label="鎶曚繚鍗曠绔犲叧閿瓧" prop="signKeyword">
-                <el-input v-model="form.signKeyword" placeholder="澶氫釜鑻辨枃閫楀彿闅斿紑" v-trim/>
-            </el-form-item>
+<!--            <el-form-item label="鎶曚繚鍗曠绔犲叧閿瓧锛堝鏈夊涓叧閿瓧锛岃浣跨敤鑻辨枃鍒嗗彿 ; 闅斿紑锛�" prop="signKeyword">
+                <el-input v-model="form.signKeyword" placeholder="澶氫釜鑻辨枃鍒嗗彿 ; 闅斿紑" v-trim/>
+            </el-form-item>-->
             <el-button type="primary" @click="add">娣诲姞宸ョ</el-button>
             <el-table
                 :data="form.worktypeIdList"
@@ -122,191 +168,290 @@
                 </el-table-column>
             </el-table>
             <el-form-item label="鐗瑰埆绾﹀畾" prop="specialAgreement">
-                <el-input type="textarea" v-model="form.specialAgreement" placeholder="璇疯緭鍏ョ壒鍒害瀹�" v-trim/>
+                <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">
-                <el-input type="textarea" v-model="form.specialInfo" placeholder="璇疯緭鍏ョ壒鍒鏄�" v-trim/>
+              <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">
-                <el-input type="textarea" v-model="form.ortherInfo" placeholder="璇疯緭鍏ュ叾浠栬鏄�" v-trim/>
+          <el-form-item label="鍏朵粬璇存槑" prop="ortherInfo">
+               <RichEditor   :richData="form.ortherInfo" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor2" :readonly="false"/>
             </el-form-item>
         </el-form>
     </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 } from '@/api/business/worktype'
-    import { solutionsId } from '@/api/business/solutions'
-    export default {
-        name: 'OperaSolutionsWindow',
-        extends: BaseOpera,
-        components: { GlobalWindow },
-        data () {
-            return {
-                // 琛ㄥ崟鏁版嵁
-                form: {
-                    id: null,
-                    name: '',
-                    companyName: '',
-                    insuranceId: '',
-                    validType: 0,
-                    type: 0,
-                    minAge: '',
-                    maxAge: '',
-                    price: '',
-                    timeUnit: '',
-                    insureCycle: '',
-                    insureCycleUnit: '',
-                    email: '',
-                    specialAgreement: '',
-                    specialInfo: '',
-                    ortherInfo: '',
-                    signKeyword: '',
-                    worktypeIdList: [{ worktypeId: '' }]
-                },
-                // 楠岃瘉瑙勫垯
-                rules: {
-                    name: [
-                        { required: true, message: '璇疯緭鍏ユ柟妗堝悕绉�' }
-                    ],
-                    insuranceId: [
-                        { required: true, message: '璇烽�夋嫨淇濋櫓鍏徃' }
-                    ],
-                    companyName: [
-                        { required: true, message: '璇疯緭鍏ユ壙淇濆叕鍙�' }
-                    ],
-                    minAge: [
-                        { required: true, message: '璇烽�夋嫨鎶曚繚骞撮緞' }
-                    ],
-                    price: [
-                        { required: true, message: '璇疯緭鍏ヤ繚闄╄垂鐢�' }
-                    ],
-                    insureCycle: [
-                        { required: true, message: '璇疯緭鍏ユ姇淇濆懆鏈�' }
-                    ],
-                    validType: [
-                        { required: true, message: '璇烽�夋嫨鐢熸晥鏃堕棿' }
-                    ],
-                    type: [
-                        { required: true, message: '璇烽�夋嫨鎶曚繚绫诲瀷' }
-                    ],
-                    signKeyword: [
-                        { required: true, message: '璇疯緭鍏ユ姇淇濆崟绛剧珷鍏抽敭瀛�' }
-                    ]
-                },
-                company: [],
-                typeWork: []
-            }
-        },
-        created () {
-            this.config({
-                api: '/business/solutions',
-                'field.id': 'id'
-            })
-        },
-        methods: {
-            // 鍒囨崲鍏徃
-            getAllWorktype1() {
-                this.form.worktypeIdList = [{ worktypeId: '' }]
-                this.getAllWorktype()
-            },
-            // 纭鏂板缓/淇敼
-            confirm () {
-                let 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.worktypeIdList = [{ worktypeId: '' }]
-                this.allCompany()
-                // 鏂板缓
-                if (target == null) {
-                    this.$nextTick(() => {
-                        this.$refs.form.resetFields()
-                        this.form[this.configData['field.id']] = null
-                    })
-                    return
-                }
-                // 缂栬緫
-                this.$nextTick(() => {
-                    solutionsId(target.id)
-                        .then(res => {
-                            for (const key in this.form) {
-                                this.form[key] = res[key]
-                            }
-                            this.form.worktypeIdList = res.worktypeList.map(item => {
-                                return {
-                                    worktypeId: item.worktypeId
-                                }
-                            })
-                            this.getAllWorktype()
-                        })
-                })
-            },
-            // 鏌ヨ淇濋櫓鍏徃涓嬪叏閮ㄥ伐绉�
-            getAllWorktype() {
-                allWorktype({
-                    insuranceId: this.form.insuranceId
-                }).then(res => {
-                    this.typeWork = res
-                })
-            },
-            // 鏌ヨ鍏ㄩ儴淇濋櫓鍏徃
-            allCompany() {
-                all({ dataType: 2 })
-                    .then(res => {
-                        console.log(res)
-                        this.company = res
-                    })
-            },
-            add() {
-                this.form.worktypeIdList.push({ worktypeId: '' })
-            },
-            dele(index) {
-                if (this.form.worktypeIdList.length === 1) {
-                    this.$message.warning('鑷冲皯瑕佷繚鐣欎竴椤�')
-                    return
-                }
-                this.form.worktypeIdList.splice(index, 1)
-            }
-        }
+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 { solutionsId } from '@/api/business/solutions'
+import { pageAll as shopList } from '@/api/business/company'
+import UploadFile from '@/components/common/UploadFile'
+import { checkMobile, numRule } from '@/utils/form'
+import RichEditor from '@/components/common/RichEditor'
+export default {
+  name: 'OperaSolutionsWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow, UploadFile, RichEditor },
+  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()
     }
+    return {
+      // 琛ㄥ崟鏁版嵁
+      form: {
+        id: null,
+        name: '',
+        companyName: '',
+        insuranceId: '',
+        validType: 0,
+        type: 0,
+        minAge: '',
+        maxAge: '',
+        price: '',
+        timeUnit: '',
+        shopId: null,
+        insureCycle: '',
+        insureCycleUnit: '',
+        email: '',
+        specialAgreement: '',
+        specialInfo: '',
+        ortherInfo: '',
+        signKeyword: '',
+        validTypeNum: '',
+        canReduce: 0,
+        canChangeUnit: 0,
+        addValidDays: 0,
+        delValidDays: 0,
+        delOnlyReplace: 0,
+        canAdd: 0,
+        fileList1: [],
+        fanganFile: null,
+        worktypeIdList: [{ worktypeId: '' }]
+      },
+      // 楠岃瘉瑙勫垯
+      rules: {
+        name: [
+          { required: true, message: '璇疯緭鍏ユ柟妗堝悕绉�' }
+        ],
+        delOnlyReplace: [
+          { required: true, message: '璇烽�夋嫨' }
+        ],
+        addValidDays: [
+          { validator: numRule }
+        ],
+        delValidDays: [
+          { validator: numRule }
+        ],
+        insuranceId: [
+          { required: true, message: '璇烽�夋嫨淇濋櫓鍏徃' }
+        ],
+        companyName: [
+          { required: true, message: '璇疯緭鍏ユ壙淇濆叕鍙�' }
+        ],
+        minAge: [
+          { required: true, message: '璇烽�夋嫨鎶曚繚骞撮緞' }
+        ],
+        price: [
+          { required: true, message: '璇疯緭鍏ユ柟妗堣垂鐢�' }
+        ],
+        insureCycleUnit: [
+          { required: true, message: '璇疯緭鍏ユ壒鏀硅璐瑰崟浣�' }
+        ],
+        validTypeNum: [
+          { required: true, validator: validType }
+        ],
+        type: [
+          { required: true, message: '璇烽�夋嫨鎶曚繚绫诲瀷' }
+        ]
+        // signKeyword: [
+        //     { required: false, message: '璇疯緭鍏ユ姇淇濆崟绛剧珷鍏抽敭瀛�' }
+        // ]
+      },
+      shops: [],
+      company: [],
+      typeWork: []
+    }
+  },
+  created () {
+    this.config({
+      api: '/business/solutions',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    getWangedditor(val){
+      this.form.specialAgreement = val;
+    },
+    getWangedditor1(val){
+      this.form.specialInfo = val;
+    },
+    getWangedditor2(val){
+      this.form.ortherInfo = val;
+    },
+
+    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, '')
+      }
+    },
+    changeTimeUnit () {
+      if (this.form.timeUnit < this.form.insureCycleUnit) {
+        this.form.insureCycleUnit = null
+      }
+    },
+    editFanganFile (data) {
+      this.form.fanganFile = data
+    },
+    // 鍒囨崲鍏徃
+    getAllWorktype1 () {
+      this.form.worktypeIdList = [{ worktypeId: '' }]
+      this.getAllWorktype()
+    },
+    // 纭鏂板缓/淇敼
+    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
+        }
+        if (data.type === 1 && (!data.fanganFile || !data.fanganFile.fileurl)) {
+          this.$message.error('璇蜂笂浼犳柟妗堢‘璁や功锛�')
+          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
+            })
+        }
+      })
+    },
+    deleFile () {
+      this.form.fanganFile = {}
+    },
+    open (title, target) {
+      this.title = title
+      this.visible = true
+      this.form.maxAge = ''
+      this.form.timeUnit = ''
+      this.form.insureCycleUnit = ''
+      this.form.validTypeNum = ''
+      this.form.fanganFile = null
+      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.fileList1 = []
+      this.form.worktypeIdList = [{ worktypeId: '' }]
+      // this.$refs['$upload'].clearFiles()//鍒濆鍖栧鍏ョ粍浠�
+      this.allCompany()
+      this.allShops()
+      // 鏂板缓
+      if (target == null) {
+        this.$nextTick(() => {
+          this.$refs.form.resetFields()
+          this.form.maxAge = ''
+          this.form.timeUnit = ''
+          this.form.insureCycleUnit = ''
+          this.form.validTypeNum = ''
+          this.form.fanganFile = null
+          this.form.fileList1 = []
+          this.form.worktypeIdList = [{ worktypeId: '' }]
+          this.form[this.configData['field.id']] = null
+        })
+        return
+      }
+      // 缂栬緫
+      this.$nextTick(() => {
+        solutionsId(target.id)
+          .then(res => {
+            for (const key in this.form) {
+              this.form[key] = res[key]
+            }
+            if (this.form.fanganFile && this.form.fanganFile.fileurl) {
+              this.form.fileList1 = [{ url: this.form.fanganFile.fileurlFull, name: this.form.fanganFile.name }]
+            }
+            console.log(this.form.fileList1)
+            this.form.worktypeIdList = res.worktypeList.map(item => {
+              return {
+                worktypeId: item.worktypeId
+              }
+            })
+            this.getAllWorktype()
+          })
+      })
+    },
+    // 鏌ヨ淇濋櫓鍏徃涓嬪叏閮ㄥ伐绉�
+    getAllWorktype () {
+      allWorktype({
+        insuranceId: this.form.insuranceId
+      }).then(res => {
+        this.typeWork = res
+      })
+    },
+
+    // 鏌ヨ鍏ㄩ儴淇濋櫓鍏徃
+    allCompany () {
+      all({ dataType: 2, status: 0 })
+        .then(res => {
+          console.log(res)
+          this.company = res
+        })
+    },
+    allShops () {
+      shopList({ type: 1, status: 0 })
+        .then(res => {
+          console.log(res)
+          this.shops = res
+        })
+    },
+    add () {
+      this.form.worktypeIdList.push({ worktypeId: '' })
+    },
+    dele (index) {
+      if (this.form.worktypeIdList.length === 1) {
+        this.$message.warning('鑷冲皯瑕佷繚鐣欎竴椤�')
+        return
+      }
+      this.form.worktypeIdList.splice(index, 1)
+    }
+  }
+}
 </script>

--
Gitblit v1.9.3