| | |
| | | <input type="date" class="layui-input" lay-verify="HReceiveDate" name="HReceiveDate" id="HReceiveDate" style="width:190px;"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">åä»·ç±»å</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="HPriceType" id="HPriceType" lay-filter="HPriceType" style="width: 190px; "> |
| | | <option value="ææ¬ä»·" selected="selected">ææ¬ä»·</option> |
| | | <option value="ç»ç®ä»·">ç»ç®ä»·</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>å¢å ä¸è¡</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-InsertLine"><i class="layui-icon layui-icon-form"></i>æå
¥ä¸è¡</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>å¤å¶ä¸è¡</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Up"><i class="layui-icon layui-icon-form"></i>ä¸ç§»</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Under"><i class="layui-icon layui-icon-form"></i>ä¸ç§»</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | <div class="layui-tab" lay-filter="tab-POStockInBill"> |
| | | <ul class="layui-tab-title" lay-filter="tab-all"> |
| | | <li style="padding:1px;" class="layui-this">æ±æ»è¡¨æ ¼</li> |
| | | <li style="padding:1px;">æç»è¡¨æ ¼</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | {{# if(haveSource == false){ }}/ |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>å¢å ä¸è¡</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-InsertLine"><i class="layui-icon layui-icon-form"></i>æå
¥ä¸è¡</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>å¤å¶ä¸è¡</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Up"><i class="layui-icon layui-icon-form"></i>ä¸ç§»</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Under"><i class="layui-icon layui-icon-form"></i>ä¸ç§»</button> |
| | | {{# } }} |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Inventory" id="get_Inventory"><i class="layui-icon layui-icon-form"></i>åºåæ¥è¯¢</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="get_InOutSum" id="get_InOutSum"><i class="layui-icon layui-icon-form"></i>åºå
¥åºè®°å½æ¥è¯¢</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="xuhao"> |
| | | {{d.LAY_TABLE_INDEX+1}} |
| | | </script> |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | <table class="layui-hide" id="mainTableEntry" lay-filter="mainTableEntry"></table> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="xuhao"> |
| | | {{d.LAY_TABLE_INDEX+1}} |
| | | </script> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | |
| | | <script> |
| | | //#region æå 注é |
| | | //#endregion |
| | | //æ¯å¦ææºå |
| | | var haveSource = false; |
| | | layui.config({ |
| | | base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ |
| | | }).extend({ |
| | |
| | | //åå§åå表 |
| | | set_InitGrid(); |
| | | |
| | | //åå§åç»ç» |
| | | Organ(); |
| | | |
| | | //è·åæºåç±»å |
| | | HBillType(); |
| | | //#region 夿æä½ç±»åå¹¶åå§åçé¢ |
| | | if (OperationType == 1) { //æ æºåæ°å¢ |
| | | /* $("#HItemID").val(0);*/ |
| | |
| | | |
| | | DisPlay_HideColumn(); |
| | | |
| | | //åå§åç»ç» |
| | | Organ(); |
| | | |
| | | //è·åæºåç±»å |
| | | HBillType(); |
| | | |
| | | |
| | | //#endregion |
| | | |
| | |
| | | //å设置 |
| | | case 'set_HideColumn': |
| | | get_HideColumn(); |
| | | break; |
| | | //åºåæ¥è¯¢ |
| | | case 'get_Inventory': get_Inventory(); |
| | | break; |
| | | //åºå
¥åºè®°å½æ¥è¯¢ |
| | | case 'get_InOutSum': get_InOutSum(); |
| | | break; |
| | | } |
| | | }); |
| | |
| | | , "HSeOrderEntryID": "0" |
| | | , "HSeOrderBillNo": "" |
| | | }]; |
| | | optionEntry = { |
| | | elem: '#mainTableEntry' |
| | | , totalRow: true |
| | | , limit: 500 |
| | | , height: 500 |
| | | , loading: false |
| | | , cols: [[ //å表 |
| | | { type: 'checkbox', totalRowText: 'å计è¡' } |
| | | , { type: 'numbers', title: 'åºå·', width: 100 } |
| | | , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', width: 150, style: 'background-color:#efefef4d;' } |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, style: 'background-color:#efefef4d;' } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: '计éåä½', title: '计éåä½', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HQty', title: 'æ°é', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HPrice', title: 'åä»·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HMoney', title: 'éé¢', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HTaxPrice', title: 'å«ç¨åä»·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HDiscountRate', title: 'ææ£ç', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRelTaxPrice', title: 'å®é
å«ç¨åä»·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HTaxRate', title: 'ç¨ç', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HTaxMoney', title: 'ç¨é¢', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HMoneyBB', title: 'æ¬ä½å¸éé¢', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HlineTotal', title: 'ä»·ç¨å计', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HlineTotalBB', title: 'æ¬ä½å¸ä»·ç¨å计', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRemark', title: '夿³¨', width: 100, style: 'background-color:#efefef4d;' } |
| | | |
| | | , { field: 'HSourceInterID', title: 'æºåå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSourceEntryID', title: 'æºååå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSourceBillNo', title: 'æºåå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRelationQty', title: 'å
³èæ°é', width: 100, totalRow: true, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRelationMoney', title: 'å
³èéé¢', width: 100, totalRow: true, hide: true, style: 'background-color:#efefef4d;' } |
| | | |
| | | , { field: 'HPOOrderInterID', title: 'éè´è®¢åå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HPOOrderEntryID', title: 'éè´è®¢ååå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HPOOrderBillNo', title: 'éè´è®¢åå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | |
| | | , { field: 'HSeOrderTaxPrice', title: '订åå«ç¨åä»·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSeOrderInterID', title: 'éå®è®¢åå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSeOrderEntryID', title: 'éå®è®¢ååå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSeOrderBillNo', title: 'éå®è®¢åå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | ]] |
| | | } |
| | | option.data = rowdata; |
| | | table.render(option); |
| | | table.render(optionEntry); |
| | | } |
| | | function set_InitGridHaveSource() { |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , totalRow: true |
| | | , limit: 500 |
| | | , height: 500 |
| | | , loading: false |
| | | , cols: [[ //å表 |
| | | { type: 'checkbox', totalRowText: 'å计è¡' } |
| | | , { type: 'numbers', title: 'åºå·', width: 100 } |
| | | , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'ç©æä»£ç ', title: 'ç©æä»£ç ', width: 150, edit: 'text', event: "HMaterID" }//f7 |
| | | , { field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, style: 'background-color:#efefef4d;' } |
| | | , { field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 100, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: '计éåä½', title: '计éåä½', width: 100, edit: 'text', event: "HUnitID" }//f7 |
| | | , { field: 'HQty', title: 'æ°é', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HPrice', title: 'åä»·', width: 100, edit: 'text', event: "HPrice" } |
| | | , { field: 'HMoney', title: 'éé¢', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HTaxPrice', title: 'å«ç¨åä»·', width: 100, edit: 'text', event: "HTaxPrice" } |
| | | , { field: 'HDiscountRate', title: 'ææ£ç', width: 100, edit: 'text' } |
| | | , { field: 'HRelTaxPrice', title: 'å®é
å«ç¨åä»·', width: 100, edit: 'text' } |
| | | , { field: 'HTaxRate', title: 'ç¨ç', width: 100, edit: 'text' } |
| | | , { field: 'HTaxMoney', title: 'ç¨é¢', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HMoneyBB', title: 'æ¬ä½å¸éé¢', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HlineTotal', title: 'ä»·ç¨å计', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HlineTotalBB', title: 'æ¬ä½å¸ä»·ç¨å计', width: 100, totalRow: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRemark', title: '夿³¨', width: 100, edit: 'text' } |
| | | |
| | | , { field: 'HSourceInterID', title: 'æºåå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSourceEntryID', title: 'æºååå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSourceBillNo', title: 'æºåå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSourceBillType', title: 'æºåç±»å', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRelationQty', title: 'å
³èæ°é', width: 100, totalRow: true, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HRelationMoney', title: 'å
³èéé¢', width: 100, totalRow: true, hide: true, style: 'background-color:#efefef4d;' } |
| | | |
| | | , { field: 'HPOOrderInterID', title: 'éè´è®¢åå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HPOOrderEntryID', title: 'éè´è®¢ååå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HPOOrderBillNo', title: 'éè´è®¢åå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | |
| | | , { field: 'HSeOrderTaxPrice', title: '订åå«ç¨åä»·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSeOrderInterID', title: 'éå®è®¢åå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSeOrderEntryID', title: 'éå®è®¢ååå
ç ', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { field: 'HSeOrderBillNo', title: 'éå®è®¢åå·', width: 100, hide: true, style: 'background-color:#efefef4d;' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 70 } |
| | | ]] |
| | | } |
| | | } |
| | | //#endregion |
| | | |
| | |
| | | , "HMainSourceEntryID": data.HMainSourceEntryID |
| | | , "HMainSourceBillNo": data.HMainSourceBillNo |
| | | , "HMainSourceBillType": data.HMainSourceBillType |
| | | |
| | | , "HPriceType": data.åä»·ç±»å |
| | | , "HDeptID": data.HDeptID |
| | | , "HDeptName": data.é¨é¨ |
| | | , "HMangerID": data.HMangerID |
| | |
| | | , "HDeleteMan": data.ä½åºäºº |
| | | , "HDeleteDate": data.ä½åºæ¥æ == null ? "" : Format(new Date(data.ä½åºæ¥æ), "yyyy-MM-dd") |
| | | }); |
| | | |
| | | if (data.HMainSourceBillType != "") { |
| | | haveSource = true; |
| | | $("#BillType").val(data.HMainSourceBillType); |
| | | } |
| | | |
| | | HOrgIDBar = sessionStorage["OrganizationID"]; |
| | | |
| | |
| | | } |
| | | option.data = rowdata; |
| | | table.render(option); |
| | | |
| | | //å表 èµå¼ |
| | | var rowdata = result.list[0]; |
| | | optionEntry.data = rowdata; |
| | | table.render(optionEntry); |
| | | |
| | | layer.close(ajaxLoad); |
| | | } else { |
| | | layer.close(ajaxLoad); |
| | |
| | | } |
| | | } |
| | | var sSubStr = JSON.stringify(num); |
| | | var sSubStr2; |
| | | if (haveSource == true) { |
| | | //è·åå表2æ°æ® |
| | | var num = []; |
| | | for (var i = 0; i < table.cache["mainTableEntry"].length; i++) { |
| | | if (table.cache["mainTableEntry"][i] != "") { |
| | | table.cache["mainTableEntry"][i].LAY_TABLE_INDEX = i; |
| | | num.push(table.cache["mainTableEntry"][i]) |
| | | } |
| | | } |
| | | sSubStr2 = JSON.stringify(num); |
| | | } else { |
| | | sSubStr2 = JSON.stringify([]); |
| | | } |
| | | |
| | | //è·åæä½æ¹å¼ |
| | | var refSav = ""; |
| | |
| | | refSav = "Update"; |
| | | } |
| | | |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav + ';' + sessionStorage["HUserName"]; |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sSubStr2 + ';' + refSav + ';' + sessionStorage["HUserName"]; |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | |
| | | console.log("ç´¢å¼ä¸º:" + rowIndex); |
| | | if (rowIndex === '0') { |
| | | layer.msg('é¦è¡æ æ³å é¤ï¼ï¼ï¼'); |
| | | } else { |
| | | } else if (haveSource == true) { |
| | | layer.msg('ææºåæ æ³å é¤ï¼ï¼ï¼'); |
| | | }else { |
| | | obj.del(); |
| | | option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ |
| | | table.reload(option); |
| | |
| | | } |
| | | } |
| | | //#endregion |
| | | |
| | | //#region åºåæ¥è¯¢ |
| | | function get_Inventory() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1 && data[0].HMaterID != 0) { |
| | | var HMaterID = data[0].HMaterID.toString(); |
| | | //å¼¹çªæ¹æ³ |
| | | layer.open({ |
| | | type: 2//å¼¹çªç±»å |
| | | , skin: 'layui-layer-rim' //å ä¸è¾¹æ¡ |
| | | , area: ['90%', '90%']//å¤§å° |
| | | , title: 'åºåæ¥è¯¢å表'//æ é¢ |
| | | , shift: 2//å¼¹åºå¨ç» |
| | | , content: ['../../ä»å管ç/æ¡ç æ¥è¡¨/Kf_ICinventoryQueryReport.html?Type=1&HMaterID=' + HMaterID, 'yes'] |
| | | , btn: ['åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | } |
| | | else { |
| | | layer.msg('è¯·éæ©ä¸è¡æç©ææ°æ®æ¥è¯¢ï¼'); |
| | | } |
| | | } |
| | | //#endregion |
| | | //#region åºå
¥åºè®°å½æ¥è¯¢ |
| | | function get_InOutSum() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1 && data[0].HMaterID != 0) { |
| | | var HMaterID = data[0].HMaterID.toString(); |
| | | layer.open({ |
| | | type: 2//å¼¹çªç±»å |
| | | , skin: 'layui-layer-rim' //å ä¸è¾¹æ¡ |
| | | , area: ['90%', '90%']//å¤§å° |
| | | , title: 'åºå
¥åºè®°å½å表'//æ é¢ |
| | | , shift: 2//å¼¹åºå¨ç» |
| | | , content: ['../../ä»å管ç/æ¡ç æ¥è¡¨/Kf_StockInOutSumQueryReport.html?Type=1&HMaterID=' + HMaterID, 'yes'] |
| | | , btn: ['åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | } |
| | | else { |
| | | layer.msg('è¯·éæ©ä¸è¡æç©ææ°æ®æ¥è¯¢ï¼'); |
| | | } |
| | | } |
| | | //#endregion |
| | | //#region ä¸ç§» |
| | | function btn_under() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | |
| | | , "HSellSName": dataArray[0].é宿¹å¼ |
| | | }); |
| | | |
| | | //å表 èµå¼ |
| | | var rowdata = []; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | rowdata.push( |
| | | { |
| | | "HMaterID": dataArray[i].HMaterID |
| | | , "ç©æä»£ç ": dataArray[i].ç©æä»£ç |
| | | , "ç©æåç§°": dataArray[i].ç©æåç§° |
| | | , "è§æ ¼åå·": dataArray[i].è§æ ¼åå· |
| | | , "HUnitID": dataArray[i].HUnitID |
| | | , "计éåä½": dataArray[i].计éåä½ |
| | | , "HQty": dealDoubleToFixed(dataArray[i].æ°é, 1) |
| | | , "HPrice": dealDoubleToFixed(dataArray[i].åä»·, 3) |
| | | , "HTaxPrice": dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , 'HDiscountRate':"0" // |
| | | , 'HRelTaxPrice': "0" |
| | | , "HTaxRate": dataArray[i].ç¨ç |
| | | , 'HTaxMoney':"0" // |
| | | , "HMoney": dealDoubleToFixed(dataArray[i].éé¢, 2) |
| | | , 'HMoneyBB': dealDoubleToFixed(dataArray[i].éé¢ * dataArray[0].æ±ç, 2) |
| | | , 'HlineTotal': dealDoubleToFixed(dataArray[i].ä»·ç¨å计, 2) |
| | | , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].ä»·ç¨å计 * dataArray[0].æ±ç, 2) |
| | | , "HRemark": "" |
| | | if ($("#HPriceType").val() == "ææ¬ä»·") { |
| | | //åè¡¨ææ¬ä»·Entry èµå¼ |
| | | var rowdataEntry = []; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | |
| | | , "HSourceInterID": dataArray[i].hmainid |
| | | , "HSourceEntryID": dataArray[i].hsubid |
| | | , "HSourceBillNo": dataArray[i].åæ®å· |
| | | , "HSourceBillType": dataArray[i].HBillType |
| | | , "HRelationQty": "0" |
| | | , "HRelationMoney": "0" |
| | | rowdataEntry.push( |
| | | { |
| | | "HMaterID": dataArray[i].HMaterID |
| | | , "ç©æä»£ç ": dataArray[i].ç©æä»£ç |
| | | , "ç©æåç§°": dataArray[i].ç©æåç§° |
| | | , "è§æ ¼åå·": dataArray[i].è§æ ¼åå· |
| | | , "HUnitID": dataArray[i].HUnitID |
| | | , "计éåä½": dataArray[i].计éåä½ |
| | | , "HQty": dealDoubleToFixed(dataArray[i].æ°é, 1) |
| | | , "HPrice": dealDoubleToFixed(dataArray[i].HNoTaxCost, 3) |
| | | , "HTaxPrice": dealDoubleToFixed(dataArray[i].HTaxCost, 3) |
| | | , 'HDiscountRate': "0" // |
| | | , 'HRelTaxPrice': "0" |
| | | , "HTaxRate": dataArray[i].ç¨ç |
| | | , 'HTaxMoney': "0" // |
| | | , "HMoney": dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].HNoTaxCost, 2) |
| | | , 'HMoneyBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].HNoTaxCost, 2) |
| | | , 'HlineTotal': dealDoubleToFixed(dataArray[i].ä»·ç¨å计, 2) |
| | | , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].ä»·ç¨å计 * dataArray[0].æ±ç, 2) |
| | | , "HRemark": "" |
| | | |
| | | , 'HPOOrderInterID': "0" |
| | | , 'HPOOrderEntryID': "0" |
| | | , 'HPOOrderBillNo': "" |
| | | , "HSourceInterID": dataArray[i].hmainid |
| | | , "HSourceEntryID": dataArray[i].hsubid |
| | | , "HSourceBillNo": dataArray[i].åæ®å· |
| | | , "HSourceBillType": dataArray[i].HBillType |
| | | , "HRelationQty": "0" |
| | | , "HRelationMoney": "0" |
| | | |
| | | , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , "HSeOrderInterID": dataArray[i].hmainid |
| | | , "HSeOrderEntryID": dataArray[i].hsubid |
| | | , "HSeOrderBillNo": dataArray[i].åæ®å· |
| | | } |
| | | ); |
| | | , 'HPOOrderInterID': "0" |
| | | , 'HPOOrderEntryID': "0" |
| | | , 'HPOOrderBillNo': "" |
| | | |
| | | , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].HTaxPrice, 3) |
| | | , "HSeOrderInterID": dataArray[i].hmainid |
| | | , "HSeOrderEntryID": dataArray[i].hsubid |
| | | , "HSeOrderBillNo": dataArray[i].åæ®å· |
| | | } |
| | | ); |
| | | } |
| | | } else { |
| | | //å表Entry èµå¼ |
| | | var rowdataEntry = []; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | rowdataEntry.push( |
| | | { |
| | | "HMaterID": dataArray[i].HMaterID |
| | | , "ç©æä»£ç ": dataArray[i].ç©æä»£ç |
| | | , "ç©æåç§°": dataArray[i].ç©æåç§° |
| | | , "è§æ ¼åå·": dataArray[i].è§æ ¼åå· |
| | | , "HUnitID": dataArray[i].HUnitID |
| | | , "计éåä½": dataArray[i].计éåä½ |
| | | , "HQty": dealDoubleToFixed(dataArray[i].æ°é, 1) |
| | | , "HPrice": dealDoubleToFixed(dataArray[i].åä»·, 3) |
| | | , "HTaxPrice": dealDoubleToFixed(dataArray[i].HTaxPrice, 3) |
| | | , 'HDiscountRate': "0" // |
| | | , 'HRelTaxPrice': "0" |
| | | , "HTaxRate": dataArray[i].ç¨ç |
| | | , 'HTaxMoney': "0" // |
| | | , "HMoney": dealDoubleToFixed(dataArray[i].éé¢, 2) |
| | | , 'HMoneyBB': dealDoubleToFixed(dataArray[i].éé¢ * dataArray[0].æ±ç, 2) |
| | | , 'HlineTotal': dealDoubleToFixed(dataArray[i].ä»·ç¨å计, 2) |
| | | , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].ä»·ç¨å计 * dataArray[0].æ±ç, 2) |
| | | , "HRemark": "" |
| | | |
| | | , "HSourceInterID": dataArray[i].hmainid |
| | | , "HSourceEntryID": dataArray[i].hsubid |
| | | , "HSourceBillNo": dataArray[i].åæ®å· |
| | | , "HSourceBillType": dataArray[i].HBillType |
| | | , "HRelationQty": "0" |
| | | , "HRelationMoney": "0" |
| | | |
| | | , 'HPOOrderInterID': "0" |
| | | , 'HPOOrderEntryID': "0" |
| | | , 'HPOOrderBillNo': "" |
| | | |
| | | , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].HTaxPrice, 3) |
| | | , "HSeOrderInterID": dataArray[i].hmainid |
| | | , "HSeOrderEntryID": dataArray[i].hsubid |
| | | , "HSeOrderBillNo": dataArray[i].åæ®å· |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | option.data = rowdata; |
| | | optionEntry.data = rowdataEntry; |
| | | table.render(optionEntry); |
| | | //åè¡¨æ±æ» |
| | | for (var i = 0; i < rowdataEntry.length; i++) { |
| | | var item = rowdataEntry[i]; |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty; |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | | rowdataEntry[i].HlineTotalBB = Number(((rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney) * HExRate).toFixed(4)) //æ¬ä½å¸ä»·ç¨å计 |
| | | rowdataEntry.splice(j, 1); |
| | | j = j - 1; |
| | | } |
| | | } |
| | | } |
| | | set_InitGridHaveSource(); |
| | | option.data = rowdataEntry; |
| | | haveSource = true; |
| | | table.render(option); |
| | | } |
| | | //#endregion |
| | |
| | | , "HSellSID": dataArray[0].HSellSID |
| | | , "HSellSName": dataArray[0].é宿¹å¼ |
| | | }); |
| | | if ($("#HPriceType").val() == "ææ¬ä»·") { |
| | | //å表 èµå¼ |
| | | var rowdataEntry = []; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | rowdataEntry.push( |
| | | { |
| | | "HMaterID": dataArray[i].hmaterid |
| | | , "ç©æä»£ç ": dataArray[i].ç©æä»£ç |
| | | , "ç©æåç§°": dataArray[i].ç©æåç§° |
| | | , "è§æ ¼åå·": dataArray[i].è§æ ¼åå· |
| | | , "HUnitID": dataArray[i].hunitid |
| | | , "计éåä½": dataArray[i].计éåä½ |
| | | , "HQty": dealDoubleToFixed(dataArray[i].æ°é, 1) |
| | | , "HPrice": dealDoubleToFixed(dataArray[i].ææ¬åä»·, 3) |
| | | , "HTaxPrice": dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , 'HDiscountRate': "0" // |
| | | , 'HRelTaxPrice': "0" |
| | | , "HTaxRate": dataArray[i].ç¨ç |
| | | , 'HTaxMoney': "0" // |
| | | , "HMoney": dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].ææ¬åä»·, 2) |
| | | , 'HMoneyBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].ææ¬åä»· * dataArray[0].æ±ç, 2) |
| | | , 'HlineTotal': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].å«ç¨åä»·, 2) |
| | | , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].å«ç¨åä»· * dataArray[0].æ±ç, 2) |
| | | , "HRemark": "" |
| | | |
| | | //å表 èµå¼ |
| | | var rowdata = []; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | rowdata.push( |
| | | { |
| | | "HMaterID": dataArray[i].hmaterid |
| | | , "ç©æä»£ç ": dataArray[i].ç©æä»£ç |
| | | , "ç©æåç§°": dataArray[i].ç©æåç§° |
| | | , "è§æ ¼åå·": dataArray[i].è§æ ¼åå· |
| | | , "HUnitID": dataArray[i].hunitid |
| | | , "计éåä½": dataArray[i].计éåä½ |
| | | , "HQty": dealDoubleToFixed(dataArray[i].æ°é, 1) |
| | | , "HPrice": dealDoubleToFixed(dataArray[i].åä»·, 3) |
| | | , "HTaxPrice": dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , 'HDiscountRate': "0" // |
| | | , 'HRelTaxPrice': "0" |
| | | , "HTaxRate": dataArray[i].ç¨ç |
| | | , 'HTaxMoney': "0" // |
| | | , "HMoney": dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].åä»·, 2) |
| | | , 'HMoneyBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].åä»· * dataArray[0].æ±ç, 2) |
| | | , 'HlineTotal': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].å«ç¨åä»·, 2) |
| | | , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].å«ç¨åä»· * dataArray[0].æ±ç, 2) |
| | | , "HRemark": "" |
| | | , "HSourceInterID": dataArray[i].hmainid |
| | | , "HSourceEntryID": dataArray[i].hsubid |
| | | , "HSourceBillNo": dataArray[i].åæ®å· |
| | | , "HSourceBillType": dataArray[i].HBillType |
| | | , "HRelationQty": "0" |
| | | , "HRelationMoney": "0" |
| | | |
| | | , "HSourceInterID": dataArray[i].hmainid |
| | | , "HSourceEntryID": dataArray[i].hsubid |
| | | , "HSourceBillNo": dataArray[i].åæ®å· |
| | | , "HSourceBillType": dataArray[i].HBillType |
| | | , "HRelationQty": "0" |
| | | , "HRelationMoney": "0" |
| | | , 'HPOOrderInterID': "0" |
| | | , 'HPOOrderEntryID': "0" |
| | | , 'HPOOrderBillNo': "" |
| | | |
| | | , 'HPOOrderInterID': "0" |
| | | , 'HPOOrderEntryID': "0" |
| | | , 'HPOOrderBillNo': "" |
| | | |
| | | , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , "HSeOrderInterID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceInterID: "0" |
| | | , "HSeOrderEntryID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceEntryID : "0" |
| | | , "HSeOrderBillNo": dataArray[i].HSourceBillType == "1401" ? dataArray[i].æºååå· : "" |
| | | } |
| | | ); |
| | | , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , "HSeOrderInterID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceInterID : "0" |
| | | , "HSeOrderEntryID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceEntryID : "0" |
| | | , "HSeOrderBillNo": dataArray[i].HSourceBillType == "1401" ? dataArray[i].æºååå· : "" |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | option.data = rowdata; |
| | | else { |
| | | //å表 èµå¼ |
| | | var rowdataEntry = []; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | rowdataEntry.push( |
| | | { |
| | | "HMaterID": dataArray[i].hmaterid |
| | | , "ç©æä»£ç ": dataArray[i].ç©æä»£ç |
| | | , "ç©æåç§°": dataArray[i].ç©æåç§° |
| | | , "è§æ ¼åå·": dataArray[i].è§æ ¼åå· |
| | | , "HUnitID": dataArray[i].hunitid |
| | | , "计éåä½": dataArray[i].计éåä½ |
| | | , "HQty": dealDoubleToFixed(dataArray[i].æ°é, 1) |
| | | , "HPrice": dealDoubleToFixed(dataArray[i].åä»·, 3) |
| | | , "HTaxPrice": dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , 'HDiscountRate': "0" // |
| | | , 'HRelTaxPrice': "0" |
| | | , "HTaxRate": dataArray[i].ç¨ç |
| | | , 'HTaxMoney': "0" // |
| | | , "HMoney": dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].åä»·, 2) |
| | | , 'HMoneyBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].åä»· * dataArray[0].æ±ç, 2) |
| | | , 'HlineTotal': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].å«ç¨åä»·, 2) |
| | | , 'HlineTotalBB': dealDoubleToFixed(dataArray[i].æ°é * dataArray[i].å«ç¨åä»· * dataArray[0].æ±ç, 2) |
| | | , "HRemark": "" |
| | | |
| | | , "HSourceInterID": dataArray[i].hmainid |
| | | , "HSourceEntryID": dataArray[i].hsubid |
| | | , "HSourceBillNo": dataArray[i].åæ®å· |
| | | , "HSourceBillType": dataArray[i].HBillType |
| | | , "HRelationQty": "0" |
| | | , "HRelationMoney": "0" |
| | | |
| | | , 'HPOOrderInterID': "0" |
| | | , 'HPOOrderEntryID': "0" |
| | | , 'HPOOrderBillNo': "" |
| | | |
| | | , 'HSeOrderTaxPrice': dealDoubleToFixed(dataArray[i].å«ç¨åä»·, 3) |
| | | , "HSeOrderInterID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceInterID : "0" |
| | | , "HSeOrderEntryID": dataArray[i].HSourceBillType == "1401" ? dataArray[i].HSourceEntryID : "0" |
| | | , "HSeOrderBillNo": dataArray[i].HSourceBillType == "1401" ? dataArray[i].æºååå· : "" |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | |
| | | optionEntry.data = rowdataEntry; |
| | | table.render(optionEntry); |
| | | //åè¡¨æ±æ» |
| | | for (var i = 0; i < rowdataEntry.length; i++) { |
| | | var item = rowdataEntry[i]; |
| | | for (var j = i + 1; j < rowdataEntry.length; j++) { |
| | | if (rowdataEntry[j].HMaterID == item.HMaterID) { |
| | | rowdataEntry[i].HQty += rowdataEntry[j].HQty; |
| | | rowdataEntry[i].HMoney = rowdataEntry[i].HQty * rowdataEntry[i].HPrice//éé¢=æ°é*åä»· |
| | | rowdataEntry[i].HTaxMoney = Number((rowdataEntry[i].HMoney * rowdataEntry[i].HTaxRate).toFixed(4))//ç¨é¢ |
| | | rowdataEntry[i].HlineTotal = rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney //ä»·ç¨å计 |
| | | var HExRate = $("#HExRate").val(); |
| | | rowdataEntry[i].HlineTotalBB = Number(((rowdataEntry[i].HMoney + rowdataEntry[i].HTaxMoney) * HExRate).toFixed(4)) //æ¬ä½å¸ä»·ç¨å计 |
| | | rowdataEntry.splice(j, 1); |
| | | j = j - 1; |
| | | } |
| | | } |
| | | } |
| | | set_InitGridHaveSource(); |
| | | option.data = rowdataEntry; |
| | | haveSource = true; |
| | | table.render(option); |
| | | } |
| | | //#endregion |