<!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 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 v-if="!isedit" style="float: right; margin-right: 0px; right: 15px; z-index: 2; padding: 5px 30px 0px 0px;"><!-- position: absolute; -->
|
<el-button-group style="margin-left: 3px">
|
<el-button v-if="buttons.distribute && state == '已确认'" :loading="btnLoading" type="primary" @click="addResultOnce">一键添加重算结果</el-button>
|
<el-button v-if="buttons.distribute && state == '已确认'" :loading="btnLoading" type="primary" @click="addResult">添加重算结果</el-button>
|
<input type="file" id="btn_file" style="display: none;" @change="getFile($event)" />
|
<el-button v-if="buttons.upload && selectTabObj.isEditTableData" :loading="export_loading" @click="fileUpload()">导 入</el-button>
|
<el-button size="small" type="primary" @click="exportList">导 出</el-button>
|
<el-button size="small" v-if="buttons.recal && (state == '待确认' || state == '草稿')" type="primary" @click="reCalculate('again')">重 算</el-button>
|
<el-button size="small" v-if="buttons.cer && state == '待确认'" type="primary" :loading="btnLoading" @click="cerDiscount">确 认</el-button>
|
<el-button size="small" v-if="buttons.backCom && formData.plan_id && state == '已分发' && !undertake" type="primary" @click="tempBtnChangeStatus">反馈完成</el-button>
|
<el-button size="small" v-if="buttons.distribute && state == '已确认'" type="primary" :loading="btnLoading" @click="distribute()">分 发</el-button>
|
<el-button size="small" v-if="buttons.reply && formData.plan_id && state == '已分发' && !undertake" type="primary" @click="getReply">获取反馈</el-button>
|
<el-button size="small" v-if="formData.plan_id && (state == '已反馈' || state == '审批中') && !undertake" type="primary" @click="getReply">查看反馈</el-button>
|
<el-button size="small" v-if="buttons.submit && state == '已反馈' && !undertake && !isapproval" type="primary" :loading="btnLoading" @click="submit">封 板</el-button>
|
<el-button size="small" v-if="isapproval" type="success" @click="approvalOp(true)">批 准</el-button>
|
<el-button size="small" v-if="isapproval" type="danger" @click="approvalOp(false)">拒 绝</el-button>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</el-button-group>
|
</div>
|
|
<div style=" text-align: right; padding: 5px 30px 0px 0px;" v-if="isedit">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="selectTabObj.formfieldClick"
|
>
|
</h-form>
|
</div>
|
<div style=" text-align: right; padding: 5px 30px 0px 0px;" v-if="!isedit" v-show="showFilter"><!-- margin-top: 30px; -->
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields_info"
|
:form-data="formData_info"
|
:table-field-click="selectTabObj.formfieldClick"
|
>
|
</h-form>
|
</div>
|
<div v-if="!isedit" style="margin-left: 15px; padding: 5px 30px 0px 0px">
|
<el-button-group style="">
|
<el-button size="small" v-if="" type="primary" @click="filterShow()">高级搜索</el-button>
|
<el-button size="small" v-if="selectTabObj.code=='matched' && buttons.distribute && state == '待确认'" type="primary" :loading="btnLoading" @click="distributeNew('business')">分发省商务</el-button>
|
<el-button size="small" v-if="selectTabObj.code=='matched' && buttons.distribute && state == '待确认'" type="primary" :loading="btnLoading" @click="distributeNew('operator')">分发商业操作人</el-button>
|
</el-button-group>
|
</div>
|
<div class="topbar-line" id="tabAreaId">
|
<div style="display: flex; margin-bottom: 3px;">
|
<div style="width: 100%;">
|
<el-tabs v-model="activeTabName" @tab-click="handleClick">
|
<el-tab-pane v-for="(tab, k) in tabs" :label="tab.name" :name="tab.code" :key="k"></el-tab-pane>
|
</el-tabs>
|
</div>
|
</div>
|
|
<div class="query-bar" v-show="showFilter">
|
<h-form-filter v-if="selectTabObj.filterFields" ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="selectTabObj.filterFields"
|
:form-data="selectTabObj.filterObj"
|
:table-field-click="selectTabObj.filterfieldClick"
|
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
v-on:on-edit-query="onEditFilter"
|
v-on:order-fields="orderFilterFields"
|
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
|
<div class="h_dialog__body">
|
<h-table
|
v-if="isRefresh && selectTabObj.tableFields"
|
ref="table1"
|
:table-fields="selectTabObj.tableFields"
|
:table-data="selectTabObj.tableData"
|
:is-edit-table-data="selectTabObj.isEditTableData && showSave"
|
:is-within-edit-table-data="selectTabObj.code=='matched' && state == '待确认' && showSave"
|
:edit-table-button="selectTabObj.editTableButton"
|
:pagesize="selectTabObj.pagesize"
|
:pagenum="selectTabObj.pagenum"
|
:total="selectTabObj.total"
|
:table-height="selectTabObj.tableHeight - 50"
|
:table-field-click="selectTabObj.tablefieldClick"
|
:is-show-index="true"
|
:tableloading="tableloading"
|
:isdraggableorder="true"
|
|
:select-table-data="selectedrows"
|
:is-selection="selectTabObj.code=='matched' && state == '待确认' && selectTabObj.tableData.length>0"
|
:isshow-shoppingcart="true"
|
v-on:selection-change="selectionChange"
|
v-on:save-shoppingcart="saveShoppingcart"
|
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:del-data="delData"
|
v-on:order-fields="orderTableFields"
|
>
|
</h-table>
|
</div>
|
|
<h-form
|
ref="form3"
|
:form-attr="formAttr_back"
|
:table-fields="formFields_back"
|
:form-data="formData_back"
|
:table-field-click="selectTabObj.formfieldClick"
|
>
|
</h-form>
|
<el-button-group v-if="showBackBtn" style="float: right; margin-right: 17px; margin-bottom: 50px; ">
|
<el-button size="small" type="primary" @click="saveBackInfo">反 馈</el-button>
|
</el-button-group>
|
|
<div v-if="showApprovalInfo" style="border-top: 15px">
|
<!-- <iframe :src="'../../approval/ApprovalList_page.html?flow_id=' + flow_id" style="width: 100%; height: 100%; border: 0px;"></iframe> -->
|
<div style="width: 100%; height: 100%; border: 0px;">
|
<div class="topbar">
|
<span>审批记录</span>
|
|
<div style="float: right; margin-right: 20px;">
|
<el-button-group>
|
<!-- <el-button :disabled="isexport_pdf" @click="" :loading="export_loading">导出</el-button> -->
|
<el-button @click="onShowApproval">查看流程图</el-button>
|
<!-- <el-button type="default" @click="closeDialog">关 闭</el-button> -->
|
</el-button-group>
|
</div>
|
</div>
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table3"
|
:table-fields="tableFields3"
|
:table-data="tableData3"
|
:table-height="selectTabObj.tableHeight"
|
:isdraggableorder="false"
|
:is-pagination="false"
|
:table-field-click="selectTabObj.tablefieldClick"
|
>
|
</h-table>
|
</div>
|
</div>
|
</div>
|
<el-dialog :title="approvalTitle" :close-on-click-modal="false" :visible.sync="reasonvisible" height="50%">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="approveremark">
|
</el-input>
|
|
<h-form
|
ref="form3"
|
:form-attr="formAttr3"
|
:table-fields="formFields3"
|
:form-data="formData3"
|
:table-field-click="selectTabObj.formfieldClick"
|
>
|
</h-form>
|
|
<div slot="footer" class="dialog-footer" >
|
<el-button type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button type="primary" :loading="false" @click="saveReason">确 定</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog title="附件列表" :close-on-click-modal="false" :visible.sync="showFileList" width="30%" height="10%">
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields4"
|
:table-data="tableData4"
|
:table-height="250"
|
:is-pagination="false"
|
:table-field-click="selectTabObj.tablefieldClick"
|
>
|
</h-table>
|
</div>
|
</el-dialog>
|
|
<div class="el-dialog__footer" v-if="isedit || isrefuseedit">
|
<el-button size="small" type="default" @click="closeDialog">关 闭</el-button>
|
<!-- <el-button size="small" type="primary" @click="">保 存</el-button> -->
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
function initVue() {
|
new TabTableVue({
|
el: "#vbody",
|
data: {
|
title: "折让计算",
|
//Tab项设置
|
tabs_d: [],
|
filterAttr: {
|
labelwidth: "120px",
|
},
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 4,
|
labelwidth: "100px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600"
|
},
|
formAttr3: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formAttr_back: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 1,
|
labelwidth: "120px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "10px solid #c6c6c600"
|
},
|
formFields: [],
|
formFields_info: [],
|
default_formFields: [
|
{isshow: "T",field: "calculate_date",name: "日期范围",width: "100", type: "daterange", buttonname:"试算",},
|
],
|
default_formFields_info: [
|
// {isshow: "T",field: "name",name: "任务名称", type: "span"},
|
{isshow: "T",field: "amt",name: "折让汇总", type: "span", formatter: "formatter_money"},
|
{isshow: "T", field: "start_date",name: "开始时间", type: "span", formatter: "formatter_date"},
|
{isshow: "T", field: "end_date",name: "结束时间", type: "span", formatter: "formatter_date"},
|
{isshow: "T", field: "create_time",name: "创建时间", type: "span", formatter: "formatter_date"},
|
],
|
formFields_back: [
|
{isshow: "F", field: "undertake_info",name: "计提结果反馈", type: "textarea"},
|
{isshow: "F", field: "operate_info",name: "运营处理结果", type: "textarea", disabled: true},
|
],
|
formData: {},
|
formData_info: {},
|
formData_back: {},
|
|
//审批相关
|
default_tableFields3: [
|
{isshow: "T", field: "node_name", name: "当前节点", width: "150", type:"span", required: true},
|
{isshow: "T", field: "end_time", name: "申请/审批时间", width: "100", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
|
{isshow: "T", field: "pass", name: "审批情况", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "reason", name: "原因", width: "150", type: "span", required: true, isminwidth: true,},
|
{isshow: "T", field: "user_name", name: "申请/审批人", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "viewFile", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableFields3: [],
|
tableFields4: [
|
{isshow: "T", field: "attachment_name", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableData3: [],
|
tableData4: [],
|
|
formFields3: [],
|
formData3: {},
|
default_formFields3: [
|
{isshow: "T", field: "files2", name: "附件", type: "uploadfilelist"},
|
],
|
approvalTitle: '通过原因',
|
|
editTableButton: {
|
saveRow: {
|
isshow:true,
|
txt:"保存"
|
},
|
del: {
|
isshow:false,
|
txt:"保存"
|
},
|
|
},
|
|
d_tabs: {},
|
tabs: [],
|
tabsobj: {},
|
|
state: "",
|
isedit: false,
|
isrefuseedit: false,
|
undertake: false,
|
operate: false,
|
showBackBtn: false,
|
isapproval: false,
|
reasonvisible: false,
|
showFileList: false,
|
showApprovalInfo: false,
|
onlyRead: false,
|
emp_code: localStorage.getItem('emp_code'),
|
emp_name: localStorage.getItem('emp_name'),
|
|
approveremark: "",
|
|
plan_id: "",
|
plan_name: "",
|
|
popupFormData: {},
|
export_loading: false,
|
|
dataRequest: [
|
{
|
name: "md_province",
|
url: "rootjemin/data/getEntitySet",
|
paramsobj: {dataname: "md_division", filter: "level = '1'"},
|
isnotoption: false, //true:不是选项
|
},
|
{
|
name: "delivery_organization",
|
url: "root/data/getEntitySet",
|
paramsobj: {dataname: "delivery_organization", filter: ""},
|
isnotoption: false,
|
}
|
],
|
showSave: false,
|
buttons: {},
|
tabMapButton:{
|
page_id: {},
|
},
|
|
selectedrows: [],
|
showFilter: false,
|
filterBtnText: "使用筛选条件",
|
btnLoading: false,
|
dataname_reCal: "",
|
dataname_reCalOnce: ""
|
},
|
created() {
|
this.getButtonsByPage("A10-49");
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text;
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
this.formData_info = clone(this.popupParames.data);
|
if (this.formData.state_name) {
|
this.state = clone(this.formData.state_name);
|
if (this.state && this.state == "已反馈") {
|
this.onlyRead = true
|
}
|
}
|
if (this.formData.plan_id) {
|
this.getPageInfo(this.formData.plan_id)
|
}
|
}
|
|
if (this.popupParames.delta) {
|
if (this.popupParames.delta.plan_id) {
|
this.getPageInfo(this.popupParames.delta.plan_id)
|
|
this.plan_id = this.popupParames.delta.plan_id
|
this.plan_name = this.popupParames.delta.plan_name
|
}
|
if (this.popupParames.delta.undertake) {
|
this.undertake = true
|
}
|
if (this.popupParames.delta.operate) {
|
this.operate = true
|
}
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
|
this.tableData = [];
|
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 == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.isapproval = true;
|
this.onlyRead = true
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
|
if (!this.isedit) {
|
document.getElementById('tabAreaId').style.marginTop = "10px"
|
}
|
|
this.getBackInfo()
|
},
|
|
mounted() {
|
var me = this;
|
},
|
computed: {
|
formDataDate() {
|
return this.formData.calculate_date;
|
}
|
},
|
watch: {
|
formDataDate: function (newVal, oldVal) {
|
this.popupFormData = {}
|
this.filterTxt = "1<>1"
|
this.onQuery()
|
},
|
deep:true
|
},
|
methods:{
|
getButtonsByPage(pageid) {
|
var me = this;
|
var resource_type = "button";
|
|
var roleCode = Root.role.id;
|
var roleid_str = "";
|
roleCode.map(r=>{
|
if (!roleid_str) {
|
roleid_str = r;
|
}
|
else {
|
roleid_str += ";" + r;
|
}
|
});
|
|
var roleid_ = roleid_str.replace(/;/g,"','");
|
//按键
|
var params = {
|
dataname: "buttonByPage",//buttonByPage/buttonByPanel
|
isClientMode: false,
|
filter: "resource_page.id='" + pageid +
|
"' and EXISTS( SELECT 1 from resource_role r where r.type='" + resource_type +
|
"' and r.role_id in ('" + roleid_ + "') and r.resource_id = t.id)"
|
//userId: this.userId
|
}
|
Server.call("root/data/getEntitySet", params, function(result) {
|
console.log(result);
|
if (result && result.data.entityset) {
|
result.data.entityset.map(e=>{
|
if (!me.tabMapButton[e.page_id]) {
|
me.tabMapButton[e.page_id] = {};
|
}
|
me.tabMapButton[e.page_id][e.id_name]=e;
|
});
|
me.getButtonByTabName(pageid);
|
|
me.$forceUpdate();
|
}
|
});
|
},
|
getButtonByTabName(tab_name) {
|
var me = this;
|
me.buttons = {};
|
if (me.tabMapButton[tab_name]) {
|
me.buttons = me.tabMapButton[tab_name];
|
}
|
if (me.buttons.save) {
|
me.showSave = true
|
}
|
},
|
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]);
|
me.export_loading = true
|
uploadAxios.post(window.top.RootSetting.url_jemin + 'io/loadData?ioname=' + "load_" + me.tabs[0].dataname + '&token=' + Root.getToken(), formData).then(result => {
|
if(result.data.success) {
|
me.onQuery()
|
}
|
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:250px; width: auto; overflow: auto; line-height: 16px; letter-spacing: 1px;'>" + decodeURI(e.message)
|
else {
|
str += "</br></br> " + decodeURI(e.message)
|
}
|
})
|
|
if(result.data.success) {
|
Root.message({
|
dangerouslyUseHTMLString: true,
|
type: 'success',
|
message: str
|
});
|
}
|
else {
|
me.$alert(str, '提示', {
|
dangerouslyUseHTMLString: true
|
});
|
}
|
}
|
//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
|
},
|
exportList() {
|
exportList(this.tabs[0].dataname, this.getFilterData())
|
},
|
tempBtnChangeStatus() {
|
let me = this;
|
Root.confirm('确定都已反馈完成吗?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let pa = {
|
dataName: "fee_task",
|
id: me.formData.id,
|
}
|
Server.call("rootjemin/result/changeStateToFeedbacked", pa, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '操作成功'
|
});
|
me.saveAfter();
|
}
|
})
|
}).catch(() => {
|
|
});
|
},
|
cerDiscount() {
|
let me = this;
|
let pa = {
|
dataName: "fee_task",
|
id: this.formData.id,
|
}
|
me.btnLoading = true
|
Server.call("rootjemin/result/changeStateToConfirmed", pa, function(result) {
|
me.btnLoading = false
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '确认成功'
|
});
|
me.saveAfter();
|
}
|
}, function(error) {
|
me.btnLoading = false
|
Root.message({
|
type: 'error',
|
message: '确认失败,请稍后重试'
|
});
|
})
|
},
|
submit() {
|
let me = this;
|
let pa = {
|
dataName: "fee_task",
|
id: this.formData.id,
|
flow_id: this.formData.flow_id || "",
|
business_type: "feeFinished"
|
}
|
me.btnLoading = true
|
Server.call("rootjemin/data/Commit", pa, function(result) {
|
me.btnLoading = false
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
window.top.vue.setMenuBadgeByMenuid('09101', 'feeFinished');
|
me.saveAfter();
|
}
|
}, function(result) {
|
me.btnLoading = false
|
if (result.messages && result.messages.list && result.messages.list.length > 0){
|
let str = ''
|
result.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:200px; width: 340px; overflow: auto;'>" + e.message
|
else {
|
str += "</br></br> " + e.message
|
}
|
})
|
|
Root.message({
|
dangerouslyUseHTMLString: true,
|
type: 'error',
|
message: str
|
});
|
}
|
});
|
},
|
getBackInfo() {
|
let me = this
|
|
let param = {
|
dataName: "fee_task_check_emp",
|
filter: "task_id = '" + this.formData.id + "'"
|
}
|
Server.call("rootjemin/data/getEntitySet", param, function(result) {
|
if (result.success) {
|
if (result.data.entityset) {
|
let data = result.data.entityset
|
if (data.length > 0) {
|
let formFields_back = clone(me.formFields_back)
|
if (me.undertake) {
|
formFields_back[0]['isshow'] = "T"
|
|
let undertakeObj = data.filter(x => x.check_emp_code == me.emp_code)[0]
|
|
me.formData_back = undertakeObj
|
if (me.formData_back.undertake_info) {
|
formFields_back[0]['disabled'] = true
|
}
|
else {
|
me.showBackBtn = true
|
}
|
if (me.formData_back.operate_info) {
|
formFields_back[1]['isshow'] = "T"
|
}
|
}
|
// else if (me.operate && me.state == "已反馈") {
|
// formFields_back[1]['isshow'] = "T"
|
// }
|
|
me.formFields_back = formFields_back
|
}
|
}
|
}
|
})
|
},
|
saveBackInfo() {
|
let me = this
|
|
if (!me.formData_back.undertake_info) {
|
Root.message({
|
type: 'warning',
|
message: '请填写反馈结果'
|
})
|
return
|
}
|
|
let param = {
|
dataName: "fee_task_check_emp",
|
data: {
|
fee_task_check_emp: {}
|
}
|
}
|
|
if (me.undertake) {
|
param.data.fee_task_check_emp['id'] = me.formData_back.id,
|
param.data.fee_task_check_emp['undertake_info'] = me.formData_back.undertake_info
|
}
|
else if (me.operate) {
|
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '反馈成功'
|
})
|
|
me.saveAfter()
|
}
|
});
|
},
|
getPageInfo(plan_id) {
|
let me = this
|
|
let param = {
|
dataName: "v_fee_book_info",
|
filter: "planid = '" + plan_id + "'"
|
}
|
Server.call("rootjemin/data/getEntitySet", param, function(result) {
|
if (result.success) {
|
if (result.data.entityset) {
|
result.data.entityset.map(s => {
|
let list = {code: "matched", name: "已匹配", dataname: s.plan_object, filterTxt: "", orderby: "update_time desc",
|
tableData: [],
|
tableFields: [],
|
filterFields: [],
|
dataurl: "rootjemin/data/getEntitySet"}
|
let list1 = {code: s.book_code, name: s.band_name, dataname: s.un_linked_data_object, filterTxt: "", orderby: "update_time desc",
|
tableData: [],
|
tableFields: [],
|
filterFields: [],
|
dataurl: "rootjemin/data/getEntitySet"}
|
|
if (me.formData.id) {
|
list.filterTxt = "task_id = '" + me.formData.id + "'"
|
list1.filterTxt = "task_id = '" + me.formData.id + "'"
|
}
|
else {
|
me.filterTxt = "1<>1"
|
}
|
if (me.undertake) {
|
list.filterTxt += " and _check_emp_name like '%" + me.emp_name + "%'"
|
}
|
|
if (me.tabs_d.length === 0) {
|
me.tabs_d.push(list)
|
me.d_tabs['matched'] = true
|
}
|
|
me.tabs_d.push(list1)
|
me.d_tabs[s.book_code] = true
|
})
|
|
me.ctabs_r = me.d_tabs;
|
|
var tabsarr = [];
|
me.tabs_d.map(e=>{
|
if(me.ctabs_r[e.code]){
|
tabsarr.push(e)
|
}
|
})
|
me.tabs = tabsarr;
|
|
if(me.tabs.length>0){
|
me.activeTabName = me.tabs[0].code;
|
}
|
|
|
if (me.dataRequest && me.dataRequest.length) {
|
var result = {};
|
me.loadRequestData(me.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
//初始化Tabs
|
me.initTabsPage(function() {
|
//获取数据
|
me.initData();
|
});
|
});
|
}
|
else {
|
//初始化Tabs
|
me.initTabsPage(function() {
|
//获取数据
|
me.initData();
|
});
|
}
|
|
me.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
}
|
}
|
});
|
},
|
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
editData(scope) {
|
let me = this
|
let row = scope.row
|
|
let param = {
|
dataName: me.selectTabObj.dataname,
|
data: {
|
id: row.id,
|
task_id: this.formData.id,
|
_d_total_amt: row._d_total_amt || 0,
|
_diff_amt: row._diff_amt || 0,
|
_d_disocunt_total_amt: row._d_disocunt_total_amt || 0,
|
_d_compliance_deduction: row._d_compliance_deduction || 0,
|
_d_deduction_amt: row._d_deduction_amt || 0,
|
_d_discount_actual: row._d_discount_actual || 0,
|
_dc_diff: row._dc_diff || 0,
|
_scan_diff: row._scan_diff || 0,
|
_actual_amount: row._actual_amount || 0,
|
check_emp_list: []
|
}
|
}
|
|
if (row.check_emp_list) {
|
param.data.check_emp_list = row.check_emp_list
|
}
|
|
Server.call("rootjemin/data/SaveResult", param, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
})
|
}
|
});
|
},
|
|
onhandleClick() {
|
this.initData();
|
},
|
|
onInitFilter() {
|
//清空
|
this.selectTabObj.filterObj = {};
|
this.selectTabObj.selectedrow = {};
|
this.initData();
|
},
|
|
onQuery() {
|
let me = this
|
if (me.popupFormData && me.popupFormData.id) {
|
me.filterTxt = "task_id = '" + me.popupFormData.id + "'"
|
}
|
me.export_loading = false
|
this.initData();
|
},
|
|
initData() {
|
var me = this;
|
this.selectTabObj.pagesize = 50
|
this.doQueryByTab(function(result, callback) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta[me.selectTabObj.dataname] && result.meta[me.selectTabObj.dataname].fields) {
|
var metas = clone(result.meta[me.selectTabObj.dataname].fields);
|
var filterFields_ = [];
|
var tableFields_ = [];
|
|
metas.map(f=>{
|
f.isshow = "T";
|
|
if (f.isfilter) {
|
if (f.field == '_province_name' || f.field == '_seller_province_name') {
|
f.isfilterable = true
|
me.dataRequestObj.md_province.data.entityset.map(e => {
|
e.value = e.name
|
e.code = e.name
|
})
|
f.options = me.dataRequestObj.md_province.data.entityset
|
}
|
if (f.field == '_seller_province_code') {
|
f.isfilterable = true
|
me.dataRequestObj.md_province.data.entityset.map(e => {
|
e.value = e.name
|
e.code = e.code
|
})
|
f.options = me.dataRequestObj.md_province.data.entityset
|
}
|
if (f.field == '_delivery_part_name') {
|
f.isfilterable = true
|
me.dataRequestObj.delivery_organization.data.entityset.map(e => {
|
e.value = e.name
|
e.code = e.name
|
})
|
f.options = me.dataRequestObj.delivery_organization.data.entityset
|
}
|
if (f.field == '_month') {
|
let options = [
|
{value: "1", code: "1"},
|
{value: "2", code: "2"},
|
{value: "3", code: "3"},
|
{value: "4", code: "4"},
|
{value: "5", code: "5"},
|
{value: "6", code: "6"},
|
{value: "7", code: "7"},
|
{value: "8", code: "8"},
|
{value: "9", code: "9"},
|
{value: "10", code: "10"},
|
{value: "11", code: "11"},
|
{value: "12", code: "12"}
|
]
|
f.options = options
|
}
|
|
filterFields_.push(clone(f));
|
}
|
else {
|
var filter_f = clone(f);
|
filter_f.isshow = "F";
|
filterFields_.push(filter_f);
|
}
|
|
tableFields_.push(clone(f));
|
})
|
if (!me.selectTabObj.filterFields || (me.selectTabObj.filterFields && me.selectTabObj.filterFields.length == 0)) {
|
me.selectTabObj.filterFields = clone(filterFields_);
|
me.selectTabObj.tableFields = clone(tableFields_);
|
|
me.formFields = clone(me.default_formFields)
|
me.formFields_info = clone(me.default_formFields_info)
|
me.tableFields3 = clone(me.default_tableFields3);
|
me.formFields3 = clone(me.default_formFields3);
|
|
//字段数组转字段obj
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
|
me.selectTabObj.isEditTableData = false
|
if (me.selectTabObj.code == 'matched' && me.state == '待确认') {/* && (me.formData.plan_id == 'P001' || me.formData.plan_id == 'P003' || me.formData.plan_id == 'P004' || me.formData.plan_id == 'P007' || me.formData.plan_id == 'P005' || me.formData.plan_id == 'P006') */
|
me.selectTabObj.editTableButton = me.editTableButton
|
me.selectTabObj.isEditTableData = true
|
}
|
if (me.selectTabObj.code == 'matched' && me.state == '已确认') {
|
me.editTableButton.del.isshow = true
|
me.editTableButton.saveRow.isshow = false
|
me.selectTabObj.editTableButton = me.editTableButton
|
me.selectTabObj.isEditTableData = true
|
}
|
|
if (me.formData.flow_id) {
|
me.showApprovalInfo = true
|
me.getApprovalHisInfo(me.formData.flow_id || "")
|
}
|
|
if (callback) {
|
callback();
|
}
|
});
|
},
|
|
tableFieldClick() {
|
var me = this;
|
var tablefieldClick = {};
|
var formfieldClick = {};
|
//表格字段事件设置
|
tablefieldClick = {
|
viewFile: {
|
val: {
|
onclick: function(obj) {
|
me.showFileList = true
|
me.getFileList(obj.row.attachment)
|
},
|
}
|
},
|
attachment_name: {
|
val: {
|
onclick: function(obj) {
|
me.showFileImgByFileId({file_id: obj.row.attachment, file_name: obj.row.attachment_name}, true);
|
},
|
}
|
},
|
status: {//字段事件设置
|
val: {//有值时的点击事件
|
onclick: function(obj) {//数据值点击事件
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "500px",
|
icon: "icon-product",
|
text: "",
|
id: obj.row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "../approval_new/ApprovalList_page_new.html?flow_id=" + obj.row.flow_id,
|
data: obj.row,
|
delta: {},
|
sceneCode: "change",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
},
|
},
|
_assume_emp_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择承担主体",
|
id: "popup_actual_op_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_actual_op_list.html",
|
data: {},
|
delta: {isSelects: true},
|
dataname: "vemployee",
|
filter: "1 = 1",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData = clone(me.selectTabObj.tableData)
|
|
let str_name = ""
|
let str_amt = ""
|
let arr = []
|
data.map((e, index) => {
|
if (!str_name) {
|
str_name = e.md_description
|
}
|
else {
|
str_name += ";" + e.md_description
|
}
|
|
if (!str_amt) {
|
str_amt = e.remark
|
}
|
else {
|
str_amt += ";" + e.remark
|
}
|
e
|
let list = {
|
_assume_emp_code: e.md_code,
|
_assume_emp_name: e.md_description,
|
remark: e.remark || 0
|
}
|
arr.push(list)
|
})
|
tableData[obj.$index]['_assume_emp_name'] = str_name;
|
tableData[obj.$index]['_check_emp_amt'] = str_amt
|
tableData[obj.$index]['check_emp_list'] = arr
|
|
me.selectTabObj.tableData = tableData
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
_check_emp_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择分发确认人",
|
id: "popup_actual_op_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_actual_op_list.html",
|
data: {},
|
delta: {},
|
dataname: "vemployee",
|
filter: "1 = 1",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData = clone(me.selectTabObj.tableData)
|
|
tableData[obj.$index]['_check_emp_name'] = data.row.md_description;
|
tableData[obj.$index]['_check_emp_code'] = data.row.md_code;
|
|
me.selectTabObj.tableData = tableData
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
_diff_amt: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.selectTabObj.tableData)
|
if (tableData[obj.$index]['_d_total_amt']) {
|
tableData[obj.$index]['_final_amt'] = parseFloat((parseFloat(obj.row._d_total_amt) - parseFloat(obj.row._diff_amt)).toFixed(10))
|
tableData[obj.$index]['_d_disocunt_total_amt'] = parseFloat((parseFloat(obj.row._d_total_amt) - parseFloat(obj.row._diff_amt)).toFixed(10))
|
}
|
|
me.selectTabObj.tableData = tableData
|
}
|
},
|
},
|
_d_compliance_deduction: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.selectTabObj.tableData)
|
tableData[obj.$index]['_d_deduction_amt'] = parseFloat((parseFloat(obj.row._d_task_deduction) + parseFloat(obj.row._d_accept_deduction) + parseFloat(obj.row._d_compliance_deduction)).toFixed(10))
|
tableData[obj.$index]['_d_discount_actual'] = parseFloat((parseFloat(obj.row._d_discount_annual) - tableData[obj.$index]['_d_deduction_amt']).toFixed(10))
|
me.selectTabObj.tableData = tableData
|
}
|
},
|
},
|
_dc_diff: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.selectTabObj.tableData)
|
tableData[obj.$index]['_actual_amount'] = parseFloat((parseFloat(obj.row._amount) - parseFloat(obj.row._task_diff) - parseFloat(obj.row._dc_diff) - parseFloat(obj.row._scan_diff || 0)).toFixed(10))
|
me.selectTabObj.tableData = tableData
|
}
|
},
|
},
|
_scan_diff: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.selectTabObj.tableData)
|
tableData[obj.$index]['_actual_amount'] = parseFloat((parseFloat(obj.row._amount) - parseFloat(obj.row._task_diff) - parseFloat(obj.row._dc_diff || 0) - parseFloat(obj.row._scan_diff)).toFixed(10))
|
me.selectTabObj.tableData = tableData
|
}
|
},
|
},
|
};
|
|
formfieldClick = {
|
calculate_date: {
|
button: {
|
onclick: function(obj) {//按键点击事件
|
if (!me.formData.calculate_date || me.formData.calculate_date.length == 0) {
|
Root.message({
|
type: 'warning',
|
message: '请选择日期范围'
|
})
|
|
return
|
}
|
if (JSON.stringify(me.popupFormData) == "{}") {
|
let param = {
|
dataName: "fee_task",
|
}
|
Server.call("rootjemin/data/newEntity", param, function(result) {
|
if (result.success) {
|
me.popupFormData = result.data.fee_task
|
me.reCalculate();
|
}
|
});
|
}
|
else {
|
me.reCalculate();
|
}
|
}
|
},
|
},
|
attachment_name: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "attachment_name";
|
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);
|
}
|
}
|
}
|
},
|
files2: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "files2";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj, true);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname, true);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj, true);
|
}
|
}
|
}
|
},
|
}
|
|
this.selectTabObj.formfieldClick = formfieldClick;
|
this.selectTabObj.tablefieldClick = tablefieldClick;
|
},
|
|
getFileList(parentFileId) {
|
let me = this
|
|
let param = {
|
dataName: "sys_file_mapping",
|
filter: "parent_id = '" + parentFileId + "'"
|
}
|
Server.call("rootjemin/data/getEntitySet", param, function(result) {
|
if (result.success) {
|
let fileList = result.data.entityset || []
|
fileList.map(e => {
|
e.attachment_name = e.file_name
|
e.attachment = e.file_id
|
})
|
|
me.tableData4 = fileList
|
}
|
});
|
},
|
getApprovalHisInfo(flowId) {
|
let me = this
|
|
if (!flowId) {
|
return
|
}
|
|
let param = {
|
flowId: flowId
|
}
|
|
Server.call("jeminact/root/order/getHistoryTask", param, function(result) {
|
if (result.success) {
|
let tableData = []
|
tableData = result.data.entityset
|
tableData.map(s => {
|
s.pass = !s.pass && s.pass !== 0? '' : s.pass == '1'? '同意' : '拒绝'
|
s.user_name = s.user_name? s.user_name : '已完成'
|
|
s.viewFile = s.attachment? "查看附件" : ''
|
})
|
me.tableData3 = tableData
|
}
|
});
|
},
|
onShowApproval() {
|
var me = this;
|
let param = {
|
isClientMode: false,
|
flowId: this.formData.flow_id
|
}
|
|
var config = {
|
hide_close: true,
|
width: "85vw",
|
height: "95vh",
|
url: "../approval_new/Approval_flowid_new.html",
|
data: {},
|
delta: {
|
flow_id: this.formData.flow_id,
|
title: ''
|
},
|
};
|
|
this.doPopupByPublic(config);
|
},
|
|
approvalOp(op) {
|
this.reasonvisible = true
|
this.approveremark = ""
|
this.formData3.files2 = null
|
if (op) {
|
this.approvalTitle = '通过原因'
|
this.pass = true
|
}
|
else {
|
this.approvalTitle = '拒绝原因'
|
this.pass = false
|
}
|
},
|
|
saveReason() {
|
let me = this
|
|
if (!this.pass && !this.approveremark) {
|
Root.message({
|
type: 'warning',
|
message: '请填写拒绝原因'
|
})
|
|
return
|
}
|
|
if (this.formData3.files2 && this.formData3.files2.length > 0) {
|
let sys_file_mapping = []
|
let parent_id = uuid_short()
|
this.formData3.files2.map(e => {
|
let list = {
|
parent_id: parent_id,
|
type: "fee_task",
|
file_id: e.id,
|
file_name: e.file_name
|
}
|
sys_file_mapping.push(list)
|
})
|
let param = {
|
dataName: 'sys_file_mapping',
|
data: {
|
sys_file_mapping: sys_file_mapping
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
if (result.success) {
|
me.doSaveReason(parent_id)
|
}
|
});
|
}
|
else {
|
me.doSaveReason()
|
}
|
},
|
|
doSaveReason(parent_id) {
|
let me = this
|
|
let param = {
|
businessId: this.formData.id,
|
flowId: this.formData.flow_id,
|
variableMap: {
|
dataName: "fee_task", //me.tabs[0].dataname
|
reason: this.approveremark,
|
flowId: this.formData.flow_id,
|
attachment: parent_id?parent_id : ""
|
},
|
pass: this.pass
|
}
|
Server.call("jeminact/rootact/act/deal/" + this.formData.flow_id, param, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
})
|
window.top.vue.setMenuBadgeByMenuid('09101', 'feeFinished');
|
me.saveAfter()
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: result.error
|
})
|
}
|
});
|
},
|
|
onPopupByUploadFile(filenamefield, fileidfield,dataname, isApprovalReason) {
|
var me = this;
|
let url = isApprovalReason? "../tool_new/popup_uploadFile_new.html" : "../tool/popup_uploadFile.html"
|
var analysistype_ = "";
|
var formData_ = isApprovalReason? clone(me.formData3) : clone(me.formData2);
|
var delta_ = {filetypelist: []}//".png", ".jpg", ".pdf"
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: url,
|
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_);
|
|
if (isApprovalReason) {
|
me.formData3 = formData_;
|
}
|
else {
|
me.formData2 = formData_;
|
}
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId(filenamefield, fileobj, isApprovalReason){
|
var me = this;
|
Root.confirm('确定删除附件【' + fileobj.file_name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (isApprovalReason) {
|
me.formData3[filenamefield].remove(fileobj);
|
}
|
else {
|
me.formData2[filenamefield].remove(fileobj);
|
}
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}).catch(() => {
|
|
});
|
},
|
|
showFileImgByFileId(fileobj, isApprovalReason) {
|
let me = this;
|
var file_id = fileobj.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: "../tool/popup_file_pdf.html",
|
data: row,
|
delta: {},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
|
}
|
else {//只可下载,不可预览
|
if (isApprovalReason) {
|
handleDownloadNew(fileid);
|
}
|
else {
|
handleDownload(fileid);
|
}
|
}
|
}
|
},
|
|
filterShow() {
|
this.showFilter = this.showFilter? false : true
|
//this.filterBtnText = this.showFilter? "隐藏筛选条件" : "使用筛选条件"
|
this.tableDataAfter()
|
},
|
|
distribute() {
|
let me = this
|
let param = {
|
dataName: this.selectTabObj.dataname,
|
task_id: this.formData.id
|
}
|
me.btnLoading = true
|
Server.call("rootjemin/data/Distribute", param, function(result) {
|
me.btnLoading = false
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '分发成功'
|
})
|
me.saveAfter();
|
}
|
}, function(error) {
|
me.btnLoading = false
|
Root.message({
|
type: 'error',
|
message: '分发失败,请稍后重试'
|
})
|
});
|
},
|
distributeNew(role) {
|
let me = this
|
|
if (this.selectedrows.length == 0) {
|
Root.message({
|
type: 'warning',
|
message: '请勾选需要分发明细'
|
})
|
return;
|
}
|
let idArr = []
|
this.selectedrows.map(e => {
|
idArr.push(e.id)
|
})
|
|
let param = {
|
dataName: this.selectTabObj.dataname,
|
type: role,
|
id: idArr
|
}
|
me.btnLoading = true
|
Server.call("rootjemin/result/setDistributePerson", param, function(result) {
|
me.btnLoading = false
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '分发设置成功'
|
})
|
me.selectedrows = []
|
|
me.onQuery()
|
}
|
}, function (error) {
|
me.btnLoading = false
|
Root.message({
|
type: 'error',
|
message: '分发设置失败,请稍后重试'
|
})
|
});
|
},
|
reCalculate(remark) {
|
var me = this;
|
|
let again = false
|
if (remark && remark == 'again') {
|
again = true
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "计算进度",
|
id: "popup_recalculate",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/discount/popup_recalculate.html",
|
data: me.popupFormData? me.popupFormData : "",
|
delta: {again: again, id: me.formData.id, calculate_date: me.formData.calculate_date, plan_id: me.plan_id, plan_name: me.plan_name},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (me.popupFormData && me.popupFormData.id) {
|
me.filterTxt = "task_id = '" + me.popupFormData.id + "'"
|
}
|
if (callback) {
|
callback();
|
}
|
},
|
closecallback: function() {
|
if (me.popupFormData && me.popupFormData.id) {
|
me.filterTxt = "task_id = '" + me.popupFormData.id + "'"
|
}
|
},
|
};
|
me.doPopupByPublic(config);
|
},
|
getReply() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "反馈详情",
|
id: "popup_replies",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/discount/popup_replies.html",
|
data: "",
|
delta: {onlyRead: me.onlyRead},
|
filter: " task_id = '" + me.formData.id + "' and undertake_info <> ''",
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
// 添加计算结果
|
addResult() {
|
let me = this;
|
let params = {
|
dataname: "v_fee_book_info",
|
filter: "planid = '" + this.formData.plan_id + "'"
|
}
|
|
Server.call("rootjemin/data/getEntitySet", params, function(result) {
|
if (result.success && result.data.entityset) {
|
me.dataname_reCal = result.data.entityset[0].plan_object
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "添加计算结果",
|
id: "popup_add_result",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/discount/popup_add_result.html",
|
data: "",
|
dataname: me.dataname_reCal,
|
delta: {task_id: me.formData.id},
|
filter: "",
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData_ = clone(me.selectTabObj.tableData)
|
let idList = [];
|
data.map(e => {
|
if (e.id){
|
idList.push(e)
|
}
|
})
|
let params = {
|
dataname: me.dataname_reCal,
|
task_id: me.formData.id,
|
id: idList,
|
}
|
Server.call("rootjemin/addition/workingResultAdd", params, function(result){
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '添加成功'
|
});
|
me.onQuery()
|
}
|
},function(result){
|
if (result.messages && result.messages.list && result.messages.list.length > 0){
|
let str = ''
|
result.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:250px; width: auto; overflow: auto; line-height: 16px; letter-spacing: 1px; color: #e10c0c;'>" + e.message
|
else {
|
str += "</br></br> " + e.message
|
}
|
})
|
|
me.$alert(str, '提示', {
|
dangerouslyUseHTMLString: true
|
});
|
|
}
|
})
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
});
|
},
|
|
// 一键添加重算结果
|
addResultOnce(){
|
let me = this;
|
let params = {
|
dataname: "v_fee_book_info",
|
filter: "planid = '" + this.formData.plan_id + "'"
|
}
|
|
Server.call("rootjemin/data/getEntitySet", params, function(result) {
|
if (result.success && result.data.entityset) {
|
me.dataname_reCalOnce = result.data.entityset[0].plan_object
|
}
|
let pa = {
|
dataname: me.dataname_reCalOnce,
|
task_id: me.formData.id,
|
}
|
|
Server.call("rootjemin/addition/workingResultAddDefault", pa, function(result){
|
me.btnLoading = false
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '添加成功'
|
});
|
me.onQuery()
|
}
|
},function(result){
|
me.btnLoading = false
|
if (result.messages && result.messages.list && result.messages.list.length > 0){
|
let str = ''
|
result.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:250px; width: auto; overflow: auto; line-height: 16px; letter-spacing: 1px; color: #e10c0c;'>" + e.message
|
else {
|
str += "</br></br> " + e.message
|
}
|
})
|
|
me.$alert(str, '提示', {
|
dangerouslyUseHTMLString: true
|
});
|
|
}
|
})
|
});
|
},
|
|
delData(scope) {
|
let me = this
|
if (!(scope.row.type == 'red' || scope.row.type == 'recal')) {
|
Root.message({
|
type: 'error',
|
message: '该条数据不是添加的重算结果,不可删除!'
|
})
|
}
|
else {
|
Root.confirm('确定删除吗?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let params = {
|
dataname: "v_fee_book_info",
|
filter: "planid = '" + this.formData.plan_id + "'"
|
}
|
Server.call("rootjemin/data/getEntitySet", params, function(result){
|
if (result.success && result.data.entityset){
|
me.dataname_reCal = result.data.entityset[0].plan_object
|
}
|
let param = {
|
dataName: me.dataname_reCal,
|
id: scope.row.id,
|
}
|
|
Server.call("rootjemin/addition/workingResultDelete", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.onQuery()
|
}
|
},function(result) {
|
if (result.messages && result.messages.list && result.messages.list.length > 0){
|
let str = ''
|
result.messages.list.map(e => {
|
if (!str) str += "<div style='max-height:250px; width: auto; overflow: auto; line-height: 16px; letter-spacing: 1px; color: #e10c0c;'>" + e.message
|
else {
|
str += "</br></br> " + e.message
|
}
|
})
|
|
me.$alert(str, '提示', {
|
dangerouslyUseHTMLString: true
|
});
|
}
|
});
|
})
|
}).catch(() => {
|
});
|
}
|
},
|
|
state_click(row){
|
|
},
|
|
endData(){
|
var me = this;
|
var row = me.selectTabObj.selectedrow;
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "二次议价终止",
|
id: "terminal_policy_info",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/policy/terminal_policy_info.html",
|
data: row,
|
delta: {},
|
sceneCode: "end",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
onAddData() {
|
var me = this;
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "二次议价新增",
|
id: "terminal_policy" + "add",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/policy/terminal_policy_info.html",
|
data: {},
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
showInfo(obj) {
|
var me = this;
|
|
var config = {
|
totab: true, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "商业政策信息查看",
|
id: "commercial_policy_info" + "browse" + obj.row.id,//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/policy/commercial_policy_info.html",
|
data: obj.row,
|
delta: {},
|
sceneCode: "browse",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
me.doPopupByPublic(config);
|
},
|
|
onClickRowCard(row) {
|
this.selectTabObj.selectedrow = clone(row);
|
this.$forceUpdate();
|
|
},
|
selectionChange(obj){
|
var me = this;
|
// me.selectedrows = obj;
|
},
|
saveShoppingcart(list) {
|
var me = this;
|
// me.selectedrows = list;
|
},
|
}
|
});
|
};
|
initVue();
|
</script>
|
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
.el-tabs__nav-scroll {
|
overflow: hidden;
|
position: relative;
|
padding-left: 20px;
|
}
|
|
.h_form_filter {
|
padding-top: 1px;
|
}
|
|
.h_table_card_title{
|
padding: 0px;
|
margin: -10px 0px;
|
}
|
|
/* .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;
|
margin-bottom: 5px;
|
}
|
|
.el-card {
|
border-radius: 8px;
|
}
|
|
.el-tabs--top {
|
background-color: #F5F7FA;
|
}
|
|
/* .el-table--scrollable-y .el-table__body-wrapper {
|
overflow-y: auto;
|
height: auto !important;
|
}
|
.h_table .el-table {
|
border-left: 1px solid #EBEEF5;
|
border-right: 1px solid #EBEEF5;
|
height: auto !important;
|
} */
|
/* .el-button+.el-button {
|
margin-left: 0px;
|
} */
|
/* .el-table__header-wrapper{
|
position: relative;
|
width: 100%;
|
z-index: 999;
|
}
|
// 监听到滚动条开始滚动后的样式
|
.box-active{
|
position: fixed;
|
top: 0;
|
} */
|
</style>
|
</body>
|
</html>
|