<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>授信管理</title>
|
|
<script type="text/javascript">
|
var pageVue = null;
|
function loadJsCss(callback) {
|
var jscss_urls = [];
|
window.top.initJsCss(document, jscss_urls, callback);
|
};
|
function initVue() {
|
new ListVue({
|
el: "#vbody",
|
data: {
|
dataname: "credit_flow",
|
title: "授信管理",
|
default_filterFields: [
|
{isshow: "T", field: "year", name: "年份", options: dataRoot.database.years, filteroperator: "", type: "select"},
|
{isshow: "T", field: "month", name: "月份", options: dataRoot.database.months, filteroperator: "", type: "select"},
|
{isshow: "T", field: "state", name: "状态", type: "select", options: [{label: "草稿",value: "input"}, {label: "待审批",value: "submit"}, {label: "审批完成",value: "open"}]},
|
],
|
default_tableFields: [
|
{isshow: "T", field: "year", name: "年", align: "center", width: "100"},
|
{isshow: "T", field: "month", name: "月", align: "center", width: "100"},
|
{isshow: "T", field: "project", name: "项目", align: "left"},
|
{isshow: "T", field: "credit_add", name: "授信增加", align: "right", width: "150", istablesum: true},
|
{isshow: "T", field: "credit_sub", name: "授信减少", align: "right", width: "150", istablesum: true},
|
{isshow: "T", field: "state", name: "状态", align: "center", width: "200", formatter: "formatter_OrderState"},
|
],
|
filterfieldClick: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
tableData: [],
|
orderby: " update_time desc",
|
havaMoney: 0,
|
selectrow: {},
|
},
|
created() {
|
var popupParames = clone(Root.popupParames);
|
if (popupParames && popupParames.menuid && popupParames.menuid == "A6-01-02"){
|
this.filterObj = clone(popupParames.delta.filterobj)
|
this.filterFields = [
|
{isshow: "T", field: "customer_code", name: "客户编码"},
|
{isshow: "T", field: "customer_name", name: "客户名称"}
|
]
|
this.fieldsToFieldsObj();
|
}
|
|
|
},
|
mounted() {
|
this.initData();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
methods:{
|
initData() {
|
var me = this;
|
this.filterFields = [];
|
this.onQuery(function(result,callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
var metas = clone(result.meta[me.dataname].fields);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
|
if (f.isfilter) {
|
filterFields_.push(clone(f));
|
}
|
else {
|
var filter_f = clone(f);
|
filter_f.isshow = "F";
|
filterFields_.push(filter_f);
|
}
|
|
if (f.field == "amt_add" || f.field == "amt_delete") {
|
f.istablesum = true
|
}
|
tableFields_.push(clone(f));
|
})
|
if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
|
me.filterFields = clone(filterFields_);
|
me.tableFields = clone(tableFields_);
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
|
if(callback){
|
callback();
|
}
|
});
|
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//筛选字段事件设置
|
//表格字段事件设置
|
this.tablefieldClick = {
|
project: {//字段事件设置
|
val: {//有值时的点击事件
|
notclick_val: "",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222"
|
notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"]
|
onclick: function(obj) {//数据值点击事件
|
me.opentest(obj);
|
},
|
},
|
},
|
};
|
|
},
|
|
opentest(obj) {
|
var me = this;
|
Root.message({
|
type: 'success',
|
message: '点击事件'
|
});
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "查看详情",
|
id: "test_page" + obj.row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/system/page/sample/sample_form.html",
|
data: obj.row,
|
delta: {},
|
sceneCode: "browse",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
addTableData(type) {
|
let me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "400px",
|
icon: "icon-product",
|
text: "授信编辑",
|
id: "test_page",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/customer/page/credit_edit.html",
|
data: {},
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
rowClick(obj){
|
var me = this;
|
me.selectrow = obj.row;
|
},
|
editTableData(){
|
let me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "400px",
|
icon: "icon-product",
|
text: "授信编辑",
|
id: "test_page",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/customer/page/credit_edit.html",
|
data: me.selectrow,
|
delta: {},
|
sceneCode: "edit",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
delTableData() {
|
let me = this;
|
let name_ = "该数据";
|
let row = me.selectrow;
|
if (!row.id) {
|
Root.message({
|
type: 'warning',
|
message: '该事件需存在数据ID'
|
});
|
return
|
}
|
if (row.name) {
|
name_ = "_" + row.name + "_";
|
}
|
|
Root.confirm('确定删除' + name_ + '吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
id: row.id,
|
dataname: me.dataname,
|
}
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.doQuery();
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
submitData() {
|
var me = this;
|
var row = this.selectrow;
|
|
let param = {
|
// flowName: "sales",
|
dataName: me.dataname,
|
id: row.id,
|
}
|
Server.call("root/data/commit", param, function(result) {
|
console.log(result);
|
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.onQuery();
|
});
|
},
|
|
approvalData() {
|
let me = this;
|
let row = me.selectrow;
|
var sceneCode = "approval";
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "400px",
|
icon: "icon-product",
|
text: "授信编辑",
|
id: "test_page",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/customer/page/credit_edit.html",
|
data: me.selectrow,
|
delta: {},
|
sceneCode: "approval",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
}
|
});
|
};
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span>{{title}}</span>
|
|
<template v-if="1!=1">
|
<span class="h_dialog__body">版本号: {{currentVersion.label}}</span>
|
<h-select :datalist="versionList" v-on:itemselect="versionSelect"></h-select>
|
</template>
|
|
<div style="float: right; margin-right: 18px;">
|
<el-button-group style="margin-left: 3px;">
|
<el-button >导出</el-button>
|
<!-- <el-button v-if="buttons.append" :disabled="buttons.append.disabled" icon="el-icon-plus" @click="addData">添 加</el-button>
|
<el-button v-if="buttons.edit" :disabled="buttons.edit.disabled" @click="setEditTableData">{{isEditTableData ? '取消编辑' : '编 辑'}}</el-button>
|
<el-button v-if="buttons.submit" :disabled="buttons.submit.disabled" icon="" @click="h_procedure('state', 'input', 'working', 'name', '提交审批', '等待审批中')">修改提交</el-button>
|
<el-button v-if="buttons.approval" :disabled="buttons.approval.disabled" @click="approvalData('data_state')">审批</el-button> -->
|
</el-button-group>
|
|
<el-button-group style="margin-left: 3px;">
|
<!-- <el-button v-if="buttons.append" :disabled="buttons.append.disabled" icon="" @click="consignee_mapping">收货信息</el-button>
|
<el-button v-if="buttons.append" :disabled="buttons.append.disabled" icon="" @click="invoice_mapping">开票信息</el-button>
|
<el-button v-if="buttons.append" :disabled="buttons.append.disabled" icon="" @click="licence_mapping">证照信息</el-button> -->
|
<el-button @click="addTableData('add')">新增授信</el-button>
|
<el-button :disabled="!(selectrow.id && selectrow.state_code == 'Input')" @click="editTableData":icon="buttonsconfig.alter.icon">{{buttonsconfig.alter.name}}</el-button>
|
<el-button :disabled="!(selectrow.id && selectrow.state_code == 'Input')" type="danger" @click="delTableData">删 除</el-button>
|
<el-button :disabled="!(selectrow.id && (!selectrow.state_code || selectrow.state_code == 'Input'))" type="success" @click="submitData" :icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button>
|
|
<!-- <el-button @click="onShowApproval()">审批记录</el-button> -->
|
</el-button-group>
|
<el-button-group style="margin-left: 3px;">
|
<el-button :disabled="!(selectrow.id && selectrow.state_code == 'UnderApproval')" @click="approvalData">审 批</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
|
<div class="topbar-line">
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
<div class="query-bar">
|
</div>
|
</div>
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:table-field-click="tablefieldClick"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:show-summary= "false"
|
:table-height="tableHeight"
|
:is-highlight-row="true"
|
:isdraggableorder="true"
|
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:del-data="delData"
|
v-on:row-click="rowClick"
|
>
|
</h-table>
|
</div>
|
</div>
|
|
|
</div>
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
<style>
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
</body>
|
</html>
|