|
@@ -519,6 +519,8 @@
|
|
|
<!-- Test Data -->
|
|
|
<script type="text/javascript" src="/test/tmp_data/bills_grid_setting.js"></script>
|
|
|
<!-- view -->
|
|
|
+ <script type="text/javascript" src="/web/building_saas/main/js/views/project_info.js"></script>
|
|
|
+ <script type="text/javascript" src="/web/building_saas/main/js/views/project_view.js"></script>
|
|
|
<script type="text/javascript" src="/web/building_saas/main/js/main_ajax.js"></script>
|
|
|
<script type="text/javascript" src="/web/building_saas/main/js/main.js"></script>
|
|
|
<script type="text/javascript" src="/web/building_saas/main/js/controllers/project_controller.js"></script>
|
|
@@ -593,200 +595,4 @@
|
|
|
</SCRIPT>
|
|
|
<script type="text/javascript" src="/web/building_saas/main/js/views/gljView.js"></script>
|
|
|
</body>
|
|
|
-<script>
|
|
|
-
|
|
|
- var project;
|
|
|
- var controller;
|
|
|
- var billsSpread;
|
|
|
-
|
|
|
- $(document).ready(function () {
|
|
|
- GC.Spread.Common.CultureManager.culture("zh-cn");
|
|
|
-
|
|
|
- billsSpread = new GC.Spread.Sheets.Workbook($('#billsSpread')[0], { sheetCount: 1 });
|
|
|
- billsSpread.options.tabStripVisible = false;
|
|
|
- billsSpread.options.scrollbarMaxAlign = true;
|
|
|
- billsSpread.options.allowUserDragDrop = false;
|
|
|
- billsSpread.getActiveSheet().selectionPolicy(GC.Spread.Sheets.SelectionPolicy.single);
|
|
|
-
|
|
|
- // For Test
|
|
|
- /*datas.forEach(function (data) {
|
|
|
- data.fees = [];
|
|
|
- data.fees.push({fieldName: 'labour', unitFee: '1', totalFee: '2', tenderUnitFee: '3', tenderTotalFee: '4'});
|
|
|
- data.flags = [];
|
|
|
- data.flags.push({fieldName: 'isPartGather', flag: true});
|
|
|
- });
|
|
|
- drawing_data.forEach(function (data) {
|
|
|
- data.fees = [];
|
|
|
- data.fees.push({fieldName: 'machine', unitFee: '5', totalFee: '6', tenderUnitFee: '7', tenderTotalFee: '8'});
|
|
|
- data.flags = [];
|
|
|
- data.flags.push({fieldName: 'isPartGather', flag: false});
|
|
|
- });*/
|
|
|
-
|
|
|
- project = PROJECT.createNew(scUrlUtil.GetQueryString('project'), userID);
|
|
|
- project.loadDatas(function (err) {
|
|
|
- if (!err) {
|
|
|
- controller = TREE_SHEET_CONTROLLER.createNew(project.mainTree, billsSpread.getActiveSheet(), BillsGridSetting);
|
|
|
-
|
|
|
- controller.showTreeData();
|
|
|
- controller.bind('refreshBaseActn', function (tree) {
|
|
|
- var setButtonValid = function (valid, btn) {
|
|
|
- if (valid) {
|
|
|
- btn.removeClass('disabled');
|
|
|
- } else {
|
|
|
- btn.addClass('disabled');
|
|
|
- }
|
|
|
- };
|
|
|
- setButtonValid(tree.selected && tree.selected.canUpLevel(), $('#upLevel'));
|
|
|
- setButtonValid(tree.selected && tree.selected.canDownLevel(), $('#downLevel'));
|
|
|
- setButtonValid(tree.selected && tree.selected.canUpMove(), $('#upMove'));
|
|
|
- setButtonValid(tree.selected && tree.selected.canDownMove(), $('#downMove'));
|
|
|
- setButtonValid(tree.selected ? true : false, $('#delete'));
|
|
|
- });
|
|
|
-
|
|
|
- gljView.showDatas(project.GLJ.datas);
|
|
|
-// alert('GLJDatas1:' + objTest(project.GLJ.datas[0]));
|
|
|
-// project.FeeRate.getRate();
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $.contextMenu({
|
|
|
- selector: '#billsSpread',
|
|
|
- build: function ($trigger, e) {
|
|
|
- var target = SheetDataHelper.safeRightClickSelection($trigger, e, billsSpread);
|
|
|
- controller.setTreeSelected(controller.tree.items[target.row]);
|
|
|
- return target.hitTestType === GC.Spread.Sheets.SheetArea.viewport || target.hitTestType === GC.Spread.Sheets.SheetArea.rowHeader;
|
|
|
- },
|
|
|
- items: {
|
|
|
- "insertBills": {
|
|
|
- name: "插入清单",
|
|
|
- icon: 'fa-sign-in',
|
|
|
- disabled: function () {
|
|
|
- return project.mainTree.selected ? project.mainTree.selected.sourceType !== project.Bills.getSourceType() : false;
|
|
|
- },
|
|
|
- callback: function (key, opt) {
|
|
|
- ProjectController.addBills(project, controller);
|
|
|
- }
|
|
|
- },
|
|
|
- "insertRation": {
|
|
|
- name: "插入定额",
|
|
|
- icon: 'fa-sign-in',
|
|
|
- disabled: function () {
|
|
|
- var selected = project.mainTree.selected;
|
|
|
- if (selected) {
|
|
|
- if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
- return false;
|
|
|
- } else if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- return selected.source.children.length !== 0;
|
|
|
- };
|
|
|
- } else {
|
|
|
- return true;
|
|
|
- }
|
|
|
- },
|
|
|
- callback: function (key, opt) {
|
|
|
- ProjectController.addRation(project, controller);
|
|
|
- }
|
|
|
- },
|
|
|
- "insertLJ": {
|
|
|
- name: "插入量价",
|
|
|
- icon: 'fa-sign-in',
|
|
|
- disabled: function () {
|
|
|
- var selected = project.mainTree.selected;
|
|
|
- if (selected) {
|
|
|
- if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
- return false;
|
|
|
- } else if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- return selected.source.children.length !== 0;
|
|
|
- };
|
|
|
- } else {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- "spr1": '--------',
|
|
|
- "delete": {
|
|
|
- name: '删除',
|
|
|
- icon: 'fa-remove',
|
|
|
- disabled: function () {
|
|
|
- var selected = project.mainTree.selected;
|
|
|
- return !selected;
|
|
|
- },
|
|
|
- callback: function () {
|
|
|
- var selected = controller.tree.selected;
|
|
|
- if (selected) {
|
|
|
- if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- project.Bills.deleteBills(selected.source);
|
|
|
- controller.delete();
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $('#insert').click(function () {
|
|
|
- var selected = controller.tree.selected;
|
|
|
-
|
|
|
- if (!selected || selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- ProjectController.addBills(project, controller);
|
|
|
- } else if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
- ProjectController.addRation(project, controller);
|
|
|
- }
|
|
|
- });
|
|
|
- $('#delete').click(function () {
|
|
|
- var selected = controller.tree.selected;
|
|
|
- if (selected) {
|
|
|
- if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- project.Bills.deleteBills(selected.source);
|
|
|
- controller.delete();
|
|
|
- } else if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
- project.Ration.delete(selected.source);
|
|
|
- controller.delete();
|
|
|
- };
|
|
|
- }
|
|
|
- });
|
|
|
- $('#upLevel').click(function () {
|
|
|
- console.log(project.Bills.tree.getInsertData(project.Bills.tree.selected.getParentID(), project.Bills.tree.selected.getNextSiblingID()));
|
|
|
- var selected = controller.tree.selected;
|
|
|
- if (selected && selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- selected.source.upLevel();
|
|
|
- controller.upLevel();
|
|
|
- }
|
|
|
- });
|
|
|
- $('#downLevel').click(function () {
|
|
|
- var selected = controller.tree.selected;
|
|
|
- if (selected && selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- selected.source.upLevel();
|
|
|
- controller.downLevel();
|
|
|
- }
|
|
|
- });
|
|
|
- $('#upMove').click(function () {
|
|
|
- var selected = controller.tree.selected, pre, preSerialNo;
|
|
|
- if (selected) {
|
|
|
- if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- selected.source.upLevel();
|
|
|
- controller.upMove();
|
|
|
- } else if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
- project.Ration.changePos(selected.source, selected.preSibling.source);
|
|
|
- controller.upMove();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- $('#downMove').click(function () {
|
|
|
- var selected = controller.tree.selected, next, nextSerialNo;
|
|
|
- if (selected) {
|
|
|
- if (selected.sourceType === project.Bills.getSourceType()) {
|
|
|
- selected.source.downLevel();
|
|
|
- controller.downMove();
|
|
|
- } else if (selected.sourceType === project.Ration.getSourceType()) {
|
|
|
- project.Ration.changePos(selected.source, selected.nextSibling.source);
|
|
|
- controller.downMove();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-</script>
|
|
|
</html>
|