Commit 28a17f86 by zhaoxiqing

gsb

parent afb3e779
var system = require("../../system")
var settings = require("../../../config/settings");
const CtlBase = require("../ctl.base");
const uuidv4 = require('uuid/v4');
const moment = require("moment");
class EcontractofflineCtl extends CtlBase {
constructor() {
super(CtlBase.getServiceName(EcontractofflineCtl));
}
async saveEcontractOffline(queryobj, obj, req) {
try {
return await this.service.saveEcontractOffline(obj);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
async allList(queryobj, obj, req) {
var params = obj.search || {};
try {
var page = await this.service.allList(params);
return system.getResult2(page);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
async info(queryobj, qobj, req) {
var id = Number(qobj.id);
try {
var info = await this.service.findById(id);
if (info) {
if (info.created_at) {
info.created_at = moment(info.created_at).format("YYYY-MM-DD HH:mm:ss");
}
}
return system.getResult2(info);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
}
module.exports = EcontractofflineCtl;
......@@ -74,6 +74,18 @@ class EtemplatebusiCtl extends CtlBase {
var list = await this.esettleSve.suggest(name);
return system.getResult2(list);
}
async suggest2(queryobj, qobj, req) {
var name = this.trim(qobj.name);
if (!name) {
return system.getResult2([])
}
var list = await this.esettleSve.suggest2(name);
return system.getResult2(list);
}
}
module.exports = EtemplatebusiCtl;
\ No newline at end of file
module.exports = EtemplatebusiCtl;
const system = require("../../system");
const Dao = require("../dao.base");
class EcontractofflineDao extends Dao {
constructor() {
super(Dao.getModelName(EcontractofflineDao));
}
}
module.exports = EcontractofflineDao;
......@@ -1057,6 +1057,18 @@ module.exports = {
],
},
{
"code": "zc_econtract_offline", "isGroup": true,"icon":"fa fa-user-circle", "label": "线下管理 ", "children": [
{
"code": "zc_econtract_offline_manager",
"label": "线下签约",
"isMenu": true,
"bizCode": "econtractoffline",
"bizConfig": null,
"path": ""
},
],
},
{
"code": "gsb_settle_accounts", "isGroup": true,"icon":"fa fa-user-circle", "label": "公司宝结算 ", "children": [
{
"code": "c_offline_company",
......@@ -1597,6 +1609,9 @@ module.exports = {
"channelmanager": {"title": "渠道管理", "config": null, "path": "/channelmanager", "comname": "channelmanager"},
"channelmerchantmanager": {"title": "商户管理", "config": null, "path": "/channelmerchantmanager", "comname": "channelmerchantmanager"},
//线下签约
"econtractoffline": {"title": "线下签约", "config": null, "path": "/econtractoffline", "comname": "econtractoffline"},
// 需求管理
"ejobmanager": {"title": "需求管理", "config": null, "path": "/ejobmanager", "comname": "ejobmanager"},
"ejobapplys": {"title": "需求零工", "config": null, "path": "/ejobapplys", "comname": "ejobapplys"},
......
const system = require("../../system");
const settings = require("../../../config/settings");
const uiconfig = system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
return db.define("econtractoffline", {
mchtId: DataTypes.STRING,
mchtName: DataTypes.STRING,
id_no: DataTypes.STRING,
id_name: DataTypes.STRING,
bank_no: DataTypes.STRING,
mobile: DataTypes.STRING,
fileurl: DataTypes.STRING,
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_econtract_offline',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../system");
const ServiceBase = require("../sve.base");
const moment = require("moment");
const md5 = require("MD5");
class EcontractofflineService extends ServiceBase {
constructor() {
super(ServiceBase.getDaoName(EcontractofflineService));
this.etemplateSve = system.getObject("service.etemplateSve");
this.usereaccountSve = system.getObject("service.usereaccountSve");
}
async allList(params) {
var currentPage = Number(params.currentPage || 0);
var pageSize = Number(params.pageSize || 10);
var where = {};
if (params.mchtId) {
where.mchtId = params.mchtId;
}
if (params.mchtName) {
where.mchtName = params.mchtName;
}
if (params.id_name) {
where.id_name = {
[this.db.Op.like]: "%" + params.id_name + "%"
};
}
if (params.mobile) {
where.mobile = params.mobile;
}
if (params.id_no) {
where.id_no = params.id_no;
}
var orderby = [
["id", 'desc']
];
var page = await this.getPageList(currentPage, pageSize, where, orderby);
if (page && page.rows) {
for (var row of page.rows) {
this.handleDate(row, ["created_at"], null);
}
}
return page;
}
async saveEcontractOffline(obj) {
// var mchtId = obj.mchtId;
obj.id_no = obj.id_no.toUpperCase();
// // 1 查签约模板(c_etemplate_busi)
// var templateIds = await this.etemplateSve.findIdsByCompanyIdAndMainId(mchtId);
// if (templateIds.idsO.length == 0 && templateIds.idsT.length == 0) {
// return this.returnjson(-1,"电子签模板签约主体设置错误,请到bpo后台重新设置");
// }
// // 2查签约用户
// //3方电子签
// if (templateIds.idsO.length > 0) {
// var idsOCOunt = await this.usereaccountSve.getSignAccounts(templateIds.idsO, obj.id_no, obj.id_name);
// }
// //2方电子签
// if (templateIds.idsT.length > 0) {
// var idsTCount = await this.usereaccountSve.getSignAccounts_dk(templateIds.idsT, obj.id_no, obj.id_name);
// }
//
// if(idsOCOunt || idsTCount){
let econtractOffline;
if (obj.id) {
econtractOffline = await this.findById(obj.id);
} else {
econtractOffline = {isEnabled: 1};
}
econtractOffline.mchtId = this.trim(obj.mchtId);
econtractOffline.mchtName = this.trim(obj.mchtName);
econtractOffline.id_no = this.trim(obj.id_no);
econtractOffline.id_name = this.trim(obj.id_name);
econtractOffline.bank_no = this.trim(obj.bank_no);
econtractOffline.mobile = this.trim(obj.mobile);
econtractOffline.fileurl = this.trim(obj.fileurl);
if (econtractOffline.id) {
try {
econtractOffline = await econtractOffline.save();
} catch (e) {
return this.returnjson(-1, "用户已存在");
}
} else {
try {
econtractOffline = await this.dao.create(econtractOffline);
} catch (e) {
return this.returnjson(-1, "用户已存在");
}
}
return system.getResult2(econtractOffline);
// }
}
trim(o) {
if (!o) {
return "";
}
return o.toString().trim();
}
returnjson(code, msg, data) {
return {
code: code,
msg: msg,
data: data || null
}
}
}
module.exports = EcontractofflineService;
......@@ -84,7 +84,7 @@ class EtemplateService extends ServiceBase{
}
async getInfo(id) {
var attrs = ["id", "name", "ecompanyMainId", "mainId", "nameA", "templateid", "filekey", "filepath", "qrcodeurl",
var attrs = ["id", "name", "ecompanyMainId", "mainId", "nameA", "templateid", "filekey", "filepath", "qrcodeurl",
"placeholderkey", "isEnabled", "created_at", "updated_at", "ecompany_id"];
return await this.dao.model.findOne({
where: { id: id }, attrs, raw: true
......@@ -113,5 +113,25 @@ class EtemplateService extends ServiceBase{
});
return list;
}
async findIdsByCompanyIdAndMainId(mtchId) {
var sql = "SELECT template_id,template_type FROM `c_etemplate_busi` WHERE busi_id = :busiId";
var list = await this.dao.customQuery(sql, {busiId: mtchId});
var ids = {
idsO:[],
idsT:[],
};
if(list) {
for(var item of list) {
if(item.template_type == 1){
ids.idsO.push(item.template_id)
}else if(item.template_type == 2){
ids.idsT.push(item.template_id)
}
}
}
return ids;
}
}
module.exports=EtemplateService;
......@@ -30,7 +30,7 @@ class UsereaccountService extends ServiceBase{
list : [],
};
var isValid = true;
var isValid = true;
var regexNumber = /^[0-9]*$/;
var dataList = [];
......@@ -80,10 +80,10 @@ class UsereaccountService extends ServiceBase{
data.id_card = this.trim(cells[1]).toUpperCase();
data.phone = this.trim(cells[2]) || "";
data.bank_no = this.trim(cells[3]);
data.rowNum = rowNum;
//验证不为空
if(!data.name) {
result.msg = "excel第" + rowNum + "行,请填写姓名";
......@@ -98,7 +98,7 @@ class UsereaccountService extends ServiceBase{
return result;
}
//验证是否有效
// if(!await this.idcardClient.checkIDCard(data.id_card)) {
// erridcardLines.push(rowNum);
......@@ -110,7 +110,7 @@ class UsereaccountService extends ServiceBase{
return result;
}
}
if(!regexNumber.test(data.bank_no)) {
result.msg = "excel第" + rowNum + "行,银行卡号格式错误,请填写纯数字";
return result;
......@@ -128,10 +128,10 @@ class UsereaccountService extends ServiceBase{
result.msg = "excel第【" + erridcardLines.join("、") + "】行,身份证号格式错误!";
return result;
}
result.code = 1;
result.list = datalist;
result.list = datalist;
return result;
} catch (error) {
......@@ -141,5 +141,42 @@ class UsereaccountService extends ServiceBase{
}
}
async getSignAccounts(etemplateIds, idNoList, idNameList) {
var sql = [];
sql.push("SELECT ");
sql.push("t2.userName, t2.personsSign");
sql.push("FROM c_econtract t1");
sql.push("INNER JOIN p_user_eaccount t2 ON t1.usereaccount_id = t2.id");
sql.push("WHERE t1.etemplate_id IN (:etemplateIds) AND t1.`eflowstatus` = '2'");
sql.push("AND t2.`userName` IN (:idNameList)");
sql.push("AND t2.`personsSign` IN (:idNoList)");
var list = await this.dao.customQuery(sql.join(" "), {
etemplateIds: etemplateIds,
idNameList: idNameList,
idNoList: idNoList,
});
return list || [];
}
async getSignAccounts_dk(etemplateIds, idNoList, idNameList) {
var sql = [];
sql.push("SELECT ");
sql.push("t2.userName, t2.personsSign");
sql.push("FROM c_dkcontract t1");
sql.push("INNER JOIN p_user_eaccount t2 ON t1.usereaccount_id = t2.id");
sql.push("WHERE t1.dktemplate_id IN (:etemplateIds) AND t1.`eflowstatus` = '2'");
sql.push("AND t2.`userName` IN (:idNameList)");
sql.push("AND t2.`personsSign` IN (:idNoList)");
var list = await this.dao.customQuery(sql.join(" "), {
etemplateIds: etemplateIds,
idNameList: idNameList,
idNoList: idNoList,
});
return list || [];
}
}
module.exports=UsereaccountService;
<gsb-pcpage>
<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;">
<span style="color:2F2F2F;font-size: 14px;" >商户名称: </span>
<el-select
v-model="search.mchtName"
filterable
remote
clearable
reserve-keyword
style="width:340px;"
placeholder="请搜索公司名称"
@change="nameChange"
:remote-method="getCompanyNames"
:loading="nameLoading">
<el-option
v-for="item in nameList"
:key="item.id"
:label="item.company_name"
:value="item.company_name">
<span style="float: left;width:150px;">{{ item.name }} - {{ item.id }}</span>
</el-option>
</el-select>
</div>
<div style="float:left;width: 300px;">
<span style="color:2F2F2F;font-size: 14px;" >个人姓名: </span>
<el-input v-model="search.id_name" placeholder="请输入个人姓名" maxlength="100" clearable style="max-width:200px;height: 36px;" ></el-input>
</div>
<div style="float:left;width: 300px;">
<span style="color:2F2F2F;font-size: 14px;" >身份证号: </span>
<el-input v-model="search.id_no" placeholder="请输入个人身份证号" maxlength="100" clearable style="max-width:200px;height: 36px;" ></el-input>
</div>
<div style="float:left;width: 300px;">
<span style="color:2F2F2F;font-size: 14px;" >手机号: </span>
<el-input v-model="search.mobile" placeholder="请输入手机号" maxlength="100" clearable style="max-width:200px;height: 36px;" ></el-input>
</div>
<div style="float:left;width:100%;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="序号" :formatter="onColFormater" width="80" align="center" ></el-table-column>
<el-table-column prop="mchtId" label="商户号" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="mchtName" label="商户名称" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="id_name" label="姓名" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="id_no" label="身份证号" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="mobile" label="手机号" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column prop="bank_no" label="银行卡号" :formatter="onColFormater" align="center" ></el-table-column>
<el-table-column label="签约文件" >
<template slot-scope="scope" >
<a v-if="scope.row.fileurl" :href="scope.row.fileurl" target="_blank" style="text-decoration: none;color:#59C1A6;font-size: 14px;">查看</a>
</template>
</el-table-column>
<el-table-column prop="created_at" label="创建日期" :formatter="onColFormater" align="center" ></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="econtractoffline" :rules="rules" ref="econtractoffline" 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="mchtName">
<el-select
v-model="econtractoffline.mchtName"
filterable
remote
clearable
reserve-keyword
style="width:468px;"
placeholder="请搜索公司名称"
@change="nameChange2"
:remote-method="getCompanyNames2"
:loading="nameLoading2">
<el-option
v-for="item in nameList2"
:key="item.id"
:label="item.name"
:value="item.name">
<span style="float: left;width:150px;">{{ item.name }} - {{ item.id }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="个人姓名:" prop="id_name" >
<el-input v-model="econtractoffline.id_name" placeholder="请输入签约姓名" maxlength="50" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="身份证号:" prop="id_no" >
<el-input v-model="econtractoffline.id_no" placeholder="请输入身份证号码" maxlength="50" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="银行卡号:" prop="bank_no" >
<el-input v-model="econtractoffline.bank_no" placeholder="请输入银行卡号" maxlength="50" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="手机号码:" prop="mobile" >
<el-input v-model="econtractoffline.mobile" placeholder="请输入手机号码" maxlength="50" style="width:468px;" clearable ></el-input>
</el-form-item>
<el-form-item label="签约文件:" prop="fileurl">
<gsb-upload3 ref="upload3" v-model="econtractoffline.fileurl" @uploadsuccess="uploadsuccess" :fileList="fileList"></gsb-upload3>
</el-form-item>
</el-form>
<div style="margin-left: 200px;">
<el-button :loading="saveLoading" @click="saveContractoffline" 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 {
econtractoffline: {isEnabled:true},
editTitle: "新增",
showEdit: false,
showrelevances: false,
saveLoading: false,
busiData:[],
nameLoading: false,
nameList: [],
nameMap: [],
nameLoading2: false,
nameList2: [],
nameMap2:[],
uploadResult: null,
fileList:[],
mainList:[],
search: {
list: [],
currentPage: 1,
pageSize: 20,
total : 0,
name:'',
},
rules: {
mchtName : [
{ required: true, message: '请选择商户', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
id_name: [
{ required: true, message: '请输入个人姓名', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
id_no: [
{ required: true, message: '请输入个人身份证号', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
fileurl: [
{ required: true, message: '请上传签约协议', trigger: 'blur' },
{ validator: validMethod, trigger: 'blur' }
],
a : [],
},
busi_id: 0,
}
},
mounted: function () {
this.resetSearch(true);
this.getMainList();
},
created: function () {},
methods: {
getEmptySearch() {
return {
list: [],
currentPage: 1,
pageSize: 20,
total : 0,
name:'',
}
},
resetSearch() {
this.search = this.getEmptySearch();
this.getList();
},
tableHeaderColor({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 0) {
return 'background-color: #F5F5F5;color: #2F2F2F;font-size: 14px;font-weight:400;'
}
},
opSearch() {
this.search.currentPage = 1;
this.search.total = 0;
this.getList();
},
getMainList() {
var self = this;
this.$root.postReq("/web/ecompanymainCtl/all", {
}).then(function (d) {
if (d.status == 0) {
self.mainList = d.data || [];
} else {
}
});
},
getList() {
var self = this;
var params = this.getParams();
this.$root.postReq("/web/econtractofflineCtl/allList", {
search: 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;
},
getExportParams() {
var params = {};
for(var f in this.search) {
if(f == "list") {
continue;
}
params[f] = this.search[f];
}
return "?search=" + encodeURIComponent(JSON.stringify(params));
},
onColFormater(row, column, cellValue, index) {
return cellValue || "---";
},
getEtemplate(id) {
var self = this;
self.$root.postReq("/web/econtractofflineCtl/info", {
id: id,
}).then(function (d) {
if (d.status == 0) {
if(d.data) {
d.data.isEnabled = d.data.isEnabled ? true : false;
}
self.econtractoffline = d.data;
if(self.econtractoffline.fileurl) {
self.fileList = [{
name: "模板文件",
url: self.econtractoffline.fileurl,
}];
} else {
self.uploadResult = null;
}
} else {
self.$message.warning(d.msg || `您的网络不稳定, 请稍后重试`);
}
});
},
addCompany() {
this.companysForm.bpoCompanyList.push({
companyName: '',
key: Date.now(),
rules: {required: true, message: '公司名称不能为空', trigger: 'blur'},
});
},
getEtemplate_relevance(id) {
var self = this;
this.busi_id = id;
this.$root.postReq("/web/etemplatebusiCtl/getlist", {
id: id,
type:1,
}).then(function (d) {
self.template_id = id;
self.busiData = d || [];
});
},
toDetail(id) {
},
openEdit(id) {
this.clearUpload();
if(id) {
this.editTitle = "修改";
this.getEtemplate(id);
} else {
this.editTitle = "新增";
this.econtractoffline = {isEnabled:true};
}
this.showEdit = true;
},
relevance(id){
this.getEtemplate_relevance(id);
this.showrelevances = true;
},
handleSizeChange(val) {
this.search.pageSize = val;
this.resetSearch();
},
handleCurrentChange(val) {
this.search.currentPage = val;
this.getList();
},
validfileds(rule, value, callback) {
var self = this;
if(rule.field == "ecompanyName") {
if(!self.etemplate.ecompany_id) {
return callback(new Error("请重新选择公司名称"));
}
}
return callback();
},
nameChange(val) {
var self = this;
var item = self.nameMap[val];
self.search.mchtId = (item || {}).id || "";
},
nameChange2(val) {
var self = this;
var item = self.nameMap2[val];
self.econtractoffline.mchtId = (item || {}).id || "";
},
getCompanyNames(query) {
var self = this;
self.nameLoading = true;
self.$root.postReq("/web/etemplatebusiCtl/suggest2", {
name: query
}).then(function (d) {
self.nameLoading = false;
self.nameList = d.data || [];
self.nameMap = [];
for(var item of self.nameList) {
self.nameMap[item.name] = item;
}
});
setTimeout(() => {
self.nameLoading = false;
}, 15000);
},
getCompanyNames2(query) {
var self = this;
self.nameLoading2 = true;
self.$root.postReq("/web/etemplatebusiCtl/suggest2", {
name: query
}).then(function (d) {
self.nameLoading2 = false;
self.nameList2 = d.data || [];
self.nameMap2 = [];
for(var item of self.nameList2) {
self.nameMap2[item.name] = item;
}
});
setTimeout(() => {
self.nameLoading2 = false;
}, 15000);
},
clearUpload() {
var self = this;
self.uploadResult = null;
self.econtractoffline.fileurl = "";
if(self.$refs.upload3 && self.$refs.upload3.$refs && self.$refs.upload3.$refs.upload) {
self.$refs.upload3.$refs.upload.clearFiles();
}
},
uploadsuccess(v) {
if(!v || !v[0] || !v[0].url) {
this.$message.warning("上传失败");
return;
}
this.econtractoffline.fileurl = v[0].url;
},
saveContractoffline() {
var self = this;
self.$refs.econtractoffline.validate((valid) => {
if (valid) {
self.saveLoading = true;
setTimeout(() => {
self.saveLoading = false;
}, 15000);
self.$root.postReq("/web/econtractofflineCtl/saveEcontractOffline", self.econtractoffline).then(function (d) {
if (d.status == 0) {
self.$message.success(`保存成功`);
self.showEdit = false;
self.getList();
} else {
self.$alert(d.msg || '保存失败', '提示', {
confirmButtonText: '确定',
callback: action => {}
});
}
self.saveLoading = false;
});
} else {
self.saveLoading = false;
return false;
}
});
},
},
vname: "gsb-ecompanyadmin"
}
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