Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
c6d19c3a
Commit
c6d19c3a
authored
Oct 26, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] fixed uigrid to dxgrid and view active menu
parent
7bc96dd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
221 additions
and
42 deletions
+221
-42
app-approve.ctrl.js
...main/webapp/app/framework/app-approve/app-approve.ctrl.js
+152
-41
app-approve.html
...rc/main/webapp/app/framework/app-approve/app-approve.html
+69
-1
No files found.
atms-web/src/main/webapp/app/framework/app-approve/app-approve.ctrl.js
View file @
c6d19c3a
...
@@ -628,20 +628,164 @@
...
@@ -628,20 +628,164 @@
return
typeof
floatVal
==
'undefined'
?
Math
.
round
(
randVal
)
:
randVal
.
toFixed
(
floatVal
);
return
typeof
floatVal
==
'undefined'
?
Math
.
round
(
randVal
)
:
randVal
.
toFixed
(
floatVal
);
}
}
var
loadApprovalFromDB
=
function
(
pageIndex
)
{
var
loadApprovalFromDB
=
function
()
{
vatApproveService
.
approvalTasks
().
success
(
function
(
data
)
{
vatApproveService
.
approvalTasks
().
success
(
function
(
data
)
{
if
(
data
)
{
if
(
data
)
{
var
index
=
1
;
$scope
.
gridOptions
=
{
data
.
forEach
(
function
(
v
)
{
dataSource
:
data
,
v
.
index
=
index
++
;
keyExpr
:
"instanceId"
,
v
.
amount
=
PWC
.
round
(
v
.
amount
,
2
);
showBorders
:
true
,
v
.
taxAmount
=
PWC
.
round
(
v
.
taxAmount
,
2
);
editing
:
{
});
mode
:
"form"
,
$scope
.
gridOptions
.
data
=
data
;
allowUpdating
:
true
},
columns
:
[
{
caption
:
'项目名称'
,
width
:
'12%'
,
dataField
:
"projectName"
},
{
caption
:
'期间'
,
width
:
'7%'
,
dataField
:
"period"
},
{
caption
:
'提审人'
,
width
:
'10%'
,
dataField
:
"createBy"
},
{
caption
:
'审批人'
,
width
:
'10%'
,
dataField
:
"approvalBy"
},
{
caption
:
'审批状态'
,
width
:
'10%'
,
dataField
:
"status"
},
{
caption
:
'审批意见'
,
width
:
'15%'
,
dataField
:
"approvalResult"
},
{
caption
:
'创建时间'
,
width
:
'7.5%'
,
dataField
:
"createTime"
},
{
caption
:
'审批时间'
,
width
:
'7.5%'
,
dataField
:
"approvalTime"
}
],
onRowClick
:
function
(
e
)
{
$scope
.
newProductModalInstance
=
ackUibModal
(
$scope
,
'addNewProduct.html'
,
'addNewProduct'
,
'.app-overview '
,
'static'
)
$scope
.
newProductModalInstance
.
open
();
}
};
}
}
});
});
};
};
$scope
.
cancel
=
function
()
{
$scope
.
newProductModalInstance
.
cancel
();
};
$scope
.
modalService
=
{
open
:
function
()
{
$scope
.
product
=
{
fYear
:
""
,
fSetId
:
""
,
fSetName
:
""
,
fManager
:
""
};
var
treeView
;
var
syncTreeViewSelection
=
function
(
treeView
)
{
if
(
!
treeView
)
return
;
if
(
!
$scope
.
treeBoxValue
)
{
treeView
.
unselectAll
();
return
;
}
$scope
.
treeBoxValue
.
forEach
(
function
(
key
)
{
treeView
.
selectItem
(
key
);
});
};
$scope
.
treeBoxValue
=
[
""
];
$scope
.
treeDataSource
=
[];
$scope
.
treeBoxNameValue
=
[
""
];
// productService.getProductList().success(function (data) {
// data.forEach(function (v) {
// if (!v.productIDs) {
// var item = new Object;
// item.name = v.fSetName;
// item.content = { id: v.fSetCode, guid: v.id};
// $scope.treeDataSource.push(item);
// }
// });
// });
$scope
.
treeBoxOptions
=
{
bindingOptions
:
{
value
:
'treeBoxNameValue'
},
valueExpr
:
"ID"
,
displayExpr
:
"name"
,
placeholder
:
"选择..."
,
showClearButton
:
false
,
dataSource
:
$scope
.
treeDataSource
,
onValueChanged
:
function
()
{
syncTreeViewSelection
(
treeView
);
},
treeView
:
{
dataSource
:
$scope
.
treeDataSource
,
dataStructure
:
"plain"
,
keyExpr
:
"ID"
,
parentIdExpr
:
"categoryId"
,
displayExpr
:
"name"
,
selectByClick
:
true
,
selectNodesRecursive
:
false
,
showCheckBoxesMode
:
"normal"
,
bindingOptions
:
{
selectionMode
:
"selectionMode"
},
onContentReady
:
function
(
e
)
{
treeView
=
e
.
component
;
syncTreeViewSelection
(
treeView
);
},
onItemSelectionChanged
:
function
(
args
)
{
var
keyValue
=
args
.
component
.
getSelectedNodesKeys
();
if
(
keyValue
.
length
===
0
)
{
keyValue
=
[
""
];
}
var
value
=
[
""
];
var
nodes
=
args
.
component
.
getNodes
();
var
newValue
=
[
""
];
var
nameValue
=
[
""
];
keyValue
.
forEach
(
function
(
v
)
{
var
findResult
=
_
.
find
(
nodes
,
function
(
node
)
{
return
node
.
key
===
v
;
});
if
(
findResult
)
{
newValue
.
push
(
findResult
.
itemData
.
content
.
guid
);
value
.
push
(
findResult
.
itemData
.
content
.
id
);
nameValue
.
push
(
findResult
.
itemData
.
name
);
}
});
$scope
.
treeBoxValue
=
keyValue
;
$scope
.
newNewtreeBoxValue
=
value
;
$scope
.
newTreeBoxValue
=
newValue
;
var
tempArray
=
nameValue
.
length
===
1
?
nameValue
:
nameValue
.
shift
();
$scope
.
treeBoxNameValue
=
nameValue
;
}
}
};
$timeout
(
function
()
{
var
ele2
=
$
(
"#productStartDate"
);
ele2
.
datepicker
({
startDate
:
$scope
.
startDate
,
endDate
:
$scope
.
endDate
,
language
:
region
,
viewMode
:
$scope
.
viewMode
,
minViewMode
:
$scope
.
viewMode
,
autoclose
:
true
,
//选中之后自动隐藏日期选择框
clearBtn
:
true
,
//清除按钮
todayBtn
:
false
,
//今日按钮
format
:
$scope
.
dateFormat
//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
}).
on
(
'changeDate'
,
function
(
e
)
{
$scope
.
changeStartDate
(
e
);
});
ele2
.
datepicker
(
"setDate"
,
$scope
.
selectedStartDate
);
},
100
);
$scope
.
newProductModalInstance
=
ackUibModal
(
$scope
,
'addNewProduct.html'
,
'addNewProduct'
,
'.app-overview '
,
'static'
)
$scope
.
newProductModalInstance
.
open
();
},
save
:
function
(
result
)
{
$scope
.
saveProduct
();
$scope
.
newProductModalInstance
.
close
();
},
cancel
:
function
()
{
$scope
.
newProductModalInstance
.
cancel
();
}
};
(
function
initialize
()
{
(
function
initialize
()
{
initDatePickers
();
initDatePickers
();
...
@@ -659,39 +803,6 @@
...
@@ -659,39 +803,6 @@
orgDisplay
.
main
();
orgDisplay
.
main
();
loadApprovalFromDB
();
loadApprovalFromDB
();
});
});
/**
private String projectName;
private Integer period;
private String instanceId;
private String createBy;
private String approvalBy;
private String status;
private String approvalResult;
private Date createTime;
private Date approvalTime;
private String reportPaths;
*/
$scope
.
gridOptions
=
{
rowHeight
:
constant
.
UIGrid
.
rowHeight
,
selectionRowHeaderWidth
:
constant
.
UIGrid
.
rowHeight
,
virtualizationThreshold
:
50
,
//默认加载50条数据,避免在数据展示时,只显示前面4条
enableSorting
:
false
,
enableColumnMenus
:
false
,
columnDefs
:
[
{
name
:
'序号'
,
width
:
'7%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>'
},
{
name
:
'项目名称'
,
width
:
'12%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.projectName}}<span></div>'
},
{
name
:
'期间'
,
width
:
'7%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.period}}<span></div>'
},
{
name
:
'提审人'
,
width
:
'10%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.createBy}}</span></div>'
},
{
name
:
'审批人'
,
width
:
'10%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span> {{row.entity.approvalBy}}</span></div>'
},
{
name
:
'审批状态'
,
width
:
'10%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.status}}</span></div>'
},
{
name
:
'审批意见'
,
width
:
'15%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.approvalResult}}</span></div>'
},
{
name
:
'创建时间'
,
width
:
'7.5%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.createTime | date:"yyyy-MM-dd"}}</span></div>'
},
{
name
:
'审批时间'
,
width
:
'7.5%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>{{row.entity.approvalTime | date:"yyyy-MM-dd"}}</span></div>'
},
{
name
:
'操作'
,
width
:
'15%'
,
cellTemplate
:
'<div class="ui-grid-cell-contents"><span>审批</span>|<span>下载</span>|<span>流程图</span></div>'
}
]
};
})();
})();
}
}
]);
]);
atms-web/src/main/webapp/app/framework/app-approve/app-approve.html
View file @
c6d19c3a
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
</div>
</div>
<div
class=
"vat-preview-input-invoice"
id=
"mainPreviewDiv"
>
<div
class=
"vat-preview-input-invoice"
id=
"mainPreviewDiv"
>
<div
id=
"mainAreaDiv"
class=
"main-area"
>
<div
id=
"mainAreaDiv"
class=
"main-area"
>
<div
class=
"inputInvoiceGrid"
ui-grid-expandable
ui
-grid=
"gridOptions"
>
<div
class=
"inputInvoiceGrid"
id=
"grid"
dx-data
-grid=
"gridOptions"
>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
><span
translate=
"NoDataAvailable"
></span>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
><span
translate=
"NoDataAvailable"
></span>
</div>
</div>
</div>
</div>
...
@@ -96,4 +96,71 @@
...
@@ -96,4 +96,71 @@
</div>
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/ng-template"
id=
"addNewProduct.html"
>
<
div
class
=
"modal-header"
>
<
div
class
=
"modal-title"
id
=
"modal-title"
>
新增产品
<
/div
>
<
/div
>
<
div
class
=
"modal-body"
id
=
"modal-body"
>
<
div
class
=
"content"
>
<
form
name
=
"add-product-form"
id
=
"add-product-form"
class
=
"form-horizontal"
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"year"
class
=
"col-sm-3 control-label"
>
年份
<
/label
>
<
div
class
=
"col-sm-8 input-group"
>
<
input
class
=
"form-control"
name
=
"year"
id
=
"year"
ng
-
model
=
"product.fYear"
maxlength
=
"50"
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"setId"
class
=
"col-sm-3 control-label"
>
产品标识
<
/label
>
<
div
class
=
"col-sm-8 input-group"
>
<
input
class
=
"form-control"
name
=
"setId"
id
=
"setId"
ng
-
model
=
"product.fSetId"
maxlength
=
"50"
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"setCode"
class
=
"col-sm-3 control-label"
>
产品编号
<
/label
>
<
div
class
=
"col-sm-8 input-group"
>
<
input
class
=
"form-control"
name
=
"setCode"
id
=
"setCode"
ng
-
model
=
"product.fSetCode"
maxlength
=
"50"
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"aliaSetCode"
class
=
"col-sm-3 control-label"
>
关联产品
<
/label
>
<
div
class
=
"col-sm-8 input-group"
>
<
div
class
=
"dx-field-value"
style
=
"width:265px"
>
<
div
dx
-
drop
-
down
-
box
=
"treeBoxOptions"
>
<
div
data
-
options
=
"dxTemplate: { name: 'content' }"
>
<
div
dx
-
tree
-
view
=
"treeBoxOptions.treeView"
><
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"setName"
class
=
"col-sm-3 control-label"
>
产品描述
<
/label
>
<
div
class
=
"col-sm-8 input-group"
>
<
input
class
=
"form-control"
name
=
"setName"
id
=
"setName"
ng
-
model
=
"product.fSetName"
maxlength
=
"50"
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"manager"
class
=
"col-sm-3 control-label"
>
财务主管
<
/label
>
<
div
class
=
"col-sm-8 input-group"
>
<
input
class
=
"form-control"
name
=
"manager"
id
=
"manager"
ng
-
model
=
"product.fManager"
maxlength
=
"50"
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
style
=
"margin-bottom:5px"
>
<
label
for
=
"startDate"
class
=
"col-sm-3 control-label"
>
启用日期
<
/label
>
<
div
class
=
"overview-picker"
>
<
input
type
=
"text"
id
=
"productStartDate"
class
=
"datepicker vat-subheader"
style
=
"width:200px;"
readonly
=
"readonly"
/>
<
i
class
=
"fa fa-calendar vat-subheader red-color"
style
=
"width:20px;"
><
/i
>
<
/div
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-third"
data
-
dismiss
=
"modal"
ng
-
click
=
"cancel()"
>
{{
'Cancel'
|
translate
}}
<
/button
>
<
/div
>
</script>
</div>
</div>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment