<!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="../../../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>
|
|
<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=" text-align: right; padding: 5px 30px 0px 0px;" v-if="!isedit">
|
<el-button size="small" type="primary" @click="">重新计算</el-button>
|
<el-button size="small" type="primary" @click="">审 批</el-button>
|
<el-button size="small" type="primary" @click="">批量审批</el-button>
|
<el-button size="small" type="primary" @click="">导 入</el-button>
|
<el-button size="small" type="primary" @click="">导 出</el-button>
|
<el-button size="small" type="primary" @click="">保 存</el-button>
|
<el-button size="small" type="primary" @click="">编 辑</el-button>
|
<el-button size="small" type="primary" @click="">分 发</el-button>
|
<el-button size="small" type="primary" @click="">获取反馈</el-button>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
|
<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
|
<div class="topbar-line" style="padding-top: 20px;">
|
<div class="query-bar">
|
<h-form-filter ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
:table-field-click="filterfieldClick"
|
:isdraggableorder="false"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="el-dialog__body">
|
<div class="h_dialog__body">
|
<div v-if="isedit || isrefuseedit" style=" text-align: right; padding-top: 10px;">
|
<!-- 工具栏 -->
|
<div style=" display: inline-block; width: 215px;">
|
<el-button-group style="display: flex;">
|
<el-button @click="addTableData">新增明细</el-button>
|
<el-button @click="">模板下载</el-button>
|
<el-button @click="">导 入</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
|
<h-table
|
v-if="isRefresh && tableFields.length"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="false"
|
:is-within-edit-table-data="true"
|
:is-pagination="true"
|
:table-field-click="tablefieldClick"
|
:is-show-index="true"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="true"
|
|
:select-table-data="selectedrows"
|
:is-selection="!isedit"
|
:isshow-shoppingcart="false"
|
v-on:selection-change="selectionChange"
|
v-on:save-shoppingcart="saveShoppingcart"
|
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
</div>
|
</div>
|
</div>
|
<div class="el-dialog__footer" v-if="isedit">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" type="primary" @click="">保 存</el-button>
|
<el-button size="small" 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: "md_product_line",
|
table_dataname: "md_product_line.aaa_detail",
|
title: "表单+明细模板1",
|
|
filterAttr: {
|
columnnumber: 4,
|
labelwidth: "100px",
|
labelposition: "right",//"left",//"right",
|
size: "medium",
|
border: "0px solid #c6c6c600"
|
},
|
default_filterFields: [
|
{isshow: "T", field: "process_no", name: "流程号", filterfield:"", filteroperator: "like", type: ""},
|
{isshow: "T", field: "apply_name", name: "申请人", filterfield:"", filteroperator: "like", type: ""},
|
],
|
filterFields: [],
|
filterfieldClick: {},
|
filterObj: {},
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 3,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields: [
|
{isshow: "T", field: "process_no", name: "流程号", type:"span", colspan: 3, required: true},
|
{isshow: "T", field: "apply_date", name: "申请日期", type:"span", type: "date", required: true},
|
{isshow: "T", field: "employee_code", name: "员工编号", required: true },
|
{isshow: "T", field: "apply_name", name: "申请人", type:"span", required: true},
|
{isshow: "T", field: "department", name: "所在部门", type:"span", required: true},
|
{isshow: "T", field: "apply_province", name: "申请省份", type:"select", required: true},
|
{isshow: "T", field: "remark", name: "备注", type:"textarea", required: false, colspan: 2},
|
// {isshow: "T", field: "process_type", name: "流程类型",},
|
],
|
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: {},
|
|
formAttr2: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 1,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields2: [
|
{isshow: "T", field: "summary", name: "折扣金额汇总", type: "span"},
|
{isshow: "T", field: "files", name: "附件", type: "uploadfilelist"},
|
],
|
formFields2: [],
|
formData2: {},
|
|
default_tableFields: [
|
{isshow: "T",field: "year", name: "年", width: "100", type:"span"},
|
{isshow: "T",field: "month", name: "月", width: "100", type:"span"},
|
{isshow: "T", field: "main", name: "主体", width: "100", type:"span",},
|
{isshow: "T", field: "department", name: "业务线/部门", width: "100", type:"span",},
|
{isshow: "T", field: "province", name: "省份", width: "100", type:"span",},
|
{isshow: "T", field: "receipt_type", name: "单据类型", width: "100", type:"span",},
|
{isshow: "T", field: "date", name: "日期", width: "150", type:"span",},
|
{isshow: "T", field: "outflow_code", name: "流出方编码", width: "150", type: "span",},
|
{isshow: "T", field: "outflow_name", name: "流出方名称", width: "200", type:"span",},
|
{isshow: "T", field: "outflowdept_code", name: "流出部门编码", width: "150", type: "span",},
|
{isshow: "T", field: "outsalesman_code", name: "流出业务员编码", width: "150", type: "span",},
|
{isshow: "T", field: "out_salesman", name: "流出业务员", width: "150", type: "span",},
|
{isshow: "T", field: "inflow_code", name: "流入方编码", width: "150", type: "span",},
|
{isshow: "T", field: "inflow_name", name: "流入方名称", width: "200", type:"span",},
|
{isshow: "T", field: "inflowdept_code", name: "流入部门编码", width: "150", type: "span",},
|
{isshow: "T", field: "inflow——dept", name: "流入部门", width: "150", type: "span",},
|
{isshow: "T", field: "insalesman_code", name: "流入业务员编码", width: "150", type: "span",},
|
{isshow: "T", field: "in_salesman", name: "流入业务员", width: "150", type: "span",},
|
{isshow: "T", field: "inflow_type", name: "流入类型", width: "100", type:"span",},
|
{isshow: "T", field: "stock_code", name: "存货编码", width: "200", type:"span",},
|
{isshow: "T", field: "stock_name", name: "存货名称", width: "200", type:"span",},
|
{isshow: "T", field: "stock_spec", name: "存货规格", width: "200", type: "span",},
|
{isshow: "T", field: "inflow_date", name: "流入时间", width: "150", type:"span", formatter: "formatter_date"},
|
{isshow: "T", field: "quantity", name: "数量", width: "200", type: "span",},
|
{isshow: "T", field: "amount", name: "金额", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "medicine_batch", name: "药品批号", width: "200", type:"span",},
|
{isshow: "T", field: "remark", name: "明细备注", type: "span", width: "150"},
|
{isshow: "T", field: "allocate_zone", name: "划拨区域", width: "150", type:"span",},
|
{isshow: "T", field: "system_unit", name: "原系统-单价", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "insalesman_code", name: "流入业务员编码2", width: "150", type: "input",},
|
{isshow: "T", field: "in_salesman", name: "流入业务员名称2", width: "150", type: "input",},
|
{isshow: "T", field: "booking_code", name: "上帐一级编码", width: "150", type: "span",},
|
{isshow: "T", field: "booking_name", name: "上账一级名称", width: "200", type:"span",},
|
{isshow: "T", field: "adjust_unit", name: "补差单价", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "adjust_amount", name: "补差金额", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "pay_type", name: "支付方式", width: "100", type: "span"},
|
{isshow: "T", field: "policy_code", name: "终端政策明细编码", width: "100", type:"input",},
|
{isshow: "T", field: "remark", name: "备注", type: "input", width: "150"},
|
],
|
tableFields: [],
|
newTableData: {
|
// create_time: createDatetime(),
|
// creator_name: window.top.vue.userinfo.name,
|
},
|
tableData: [
|
{
|
id: "01",
|
warning: "80",
|
customer_code: "10010064",
|
customer_name: "云南博泰药业有限公司",
|
},
|
{
|
id: "02",
|
warning: "80",
|
customer_code: "10010058",
|
customer_name: "合肥亿帆医药有限公司",
|
},
|
],
|
|
default_tableFields3: [
|
{isshow: "T", field: "field1", name: "当前节点", width: "150", type:"span", required: true},
|
{isshow: "T", field: "field2", name: "申请/审批时间", width: "100", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
|
{isshow: "T", field: "field3", name: "审批情况", width: "150", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
|
{isshow: "T", field: "field4", name: "原因", width: "150", type: "span", required: true, isminwidth: true,},
|
{isshow: "T", field: "field5", name: "申请/审批人", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "field6", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableFields3: [],
|
tableData3: [],
|
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
isend: false,
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
|
flow_id: "c1355b3fd4b049f28135548d17f2071f",
|
t_height:null,
|
isRefresh: true,
|
selectedrows: [],
|
},
|
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_;
|
}
|
|
if (this.newTableData) {
|
this.tableData.push(clone(this.newTableData));
|
}
|
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
this.isapproval = true;
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
me.t_height = document.documentElement.clientHeight*1 - 91;
|
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
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 (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.filterFields = clone(me.default_filterFields);
|
me.formFields = clone(me.default_formFields);
|
me.formFields2 = clone(me.default_formFields2);
|
me.tableFields = clone(me.default_tableFields);
|
me.tableFields3 = clone(me.default_tableFields3);
|
|
//字段数组转字段obj
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
|
// if (this.formData.id) {
|
// id_ = this.formData.id;
|
// }
|
// this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
|
// if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
// var metas = clone(result.meta[me.dataname].fields);
|
// var table_dataname_ = "";
|
// for (var dataname_ in result.meta) {
|
// if (dataname_ != me.dataname && !table_dataname_) {
|
// table_dataname_ = dataname_;
|
// }
|
// }
|
// var table_metas = [];
|
// if (table_dataname_) {
|
// me.table_dataname = table_dataname_;
|
// table_metas = clone(result.meta[table_dataname_].fields);
|
|
// }
|
|
// var formFields_ = [];
|
// var tableFields_ = [];
|
// metas.map(f=>{
|
// f.isshow = "T";
|
// formFields_.push(clone(f));
|
// })
|
// table_metas.map(f=>{
|
// f.isshow = "T";
|
// tableFields_.push(clone(f));
|
// })
|
|
// if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
// me.formFields = clone(formFields_);
|
// me.tableFields = clone(tableFields_);
|
|
// //字段数组转字段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.filterfieldClick = {
|
|
};
|
//表单字段事件设置
|
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);
|
}
|
}
|
}
|
},
|
};
|
|
//表格字段事件设置
|
this.tablefieldClick = {
|
warning: {//字段事件设置
|
prefixclass: {
|
setclass: function(row, field){
|
// 根据逻辑返回class名称
|
console.log(row);
|
if (row.warning * 1 >= 60) {
|
// return "prefixclass";
|
return 'el-icon-warning-outline';
|
// return '<i class="el-icon-time"></i>';
|
} else {
|
return 'whitefixclass';
|
}
|
}
|
},
|
},
|
};
|
|
},
|
|
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 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];
|
}
|
}
|
|
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 param = {
|
dataname: this.dataname,
|
operator: operator_,
|
data: {},
|
}
|
param.data[this.dataname] = entity;
|
param.data[this.table_dataname] = tableData_;
|
|
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();
|
}
|
}
|
});
|
},
|
selectionChange(obj){
|
var me = this;
|
me.selectedrows = obj;
|
},
|
saveShoppingcart(list) {
|
var me = this;
|
me.selectedrows = list;
|
},
|
}
|
});
|
};
|
|
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;
|
}
|
|
/* .el-button--mini {
|
color: #FFF;
|
background-color: #2984e2;
|
border-color: #409EFF;
|
} */
|
|
.prefixclass {
|
width: 10px;
|
height: 10px;
|
border-radius: 5px;
|
background-color: #087e13;
|
display: inline-block;
|
}
|
|
.whitefixclass {
|
width: 10px;
|
height: 10px;
|
border-radius: 5px;
|
display: inline-block;
|
}
|
|
.el-icon-warning-outline {
|
color: darkorange;
|
}
|
</style>
|
|
</body>
|
</html>
|