Kaynağa Gözat

安全生产经费相关

MaiXinRong 1 yıl önce
ebeveyn
işleme
0da8162b86

+ 2 - 1
app/const/payment.js

@@ -77,7 +77,8 @@ const signature_msg = {
 };
 
 const defaultSafeBills = [
-    { b_code: '', name: '安全生产费用清单', tree_id: 1, tree_pid: -1, tree_level: 1, tree_order: 1, tree_full_path: '1', tree_is_leaf: 1 }
+    { b_code: '', name: '安全生产费用清单', tree_id: 1, tree_pid: -1, tree_level: 1, tree_order: 1, tree_full_path: '1', tree_is_leaf: 0 },
+    { b_code: '', name: '请输入费用名称', tree_id: 2, tree_pid: 1, tree_level: 2, tree_order: 1, tree_full_path: '1-2', tree_is_leaf: 1 },
 ];
 
 module.exports = {

+ 3 - 3
app/public/js/payment_safe.js

@@ -27,7 +27,7 @@ $(document).ready(function() {
             this.spreadSetting = {
                 cols: [
                     {title: '编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 230, formatter: '@', cellType: 'tree'},
-                    {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
+                    {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@', cellType: 'autoTip'},
                     {title: '规格', colSpan: '1', rowSpan: '2', field: 'spec', hAlign: 0, width: 150, formatter: '@'},
                     {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
                     {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 80, type: 'Number'},
@@ -202,7 +202,7 @@ $(document).ready(function() {
             let count = 1;
             if (sel.rowCount > 1) {
                 for (let r = 1; r < sel.rowCount; r++) {
-                    const rNode = sheet.zh_tree.nodes[sel.row + r];
+                    const rNode = this.sheet.zh_tree.nodes[sel.row + r];
                     if (rNode.tree_level > node.tree_level) continue;
                     if ((rNode.tree_level < node.tree_level) || (rNode.tree_level === node.tree_level && rNode.tree_pid !== node.tree_pid)) {
                         toastr.warning('请选择同一节点下的节点,进行该操作');
@@ -912,7 +912,7 @@ $(document).ready(function() {
                         mainSheet.setSelection(billsObj.tree.nodes.indexOf(node), sel.col, 1, sel.colCount);
                         SpreadJsObj.reloadRowsBackColor(mainSheet, [sel.row, billsObj.tree.nodes.indexOf(node)]);
                     }
-                    billsObj.refreshOperationValid;
+                    billsObj.refreshOperationValid();
                     billsObj.spread.focus();
                 });
             } else {

+ 2 - 1
app/service/payment_safe_bills.js

@@ -412,6 +412,7 @@ module.exports = app => {
             };
             let parent = await this.getDataByKid(detail.id, targetId);
             if (targetId && !parent) throw '新增节点数据错误,请刷新页面重试';
+            const orgParentId = parent.id;
             let children = await this.getChildrenByParentId(detail.id, targetId);
             const updateParent = children.length === 0;
 
@@ -455,7 +456,7 @@ module.exports = app => {
             const createData = await this.getDataByFullPath(detail.id, insertData[0][this.setting.fullPath] + '%');
             const updateData = await this.getNextsData(detail.id, targetId, insertData[0][this.setting.order]);
             if (updateParent) {
-                updateData.push(await this.getDataById(parent.id));
+                updateData.push(await this.getDataByKid(detail.id, targetId));
             }
             return { create: createData, update: updateData };
         }