| | |
| | | //计算有效期至 |
| | | if (HExpUnit == "Y") {//年 |
| | | date = new Date(date); |
| | | console.log(date.getFullYear(date)); |
| | | date.setYear(date.getFullYear(date) + HKFPeriod); |
| | | console.log(Format(date, "yyyy-MM-dd")); |
| | | date.setDate(date.getDate(date) - 1); |
| | | |
| | | return Format(date, "yyyy-MM-dd"); |
| | | } |
| | | if (HExpUnit == "M") {//月 |
| | | date = new Date(date); |
| | | date.setMonth(date.getMonth(date) + HKFPeriod); |
| | | date.setDate(date.getDate(date) - 1); |
| | | |
| | | return Format(date, "yyyy-MM-dd"); |
| | | } |
| | | if (HExpUnit == "D") {//日 |
| | | date = new Date(date); |
| | | date.setDate(date.getDate(date) + HKFPeriod); |
| | | console.log(Format(date, "yyyy-MM-dd")); |
| | | date.setDate(date.getDate(date) - 1); |
| | | |
| | | return Format(date, "yyyy-MM-dd"); |
| | | } |
| | | else { //安瑞计算方式 |
| | | else { //安瑞计算方式 |
| | | if (days == undefined || days == '') { |
| | | days = 1; |
| | | } |
| | |
| | | } |
| | | //获取下标 |
| | | index = findIndex(_sSubStr[i].HMaterNumber, _sSubStr[i].HMaterModel, newArray); |
| | | if (index === -1) { |
| | | if (index === -1 || _sSubStr[i].HIsSplit == 0) { |
| | | //如果数组中没有当前数据,则将数据添加进数组中 |
| | | newArray.push(_sSubStr[i]); |
| | | |
| | |
| | | if (newArray[index].HPOOrderBillNo == _sSubStr[i].HPOOrderBillNo) { |
| | | //如果数组中有和当前数据中物料代码、规格型号一致的信息,则将他们的数量累加 |
| | | newArray[index].HQty = Number(newArray[index].HQty) + Number(_sSubStr[i].HQty); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true } |
| | | , { field: 'HSupID', title: '供应商ID', width: 150, hide: true } |
| | | , { field: 'HSupName', title: '供应商名称', width: 150, hide: true } |
| | | , { field: 'HIsSplit', title: '是否拆分', width: 150, hide: true } //0否,1是 |
| | | |
| | | ]] |
| | | , done: function (res, curr, count) { |
| | |
| | | , "HSupName": data[i].HSupName |
| | | , "HSupBatchNo": data[i].HSupBatchNo |
| | | , "HSupMaterNumber": data[i].HSupMaterNumber |
| | | , "HEXPUNIT": data[i].HEXPUNIT |
| | | , "HIsSplit": 1 |
| | | } |
| | | //oldData.push(data1); |
| | | oldData.splice(dataindex, 0, data1); |
| | | oldData.push(data1); |
| | | //oldData.splice(dataindex, 0, data1); |
| | | }; |
| | | break; |
| | | } |