<!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 src="../../../../jsnew/elementDefault.js?v=20220425"></script>
|
<script src="../../../../jsnew/vue/vue.js"></script>
|
<script src="../../../../jsnew/vue/element-ui/element-ui_15/index.js"></script>
|
<script src="../../../../jsnew/vue/axios/dist/axios.min.js"></script>
|
<script src="../../../../jsnew/myelement.js?v=20220615"></script>
|
<script src="../../../../jsnew/page.js?v=20220729"></script>
|
<script src="../../../../js/common.js"></script>
|
<script src="fields.js?v=20230713"></script>
|
|
<link href="../../../../jsnew/vue/element-ui/element-ui_15/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../../jsnew/myelement.css?v=20220425" rel="stylesheet">
|
<link href="../../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../../jsnew/page.css?v=20220426" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_mkoo966o0uo.css" rel="stylesheet">
|
</head>
|
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
<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: t_height +'px', '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>
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tab-pane label="备案头字段" name="tab_banT">
|
<div ref="tablebutton_ref" style="text-align: right;">
|
<!-- <el-button size="small" @click="">新增表字段</el-button> -->
|
<el-button size="small" @click="addRowData('banT')">新增字段</el-button>
|
</div>
|
<div class="h_ba_mb_zd">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData_banT"
|
:is-within-edit-table-data="isWithinEditTableData"
|
:is-highlight-row="true"
|
:is-pagination="false"
|
:table-height="tableHeight"
|
|
v-on:get-data="getData"
|
v-on:row-click="rowClick"
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
</div>
|
</el-tab-pane>
|
<el-tab-pane label="备案详情字段" name="tab_banMX">
|
<div ref="tablebutton_ref" style="text-align: right;">
|
<!-- <el-button size="small" @click="">新增表字段</el-button> -->
|
<el-button size="small" @click="addRowData('banMX')">新增字段</el-button>
|
</div>
|
<div class="h_ba_mb_zd">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields2"
|
:table-data="tableData_banMX"
|
:is-within-edit-table-data="isWithinEditTableData"
|
:is-highlight-row="true"
|
:is-pagination="false"
|
:table-height="tableHeight"
|
|
v-on:get-data="getData"
|
v-on:row-click="rowClick"
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
</div>
|
</el-tab-pane>
|
</el-tabs>
|
|
|
</div>
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="isend" @click="">作 废</el-button>
|
<el-button size="small" v-if="(isedit || isrefuseedit)" type="primary" @click="saveRowTable">保 存</el-button>
|
<!-- <el-button size="small" v-if="isedit" type="success" @click="">提 交</el-button>
|
<el-button size="small" v-if="isrefuseedit" type="success" @click="">再次提交</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>
|
|
<script type="text/javascript">
|
function initVue() {
|
new FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "pkg_agm_record_template",
|
table_dataname: "", //agm_record_template_detail
|
title: "备案模板信息",
|
dataurl: "rootjemin/data/getEntity",
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields: [
|
// {isshow: "T", field: "template_name", name: "模板名称", notvalunit: true, colspan: 2},
|
// {isshow: "T", field: "open_date", name: "生效日期", type: "date", notvalunit: true},
|
// {isshow: "T", field: "end_date", name: "失效日期", type: "date", notvalunit: true},
|
// {isshow: "T", field: "creator_name", name: "创建人", type: "span", notvalunit: true},
|
// {isshow: "T", field: "create_time", name: "创建时间", type: "span", notvalunit: true},
|
// {isshow: "T", field: "remark", name: "备注", type: "textarea", notvalunit: true, colspan: 2},
|
// {
|
// isshow: "T", field: "flow_type", name: "流向类型", type: "radio", valuewidth: "120px",
|
// options: [
|
// {
|
// label: "01",
|
// value: "流向-发货退货明细",
|
// },
|
// {
|
// label: "02",
|
// value: "流向-定版流向",
|
// },
|
// {
|
// label: "03",
|
// value: "流向-回款明细",
|
// },
|
// {
|
// label: "04",
|
// value: "流向-销账明细",
|
// },
|
// ],
|
// colspan: 3,
|
// },
|
// {
|
// isshow: "T", field: "template_fields", name: "备案字段配置", type: "checkboxobjgroup", valuewidth: "120px",
|
// options: [
|
// {
|
// name: "基本信息",
|
// children: [],
|
// }
|
// ],
|
// colspan: 3
|
// },
|
],
|
formFields: [],
|
newformData: {
|
//id: uuid_short(),
|
// code: createCode("BA"),
|
// create_time: createDatetime(),
|
state_code: "Draft",
|
state_name: "录入",
|
// creator_name: window.top.vue.userinfo.name,
|
type_code: "",
|
type_name: "",
|
},
|
formData: {},
|
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
isend: false,
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
|
t_height:null,
|
isRefresh: true,
|
|
fieldsAll: [],
|
fieldsTerminal: [],
|
fieldsDistribution: [],
|
fieldsFront: [],
|
check: false,
|
|
tableFields: [],
|
/*
|
{isshow: "T", field: "template_field_qy", name: "是否启用", type: "switch"},
|
{isshow: "T", field: "template_field", name: "备案字段", type: "select", options: []},
|
{isshow: "T", field: "template_field_bm", name: "别名", type: "input"},
|
{isshow: "T", field: "template_field_gs", name: "公式", type: "button"},
|
{isshow: "T", field: "template_field_sx", name: "顺序", type: "number", issortable: true},
|
*/
|
tableFields2: [],
|
|
tableData: [
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "1"},
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "3"},
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "2"},
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "1"},
|
],
|
|
tableData_banT: [],
|
|
tableData_banMX: [],
|
|
isWithinEditTableData: true,
|
tableHeight: 0,
|
|
activeName: "",
|
|
},
|
created() {
|
if (terminalFields) {
|
terminalFields.map( f => {
|
let obj = {
|
code: f.field,
|
value: f.name,
|
fieldtype: f.fieldtype,
|
};
|
this.fieldsTerminal.push(f.field);
|
if (this.fieldsAll && this.fieldsAll.length) {
|
this.check = this.fieldsAll.some( a=> {
|
if (a.code == f.field) {
|
return true;
|
}
|
});
|
}
|
if (!this.check) {
|
this.fieldsAll.push(obj);
|
}
|
})
|
}
|
if (distributionFields) {
|
distributionFields.map( f => {
|
let obj = {
|
code: f.field,
|
value: f.name,
|
fieldtype: f.fieldtype,
|
};
|
this.fieldsDistribution.push(f.field);
|
if (this.fieldsAll && this.fieldsAll.length) {
|
this.check = this.fieldsAll.some( a=> {
|
if (a.code == f.field) {
|
return true;
|
}
|
});
|
}
|
if (!this.check) {
|
this.fieldsAll.push(obj);
|
}
|
})
|
}
|
if (frontFields) {
|
frontFields.map( f => {
|
let obj = {
|
code: f.field,
|
value: f.name,
|
fieldtype: f.fieldtype,
|
};
|
this.fieldsFront.push(f.field);
|
if (this.fieldsAll && this.fieldsAll.length) {
|
this.check = this.fieldsAll.some( a=> {
|
if (a.code == f.field) {
|
return true;
|
}
|
});
|
}
|
if (!this.check) {
|
this.fieldsAll.push(obj);
|
}
|
})
|
}
|
if (reserveFields) {
|
reserveFields.map( f => {
|
let obj = {
|
code: f.field,
|
value: f.name,
|
fieldtype: f.fieldtype,
|
};
|
// this.fieldsFront.push(f.field);
|
if (this.fieldsAll && this.fieldsAll.length) {
|
this.check = this.fieldsAll.some( a=> {
|
if (a.code == f.field) {
|
return true;
|
}
|
});
|
}
|
if (!this.check) {
|
this.fieldsAll.push(obj);
|
}
|
})
|
}
|
|
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.formData.template_name == "二次议价") {
|
this.formData.template_fields = this.fieldsTerminal;
|
}
|
else if (this.formData.template_name == "分销政策") {
|
this.formData.template_fields = this.fieldsDistribution;
|
}
|
else if (this.formData.template_name == "前台费用") {
|
this.formData.template_fields = this.fieldsFront;
|
}
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
//动态获取默认数据
|
var newEntity_ = {
|
name: "newEntity",
|
url: "rootjemin/data/newEntity",
|
paramsobj: {dataname: "pkg_agm_record_template"},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
|
// if (this.newformData) {
|
// let formData_ = clone(this.formData);
|
|
// for (var k in this.newformData) {
|
// formData_[k] = this.newformData[k];
|
// }
|
// this.formData = formData_;
|
// }
|
|
// if (this.newTableData) {
|
// this.tableData.push(clone(this.newTableData));
|
// }
|
|
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 == "end") {//作废
|
this.formAttr.disabled = true;
|
this.isend = 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;
|
this.activeName = "tab_banT"
|
/*
|
tableData: [
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "1"},
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "3"},
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "2"},
|
{template_field_qy: true, template_field:"字段", template_field_bm: "字段", template_field_gs: "公式设置", template_field_sx: "1"},
|
|
],
|
|
*/
|
me.tableData = [];
|
var tableData_ = [];
|
// var i = 0;
|
// me.fieldsAll.map(f=>{
|
// i++;
|
// var f_ = {
|
// template_field_qy: false,
|
// template_field: f.value,
|
// template_field_code: f.code,
|
// template_field_bm: clone(f.value),
|
// template_field_gs: (f.fieldtype && f.fieldtype=='yl') ? "公式设置" : "",
|
// template_field_sx: i,
|
// }
|
// tableData_.push(f_);
|
|
// })
|
me.tableData = clone(tableData_);
|
|
me.t_height = document.documentElement.clientHeight*1 - 91;
|
var formFields_ = clone(me.default_formFields);
|
formFields_.map( f=> {
|
if (f.field == "template_fields") {
|
f.options[0].children = clone(me.fieldsAll);
|
}
|
})
|
me.default_formFields = clone(formFields_);
|
|
var tableFields_ = clone(me.tableFields);
|
tableFields_.map( f=> {
|
if (f.field == "template_field") {
|
f.options = clone(me.fieldsAll);
|
}
|
})
|
me.tableFields = clone(tableFields_);
|
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
if (me.dataRequestObj.newEntity) {
|
var formData = clone(me.dataRequestObj.newEntity.data["agm_record_template"]);
|
// formData.product_category_name = [];
|
if (me.newformData) {
|
let formData_ = clone(formData);
|
|
for (var k in me.newformData) {
|
if (!formData_[k]) {
|
formData_[k] = me.newformData[k];
|
}
|
}
|
|
me.formData = formData_;
|
}
|
|
if (me.popupParames.delta) {
|
me.formData.category_code = clone(me.popupParames.delta.code);
|
me.formData.category_name = clone(me.popupParames.delta.name);
|
}
|
}
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
var form1_h = me.$refs.form1.$el.offsetHeight;
|
var tablebutton_ref_h = me.$refs.tablebutton_ref.offsetHeight;
|
|
me.tableHeight = me.t_height - form1_h - tablebutton_ref_h - 60;
|
// 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;
|
}
|
this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta['agm_record_template'] && result.meta['agm_record_template'].fields) {
|
var metas = clone(result.meta['agm_record_template'].fields);
|
var table_dataname_ = "";
|
for (var dataname_ in result.meta) {
|
if (dataname_ != 'agm_record_template' && !table_dataname_) {
|
table_dataname_ = dataname_;
|
}
|
}
|
var table_metas = clone(result.meta['agm_record_template_field_head'].fields);
|
var table_metas2 = clone(result.meta['agm_record_template_field_detail'].fields);
|
|
|
var formFields_ = [];
|
var tableFields_ = [];
|
var tableFields2_ = [];
|
metas.map(f=>{
|
f.isshow = "T";
|
formFields_.push(clone(f));
|
})
|
table_metas.map(f=>{
|
f.isshow = "T";
|
tableFields_.push(clone(f));
|
})
|
table_metas2.map(f=>{
|
f.isshow = "T";
|
tableFields2_.push(clone(f));
|
})
|
|
if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.formFields = clone(formFields_);
|
me.tableFields = clone(tableFields_);
|
me.tableFields2 = clone(tableFields2_);
|
|
//字段数组转字段obj
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
|
if (me.rowData[me.dataname]) {
|
me.formData = me.rowData[me.dataname];
|
}
|
if (me.rowData[me.table_dataname]) {
|
me.tableData = me.rowData[me.table_dataname];
|
}
|
})
|
},
|
|
newEndDeatil() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "请选择要终止的备案模板信息明细数据",
|
id: "popup_terminal_policy_info_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/policy/popup_terminal_policy_info_list.html",
|
data: {},
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
files: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "files";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj);
|
}
|
}
|
}
|
},
|
|
oa_code: {
|
val: {
|
onclick: function(obj) {
|
|
}
|
}
|
}
|
};
|
|
//表格字段事件设置
|
this.tablefieldClick = {
|
};
|
|
},
|
|
handleClick() {
|
|
},
|
|
addRowData(type) {
|
var me = this;
|
if (type == "banT") {
|
var tableData_ = clone(me.tableData_banT);
|
var f_ = {
|
// template_field_qy: false,
|
// template_field: "",
|
// template_field_code: "",
|
// template_field_bm: "",
|
// template_field_gs: "公式设置",
|
}
|
tableData_.unshift(f_);
|
|
me.tableData_banT = clone(tableData_);
|
}
|
else if (type == "banMX") {
|
var tableData_ = [];
|
tableData_ = clone(me.tableData_banMX);
|
var f_ = {
|
template_field_qy: false,
|
template_field: "",
|
template_field_code: "",
|
template_field_bm: "",
|
template_field_gs: "公式设置",
|
}
|
tableData_.unshift(f_);
|
|
me.tableData_banMX = clone(tableData_);
|
}
|
|
},
|
|
onPopupByUploadFile(filenamefield, fileidfield,dataname) {
|
var me = this;
|
var analysistype_ = "";
|
var formData_ = clone(me.formData);
|
var delta_ = {filetypelist: []}//".png", ".jpg", ".pdf"
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: "../tool/popup_uploadFile.html",
|
data: {
|
dataName: dataname,
|
fileidfieldName: fileidfield,
|
id: me.formData.id,
|
fileNamefieldName: filenamefield,
|
max_size: "100MB",
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
|
var file_ = {
|
id: obj.row[0].id,
|
file_name: decodeURI(obj.row[0].name)
|
}
|
if (!formData_[filenamefield]) {
|
formData_[filenamefield] = []
|
}
|
formData_[filenamefield].push(file_);
|
|
me.formData = formData_;
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId(filenamefield, fileobj){
|
var me = this;
|
var formData_ = clone(me.formData);
|
Root.confirm('确定删除附件【' + fileobj.file_name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (fileobj.id) {
|
let param = {
|
dataname: "file_index",
|
id: fileobj.id
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.formData[filenamefield].remove(fileobj);
|
// me.formData = formData_;
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}
|
});
|
}
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
|
},
|
|
showFileImgByFileId(fileobj) {
|
let me = this;
|
var file_id = fileobj.id;
|
var file_name = fileobj.file_name;
|
|
this.zzimg = {};
|
this.zzimgList = [];
|
this.file_txt = false;
|
if(file_id) {
|
var fileid = file_id;
|
let fileName = clone(file_name);
|
let index1 = fileName.lastIndexOf(".");
|
let index2 = fileName.length;
|
let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
|
if (suffix == ".png" || suffix == ".jpg" || suffix == ".pdf") {
|
var row = {
|
fileid: fileid,
|
filename: fileName
|
}
|
|
var config = {
|
totab: false,
|
width: "1200px",
|
height: 800,
|
icon: "icon-product",
|
text: "附件预览",
|
id: "pdf_" + fileid,
|
url: "module/tool/page/popup_file_pdf.html",
|
data: row,
|
delta: {},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
|
}
|
else {//只可下载,不可预览
|
// handleDownloadUrl(fileid,false);
|
handleDownload(fileid);
|
}
|
}
|
},
|
|
|
|
addTableData() {
|
var table_row = clone(this.newTableData);
|
this.rowChange(table_row, "add", this.table_dataname);
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
Root.confirm('确定删除数据【' + JSON.stringify(row) + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.rowChange(row, "del", me.table_dataname);
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
rowChange(row, type, tablename) {
|
var me = this;
|
if (type == "add") {
|
this.tableData.unshift(row);
|
}
|
else if (type == "del") {
|
if (row.id) {
|
let param = {
|
dataname: tablename,
|
id: row.id
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.tableData.remove(row);
|
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}
|
});
|
}
|
else {
|
this.tableData.remove(row);
|
}
|
}
|
else {
|
|
}
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r]) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
// var tableData_ = [];
|
// this.tableData.map(r=>{
|
// var row_ = {};
|
// for (var k in r) {
|
// if (r[k]) {
|
// row_[k] = r[k];
|
// }
|
// }
|
// tableData_.push(row_);
|
// })
|
|
// if (tableData_.length == 0) {
|
// Root.message({
|
// type: 'warning',
|
// message: '请先添加明细数据'
|
// });
|
// return
|
// }
|
let agm_record_template_field_head = []
|
let agm_record_template_field_detail = []
|
this.tableData_banT.map(e => {
|
let list = {}
|
for (let key in e) {
|
list[key] = e[key]
|
}
|
agm_record_template_field_head.push(list)
|
})
|
this.tableData_banMX.map(e => {
|
let list = {}
|
for (let key in e) {
|
list[key] = e[key]
|
}
|
agm_record_template_field_detail.push(e)
|
})
|
let param = {
|
dataName: 'pkg_agm_record_template',
|
data: {
|
agm_record_template: entity,
|
agm_record_template_field_head: agm_record_template_field_head,
|
agm_record_template_field_detail: agm_record_template_field_detail
|
}
|
}
|
|
Server.call("rootjemin/data/Commit", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
});
|
},
|
|
getData() {
|
|
},
|
rowClick() {
|
|
},
|
cellClick() {
|
|
},
|
|
|
|
|
}
|
});
|
};
|
|
initVue();
|
</script>
|
|
<style>
|
.a:hover{
|
background-color: #FFFFFF;
|
}
|
.el-input__inner{
|
padding: 0 2px;
|
}
|
.header {
|
height: 21px;
|
}
|
.el-dialog_header {
|
padding: 10px 20px;
|
border-bottom: 1px solid #ccc;
|
right: 10px;
|
left: 10px;
|
top: 0px;
|
position: fixed;
|
}
|
.el-dialog_body{
|
padding: 20px;
|
|
overflow-y: auto;
|
right: 10px;
|
left: 10px;
|
top: 42px;
|
bottom: 50px;
|
position: fixed;
|
}
|
.el-dialog_footer {
|
padding: 10px 20px;
|
border-top: 1px solid #ccc;
|
right: 10px;
|
left: 10px;
|
bottom: 0px;
|
position: fixed;
|
background-color: #fff;
|
z-index: 10;
|
text-align: right;
|
}
|
html{
|
overflow-y: hidden;
|
}
|
.h_ba_mb_zd {
|
color: #000000;
|
}
|
|
/* .el-button--mini {
|
color: #FFF;
|
background-color: #2984e2;
|
border-color: #409EFF;
|
} */
|
</style>
|
|
</body>
|
</html>
|