Browse Source

add quantity

zhangweicheng 6 years ago
parent
commit
a607c16f3e

+ 2 - 1
modules/all_models/bills_template_items.js

@@ -34,7 +34,8 @@ let BillsTemplateSchema = {
     //计算基数
     calcBase: String,
     //费率ID
-    feeRateID:Number
+    feeRateID:Number,
+    quantity: String,
 };
 
 mongoose.model(collectionName, new Schema(BillsTemplateSchema, {versionKey: false, collection: collectionName}));

+ 26 - 0
public/web/common_ajax.js

@@ -118,3 +118,29 @@ var CommonAjax = {
         });
     }
 };
+
+async function ajaxPost(url, data) {
+    return new Promise(function (resolve, reject) {
+        $.ajax({
+            type:"POST",
+            url: url,
+            data: {'data': JSON.stringify(data)},
+            dataType: 'json',
+            cache: false,
+            timeout: 50000,
+            success: function(result){
+                if (result.error === 0) {
+                    resolve(result.data);
+                } else {
+                    alert('error: ' + result.message);
+                    reject(result.message);
+                }
+            },
+            error: function(jqXHR, textStatus, errorThrown){
+                ajaxErrorInfo(jqXHR, textStatus, errorThrown);
+                reject("请求错误");
+            }
+        });
+
+    });
+}

+ 18 - 0
web/maintain/bill_template_lib/js/bills_template_edit.js

@@ -78,6 +78,24 @@ let TEMPLATE_BILLS_SETTING = {
             "font":"Arail"
         }
     }, {
+            "width":80,
+            "readOnly":false,
+            "head":{
+                "titleNames":["工程量"],
+                "spanCols":[1],
+                "spanRows":[1],
+                "vAlign":[1],
+                "hAlign":[1],
+                "font":["Arial"]
+            },
+            "data":{
+                "field":"quantity",
+                "type":'Number',
+                "vAlign":0,
+                "hAlign":2,
+                "font":"Arail"
+            }
+    }, {
         "width":200,
         "readOnly":false,
         "head":{