<!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/myelement.js?v=20220425"></script>
|
<script src="../../../jsnew/page.js?v=20220425"></script>
|
<script src="../../../js/vue/axios/dist/axios.min.js"></script>
|
<script src="../../../js/common.js"></script>
|
<!-- <script src="../../../setting.js"></script> -->
|
|
<link href="../../../jsnew/vue/element-ui/element-ui_15/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../jsnew/myelement.css?v=20220426" rel="stylesheet">
|
<link href="../../../jsnew/theme.css?v=20220426" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../jsnew/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span>{{title}}</span>
|
|
<div style="margin-right: 18px;float: right;">
|
<el-button-group style="margin-left: 3px">
|
<el-button @click="moduleDownload">模板下载</el-button>
|
<input type="file" id="btn_file" style="display: none;" @change="getFile($event)" />
|
<el-button @click="fileUpload">导 入</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
|
<div class="topbar-line">
|
<div class="query-bar">
|
<h-form-filter ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
:table-field-click="filterfieldClick"
|
:isdraggableorder="true"
|
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
v-on:order-fields="orderFilterFields"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="h_dialog__body" :style="{height: t_height +'px', 'overflow-y': 'auto', 'padding-top': '15px'}">
|
<template v-if="isRefresh && tableFields">
|
<div v-for="(row, index) in tableData" :key="'c' + index" class="" style="margin-bottom: 10px;" @click="onClickRowCard(row)">
|
<el-card :class="[selectedrow && selectedrow.id == row.id ? 'h_select_card' : '','h_table_card']" shadow="hover" style="position: relative;" >
|
<div class="h_table_card_title">
|
<div style="width: 100%; height: 100%;">
|
<!-- <div style="padding: 10px; display: inline-block;">
|
<el-tag
|
:type="row.source == '新增'? 'success' : (row.source == '变更'? '': 'danger')"
|
>
|
{{row.source}}
|
</el-tag>
|
</div> -->
|
<!-- <div class="state" @click="state_click(row)" style="padding: 10px; display: inline-block; position: absolute; right: 30px; color: red;">
|
{{row.state_name}}
|
</div> -->
|
</div>
|
</div>
|
|
<el-row :gutter="20">
|
<el-col :span="2" class="h_table_card_front">
|
<!-- <div style="width: 100%; height: 100%;background-color: #b780e600;">前缀</div> -->
|
</el-col>
|
<el-col :span="20" class="h_table_card_body">
|
<h-form
|
:ref="'cf' + index"
|
:form-attr="formAttr"
|
:table-fields="tableFields"
|
:form-data="row"
|
:table-field-click="tablefieldClick"
|
>
|
</h-form>
|
</el-col>
|
<el-col :span="2" class="h_table_card_after" style="position: absolute; right: 5%; height: 100vh; top: 30%;">
|
<div style="width: 100%; background-color: #83e67300;">
|
<div>
|
<el-button
|
plain
|
icon="el-icon-arrow-right"
|
class="button-card"
|
@click="showInfo(row)" >
|
</el-button>
|
</div>
|
</div>
|
</el-col>
|
</el-row>
|
</el-card>
|
</div>
|
</template>
|
</div>
|
|
<div style="text-align: right; padding: 16px 0px;">
|
<el-pagination
|
background
|
layout="prev, pager, next"
|
:total="total"
|
v-on:current-change="changePage"
|
>
|
</el-pagination>
|
</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 ListVue({
|
el: "#vbody",
|
data: {
|
dataname: "pkg_fee_data_final_flow",
|
dataurl: "rootjemin/data/getEntitySet",
|
title: "定版流向",
|
|
default_filterFields: [
|
{isshow: "T",field: "type",name: "类型", filteroperator: "like"},
|
],
|
default_tableFields: [
|
// {isshow: "F",field: "source",name: "来源",width: "150", type: "span"},
|
// {isshow: "T",field: "process_no",name: "流程号",width: "200",align: "left", isminwidth: true, colspan: 2, type: "span"},
|
{isshow: "T", field: "type",name: "类型",width: "150",align: "left", isminwidth: true, type: "span"},
|
// {isshow: "T",field: "apply_person",name: "申请人",width: "100", type: "span"},
|
// {isshow: "T",field: "department",name: "申请部门",width: "150",align: "left", isminwidth: true, type: "span"},
|
// {isshow: "T",field: "province",name: "申请省份",width: "150",align: "left", isminwidth: true, type: "span"},
|
// {isshow: "F",field: "state_name",name: "状态",width: "100", type: "span"},
|
{isshow: "T", field: "create_time",name: "创建日期", width: "100", align: "center", isminwidth: true, type: "span", formatter: "formatter_date"},
|
{isshow: "T",field: "remark",name: "备注",width: "100", type: "span",},
|
],
|
filterfieldClick: {},
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "120px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "1px solid #c6c6c600"
|
},
|
|
tableData: [
|
{
|
id: "zysq03",
|
// source: "新增",
|
create_time: "2023-06-28",
|
type: "定版流向",
|
},
|
{
|
id: "zysq02",
|
// source: "变更",
|
create_time: "2023-06-28",
|
type: "定版流向",
|
},
|
{
|
id: "zysq01",
|
// source: "终止",
|
create_time: "2023-06-28",
|
type: "定版流向",
|
},
|
],
|
t_height:null,
|
},
|
created() {
|
|
},
|
|
mounted() {
|
var me = this;
|
me.t_height = document.documentElement.clientHeight*1 - 152;
|
|
//获取数据
|
this.initData();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
moduleDownload() {
|
let url = encodeURI("template\\导入_定版流向.xlsx")
|
handleDownloadPath(window.top.RootSetting.url_jemin + "io/downloadOneFile?token=" + Root.getToken() + "&url=" + url)
|
},
|
fileUpload() {
|
document.getElementById("btn_file").click()
|
},
|
getFile(event) {
|
var me = this;
|
//this.fullscreenLoading = true;
|
var file = event.target.files;
|
var forms = new FormData();
|
|
if(file.length <= 0) {
|
//this.fullscreenLoading = false;
|
}
|
for (var i = 0; i < file.length; i++) {
|
// 上传类型判断
|
var FileName = file[i].name;
|
var idx = FileName.lastIndexOf(".");
|
if (idx != -1) {
|
var ext = FileName.substr(idx + 1).toUpperCase();
|
ext = ext.toLowerCase();
|
if (ext == 'xlsx') {
|
let formData = new FormData()
|
formData.append("file", file[i]);
|
|
uploadAxios.post(window.top.RootSetting.url_jemin + 'io/importData?ioname=tempFinalFlowImport&token=' + Root.getToken(), formData).then(result => {
|
if(result.data.success) {
|
|
let param = {
|
tableName: 'fee_data_final_flow'
|
}
|
|
Server.call("rootjemin/history/tempToFormal", param, function(result) {
|
if (result.success) {
|
me.saveImportData(result.parent_id)
|
}
|
});
|
}else {
|
if (result.data.messages && result.data.messages.list && result.data.messages.list.length > 0){
|
let str = ''
|
result.data.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:200px; width: 340px; overflow: auto;'>" + decodeURI(e.message)
|
else {
|
str += "</br></br> " + decodeURI(e.message)
|
}
|
})
|
|
Root.message({
|
dangerouslyUseHTMLString: true,
|
type: 'error',
|
message: str
|
});
|
}
|
}
|
//me.fullscreenLoading = false;
|
}).catch(error => {
|
me.$message({
|
showClose: true,
|
message: ':请求出现错误:' + error,
|
type: 'error'
|
});
|
//me.fullscreenLoading = false;
|
});
|
} else {
|
Root.message({
|
type: 'info',
|
message: '格式不正确'
|
});
|
//me.fullscreenLoading = false;
|
}
|
}
|
}
|
|
event.target.value = null
|
},
|
saveImportData(parent_id) {
|
let me = this
|
let params = {
|
dataName: "fee_data_final_title",
|
data: {
|
fee_data_final_title: {
|
id: parent_id,
|
type: "final_flow",
|
create_time: createDatetime(),
|
count_year: createDatetime().split('-')[0],
|
count_month: createDatetime().split('-')[1]
|
}
|
}
|
}
|
Server.call("rootjemin/data/saveEntity", params, function(result) {
|
if (result.success) {
|
|
|
Root.message({
|
type: 'success',
|
message: "导入成功"
|
});
|
me.onQuery()
|
}
|
});
|
},
|
onInitFilter() {
|
//清空
|
this.filterObj = {};
|
this.selectedrow = {};
|
this.initData();
|
},
|
|
// onQuery() {
|
// this.initData();
|
// },
|
|
initData() {
|
var me = this;
|
// if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
|
// me.filterFields = clone(me.default_filterFields);
|
// me.tableFields = clone(me.default_tableFields);
|
// me.formFields2 = clone(me.default_formFields2);
|
|
// //字段数组转字段obj
|
// me.fieldsToFieldsObj();
|
|
// //设置字段事件
|
// me.tableFieldClick();
|
// }
|
// this.tableDataAfter();
|
|
this.onQuery(function(result, callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta['fee_data_final_title'] && result.meta['fee_data_final_title'].fields) {
|
var metas = clone(result.meta['fee_data_final_title'].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);
|
}
|
|
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();
|
}
|
});
|
},
|
|
changePage(pageNo) {
|
this.pagenum = pageNo
|
this.selectedrow = {};
|
this.doQuery()
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//筛选字段事件设置
|
this.filterfieldClick = {
|
product_code: {//字段事件设置
|
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: '下拉更改事件'
|
});
|
}
|
},
|
},
|
};
|
//表格字段事件设置
|
this.tablefieldClick = {
|
product_code: {//字段事件设置
|
val: {//有值时的点击事件
|
notclick_val: "",//不可点击的值,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: '输入更改事件'
|
});
|
}
|
},
|
|
|
},
|
};
|
|
//表单字段事件设置
|
this.formfieldClick = {
|
product_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) {//下拉更改事件
|
Root.message({
|
type: 'success',
|
message: '下拉更改事件'
|
});
|
}
|
},
|
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: '按键组点击事件'
|
});
|
}
|
},
|
|
},
|
};
|
},
|
|
onAddData() {
|
let me = this;
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "定版流向信息新增",
|
id: "final_version_flow_info" + row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/baseDatas/final_version_flow_info.html",
|
data: row,
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
showInfo(row) {
|
var me = this;
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "定版流向信息查看",
|
id: "final_version_flow_info" + row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/baseDatas/final_version_flow_info.html",
|
data: row,
|
delta: {},
|
sceneCode: "browse",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
addData() {
|
let me = this;
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "300px",
|
icon: "icon-product",
|
text: "产品信息",
|
id: "product_edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/product/page/product_edit.html",
|
data: {},
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
onEditData(config, scope) {
|
var me = this;
|
var row = scope.row;
|
|
//1. empty row
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请选择要编辑的数据'
|
});
|
return false;
|
}
|
|
//3. popup
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "500px",
|
height: "300px",
|
icon: "icon-product",
|
text: "产品线信息",
|
id: "product_edit" + row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "module/md/page/product/page/product_edit.html",
|
data: row,
|
delta: null,
|
sceneCode: "edit",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
onClickRowCard(row) {
|
this.selectedrow = clone(row);
|
this.$forceUpdate();
|
},
|
}
|
});
|
};
|
|
initVue();
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
|
.h_form_filter {
|
padding-top: 1px;
|
}
|
|
/* .el-button--mini {
|
color: #FFF;
|
background-color: #2984e2;
|
border-color: #409EFF;
|
} */
|
|
.state {
|
text-decoration: underline;
|
cursor: pointer;
|
}
|
.h_table_card:hover {
|
cursor: pointer;
|
}
|
.h_select_card {
|
border: 2px solid rgb(72, 172, 211);
|
}
|
|
/* .el-card__body {
|
padding: 5px;
|
}
|
|
.button-card {
|
width: 80px;
|
} */
|
|
.el-card {
|
border-radius: 8px;
|
}
|
</style>
|
</body>
|
</html>
|