<!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>
|
<script src="./setting.js"></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" :disabled="buttons.edit.disabled" @click="setEditTableData">{{isEditTableData ? '取消编辑' : '在线编辑'}}</el-button>
|
</el-button-group> -->
|
|
<el-button-group style="margin-left: 3px;">
|
<el-button v-if="buttons.cancel" :disabled="buttons.disabled" @click="h_procedure('statecode', 'refuse', 'close', 'code', '作废', '已作废')">作废</el-button>
|
</el-button-group>
|
|
<el-button-group style="margin-left: 3px;">
|
<!-- <el-button @click="commitApproval">提交</el-button> -->
|
<el-button v-if="buttons.approve && activeName == '0'" :disabled="!selectedrow.id" @click="approvalData('status')">审批</el-button>
|
</el-button-group>
|
|
<!-- <el-button-group style="margin-left: 3px;">
|
<el-button :disabled="!selectedrow.id" @click="onShowApproval()">审批记录</el-button>
|
<el-button @click="download()">导出</el-button>
|
</el-button-group> -->
|
</div>
|
</div>
|
|
<!-- 查询条件 -->
|
<div class="topbar-line">
|
<div style="float: left; width: 100%;">
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tab-pane label="待审批" name="0"></el-tab-pane>
|
<el-tab-pane label="审批历史" name="1"></el-tab-pane>
|
</el-tabs>
|
</div>
|
<div style="position: absolute; top: 41px; left: 200px; color: red;">{{ year }}年{{ month }}月份,纯销计划已报:{{ haveReport }},未报:{{ noReport }}</div>
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
<div v-if="activeName == '0'" 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 v-if="activeName == '1'" class="query-bar">
|
<h-form-filter ref="form_records"
|
:form-attr="filterAttr"
|
:table-fields="filterFieldsObj_records"
|
:form-data="filterObj"
|
:isbuttonquery="false"
|
v-on:on-formchange="onQueryApprovalRecords"
|
v-on:on-query="onQueryApprovalRecords"
|
v-on:on-init-query="onInitFilterApprovalRecords"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div v-if="activeName == '0'" 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 v-if="activeName == '1'" class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table_records"
|
: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:edit-data="editData"
|
v-on:del-data="delData"
|
v-on:row-click="rowClick"
|
|
v-on:get-data="getApprovalRecordsData"
|
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: "puresalePlanApproval",
|
dataname_records: "puresalePlan",
|
tabaleFieldsName: "puresalePlan_",
|
filterFieldsName: "puresalePlan_",
|
|
title: "纯销计划审批",
|
|
orderby: "create_time desc",
|
tableloading: false,
|
activeName: '0',
|
total_tab0: 0,
|
total_tab1: 0,
|
editTableButton: {
|
edit: {
|
isshow:true,
|
txt:"编辑"
|
},
|
del: {
|
isshow:false,
|
txt:"删除"
|
},
|
save:{
|
isshow:true,
|
txt:"保存"
|
},
|
},
|
// filter_: " and status = 'working' and fne.emp_code = '" + window.top.userinfo.employee.code + "'"
|
filterObjBydefault: {
|
"status": "working",
|
"emp_code": window.top.userinfo.employee.code
|
},
|
|
year: "",
|
month: "",
|
haveReport: "",
|
noReport: ""
|
},
|
created() {
|
this.pageCode = "A2-2-3";
|
this.getResoures();
|
this.getdlempcode("puresale_plan");//根据流程获取代理人员,设置this.dl_emp_codestrs
|
|
},
|
|
mounted() {
|
this.initData();
|
this.getReport()
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
getReport() {
|
let me = this
|
|
me.year = new Date().getFullYear()
|
me.month = new Date().getMonth() + 1
|
|
let param = {
|
dataName: "planPuresaleSubmit",
|
filter: "business_operate_code = '" + localStorage.getItem("emp_code") + "'"
|
}
|
Server.call("root/data/getEntitySet", param, function(result) {
|
console.log(result);
|
if (result.success){
|
let arr = result.data.entityset
|
arr.map(e => {
|
if (e.ids) {
|
if (!me.haveReport) {
|
me.haveReport = e.value
|
}
|
else {
|
me.haveReport += "、" + e.value
|
}
|
}
|
else {
|
if (!me.noReport) {
|
me.noReport = e.value
|
}
|
else {
|
me.noReport += "、" + e.value
|
}
|
}
|
})
|
|
if (!me.haveReport) {
|
me.haveReport = "暂无"
|
}
|
if (!me.noReport) {
|
me.noReport = "暂无"
|
}
|
}
|
});
|
},
|
initData() {
|
if (initlized) { return; }
|
initlized = true;
|
|
var total_tab = "total_tab" + this.activeName;
|
this.totaltab = total_tab;
|
this.onQuery(total_tab);
|
},
|
|
onServerInitData(data) {
|
var me = this.data;
|
|
me.tableFields = data.tableFields;
|
me.filterFields = data.filterFields;
|
me.filterFieldsObj_records = 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_;
|
}
|
}
|
},
|
|
handleClick(tab) {
|
var me = this;
|
var total_tab = "total_tab" + tab.name;
|
this.totaltab = total_tab;
|
|
if (tab.name == "0") {
|
this.filterTxt = "";
|
this.onQuery(total_tab);
|
}
|
else if (tab.name == "1") {
|
this.orderby="create_time desc";
|
this.approvaltype = "puresale_plan";
|
|
this.approvalfields = ["*"];
|
this.filterTxt = "act_assignee in ('" +localStorage.getItem("emp_code")+"','"+localStorage.getItem("emp_id")+"','"+localStorage.getItem("id")+"'" + me.dl_emp_codestrs + ")";//"act_assignee='" + localStorage.getItem("emp_code") + "'" //c.create_operate_id = '" + localStorage.getItem("emp_id") + "'
|
this.onQueryApprovalRecords(total_tab)
|
}
|
|
},
|
|
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;
|
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(() => {
|
let param = {
|
businessId: row.id,
|
businessType: "puresale_plan",
|
variableMap: '',
|
}
|
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();
|
}else{
|
Root.message({
|
type: 'warning',
|
message: result.message
|
});
|
}
|
});
|
}else{
|
Root.message({
|
type: 'warning',
|
message: result.message
|
});
|
}
|
});
|
}).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>
|