Commit 206882e0 by zhaoxiqing

gsb

parent 4781e212
var system = require("../../system")
var settings = require("../../../config/settings");
const CtlBase = require("../ctl.base");
const moment = require("moment");
class offlinecompanyCtl extends CtlBase {
constructor() {
super(CtlBase.getServiceName(offlinecompanyCtl));
}
async allList(queryobj, qobj, req) {
try {
var params = qobj;
var page = await this.service.pageByCondition(params);
console.log(page)
return system.getResult2(page);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
async getinfo(queryobj, qobj, req){
console.log(qobj)
let channel = await this.service.findById(qobj.id);
return system.getResult2(channel);
}
async companylSave(queryobj, qobj, req){
try {
var rs = await this.service.updateCreate(qobj);
return rs;
} catch (e) {
console.log(e);
return system.getErrResult2("出现异常,请联系管理员");
}
}
}
module.exports = offlinecompanyCtl;
...@@ -95,7 +95,7 @@ module.exports = { ...@@ -95,7 +95,7 @@ module.exports = {
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ {
"code": "econtractall", "code": "econtractall",
"label": "已签协议", "label": "已签协议",
...@@ -269,7 +269,7 @@ module.exports = { ...@@ -269,7 +269,7 @@ module.exports = {
"bizCode": "ecompanyall", "bizCode": "ecompanyall",
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ {
"code": "qd_ecompanymy", "code": "qd_ecompanymy",
"label": "成交客户", "label": "成交客户",
...@@ -456,7 +456,7 @@ module.exports = { ...@@ -456,7 +456,7 @@ module.exports = {
"bizCode": "ecompanyall", "bizCode": "ecompanyall",
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ {
"code": "pt_ecompanymy", "code": "pt_ecompanymy",
"label": "成交客户", "label": "成交客户",
...@@ -720,7 +720,7 @@ module.exports = { ...@@ -720,7 +720,7 @@ module.exports = {
"bizCode": "ecompanyall", "bizCode": "ecompanyall",
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ {
"code": "dkh_ecompanymy", "code": "dkh_ecompanymy",
"label": "成交客户", "label": "成交客户",
...@@ -829,7 +829,7 @@ module.exports = { ...@@ -829,7 +829,7 @@ module.exports = {
}, },
], ],
}, },
{ {
"code": "tz_ecompany", "isGroup": true,"icon":"fa fa-user-circle", "label": "客户管理 ", "children": [ "code": "tz_ecompany", "isGroup": true,"icon":"fa fa-user-circle", "label": "客户管理 ", "children": [
{ {
...@@ -855,7 +855,7 @@ module.exports = { ...@@ -855,7 +855,7 @@ module.exports = {
"bizCode": "ecompanyall", "bizCode": "ecompanyall",
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ {
"code": "tz_ecompanymy", "code": "tz_ecompanymy",
"label": "成交客户", "label": "成交客户",
...@@ -985,14 +985,14 @@ module.exports = { ...@@ -985,14 +985,14 @@ module.exports = {
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ // {
"code": "zc_esettlegsblist", // "code": "zc_esettlegsblist",
"label": "公司宝结算", // "label": "公司宝结算",
"isMenu": true, // "isMenu": true,
"bizCode": "esettlegsblist", // "bizCode": "esettlegsblist",
"bizConfig": null, // "bizConfig": null,
"path": "" // "path": ""
}, // },
// { // {
// "code": "zc_esettleofflinetax", // "code": "zc_esettleofflinetax",
// "label": "公司宝个税", // "label": "公司宝个税",
...@@ -1049,6 +1049,26 @@ module.exports = { ...@@ -1049,6 +1049,26 @@ module.exports = {
], ],
}, },
{ {
"code": "gsb_settle_accounts", "isGroup": true,"icon":"fa fa-user-circle", "label": "公司宝结算 ", "children": [
{
"code": "c_offline_company",
"label": "商户管理",
"isMenu": true,
"bizCode": "offlinecompany",
"bizConfig": null,
"path": ""
},
{
"code": "zc_esettlegsblist",
"label": "交易管理",
"isMenu": true,
"bizCode": "esettlegsblist",
"bizConfig": null,
"path": ""
},
],
},
/* {
"code": "qd_ecompany", "isGroup": true,"icon":"fa fa-user-circle", "label": "客户管理 ", "children": [ "code": "qd_ecompany", "isGroup": true,"icon":"fa fa-user-circle", "label": "客户管理 ", "children": [
{ {
"code": "zc_eintentionall", "code": "zc_eintentionall",
...@@ -1059,7 +1079,7 @@ module.exports = { ...@@ -1059,7 +1079,7 @@ module.exports = {
"path": "" "path": ""
}, },
], ],
}, },*/
{ {
"code": "qd_ecompany", "isGroup": true,"icon":"fa fa-user-circle", "label": "客户管理 ", "children": [ "code": "qd_ecompany", "isGroup": true,"icon":"fa fa-user-circle", "label": "客户管理 ", "children": [
{ {
...@@ -1365,9 +1385,9 @@ module.exports = { ...@@ -1365,9 +1385,9 @@ module.exports = {
"bizConfig": null, "bizConfig": null,
"path": "" "path": ""
}, },
{ {
"code": "signinfoyd", "code": "signinfoyd",
"label": "签约人信息", "label": "签约人信息",
...@@ -1502,31 +1522,33 @@ module.exports = { ...@@ -1502,31 +1522,33 @@ module.exports = {
"ecompanyall": {"title": "全部成交", "config": null, "path": "/ecompanyall", "comname": "ecompanyall"}, "ecompanyall": {"title": "全部成交", "config": null, "path": "/ecompanyall", "comname": "ecompanyall"},
"ecompanymy": {"title": "我的成交", "config": null, "path": "/ecompanymy", "comname": "ecompanymy"}, "ecompanymy": {"title": "我的成交", "config": null, "path": "/ecompanymy", "comname": "ecompanymy"},
// 意向客户 // 意向客户
"eintentionall": {"title": "全部客户", "config": null, "path": "/eintentionall", "comname": "eintentionall"}, "eintentionall": {"title": "全部客户", "config": null, "path": "/eintentionall", "comname": "eintentionall"},
// 我的客户 // 我的客户
"eintentionmy": {"title": "意向客户", "config": null, "path": "/eintentionmy", "comname": "eintentionmy"}, "eintentionmy": {"title": "意向客户", "config": null, "path": "/eintentionmy", "comname": "eintentionmy"},
// 全部合同 // 全部合同
"ecompanycontractall": {"title": "全部合同", "config": null, "path": "/ecompanycontractall", "comname": "ecompanycontractall"}, "ecompanycontractall": {"title": "全部合同", "config": null, "path": "/ecompanycontractall", "comname": "ecompanycontractall"},
"ecompanycontractedit": {"title": "全部合同-新增合同", "config": null, "path": "/ecompanycontractedit", "comname": "ecompanycontractedit"}, "ecompanycontractedit": {"title": "全部合同-新增合同", "config": null, "path": "/ecompanycontractedit", "comname": "ecompanycontractedit"},
"ecompanycontractinfo": {"title": "全部合同-合同详情", "config": null, "path": "/ecompanycontractinfo", "comname": "ecompanycontractinfo"}, "ecompanycontractinfo": {"title": "全部合同-合同详情", "config": null, "path": "/ecompanycontractinfo", "comname": "ecompanycontractinfo"},
// 我的合同 // 我的合同
"ecompanycontractmy": {"title": "我的合同", "config": null, "path": "/ecompanycontractmy", "comname": "ecompanycontractmy"}, "ecompanycontractmy": {"title": "我的合同", "config": null, "path": "/ecompanycontractmy", "comname": "ecompanycontractmy"},
// 发薪详情 // 发薪详情
"ecommissionlist": {"title": "发薪详情", "config": null, "path": "/ecommissionlist", "comname": "ecommissionlist"}, "ecommissionlist": {"title": "发薪详情", "config": null, "path": "/ecommissionlist", "comname": "ecommissionlist"},
"ecommissionall": {"title": "发薪详情", "config": null, "path": "/ecommissionall", "comname": "ecommissionall"}, "ecommissionall": {"title": "发薪详情", "config": null, "path": "/ecommissionall", "comname": "ecommissionall"},
"esettlegsblist": {"title": "公司宝结算", "config": null, "path": "/esettlegsblist", "comname": "esettlegsblist"}, //公司宝结算
"offlinecompany" : {"title": "商户管理", "config": null, "path": "/offlinecompany", "comname": "offlinecompany"},
"esettlegsblist": {"title": "交易管理", "config": null, "path": "/esettlegsblist", "comname": "esettlegsblist"},
"esettleofflinetax": {"title": "公司宝个税", "config": null, "path": "/esettleofflinetax", "comname": "esettleofflinetax"}, "esettleofflinetax": {"title": "公司宝个税", "config": null, "path": "/esettleofflinetax", "comname": "esettleofflinetax"},
"esettlebalance": {"title": "公司余额", "config": null, "path": "/esettlebalance", "comname": "esettlebalance"}, "esettlebalance": {"title": "公司余额", "config": null, "path": "/esettlebalance", "comname": "esettlebalance"},
"epartneramtlist": {"title": "发薪详情", "config": null, "path": "/epartneramtlist", "comname": "epartneramtlist"}, "epartneramtlist": {"title": "发薪详情", "config": null, "path": "/epartneramtlist", "comname": "epartneramtlist"},
"epartneramtall": {"title": "发薪详情", "config": null, "path": "/epartneramtall", "comname": "epartneramtall"}, "epartneramtall": {"title": "发薪详情", "config": null, "path": "/epartneramtall", "comname": "epartneramtall"},
...@@ -1554,7 +1576,7 @@ module.exports = { ...@@ -1554,7 +1576,7 @@ module.exports = {
"ecompanysettles": {"title": "报酬详情", "config": null, "path": "/ecompanysettles", "comname": "ecompanysettles"}, "ecompanysettles": {"title": "报酬详情", "config": null, "path": "/ecompanysettles", "comname": "ecompanysettles"},
"ecompanysafesettings": {"title": "安全设置", "config": null, "path": "/ecompanysafesettings", "comname": "ecompanysafesettings"}, "ecompanysafesettings": {"title": "安全设置", "config": null, "path": "/ecompanysafesettings", "comname": "ecompanysafesettings"},
"ecompanyauthlist": {"title": "企业中心", "config": null, "path": "/ecompanyauthlist", "comname": "ecompanyauthlist"}, "ecompanyauthlist": {"title": "企业中心", "config": null, "path": "/ecompanyauthlist", "comname": "ecompanyauthlist"},
// 总后台 // 总后台
"adminhome": {"title": "首页", "config": null, "path": "/adminhome", "comname": "adminhome"}, "adminhome": {"title": "首页", "config": null, "path": "/adminhome", "comname": "adminhome"},
"ejoballmanager": {"title": "需求管理", "config": null, "path": "/ejoballmanager", "comname": "ejoballmanager"}, "ejoballmanager": {"title": "需求管理", "config": null, "path": "/ejoballmanager", "comname": "ejoballmanager"},
...@@ -1618,16 +1640,16 @@ module.exports = { ...@@ -1618,16 +1640,16 @@ module.exports = {
"eduType": {"10":"小学","20":"初中","30":"中专","40":"高中","50":"大专","60":"本科","70":"硕士","80":"博士"}, "eduType": {"10":"小学","20":"初中","30":"中专","40":"高中","50":"大专","60":"本科","70":"硕士","80":"博士"},
"identityType": {"10":"在校学生","20":"自由职业者","30":"兼职人员"}, "identityType": {"10":"在校学生","20":"自由职业者","30":"兼职人员"},
"jdAuthStatus": {'0': '待认证', '1' : '已认证', '2' : '认证失败'}, "jdAuthStatus": {'0': '待认证', '1' : '已认证', '2' : '认证失败'},
"companyNature" : {"100":"有限责任公司", "200":"股份有限公司", "300":"国有企业", "400":"民营企业", "500":"个体户", "600":"事业单位", "companyNature" : {"100":"有限责任公司", "200":"股份有限公司", "300":"国有企业", "400":"民营企业", "500":"个体户", "600":"事业单位",
"700":"政府机构", "800":"非营利组织", "900":"合伙企业" "700":"政府机构", "800":"非营利组织", "900":"合伙企业"
}, },
"companyIndustry" : {"100":"农、林、牧、渔业", "200":"采矿业", "300":"制造业", "400":"电力、热力、燃气及水生产和供应业", "500":"建筑业", "companyIndustry" : {"100":"农、林、牧、渔业", "200":"采矿业", "300":"制造业", "400":"电力、热力、燃气及水生产和供应业", "500":"建筑业",
"600":"批发和零售业", "700":"交通运输、仓储和邮政业", "800":"住宿和餐饮业", "900":"信息传输、软件和信息技术服务业", "1000":"金融业", "600":"批发和零售业", "700":"交通运输、仓储和邮政业", "800":"住宿和餐饮业", "900":"信息传输、软件和信息技术服务业", "1000":"金融业",
"1100":"房地产业", "1200":"租赁和商务服务业", "1300":"科学研究和技术服务业", "1400":"水利、环境和公共设施管理业", "1500":"居民服务、修理和其他服务业", "1100":"房地产业", "1200":"租赁和商务服务业", "1300":"科学研究和技术服务业", "1400":"水利、环境和公共设施管理业", "1500":"居民服务、修理和其他服务业",
"1600":"教育", "1700":"卫生和社会工作", "1800":"文化、体育和娱乐业", "1900":"公共管理、社会保障和社会组织", "2000":"国际组织" "1600":"教育", "1700":"卫生和社会工作", "1800":"文化、体育和娱乐业", "1900":"公共管理、社会保障和社会组织", "2000":"国际组织"
}, },
"bpoAdvantage" : {"10":"企业资源多", "20":"企业高层朋友多", "30":"熟悉财税社保业务", "40":"其他"}, "bpoAdvantage" : {"10":"企业资源多", "20":"企业高层朋友多", "30":"熟悉财税社保业务", "40":"其他"},
"commissionType" : {"0":"首次发薪提成","1":"每次发薪提成","2":"佣金提成"}, "commissionType" : {"0":"首次发薪提成","1":"每次发薪提成","2":"佣金提成"},
"commissionSource" : {"0":"我的客户","1":"合伙人"}, "commissionSource" : {"0":"我的客户","1":"合伙人"},
"ecompanySourceType" : {"0":"直接开发","10":"转介绍","20":"扫码推广","90":"其他来源"}, "ecompanySourceType" : {"0":"直接开发","10":"转介绍","20":"扫码推广","90":"其他来源"},
"ecompanyLevel" : {"0":"普通","1":"小微","2":"重要"}, "ecompanyLevel" : {"0":"普通","1":"小微","2":"重要"},
......
...@@ -17,7 +17,6 @@ module.exports = (db, DataTypes) => { ...@@ -17,7 +17,6 @@ module.exports = (db, DataTypes) => {
// define the table's name // define the table's name
tableName: 'c_offline_company', tableName: 'c_offline_company',
validate: { validate: {
}, },
indexes:[ indexes:[
// Create a unique index on email // Create a unique index on email
......
...@@ -6,25 +6,56 @@ class OfflinecompanyService extends ServiceBase{ ...@@ -6,25 +6,56 @@ class OfflinecompanyService extends ServiceBase{
super(ServiceBase.getDaoName(OfflinecompanyService)); super(ServiceBase.getDaoName(OfflinecompanyService));
} }
async pageByCondition(params) {
var currentPage = Number(params.currentPage || 0);
var pageSize = Number(params.pageSize || 10);
var where = {};
if (params.name) {
where.company_name = {
[this.db.Op.like]: "%" + params.name + "%"
};
}
var orderby = [
["id", 'desc']
];
var attributes = ["id", "company_name", "contact_man", "contact_mobile", "contact_email", "contact_addr", "created_at"];
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) {
for (var row of page.rows) {
this.handleDate(row, ["created_at"], null, -8);
}
}
return page;
}
async updateCreate(params){ async updateCreate(params){
params.company_name =params.merchant_name;
var offlinecompany = await this.dao.findOne({company_name : params.merchant_name}); var offlinecompany = await this.dao.findOne({company_name : params.company_name});
if(offlinecompany){
offlinecompany.contact_man = params.contact_man; if(offlinecompany && !params.id){
offlinecompany.contact_mobile = params.contact_mobile; return {status :-1,msg:"商户已存在"}
offlinecompany.contact_email = params.contact_email; }
offlinecompany.contact_addr = params.contact_addr; if(params.id){
var updates = await offlinecompany.save(); var offlinecompanys = await this.dao.findById(params.id);
offlinecompanys.company_name = params.company_name;
offlinecompanys.contact_man = params.contact_man;
offlinecompanys.contact_mobile = params.contact_mobile;
offlinecompanys.contact_email = params.contact_email;
offlinecompanys.contact_addr = params.contact_addr;
var updates = await offlinecompanys.save();
if(updates.id > 0){ if(updates.id > 0){
return updates; return {status :0,msg:"修改成功"};
} }
return -1; return {status :-1,msg:"修改失败"};
} }
var saves = await this.dao.create(params); var saves = await this.dao.create(params);
if(saves.id > 0){ if(saves.id > 0){
return saves; return {status :0,msg:"添加成功"};
} }
return -1; return {status :-1,msg:"添加失败"};
} }
......
<gsb-pcpage>
<style>
::el-radio-button__inner {
border-color: #D9D9D9;
}
</style>
<div style="padding:20px;">
<div style="height: auto;min-width: 1000px; max-width: 1500px;">
<el-card style="background-color: #FFFFFF;padding:10px 10px 30px 10px;margin-top: 20px;">
<div style="width:100%;line-height: 40px;">
<div style="float:left;width: 300px;">
<span style="color:2F2F2F;font-size: 14px;" >商户名称: </span>
<el-input v-model="search.name" placeholder="请输商户名称" maxlength="100" clearable style="max-width:200px;height: 36px;" ></el-input>
</div>
<div style="float:left;margin-top:5px;">
<el-button @click="resetSearch()" style="float:right;width:68px;height:36px;background-color: #54C4A7;color: #FFFFFF;font-size: 14px;padding-top:10px;" >重置</el-button>
<el-button @click="opSearch" style="float:right;width:68px;height:36px;background-color: #54C4A7;color: #FFFFFF;font-size: 14px;padding-top:10px;margin-right: 10px;" >搜索</el-button>
</div>
</div>
</el-card>
<el-card style="background-color: #FFFFFF;padding:10px 10px 30px 10px;margin-top: 20px;">
<div>
<div style="line-height: 36px;padding-bottom: 20px;">
<span style="float:left;color:#2F2F2F;font-size: 14px;">共{{search.total}}条记录</span>
<el-button @click="openEdit()" style="float:right;width:100px;height:36px;color: #FFFFFF;font-weight: 400;border-radius: 4px;font-size: 14px;background-color: #59C1A6;padding-top:11px">增加商户</el-button>
</div>
<div>
<el-table
stripe
fix="true"
:data="search.list"
tooltip-effect="light"
style="min-width: 1000px;max-width: 1500px;margin-top: 23px;min-height: 500px;"
empty-text="暂无需求"
header-cell-style="background-color: #F5F5F5;color: #2F2F2F;font-size: 14px;font-weight:400;"
row-style="height:50px;" >
<el-table-column prop="id" label="商户ID" :formatter="onColFormater" width="80" align="center" ></el-table-column>
<el-table-column prop="company_name" label="商户名称" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="contact_man" label="联系人" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="contact_mobile" label="联系人电话" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="contact_email" label="联系人邮箱" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column prop="contact_addr" label="联系地址" :formatter="onColFormater" align="center" show-overflow-tooltip ></el-table-column>
<el-table-column label="操作" align="center" >
<template slot-scope="scope">
<a href="javascript:;" @click="openEdit(scope.row.id)" style="text-decoration: none;color:#59C1A6;font-size: 14px;">修改</a>
</template>
</el-table-column>
</el-table>
<div style="width:100%;text-align: center;margin-top: 20px">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="search.currentPage"
:page-sizes="[10, 20, 50, 100]"
:page-size="search.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="search.total">
</el-pagination>
</div>
</div>
</div>
</el-card>
<el-dialog width="862px" :visible.sync="showEdit">
<div slot="title">
<span style="margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;">{{editTitle}}商户</span>
<div style="width: 862px; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"></div>
</div>
<el-form :model="offlinecompanys" :rules="rules" ref="offlinecompanys" label-width="100px" label="right" style="padding:0px 100px;" >
<div style="0px 10px; line-height: 15px;padding-bottom:40px;">
<div style="width:2px;height:15px;float: left;background-color: #54C4A7">
</div>
<span style="font-size:15px;color: #333333;float: left;font-weight:bold;margin-left: 7px;">商户信息</span>
</div>
<el-form-item label="商户名称:" prop="company_name">
<el-input v-model="offlinecompanys.company_name" placeholder="请输入商户名称" maxlength="200" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="联系人:" prop="contact_man" >
<el-input v-model="offlinecompanys.contact_man" placeholder="请输入联系人" maxlength="200" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="联系电话:" prop="contact_mobile" >
<el-input v-model="offlinecompanys.contact_mobile" placeholder="请输入联系电话" maxlength="11" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="联系邮箱:" prop="contact_email" >
<el-input v-model="offlinecompanys.contact_email" placeholder="请输入联系邮箱" maxlength="100" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="联系地址:" prop="contact_addr" >
<el-input v-model="offlinecompanys.contact_addr" placeholder="请输入联系地址" maxlength="200" style="width:468px;" clearable ></el-input>
</el-form-item>
</el-form>
<div style="margin-left: 200px;">
<el-button :loading="saveLoading" @click="saveCompany" style="width:120px;height:36px; background:#54C4A7; border-radius:4px;color: #FFFFFF;font-size: 16px;padding-top: 10px;">保存</el-button>
</div>
</el-dialog>
</div>
</gsb-pcpage>
{
template: '${tmpl}',
data: function () {
var validMethod = (rule, value, callback) => {
return this.validfileds(rule, value, callback);
};
return {
offlinecompanys: {},
editTitle: "新增",
showEdit: false,
saveLoading: false,
ownerList:[],
ownerMap:[],
ownerLoading:false,
owner_id: "",
search: {
list: [],
currentPage: 1,
pageSize: 20,
total : 0,
name:'',
},
rules: {
company_name: [
{ required: true, message: '请输入商户名称', trigger: 'blur' },
],
contact_man: [
{ required: true, message: '请输入联系人', trigger: 'blur' },
],
contact_mobile : [
{ required: true, message: '请输入联系电话', trigger: 'blur' },
],
contact_email: [
{ required: true, message: '请输入联系邮箱', trigger: 'blur' },
],
contact_addr : [
{ required: true, message: '请输入联系地址', trigger: 'blur' },
],
},
}
},
mounted: function () {
this.resetSearch(true);
},
created: function () {},
methods: {
getEmptySearch() {
return {
list: [],
currentPage: 1,
pageSize: 20,
total : 0,
name:'',
}
},
resetSearch() {
this.search = this.getEmptySearch();
this.getList();
},
opSearch() {
this.search.currentPage = 1;
this.search.total = 0;
this.getList();
},
getList() {
var self = this;
var params = this.getParams();
this.$root.postReq("/web/offlinecompanyCtl/allList", params).then(function (d) {
if (d.status == 0) {
self.search.list = d.data.rows || [];
self.search.total = d.data.count || 0;
} else {
}
});
},
getParams() {
var params = {};
for(var f in this.search) {
if(f == "list") {
continue;
}
params[f] = this.search[f];
}
return params;
},
openEdit(id) {
this.ownerLoading = false;
this.saveLoading = false;
this.owner_id = null;
if(this.$refs.offlinecompanys) {
this.$refs.offlinecompanys.resetFields();
}
if(id) {
this.getDKcompany(id);
this.editTitle = "修改";
} else {
this.editTitle = "新增";
this.offlinecompanys = {};
}
this.showEdit = true;
},
getDKcompany(id) {
var self = this;
self.$root.postReq("/web/offlinecompanyCtl/getinfo", {
id: id,
}).then(function (d) {
if (d.status == 0) {
self.offlinecompanys = d.data;
} else {
self.$message.warning(d.msg || `您的网络不稳定, 请稍后重试`);
}
});
},
onColFormater(row, column, cellValue, index) {
return cellValue || "---";
},
handleSizeChange(val) {
this.search.pageSize = val;
this.resetSearch();
},
handleCurrentChange(val) {
this.search.currentPage = val;
this.getList();
},
saveCompany() {
var self = this;
self.saveLoading = true;
self.$refs.offlinecompanys.validate((valid) => {
if (valid) {
self.$root.postReq("/web/offlinecompanyCtl/companylSave", self.offlinecompanys).then(function (d) {
if (d.status == 0) {
self.$message.success(d.msg);
self.showEdit = false;
self.getList();
} else {
self.$alert(d.msg || '保存失败', '提示', {
confirmButtonText: '确定',
callback: action => {}
});
}
self.saveLoading = false;
});
} else {
self.saveLoading = false;
return false;
}
});
setTimeout(() => {
self.saveLoading = false;
}, 5000);
},
},
vname: "gsb-dkcompanyadmin"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment