| 
					
				 | 
			
			
				@@ -16,6 +16,14 @@ const invalidFields = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     posCalc: ['sgfh_qty', 'sgfh_tp', 'sjcl_qty', 'sjcl_tp', 'qtcl_qty', 'qtcl_tp'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     posXmj: ['code'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function getExprInfo (field) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const exprField = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        {qty: 'sgfh_qty', expr: 'sgfh_expr'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        {qty: 'sjcl_qty', expr: 'sjcl_expr'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        {qty: 'qtcl_qty', expr: 'qtcl_expr'}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return _.find(exprField, {qty: field}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function transExpr(expr) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return $.trim(expr).replace('\t', '').replace('=', '').replace('%', '/100'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -76,7 +84,13 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (col && col.type === 'Number') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const data = SpreadJsObj.getSelectObject(sheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (data) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    const exprInfo = getExprInfo(col.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $('#bills-expr').val(data[exprInfo.expr] ? data[exprInfo.expr] : data[col.field]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            .attr('field', col.field).attr('org', data[col.field]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (col.field.indexOf('dgn') >= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (_.isString(data.b_code) && data.b_code !== '')); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -400,6 +414,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 data[col.field] = math.evaluate(transExpr(text)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                const exprInfo = getExprInfo(col.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    data[exprInfo.expr] = newValue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } catch(err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 toastr.error('输入的表达式非法'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 SpreadJsObj.reLoadRowData(info.sheet, info.row); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -513,6 +531,11 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 data[colSetting.field] = math.evaluate(transExpr(value)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                const exprInfo = getExprInfo(colSetting.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    data[exprInfo.expr] = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                bPaste = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 toastMessageUniq(hint.invalidExpr); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 continue; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -646,6 +669,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (let iCol = sel.col; iCol < sel.col + sel.colCount; iCol++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     const col = sheet.zh_setting.cols[iCol]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     data[col.field] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    const exprInfo = getExprInfo(col.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        data[exprInfo.expr] = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 datas.push(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -653,6 +680,7 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 postData(window.location.pathname + '/update', {postType: 'update', postData: datas}, function (result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     const refreshNode = sheet.zh_tree.loadPostData(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     billsTreeSpreadObj.refreshTree(sheet, refreshNode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    treeOperationObj.loadExprToInput(sheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -746,6 +774,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         const colSetting = sheet.zh_setting.cols[iCol]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         data[colSetting.field] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        const exprInfo = getExprInfo(colSetting.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            data[exprInfo.expr] = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     datas.push(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -827,6 +859,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         data[field] = math.evaluate(transExpr(newValue)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        const exprInfo = getExprInfo(field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            data[exprInfo.expr] = newValue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         toastr.error('输入的表达式非法'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -839,7 +875,6 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 更新至服务器 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             postData(window.location.pathname + '/update', {postType: 'update', postData: data}, function (result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const refreshNode = billsTree.loadPostData(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                expr.val(select[field]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 billsTreeSpreadObj.refreshTree(billsSheet, refreshNode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1083,7 +1118,11 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (col && col.type === 'Number') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const data = SpreadJsObj.getSelectObject(posSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (data) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $('#pos-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    const exprInfo = getExprInfo(col.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    const value = exprInfo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        ? (data[exprInfo.expr] ? data[exprInfo.expr] : data[col.field]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        : data[col.field]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $('#pos-expr').val(value).attr('field', col.field).attr('org', data[col.field]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .attr('row', sel.row).attr('readOnly', readOnly || cell.locked()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $('#pos-expr').val('').attr('readOnly', true); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1238,6 +1277,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             data.postData[col.field] = math.evaluate(transExpr(newText)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            const exprInfo = getExprInfo(col.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                data.updateData[exprInfo.expr] = newText; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } catch(err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             toastr.error('输入的表达式非法'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             SpreadJsObj.reLoadRowData(info.sheet, info.row); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1288,6 +1331,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (!style.locked) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             const colSetting = sheet.zh_setting.cols[iCol]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             data[colSetting.field] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            const exprInfo = getExprInfo(colSetting.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                data[exprInfo.expr] = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             bDel = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1411,6 +1458,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 posData[colSetting.field] = math.evaluate(transExpr(posData[colSetting.field])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                const exprInfo = getExprInfo(colSetting.field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    posData[exprInfo.expr] = trimInvalidChar(info.sheet.getText(curRow, curCol)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 if (!bHint) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     toastr.warning('粘贴了非法表达式,已过滤'); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1486,6 +1537,10 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         data[field] = math.evaluate(transExpr(newValue)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        const exprInfo = getExprInfo(field); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (exprInfo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            data[exprInfo.expr] = newValue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } catch (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         toastr.error('输入的表达式非法'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1498,7 +1553,6 @@ $(document).ready(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 更新至服务器 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             postData(window.location.pathname + '/update', {postType: 'pos', posPostType: 'update', postData: data}, function (result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const updateRst = pos.updateDatas(result.pos); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                expr.val(select[field]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 刷新当前行, 不适用于新增(在非下一空白行新增) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 SpreadJsObj.reLoadRowData(posSheet, row); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const loadResult = billsTree.loadPostData(result.ledger); 
			 |