|
@@ -1,182 +1,301 @@
|
|
|
-
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div v-if="!openDetail">
|
|
|
- <el-card>
|
|
|
- <el-form size="mini" class="search_area" label-width="120px">
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="客户名称">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.customerName"
|
|
|
- clearable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="年度">
|
|
|
- <el-date-picker
|
|
|
- v-model="queryParams.month"
|
|
|
- type="month"
|
|
|
- value-format="yyyy-MM"
|
|
|
- clearable
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="创建人">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.createByName"
|
|
|
- clearable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="部门">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.deptName"
|
|
|
- clearable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="" label-width="20px">
|
|
|
- <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
|
|
|
- <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <el-divider></el-divider>
|
|
|
- <div class="btn_grooup">
|
|
|
- <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
|
|
|
- </div>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-table v-loading="loading" :data="authorityList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="项目岗位" align="center" prop="postName" />
|
|
|
+ <el-table-column label="商机-下一步" align="center" prop="boNext">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.boNext ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商机-修改" align="center" prop="boEdit">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.boEdit ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商机-关闭" align="center" prop="boClose">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.boClose ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商机-赢单" align="center" prop="boWin">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.boWin ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商机-丢单" align="center" prop="boLose">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.boLose ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="项目成员-新增" align="center" prop="pojpsnAdd" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.pojpsnAdd ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="项目成员-删除" align="center" prop="pojpsnDel">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.pojpsnDel ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="项目成员-编辑" align="center" prop="pojpsnEdit">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.pojpsnEdit ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="项目成员-查看" align="center" prop="pojpsnView">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.pojpsnView ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-table
|
|
|
- :data="tableList"
|
|
|
- @row-dblclick="useDoubleClick"
|
|
|
- v-loading="loading"
|
|
|
- height="600px"
|
|
|
- >
|
|
|
- <el-table-column label="序号" type="index" width="50" align="center" fixed/>
|
|
|
- <el-table-column show-overflow-tooltip label="编码" align="center" width="200" prop="code"/>
|
|
|
- <el-table-column show-overflow-tooltip label="客户名称" align="center" width="200" prop="customerName"/>
|
|
|
- <el-table-column show-overflow-tooltip label="月度" align="center" width="200" prop="month"/>
|
|
|
- <el-table-column show-overflow-tooltip label="部门" align="center" width="200" prop="deptName"/>
|
|
|
- <el-table-column show-overflow-tooltip label="创建人" align="center" width="200" prop="createByName" />
|
|
|
- <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
|
|
|
- <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
|
|
|
- <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
|
|
|
- <el-table-column fixed="right" label="操作" align="center" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="mini" @click="useEdit(scope.row)">填报</el-button>
|
|
|
- <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-table-column label="任务-新增" align="center" prop="taskAdd" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.taskAdd ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="任务-删除" align="center" prop="taskDel">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.taskDel ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="任务-编辑" align="center" prop="taskEdit">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.taskEdit ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="任务-查看" align="center" prop="taskView">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.taskView ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="行动-新增" align="center" prop="behaviorAdd">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.behaviorAdd ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="行动-删除" align="center" prop="behaviorDel">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.behaviorDel ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="行动-编辑" align="center" prop="behaviorEdit">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.behaviorEdit ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="行动-查看" align="center" prop="behaviorView">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.behaviorView ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="联系人-新增" align="center" prop="contactAdd">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.contactAdd ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="联系人-删除" align="center" prop="contactDel">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.contactDel ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="联系人-编辑" align="center" prop="contactEdit">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.contactEdit ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="联系人-查看" align="center" prop="contactView">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.contactView ? '√' : '×'}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['material:authority:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- @size-change="useChangePageSize"
|
|
|
- @current-change="useCurrentChange"
|
|
|
- :current-page="queryParams.pageNum"
|
|
|
- :page-sizes="[10, 15, 20]"
|
|
|
- :page-size="100"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total=total>
|
|
|
- </el-pagination>
|
|
|
- </el-card>
|
|
|
- </div>
|
|
|
- <Detail v-if="openDetail" :openMode="openMode" :row="row"/>
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
|
|
|
- <!-- 新增填报对话框 -->
|
|
|
- <el-dialog
|
|
|
- title="新增"
|
|
|
- :visible.sync="open"
|
|
|
- width="1000px"
|
|
|
- append-to-body
|
|
|
- >
|
|
|
- <el-form
|
|
|
- size="mini"
|
|
|
- :model="form"
|
|
|
- :rules="rules"
|
|
|
- ref="form"
|
|
|
- label-width="auto"
|
|
|
- >
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="编码" prop="code">
|
|
|
- <el-input
|
|
|
- placeholder="自动生成"
|
|
|
- readonly
|
|
|
- v-model="form.code"
|
|
|
- style="width: 200px"
|
|
|
- clearable
|
|
|
- />
|
|
|
+ <!-- 添加或修改商机角色权限对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="项目岗位" prop="postName">
|
|
|
+ {{form.postName}}
|
|
|
+ <!-- <el-input v-model="form.postName"/> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-divider content-position="left">
|
|
|
+ <dev style="width: 50px; height: 40px; font-size: 18px">商机</dev>
|
|
|
+ </el-divider>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="boNext">
|
|
|
+ <el-checkbox v-model="form.boNext">下一步</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="月份" prop="month">
|
|
|
- <el-date-picker
|
|
|
- :readonly="this.openMode == 'edit' || this.openMode == 'see'"
|
|
|
- v-model="form.month"
|
|
|
- value-format="yyyy-MM"
|
|
|
- type="month"
|
|
|
- clearable
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="boEdit">
|
|
|
+ <el-checkbox v-model="form.boEdit">修改</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="客户" prop="customer">
|
|
|
- <dr-popover-select
|
|
|
- :readonly="this.openMode == 'edit' || this.openMode == 'see'"
|
|
|
- size="mini"
|
|
|
- v-model="form.customerName"
|
|
|
- title="客户选择"
|
|
|
- type="MK_CUSTOMER_BYPRINCIPAL"
|
|
|
- :dataMapping="{
|
|
|
- customer: 'id',
|
|
|
- customerName: 'name',
|
|
|
- }"
|
|
|
- :source.sync="form"
|
|
|
- :queryParams="additionalCondition"
|
|
|
- >
|
|
|
- </dr-popover-select>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="boClose">
|
|
|
+ <el-checkbox v-model="form.boClose">关闭</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="创建日期" prop="createTime">
|
|
|
- <el-input
|
|
|
- v-model="form.createTime"
|
|
|
- style="width: 200px"
|
|
|
- clearable
|
|
|
- readonly
|
|
|
- />
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="boWin">
|
|
|
+ <el-checkbox v-model="form.boWin">赢单</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="创建人" prop="createByName">
|
|
|
- <el-input
|
|
|
- v-model="form.createByName"
|
|
|
- style="width: 200px"
|
|
|
- clearable
|
|
|
- readonly
|
|
|
- />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="boLose">
|
|
|
+ <el-checkbox v-model="form.boLose">丢单</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">
|
|
|
+ <dev style="width: 50px; height: 40px; font-size: 18px">项目成员</dev>
|
|
|
+ </el-divider>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="taskAdd">
|
|
|
+ <el-checkbox v-model="form.pojpsnAdd">新增</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-form-item label="部门" prop="deptName">
|
|
|
- <el-input
|
|
|
- v-model="form.deptName"
|
|
|
- style="width: 200px"
|
|
|
- clearable
|
|
|
- readonly
|
|
|
- />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="pojpsnDel">
|
|
|
+ <el-checkbox v-model="form.pojpsnDel">删除</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="pojpsnEdit">
|
|
|
+ <el-checkbox v-model="form.pojpsnEdit">编辑</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="pojpsnView">
|
|
|
+ <el-checkbox v-model="form.pojpsnView">查看</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">
|
|
|
+ <dev style="width: 50px; height: 40px; font-size: 18px">任务</dev>
|
|
|
+ </el-divider>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="taskAdd">
|
|
|
+ <el-checkbox v-model="form.taskAdd">新增</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="taskDel">
|
|
|
+ <el-checkbox v-model="form.taskDel">删除</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="taskEdit">
|
|
|
+ <el-checkbox v-model="form.taskEdit">编辑</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="taskView">
|
|
|
+ <el-checkbox v-model="form.taskView">查看</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">
|
|
|
+ <dev style="width: 50px; height: 40px; font-size: 18px">行动</dev>
|
|
|
+ </el-divider>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="behaviorAdd">
|
|
|
+ <el-checkbox v-model="form.behaviorAdd">新增</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="behaviorDel">
|
|
|
+ <el-checkbox v-model="form.behaviorDel">删除</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="behaviorEdit">
|
|
|
+ <el-checkbox v-model="form.behaviorEdit">编辑</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="behaviorView">
|
|
|
+ <el-checkbox v-model="form.behaviorView">查看</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-divider content-position="left">
|
|
|
+ <dev style="width: 50px; height: 40px; font-size: 18px">联系人</dev>
|
|
|
+ </el-divider>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="contactAdd">
|
|
|
+ <el-checkbox v-model="form.contactAdd">新增</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="contactDel">
|
|
|
+ <el-checkbox v-model="form.contactDel">删除</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="contactEdit">
|
|
|
+ <el-checkbox v-model="form.contactEdit">编辑</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="contactView">
|
|
|
+ <el-checkbox v-model="form.contactView">查看</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -187,245 +306,171 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Detail from './detail.vue'
|
|
|
-import { addAssess,listAssess,delAssess, } from "@/api/business/spd/fillin/dailysale_quantity_assess";
|
|
|
-import { byPrincipal } from "@/api/business/spd/bo/iuapquery/basic";
|
|
|
-
|
|
|
+import { listAuthority, getAuthority, delAuthority, addAuthority, updateAuthority } from "@/api/business/spd/bo/authority";
|
|
|
export default {
|
|
|
- name: "dailysaleQuantityAssess",
|
|
|
- components: {Detail},
|
|
|
+ name: "Authority",
|
|
|
data() {
|
|
|
return {
|
|
|
- loading: false,
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 商机角色权限表格数据
|
|
|
+ authorityList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- //新增表单
|
|
|
- form: {
|
|
|
- month: "",
|
|
|
- customer: "",
|
|
|
- customerName: "",
|
|
|
- },
|
|
|
- //表单校验
|
|
|
- rules: {
|
|
|
- month: [{ required: true, message: "月份不能为空", trigger: "blur" }],
|
|
|
- customer: [
|
|
|
- { required: true, message: "客户不能为空", trigger: "blur" },
|
|
|
- ],
|
|
|
- },
|
|
|
- // 搜索框参数
|
|
|
+ // 查询参数
|
|
|
queryParams: {
|
|
|
- customerName:null,
|
|
|
- month:null,
|
|
|
- deptName:null,
|
|
|
- deptName:null,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ post: null,
|
|
|
+ boNext: null,
|
|
|
+ boEdit: null,
|
|
|
+ boClose: null,
|
|
|
+ boWin: null,
|
|
|
+ boLose: null,
|
|
|
+ taskAdd: null,
|
|
|
+ taskDel: null,
|
|
|
+ taskEdit: null,
|
|
|
+ taskView: null,
|
|
|
+ behaviorAdd: null,
|
|
|
+ behaviorDel: null,
|
|
|
+ behaviorEdit: null,
|
|
|
+ behaviorView: null,
|
|
|
+ contactAdd: null,
|
|
|
+ contactDel: null,
|
|
|
+ contactEdit: null,
|
|
|
+ contactView: null
|
|
|
},
|
|
|
- //总条数
|
|
|
- total: 0,
|
|
|
- //列表数据
|
|
|
- tableList:[],
|
|
|
- //是否打开详情页面
|
|
|
- openDetail:false,
|
|
|
- //编辑页面打开方式,add或edit或see
|
|
|
- openMode:'',
|
|
|
- //行数据
|
|
|
- row:{},
|
|
|
- //查询员工所负责的客户
|
|
|
- queryCustomerParams:{
|
|
|
- staffCode:"",
|
|
|
- code:"",
|
|
|
- name:"",
|
|
|
- },
|
|
|
- customerList:[],
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
- async created() {
|
|
|
- await this.getList(this.queryParams);
|
|
|
- this.queryCustomerParams.staffCode = this.$store.state.user.name;
|
|
|
- await this.getCustomer();
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- //是否打开详情页面
|
|
|
- useOpenDetail(){
|
|
|
- this.openDetail = !this.openDetail;
|
|
|
- },
|
|
|
- //新增
|
|
|
- useAdd(){
|
|
|
- this.reset();
|
|
|
- if(this.customerList.length){
|
|
|
- this.form.customer = this.customerList[0].id;
|
|
|
- this.form.customerName = this.customerList[0].name;
|
|
|
- }
|
|
|
- this.form.createTime = this.getCurrentTime();
|
|
|
- this.form.month = this.getCurrentMonth();
|
|
|
- this.form.createByName = this.$store.state.user.nickName;
|
|
|
- this.form.dept = this.$store.state.user.deptId;
|
|
|
- this.form.deptName = this.$store.state.user.deptName;
|
|
|
- this.open = true;
|
|
|
- },
|
|
|
- //编辑
|
|
|
- async useEdit(row){
|
|
|
- this.openMode = 'edit';
|
|
|
- this.row = row;
|
|
|
- this.openDetail = true;
|
|
|
- },
|
|
|
- //删除
|
|
|
- async useDel(row){
|
|
|
- this.$modal.confirm('确认删除选择数据').then(() => {
|
|
|
- delAssess(row.id).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- this.getList(this.queryParams);
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- //查询列表
|
|
|
- async getList(params){
|
|
|
+ /** 查询商机角色权限列表 */
|
|
|
+ getList() {
|
|
|
this.loading = true;
|
|
|
- await listAssess(params).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.tableList = res.rows
|
|
|
- this.total = res.total
|
|
|
- }
|
|
|
+ listAuthority(this.queryParams).then(response => {
|
|
|
+ this.authorityList = response.rows;
|
|
|
+ console.log('this.authorityList',this.authorityList);
|
|
|
+ this.total = response.total;
|
|
|
this.loading = false;
|
|
|
- })
|
|
|
- },
|
|
|
- //查询客户
|
|
|
- async getCustomer(){
|
|
|
- await byPrincipal(this.queryCustomerParams).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.customerList = res.rows
|
|
|
- this.queryCustomerParams.total = res.total
|
|
|
- }
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- //客户弹窗附加查询条件
|
|
|
- additionalCondition(){
|
|
|
- return {
|
|
|
- parame:{
|
|
|
- staffCode: this.$store.state.user.name
|
|
|
- }
|
|
|
- }
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
},
|
|
|
- //双击
|
|
|
- useDoubleClick(row){
|
|
|
- this.openMode = 'see';
|
|
|
- this.row = row;
|
|
|
- this.openDetail = true;
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ post: null,
|
|
|
+ boNext: null,
|
|
|
+ boEdit: null,
|
|
|
+ boClose: null,
|
|
|
+ boWin: null,
|
|
|
+ boLose: null,
|
|
|
+ taskAdd: null,
|
|
|
+ taskDel: null,
|
|
|
+ taskEdit: null,
|
|
|
+ taskView: null,
|
|
|
+ behaviorAdd: null,
|
|
|
+ behaviorDel: null,
|
|
|
+ behaviorEdit: null,
|
|
|
+ behaviorView: null,
|
|
|
+ contactAdd: null,
|
|
|
+ contactDel: null,
|
|
|
+ contactEdit: null,
|
|
|
+ contactView: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
},
|
|
|
- //改变一页显示条数
|
|
|
- useChangePageSize(val){
|
|
|
- this.queryParams.pageSize = val
|
|
|
- this.getList(this.queryParams)
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
- //翻页
|
|
|
- useCurrentChange(val){
|
|
|
- this.queryParams.pageNum = val
|
|
|
- this.getList(this.queryParams)
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
},
|
|
|
- //搜索
|
|
|
- useSearch() {
|
|
|
- console.log(this.queryParams);
|
|
|
- this.getList(this.queryParams);
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
},
|
|
|
- //重置
|
|
|
- useReset(){
|
|
|
- this.queryParams = {
|
|
|
- customerName:null,
|
|
|
- month:null,
|
|
|
- deptName:null,
|
|
|
- deptName:null,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- }
|
|
|
- this.getList(this.queryParams);
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加商机角色权限";
|
|
|
},
|
|
|
- //重置表单
|
|
|
- reset(){
|
|
|
- this.form = {
|
|
|
- month: "",
|
|
|
- customer: "",
|
|
|
- customerName: "",
|
|
|
- }
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getAuthority(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改商机角色权限";
|
|
|
+ });
|
|
|
},
|
|
|
- // 确认
|
|
|
- async submitForm() {
|
|
|
- this.$refs["form"].validate(async (valid) => {
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.loading = true;
|
|
|
- try {
|
|
|
- let res = await addAssess(this.form);
|
|
|
- if (res.code === 200) {
|
|
|
- this.$modal.msgSuccess("保存成功");
|
|
|
- this.cancel();
|
|
|
- this.getList(this.queryParams);
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- console.error(err);
|
|
|
- } finally {
|
|
|
- this.loading = false;
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateAuthority(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addAuthority(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
}
|
|
|
- } else {
|
|
|
- return false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- getCurrentTime() {
|
|
|
- var date = new Date();//当前时间
|
|
|
- var year = date.getFullYear() //年
|
|
|
- var month = this.repair(date.getMonth() + 1);//月
|
|
|
- var day = this.repair(date.getDate());//日
|
|
|
- var hour = this.repair(date.getHours());//时
|
|
|
- var minute = this.repair(date.getMinutes());//分
|
|
|
- var second = this.repair(date.getSeconds());//秒
|
|
|
- //当前时间
|
|
|
- var curTime = year + "-" + month + "-" + day
|
|
|
- + " " + hour + ":" + minute + ":" + second;
|
|
|
- return curTime;
|
|
|
- },
|
|
|
- repair(i){
|
|
|
- if (i >= 0 && i <= 9) {
|
|
|
- return "0" + i;
|
|
|
- } else {
|
|
|
- return i;
|
|
|
- }
|
|
|
- },
|
|
|
- //获取当月
|
|
|
- getCurrentMonth(){
|
|
|
- const date = new Date()
|
|
|
- let year = date.getFullYear()
|
|
|
- let month = date.getMonth() + 1
|
|
|
- month = month > 9 ? month : '0' + month
|
|
|
- return `${year}-${month}`
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除商机角色权限编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delAuthority(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
|
- },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('material/authority/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `authority_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-.el-card {
|
|
|
- width: calc(100% - 20px);
|
|
|
- height: 100%;
|
|
|
- margin: 10px;
|
|
|
- padding: 20px;
|
|
|
-}
|
|
|
-.el-button-group + .el-button-group {
|
|
|
- margin: 0 0 0 10px;
|
|
|
-}
|
|
|
-.btn_grooup {
|
|
|
- margin-bottom: 10px;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
-}
|
|
|
-.el-pagination {
|
|
|
- margin-top: 10px;
|
|
|
- text-align: right;
|
|
|
-}
|
|
|
-</style>
|