MrShi
2024-11-01 356f2f4c518734b87b8d816fbae0d3949c835cb6
优化
已添加4个文件
已修改4个文件
1018 ■■■■■ 文件已修改
company/.env.development 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/api/business/solutionsBase.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaSolutionsBaseDescWindow.vue 283 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaSolutionsBaseWindow.vue 390 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/business/insurance.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/business/solutions.vue 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/business/solutionsBase.vue 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/login.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/.env.development
@@ -7,8 +7,8 @@
VUE_APP_COOKIE_NAME='dmplat-auth-token'
# æµ‹è¯•服
VUE_APP_API = 'https://dmtest.ahapp.net/yyb_admin_api/'
# VUE_APP_API = 'http://localhost:10030/'
# VUE_APP_API = 'http://192.168.0.135:10030/'
# VUE_APP_API = 'https://www.yyb.red/yyb_admin_api/'
# ä»»åº·
# VUE_APP_API = 'http://192.168.0.138:10030/'
company/src/api/business/solutionsBase.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
import request from '../../utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  return request.post('/business/solutionsBase/page', data, {
    trim: true
  })
}
// åˆ›å»º
export function create (data) {
  return request.post('/business/solutionsBase/create', data)
}
// ä¿®æ”¹
export function updateById (data) {
  return request.post('/business/solutionsBase/updateById', data)
}
// åˆ é™¤
export function deleteById (id) {
  return request.get(`/business/solutionsBase/delete/${id}`)
}
// æ ¹æ®id查询
export function solutionsBaseId (id) {
  return request.get(`/business/solutionsBase/${id}`)
}
// æ‰¹é‡åˆ é™¤
export function deleteByIdInBatch (ids) {
  return request.get('/business/solutionsBase/delete/batch', {
    params: {
      ids
    }
  })
}
company/src/components/business/OperaSolutionsBaseDescWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,283 @@
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        text="修改"
        :withFooter="userInfo.type !== 1"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="$refs.operaSolutionsWindow.open('编辑方案', form)"
    >
        <div class="info">
            <div class="info_list">
                <div class="info_list_item">
                    <div class="info_list_item_label">方案名称:</div>
                    <div class="info_list_item_val">{{form.name}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">保险公司:</div>
                    <div class="info_list_item_val">{{form.insuranceName}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">承保公司:</div>
                    <div class="info_list_item_val">{{form.companyName}}</div>
                </div>
<!--                <div class="info_list_item">-->
<!--                    <div class="info_list_item_label">投保周期:</div>-->
<!--                    <div class="info_list_item_val">1月</div>-->
<!--                </div>-->
                <div class="info_list_item">
                    <div class="info_list_item_label">批改提醒时间:</div>
                    <div class="info_list_item_val">{{form.correctWarnTime}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">批增生效:</div>
                    <div class="info_list_item_val">{{form.addValidDays||0}} å¤©</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">批减生效:</div>
                    <div class="info_list_item_val">{{form.delOnlyReplace === 1 ? '是' : '否'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">批改支持:</div>
                    <div class="info_list_item_val">
                        <span style="margin-right: 50px">加保 <i  :class="form.canAdd ==1?'el-icon-circle-check':'el-icon-circle-close'" :style="form.canAdd ==1?'color:green;font-weight:bold':'color:red;font-weight:bold'"></i></span>
                        <span  style="margin-right: 50px">减保  <i   :class="form.canReduce ==1?'el-icon-circle-check':'el-icon-circle-close'" :style="form.canReduce ==1?'color:green;font-weight:bold':'color:red;font-weight:bold'"></i></span>
                        <span>更换派遣单位 <i   :class="form.canChangeUnit ==1?'el-icon-circle-check':'el-icon-circle-close'" :style="form.canChangeUnit ==1?'color:green;font-weight:bold':'color:red;font-weight:bold'"></i></span>
                    </div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">批减仅支持替换:</div>
                    <div class="info_list_item_val">是</div>
                </div>
            </div>
            <el-table
                :data="form.worktypeList"
                border
                style="width: 100%; margin-bottom: 20px;">
                <el-table-column
                        label="序号"
                        align="center"
                        width="80">
                    <template slot-scope="scope">
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                        prop="worktypeName"
                        align="center"
                        label="工种名称">
                </el-table-column>
            </el-table>
            <div class="info_agree">
                <div class="info_agree_label">特别约定:<div v-html="form.specialAgreement"></div></div>
                <div class="info_agree_label">特别说明:<div v-html="form.specialInfo"></div></div>
                <div class="info_agree_label">其他说明:<div v-html="form.ortherInfo"></div></div>
            </div>
        </div>
        <!-- ä¿®æ”¹ -->
        <OperaSolutionsWindow ref="operaSolutionsWindow" @success="callback"/>
        <OperaPdfViewerWindow ref="OperaPdfViewerWindow"  />
    </GlobalWindow>
</template>
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
  import OperaPdfViewerWindow from '@/components/business/OperaPdfViewerWindow'
  import { solutionsBaseId } from '@/api/business/solutionsBase'
  import { mapState } from 'vuex'
  export default {
    name: 'OperaSolutionsBaseDescWindow',
    extends: BaseOpera,
    components: { GlobalWindow, OperaPdfViewerWindow,OperaSolutionsWindow },
    data () {
      return {
        // è¡¨å•数据
        form: {
          id: null,
          name: '',
          companyName: '',
          insuranceId: '',
          validType: 0,
          type: 0,
          minAge: '',
          maxAge: '',
          price: '',
          timeUnit: '',
          insureCycle: '',
          shopName: '',
          insureCycleUnit: '',
          validTypeNum: '',
          email: '',
          canReduce: 0,
          canChangeUnit: 0,
          addValidDays: 0,
          delValidDays: 0,
          delOnlyReplace: 0,
          canAdd: 0,
          correctWarnTime: '',
          specialAgreement: '',
          specialInfo: '',
          ortherInfo: '',
          insuranceName: '',
          signKeyword: '',
          worktypeList: [],
          worktypeIdList: []
        }
      }
    },
    computed: {
      ...mapState(['userInfo'])
    },
    created () {
      this.config({
        api: '/business/solutionsBase',
        'field.id': 'id'
      })
    },
    methods: {
      open (title, target) {
        this.title = title
        this.visible = true
        this.form = {
          id: null,
          name: '',
          companyName: '',
          insuranceId: '',
          validType: 0,
          type: 0,
          minAge: '',
          maxAge: '',
          price: '',
          timeUnit: '',
          insureCycle: '',
          shopName: '',
          insureCycleUnit: '',
          validTypeNum: '',
          email: '',
          specialAgreement: '',
          specialInfo: '',
          ortherInfo: '',
          fanganFile: null,
          canReduce: 0,
          canChangeUnit: 0,
          addValidDays: 0,
          correctWarnTime: '',
          delValidDays: 0,
          delOnlyReplace: 0,
          canAdd: 0,
          insuranceName: '',
          signKeyword: '',
          worktypeList: [],
          worktypeIdList: []
        }
        this.$nextTick(() => {
          for (const key in this.form) {
            this.form[key] = target[key]
          }
          this.getDetails()
        })
      },
      openFile (url) {
        setTimeout(() => {
          this.$refs.OperaPdfViewerWindow.open('方案确认书',url)
          // window.open(url)
        }, 500)
      },
      getDetails () {
        solutionsBaseId(this.form.id)
          .then(res => {
            for (const key in this.form) {
              this.form[key] = res[key]
            }
            if (res.worktypeList) {
              this.form.worktypeIdList = res.worktypeList.map(item => {
                return {
                  worktypeId: item.worktypeId
                }
              })
            }
          })
      },
      callback () {
        this.$emit('success')
        this.visible = false
      }
    }
  }
</script>
<style lang="scss" scoped>
    .info {
        width: 100%;
        .info_agree {
            width: 100%;
            display: flex;
            flex-direction: column;
            margin-top: 20px;
            .info_agree_label {
                font-size: 14px;
                font-weight: 500;
                color: #000000;
                margin-top: 5px;
            }
            .info_agree_val {
                font-size: 14px;
                font-weight: 500;
                color: #000000;
                margin-top: 5px;
            }
        }
        .info_label {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            span {
                font-size: 18px;
                font-weight: 500;
                color: #000000;
            }
        }
        .info_fwb {
            width: 100%;
            margin-top: 20px;
        }
        .info_list {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            .info_list_item {
                width: 50%;
                display: flex;
                align-items: start;
                margin-bottom: 20px;
                .info_list_item_label {
                    flex-shrink: 0;
                }
                .info_list_item_val {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    .image {
                        width: 100px;
                        height: 100px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        overflow: hidden;
                        img {
                            width: 100%;
                        }
                    }
                }
            }
        }
    }
</style>
company/src/components/business/OperaSolutionsBaseWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,390 @@
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <el-form :model="form" ref="form" :rules="rules">
            <el-form-item label="方案名称" prop="name">
                <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-form-item>
            <el-form-item label="承保公司" prop="companyName">
                <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" 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" 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>
            <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>
            </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>
            </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>
            </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="correctWarnTime">{{form.correctWarnTime}}
                <el-time-picker
                    value-format="HH:hh:mm"
                    v-model="form.correctWarnTime"
                    placeholder="请选择批改提醒时间">
                </el-time-picker>
            </el-form-item>
            <el-button type="primary" @click="add" style="margin-bottom: 10px;">添加工种</el-button>
            <el-table
                :data="form.worktypeIdList"
                border
                style="width: 100%; margin-bottom: 20px;">
                <el-table-column
                    label="序号"
                    align="center"
                    width="80">
                    <template slot-scope="scope">
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                    align="center"
                    label="所属工种">
                    <template slot-scope="{row}">
                        <el-select filterable v-model="row.worktypeId" placeholder="请选择">
                            <el-option
                                v-for="item in typeWork"
                                :key="item.id"
                                :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </template>
                </el-table-column>
                <el-table-column
                    label="操作"
                    align="center"
                    width="100">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" style="color: red;" @click="dele(scope.$index)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <el-form-item label="特别约定" prop="specialAgreement">
                <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"/>
            </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"/>
            </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 { 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'
  export default {
    name: 'OperaSolutionsBaseWindow',
    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()
      }
      var canAddFun = (rule, value, callback) => {
        if (!this.form.canAdd && !form.canReduce && !form.canChangeUnit) {
          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,
          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: []
      }
    },
    created () {
      this.config({
        api: '/business/solutionsBase',
        '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, '')
        }
      },
      // åˆ‡æ¢å…¬å¸
      getAllWorktype1 () {
        this.form.worktypeIdList = [{ worktypeId: '' }]
        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)
        data.correctWarnTime = data.correctWarnTime.substring(0, data.correctWarnTime.lastIndexOf(':'))
        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 = [{ worktypeId: '' }]
        // 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 = [{ worktypeId: '' }]
            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`
              console.log(this.form.correctWarnTime)
              if (res.worktypeList) {
                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>
company/src/views/business/insurance.vue
@@ -27,6 +27,10 @@
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="保险公司" min-width="100px"></el-table-column>
                <el-table-column prop="name" label="LOGO" min-width="100px"></el-table-column>
                <el-table-column prop="name" label="英文名称" min-width="100px"></el-table-column>
                <el-table-column prop="name" label="联系人" min-width="100px"></el-table-column>
                <el-table-column prop="name" label="联系电话" min-width="100px"></el-table-column>
                <el-table-column label="启用状态" min-width="100px">
                    <template slot-scope="{row}">
                        <el-switch
company/src/views/business/solutions.vue
@@ -5,18 +5,6 @@
            <el-form-item label="保险方案" prop="name">
                <el-input v-model="searchForm.name" placeholder="请输入" @keypress.enter.native="search"></el-input>
            </el-form-item>
            <el-form-item label="启用状态" prop="status" v-if="userInfo.type !== 1">
                <el-select v-model="searchForm.status" placeholder="请选择" @keypress.enter.native="search">
                    <el-option label="启用" value="0"></el-option>
                    <el-option label="禁用" value="1"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="类型" prop="type" >
                <el-select v-model="searchForm.type" placeholder="请选择" @keypress.enter.native="search">
                    <el-option label="直保" value="0"></el-option>
                    <el-option label="委托投保" value="1"></el-option>
                </el-select>
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button @click="reset">重置</el-button>
@@ -39,51 +27,39 @@
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="保险方案" min-width="150px"></el-table-column>
                <el-table-column prop="insuranceName" label="保险公司" min-width="100px"></el-table-column>
                <el-table-column label="投保年龄" min-width="100px">
                    <template slot-scope="{row}">
                        <span>{{row.minAge}}至{{row.maxAge}}岁</span>
                    </template>
                </el-table-column>
                <el-table-column label="投保生效日期" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.validType === 0">{{row.validTypeNum}}日后生效</span>
                        <span v-if="row.validType === 1">次月生效</span>
                    </template>
                </el-table-column>
<!--                <el-table-column prop="addValidDays"  label="批增生效时间" min-width="100px">   </el-table-column>
                <el-table-column prop="delValidDays"  label="批减生效时间" min-width="100px">   </el-table-column>-->
                <el-table-column label="方案费用" min-width="100px">
                    <template slot-scope="{row}">
                        <span>{{row.price}}元/人/</span>
                        <span v-if="row.timeUnit === 0">天</span>
<!--                        <span v-if="row.timeUnit === 1">半月</span>-->
                        <span v-if="row.timeUnit === 2">月</span>
                        <span v-if="row.timeUnit === 3">季度</span>
                        <span v-if="row.timeUnit === 4">半年</span>
                        <span v-if="row.timeUnit === 5">å¹´</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="子方案名称" min-width="150px"></el-table-column>
                <el-table-column prop="insuranceName" label="主方案" min-width="100px"></el-table-column>
                <el-table-column label="投保类型" min-width="120px" align="center">
                    <template slot-scope="{row}">
                        <span v-if="row.type === 0">直保</span>
                        <span v-if="row.type === 1">委托<div style="color: blue;display:  block" >{{row.shopName||'-'}}</div></span>
                    </template>
                </el-table-column>
                <el-table-column label="投保价格" min-width="100px">
                    <template slot-scope="{row}">
                        <span>{{row.price}}元/人/</span>
                        <span v-if="row.timeUnit === 0">天</span>
                        <!--                        <span v-if="row.timeUnit === 1">半月</span>-->
                        <span v-if="row.timeUnit === 2">月</span>
                        <span v-if="row.timeUnit === 3">季度</span>
                        <span v-if="row.timeUnit === 4">半年</span>
                        <span v-if="row.timeUnit === 5">å¹´</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="需要复审"></el-table-column>
                <el-table-column prop="createDate" label="方案创建日期" min-width="100px"></el-table-column>
                <el-table-column prop="status" label="启用状态" min-width="100px" v-if="userInfo.type !== 1">
                    <template slot-scope="{row}">
                        <el-switch
                            @change="changeStatus($event, row)"
                            v-model="row.status"
                            active-color="#13ce66"
                            inactive-color="#ff4949"
                            :active-value="0"
                            :inactive-value="1">
                                @change="changeStatus($event, row)"
                                v-model="row.status"
                                active-color="#13ce66"
                                inactive-color="#ff4949"
                                :active-value="0"
                                :inactive-value="1">
                        </el-switch>
                    </template>
                </el-table-column>
                <el-table-column prop="createDate" label="方案日期" min-width="100px"></el-table-column>
                <el-table-column
                    v-if="containPermissions(['business:solutions:update', 'business:solutions:delete'])"
                    label="操作"
@@ -112,55 +88,55 @@
    </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
import OperaSolutionsDescWindow from '@/components/business/OperaSolutionsDescWindow'
import { updateStatus } from '@/api/business/solutions'
import { mapState } from 'vuex'
export default {
  name: 'Solutions',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaSolutionsWindow, OperaSolutionsDescWindow },
  data () {
    return {
      // æœç´¢
      searchForm: {
        name: '',
        status: '',
        type: ''
  import BaseTable from '@/components/base/BaseTable'
  import TableLayout from '@/layouts/TableLayout'
  import Pagination from '@/components/common/Pagination'
  import OperaSolutionsWindow from '@/components/business/OperaSolutionsWindow'
  import OperaSolutionsDescWindow from '@/components/business/OperaSolutionsDescWindow'
  import { updateStatus } from '@/api/business/solutions'
  import { mapState } from 'vuex'
  export default {
    name: 'Solutions',
    extends: BaseTable,
    components: { TableLayout, Pagination, OperaSolutionsWindow, OperaSolutionsDescWindow },
    data () {
      return {
        // æœç´¢
        searchForm: {
          name: '',
          status: '',
          type: ''
        }
      }
    },
    computed: {
      ...mapState(['userInfo'])
    },
    created () {
      this.config({
        module: '保险方案信息表',
        api: '/business/solutions',
        'field.id': 'id',
        'field.main': 'id'
      })
      if (this.userInfo.type === 1) {
        this.searchForm.status = '0'
      } else {
        this.searchForm.status = ''
      }
      this.search()
    },
    methods: {
      // ä¿®æ”¹çŠ¶æ€
      changeStatus (status, row) {
        updateStatus({ id: row.id, status })
          .then(res => {
            this.search()
          })
          .catch(err => {
            row.status = row.status === 0 ? 1 : 0
          })
      }
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  created () {
    this.config({
      module: '保险方案信息表',
      api: '/business/solutions',
      'field.id': 'id',
      'field.main': 'id'
    })
    if (this.userInfo.type === 1) {
      this.searchForm.status = '0'
    } else {
      this.searchForm.status = ''
    }
    this.search()
  },
  methods: {
    // ä¿®æ”¹çŠ¶æ€
    changeStatus (status, row) {
      updateStatus({ id: row.id, status })
        .then(res => {
          this.search()
        })
        .catch(err => {
          row.status = row.status === 0 ? 1 : 0
        })
    }
  }
}
</script>
company/src/views/business/solutionsBase.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,134 @@
<template>
    <TableLayout :permissions="['business:solutions:query']">
        <!-- æœç´¢è¡¨å• -->
        <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
            <el-form-item label="保险方案" prop="name">
                <el-input v-model="searchForm.name" placeholder="请输入" @keypress.enter.native="search"></el-input>
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button @click="reset">重置</el-button>
            </section>
        </el-form>
        <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:solutions:create']">
                <template v-if="userInfo.type !== 1">
                    <li><el-button type="primary" @click="$refs.operaSolutionsBaseWindow.open('新建主方案')" v-permissions="['business:solutions:create']">添加方案</el-button></li>
                </template>
            </ul>
            <el-table
                v-loading="isWorking.search"
                :data="tableData.list"
                stripe
            >
                <el-table-column label="序号" width="50px">
                    <template slot-scope="scope">
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="保险方案" min-width="150px"></el-table-column>
                <el-table-column prop="insuranceName" label="保险公司" min-width="100px"></el-table-column>
                <el-table-column label="投保年龄" min-width="100px">
                    <template slot-scope="{row}">
                        <span>{{row.minAge}}至{{row.maxAge}}岁</span>
                    </template>
                </el-table-column>
                <el-table-column label="投保生效日期" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.validType === 0">{{row.validTypeNum}}日后生效</span>
                        <span v-if="row.validType === 1">次月生效</span>
                    </template>
                </el-table-column>
                <el-table-column prop="createDate" label="方案创建日期" min-width="100px"></el-table-column>
                <el-table-column prop="status" label="启用状态" min-width="100px" v-if="userInfo.type !== 1">
                    <template slot-scope="{row}">
                        <el-switch
                            @change="changeStatus($event, row)"
                            v-model="row.status"
                            active-color="#13ce66"
                            inactive-color="#ff4949"
                            :active-value="0"
                            :inactive-value="1">
                        </el-switch>
                    </template>
                </el-table-column>
                <el-table-column
                    v-if="containPermissions(['business:solutions:update', 'business:solutions:delete'])"
                    label="操作"
                    min-width="180"
                    fixed="right"
                >
                    <template slot-scope="{row}">
                        <el-button type="text" @click="$refs.operaSolutionsBaseDescWindow.open('方案详情', { id: row.id })" icon="el-icon-edit" v-permissions="['business:solutions:update']">查看详情</el-button>
                        <template v-if="userInfo.type !== 1">
                            <el-button type="text" @click="$refs.operaSolutionsBaseWindow.open('编辑主方案', { id: row.id })" icon="el-icon-edit" v-permissions="['business:solutions:update']">修改</el-button>
                        </template>
                        <el-button type="text" @click="deleteById(row)" icon="el-icon-delete">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
                @current-change="handlePageChange"
                :pagination="tableData.pagination"
            >
            </pagination>
        </template>
        <!-- ä¿®æ”¹ -->
        <OperaSolutionsBaseWindow ref="operaSolutionsBaseWindow" @success="handlePageChange"/>
        <!-- è¯¦æƒ… -->
        <OperaSolutionsBaseDescWindow ref="operaSolutionsBaseDescWindow" @success="handlePageChange"/>
    </TableLayout>
</template>
<script>
  import BaseTable from '@/components/base/BaseTable'
  import TableLayout from '@/layouts/TableLayout'
  import Pagination from '@/components/common/Pagination'
  import OperaSolutionsBaseWindow from '@/components/business/OperaSolutionsBaseWindow'
  import OperaSolutionsBaseDescWindow from '@/components/business/OperaSolutionsBaseDescWindow'
  import { updateStatus } from '@/api/business/solutionsBase'
  import { mapState } from 'vuex'
  export default {
    name: 'mainPlan',
    extends: BaseTable,
    components: { TableLayout, Pagination, OperaSolutionsBaseWindow, OperaSolutionsBaseDescWindow },
    data () {
      return {
        // æœç´¢
        searchForm: {
          name: ''
        }
      }
    },
    computed: {
      ...mapState(['userInfo'])
    },
    created () {
      this.config({
        module: '主方案信息表',
        api: '/business/solutionsBase',
        'field.id': 'id',
        'field.main': 'id'
      })
      if (this.userInfo.type === 1) {
        this.searchForm.status = '0'
      } else {
        this.searchForm.status = ''
      }
      this.search()
    },
    methods: {
      // ä¿®æ”¹çŠ¶æ€
      changeStatus (status, row) {
        updateStatus({ id: row.id, status })
          .then(res => {
            this.search()
          })
          .catch(err => {
            row.status = row.status === 0 ? 1 : 0
          })
      }
    }
  }
</script>
company/src/views/login.vue
@@ -139,7 +139,7 @@
      if (this.loading) {
        return
      }
      if (this.readed != 1) {
      if (this.readed !== 1) {
        this.$message.error('请先阅读和同意《服务协议》和《隐私协议》')
        return
      }