<!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>上海GPO政策编辑</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>
|
|
<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 class="el-dialog__footer" v-if="isapproval || isbrowse">
|
<el-button size="small" v-if="isapproval" type="primary" @click="exportList">导 出</el-button>
|
<el-button :disabled="true" size="small" v-if="isbrowse" type="primary" @click="">下 载</el-button>
|
<el-button-group>
|
<el-button size="small" v-if="isapproval" type="success" @click="approvalOp(true)">批 准</el-button>
|
<el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">退 回</el-button>
|
<el-button size="small" v-if="isapproval" type="danger" @click="approvalOp(false)">拒 绝</el-button>
|
<el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">转 发</el-button>
|
<el-button :disabled="true" size="small" v-if="isapproval" type="primary" @click="">转 办</el-button>
|
</el-button-group>
|
<el-button :disabled="true" size="small" type="primary" v-if="isapproval" @click="">征询意见</el-button>
|
<el-button size="small" type="primary" @click="toPDFPage">打 印</el-button>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
|
<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
|
<div class="el-dialog__body">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
|
<div class="h_dialog__body" style=" padding-top: 20px;">
|
<!-- <el-alert
|
v-if="!isend && !ischange"
|
title="直营政策-OTC经销: 非金水宝系列预付款折让小计比率不超过4%, 账期不超过3%"
|
description="折让小计比率为1,118.182%"
|
type="warning"
|
show-icon
|
>
|
</el-alert> -->
|
<el-alert
|
v-for="(item, key) in alertMessage"
|
:title="item"
|
type="error"
|
>
|
</el-alert>
|
|
<div style="display: flex;">
|
<div v-if="showChangeInfo" style="margin-right: auto;">
|
<span>变更前</span>
|
</div>
|
<div v-if="isedit || isrefuseedit" style="margin-left: auto;">
|
<!-- 工具栏 -->
|
<el-button-group style="display: flex;">
|
<el-button v-if="!isend && !ischange && !isChangeEdit && !isEndEdit" @click="addTableData">新增明细</el-button>
|
<el-button v-if="isend || ischange || isChangeEdit || isEndEdit" @click="newEndDeatil">新增明细</el-button>
|
<!-- <el-button v-if="ischange" @click="changeTableData">新增明细</el-button> -->
|
<el-button v-if="formData.trans_type=='new'" @click="moduleDownload">模板下载</el-button>
|
<input type="file" id="btn_file" style="display: none;" @change="getFile($event)" />
|
<el-button v-if="formData.trans_type=='new'" @click="fileUpload()">导 入</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="opTableData"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="tableData.length ? true : false"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
</div>
|
|
<div class="h_dialog__body" v-if="showChangeInfo" style="padding-top: 30px;;">
|
<div v-if="showChangeInfo" style="margin-right: auto;">
|
<span>变更后</span>
|
</div>
|
|
<h-table
|
v-if="isRefresh && tableFields.length"
|
ref="table2"
|
:table-fields="tableFields2"
|
:table-data="tableData2"
|
:table-data-old="tableDataOldObj"
|
:is-old-contrast="true"
|
:is-edit-table-data="isedit || isrefuseedit"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="tableData.length ? true : false"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
</div>
|
|
<div class="h_dialog__body" style="padding-top: 30px;">
|
<h-form
|
ref="form2"
|
:form-attr="formAttr2"
|
:table-fields="formFields2"
|
:form-data="formData2"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
</div>
|
|
<div v-if="showApprovalInfo" style="height: 150px; 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="tableHeight"
|
:isdraggableorder="false"
|
:is-pagination="false"
|
:table-field-click="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="formfieldClick"
|
>
|
</h-form>
|
|
<div slot="footer" class="dialog-footer" >
|
<el-button type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button type="primary" :loading="loading_pass" @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="tablefieldClick"
|
>
|
</h-table>
|
</div>
|
</el-dialog>
|
</div>
|
</div>
|
<div class="el-dialog__footer" v-if="!isapproval && !isbrowse">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="(isedit || isrefuseedit)" :loading="btnLoading" type="primary" @click="saveRowTable">保 存</el-button>
|
<el-button size="small" v-if="isedit" type="success" :loading="btnLoading" @click="submitRowTable">提 交</el-button>
|
<!-- <el-button size="small" v-if="isend" type="primary" @click="">提交申请</el-button> -->
|
<el-button size="small" v-if="isrefuseedit" 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: "agm_record_apply_gpo",
|
table_dataname: "agm_record_gpo",
|
title: "表单+明细模板1",
|
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields: [
|
{isshow: "T", field: "process_no", name: "流程号", type:"span", colspan: 2, required: true},
|
{isshow: "T", field: "apply_date", name: "申请日期", type:"span", required: true},
|
{isshow: "T", field: "employee_code", name: "员工编号", type:"span", 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: "type", name: "流程类型", type:"select", required: true},
|
{isshow: "T", field: "remark", name: "备注", type:"textarea", required: false, colspan: 2},
|
],
|
formFields: [],
|
newformData: {},
|
formData: {},
|
|
dataRequest: [
|
{
|
name: "md_province",
|
url: "rootjemin/data/getEntitySet",
|
paramsobj: {dataname: "md_division", filter: "level = '1'"},
|
isnotoption: false, //true:不是选项
|
label: "name",
|
code: "code"
|
}
|
],
|
|
editTableButton: {
|
del: {
|
isshow: true,
|
txt: "删除"
|
}
|
},
|
|
formAttr2: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
|
formAttr3: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formFields3: [],
|
formData3: {},
|
|
default_formFields2: [
|
{isshow: "T", field: "attachment_name", name: "附件", type: "uploadfilelist"},
|
],
|
default_formFields3: [
|
{isshow: "T", field: "files2", name: "附件", type: "uploadfilelist"},
|
],
|
formFields2: [],
|
|
formData2: {},
|
|
|
default_tableFields: [
|
// {isshow: "T",field: "begin_date", name: "开始时间", width: "150", type:"date", formatter: "formatter_date", required: true},
|
// {isshow: "T",field: "end_date", name: "结束时间", width: "150", type:"date", formatter: "formatter_date", required: true},
|
// {isshow: "T", field: "customer_code", name: "商业编码", width: "150", type: "select", required: true},
|
// {isshow: "T", field: "customer_name", name: "商业名称", width: "200", type:"span", required: true},
|
// {isshow: "T", field: "customer_person", name: "商业操作人", width: "100", type:"input", required: true},
|
// {isshow: "T", field: "product_code", name: "品种编码", width: "150", type:"select", required: true},
|
// {isshow: "T", field: "product_name", name: "品名", width: "200", type: "span", align: "left", required: true},
|
// {isshow: "T", field: "spec", name: "规格", width: "100", type: "span", required: true},
|
// {isshow: "T", field: "net_code", name: "网点编码", width: "100", type: "span",},
|
// {isshow: "T", field: "net_name", name: "网点名称", width: "200", type: "select", align: "left", required: true},
|
// {isshow: "T", field: "target_price", name: "中标价", width: "100", type: "input", formatter: "formatter_money", align: "right", required: true},
|
// {isshow: "T", field: "origin_price", name: "商业供货价", width: "100", type: "input", formatter: "formatter_money", align: "right", required: true},
|
// {isshow: "T", field: "gap_price", name: "补差单价", width: "100", type: "input", formatter: "formatter_money", align: "right", required: true},
|
// {isshow: "T", field: "gap_rate", name: "补差扣率", width: "100", type: "span", required: true},
|
// {isshow: "T", field: "pay_type", name: "支付方式", width: "100", type: "span", required: true},
|
// {isshow: "T", field: "pay_time", name: "兑付周期", width: "100", align: "right", type: "select", required: true},
|
// {isshow: "T", field: "is_agency", name: "是否托管", width: "100", align: "right", required: true},
|
// {isshow: "T", field: "agree_no", name: "协议编码", width: "100", align: "right", type: "input",},
|
// {isshow: "T", field: "remark", name: "明细备注", type: "input", width: "150"},
|
],
|
tableFields: [],
|
newTableData: {
|
pay_type: "票折"
|
},
|
tableData: [],
|
tableData_old: [],
|
|
//变更后
|
tableFields2: [],
|
tableData2: [],
|
|
//审批相关
|
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: [],
|
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
isend: false,
|
ischange: false,
|
isbrowse: false,
|
iscommit: false,//提交标记
|
isChangeEdit: false,
|
isEndEdit: false,
|
|
//弹窗参数
|
popupParames: {},
|
|
t_height:null,
|
flow_id: "c1355b3fd4b049f28135548d17f2071f",
|
isRefresh: true,
|
|
showApprovalInfo: false,
|
showChangeInfo: false,
|
opTableData: true,
|
reasonvisible: false,
|
loading_pass: false,
|
pass: false,
|
approveremark: '',
|
approvalTitle: '',
|
|
province_code_old: '',
|
province_name_old: '',
|
tableDataObj: {},
|
tableDataOldObj: {},
|
alertMessage: [],
|
showFileList: false,
|
|
btnLoading: false
|
},
|
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 == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
this.isapproval = true;
|
this.opTableData = false;
|
}
|
else {
|
this.newformData = {
|
biz_date: createDate(),
|
creator_code: window.top.vue.userinfo.employee.code,
|
creator_name: window.top.vue.userinfo.employee.name,
|
creator_depart_name: window.top.vue.userinfo.employee.hierarchyNodesStr || "虚拟部门",
|
type: 'gpo',
|
status: 'input',
|
trans_type: "new"
|
}
|
}
|
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;
|
|
//动态获取默认数据
|
var newEntity_ = {
|
name: "newEntity",
|
url: "rootjemin/data/newEntity",
|
paramsobj: {dataname: "pkg_agm_record_gpo"},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
this.isbrowse = true;
|
this.opTableData = false;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "changeEdit") {//编辑
|
this.isedit = true;
|
this.isChangeEdit = true
|
}
|
else if (this.popupParames.sceneCode == "endEdit") {//编辑
|
this.isedit = true;
|
this.isEndEdit = true
|
}
|
else if (this.popupParames.sceneCode == "change") {//变更
|
//this.formAttr.disabled = true;
|
this.formAttr2.disabled = false;
|
this.isapproval = false;
|
this.isedit = true;
|
this.ischange = true;
|
|
if (this.newformData) {
|
this.newformData.trans_type = "trans"
|
let formData_ = clone(this.formData);
|
|
for (var k in this.newformData) {
|
formData_[k] = this.newformData[k];
|
}
|
this.formData = formData_;
|
}
|
var newEntity_ = {
|
name: "newEntity",
|
url: "rootjemin/data/newEntity",
|
paramsobj: {dataname: "pkg_agm_record_gpo"},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
}
|
else if (this.popupParames.sceneCode == "end") {//终止
|
//this.formAttr.disabled = true;
|
this.formAttr2.disabled = false;
|
this.isapproval = false;
|
this.isend = true;
|
this.isedit = true;
|
|
if (this.newformData) {
|
this.newformData.trans_type = "end"
|
let formData_ = clone(this.formData);
|
|
for (var k in this.newformData) {
|
formData_[k] = this.newformData[k];
|
}
|
this.formData = formData_;
|
}
|
var newEntity_ = {
|
name: "newEntity",
|
url: "rootjemin/data/newEntity",
|
paramsobj: {dataname: "pkg_agm_record_gpo"},
|
isnotoption: true, //true:不是选项
|
}
|
this.dataRequest.push(newEntity_);
|
}
|
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
|
if (me.dataRequestObj.newEntity) {
|
var formData = clone(me.dataRequestObj.newEntity.data["agm_record_apply_gpo"]);
|
// formData.product_category_name = [];
|
if (me.newformData) {
|
let formData_ = clone(formData);
|
|
for (var k in me.newformData) {
|
if (!formData_[k]) {
|
formData_[k] = me.newformData[k];
|
}
|
}
|
|
me.formData = formData_;
|
}
|
|
// if (me.popupParames.delta) {
|
// me.formData.category_code = clone(me.popupParames.delta.code);
|
// me.formData.category_name = clone(me.popupParames.delta.name);
|
// }
|
}
|
|
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:{
|
toPDFPage() {
|
var row = this.formData;
|
window.open(window.top.RootSetting.url_fee + "page/agreement/policy/policy_print.html?dataname=pkg_agm_record_gpo&formName=agm_record_apply_gpo&tableName=agm_record_gpo&s="+ new Date() +"&id=" + row.id + "&token=" + Root.getToken() + "&userId=" + window.top.userinfo.user.id, "打印预览")
|
},
|
moduleDownload() {
|
let url = encodeURI("template\\上海GPO政策_新增_导入模板.xlsx")
|
handleDownloadPath(window.top.RootSetting.url_jemin + "io/downloadOneFile?token=" + Root.getToken() + "&url=" + url)
|
},
|
fileUpload() {
|
if (!this.formData.head_province_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择省份'
|
})
|
return
|
}
|
|
document.getElementById("btn_file").click()
|
},
|
getFile(event) {
|
var me = this;
|
//this.fullscreenLoading = true;
|
var file = event.target.files;
|
var forms = new FormData();
|
|
if(file.length <= 0) {
|
//this.fullscreenLoading = false;
|
}
|
for (var i = 0; i < file.length; i++) {
|
// 上传类型判断
|
var FileName = file[i].name;
|
var idx = FileName.lastIndexOf(".");
|
if (idx != -1) {
|
var ext = FileName.substr(idx + 1).toUpperCase();
|
ext = ext.toLowerCase();
|
if (ext == 'xlsx') {
|
let formData = new FormData()
|
formData.append("file", file[i]);
|
|
uploadAxios.post(window.top.RootSetting.url_jemin + 'io/loadData?ioname=recordGpoLoad&head_province_name=' + me.formData.head_province_name + '&token=' + Root.getToken(), formData).then(result => {
|
if(result.data.success) {
|
let tableData = result.data.data;
|
|
me.tableData = tableData
|
}
|
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('recordGpoExport', "ara.id = '" + this.formData.id + "'")
|
},
|
//关闭弹窗
|
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.formFields2 = clone(me.default_formFields2);
|
me.formFields3 = clone(me.default_formFields3);
|
me.tableFields3 = clone(me.default_tableFields3);
|
}
|
|
let param = {
|
dataname: "pkg_agm_record_gpo",
|
};
|
param.id = this.formData.parent_id?this.formData.parent_id : this.formData.id?this.formData.id : '';
|
|
Server.call("rootjemin/data/getEntity", param, function(result) {
|
if (result.success) {
|
let formData_ = result.data['agm_record_apply_gpo']
|
let formData2_ = result.data['agm_record_gpo_file']
|
let tableData_ = result.data['agm_record_gpo']
|
let alertMessage = result.data['agm_notice_message']
|
if (alertMessage && alertMessage.length > 0) {
|
let arr = []
|
alertMessage.map(s => {
|
arr.push(s.title + ";" + s.message)
|
})
|
me.alertMessage = arr
|
}
|
if (formData_) {
|
me.formData = formData_
|
}
|
if (formData2_ && formData2_.length > 0) {
|
let formData = clone(me.formData2)
|
formData.attachment_name = formData2_
|
me.formData2 = formData
|
}
|
if (tableData_ && tableData_.length > 0) {
|
tableData_.map(e => {
|
e.is_deposit = e.is_deposit? 'Y' : 'N'
|
})
|
|
let idStr = ''
|
tableData_.map(s => {
|
if (!idStr) idStr += "'" + s.old_id + "'"
|
else idStr += ",'" + s.old_id + "'"
|
})
|
if (me.formData.trans_type && me.formData.trans_type == 'trans' && me.popupParames.sceneCode !== "changeEdit") {
|
me.tableDataObj = {}
|
tableData_.map(s => {
|
me.tableDataObj[s.old_id] = s.id
|
|
})
|
me.tableData2 = tableData_
|
me.getOldData(idStr)
|
}
|
else if (me.popupParames.sceneCode == "changeEdit") {
|
me.tableData = tableData_
|
me.getOldData(idStr)
|
}
|
else {
|
me.tableData = tableData_
|
}
|
}
|
|
if (me.popupParames.sceneCode !== "change" && me.popupParames.sceneCode !== "end" && me.popupParames.sceneCode !== "changeEdit" && me.popupParames.sceneCode !== "endEdit" && me.formData.trans_type && me.formData.trans_type == 'trans') {
|
me.showChangeInfo = true
|
}
|
|
if (me.formData.flow_id) {
|
me.showApprovalInfo = true
|
me.getApprovalHisInfo(me.formData.flow_id || "")
|
}
|
if (me.popupParames.sceneCode == "approval" && me.formData.readed != "T") {
|
me.setPolicyReaded()
|
}
|
|
var metas = clone(result.meta['agm_record_apply_gpo'].fields);
|
var table_dataname_ = "agm_record_gpo";
|
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";
|
if (f.field == 'head_province_name') {
|
f.filterable = true
|
me.dataRequestObj.md_province.data.entityset.map(e => {
|
e.value = e.name
|
})
|
f.options = me.dataRequestObj.md_province.data.entityset
|
}
|
formFields_.push(clone(f));
|
})
|
table_metas.map(f=>{
|
f.isshow = "T";
|
if (me.popupParames.sceneCode == "add" && f.field == 'detail_code') {
|
f.isshow = "F"
|
}
|
if (!f.appendix) {
|
tableFields_.push(clone(f));
|
}
|
})
|
|
if (me.formData.trans_type == 'trans') {
|
let canChangeField = [
|
{field: "end_date"},
|
{field: "tag_price_type"},
|
{field: "balance_price"},
|
{field: "settle_type"},
|
{field: "actual_operate_name"},
|
{field: "tag_price"},
|
{field: "supply_price"},
|
{field: "invoice_limit_price"},
|
{field: "distribution_price"},
|
{field: "retail_price"},
|
{field: "settle_price"},
|
{field: "cash_type"},
|
{field: "terminal_position"},
|
{field: "inventory_amt"},
|
{field: "drained_amt"},
|
{field: "discount_flow_amt"},
|
{field: "discount_business_amt"},
|
{field: "discount_annual_amt"},
|
{field: "discount_common_amt"},
|
{field: "project_amt"},
|
{field: "pay_tax_amt"},
|
{field: "agm_sales_task"},
|
{field: "drained_arrest_amt"},
|
{field: "discount_trans_amt"},
|
{field: "current_tick_amt"},
|
{field: "pay_peroid"},
|
{field: "remark"}
|
]
|
tableFields_.map(s => {
|
if (canChangeField.filter(e => e.field == s.field).length == 0) {
|
s.type = "span"
|
}
|
})
|
|
var termination_date = {
|
isshow: "T",field: "termination_date", name: "终止日期", width: "150", type:"date", formatter: "formatter_date"
|
};
|
tableFields_.unshift(termination_date);
|
}
|
if (me.formData.trans_type == 'end') {
|
tableFields_.map(t => {
|
t.type = "span";
|
})
|
var termination_date = {
|
isshow: "T",field: "termination_date", name: "终止日期", width: "150", type:"date", formatter: "formatter_date"
|
};
|
tableFields_.unshift(termination_date);
|
}
|
|
// if (me.popupParames.sceneCode == "change" || me.popupParames.sceneCode == "changeEdit") {
|
// var termination_date = {
|
// isshow: "T",field: "termination_date", name: "终止日期", width: "150", type:"date", formatter: "formatter_date"
|
// };
|
// tableFields_.unshift(termination_date);
|
// }
|
// else if (me.popupParames.sceneCode == "end" || me.popupParames.sceneCode == "endEdit") {
|
// tableFields_.map(t => {
|
// t.type = "span";
|
// })
|
// var termination_date = {
|
// isshow: "T",field: "termination_date", name: "终止日期", width: "150", type:"date", formatter: "formatter_date"
|
// };
|
// tableFields_.unshift(termination_date);
|
// }
|
|
me.formFields = clone(formFields_);
|
me.tableFields = clone(tableFields_);
|
me.tableFields2 = clone(tableFields_);
|
|
me.$nextTick(function(){
|
if (me.showChangeInfo) {
|
me.addListener()
|
}
|
})
|
|
//字段数组转字段obj
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
});
|
// 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];
|
// }
|
// })
|
},
|
|
addListener() {
|
this.dom1 = this.$refs['table1'].$refs['table1'].bodyWrapper
|
this.dom2 = this.$refs['table2'].$refs['table1'].bodyWrapper
|
|
this.dom2.addEventListener('scroll', () => {
|
this.dom1.scrollLeft = this.dom2.scrollLeft
|
this.dom1.scrollTop = this.dom2.scrollTop
|
})
|
},
|
|
newEndDeatil() {
|
var me = this;
|
|
if (!this.formData.head_province_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择省份'
|
})
|
return
|
}
|
|
let filter = " type = 'gpo' and ara.status = 'open' and ar.freeze <> 'T' and ar.start_date < now() and ar.end_date > now() and ar.termination_date is null and head_province_code = '" + this.formData.head_province_code + "' "
|
if (me.tableData.length > 0) {
|
let str = ''
|
me.tableData.map(s => {
|
if (!str) {
|
str = "'" + s.old_id + "'"
|
}
|
else {
|
str += ",'" + s.old_id + "'"
|
}
|
})
|
|
if (str) {
|
filter += " and ar.id not in (" + str + ")"
|
}
|
}
|
|
let re = false
|
if (window.top.vue.userinfo.user.roleList && window.top.vue.userinfo.user.roleList.length > 0) {
|
window.top.vue.userinfo.user.roleList.map(s => {
|
if (s.id && (s.id == "0")) {
|
re = true
|
}
|
})
|
}
|
if (!re) {
|
filter += " and creator_code = '" + window.top.vue.userinfo.employee.code + "' "
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "请选择上海GPO政策明细数据",
|
id: "popup_shanghai_policy_info_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/policy/popup_policy_info_list.html",
|
dataname: "agm_record_gpo",
|
filter: filter,
|
data: {},
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData_ = clone(me.tableData)
|
data.map(e => {
|
e.termination_operate_code = window.top.vue.userinfo.employee.code
|
e.termination_operate_name = window.top.vue.userinfo.employee.name
|
e.old_id = JSON.parse(JSON.stringify(e.id))
|
e.id = null
|
e.parent_id = me.formData.id
|
|
tableData_.push(e)
|
})
|
me.tableData = tableData_
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
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);
|
}
|
}
|
}
|
},
|
head_province_name: {
|
select: {
|
onchange: function(obj) {//下拉展开事件
|
if (me.formData.head_province_code && me.tableData.length > 0) {
|
Root.confirm('切换省份将清空明细,请确认', '提示', {
|
confirmButtonText: '确认',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
obj.data.head_province_code = obj.selectoption.code
|
obj.data.head_province_name = obj.selectoption.name
|
|
me.tableData = []
|
}).catch(() => {
|
let formData = clone(me.formData)
|
formData.head_province_code = me.province_code_old
|
formData.head_province_name = me.province_name_old
|
me.formData = formData
|
});
|
}
|
else {
|
obj.data.head_province_code = obj.selectoption.code
|
obj.data.head_province_name = obj.selectoption.name
|
me.province_code_old = obj.selectoption.code
|
me.province_name_old = obj.selectoption.name
|
}
|
}
|
},
|
}
|
};
|
|
//表格字段事件设置
|
this.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);
|
},
|
}
|
},
|
customer_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择客户",
|
id: "popup_customer_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_customer_list.html",
|
data: {},
|
delta: {},
|
dataname: "customer",
|
filter: "1 = 1 and province = '" + me.formData.head_province_code + "'",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popObj, callback) {
|
let tableData = clone(me.tableData)
|
|
tableData[obj.$index]['customer_id'] = popObj.row.id
|
tableData[obj.$index]['customer_code'] = popObj.row.md_code
|
tableData[obj.$index]['customer_name'] = popObj.row.md_description
|
tableData[obj.$index]['customer_business_operater_code'] = popObj.row.operator_code
|
tableData[obj.$index]['customer_business_operater_name'] = popObj.row.operator_name
|
|
me.tableData = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
product_code: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择药品",
|
id: "popup_product_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_product_list.html",
|
data: {},
|
delta: {},
|
dataname: "md_product",
|
filter: "1 = 1",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popObj, callback) {
|
let tableData = clone(me.tableData)
|
|
tableData[obj.$index]['product_id'] = popObj.row.id
|
tableData[obj.$index]['product_code'] = popObj.row.md_code
|
tableData[obj.$index]['product_name'] = popObj.row.md_description
|
tableData[obj.$index]['product_spec'] = popObj.row.specification
|
|
me.tableData = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
network_name: {
|
popup: {
|
onclick: function(obj) {//弹窗点击事件
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择网点",
|
id: "popup_customer_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_network_list.html",
|
data: {},
|
delta: {},
|
dataname: "md_terminal",
|
filter: "1 = 1 and pos_province = '" + me.formData.head_province_code + "'",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(popObj, callback) {
|
let tableData = clone(me.tableData)
|
|
tableData[obj.$index]['network_code'] = popObj.row.pos_code
|
tableData[obj.$index]['network_name'] = popObj.row.md_description
|
|
me.tableData = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
},
|
},
|
tag_price: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.tableData)
|
let tag_price = obj.row.tag_price? parseFloat(obj.row.tag_price) : 0
|
let business_confirmed_price = obj.row.business_confirmed_price? parseFloat(obj.row.business_confirmed_price) : 0
|
tableData[obj.$index]['agm_amount'] = tag_price * business_confirmed_price
|
me.tableData = tableData
|
}
|
},
|
},
|
business_confirmed_price: {
|
input: {
|
onchange: function(obj) {
|
let tableData = clone(me.tableData)
|
let tag_price = obj.row.tag_price? parseFloat(obj.row.tag_price) : 0
|
let business_confirmed_price = obj.row.business_confirmed_price? parseFloat(obj.row.business_confirmed_price) : 0
|
tableData[obj.$index]['agm_amount'] = tag_price * business_confirmed_price
|
me.tableData = tableData
|
}
|
},
|
},
|
balance_price: {
|
input: {
|
onchange: function(obj) {
|
if (obj.row.tag_price) {
|
let tableData = clone(me.tableData)
|
let tag_price = obj.row.tag_price? parseFloat(obj.row.tag_price) : 0
|
let balance_price = obj.row.balance_price? parseFloat(obj.row.balance_price) : 0
|
tableData[obj.$index]['balance_rate'] = balance_price / tag_price
|
me.tableData = tableData
|
}
|
}
|
},
|
},
|
termination_date: {
|
input: {
|
onchange: function(obj) {
|
let start_date = obj.row.start_date
|
if (me.tableData_old.length > 0) {
|
start_date = me.tableData_old.filter(s => s.id == obj.row.old_id)[0].start_date
|
}
|
|
var year_ = new Date().getFullYear();
|
if (new Date(obj.row.termination_date) > new Date(year_ + "-12-31")) {
|
Root.message({
|
type: 'warning',
|
message: '终止日期不能跨年'
|
});
|
obj.row.termination_date = null;
|
return
|
}
|
if (obj.row.end_date) {
|
if (new Date(obj.row.termination_date) > new Date(obj.row.end_date) || new Date(obj.row.termination_date) < new Date(createDate())) {
|
Root.message({
|
type: 'warning',
|
message: '终止日期需在当前日期与结束日期之间',
|
});
|
obj.row.termination_date = null;
|
return
|
}
|
|
var year_2 = start_date.split('-')[0];
|
if (new Date(obj.row.termination_date) > new Date(year_2 + "-12-31")) {
|
Root.message({
|
type: 'warning',
|
message: '终止日期不能跨年'
|
});
|
obj.row.start_date = null;
|
}
|
}
|
},
|
}
|
},
|
start_date: {
|
input: {
|
onchange: function(obj) {
|
var year_ = new Date().getFullYear();
|
if (new Date(obj.row.start_date) > new Date(year_ + "-12-31")) {
|
Root.message({
|
type: 'warning',
|
message: '开始日期不能跨年'
|
});
|
obj.row.start_date = null;
|
}
|
if (obj.row.end_date) {
|
if (obj.row.start_date) {
|
if (new Date(obj.row.end_date) < new Date(obj.row.start_date)) {
|
Root.message({
|
type: 'warning',
|
message: '开始日期不能晚于结束日期',
|
});
|
obj.row.start_date = null;
|
}
|
}
|
|
var year_2 = obj.row.end_date.split('-')[0];
|
if (new Date(obj.row.start_date) > new Date(year_2 + "-12-31")) {
|
Root.message({
|
type: 'warning',
|
message: '开始日期不能跨年'
|
});
|
obj.row.start_date = null;
|
}
|
}
|
},
|
}
|
},
|
end_date: {
|
input: {
|
onchange: function(obj) {
|
if (obj.row.end_date) {
|
if (obj.row.end_date && obj.row.start_date) {
|
if (new Date(obj.row.end_date) < new Date(obj.row.start_date)) {
|
Root.message({
|
type: 'warning',
|
message: '结束日期不能早于开始日期',
|
});
|
obj.row.end_date = null;
|
}
|
}
|
|
var year_ = obj.row.start_date? obj.row.start_date.split('-')[0] : new Date().getFullYear();
|
if (new Date(obj.row.end_date) > new Date(year_ + "-12-31")) {
|
Root.message({
|
type: 'warning',
|
message: '结束日期不能跨年'
|
});
|
obj.row.end_date = null;
|
}
|
}
|
}
|
}
|
},
|
};
|
},
|
|
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
|
}
|
});
|
},
|
|
getOldData(idStr) {
|
let me = this
|
let param = {
|
dataName: 'agm_record_syzc',
|
filter: "ar.id in (" + idStr + ")"
|
}
|
|
Server.call("rootjemin/data/getEntitySet", param, function(result) {
|
if (result.success) {
|
let tableData = result.data.entityset
|
if (tableData.length > 0) {
|
let idArr = idStr.replaceAll("'", "").split(',')
|
let tableData_ = []
|
idArr.map(s => {
|
tableData_.push(tableData.filter(x => x.id == s)[0])
|
})
|
|
if (me.popupParames.sceneCode == "changeEdit") {
|
me.tableData_old = tableData_
|
}
|
else {
|
var tableDataOldObj_ = {};
|
tableData_.map(entity=>{
|
let row_ = clone(entity);
|
// if (row_.start_date) {
|
// row_.start_date = row_.start_date.split(' ')[0]
|
// }
|
// if (row_.end_date) {
|
// row_.end_date = row_.end_date.split(' ')[0]
|
// }
|
// if (row_.termination_date) {
|
// row_.termination_date = row_.termination_date.split(' ')[0]
|
// }
|
tableDataOldObj_[me.tableDataObj[row_.id]] = row_;
|
})
|
|
me.tableDataOldObj = clone(tableDataOldObj_);
|
|
me.tableData = tableData_
|
|
let tableData = clone(me.tableData)
|
let tableData2 = clone(me.tableData2)
|
|
tableData.map(s => {
|
tableData2.map(x => {
|
if (x.old_id == s.id) {
|
if (!s.termination_date) {
|
s.termination_date = JSON.parse(JSON.stringify(x.termination_date))
|
x.termination_date = ""
|
}
|
}
|
})
|
})
|
|
me.tableData = tableData
|
me.tableData2 = tableData2
|
}
|
}
|
}
|
});
|
},
|
|
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 = clone(me.tableData3)
|
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: "flow",
|
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: "agm_record_apply",
|
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: '审批成功'
|
})
|
try {
|
window.top.vue.setMenuBadgeByMenuid('A10163', 'recordGpo');
|
} catch (error) {
|
console.error(error);
|
}
|
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);
|
}
|
}
|
}
|
},
|
|
changeTableData() {
|
var table_row = clone(this.newTableData);
|
this.rowChange(table_row, "2add", this.table_dataname);
|
},
|
|
addTableData() {
|
let me = this
|
|
if (!me.formData.head_province_code) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择省份'
|
})
|
return
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "450px",
|
icon: "icon-product",
|
text: "选择网点",
|
id: "popup_customer_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/popup/popup_network_list.html",
|
data: {},
|
delta: {isSelects: true},
|
dataname: "md_terminal",
|
filter: "1 = 1 and pos_province = '" + me.formData.head_province_code + "'",
|
sceneCode: "add", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData = clone(me.tableData)
|
|
data.map((e, index) => {
|
let s = {}
|
s.pay_type = "票折"
|
s.network_code = e.pos_code
|
s.network_name = e.md_description
|
|
tableData.push(s)
|
})
|
|
me.tableData = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
|
me.doPopupByPublic(config);
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
Root.confirm('确定删除吗?', '删除提示', {
|
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 == "2add") {
|
this.tableData2.unshift(row);
|
}
|
else if (type == "del") {
|
this.tableData.remove(row);
|
}
|
else {
|
|
}
|
},
|
|
setPolicyReaded() {
|
let me = this
|
let param = {
|
dataName: 'pkg_agm_record_gpo',
|
data: {
|
agm_record_apply_gpo: {
|
id: me.formData.id,
|
readed: "T"
|
}
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {});
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
|
if (this.tableData.length == 0) {
|
Root.message({
|
type: 'warning',
|
message: '请先添加明细数据'
|
});
|
return
|
}
|
if(me.iscommit) {
|
var bo = me.$refs.form1.checkForm();
|
|
if(!bo) {
|
Root.message({
|
type: 'warning',
|
message: '请填写必填项'
|
});
|
return;
|
}
|
|
if (me.formData.trans_type && (me.formData.trans_type == 'trans' || me.formData.trans_type == 'end')) {
|
let re = false
|
this.tableData.map(e => {
|
if (!e.termination_date) {
|
re = true
|
}
|
})
|
if (re) {
|
Root.message({
|
type: 'warning',
|
message: '请填写终止日期'
|
});
|
return;
|
}
|
}
|
|
this.formData.readed = "F"
|
}
|
|
me.btnLoading = true
|
|
if (this.formData.id) {
|
me.deleteDetails(this.formData.id)
|
}
|
else {
|
me.doSaveRowTable()
|
}
|
},
|
deleteDetails(id) {
|
let me = this
|
|
let param = {
|
dataName: 'agm_record',
|
filter: "parent_id = '" + id + "'"
|
}
|
|
Server.call("rootjemin/history/deleteDetails", param, function(result) {
|
if (result && result.data) {
|
me.doSaveRowTable()
|
}
|
});
|
},
|
doSaveRowTable() {
|
let me = this
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r]) {
|
entity[r] = entity_[r];
|
}
|
}
|
entity.update_time = ""
|
|
|
if (tableData_ && tableData_.length > 0) {
|
tableData_.map(e => {
|
e.is_deposit = e.is_deposit? 'Y' : 'N'
|
})
|
|
me.tableData = tableData_
|
}
|
|
var tableData_ = [];
|
this.tableData.map(r=>{
|
var row_ = {};
|
for (var k in r) {
|
if (r[k] || r[k] == 0) {
|
if (k == 'is_deposit') {
|
if (r[k] === true) {
|
row_[k] = "Y";
|
}
|
else if (r[k] === false) {
|
row_[k] = "N";
|
}
|
else {
|
row_[k] = r[k];
|
}
|
}
|
else {
|
row_[k] = r[k];
|
}
|
}
|
}
|
tableData_.push(row_);
|
})
|
|
if (this.formData.trans_type == "trans") {
|
tableData_.map(e => {
|
if (e.termination_date) {
|
let startDate = new Date(e.termination_date)
|
startDate.setDate(startDate.getDate() + 1)
|
e.start_date = dateFormat(startDate, "yyyy-MM-dd")
|
}
|
})
|
}
|
|
let fileList = []
|
if (me.formData2.attachment_name && me.formData2.attachment_name.length > 0) {
|
me.formData2.attachment_name.map(s => {
|
let list = {
|
type: "agm_record",
|
file_id: s.id,
|
file_name: s.file_name
|
}
|
if (s.id) list.id = s.id
|
if (s.parent_id) list.parent_id = s.parent_id
|
fileList.push(list)
|
})
|
}
|
|
|
if (tableData_.length == 0) {
|
Root.message({
|
type: 'warning',
|
message: '请先添加明细数据'
|
});
|
return
|
}
|
|
let param = {
|
dataName: 'pkg_agm_record_gpo',
|
data: {
|
agm_record_apply_gpo: entity,
|
agm_record_gpo: tableData_,
|
agm_record_gpo_file: fileList
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
if(!me.iscommit) {
|
me.btnLoading = false
|
}
|
if (result.success) {
|
if(me.iscommit){
|
me.iscommit = false;
|
me.doSubmit(param.data.agm_record_apply_gpo.id);
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
});
|
},
|
|
doSubmit(id) {
|
let me = this;
|
let pa = {
|
dataName: "agm_record_apply",
|
id: id,
|
flow_id: this.formData.flow_id || "",
|
business_type: "recordGpo"
|
}
|
Server.call("rootjemin/data/Commit", pa, function(result) {
|
me.btnLoading = false
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
try {
|
window.top.vue.setMenuBadgeByMenuid('A10163', 'recordGpo');
|
} catch (error) {
|
console.error(error);
|
}
|
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: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
|
});
|
}
|
});
|
}
|
|
}
|
});
|
};
|
|
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;
|
}
|
|
.h_table .el-table {
|
margin-bottom: 50px;
|
}
|
.el-dialog__body {
|
overflow-y: visible;
|
}
|
/* .el-button--mini {
|
color: #FFF;
|
background-color: #2984e2;
|
border-color: #409EFF;
|
} */
|
</style>
|
|
</body>
|
</html>
|