<!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="../../../js/vue/vue.js"></script>
|
<script src="../../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../../js/myelement.js?v=20220615"></script>
|
<script src="../../../js/vue/page.js?v=20220615"></script>
|
|
<link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../css/myelement.css?v=20220425" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../css/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span>{{title}}</span>
|
|
<!-- 工具栏 -->
|
<div style="float: right; margin-right: 24px;">
|
<el-button-group style="margin-left: 3px;">
|
<el-button icon="el-icon-refresh" @click="refreshData">刷新</el-button>
|
<input type="file" id="btn_file" style="display: none;" />
|
<el-button v-if="buttons.append" :disabled="buttons.append.disabled" icon="el-icon-plus" @click="addData">添加</el-button>
|
<el-button v-if="buttons.edit" @click="setEditTableData">{{isEditTableData ? '取消编辑' : '在线编辑'}}</el-button>
|
</el-button-group>
|
<el-button-group style="margin-left: 3px;">
|
<el-button v-if="buttons.submit" :disabled="!(selectedrow.id && (selectedrow.status == null || selectedrow.status == 'input' || selectedrow.status == 'refuse'))" @click="commitApproval">提交</el-button>
|
<!-- <el-button @click="approvalData('data_state')">审批</el-button> -->
|
</el-button-group>
|
<el-button-group style="margin-left: 3px;">
|
<el-button :disabled="!(selectedrow.id && (selectedrow.status == 'input' || selectedrow.status == 'refuse' ))" @click="flow_Cancel('status','code','puresale_plan')">作废</el-button>
|
</el-button-group>
|
<!-- <el-button-group style="margin-left: 3px;">
|
<el-button :disabled="!(selectedrow.id && selectedrow.status != null)" @click="onShowApproval()">审批记录</el-button>
|
<el-button @click="download()">导出</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">
|
<h-form-filter ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
:isbuttonquery="true"
|
v-on:on-formchange="onQuery"
|
v-on:show-popup="showFilterPopup"
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
v-on:on-edit-query="onEditFilter"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:tableloading="tableloading"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight"
|
:is-highlight-row="true"
|
:edit-table-button="editTableButton"
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:del-data="delData"
|
v-on:row-click="rowClick"
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
</div>
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
var setting = getSetting("produceplan_list");
|
var initlized = false;
|
|
new ListVue({
|
el: "#vbody",
|
data: {
|
pageAttr: {
|
heightType: "page"
|
},
|
dataname: "puresalePlan",
|
tabaleFieldsName: "puresalePlan_",
|
filterFieldsName: "puresalePlan_",
|
|
title: "纯销计划",
|
|
orderby: "create_time desc",
|
tableloading: false,
|
editTableButton: {
|
edit: {
|
isshow:true,
|
txt:"编辑"
|
},
|
del: {
|
isshow:true,
|
txt:"删除"
|
},
|
save:{
|
isshow:true,
|
txt:"保存"
|
},
|
},
|
filterObjBydefault: {
|
create_operate_code: window.top.userinfo.employee.code
|
}
|
},
|
created() {
|
var me = this;
|
var roleList_ = localStorage.getItem("roleList");
|
var roleList = JSON.parse(roleList_);
|
roleList.map(r=>{
|
if (r.code == "admin") {
|
me.filterObjBydefault = {}
|
}
|
})
|
|
this.pageCode = "A2-2-1";
|
this.getResoures();
|
},
|
|
mounted() {
|
this.initData();
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
initData() {
|
if (initlized) { return; }
|
initlized = true;
|
|
this.onQuery();
|
},
|
|
onServerInitData(data) {
|
var me = this.data;
|
|
me.tableFields = data.tableFields;
|
me.filterFields = data.filterFields;
|
me.type = data.type;
|
|
if(me.filterFields.length > 0) {
|
for(var i=0; i < me.filterFields.length; i++) {
|
let fieldObj_ = me.filterFields[i];
|
|
me.filterFieldsObj[fieldObj_.field] = fieldObj_;
|
}
|
}
|
if(me.tableFields.length > 0) {
|
for(var i=0; i < me.tableFields.length; i++) {
|
let fieldObj_ = me.tableFields[i];
|
|
me.tableFieldsObj[fieldObj_.field] = fieldObj_;
|
}
|
}
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
if(!(row.status == "input" || row.status == "close")) {
|
Root.message({
|
type: 'warning',
|
message: '该状态不能被删除'
|
});
|
return;
|
}
|
|
Root.confirm('确定删除-' + row.code + '-吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.tableloading = true;
|
let param_table = {
|
isClientMode: false,
|
dataname: "deletePuresaleDetail",
|
parentId: row.id,
|
returnType: "Void",
|
}
|
Server.call("root/data/procedure", param_table, function(result) {
|
console.log(result);
|
if (result.success) {
|
let param = {
|
id: row.id
|
}
|
Server.call("root/data/deleteEntity/" + me.dataname, param, function(result) {
|
if(result.success) {
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.doQuery();
|
me.tableloading = false;
|
}
|
});
|
}else {
|
Root.message({
|
type: 'success',
|
message: result.message
|
});
|
me.tableloading = false;
|
}
|
})
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
me.tableloading = false;
|
});
|
},
|
|
onAddData(config) {
|
var me = this;
|
config.combine({
|
totab: true,
|
icon: "icon-product",
|
text: "纯销计划新增",
|
id: "puresaleplan_edit",
|
url: "../order/plan/puresaleplan_edit.html",
|
sceneCode: "add",
|
data: {},
|
delta: me.dataname,
|
});
|
|
return true;
|
},
|
|
onEditData(config, scope) {
|
var me = this;
|
var row = scope.row;
|
|
//1. empty row
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请选择要编辑的数据'
|
});
|
return false;
|
}
|
|
//2. not input
|
if (row.status != "input" && row.status != "refuse" && row.status) {
|
Root.message({
|
type: 'warning',
|
message: "当前数据不是输入状态"
|
})
|
return false;
|
}
|
|
//3. popup
|
config.combine({
|
totab: true,
|
icon: "icon-product",
|
text: "纯销计划编辑",
|
id: "puresaleplan_edit",
|
url: "../order/plan/puresaleplan_edit.html",
|
sceneCode: "edit",
|
data: row,
|
delta: me.dataname,
|
});
|
|
return true;
|
},
|
|
onApproveData(config, code) {
|
var me = this;
|
var row = this.selectedrow;
|
|
//1. empty row
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请选择要审批的数据'
|
});
|
return false;
|
}
|
|
//2 check state
|
|
if ("working" != row.status) {
|
Root.message({
|
type: 'warning',
|
message: "当前数据不是【审批中】状态"
|
})
|
return false;
|
}
|
|
//3. popup
|
config.combine({
|
totab: true,
|
icon: "icon-product",
|
text: "纯销计划审批",
|
id: "puresaleplan_edit",
|
url: "../order/plan/puresaleplan_edit.html",
|
sceneCode: "approval",
|
data:this.selectedrow ,
|
delta: me.dataname,
|
});
|
return true;
|
|
},
|
|
commitApproval() {
|
var me = this;
|
// Console.log(this.selectedrow);
|
var row = this.selectedrow;
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "纯销计划编辑",
|
id: "puresaleplan_edit",
|
url: "../order/plan/puresaleplan_edit.html",
|
data: row,
|
delta: me.dataname,
|
sceneCode: "edit",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
|
// if (!row || !row.id) {
|
// Root.message({
|
// type: 'warning',
|
// message: '请先选择一条数据'
|
// });
|
// return false;
|
// }
|
// else if (row.status != null && row.status != "input" && !(row.status == "refuse" && row.create_operate_name == window.top.userinfo.employee.name)) { //待调整只有创建人才可提交
|
// Root.message({
|
// type: 'warning',
|
// message: '当前状态不可提交'
|
// });
|
// return false;
|
// }
|
|
// Root.confirm('确定提交-' + row.code + '-吗?', '提示', {
|
// confirmButtonText: "提交",
|
// cancelButtonText: '取消',
|
// type: 'warning'
|
// }).then(() => {
|
// me.tableloading = true;
|
// if(row.status == "refuse") {
|
// let param = {
|
// flowId: row.flow_id,
|
// businessType: "puresale_plan",
|
// pass: true,
|
// variableMap: {
|
// reason: ""
|
// }
|
// }
|
// Server.call("root/api/dealAct", param, function(result) {
|
// if (result.success) {
|
// Root.message({
|
// type: 'success',
|
// message: '提交成功'
|
// });
|
// me.onQuery();
|
// me.tableloading = false;
|
// } else {
|
// Root.message({
|
// type: 'warning',
|
// message: result.message
|
// });
|
// me.tableloading = false;
|
// }
|
// })
|
// }else {
|
// let param = {
|
// businessId: row.id,
|
// businessType: "puresale_plan",
|
// variableMap: {
|
// province: row.province_code
|
// }
|
// }
|
// Server.call("root/api/startAct", param, function(result) {
|
// console.log(result);
|
// if (result.success){
|
// Server.call("root/data/updateEntity/" + me.dataname, {id: row.id,flow_id: result.data.data.activitiId}, function(result) {
|
// if(result.success) {
|
// Root.message({
|
// type: 'success',
|
// message: '提交成功'
|
// });
|
// me.onQuery();
|
// me.tableloading = false;
|
// }else{
|
// Root.message({
|
// type: 'warning',
|
// message: result.message
|
// });
|
// me.tableloading = false;
|
// }
|
// });
|
// }else{
|
// Root.message({
|
// type: 'warning',
|
// message: result.message
|
// });
|
// me.tableloading = false;
|
// }
|
// });
|
// }
|
// }).catch(() => {
|
// Root.message({
|
// type: 'info',
|
// message: '已取消'
|
// });
|
// me.tableloading = false;
|
// });
|
},
|
flow_Cancel: function(status_,code_,dataType_) {
|
let me = this;
|
var row = this.selectedrow;
|
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
});
|
return false;
|
}
|
else if (row[status_] != "refuse" && row[status_] != "input") {
|
Root.message({
|
type: 'warning',
|
message: '当前状态不可作废'
|
});
|
return false;
|
}
|
Root.confirm('确定作废-' + row[code_] + '-吗?', '提示', {
|
confirmButtonText: "作废",
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param = {
|
flowId: row.flow_id,
|
businessType: dataType_,
|
pass: false,
|
variableMap: {
|
reason: ""
|
}
|
}
|
Server.call("root/api/dealAct", param, function(result) {
|
console.log(result);
|
if (result.success){
|
Root.message({
|
type: 'success',
|
message: '作废成功'
|
});
|
}else{
|
Root.message({
|
type: 'warning',
|
message: '作废失败'
|
});
|
}
|
|
me.onQuery();
|
});
|
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消'
|
});
|
});
|
},
|
onShowApproval() {
|
var me = this;
|
var row = this.selectedrow;
|
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
});
|
return false;
|
}
|
else {
|
let param = {
|
isClientMode: false,
|
flowId:row.flow_id
|
}
|
|
if(row.status == null || row.status == 'input') {
|
Root.message({
|
type: 'warning',
|
message: '当前状态没有审批记录'
|
});
|
return
|
}
|
|
Server.call("root/order/getHistoryTask/", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
|
Root.popupParames = {
|
width: "900px",
|
height:"700px",
|
url: "../approval/ApprovalList.html",
|
data: result.data,
|
|
};
|
// GET /act/historyNode/{flowId}
|
// "../approval/ApprovalList.html",
|
Root.popupParames.disabled = true;
|
|
Root.showPopup(Root.popupParames);
|
}
|
});
|
}
|
},
|
|
download() {
|
dealExportByPath("../../../template/plan.xlsx","文件");
|
},
|
|
onshowFilterPopup(filter) {
|
var me = this;
|
var fieldObj_ = filter.obj;
|
var filterValue = clone(me.filterObj);
|
var field_ = fieldObj_.field;
|
|
if ("customername" == field_) {
|
Root.showPopup({
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
callback: function(result, callback) {
|
filterValue[field_] = result.row.md_description;
|
me.filterObj = filterValue;
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
},
|
onCellClick(config, obj) {
|
let me = this;
|
var clickContext = this.selectCellField.clickContext;
|
if (this.selectCellField.field == "status") {
|
clickContext.url = "";
|
if (obj.row.status != 'input' && obj.row.status != 'close' && obj.row.status) {
|
clickContext.url = "../approval/ApprovalList.html";
|
clickContext.delta = {
|
flow_id: obj.row.flow_id,
|
}
|
clickContext.width = "75vw";
|
clickContext.height = "65vh";
|
clickContext.hide_close = true;
|
}
|
}
|
if (clickContext && clickContext.type == "popup" && clickContext.url != "") {
|
config.combine({
|
url: clickContext.url,
|
hide_close: clickContext.hide_close,
|
sceneCode: clickContext.sceneCode,
|
data: obj.row,
|
delta: clickContext.delta ? clickContext.delta : {},
|
width: clickContext.width,
|
height: clickContext.height,
|
})
|
} else {
|
return false;
|
}
|
return true;
|
},
|
}
|
});
|
</script>
|
</body>
|
</html>
|