| | |
| | | placeholder="请选择批改提醒时间"> |
| | | </el-time-picker> |
| | | </el-form-item> |
| | | <div style="display: flex; align-items: center;"> |
| | | <el-button type="primary" @click="add" style="margin-bottom: 10px;">添加工种</el-button> |
| | | <el-button type="primary" @click="impor" style="margin-bottom: 10px;">导入工种</el-button> |
| | | <el-button type="text" @click="exprot">导入模版xls</el-button> |
| | | <div style="width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #ececec;"> |
| | | <div style="display: flex; align-items: center; margin-bottom: 10px;"> |
| | | <el-select filterable multiple style="width: 800px;" v-model="worktypeId" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in typeWorkCopy" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-button type="primary" @click="add" :disabled="worktypeId.length === 0" style="margin-left: 10px;">添加工种</el-button> |
| | | <el-button type="primary" @click="impor">导入工种</el-button> |
| | | <el-button type="text" @click="exprot">导入模版xls</el-button> |
| | | </div> |
| | | <u-table |
| | | :data="form.worktypeIdList" |
| | | border |
| | | use-virtual |
| | | style="width: 100%; margin-bottom: 20px;"> |
| | | <u-table-column |
| | | label="序号" |
| | | width="80"> |
| | | <template slot-scope="scope"> |
| | | <span>{{scope.$index + 1}}</span> |
| | | </template> |
| | | </u-table-column> |
| | | <u-table-column |
| | | prop="worktypeName" |
| | | label="所属工种"> |
| | | </u-table-column> |
| | | <u-table-column |
| | | label="操作" |
| | | width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" style="color: red;" @click="dele(scope.$index)">删除</el-button> |
| | | </template> |
| | | </u-table-column> |
| | | </u-table> |
| | | </div> |
| | | <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="risk"> |
| | | <div class="tx"> |
| | | <div class="tx_item"> |
| | | <div class="tx_item_head"> |
| | | <span>延迟报案提醒</span> |
| | | <el-switch :active-value="1" :inactive-value="0" v-model="form.riskDelayStatus"></el-switch> |
| | | </div> |
| | | <div class="tx_item_content"> |
| | | <span>规则设置:当报案时间超过案发时间</span> |
| | | <el-input-number style="margin: 0 15px;" :disabled="form.riskDelayStatus === 0" v-model="form.riskDelayTime" :min="1"></el-input-number> |
| | | <el-select v-model="form.riskDelayUnit" :disabled="form.riskDelayStatus === 0" style="width: 100px; margin-right: 15px;" placeholder="请选择"> |
| | | <el-option label="分钟" :value="0"></el-option> |
| | | <el-option label="小时" :value="1"></el-option> |
| | | <el-option label="天" :value="2"></el-option> |
| | | </el-select> |
| | | <span>时,进行提醒。</span> |
| | | </div> |
| | | </div> |
| | | <div class="tx_item"> |
| | | <div class="tx_item_head"> |
| | | <span>允许对新员工已投保未生效保险进行保障</span> |
| | | <el-switch :active-value="1" :inactive-value="0" v-model="form.riskNewUserStatus"></el-switch> |
| | | </div> |
| | | <div class="tx_item_content"> |
| | | <span>规则设置:允许出险时间在保单生效前</span> |
| | | <el-input-number style="margin: 0 15px;" v-model="form.riskNewUserTime" :min="1"></el-input-number> |
| | | <el-select v-model="form.riskNewUserUnit" style="width: 100px; margin-right: 15px;" placeholder="请选择"> |
| | | <el-option label="小时" :value="1"></el-option> |
| | | <el-option label="天" :value="2"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="特别约定" prop="specialAgreement"> |
| | | <RichEditor :richData="form.specialAgreement" :styleEditor="'border: 1px solid #ccc;display: inline-block;'" @getWangedditor="getWangedditor" :readonly="false"/> |
| | | </el-form-item> |
| | |
| | | import UploadFile from '@/components/common/UploadFile' |
| | | import { numRule } from '@/utils/form' |
| | | import RichEditor from '@/components/common/RichEditor' |
| | | import { UTable, UTableColumn } from 'umy-ui' |
| | | export default { |
| | | name: 'OperaSolutionsBaseWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow, UploadFile, RichEditor }, |
| | | components: { GlobalWindow, UploadFile, RichEditor, UTable, UTableColumn }, |
| | | data () { |
| | | var validType = (rule, value, callback) => { |
| | | if (this.form.validType === 0 && !value) { |
| | |
| | | return callback(new Error('批改支持不能为空')) |
| | | } |
| | | callback() |
| | | } |
| | | var riskRule = (rule, value, callback) => { |
| | | if (this.form.riskDelayStatus === '1') { |
| | | if (!this.form.riskDelayTime || !this.form.riskDelayUnit) { |
| | | return callback(new Error('请完善内容')) |
| | | } |
| | | } |
| | | if (this.form.riskNewUserStatus === '1') { |
| | | if (!this.form.riskNewUserTime || !this.form.riskNewUserUnit) { |
| | | return callback(new Error('请完善内容')) |
| | | } |
| | | } |
| | | callback() |
| | | } |
| | | return { |
| | | // 表单数据 |
| | |
| | | delOnlyReplace: 0, |
| | | canAdd: 0, |
| | | correctWarnTime: '', |
| | | worktypeIdList: [{ worktypeId: '' }] |
| | | worktypeIdList: [], |
| | | |
| | | riskDelayStatus: 0, |
| | | riskDelayTime: 1, |
| | | riskDelayUnit: 0, |
| | | riskNewUserStatus: 0, |
| | | riskNewUserTime: 1, |
| | | riskNewUserUnit: 1 |
| | | }, |
| | | value: '', |
| | | options: [], |
| | | worktypeId: [], |
| | | // 验证规则 |
| | | rules: { |
| | | name: [ |
| | |
| | | delValidDays: [ |
| | | { required: true, validator: numRule } |
| | | ], |
| | | risk: [ |
| | | { required: true, validator: riskRule } |
| | | ], |
| | | insuranceId: [ |
| | | { required: true, message: '请选择保险公司' } |
| | | ], |
| | |
| | | }, |
| | | shops: [], |
| | | company: [], |
| | | typeWork: [] |
| | | typeWork: [], |
| | | typeWorkCopy: [] |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | formdate.append('insuranceId', this.form.insuranceId) |
| | | importExcelForSolution(formdate) |
| | | .then(res => { |
| | | console.log(res) |
| | | res.forEach(id => { |
| | | if (this.form.worktypeIdList.length === 1 && !this.form.worktypeIdList[0].worktypeId) { |
| | | this.form.worktypeIdList[0].worktypeId = id |
| | | } else { |
| | | this.form.worktypeIdList.push({ worktypeId: id }) |
| | | } |
| | | let arr = [] |
| | | res.forEach(item => { |
| | | arr.push({ worktypeId: item.id, worktypeName: item.name }) |
| | | }) |
| | | this.form.worktypeIdList = [...arr, ...this.form.worktypeIdList] |
| | | let valData = this.form.worktypeIdList.map(item => item.worktypeName) |
| | | this.typeWorkCopy = this.typeWorkCopy.filter(item => !valData.includes(item.name)) |
| | | }) |
| | | .catch(err => { |
| | | this.$message.error(err.message) |
| | |
| | | }) |
| | | }, |
| | | impor() { |
| | | if (!this.form.insuranceId) return this.$message.warning('请先选择企业') |
| | | if (!this.form.insuranceId) return this.$message.warning('请先选择保险公司') |
| | | this.$refs.upload.click() |
| | | }, |
| | | // 导出模板 |
| | |
| | | }, |
| | | // 切换公司 |
| | | getAllWorktype1 () { |
| | | this.form.worktypeIdList = [{ worktypeId: '' }] |
| | | this.form.worktypeIdList = [] |
| | | this.getAllWorktype() |
| | | }, |
| | | changeValidType(e) { |
| | |
| | | this.form.delOnlyReplace = 0 |
| | | this.form.delValidDays = 0 |
| | | this.form.canAdd = 0 |
| | | this.form.worktypeIdList = [{ worktypeId: '' }] |
| | | this.form.worktypeIdList = [] |
| | | this.typeWork = [] |
| | | this.typeWorkCopy = [] |
| | | // this.$refs['$upload'].clearFiles()//初始化导入组件 |
| | | this.allCompany() |
| | | this.allShops() |
| | |
| | | this.form.maxAge = '' |
| | | this.form.validTypeNum = '' |
| | | this.form.fanganFile = null |
| | | this.form.worktypeIdList = [{ worktypeId: '' }] |
| | | this.form.worktypeIdList = [] |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | |
| | | if (res.worktypeList) { |
| | | this.form.worktypeIdList = res.worktypeList.map(item => { |
| | | return { |
| | | worktypeId: item.worktypeId |
| | | worktypeId: item.worktypeId, |
| | | worktypeName: item.worktypeName |
| | | } |
| | | }) |
| | | } |
| | |
| | | // 查询保险公司下全部工种 |
| | | getAllWorktype () { |
| | | allWorktype({ |
| | | insuranceId: this.form.insuranceId |
| | | insuranceId: this.form.insuranceId, |
| | | dataType: 2 |
| | | }).then(res => { |
| | | this.typeWork = res |
| | | this.typeWork = res |
| | | if (!this.form.id) { |
| | | this.typeWorkCopy = res |
| | | } else { |
| | | let valData = this.form.worktypeIdList.map(item => item.worktypeName) |
| | | this.typeWorkCopy = res.filter(item => !valData.includes(item.name)) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | |
| | | allCompany () { |
| | | all({ dataType: 2, status: 0 }) |
| | | .then(res => { |
| | | 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: '' }) |
| | | let arr = this.typeWorkCopy.filter(item => this.worktypeId.includes(item.id)) |
| | | let dataVal = arr.map(item => { |
| | | return { |
| | | worktypeId: item.id, |
| | | worktypeName: item.name |
| | | } |
| | | }) |
| | | this.form.worktypeIdList = [ ...dataVal, ...this.form.worktypeIdList ] |
| | | let valData = this.form.worktypeIdList.map(item => item.worktypeName) |
| | | this.typeWorkCopy = this.typeWorkCopy.filter(item => !valData.includes(item.name)) |
| | | this.worktypeId = [] |
| | | }, |
| | | dele (index) { |
| | | if (this.form.worktypeIdList.length === 1) { |
| | | this.$message.warning('至少要保留一项') |
| | | return |
| | | } |
| | | let row = this.typeWork.filter(item => item.name === this.form.worktypeIdList[index].worktypeName) |
| | | this.typeWorkCopy.unshift(row[0]) |
| | | this.form.worktypeIdList.splice(index, 1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .tx { |
| | | width: 100%; |
| | | background-color: #ffffff; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .tx_item { |
| | | width: 50%; |
| | | padding: 20px 20px; |
| | | box-sizing: border-box; |
| | | background-color: #ffffff; |
| | | border: 1px solid #ececec; |
| | | margin-bottom: 20px; |
| | | .tx_item_head { |
| | | display: flex; |
| | | align-items: center; |
| | | span { |
| | | color: rgba(16,16,16,1); |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin-right: 15px; |
| | | } |
| | | } |
| | | .tx_item_content { |
| | | display: flex; |
| | | align-items: start; |
| | | margin-top: 10px; |
| | | span { |
| | | flex-shrink: 0; |
| | | color: rgba(16,16,16,1); |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |