|
|
@@ -138,6 +138,54 @@ if (typeof baseFigureTemplate !== 'undefined' && baseFigureTemplate.budget) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+if (typeof gljOprObj !== 'undefined') {
|
|
|
+ // 添加、替换工料机界面工料机排序
|
|
|
+ gljOprObj.sortSelectViewGLJ = function (data) {
|
|
|
+ // 工料机编码:按“-”前的数值排序
|
|
|
+ const reg = /[^-]+/;
|
|
|
+ data.sort((a, b) => {
|
|
|
+ const orgCodeA = a.code;
|
|
|
+ const orgCodeB = b.code;
|
|
|
+ const regCodeA = orgCodeA.match(reg);
|
|
|
+ const regCodeB = orgCodeB.match(reg);
|
|
|
+ const compareCodeA = regCodeA
|
|
|
+ ? +regCodeA[0]
|
|
|
+ ? +regCodeA[0]
|
|
|
+ : regCodeA[0]
|
|
|
+ : orgCodeA;
|
|
|
+ const compareCodeB = regCodeB
|
|
|
+ ? +regCodeB[0]
|
|
|
+ ? +regCodeB[0]
|
|
|
+ : regCodeB
|
|
|
+ : orgCodeB;
|
|
|
+ return isNaN(compareCodeA) && isNaN(compareCodeB)
|
|
|
+ ? compareCodeA.localeCompare(compareCodeB)
|
|
|
+ : compareCodeA - compareCodeB;
|
|
|
+ });
|
|
|
+ // 工料机类型排序:人工、机上人工、混凝土、砂浆、配合比、普通材料、商品混凝土、商品砂浆、外购砼构件、绿化苗木、机械台班、机械组成物、设备。
|
|
|
+ const TypeMap = {
|
|
|
+ 1: 1,
|
|
|
+ 303: 2,
|
|
|
+ 202: 3,
|
|
|
+ 203: 4,
|
|
|
+ 204: 5,
|
|
|
+ 201: 6,
|
|
|
+ 205: 7,
|
|
|
+ 206: 8,
|
|
|
+ 208: 9,
|
|
|
+ 209: 10,
|
|
|
+ 301: 11,
|
|
|
+ 302: 12,
|
|
|
+ 5: 13,
|
|
|
+ };
|
|
|
+ data.sort((a, b) => {
|
|
|
+ const typeA = TypeMap[a.gljType];
|
|
|
+ const typeB = TypeMap[b.gljType];
|
|
|
+ return typeA - typeB;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
if(typeof gljUtil !== 'undefined'){
|
|
|
gljUtil.getCodeSortMath = getCodeSortMath
|