<!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 FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "",
|
title: "详细信息",
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600"
|
},
|
|
default_formFields: [
|
{isshow: "T", name: "奖金基数-A", field: "f1", type: "span"},
|
{isshow: "T", name: "奖金基数-B", field: "f2", type: "span"},
|
{isshow: "T", name: "奖金基数-C", field: "f3", type: "span"},
|
{isshow: "T", name: "销售达成(季)", field: "f4", type: "span"},
|
{isshow: "T", name: "销售达成(年)", field: "f5", type: "span"},
|
{isshow: "T", name: "Payout", field: "f6", type: "span"},
|
{isshow: "T", name: "加速器", field: "f7", type: "span"},
|
{isshow: "T", name: "初始奖金额", field: "f8", type: "span"},
|
{isshow: "T", name: "季度封顶率", field: "f9", type: "span"},
|
{isshow: "T", name: "季度支付率", field: "f10", type: "span"},
|
{isshow: "T", name: "封顶留存率", field: "f11", type: "span"},
|
{isshow: "T", name: "发票提交率", field: "f12", type: "span"},
|
{isshow: "T", name: "发票提交留存", field: "f13", type: "span"},
|
{isshow: "T", name: "留存总金额", field: "f14", type: "span"},
|
{isshow: "T", name: "提取发票冻结", field: "f15", type: "span"},
|
{isshow: "T", name: "季度可付金额", field: "f16", type: "span"},
|
{isshow: "T", name: "年度留存金额", field: "f17", type: "span"},
|
{isshow: "T", name: "奖金A(年)", field: "f18", type: "span"},
|
{isshow: "T", name: "奖金B(年)", field: "f19", type: "span"},
|
{isshow: "T", name: "奖金C(年)", field: "f20", type: "span"},
|
{isshow: "T", name: "年度奖金额", field: "f21", type: "span"},
|
],
|
formFields: [],
|
|
newformData: {
|
//id: uuid_short(),
|
// code: createCode("BA"),
|
create_time: createDatetime(),
|
status: "input",
|
state_name: "草稿",
|
creator_name: window.top.vue.userinfo.name,
|
type_code: "",
|
type_name: "",
|
},
|
formData: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
if (this.newformData) {
|
let formData_ = clone(this.formData);
|
|
for (var k in this.newformData) {
|
formData_[k] = this.newformData[k];
|
}
|
this.formData = formData_;
|
}
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.isapproval = true;
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
data.agm_template.map(c=>{
|
me.options_templateobj[c[me.props_template.value]] = c;
|
})
|
|
let agm_template_ = ArrayToTree(clone(data.agm_template), "name", "parent_id");
|
me.options_category = agm_template_;
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let w_ = "900px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
initData() {
|
let me = this;
|
var id_ = null;
|
if (this.formData.id) {
|
id_ = this.formData.id;
|
}
|
|
me.formFields = clone(me.default_formFields)
|
|
//字段数组转字段obj,目的为了筛选时获取字段属性
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表格字段事件设置
|
this.tablefieldClick = {
|
product_code: {//字段事件设置
|
val: {//有值时的点击事件
|
notclick_val: "PS-001;111",//不可点击的值,1、是数组["11","22"];2、以“;”分隔的字符串"111;222"
|
notclick_bindfield: [],//当该字段值等于指定字段值时不可点击["filterfield": "111"]
|
onclick: function(obj) {//数据值点击事件
|
Root.message({
|
type: 'success',
|
message: obj.val + '点击事件'
|
});
|
},
|
},
|
defaultval: {
|
val: "查看",//空值时的显示值
|
onclick: function(obj) {//默认值点击事件,此事件需要设置val才有效
|
Root.message({
|
type: 'success',
|
message: '默认值点击事件'
|
});
|
}
|
},
|
suffixval: {
|
// val: "详情",//有值时的后缀,此后缀和单位后缀不同,如:详情,更多,查看等
|
// onclick: function(obj) {//有值时的后缀点击事件,此事件需要设置val才有效
|
// //打开
|
// me.opentest()
|
// }
|
},
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
Root.message({
|
type: 'success',
|
message: '弹窗点击事件'
|
});
|
}
|
},
|
visible: {
|
onchange: function(obj) {//下拉展开事件
|
Root.message({
|
type: 'success',
|
message: '下拉展开事件'
|
});
|
}
|
},
|
select: {
|
onchange: function(obj) {//下拉更改事件
|
Root.message({
|
type: 'success',
|
message: '下拉更改事件'
|
});
|
}
|
},
|
input: {
|
onchange: function(obj) {//输入更改事件
|
Root.message({
|
type: 'success',
|
message: '输入更改事件'
|
});
|
}
|
},
|
},
|
|
customer_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_customerlist()
|
}
|
},
|
},
|
terminal_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_terminallist()
|
}
|
},
|
},
|
product_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.tablepopup_productlist()
|
}
|
},
|
},
|
};
|
|
//表单字段事件设置
|
this.formfieldClick = {
|
type_code: {//字段事件设置
|
// val: {//有值时的点击事件
|
// onclick: function(obj) {//数据值点击事件
|
// Root.message({
|
// type: 'success',
|
// message: obj.val + '点击事件'
|
// });
|
// },
|
// onchange: function(obj) {//数据修改事件
|
// Root.message({
|
// type: 'success',
|
// message: '数据修改事件'
|
// });
|
// }
|
// },
|
// popup: {
|
// onclick: function(obj) {//弹窗点击事件
|
// Root.message({
|
// type: 'success',
|
// message: '弹窗点击事件'
|
// });
|
// }
|
// },
|
visible: {
|
onchange: function(fieldObj, row, callback) {//下拉展开事件
|
Root.message({
|
type: 'success',
|
message: '下拉展开事件'
|
});
|
|
//重新设置选择项
|
if (callback) {
|
var obj_ = {
|
options: []
|
};
|
callback(obj_);
|
}
|
}
|
},
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
obj.data.type_name = clone(obj.selectoption.label);
|
}
|
},
|
input: {
|
onchange: function(obj) {//输入更改事件
|
Root.message({
|
type: 'success',
|
message: '输入更改事件'
|
});
|
}
|
},
|
button: {
|
onclick: function(obj) {//按键点击事件
|
Root.message({
|
type: 'success',
|
message: '按键点击事件'
|
});
|
}
|
},
|
buttonarray: {
|
onclick: function(obj) {//按键组点击事件,需要根据按键的code来判断具体事件
|
Root.message({
|
type: 'success',
|
message: '按键组点击事件'
|
});
|
}
|
},
|
},
|
customer_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.open_customerlist()
|
}
|
},
|
},
|
terminal_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.open_terminallist()
|
}
|
},
|
},
|
product_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
//打开
|
me.open_productlist()
|
}
|
},
|
},
|
|
};
|
},
|
|
run() {
|
let me = this
|
|
// for (let i = 0; i <= 5; i++) {
|
// setTimeout(() => {
|
// let param = {
|
// dataname: this.dataname
|
// }
|
|
// Server.call("root/data/", param, function(result) {
|
// console.log(result);
|
// });
|
// }, 1000 * i)
|
// }
|
},
|
|
open_customerlist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.customer_name = obj.row.md_description;
|
formData_.customer_code = obj.row.md_code;
|
formData_.customer_id = obj.row.id;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
open_terminallist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
formData_.customer_name = obj.row.md_description;
|
formData_.customer_code = obj.row.md_code;
|
formData_.customer_id = obj.row.id;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
open_productlist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "../md/product/popup/sku_list.html",
|
width: 800,
|
height: 550,
|
callback: function(obj, callback) {
|
let formData_ = clone(me.formData);
|
|
formData_.product_id = obj.row.id;
|
formData_.product_code = obj.row.md_code;
|
formData_.product_name = obj.row.md_description;
|
//formData_.spec = obj.row.pack_specification;
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
tablepopup_customerlist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(callbackobj, callback) {
|
obj.row.customer_code = callbackobj.row.md_code
|
obj.row.customer_name = callbackobj.row.md_description
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
tablepopup_terminallist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
data: this.oldObj,
|
dataname: "customer",
|
callback: function(callbackobj, callback) {
|
obj.row.terminal_id = callbackobj.row.id
|
obj.row.terminal_name = callbackobj.row.md_description
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
tablepopup_productlist(obj) {
|
var me = this;
|
Root.showPopup({
|
url: "../md/product/popup/sku_list.html",
|
width: 800,
|
height: 550,
|
callback: function(callbackobj, callback) {
|
obj.row.product_id = callbackobj.row.id;
|
obj.row.product_code = callbackobj.row.md_code;
|
obj.row.product_name = callbackobj.row.md_description;
|
obj.row.spec = callbackobj.row.pack_specification;
|
obj.row.pack = callbackobj.row.unit;
|
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
var operator_ = "save";//保存
|
if(me.iscommit) {
|
operator_ = "commit";//提交
|
}
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
let param = {
|
dataname: this.dataname,
|
// operator: operator_,
|
data: {},
|
}
|
param.data[this.dataname] = entity;
|
|
Server.call("root/data/saveEntity", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
if(me.iscommit){
|
me.iscommit = false;
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.saveAfter();
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
});
|
},
|
|
}
|
});
|
};
|
|
loadJsCss(function () {
|
initVue();
|
});
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<div class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}}</span>
|
</div>
|
</div>
|
<div style="height: 360px; overflow-y: auto;">
|
<div class="el-dialog__body">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
</div>
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">关 闭</el-button>
|
</div>
|
</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>
|
</body>
|
</html>
|