123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- <template>
- <div class="app-container">
- <el-card class="fiche">
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
- <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
- <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
- </div>
- <hr style="margin-top: 16px;">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="企业名称" prop="scyName">
- <el-input
- maxlength="30"
- v-model="queryParams.scyName"
- placeholder="请输入企业名称"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="社会统一代码" prop="scySocialCode">
- <el-input
- v-model="queryParams.scySocialCode"
- maxlength="30"
- placeholder="请输入社会统一代码"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="联系人" prop="nickName">
- <el-input
- v-model="queryParams.nickName"
- maxlength="30"
- placeholder="请输入联系人"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="联系电话" prop="userName">
- <el-input
- v-model="queryParams.userName"
- maxlength="11"
- placeholder="请输入联系电话"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="企业状态" prop="scyStatus">
- <el-select v-model="queryParams.scyStatus"
- placeholder="企业状态"
- clearable
- size="small"
- >
- <el-option
- v-for="dict in scyStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </el-card>
- <el-table v-loading="loading" :data="companyList" @selection-change="handleSelectionChange" stripe border>
- <el-table-column label="序号" type="index" width="50" align="center">
- <template slot-scope="scope">
- <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
- </template>
- </el-table-column>
- <el-table-column label="企业名称" align="center" prop="scyName" :show-overflow-tooltip="true" v-if="uncheckList.scyName"/>
- <el-table-column label="社会统一代码" align="center" prop="scySocialCode" v-if="uncheckList.scySocialCode"/>
- <el-table-column label="联系人" align="center" prop="nickName" v-if="uncheckList.nickName" />
- <el-table-column label="联系电话" align="center" prop="userName" v-if="uncheckList.userName"/>
- <el-table-column label="四要素状态" align="center" prop="scyAuthStatus" :formatter="scyAuthStatusFormat" v-if="uncheckList.scyAuthStatus"/>
- <el-table-column label="状态" align="center" prop="scyStatus" :formatter="scyStatusFormat" v-if="uncheckList.scyStatus"/>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.scyAuthStatus == '00' || scope.row.scyStatus == '00' || scope.row.scyStatus == '01'"
- size="mini"
- type="text"
- @click="handleDetail(scope.row)"
- v-hasPermi="['service:company:query']"
- >详情</el-button>
- <el-button
- v-if="scope.row.scyStatus == '00' && (scope.row.scyAuthStatus == '00' || scope.row.scyAuthStatus == '02')"
- size="mini"
- type="text"
- @click="handleExamine(scope.row)"
- v-hasPermi="['service:company:elementStatus']"
- >四要素审核</el-button>
- <el-button
- v-if="scope.row.scyAuthStatus == '00'"
- size="mini"
- type="text"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['service:company:update']"
- >修改</el-button>
- <el-button
- v-if="scope.row.scyStatus == '00'"
- size="mini"
- type="text"
- @click="handleCompanyFrozen(scope.row)"
- v-hasPermi="['service:company:updateCompanyStatus']"
- >冻结</el-button>
- <el-button
- v-if="scope.row.scyStatus == '01'"
- size="mini"
- type="text"
- @click="handleCompanyStatus(scope.row)"
- v-hasPermi="['service:company:updateCompanyStatus']"
- >解冻</el-button>
- <el-button
- v-if="scope.row.scyStatus != '00'"
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['service:company:delete']"
- >删除</el-button>
- <el-button
- v-if="scope.row.scyStatus == '00'"
- size="mini"
- type="text"
- @click="handleToCore(scope.row)"
- v-hasPermi="['service:company:companyToCore']"
- >改为核心企业</el-button>
- </template>
- </el-table-column>
- </el-table>
-
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改公司对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="140px" :inline="true">
- <el-form-item label="企业名称" prop="scyName">
- <el-input v-model="form.scyName" placeholder="请输入企业名称" style="width:560px" maxlength="20" show-word-limit/>
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode">
- <el-input v-model="form.scySocialCode" placeholder="请输入企业统一代码" maxlength="18" show-word-limit/>
- </el-form-item>
- <el-form-item label="联系人" prop="nickMame">
- <el-input v-model="form.nickMame" placeholder="请输入联系人" maxlength="5" show-word-limit/>
- </el-form-item>
- <el-form-item label="联系人手机号" prop="userName">
- <el-input v-model="form.userName" disabled maxlength="11" show-word-limit/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 详情公司对话框 -->
- <el-dialog :title="title" :visible.sync="openDetail" width="800px" append-to-body >
- <el-form ref="form" :model="form" :rules="rules" label-width="140px" :inline="true">
- <el-form-item label="企业名称" prop="scyName" >
- <el-input v-model="form.scyName" disabled style="width:560px" maxlength="20" show-word-limit/>
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode">
- <el-input v-model="form.scySocialCode" disabled maxlength="18" show-word-limit/>
- </el-form-item>
- <el-form-item label="联系人" prop="nickName">
- <el-input v-model="form.nickName" disabled maxlength="5" show-word-limit/>
- </el-form-item>
- <el-form-item label="联系人手机号" prop="userName">
- <el-input v-model="form.userName" disabled maxlength="11" show-word-limit/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 四要素审核 -->
- <el-dialog :title="examTitle" :visible.sync="examOpen" width="400px" append-to-body >
- <el-form ref="examForm" :model="examForm" :rules="examRules" label-width="140px" :inline="true">
- <template>
- <el-radio v-model="examForm.state" label="03">通过</el-radio>
- <el-radio v-model="examForm.state" label="04">拒绝</el-radio>
- </template>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="examSubmit">确 定</el-button>
- <el-button @click="examCancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listCompany, companyQuery, addCompany, updateCompany, updateCompanyStatus,
- getElementStatus, removeCompany, companyToCore} from "@/api/service/company/company";
- import { uploadFileNew } from "@/api/common/file";
- import { getToken } from "@/utils/auth";
- import {columnQuery,columnfilter} from "@/api/common/columnSetting";
- import ColumnSetting from '../../../components/Table/columnSetting.vue';
- import Cookies from 'js-cookie'
- export default {
- name: "supCompanyManage",
- components: {
- ColumnSetting
- },
- data() {
- return {
- //四要素审核相关
- examTitle:'',
- examOpen:false,
- examForm:{
- scyId:null,
- state:null
- },
- examRules:{
- state: [
- { required: true, message: "审核状态不能为空", trigger: "blur" },
- ]
- },
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 公司表格数据
- companyList: [],
- scyAuthStatusOptions:[],
- scyStatusOptions:[],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- openDetail : false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- scyName: null,
- scySocialCode: null,
- nickName : null,
- userName : null,
- scyStatus : null,
- scyType : '02'//供应商
- },
- //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
- tableList: [
- {
- label: 'scyId',
- value: '企业编号'
- },
- {
- label: 'scyName',
- value: '企业名称'
- },
- {
- label: 'scySocialCode',
- value: '社会统一代码'
- },
- {
- label: 'nickName',
- value: '联系人'
- },
- {
- label: 'userName',
- value: '联系电话'
- },
- {
- label: 'scyAuthStatus',
- value: '四要素状态'
- },
- {
- label: 'scyStatus',
- value: '状态'
- },
- ],
- checkList: [],//筛选列选中的数据列表--显示隐藏列用
- uncheckList: {},//控制筛选列显示隐藏--显示隐藏列用
- selfDom : this,
- tableId:"/sc-service/company/list",
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- scyName: [
- { required: true, message: "企业名称不能为空", trigger: ["blur", "change"]},
- {
- pattern: /^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$/,
- message: "企业名称不能含有特殊字符",
- trigger: ["blur", "change"]
- }
- ],
- nickName: [
- { required: true, message: "联系人不能为空", trigger: ["blur", "change"]},
- {
- pattern: /^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$/,
- message: "联系人不能含有特殊字符",
- trigger: ["blur", "change"]
- }
- ],
- userName: [
- { required: true, message: "联系人手机号不能为空", trigger: ["blur", "change"]},
- {
- pattern: /^((\d{3}-\d{7,8}|\d{4}-\d{7,8})|(1[3465789]\d{9}))$/,
- message: "手机号格式不正确",
- trigger: ["blur", "change"]
- }
- ],
- scySocialCode: [
- { required: true, message: "企业统一代码不能为空", trigger: "blur"},
- {
- pattern: /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/,
- message: "企业统一代码格式不正确",
- trigger: ["blur", "change"]
- }
- ],
- },
- };
- },
- activated(){
- this.getList();
- this.getDicts("ser_scy_status").then(response => {
- this.scyStatusOptions = response.data;
- });
- this.getDicts("ser_scy_authStatus").then(response => {
- this.scyAuthStatusOptions = response.data;
- });
- },
- mounted() {
- this.columnQuery();
- },
- methods: {
- //获取当前客户是否之前设置过列展示隐藏
- columnQuery(){
- //获取页面路径
- var psfPagePath = window.location.pathname;
- //用请求后台的url作为唯一标识
- var psfTableName = this.tableId;
- var columnForm = {};
- columnForm.psfPagePath = psfPagePath;
- columnForm.psfTableName = psfTableName;
- columnQuery(columnForm).then(response => {
- if(response.data && response.data.psfShowData){
- this.checkList = response.data.psfShowData;
- }
- this.filter();
- })
- },
- //控制隐藏显示的函数
- filter(checkList) {
- if (!!checkList) {
- this.checkList = checkList;
- }
- columnfilter(this.selfDom);
- },
- /** 查询公司列表 */
- getList() {
- this.loading = true;
- listCompany(this.queryParams).then(response => {
- this.companyList = response.data.records;
- this.total = response.data.total;
- this.loading = false;
- }
- );
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.openDetail = false,
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- scyName: null,
- scySocialCode: null,
- scyLegal : null,
- scyPhone : null
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- /* 企业详情 */
- handleDetail(row) {
- this.reset();
- this.resetForm("queryForm");
- let scyId = row.scyId || this.ids;
- let scyAuthStatus = row.scyAuthStatus || this.ids;
- let scyStatus = row.scyStatus || this.ids;
- if(scyStatus == '00'){
- Cookies.set("/company/detailComPany/" + scyId + '/', this.$route.fullPath)
- this.$router.push("/company/detailComPany/" + scyId + '/');
- }else
- if(scyAuthStatus == '00' || scyStatus == '01'){
- companyQuery(scyId).then(response => {
- this.form = response.data[0];
- this.openDetail = true;
- this.title = "详情企业信息";
- });
- }
- },
- /* 冻结 */
- handleCompanyFrozen(row) {
- const scyId = row.scyId || this.ids;
- const scyName = row.scyName;
- const state = '01';
- this.$confirm('是否确认冻结公司名称为"' + scyName + '"的数据?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return updateCompanyStatus(scyId,state);
- }).then(() => {
- this.getList();
- this.msgSuccess("冻结成功");
- })
- .catch((c) => {
- if(c == "cancel"){
- this.$message({
- type: "warning",
- message: "已取消冻结",
-
- });
- }
- });
- },
- /* 解冻 */
- handleCompanyStatus(row) {
- const scyId = row.scyId || this.ids;
- const scyName = row.scyName;
- const state = '00';
- this.$confirm('是否确认解冻公司名称为"' + scyName + '"的数据?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return updateCompanyStatus(scyId,state);
- }).then(() => {
- this.getList();
- this.msgSuccess("解冻成功");
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消解冻",
-
- });
- });
- },
- //四要素审核
- handleExamine(row){
- this.reset();
- this.resetForm("queryForm");
- const scyId = row.scyId || this.ids;
- Cookies.set("/company/detailComPanyExam/" + scyId + '/', this.$route.fullPath)
- this.$router.push("/company/detailComPanyExam/" + scyId + '/');
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const scyId = row.scyId || this.ids;
- const scyName = row.scyName;
- this.$confirm('是否确认删除企业名称为"' + scyName + '"的数据?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return removeCompany(scyId);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消删除",
-
- });
- });
- },
- /** 更改为核心企业 */
- handleToCore(row) {
- const scyId = row.scyId || this.ids;
- const scyName = row.scyName;
- this.$confirm('确认把名称为"' + scyName + '"的企业改为核心企业?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return companyToCore(scyId);
- }).then(() => {
- this.getList();
- this.msgSuccess("更改成功");
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消更改",
-
- });
- });
- },
- scyStatusFormat(row, column) {
- if(row.scyStatus == '02' || row.scyStatus == '03' || row.scyStatus == '04'){
- return this.selectDictLabel(this.scyStatusOptions, "02");
- }else {
- return this.selectDictLabel(this.scyStatusOptions, row.scyStatus);
- }
- },
- scyAuthStatusFormat(row, column) {
- return this.selectDictLabel(this.scyAuthStatusOptions, row.scyAuthStatus);
- },
- }
- };
- </script>
|