<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>协议信息</title>
|
<script src="../../../jsnew/elementDefault.js?v=20220425"></script>
|
<script src="../../../jsnew/vue/vue.js"></script>
|
<script src="../../../jsnew/vue/element-ui/element-ui_15/index.js"></script>
|
<script src="../../../jsnew/myelement.js?v=20220425"></script>
|
<script src="../../../jsnew/page.js?v=20220425"></script>
|
<!-- <script src="../../../setting.js"></script> -->
|
|
<link href="../../../jsnew/vue/element-ui/element-ui_15/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../jsnew/myelement.css?v=20220426" rel="stylesheet">
|
<link href="../../../jsnew/theme.css?v=20220426" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../jsnew/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<div class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}}</span>
|
</div>
|
</div>
|
|
<div :style="{height: p_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>
|
<div style="overflow: auto;">
|
<h-form
|
ref="A"
|
:form-attr="formAttrA"
|
:table-fields="formFieldsA"
|
:form-data="formDataA"
|
:table-field-click="formfieldClick"
|
|
v-on:button-click="(obj)=>buttonClick(obj)"
|
>
|
</h-form>
|
</div>
|
</div>
|
|
<!-- 表格 -->
|
<div class="h_dialog__body">
|
<div style=" text-align: right; padding-top: 30px;">
|
<div style="float: left;">
|
<span style="font-weight: 600; color: black; padding-right: 15px;">产品信息</span>
|
<!-- <span>使用折让金额汇总:9999</span> -->
|
</div>
|
<div v-if="isedit || isrefuseedit" style="float: right;">
|
<el-button-group>
|
<el-button @click="selectRecord">选择备案</el-button>
|
<el-button @click="selectData">新增数据</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="isedit || isrefuseedit"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="true"
|
:edit-table-button="editTableButton"
|
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
|
<div v-if="type_name == '商业政策'" style="padding-top: 30px;">
|
<div style="float: left;">
|
<span style="font-weight: 600; color: black; padding-right: 15px;">销售区域申请</span>
|
</div>
|
<div v-if="isedit || isrefuseedit" style="float: right;">
|
<el-button-group>
|
<el-button @click="addTableDataArea">新增数据</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
|
<h-table
|
v-if="isRefresh && tableFieldsArea.length && (type_name == '商业政策')"
|
ref="table1"
|
:table-fields="tableFieldsArea"
|
:table-data="tableDataArea"
|
:is-edit-table-data="isedit || isrefuseedit"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="true"
|
:edit-table-button="editTableButton"
|
|
v-on:get-data="getData"
|
v-on:del-data="delData"
|
>
|
</h-table>
|
</div>
|
|
<!-- 审批时的原因 -->
|
<el-dialog title="填写原因" :visible.sync="reasonvisible" height="50%">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="textarea2">
|
</el-input>
|
|
<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>
|
</div>
|
</div>
|
|
<div class="el-dialog__footer">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="isedit" type="primary" :loading="loading_save" @click="saveRowTable":icon="buttonsconfig.save.icon">保 存</el-button>
|
<el-button size="small" v-if="isedit" type="success" :loading="iscommit" @click="submitRowTable":icon="buttonsconfig.submit.icon">提 交</el-button>
|
|
<el-button size="small" v-if="isapproval" type="danger" @click="onRefuseApproval">拒 绝</el-button>
|
<el-button size="small" v-if="isapproval" type="success" @click="onPassApproval">通 过</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 loadJsCss(callback) {
|
// var jscss_urls = [];
|
// window.top.initJsCss(document, jscss_urls, callback);
|
// };
|
function initVue() {
|
new FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "agm_agreement",
|
title: "协议信息",
|
|
//公共表单
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formFields: [
|
// {isshow: "T", field: "category_name", name: "协议类型", inputtype: "span", group_name: "基本信息",},
|
// {isshow: "T", field: "template_name", name: "模板名称", inputtype: "span", group_name: "基本信息",},
|
// {isshow: "T", field: "template_attachment_name", name: "模板附件", inputtype: "uploadfile", readonly: true, group_name: "基本信息",},
|
{isshow: "T", required: true, field: "begin_date", name: "开始日期", inputtype: "date", group_name: "基本信息",},
|
{isshow: "T", required: true, field: "end_date", name: "终止日期", inputtype: "date", group_name: "基本信息",},
|
{isshow: "T", field: "remark", name: "备注", inputtype: "textarea", group_name: "基本信息",},
|
|
{isshow: "T", field: "partyA", name: "甲方", type:"popup", group_name: "甲方信息",},
|
],
|
newformData: {
|
status: "Open",
|
state_name: "生效",
|
// creator_id:
|
},
|
formData: {
|
// partyBAll: [{}],
|
},
|
//字段设置
|
formfieldClick: {},
|
|
//可多行的表单
|
formAttrA: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formFieldsA:[],
|
//分销多行
|
formFields_distribute: [
|
{
|
isshow: "T", field: "partyBAll", name: "", labelwidth: "0px", typeof:"objlist", group_name: "乙方信息",
|
children: [
|
{isshow: "T", field: "partyB", name: "乙方", width: "200", type:"popup",},
|
],
|
formattr: {
|
title: "表单信息",
|
istitle: false,
|
columnnumber: 1,
|
labelwidth: "120px",
|
labelposition: "left", //"right",
|
size: "medium",
|
disabled: false,
|
bordertop: "3px solid #c6c6c600",
|
},
|
required: true,
|
},
|
{
|
isshow: "T", field: "partyCAll", name: "", labelwidth: "0px", typeof:"objlist", group_name: "丙方信息",
|
children: [
|
{isshow: "T", field: "partyC", name: "丙方", width: "200", type:"popup",},
|
],
|
formattr: {
|
title: "表单信息",
|
istitle: false,
|
columnnumber: 1,
|
labelwidth: "120px",
|
labelposition: "left", //"right",
|
size: "medium",
|
disabled: false,
|
bordertop: "3px solid #c6c6c600",
|
},
|
required: true,
|
},
|
],
|
//商业多行
|
formFields_commercial: [
|
{
|
isshow: "T", field: "partyBAll", name: "", labelwidth: "0px", typeof:"objlist", group_name: "乙方信息",
|
children: [
|
{isshow: "T", field: "partyB", name: "乙方", width: "200", type:"popup",},
|
],
|
formattr: {
|
title: "表单信息",
|
istitle: false,
|
columnnumber: 1,
|
labelwidth: "120px",
|
labelposition: "left", //"right",
|
size: "medium",
|
disabled: false,
|
bordertop: "3px solid #c6c6c600",
|
},
|
required: true,
|
},
|
],
|
formDataA: {
|
partyBAll: [{}],
|
partyCAll: [{}],
|
},
|
|
tableFields: [],
|
tableFieldsArea: [],
|
tableFields_distribute: [
|
{isshow: "T", field: "product_name", name: "产品名称", width: "200", type: "span", align: "left", isminwidth: true,},
|
{isshow: "T", field: "spec", name: "规格", width: "150", type: 'span',},
|
{isshow: "T", field: "unit", name: "单位", width: "100", type: 'span',},
|
{isshow: "T", field: "product_price1", name: "挂网价", width: "100", type:"span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "product_price", name: "分销供货价", width: "100", type:"span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "remark", name: "其他特殊备注", type: "input", width: "150", isminwidth: true,},
|
],
|
tableFields_commercial: [
|
{isshow: "T", field: "product_name", name: "产品名称", width: "200", type: "span", align: "left", isminwidth: true,},
|
{isshow: "T", field: "spec", name: "规格", width: "150", type: 'span',},
|
{isshow: "T", field: "unit", name: "单位", width: "100", type: 'span',},
|
{isshow: "T", field: "product_price1", name: "供货价", width: "100", type:"span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "product_price", name: "建议零售价", width: "100", type:"span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "remark", name: "备注", type: "input", width: "150", isminwidth: true,},
|
],
|
tableFields_commercial_area: [
|
{isshow: "T", field: "area", name: "区域", width: "150", type: 'input', isminwidth: true,},
|
{isshow: "T", field: "remark", name: "备注", type: "input", width: "150", isminwidth: true,},
|
],
|
newTableData: {
|
create_time: createDatetime(),
|
// creator_name: window.top.vue.userinfo.name,
|
},
|
tableData: [],
|
tableDataArea: [],
|
tablefieldClick:{},
|
|
formFields_default: [
|
{isshow: "T", required: true, field: "begin_date", name: "开始日期", inputtype: "date", group_name: "基本信息",},
|
{isshow: "T", required: true, field: "end_date", name: "终止日期", inputtype: "date", group_name: "基本信息",},
|
{isshow: "T", field: "remark", name: "备注", inputtype: "textarea", group_name: "基本信息",},
|
],
|
tableFields_default: [
|
{isshow: "T", field: "product_name", name: "产品名称", width: "200", type: "popup", align: "left", isminwidth: true,},
|
{isshow: "T", field: "spec", name: "规格", width: "150", type: 'span',},
|
{isshow: "T", field: "unit", name: "单位", width: "100", type: 'span',},
|
{isshow: "T", field: "remark", name: "备注", type: "input", width: "150", isminwidth: true,},
|
],
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
iscommit: false,//提交标记
|
loading_save: false,
|
isRefresh: true,
|
|
//审批相关变量
|
reasonvisible:false,//审批通过或拒绝填写原因
|
textarea2: '',//填写理由
|
passOrRefuse:false,
|
loading_pass: false,
|
|
//高度
|
p_height: null,
|
|
//弹窗参数
|
popupParames: {},
|
|
dataRequest: [],
|
|
copyAdd: false,
|
formDatas_old: [],
|
|
type_name: ""
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text;
|
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
this.type_name = this.formData.category_name;
|
}
|
if (this.popupParames.delta && this.popupParames.delta.type_name) {
|
this.type_name = this.popupParames.delta.type_name;
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
//动态获取默认数据
|
// var newEntity_ = {
|
// name: "newEntity",
|
// url: "root/data/newEntity",
|
// paramsobj: {dataname: this.dataname},
|
// isnotoption: true, //true:不是选项
|
// }
|
// this.dataRequest.push(newEntity_);
|
if (this.newTableData) {
|
this.tableData.push(clone(this.newTableData));
|
}
|
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttrA.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "copyAdd") {//只读
|
this.copyAdd = true;
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.formAttrA.disabled = true;
|
this.isapproval = true;
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
me.p_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[me.dataname]);
|
// 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_;
|
}
|
}
|
|
me.initData();
|
});
|
|
// if (me.popupParames.sceneCode == "add" || me.popupParames.sceneCode == "copyAdd") {
|
// me.initField();
|
// }
|
// else {
|
me.initData();
|
// }
|
}
|
else {
|
// if (me.popupParames.sceneCode == "add" || me.popupParames.sceneCode == "copyAdd") {
|
// me.initField();
|
// }
|
// else {
|
me.initData();
|
// 以服务的方式调用的 Loading 需要异步关闭
|
me.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
me.$nextTick(function(){
|
//let w_ = this.$refs.popup_body.offsetWidth "px";
|
let w_ = "1200px";
|
let h_ = me.$refs.popup_body.offsetHeight + "px";
|
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
// }
|
}
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
initField() {
|
this.showTemplate();
|
|
// this.tableFieldClick();
|
},
|
|
buttonClick(obj) {
|
var field = obj.obj.field;
|
var index;
|
var me = this;
|
var formData6_ = clone(me.formDataA);
|
|
if (obj.obj.field == "partyBAll" || obj.obj.field == "partyCAll") {//
|
if (obj.type == "del") {
|
formData6_[obj.obj.field].splice(obj.index,1);
|
}
|
else {
|
formData6_[obj.obj.field].push({receiver_id_date_to: null,proxy_statement_date_to: null});
|
}
|
me.formDataA = formData6_;
|
}
|
},
|
|
initData() {
|
let me = this;
|
var id_ = null;
|
|
if (me.type_name) {
|
me.formData.category_name = me.type_name;
|
me.formData.template_attachment_name = me.type_name;
|
me.formData.template_name = me.type_name;
|
if (me.type_name == "商业政策") {
|
// me.filterFields = clone(me.withdraw_filterFields);
|
me.formFieldsA = clone(me.formFields_commercial);
|
me.tableFields = clone(me.tableFields_commercial);
|
me.tableFieldsArea = clone(me.tableFields_commercial_area);
|
}
|
else if (me.type_name == "二次议价") {
|
// me.filterFields = clone(me.current_filterFields);
|
// me.formFieldsA = clone(me.formFields_default);
|
me.tableFields = clone(me.tableFields_default);
|
}
|
else if (me.type_name == "分销政策") {
|
// me.filterFields = clone(me.transfer_filterFields);
|
me.formFieldsA = clone(me.formFields_distribute);
|
me.tableFields = clone(me.tableFields_distribute);
|
}
|
else if (me.type_name == "前台费用") {
|
// me.filterFields = clone(me.adjust_filterFields);
|
// me.formFieldsA = clone(me.formFields_default);
|
me.tableFields = clone(me.tableFields_default);
|
}
|
}
|
// else {
|
// me.tableFields = clone(me.default_tableFields);
|
// }
|
|
// if (this.formData.id) {
|
// id_ = this.formData.id;
|
// }
|
// this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
|
// if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
|
// var metas = clone(result.meta[me.dataname].fields);
|
// var formFields_ = [];
|
|
// metas.map(f=>{
|
// f.isshow = "T";
|
// if (f.field == "template_attachment_name") {
|
// f.readonly = true;
|
// }
|
|
// if ((me.formData && me.formData.state_code && me.formData.state_code != 'Open') || me.copyAdd) {
|
// if (f.field == 'agreement_no') {
|
// f.isshow = "F";
|
// }
|
// }
|
|
// if (me.copyAdd) {
|
// if (f.field == "customer_code" || f.field == "customer_name") {
|
// f.isshow = 'F';
|
// }
|
// }
|
|
// if (me.formData.state_code != 'Open') {
|
// if (f.field == "logistics_code") {
|
// f.isshow = 'F';
|
// }
|
// }
|
|
// formFields_.push(clone(f));
|
// })
|
// if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
// me.formFields = clone(formFields_);
|
|
// //字段数组转字段obj
|
// me.fieldsToFieldsObj();
|
|
// //设置字段事件
|
// me.tableFieldClick();
|
// }
|
// }
|
// })
|
},
|
|
addTableData() {
|
var table_row = clone(this.newTableData);
|
this.rowChange(table_row, "add", this.table_dataname);
|
},
|
|
addTableDataArea() {
|
var table_row = clone(this.newTableData);
|
this.rowChange(table_row, "add2", this.table_dataname);
|
},
|
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
Root.confirm('确定删除数据【' + JSON.stringify(row) + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.rowChange(row, "del", me.table_dataname);
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
rowChange(row, type, tablename) {
|
var me = this;
|
if (type == "add") {
|
this.tableData.unshift(row);
|
}
|
else if (type == "add2") {
|
this.tableDataArea.unshift(row);
|
}
|
else if (type == "del") {
|
if (row.id) {
|
let param = {
|
dataname: tablename,
|
id: row.id
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.tableData.remove(row);
|
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}
|
});
|
}
|
else {
|
this.tableData.remove(row);
|
}
|
}
|
else {
|
|
}
|
},
|
|
tableFieldClick() {
|
var me = this;
|
|
//表格字段事件设置
|
this.tablefieldClick = {};
|
|
//表单字段事件设置
|
this.formfieldClick = {
|
template_attachment_name: {//字段事件设置
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "template_attachment_id";
|
if(obj.buttonobj && obj.buttonobj.code == "showfile"){
|
me.showFileImgByFileId(filenamefield, fileidfield);
|
}
|
}
|
},
|
},
|
|
date_from: {//起始日期
|
val: {
|
onchange: function(obj) {
|
//开始日期要早于截止日期
|
if (obj.data.date_from && obj.data.date_to) {
|
if (new Date(obj.data.date_from) > new Date(obj.data.date_to)) {
|
Root.message({
|
type: 'warning',
|
message: '起始日期不能晚于终止日期'
|
});
|
obj.data.date_from = null;
|
}
|
}
|
}
|
}
|
},
|
|
date_to: {//终止日期
|
val: {
|
onchange: function(obj) {
|
//截止日期要晚于开始日期
|
if (obj.data.date_from && obj.data.date_to) {
|
if (new Date(obj.data.date_from) > new Date(obj.data.date_to)) {
|
Root.message({
|
type: 'warning',
|
message: '终止日期不能早于起始日期'
|
});
|
obj.data.date_to = null;
|
}
|
}
|
}
|
}
|
},
|
};
|
},
|
|
showFileImgByFileId(filenamefield, fileidfield) {
|
let me = this;
|
var file_name = me.formData[filenamefield];
|
var file_id = me.formData[fileidfield];
|
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: "1000px",
|
height: 800,
|
icon: "icon-product",
|
text: "附件预览",
|
id: "pdf_" + fileid,
|
url: "module/tool/page/popup_file_pdf.html",
|
data: row,
|
delta: {},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
}
|
else {//只可下载,不可预览
|
// handleDownloadUrl(fileid,false);
|
handleDownload(fileid);
|
}
|
}
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
//必填项校验
|
var bo1 = this.$refs.form1.checkForm();
|
if(!bo1){
|
Root.message({
|
type: 'error',
|
message: '请填写必填项'
|
});
|
this.iscommit = false;
|
return;
|
}
|
this.saveRowTable();
|
},
|
|
selectRecord() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "选择备案",
|
id: "agreement_edit" + "edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/agreement/popup_record_list.html",
|
data: me.type_name,
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
selectData() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "选择备案",
|
id: "agreement_edit" + "edit",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/agreement/popup_product_list.html",
|
data: "",
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
var operator_ = "saveEntity";//保存
|
me.loading_save = true;
|
if(me.iscommit) {
|
operator_ = "commit";//提交
|
}
|
|
var entity_ = clone(me.formData);
|
|
if (me.copyAdd) {
|
var entitys = clone(me.formDatas_old);
|
var entity = [];
|
entitys.map(es => {
|
for (var f in es) {
|
if (f == "id") {
|
es.source_id = es[f];
|
}
|
if (f == "agreement_no" || f == "contract_attachment_id" || f == "contract_attachment_name" || f == "state_detail_code" || f == "state_detail_name" || f == "id" || f == "creator_id" || f == "creator_name" || f == "create_time" || f == "update_time") {
|
es[f] = "";
|
}
|
if (f == "state_code") {
|
es[f] = "Input";
|
}
|
if (f == "state_name") {
|
es[f] = "草稿";
|
}
|
if (f == "category_id" || f == "category_name" || f == "date_from" || f == "date_to" || f == "remark" || f == "template_attachment_id" || f == "template_attachment_name" || f == "template_id" || f == "template_name") {
|
es[f] = entity_[f];
|
}
|
}
|
entity.push(es);
|
})
|
}
|
else {
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r]) {
|
entity[r] = entity_[r];
|
}
|
}
|
}
|
|
let param = {
|
dataname: me.dataname,
|
data: {},
|
}
|
param.data[me.dataname] = entity;
|
|
Server.call("root/data/"+operator_, param, function(result) {
|
if (result.success) {
|
if (me.iscommit) {
|
me.iscommit = false;
|
me.loading_save = false;
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
}
|
else {
|
me.loading_save = false;
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
}
|
me.saveAfter();
|
}
|
}, function(errorresult) {
|
console.log("错误信息", errorresult);
|
if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
|
if (errorresult.messages.list) {
|
me.iscommit = false;
|
me.loading_save = false;
|
var config = {
|
totab: false,
|
// width: "1200px",
|
// height: 800,
|
icon: "icon-product",
|
text: "错误信息",
|
url: "module/tool/page/popup_error_messages.html",
|
data: {},
|
delta: errorresult.messages.list,
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
}
|
else {
|
if(me.iscommit) {
|
me.iscommit = false;
|
Root.message({
|
type: 'error',
|
message: '提交失败'
|
});
|
}
|
else {
|
me.loading_save = false;
|
Root.message({
|
type: 'error',
|
message: '保存失败'
|
});
|
}
|
}
|
});
|
},
|
|
//审批通过相关数据赋值
|
onPassApproval() {
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = true;
|
},
|
|
//审批拒绝相关数据赋值
|
onRefuseApproval(){
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = false;
|
},
|
|
//保存通过/拒绝原因
|
saveReason(){
|
this.loading_pass = true;
|
if(this.passOrRefuse){
|
this.doPassApproval(true);
|
}else{
|
if(this.textarea2 != ""){
|
this.doPassApproval(false);
|
}
|
else{
|
Root.message({
|
type: 'warning',
|
message: '请填写原因'
|
});
|
this.loading_pass = false;
|
}
|
}
|
},
|
|
//审批通过/拒绝
|
doPassApproval(bo) {
|
var me = this;
|
var state_ = "approve"
|
if (!bo) {
|
state_ = "reject"
|
}
|
|
let param = {
|
dataname: me.dataname,
|
id: me.formData.id,
|
remark: me.textarea2,
|
}
|
Server.call("root/data/" + state_, param, function(result) {
|
me.loading_pass = false;
|
console.log(result);
|
if (bo) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
me.saveAfter();
|
}
|
|
else {
|
Root.message({
|
type: 'success',
|
message: '已拒绝'
|
});
|
me.saveAfter();
|
}
|
}, function(errorresult) {
|
console.log("错误信息", errorresult);
|
me.loading_pass = false;
|
if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
|
if (errorresult.messages.list) {
|
var config = {
|
totab: false,
|
// width: "1200px",
|
// height: 800,
|
icon: "icon-product",
|
text: "错误信息",
|
url: "module/tool/page/popup_error_messages.html",
|
data: {},
|
delta: errorresult.messages.list,
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
}
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: '审批失败'
|
});
|
}
|
});
|
},
|
}
|
});
|
};
|
|
// loadJsCss(function () {
|
initVue();
|
// });
|
</script>
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
|
.h_table {
|
margin-top: 30px;
|
}
|
</style>
|
</body>
|
</html>
|