123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532 |
- <template>
- <div class="moreBrand">
- <div class="moreBrandBtn">
- <div class="collectSeach" :style="$utils.collectSeachSty()">
- <div class="exceed">
- <span class="exceedSpan" style="width: 80px">业务属性:</span>
- <el-select v-model="moduleStr" placeholder="请选择业务属性">
- <el-option
- v-for="item in moduleData"
- :key="item.id"
- :label="item.sectionName"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <div class="exceed">
- <span class="exceedSpan" style="width: 80px">考评周期:</span>
- <el-select v-model="checkCycleStr" placeholder="请选择考评周期">
- <el-option
- v-for="item in periodData"
- :key="item.keyValue"
- :label="item.keyName"
- :value="item.keyValue">
- </el-option>
- </el-select>
- </div>
- <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
- </div>
- <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
- <btns
- :showImport="false" :showExport="false" :showSave="false"
- :showAdd="$utils.havePurview('moreBrand:oneLevel:add')"
- :showDelete="false"
- @handleAdd="handleAdd('out')"></btns>
- </div>
- <div class="moreBrandTableData">
- <el-table :data="moreBrandData" style="width: 100%" :class="moreBrandTableSty()">
- <el-table-column type="expand">
- <template #default="props">
- <div class="inTable">
- <el-table :data="props.row.children" border>
- <el-table-column label="单位名称" prop="organizationName" />
- <el-table-column label="业务属性" prop="binSectionName" />
- <el-table-column label="考评周期" prop="checkCycle">
- <template #default="scope">
- <span>{{scope.row.checkCycle === 'YDKP'?'月度考评':scope.row.checkCycle === 'JDKP'?'季度考评':'年度考评'}}</span>
- </template>
- </el-table-column>
- <el-table-column label="利润金额" prop="profit" />
- <el-table-column label="分数" prop="score" />
- <el-table-column label="年" prop="year" />
- <el-table-column label="月" prop="month" />
- <el-table-column label="备注" prop="remark" />
- <el-table-column label="操作" width="150">
- <template #default="scope">
- <div style="display: flex">
- <p class="indicitem" @click="handleEdit('in', scope.row)">修改</p>
- <p class="indicitem" @click="handleDelete(scope.row)">删除</p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="单位名称" prop="organizationName" />
- <el-table-column label="业务属性" prop="binSectionName" />
- <el-table-column label="考评周期" prop="checkCycle">
- <template #default="scope">
- <span>{{scope.row.checkCycle === 'YDKP'?'月度考评':scope.row.checkCycle === 'JDKP'?'季度考评':'年度考评'}}</span>
- </template>
- </el-table-column>
- <el-table-column label="利润金额" prop="profit" />
- <el-table-column label="分数" prop="score" />
- <el-table-column label="年" prop="year" />
- <el-table-column label="月" prop="month" />
- <el-table-column label="备注" prop="remark" />
- <el-table-column label="操作" width="150">
- <template #default="scope">
- <div style="display: flex">
- <p class="indicitem" @click="handleAdd('in', scope.row)">新增</p>
- <p class="indicitem" @click="handleEdit('out', scope.row)">修改</p>
- <p class="indicitem" @click="handleDelete(scope.row)">删除</p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="page.currentPage"
- :page-size="page.pagesize"
- layout="total, prev, pager, next, jumper"
- :total="page.total">
- </el-pagination>
- </div>
- <div class="indexRuledialog">
- <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
- <div class="periodFrom">
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"
- class="demo-ruleForm" :validate-on-rule-change="false">
- <!-- prop="organizationName" -->
- <el-form-item label="单位名称" prop="organizationName">
- <el-select v-model="ruleForm.organizationName" filterable placeholder="请选择单位名称">
- <el-option v-for="item in companyDatas" :key="item.id" :label="item.shortName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务属性" prop="binSection">
- <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性">
- <el-option v-for="item in moduleData" :key="item.id" :label="item.sectionName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="考评周期" prop="checkCycle">
- <el-select v-model="ruleForm.checkCycle" placeholder="请选择考评周期">
- <el-option v-for="item in periodData" :key="item.keyValue" :label="item.keyName"
- :value="item.keyValue">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="利润金额">
- <el-input-number v-model="ruleForm.profit" :precision="2" :step="0.1" :min="0"
- placeholder="请输入利润金额" />
- </el-form-item>
- <el-form-item label="分数">
- <el-input-number v-model="ruleForm.score" :precision="2" :step="0.1" :min="0"
- placeholder="请输入分数" />
- </el-form-item>
- <el-form-item label="年份" prop="year">
- <el-date-picker
- v-model="ruleForm.year"
- type="year"
- value-format="YYYY"
- placeholder="请选择年份"
- />
- </el-form-item>
- <el-form-item label="月份">
- <el-input-number v-model="ruleForm.month" :min="1" :max="12" />
- </el-form-item>
- <el-form-item label="备注">
- <el-input v-model="ruleForm.remark" :rows="5" type="textarea" placeholder="请输入备注"></el-input>
- </el-form-item>
- </el-form>
- </div>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="savemoreBrandMsg('ruleForm')">确 定</el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- </div>
- </div>
- </template>
- <script>
- import seachs from '../seachGroup.vue'
- import btns from '../elbuttonS.vue'
- import {apiGetmultiplebrandtreeList, apiPostmultiplebrandSave, apiGetorganizationgetListTwo,
- apiPostmultiplebrandRemove, apiGetbinsectionList, apiGetdatadictionaryList} from '../../api/api'
- export default {
- components: { btns, seachs },
- data() {
- return {
- dialogVisible: false,
- title: '',
- isSave: false,
- moduleData: [],
- periodData: [],
- moduleStr: '',
- checkCycleStr: '',
- moreBrandData:[],
- companyDatas: [],
- addType: '',
- ruleForm: {
- organizationName: '',
- binSection: '',
- checkCycle: '',
- profit: 0,
- score: 0,
- year: '',
- month: 1,
- remark: ''
- },
- rules: {
- organizationName: [
- { required: true, message: '请选择单位名称', trigger: 'change' }
- ],
- binSection: [
- { required: true, message: '请选择业务属性', trigger: 'change' }
- ],
- checkCycle: [
- { required: true, message: '请选择考评周期', trigger: 'change' }
- ],
- year: [
- { required: true, message: '请选择年份', trigger: 'change' }
- ]
- },
- page:{
- pagesize: 12,
- currentPage: 1,
- total: 0
- },
- evalradio: {},
- winPix: window.devicePixelRatio,
- innerWidth: window.innerWidth
- }
- },
- created() {
- this.getMoreBrandData()
- this.getOrganizetionData()
- this.getDataDictionary()
- },
- methods:{
- // 查询指标数据
- getMoreBrandData() {
- let that = this
- let params = {
- pageNum: that.page.currentPage,
- pageSize: that.page.pagesize,
- binSection: that.moduleStr,
- checkCycle: that.checkCycleStr
- }
- apiGetmultiplebrandtreeList(params).then(datas =>{
- if (datas && datas.data) {
- that.moreBrandData = datas.data.records
- that.page.total = datas.data.total
- }
- })
- },
- //查询组织数据
- getOrganizetionData() {
- let that = this
- // let params = {
- // id: id,
- // num: num
- // }
- apiGetorganizationgetListTwo().then(datas => {
- if (datas && datas.data) {
- that.companyDatas = datas.data
- }
- })
- },
- // 查询规则模块和阶段数据
- getDataDictionary() {
- let that = this
- apiGetbinsectionList().then(datas =>{
- if (datas && datas.data) {
- that.moduleData = datas.data
- }
- })
- apiGetdatadictionaryList({superKey: 'KPZQ0001'}).then(datas => {
- if (datas && datas.data) {
- that.periodData = datas.data
- }
- })
- },
- handleAdd(type, row) {
- this.dialogVisible = true
- this.evalradio = row
- this.addType = type
- this.isSave = false
- this.title = '新增单位营业收入'
- this.$nextTick(() =>{
- // this.$refs['ruleForm'].resetFields()
- this.ruleForm = {
- organizationName: '',
- binSection: '',
- checkCycle: '',
- profit: 0,
- score: 0,
- year: '',
- month: 1,
- remark: ''
- }
- })
- },
- handleEdit(type, row) {
- this.dialogVisible = true
- this.isSave = true
- this.addType = type
- this.title = '修改单位营业收入'
- this.evalradio = row
- this.ruleForm = {
- organizationName: this.evalradio.organizationId,
- binSection: this.evalradio.binSection,
- checkCycle: this.evalradio.checkCycle,
- profit: this.evalradio.profit,
- score: this.evalradio.score,
- year: this.evalradio.year,
- month: this.evalradio.month,
- remark: this.evalradio.remark
- }
- },
- savemoreBrandMsg(formName) {
- let that = this
- that.$refs[formName].validate((valid) => {
- if (valid) {
- that.saveAndEditRuleData()
- }
- });
- },
- //新增/修改指标数据
- saveAndEditRuleData() {
- let that = this
- let orgName = ''
- that.companyDatas.forEach(item => {
- if (item.id === that.ruleForm.organizationName) {
- orgName = item.shortName
- }
- })
- let params = {
- organizationId: that.ruleForm.organizationName,
- organizationName: orgName,
- // organizationId: '50264514',
- // organizationName: '杭锦旗国电电力有限公司',
- binSection: that.ruleForm.binSection,
- checkCycle: that.ruleForm.checkCycle,
- profit: that.ruleForm.profit,
- score: that.ruleForm.score,
- year: that.ruleForm.year,
- month: that.ruleForm.month.toString(),
- remark: that.ruleForm.remark
- }
-
- if (that.isSave) {
- if (that.addType === 'in') {
- params.parentId = that.evalradio.parentId
- }
- params.id = that.evalradio.id
- } else {
- if (that.addType === 'in') {
- params.parentId = that.evalradio.organizationId
- }
- }
- apiPostmultiplebrandSave(params).then(datas =>{
- if (!datas.success) {
- that.$message({
- message: datas.message,
- type: 'error'
- });
- } else {
- if (!that.isSave) {
- that.$message({
- message: '牌子新增成功',
- type: 'success'
- });
- } else {
- that.$message({
- message: '牌子修改成功',
- type: 'success'
- });
- }
- that.dialogVisible = false
- that.getMoreBrandData()
- }
- })
- },
- //删除指标数据
- handleDelete(row) {
- this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let that = this
- apiPostmultiplebrandRemove(row.id).then(datas =>{
- that.$message({
- type: 'success',
- message: '删除成功!'
- });
- that.getMoreBrandData()
- })
- })
- },
- getSeachData() {
- this.page.currentPage = 1
- this.getMoreBrandData()
- },
- resetSeach() {
- this.page.currentPage = 1
- this.moduleStr = ''
- this.checkCycleStr = ''
- this.getMoreBrandData()
- },
- handleSizeChange(val){
- this.page.pagesize = val
- this.getMoreBrandData()
- },
- handleCurrentChange(val){
- this.page.currentPage =val
- this.getMoreBrandData()
- },
- moreBrandTableSty() {
- if (this.winPix === 1.25 || this.innerWidth < 1800) {
- return 'moreBrand125Table'
- } else {
- return 'moreBrand100Table'
- }
- }
- }
- }
- </script>
- <style lang="less">
- .moreBrand{
- .moreBrandBtn{
- .collectSeach{
- display: flex;
- padding: 24px 20px;
- border-bottom: 1px solid#D6DBEA;
- .exceed{
- display: flex;
- .exceedSpan{
- width: 100px;
- height: 12px;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #8991B0;
- line-height: 12px;
- margin-top: 14px;
- }
- .el-select{
- line-height: 40px !important;
- .el-input__inner, .is-disabled{
- height:40px !important;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:40px;
- }
- }
- }
- }
- .el-select{
- margin-right:10px;
- .el-input__inner{
- height:30px;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:30px;
- }
- }
- }
- }
- span{
- font-size:14px;
- }
- .PeriodBtn{
- display: flex;
- justify-content: flex-end;
- padding: 20px 0;
- }
- .el-button{
- height: 30px;
- // width:100px;
- padding: 0 30px ;
- // padding-top: 8px;
- span{
- margin:0;
- }
- }
- .indexRuledialog{
- .el-overlay{
- .el-dialog{
- .el-dialog__body{
- padding: 30px 60px 30px 20px !important;
- .periodFrom{
- .el-select, .el-input{
- width: 100%;
- }
- .el-input {
- height: 30px;
- }
- }
- }
- }
- }
- }
- }
- .moreBrandTableData{
- .moreBrand125Table{
- .el-table__body-wrapper{
- height: 53vh !important;
- }
- }
- .moreBrand100Table{
- .el-table__body-wrapper{
- height: 60vh !important;
- }
- }
- .el-table{
- .el-input__inner{
- height: 30px !important;
- }
- .el-radio__label{
- display: none;
- }
-
- .inTable{
- padding: 20px;
- .el-table{
- .el-table__body-wrapper{
- height: 30vh !important;
- }
- }
- }
- .indicitem{
- color: #409EFF;
- font-size: 12px;
- margin-right: 20px;
- cursor:pointer;
- &:hover{
- text-decoration: underline;
- }
- }
- }
- .el-pagination{
- margin-top: 20px;
- text-align: end;
- position: relative;
- }
- }
-
- }
- </style>
|