Bläddra i källkod

feat: 清单精灵后台增加区间列

vian 3 år sedan
förälder
incheckning
b6401e9419

+ 1 - 0
modules/all_models/std_billsGuidance_items.js

@@ -25,6 +25,7 @@ const stdBillsGuidanceItems = new Schema({
     outputItemCharacter: {type: Boolean, default: false},
     required: {type: Boolean, default: false},
     unit: String, // 单位,辅助运距功能
+    interval: String, // 区间,辅助运距功能
     isMaterial: {type: Boolean, default: false}, // 材料,辅助替换材料规格
     isDefaultOption: {type: Boolean, default: false}, // 是否是默认选项
 }, {versionKey: false});

+ 40 - 13
web/maintain/billsGuidance_lib/js/billsGuidance.js

@@ -168,7 +168,7 @@ const billsGuidance = (function () {
                 }
             },
             {
-                width: 50,
+                width: 40,
                 readOnly: locked,
                 head: {
                     titleNames: ["单位"],
@@ -187,6 +187,25 @@ const billsGuidance = (function () {
                 }
             },
             {
+                width: 80,
+                readOnly: locked,
+                head: {
+                    titleNames: ["区间"],
+                    spanCols: [1],
+                    spanRows: [1],
+                    vAlign: [1],
+                    hAlign: [1],
+                    font: ["Arial"]
+                },
+                data: {
+                    field: "interval",
+                    vAlign: 1,
+                    hAlign: 1,
+                    font: "Arial",
+                    formatter: "@"
+                }
+            },
+            {
                 width: 40,
                 readOnly: true,
                 head: {
@@ -205,7 +224,7 @@ const billsGuidance = (function () {
                 }
             },
             {
-                width: 40,
+                width: 30,
                 readOnly: true,
                 head: {
                     titleNames: ["必填"],
@@ -223,7 +242,7 @@ const billsGuidance = (function () {
                 }
             },
             {
-                width: 40,
+                width: 30,
                 readOnly: true,
                 head: {
                     titleNames: ["材料"],
@@ -241,10 +260,10 @@ const billsGuidance = (function () {
                 }
             },
             {
-                width: 40,
+                width: 30,
                 readOnly: true,
                 head: {
-                    titleNames: ["默认"],
+                    titleNames: ["默认"],
                     spanCols: [1],
                     spanRows: [1],
                     vAlign: [1],
@@ -262,11 +281,12 @@ const billsGuidance = (function () {
         },
         headers: [
             {name: '项目指引', dataCode: 'name', width: 400, vAlign: 'center', hAlign: 'left', formatter: '@'},
-            {name: '单位', dataCode: 'unit', width: 50, vAlign: 'center', hAlign: 'center', formatter: '@'},
+            {name: '单位', dataCode: 'unit', width: 40, vAlign: 'center', hAlign: 'center', formatter: '@'},
+            {name: '区间', dataCode: 'interval', width: 80, vAlign: 'center', hAlign: 'center', formatter: '@'},
             {name: '输出特征', dataCode: 'outputItemCharacter', width: 40, vAlign: 'center', hAlign: 'center'},
-            {name: '必填', dataCode: 'required', width: 40, vAlign: 'center', hAlign: 'center'},
-            {name: '材料', dataCode: 'isMaterial', width: 40, vAlign: 'center', hAlign: 'center'},
-            {name: '默认值', dataCode: 'isDefaultOption', width: 40, vAlign: 'center', hAlign: 'center'},
+            {name: '必填', dataCode: 'required', width: 30, vAlign: 'center', hAlign: 'center'},
+            {name: '材料', dataCode: 'isMaterial', width: 30, vAlign: 'center', hAlign: 'center'},
+            {name: '默认', dataCode: 'isDefaultOption', width: 30, vAlign: 'center', hAlign: 'center'},
         ],
         events: {
             SelectionChanged: function (sender, info) {
@@ -671,12 +691,15 @@ const billsGuidance = (function () {
         if (locked) {
             return;
         }
-        // 单位,可输入单位文本。仅特征/工序行可输入
+        // 单位仅特征/工序行可输入
+        // 区间仅仅选项行可输入
         const unitCol = guideItem.headers.findIndex(item => item.dataCode === 'unit');
+        const intervalCol = guideItem.headers.findIndex(item => item.dataCode === 'interval');
         renderSheetFunc(sheet, function () {
             nodes.forEach(node => {
                 const row = node.serialNo();
                 sheet.getCell(row, unitCol).locked(!isProcessNode(node));
+                sheet.getCell(row, intervalCol).locked(!isOptionNode(node));
             });
         });
 
@@ -1275,7 +1298,7 @@ const billsGuidance = (function () {
         for(let cell of cells){
             const field = guideItem.headers[cell.col].dataCode;
             let node = bills.tree.selected.guidance.tree.items[cell.row];
-            if (field === 'name' || field === 'unit') {
+            if (field === 'name' || field === 'unit' || field === 'interval') {
                 let text = sheet.getValue(cell.row, cell.col);
                 text = text ? text.toString() : '';
                 text = text.replace(deESC, '');
@@ -1474,7 +1497,7 @@ const billsGuidance = (function () {
         updateDatas.push({updateType: updateType.update, findData: {ID: selected.getParentID()}, updateData: {NextSiblingID: selected.getID()}});
         //更新选中节点
         updateDatas.push({updateType: updateType.update, findData: {ID: selected.getID()},
-            updateData: {ParentID: selected.parent.getParentID(), NextSiblingID: selected.parent.getNextSiblingID(), unit: ''}});
+            updateData: {ParentID: selected.parent.getParentID(), NextSiblingID: selected.parent.getNextSiblingID(), unit: '', interval: ''}});
         if(selected.nextSibling && selected.children.length > 0){
             //更新选中节点最末子节点
             let lastChild = selected.children[selected.children.length - 1];
@@ -1497,7 +1520,9 @@ const billsGuidance = (function () {
             setNodesColor(sheet, bills.tree.selected.guidance.tree.items);
             setProcessNodes(sheet, bills.tree.selected.guidance.tree.items);
             const unitCol = guideItem.headers.findIndex(item => item.dataCode === 'unit');
+            const intervalCol = guideItem.headers.findIndex(item => item.dataCode === 'interval');
             sheet.setValue(selected.serialNo(), unitCol, '');
+            sheet.setValue(selected.serialNo(), intervalCol, '');
             $.bootstrapLoading.end();
             guideItem.workBook.focus(true)//31574
         });
@@ -1517,7 +1542,7 @@ const billsGuidance = (function () {
             updateDatas.push({updateType: updateType.update, findData: {ID: lastChild.getID()}, updateData: {NextSiblingID: selected.getID()}});
         }
         //更新选中节点
-        updateDatas.push({updateType: updateType.update, findData: {ID: selected.getID()}, updateData: {ParentID: selected.preSibling.getID(), NextSiblingID: -1, unit: ''}});
+        updateDatas.push({updateType: updateType.update, findData: {ID: selected.getID()}, updateData: {ParentID: selected.preSibling.getID(), NextSiblingID: -1, unit: '', interval: ''}});
         updateGuideItems(updateDatas, function () {
             controller.downLevel();
             const sheet = guideItem.workBook.getActiveSheet();
@@ -1525,7 +1550,9 @@ const billsGuidance = (function () {
             setNodesColor(sheet, bills.tree.selected.guidance.tree.items);
             setProcessNodes(sheet, bills.tree.selected.guidance.tree.items);
             const unitCol = guideItem.headers.findIndex(item => item.dataCode === 'unit');
+            const intervalCol = guideItem.headers.findIndex(item => item.dataCode === 'interval');
             sheet.setValue(selected.serialNo(), unitCol, '');
+            sheet.setValue(selected.serialNo(), intervalCol, '');
             $.bootstrapLoading.end();
             guideItem.workBook.focus(true)
         });