aaa
nidapeng
2024-03-14 8b46c471e28fbf0b71efbe363facf0bf05d8f6f8
aaa
已修改14个文件
1019 ■■■■■ 文件已修改
company/src/api/business/company.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaCompanyDescWindow.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaCompanyWindow.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaShopDescWindow.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaShopWindow.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaSolutionsDescWindow.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaSolutionsWindow.vue 393 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/modification.vue 230 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/business/solutions.vue 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/CompanySolution.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/Solutions.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/CompanySolutionServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/api/business/company.js
@@ -11,6 +11,9 @@
export function create (data) {
    return request.post('/business/company/create', data)
}
export function createShop (data) {
    return request.post('/business/company/createShop', data)
}
// 修改
export function updateById (data) {
company/src/components/business/OperaCompanyDescWindow.vue
@@ -82,6 +82,11 @@
                    label="保险方案">
                </el-table-column>
                <el-table-column
                    prop="shopName"
                    align="center"
                    label="委托商户">
                </el-table-column>
                <el-table-column
                    align="center"
                    label="加减保功能">
                    <template slot-scope="{row}">
@@ -127,7 +132,7 @@
                        </div>
                    </div>
                </div>
                <div class="info_list_item">
<!--                <div class="info_list_item">
                    <div class="info_list_item_label" style="width: 100px;">企业签章:</div>
                    <div class="info_list_item_val">
                        <div class="image" v-if="form.signImg && form.signImg.fileurlFull">
@@ -139,7 +144,7 @@
                          </el-image>
                        </div>
                    </div>
                </div>
                </div>-->
            </div>
        </div>
        <!-- 新建/修改 -->
@@ -321,6 +326,7 @@
              that.form.solutionList = resa.map(item => {
                return {
                  solutionBaseId: item.solutionBaseId,
                  shopId: item.shopId,
                  canAdd: item.canAdd,
                  canReduce: item.canReduce
                }
@@ -328,6 +334,7 @@
              that.form.solutionListName = resa.map(item => {
                return {
                  solutionName: item.solutionName,
                  shopName: item.shopName,
                  canAdd: item.canAdd,
                  canReduce: item.canReduce
                }
company/src/components/business/OperaCompanyWindow.vue
@@ -98,6 +98,20 @@
            </el-table-column>
            <el-table-column
                align="center"
                label="委托商户">
                <template slot-scope="scope">
                  <el-select  v-model="scope.row.shopId" clearable="true" value-key="id" placeholder="请选择" >
                    <el-option
                        v-for="item in shops"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                    </el-option>
                  </el-select>
                </template>
            </el-table-column>
            <el-table-column
                align="center"
                label="加减保功能">
                <template slot-scope="{row}">
                    <el-checkbox :true-label="1" :false-label="0" v-model="row.canAdd">加保</el-checkbox>
@@ -122,6 +136,7 @@
import UploadAvatarImage from '@/components/common/UploadAvatarImage'
import { all } from '@/api/business/solutions'
import { sendSms } from '@/api/business/smsEmail'
import { pageAll as shopList } from '@/api/business/company'
export default {
  name: 'OperaCompanyWindow',
  extends: BaseOpera,
@@ -156,6 +171,7 @@
        solutionList: [
          {
            solution: null,
            shop: null,
            canAdd: 0,
            canReduce: 0
          }
@@ -218,7 +234,8 @@
          { required: true, message: '请输入公司账号' }
        ]
      },
      programme: []
      programme: [],
      shops:[]
    }
  },
  created () {
@@ -240,7 +257,6 @@
  methods: {
    changeSolution(row,index){
     this.form.solutionList[index].solution=row
   //   console.log(this.form.solutionList)
    },
    send () {
      if (!this.form.phone) {
@@ -288,6 +304,11 @@
        .then(res => {
          this.programme = res
        })
      shopList({ type: 1, status: 0 })
          .then(res => {
            console.log(res)
            this.shops = res
          })
    },
    dele (index) {
      if (this.form.solutionList.length === 1) {
@@ -298,8 +319,9 @@
    },
    add () {
      this.form.solutionList.push({
        solutionId:null,
        solutionId: null,
        solution: {},
        shopId: null,
        canAdd: '',
        canReduce: ''
      })
company/src/components/business/OperaShopDescWindow.vue
@@ -9,15 +9,14 @@
    >
        <div class="info">
            <div class="info_label">
                <span>企业详情</span>
                <span>商户详情</span>
                <div>
                    <el-button type="primary" @click="$refs.modification.open('修改保险方案', form)">更改保险方案</el-button>
                    <el-button type="primary" @click="$refs.operaCompanyWindow.open('编辑企业信息', form)">修改企业信息</el-button>
                    <el-button type="primary" @click="$refs.operaCompanyWindow.open('编辑商户信息', form)">修改商户信息</el-button>
                </div>
            </div>
            <div class="info_list">
                <div class="info_list_item">
                    <div class="info_list_item_label">企业名称:</div>
                    <div class="info_list_item_label">商户名称:</div>
                    <div class="info_list_item_val">{{form.name || '-'}}</div>
                </div>
                <div class="info_list_item">
@@ -64,32 +63,6 @@
                    <div class="info_list_item_val">{{form.invoiceAddr || '-'}}</div>
                </div>
            </div>
            <el-table
                :data="form.solutionListName"
                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="solutionName"
                    align="center"
                    label="保险方案">
                </el-table-column>
                <el-table-column
                    align="center"
                    label="加减保功能">
                    <template slot-scope="{row}">
                        <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canAdd">加保</el-checkbox>
                        <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canReduce">减保</el-checkbox>
                    </template>
                </el-table-column>
            </el-table>
            <div class="info_list" v-if="JSON.stringify(form) !== '{}'">
                <div class="info_list_item">
                    <div class="info_list_item_label" style="width: 100px;">营业执照:</div>
@@ -127,23 +100,10 @@
                        </div>
                    </div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label" style="width: 100px;">企业签章:</div>
                    <div class="info_list_item_val">
                        <div class="image" v-if="form.signImg && form.signImg.fileurlFull">
                          <el-image
                              v-if="form.signImg.fileurlFull!=null"
                              style="width: 90px; height: 90px"
                              :src="form.signImg.fileurlFull"
                              :preview-src-list="[form.signImg.fileurlFull]">
                          </el-image>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 新建/修改 -->
        <OperaCompanyWindow ref="operaCompanyWindow" @success="callback"/>
        <OperaShopWindow ref="operaCompanyWindow" @success="callback"/>
        <!-- 修改保险方案 -->
        <modification ref="modification" @success="callback"/>
        <!-- 修改手机号 -->
@@ -182,15 +142,14 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
import OperaShopWindow from '@/components/business/OperaShopWindow'
import modification from '@/components/business/modification'
import { getById, updatePhone } from '@/api/business/company'
import { listForCompany } from '@/api/business/solutions'
import { sendSms } from '@/api/business/smsEmail'
export default {
  name: 'OperaCompanyDescWindow',
  extends: BaseOpera,
  components: { GlobalWindow, OperaCompanyWindow, modification },
  components: { GlobalWindow, OperaShopWindow, modification },
  data () {
    return {
      ruleForm: {
@@ -267,17 +226,16 @@
      }, 1000)
    },
    open (title, target) {
      const that = this
      this.title = title
      this.dataId = target.id
      this.phone = ''
      this.code = ''
      this.visible=true
      clearInterval(this.timer)
      this.num = 0
      this.getDetail()
    },
    getDetail () {
      var that = this
      getById(this.dataId)
        .then(res => {
          this.form = res
@@ -315,26 +273,6 @@
            this.form.file3.imgurl = res.signImg.fileurl
            this.form.file3.imgurlfull = res.signImg.fileurlFull
          }
          listForCompany({ companyId: this.dataId })
            .then(resa => {
              that.form.solutionList = resa.map(item => {
                return {
                  solutionBaseId: item.solutionBaseId,
                  canAdd: item.canAdd,
                  canReduce: item.canReduce
                }
              })
              that.form.solutionListName = resa.map(item => {
                return {
                  solutionName: item.solutionName,
                  canAdd: item.canAdd,
                  canReduce: item.canReduce
                }
              })
              console.log(that.form)
              that.visible = true
            })
        })
    },
    callback () {
company/src/components/business/OperaShopWindow.vue
@@ -4,7 +4,7 @@
        width="60%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
        @confirm="confirmShop"
    >
        <el-form :model="form" ref="form" :rules="rules" style="width: 50%;">
            <el-form-item label="商户名称" prop="name">
@@ -78,6 +78,7 @@
import UploadAvatarImage from '@/components/common/UploadAvatarImage'
import { all } from '@/api/business/solutions'
import { sendSms } from '@/api/business/smsEmail'
import {updateById} from "@/api/business/company";
export default {
  name: 'OperaCompanyWindow',
  extends: BaseOpera,
@@ -85,7 +86,7 @@
  data () {
    return {
      // 表单数据
      initParam:{
      initParam: {
        id: null,
        name: '',
        code: '',
@@ -133,7 +134,7 @@
        file3: {
          imgurl: '',
          imgurlfull: ''
        },
        }
      },
      form: {},
      timer: null,
@@ -195,9 +196,42 @@
    }
  },
  methods: {
    changeSolution(row,index){
     this.form.solutionList[index].solution=row
   //   console.log(this.form.solutionList)
    confirmShop () {
      this.$refs.form.validate((valid) => {
        // debugger
        if (!valid) {
          return
        }
        // 调用新建接口
        this.isWorking = true
        if (this.form.id == null || this.form.id === '') {
          this.api.createShop(this.form)
            .then(() => {
              this.visible = false
              this.$tip.apiSuccess('新建成功')
              this.$emit('success')
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.isWorking = false
            })
        } else {
          this.api.updateById(this.form)
            .then(() => {
              this.visible = false
              this.$tip.apiSuccess('新建成功')
              this.$emit('success')
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.isWorking = false
            })
        }
      })
    },
    send () {
      if (!this.form.phone) {
@@ -219,7 +253,7 @@
        }
      }, 1000)
    },
    open (title, target,type) {
    open (title, target, type) {
      this.title = title
      this.visible = true
      this.form = this.initParam
@@ -255,7 +289,7 @@
    },
    add () {
      this.form.solutionList.push({
        solutionId:null,
        solutionId: null,
        solution: {},
        canAdd: '',
        canReduce: ''
company/src/components/business/OperaSolutionsDescWindow.vue
@@ -22,13 +22,18 @@
                    <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" v-if="form.type === 0 "> 直保</div>
                <div class="info_list_item_val" v-if="form.type === 1">委托投保</div>
              </div>
              <div class="info_list_item" v-if="form.type === 1">
                <div class="info_list_item_label">委托商户:</div>
                <div class="info_list_item_val" > {{form.shopName}}</div>
              </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">投保年龄:</div>
                    <div class="info_list_item_val">{{form.minAge}}至{{form.maxAge}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">投保类型:</div>
                    <div class="info_list_item_val">平台投保</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">保险费用:</div>
@@ -54,10 +59,7 @@
                    <div class="info_list_item_label">生效时间:</div>
                    <div class="info_list_item_val">{{form.validType === 0 ? form.validTypeNum + '日后生效' : '次月生效'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">投保类型:</div>
                    <div class="info_list_item_val">{{form.type === 0 ? '直保' : '委托投保'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">接收文件邮箱:</div>
                    <div class="info_list_item_val">{{form.email}}</div>
@@ -78,7 +80,7 @@
                <el-table-column
                    prop="worktypeName"
                    align="center"
                    label="所属工种">
                    label="工种名称">
                </el-table-column>
            </el-table>
            <div class="info_agree">
@@ -117,6 +119,7 @@
                    price: '',
                    timeUnit: '',
                    insureCycle: '',
                    shopName:'',
                    insureCycleUnit: '',
                    validTypeNum: '',
                    email: '',
@@ -143,6 +146,30 @@
            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: '',
                    insuranceName: '',
                    signKeyword: '',
                    worktypeList: [],
                    worktypeIdList: []
              }
                this.$nextTick(() => {
                    for (const key in this.form) {
                        this.form[key] = target[key]
company/src/components/business/OperaSolutionsWindow.vue
@@ -85,6 +85,16 @@
                    <el-radio :label="1">委托投保</el-radio>
                </el-radio-group>
            </el-form-item>
          <el-form-item label="委托商户" prop="shopId" v-if="form.type =='1'">
            <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="email">
                <el-input v-model="form.email" placeholder="请输入" v-trim/>
            </el-form-item>
@@ -141,191 +151,202 @@
</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 () {
            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: '',
                    insureCycle: '',
                    insureCycleUnit: '',
                    email: '',
                    specialAgreement: '',
                    specialInfo: '',
                    ortherInfo: '',
                    signKeyword: '',
                    validTypeNum: '',
                    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: '请输入投保周期' }
                    ],
                    validTypeNum: [
                        { required: true, validator: validType }
                    ],
                    type: [
                        { required: true, message: '请选择投保类型' }
                    ],
                    // signKeyword: [
                    //     { required: false, 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.form.maxAge = ''
                this.form.timeUnit = ''
                this.form.insureCycleUnit = ''
                this.form.validTypeNum = ''
                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, status: 0 })
                    .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'
export default {
  name: 'OperaSolutionsWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  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: '',
        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: '请输入投保周期' }
        ],
        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: {
    // 切换公司
    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
        }
        // 调用新建接口
        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.form.maxAge = ''
      this.form.timeUnit = ''
      this.form.insureCycleUnit = ''
      this.form.validTypeNum = ''
      this.visible = true
      this.form.worktypeIdList = [{ worktypeId: '' }]
      this.allCompany()
      this.allShops()
      // 新建
      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, 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/components/business/modification.vue
@@ -34,6 +34,20 @@
                    </el-select>
                </template>
            </el-table-column>
          <el-table-column
              align="center"
              label="委托商户">
            <template slot-scope="scope">
              <el-select  v-model="scope.row.shopId" clearable="true" value-key="id" placeholder="请选择">
                <el-option
                    v-for="item in shops"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
            <el-table-column
                align="center"
                label="加减保功能">
@@ -55,110 +69,118 @@
</template>
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import { all } from '@/api/business/solutions'
    import { listForCompany } from '@/api/business/solutions'
    import { updateSolutions } from '@/api/business/company'
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { all, listForCompany } from '@/api/business/solutions'
    export default {
        name: 'modification',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                // 表单数据
                form: {
                    id: null,
                    solutionList: [
                        {
                            solution: { id: null, baseId: null },
                            canAdd: 0,
                            canReduce: 0
                        }
                    ]
                },
                // 验证规则
                rules: {
                    solutionList: [
                        { required: true, message: '请输入公司账号' }
                    ]
                },
                programme: []
            }
        },
        created () {
            this.config({
                api: '/business/company',
                'field.id': 'id'
            })
        },
        methods: {
            changeSolution(e, index) {
                let baseId = ''
                this.programme.forEach(item => {
                    if (item.id === e) {
                        baseId = item.baseId
                    }
                })
                this.form.solutionList[index].solution.baseId = baseId
            },
            confirm() {
                this.isWorking = true
                updateSolutions(this.form)
                    .then(res => {
                        this.visible = false
                        this.$tip.apiSuccess('新建成功')
                        this.$emit('success')
                    })
                    .catch(e => {
                        this.$tip.apiFailed(e)
                    })
                    .finally(() => {
                        this.isWorking = false
                    })
            },
            // 获取全部方案
            getAll() {
                all({ dataType: 2 })
                    .then(res => {
                        this.programme = res
                    })
            },
            open (title, target) {
                var that = this;
                this.title = title
                for (const key in this.form) {
                    this.form[key] = target[key]
                }
                this.getAll()
                listForCompany({ companyId: target.id })
                    .then(resa => {
                        that.form.solutionList = resa.map(item => {
                            return {
                                solution: {id: item.solutionId, baseId: item.solutionBaseId },
                                canAdd: item.canAdd,
                                canReduce: item.canReduce
                            }
                        })
                        console.log(that.form.solutionList)
                        that.visible = true
                    })
            },
            add() {
                this.form.solutionList.push({
                    solution: { id: null, baseId: null },
                    canAdd: '',
                    canReduce: ''
                })
            },
            dele(index) {
                if (this.form.solutionList.length === 1) {
                    this.$message.warning('至少保留一项')
                    return
                }
                this.form.solutionList.splice(index, 1)
            }
        }
import { updateSolutions, pageAll as shopList } from '@/api/business/company'
export default {
  name: 'modification',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      // 表单数据
      form: {
        id: null,
        solutionList: [
          {
            solution: { id: null, baseId: null },
            canAdd: 0,
            canReduce: 0
          }
        ]
      },
      // 验证规则
      rules: {
        solutionList: [
          { required: true, message: '请输入公司账号' }
        ]
      },
      programme: [],
      shops: []
    }
  },
  created () {
    this.config({
      api: '/business/company',
      'field.id': 'id'
    })
  },
  methods: {
    changeSolution (e, index) {
      let baseId = ''
      this.programme.forEach(item => {
        if (item.id === e) {
          baseId = item.baseId
        }
      })
      this.form.solutionList[index].solution.baseId = baseId
    },
    confirm () {
      this.isWorking = true
      updateSolutions(this.form)
        .then(res => {
          this.visible = false
          this.$tip.apiSuccess('新建成功')
          this.$emit('success')
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking = false
        })
    },
    // 获取全部方案
    getAll () {
      all({ dataType: 2 })
        .then(res => {
          this.programme = res
        })
      shopList({ type: 1, status: 0 })
        .then(res => {
          console.log(res)
          this.shops = res
        })
    },
    open (title, target) {
      var that = this
      this.title = title
      for (const key in this.form) {
        this.form[key] = target[key]
      }
      this.getAll()
      listForCompany({ companyId: target.id })
        .then(resa => {
          that.form.solutionList = resa.map(item => {
            return {
              solution: { id: item.solutionId, baseId: item.solutionBaseId },
              shopId: item.shopId,
              canAdd: item.canAdd,
              canReduce: item.canReduce
            }
          })
          console.log(that.form.solutionList)
          that.visible = true
        })
    },
    add () {
      this.form.solutionList.push({
        solution: { id: null, baseId: null },
        shopId: null,
        canAdd: '',
        canReduce: ''
      })
    },
    dele (index) {
      if (this.form.solutionList.length === 1) {
        this.$message.warning('至少保留一项')
        return
      }
      this.form.solutionList.splice(index, 1)
    }
  }
}
</script>
company/src/views/business/solutions.vue
@@ -11,6 +11,12 @@
                    <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>
@@ -55,6 +61,12 @@
                        <span v-if="row.timeUnit === 3">年</span>
                    </template>
                </el-table-column>
                <el-table-column label="委托类型" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.type === 0">直保</span>
                        <span v-if="row.type === 1">委托:<span style="color: blue" >{{row.shopName||'-'}}</span></span>
                    </template>
                </el-table-column>
                <el-table-column prop="status" label="启用状态" min-width="100px" v-if="userInfo.type !== 1">
                    <template slot-scope="{row}">
                        <el-switch
@@ -97,54 +109,55 @@
</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: ''
                }
            }
        },
        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
                    })
            }
        }
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
        })
    }
  }
}
</script>
server/service/src/main/java/com/doumee/dao/business/model/CompanySolution.java
@@ -79,6 +79,9 @@
    @ApiModelProperty(value = "方案名称" )
    @TableField(exist = false)
    private String solutionName  ;
    @ApiModelProperty(value = "委托商户名称" )
    @TableField(exist = false)
    private String shopName  ;
    @ApiModelProperty(value = "方案主键(关联solutions)", example = "1")
    @ExcelColumn(name="方案主键(关联solutions)")
    private Integer solutionId;
server/service/src/main/java/com/doumee/dao/business/model/Solutions.java
@@ -77,6 +77,9 @@
    @ApiModelProperty(value = "类型 0直保 1委托投保", example = "1")
    @ExcelColumn(name="类型 0直保 1委托投保")
    private Integer type;
    @ApiModelProperty(value = "委托商户编码(关联company)", example = "1")
    @ExcelColumn(name="委托商户编码(关联company)")
    private Integer shopId;
    @ApiModelProperty(value = "最低年龄", example = "1")
    @ExcelColumn(name="最低年龄")
@@ -170,5 +173,8 @@
    @ApiModelProperty(value = "总周期费用", example = "1")
    @TableField(exist = false)
    private BigDecimal cyclePrice;
    @ApiModelProperty(value = "委托商户名称", example = "1")
    @TableField(exist = false)
    private String shopName;
}
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -88,7 +88,6 @@
        company.setStatus(Constants.ZERO);
        company.setType(Constants.ZERO);
        company.setSignStatus(Constants.ZERO);
        company.setType(Constants.ZERO);
        company.setSignIdStatus(Constants.ZERO);
        companyMapper.insert(company);
        company.setEditDate(company.getCreateDate());
@@ -111,7 +110,7 @@
               .or().eq(Company::getEmail,company.getEmail())
               .or().eq(Company::getUsername,company.getUsername())
                .or().eq(Company::getName,company.getName()))>0){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该企业【名称】【统一信用代码】【邮箱】或者【手机号】已存在,请确认后重新提交!");
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该商户【名称】【统一信用代码】【邮箱】或者【手机号】已存在,请确认后重新提交!");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        company.setCreator(user.getId());
@@ -119,7 +118,6 @@
        company.setType(Constants.ONE);
        company.setIsdeleted(Constants.ZERO);
        company.setStatus(Constants.ZERO);
        company.setType(Constants.ZERO);
        company.setSignStatus(Constants.ZERO);
        company.setSignIdStatus(Constants.ZERO);
        companyMapper.insert(company);
@@ -257,6 +255,7 @@
        List<Integer> sIds = new ArrayList<>();
        List<CompanySolution> list = new ArrayList<>();
        int num =0;
        Date date = new Date();
        for(CompanySolution s :company.getSolutionList()){
            if(Objects.isNull(s.getSolution())){
                continue;
@@ -274,7 +273,7 @@
            s.setIsdeleted(Constants.ZERO);
            s.setCanAdd(Constants.formatIntegerNum(s.getCanAdd()));
            s.setCanReduce(Constants.formatIntegerNum(s.getCanReduce()));
            s.setCreateDate(company.getCreateDate());
            s.setCreateDate(date);
            s.setCreator(company.getCreator());
            s.setSortnum(num++);
            s.setSolutionBaseId( s.getSolution().getBaseId() );
@@ -782,17 +781,23 @@
        QueryWrapper<Company> wrapper = new QueryWrapper<>(company);
        company.setIsdeleted(Constants.ZERO);
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(company.getQueryFlag() == 0){
            //只能看权限范围内
            if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){
                wrapper.lambda().eq(Company::getId,-1);//设置无效访问
            }else {
                wrapper.lambda().in(Company::getId, user.getCompanyIdList());
        if(Constants.equalsInteger(company.getType(),Constants.ONE)){
        }else {
            //如果查询企业数据
            if(company.getQueryFlag() == 0){
                //只能看权限范围内
                if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){
                    wrapper.lambda().eq(Company::getId,-1);//设置无效访问
                }else {
                    wrapper.lambda().in(Company::getId, user.getCompanyIdList());
                }
            } else if (company.getQueryFlag() == 1 && company.getUserId()!=null) {
                //查詢是否有查看權限
                wrapper.select("*,(select count(1) from company_permission b where b.user_id="+company.getUserId()+" and b.isdeleted=0 and b.company_id=company.id) as hasPerimission");
            }
        } else if (company.getQueryFlag() == 1 && company.getUserId()!=null) {
            //查詢是否有查看權限
            wrapper.select("*,(select count(1) from company_permission b where b.user_id="+company.getUserId()+" and b.isdeleted=0 and b.company_id=company.id) as hasPerimission");
        }
        return companyMapper.selectList(wrapper);
    }
@@ -803,17 +808,22 @@
        Utils.MP.blankToNull(pageWrap.getModel());
        pageWrap.getModel().setIsdeleted(Constants.ZERO);
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(pageWrap.getModel().getQueryFlag() == 0){
            //只能看权限范围内
            if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){
                queryWrapper.lambda().eq(Company::getId,-1);//设置无效访问
            }else {
                queryWrapper.lambda().in(Company::getId, user.getCompanyIdList());
            }
        if(Constants.formatIntegerNum(pageWrap.getModel().getType()) == Constants.ONE) {
        }else{
            //如果查询企业数据,只能看权限范围内
            if(pageWrap.getModel().getQueryFlag() == 0){
                //只能看权限范围内
                if(user.getCompanyIdList() == null || user.getCompanyIdList().size() == 0){
                    queryWrapper.lambda().eq(Company::getId,-1);//设置无效访问
                }else {
                    queryWrapper.lambda().in(Company::getId, user.getCompanyIdList());
                }
//            queryWrapper.exists("select b.id from company_permission b where b.user_id="+user.getId()+" and b.isdeleted=0 and b.company_id=company.id");
        } else if (pageWrap.getModel().getQueryFlag() == 1) {
            //查詢是否有查看權限
            queryWrapper.select("*,(select count(1) from company_permission b where b.user_id="+user.getId()+" and b.isdeleted=0 and b.company_id=company.id) as hasPerimission");
            } else if (pageWrap.getModel().getQueryFlag() == 1) {
                //查詢是否有查看權限
                queryWrapper.select("*,(select count(1) from company_permission b where b.user_id="+user.getId()+" and b.isdeleted=0 and b.company_id=company.id) as hasPerimission");
            }
        }
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.lambda().eq(Company::getId, pageWrap.getModel().getId());
server/service/src/main/java/com/doumee/service/business/impl/CompanySolutionServiceImpl.java
@@ -6,6 +6,7 @@
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CompanySolutionMapper;
import com.doumee.dao.business.join.CompanySolutionJoinMapper;
import com.doumee.dao.business.model.Company;
import com.doumee.dao.business.model.CompanySolution;
import com.doumee.dao.business.model.Solutions;
import com.doumee.service.business.CompanySolutionService;
@@ -88,7 +89,9 @@
        MPJLambdaWrapper<CompanySolution> csWrapper = new MPJLambdaWrapper<>();
        csWrapper.selectAll(CompanySolution.class);
        csWrapper.selectAs(Solutions::getName,CompanySolution::getSolutionName);
        csWrapper.selectAs(Company::getName,CompanySolution::getShopName);
        csWrapper.leftJoin(Solutions.class,Solutions::getId,CompanySolution::getSolutionBaseId);
        csWrapper.leftJoin(Company.class, Company::getId,CompanySolution::getShopId);
        csWrapper.eq(CompanySolution::getCompanyId,companySolution.getCompanyId());
        csWrapper.eq(CompanySolution::getIsdeleted, Constants.ZERO);
        csWrapper.eq(Solutions::getIsdeleted, Constants.ZERO);
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -286,7 +286,9 @@
        MPJLambdaWrapper<Solutions> queryWrapper = new MPJLambdaWrapper<>();
        queryWrapper.selectAll(Solutions.class);
        queryWrapper.selectAs(Insurance::getName,Solutions::getInsuranceName);
        queryWrapper.selectAs(Company::getName,Solutions::getShopName);
        queryWrapper.leftJoin(Insurance.class,Insurance::getId,Solutions::getInsuranceId);
        queryWrapper.leftJoin(Company.class,Company::getId,Solutions::getShopId);
        queryWrapper.eq(Solutions::getId,id);
        Solutions model = solutionsJoinMapper.selectJoinOne(Solutions.class,queryWrapper);
        if(model == null  || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
@@ -331,7 +333,9 @@
        Utils.MP.blankToNull(pageWrap.getModel());
        queryWrapper.selectAll(Solutions.class);
        queryWrapper.selectAs(Insurance::getName,Solutions::getInsuranceName);
        queryWrapper.selectAs(Company::getName,Solutions::getShopName);
        queryWrapper.leftJoin(Insurance.class,Insurance::getId,Solutions::getInsuranceId);
        queryWrapper.leftJoin(Company.class,Company::getId,Solutions::getShopId);
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(user.getType().equals(Constants.ONE)){
            queryWrapper.exists(("select 1 from company_solution b where b.isdeleted=0 and b.company_id="+user.getCompanyId()+" and b.SOLUTION_BASE_ID = t.id"));