Browse Source

查找定位,显示部位

MaiXinRong 2 years ago
parent
commit
fd57ba30ce

+ 0 - 1
app/public/js/budget_detail.js

@@ -703,7 +703,6 @@ $(document).ready(() => {
         page: 'budget' + window.location.pathname.split('/')[3],
         tid: window.location.pathname.split('/')[2],
     };
-    console.log(window.location.pathname.split('/')[2]);
     // 展开收起标准清单
     $('a', 'ul.right-nav').bind('click', function (e) {
         e.preventDefault();

+ 8 - 6
app/public/js/change_revise.js

@@ -2481,12 +2481,13 @@ $(document).ready(() => {
                         searchEmpty: true,
                         resultSpreadSetting: {
                             cols: [
-                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@', readOnly: true},
-                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
-                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
-                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
-                                {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
+                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@'},
+                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
+                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
+                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
+                                {title: '数量', field: 'quantity', hAlign: 2, width: 50},
+                                {title: '部位', field: 'bw', hAlign: 2, width: 90},
                             ],
                             emptyRows: 0,
                             headRows: 1,
@@ -2496,6 +2497,7 @@ $(document).ready(() => {
                             headerFont: '12px 微软雅黑',
                             font: '12px 微软雅黑',
                             selectedBackColor: '#fffacd',
+                            readOnly: true,
                         },
                         afterLocated: function () {
                             posSpreadObj.loadCurPosData();

+ 8 - 6
app/public/js/ledger.js

@@ -2456,12 +2456,13 @@ $(document).ready(function() {
                         searchSpread: ledgerSpread,
                         resultSpreadSetting: {
                             cols: [
-                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@', readOnly: true},
-                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
-                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
-                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
-                                {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
+                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@'},
+                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
+                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
+                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
+                                {title: '数量', field: 'quantity', hAlign: 2, width: 50},
+                                {title: '部位', field: 'bw', hAlign: 2, width: 90},
                             ],
                             emptyRows: 0,
                             headRows: 1,
@@ -2471,6 +2472,7 @@ $(document).ready(function() {
                             headerFont: '12px 微软雅黑',
                             font: '12px 微软雅黑',
                             selectedBackColor: '#fffacd',
+                            readOnly: true,
                         },
                         afterLocated: function () {
                             posOperationObj.loadCurPosData();

+ 8 - 6
app/public/js/ledger_audit.js

@@ -217,12 +217,13 @@ $(document).ready(() => {
                         searchSpread: ledgerSpread,
                         resultSpreadSetting: {
                             cols: [
-                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@', readOnly: true},
-                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
-                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
-                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
-                                {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
+                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@'},
+                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
+                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
+                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
+                                {title: '数量', field: 'quantity', hAlign: 2, width: 50},
+                                {title: '部位', field: 'bw', hAlign: 2, width: 90},
                             ],
                             emptyRows: 0,
                             headRows: 1,
@@ -232,6 +233,7 @@ $(document).ready(() => {
                             headerFont: '12px 微软雅黑',
                             font: '12px 微软雅黑',
                             selectedBackColor: '#fffacd',
+                            readOnly: true
                         },
                         afterLocated: function () {
                             loadCurPosData();

+ 8 - 6
app/public/js/revise.js

@@ -2705,12 +2705,13 @@ $(document).ready(() => {
                         searchSpread: billsSpread,
                         resultSpreadSetting: {
                             cols: [
-                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@', readOnly: true},
-                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
-                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
-                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
-                                {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
+                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@'},
+                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
+                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
+                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
+                                {title: '数量', field: 'quantity', hAlign: 2, width: 50},
+                                {title: '部位', field: 'bw', hAlign: 2, width: 90},
                             ],
                             emptyRows: 0,
                             headRows: 1,
@@ -2720,6 +2721,7 @@ $(document).ready(() => {
                             headerFont: '12px 微软雅黑',
                             font: '12px 微软雅黑',
                             selectedBackColor: '#fffacd',
+                            readOnly: true,
                         },
                         afterLocated: function () {
                             posSpreadObj.loadCurPosData();

+ 8 - 6
app/public/js/revise_history.js

@@ -234,12 +234,13 @@ $(document).ready(() => {
                         searchSpread: billsSpread,
                         resultSpreadSetting: {
                             cols: [
-                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@', readOnly: true},
-                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@', readOnly: true},
-                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@', readOnly: true},
-                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50, readOnly: true},
-                                {title: '数量', field: 'quantity', hAlign: 2, width: 50, readOnly: true},
+                                {title: '项目节编号', field: 'code', hAlign: 0, width: 90, formatter: '@'},
+                                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
+                                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},
+                                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},
+                                {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
+                                {title: '数量', field: 'quantity', hAlign: 2, width: 50},
+                                {title: '部位', field: 'bw', hAlign: 2, width: 90},
                             ],
                             emptyRows: 0,
                             headRows: 1,
@@ -249,6 +250,7 @@ $(document).ready(() => {
                             headerFont: '12px 微软雅黑',
                             font: '12px 微软雅黑',
                             selectedBackColor: '#fffacd',
+                            readOnly: true,
                         },
                         afterLocated: function () {
                             posSpreadObj.loadCurPosData();

+ 31 - 0
app/public/js/shares/cs_tools.js

@@ -527,6 +527,36 @@ const showSelectTab = function(select, spread, afterShow) {
                 searchBills();
             }
         };
+        const get18Bw = function(tree, data) {
+            let parent = tree.getParent(data);
+            while (parent && parent.code.test(/^[a-zA-Z]/)) {
+                parent = tree.getParent(parent);
+            }
+            return parent ? parent.code : '';
+        };
+        const get08Bw = function(tree, data) {
+            let parent = tree.getParent(data);
+            let lastXmjCode = '', level4XmjCode = '';
+            while (parent) {
+                if (parent.code && !lastXmjCode) lastXmjCode = parent.code;
+                if (parent.code && parent.level === 4) level4XmjCode = parent.code;
+                parent = tree.getParent(parent);
+            }
+            return level4XmjCode || lastXmjCode;
+        };
+        const getBw = function (data) {
+            if (!data.b_code) return '';
+            if (searchSheet.zh_dataType !== SpreadJsObj.DataType.Tree) return '';
+
+            const sortTree = searchSheet.zh_tree;
+            if (!sortTree.checkCodeType) return '';
+
+            if (sortTree.checkCodeType() === '18') {
+                return get18Bw(sortTree, data)
+            } else {
+                return get08Bw(sortTree, data);
+            }
+        };
         const searchBills = function () {
             const keyword = $('#searchKeyword', obj).val();
             const keyNum = _.toNumber(keyword);
@@ -540,6 +570,7 @@ const showSelectTab = function(select, spread, afterShow) {
                 ) {
                     const data = JSON.parse(JSON.stringify(node));
                     data.visible = true;
+                    data.bw = getBw(data);
                     searchResult.push(data);
                 }
             }

+ 1 - 0
app/public/js/sr_detail.js

@@ -1073,6 +1073,7 @@ $(document).ready(() => {
                             {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
                             {title: '数量', field: 'quantity', hAlign: 2, width: 50},
                             {title: '完成率(%)', field: 'complete_percent', hAlign: 2, width: 70},
+                            {title: '部位', field: 'bw', hAlign: 2, width: 90},
                         ],
                         emptyRows: 0,
                         headRows: 1,

+ 1 - 0
app/public/js/stage.js

@@ -4089,6 +4089,7 @@ $(document).ready(() => {
                             {title: '单价', field: 'unit_price', hAlign: 2, width: 50},
                             {title: '数量', field: 'quantity', hAlign: 2, width: 50},
                             {title: '完成率(%)', field: 'end_gather_percent', hAlign: 2, width: 70},
+                            {title: '部位', field: 'bw', hAlign: 2, width: 90},
                         ],
                         emptyRows: 0,
                         headRows: 1,