<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title>协议审批编辑</title>
|
<script src="../../../js/vue/vue.js"></script>
|
<script src="../../../js/vue/element-ui/lib/index.js"></script>
|
<!-- <script src="../../../../js/vue/elementDefault.js"></script> -->
|
<script src="../../../js/vue/page.js"></script>
|
<script src="../../../js/myelement.js"></script>
|
<!-- <script src="../../../../data/data.js"></script> -->
|
|
<link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../css/myelement.css" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../css/page.css" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_mkoo966o0uo.css" rel="stylesheet">
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" >
|
<div class="el-dialog_header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{formAttr.title}} </span>
|
</div>
|
</div>
|
<div class="el-dialog_body">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
v-on:show-popup="showPopup"
|
>
|
</h-form>
|
<!-- <el-button-group v-if="notdisabled" style="float: right;">
|
<el-button @click="addTableData">新增数据</el-button>
|
</el-button-group> -->
|
<h-table
|
v-if="isRefresh"
|
ref="table2"
|
:table-fields="tableFields"
|
:table-data="tableData2"
|
:is-edit-table-data="isEditTableData"
|
:is-within-edit-table-data= "isWithinEditTableData"
|
:table-height="tableHeight2"
|
:is-pagination="false"
|
:is-show-index="true"
|
|
>
|
</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 class="dialog-footer" style="float: right;margin-top: 30px;">
|
<el-button type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button type="primary" @click="saveReason">确 定</el-button>
|
</div>
|
</el-dialog>
|
<div class="el-dialog_footer">
|
<el-button-group style="margin: 0px 20px;">
|
<el-button v-if="approve" type="success" @click="onpassApproval">通过</el-button>
|
<el-button v-if="approve" type="danger" @click="onrefuseApproval">拒绝</el-button>
|
</el-button-group>
|
<el-button v-if="!fromDing" type="default" @click="closeDialog">取 消</el-button>
|
<!-- <el-button v-if="notdisabled" type="primary" @click="saveRowTable">保 存</el-button> -->
|
</div>
|
</div>
|
</div>
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
|
<el-dialog :visible.sync="dingResult" width="40vw" height="50vh" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
|
<span>{{dingResultTxt}}</span>
|
<div style="min-height: 150px;"></div>
|
</el-dialog>
|
</div>
|
<script type="text/javascript">
|
new ListVue({
|
el: "#vbody",
|
data: {
|
notdisabled: true,
|
formAttr: {
|
istitle: false,
|
title: "协议信息",
|
columnnumber: 2,
|
labelwidth: "120px",
|
labelposition: "right",
|
size: "medium",
|
disabled:true,
|
border: "0px solid #c6c6c600"
|
},
|
formFields: [],
|
authorize: {
|
edit: true,
|
},
|
tableFields: [],
|
|
tableData2: [],
|
tableData: [],
|
selectrow: {},
|
|
tableHeight2: 280,
|
isEditTableData:false,
|
isWithinEditTableData:false,
|
formData: {},
|
isRefresh: true,
|
selectFormField: {},
|
popupByFieldsDialog: false,
|
|
pagesize: 10,
|
pagenum: 1,
|
total: 0,
|
tableData_cus_new: [],
|
tableData_cus: [],
|
tableData_cus2: [],
|
selectcusrow: {},
|
tableHeight_cus: 280,
|
formInline: {},
|
reasonvisible:false,
|
textarea2: '',
|
approve:true,
|
fromDing: false,
|
dingResult: false,
|
dingResultTxt: ""
|
},
|
|
created() {
|
this.formFields = dataRootFields.formFields.workFlow_;
|
this.tableFields = dataRootFields.tableFields.policyReportSummary_;
|
|
this.popupParames = clone(Root.popupParames);
|
},
|
|
mounted() {
|
if (this.popupParames.disabled) {
|
this.formAttr.disabled = true;
|
this.isEditTableData = false;
|
this.isWithinEditTableData = false;
|
this.notdisabled = false;
|
}
|
if(this.popupParames.sceneCode == "browse"){
|
this.formAttr.disabled = true;
|
this.isEditTableData = false;
|
this.isWithinEditTableData = false;
|
this.notdisabled = false;
|
this.approve = false;
|
}
|
if(this.popupParames.sceneCode == "approve"){
|
this.formAttr.disabled = true;
|
this.isEditTableData = false;
|
this.isWithinEditTableData = false;
|
this.notdisabled = false;
|
this.approve = true;
|
}
|
if (this.popupParames.data) {
|
let me = this;
|
this.formData = clone(this.popupParames.data);
|
let param_ = {
|
dataname: "protocolDetailAll",
|
filter: "protocol_detail.parent_id = '" + this.formData.id +"'",
|
}
|
|
Server.call("root/data/getEntitySet", param_, function(result) {
|
if (result && result.data) {
|
var data_ = result.data.entityset;
|
me.tableData2 = data_;
|
}
|
});
|
}
|
|
var urlParam = getGetParams(this.popupParames.url);
|
|
for(let key in urlParam) {
|
if(key == "fromDing") {
|
this.fromDing = urlParam[key];
|
}
|
}
|
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
document.getElementById('page_root').style.display = "block";
|
document.getElementById('page_loading').style.display = "none";
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
let w_ = this.$refs.popup_body.offsetWidth + "px";
|
let h_ = this.$refs.popup_body.offsetHeight + 40 + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
closeDialog() {
|
Root.hidePopup();
|
/* Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, true); */
|
},
|
saveRowTable() {
|
if(this.popupParames.callback) {
|
let obj = {
|
row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
Root.hidePopup();
|
});
|
}
|
else {
|
alert("该按键事件缺失!")
|
}
|
},
|
onServerInitData(data) {
|
|
},
|
|
onpassApproval(){
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = true;
|
},
|
onrefuseApproval(){
|
this.textarea2 = "";
|
this.reasonvisible = true;
|
this.passOrRefuse = false;
|
},
|
saveReason(){
|
let me = this;
|
if(this.passOrRefuse){
|
let param = {
|
flowId:this.formData.flow_id,
|
businessType:"protocol",
|
pass:true,
|
variableMap:{ reason:this.textarea2}
|
}
|
Server.call("root/api/dealAct", param, function(result) {
|
if (result.success){
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
});
|
|
if(me.fromDing) {
|
me.dingResult = true;
|
me.dingResultTxt = "审批成功"
|
return;
|
}
|
/* Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, true); */
|
Root.hidePopup();
|
}else{
|
Root.message({
|
type: 'warning',
|
message: result.message
|
});
|
}
|
})
|
}else{
|
if(this.textarea2 != ""){
|
let param = {
|
flowId:this.formData.flow_id,
|
businessType:"protocol",
|
pass:false,
|
variableMap:{ reason:this.textarea2}
|
}
|
Server.call("root/api/dealAct", param, function(result) {
|
if (result.success){
|
Root.message({
|
type: 'success',
|
message: '拒绝审批成功'
|
});
|
if(me.fromDing) {
|
me.dingResult = true;
|
me.dingResultTxt = "拒绝审批成功"
|
return;
|
}
|
/* Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, true); */
|
Root.hidePopup();
|
}else{
|
Root.message({
|
type: 'warning',
|
message: result.message
|
});
|
}
|
})
|
}
|
else{
|
Root.message({
|
type: 'warning',
|
message: '请填写原因'
|
});
|
}
|
}
|
},
|
/* editData(scope) {
|
if (this.selectrow != {}) {
|
this.selectrow.isWithinEdit = false;
|
}
|
this.selectrow = scope.row;
|
scope.row.isWithinEdit = scope.row.isWithinEdit ? false : true;
|
this.isRefresh = false;
|
this.$nextTick(function(){
|
this.isRefresh = true;
|
})
|
},
|
delData(scope) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
Root.confirm('确定删除-' + row.field2 + '-吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
me.tableData_new.remove(row);
|
me.tableData2.remove(row);
|
me.doQuery();
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
doQuery() {
|
let result = [];
|
if (this.formData.field2) {
|
result = this.tableData_new.filter(item => {
|
let bo = true;
|
let k_val = this.formData.field2;
|
let bo_ = item.field1.toLowerCase().indexOf(k_val.toLowerCase()) > -1;
|
if (!bo_) {
|
return false;
|
}
|
return bo;
|
});
|
}
|
this.tableData2 = result;
|
},
|
|
onInitQuery() {
|
this.formInline = {};
|
this.tableData_cus = this.tableData_cus_new;
|
this.onQuery();
|
},
|
cellInputChange(scope) {
|
let row = scope.row;
|
let field = scope.column.property;
|
if (field == "field7") {
|
row.field10 = (row.field7 ? row.field7 : 0) * (row.field9 ? row.field9 : 0);
|
}
|
if (field == "field9") {
|
row.field10 = (row.field7 ? row.field7 : 0) * (row.field9 ? row.field9 : 0);
|
}
|
this.isRefresh = false;
|
this.$nextTick(function(){
|
this.isRefresh = true;
|
})
|
},
|
onQuery() {
|
this.pagenum = 1;
|
this.doQuery_cus();
|
}, */
|
/* getData(page) {
|
this.pagesize = page.pagesize;
|
this.pagenum = page.pagenum;
|
this.doQuery_cus();
|
},
|
doQuery_cus() {
|
let result = this.tableData_cus_new.filter(item => {
|
let bo = true;
|
for(var k in this.formInline) {
|
let k_val = this.formInline[k];
|
let bo_ = item[k].toLowerCase().indexOf(k_val.toLowerCase()) > -1;
|
if (!bo_) {
|
return false;
|
}
|
}
|
return bo;
|
});
|
this.tableData_cus = result;
|
this.getData_cus();
|
},
|
getData_cus() {
|
this.total = this.tableData_cus.length;
|
this.tableData_cus2 = this.tableData_cus.slice((this.pagenum-1)*this.pagesize, this.pagenum * this.pagesize);
|
},
|
rowClickCus(obj) {
|
this.selectcusrow = obj.row;
|
}, */
|
|
//表单
|
showPopup(obj) {
|
/* let list=this.customerList;
|
this.selectFormField = obj.obj;
|
this.popupByFieldsDialog = true;
|
this.tableData_cus2 = this.tableData_cus;
|
this.getData_cus(); */
|
},
|
/*saveFormValByField() {
|
if (this.selectcusrow != {}) {
|
if(this.selectFormField.field == "field7" || this.selectFormField.field == "field3") {
|
this.$refs.form1.setFormValByField("field7", this.selectcusrow.field1);
|
this.$refs.form1.setFormValByField("field3", this.selectcusrow.field2);
|
}
|
|
this.popupByFieldsDialog = false;
|
}
|
else {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
})
|
}
|
}, */
|
}
|
});
|
</script>
|
|
<style>
|
.el-input__inner{
|
padding: 0 2px;
|
}
|
.header {
|
height: 21px;
|
}
|
.el-dialog__header {
|
border-bottom: 0;
|
}
|
.el-dialog__body {
|
text-align: center;
|
/* height: 200px; */
|
}
|
</style>
|
|
</body>
|
</html>
|