|
@@ -18,30 +18,32 @@ $(document).ready(() => {
|
|
|
let listHtml = '';
|
|
|
let list_index = 1;
|
|
|
for (const gcl of gclGatherData) {
|
|
|
- const quantity = gcl.quantity !== undefined ? gcl.quantity : 0;
|
|
|
+ const unit = gcl.unit !== undefined && gcl.unit !== null ? gcl.unit : '';
|
|
|
+ const quantity = gcl.quantity !== null && gcl.quantity !== undefined ? (unit !== '' ? roundnum(gcl.quantity, findDecimal(gcl.unit)) : gcl.quantity) : 0;
|
|
|
const unit_price = gcl.unit_price !== null && gcl.unit_price !== undefined ? gcl.unit_price : 0;
|
|
|
listHtml += '<tr data-lid="' + list_index + '" data-gcl="' + (list_index-1) + '" data-index="' + list_index + '" data-detail="">' +
|
|
|
'<td>' + list_index + '</td>' +
|
|
|
'<td>' + gcl.b_code + '</td>' +
|
|
|
'<td>' + gcl.name + '</td>' +
|
|
|
- '<td>' + gcl.unit + '</td>' +
|
|
|
- '<td>' + roundnum(unit_price, totalPriceUnit) + '</td>' +
|
|
|
- '<td>' + roundnum(quantity, findDecimal(gcl.unit)) + '</td>' +
|
|
|
+ '<td>' + unit + '</td>' +
|
|
|
+ '<td>' + roundnum(unit_price, unitPriceUnit) + '</td>' +
|
|
|
+ '<td>' + quantity + '</td>' +
|
|
|
// '<td>' + roundnum(parseFloat(gcl.unit_price).mul(parseFloat(gcl.quantity)), totalPriceUnit) + '</td>' +
|
|
|
'</tr>';
|
|
|
list_index++;
|
|
|
}
|
|
|
// 再加载签约清单
|
|
|
for (const db of dealBillList) {
|
|
|
- const quantity = db.quantity !== undefined ? db.quantity : 0;
|
|
|
+ const unit = db.unit !== undefined && db.unit !== null ? db.unit : '';
|
|
|
+ const quantity = db.quantity !== null && db.quantity !== undefined ? (unit !== '' ? roundnum(db.quantity, findDecimal(db.unit)) : db.quantity) : 0;
|
|
|
const unit_price = db.unit_price !== null && db.unit_price !== undefined ? db.unit_price : 0;
|
|
|
listHtml += '<tr data-lid="' + db.id + '" data-index="' + list_index + '" data-detail="">' +
|
|
|
'<td>' + list_index + '</td>' +
|
|
|
'<td>' + db.code + '</td>' +
|
|
|
'<td>' + db.name + '</td>' +
|
|
|
- '<td>' + db.unit + '</td>' +
|
|
|
- '<td>' + roundnum(unit_price, totalPriceUnit) + '</td>' +
|
|
|
- '<td>' + roundnum(quantity, findDecimal(db.unit)) + '</td>' +
|
|
|
+ '<td>' + unit + '</td>' +
|
|
|
+ '<td>' + roundnum(unit_price, unitPriceUnit) + '</td>' +
|
|
|
+ '<td>' + quantity + '</td>' +
|
|
|
// '<td>' + roundnum(parseFloat(db.unit_price).mul(parseFloat(db.quantity)), totalPriceUnit) + '</td>' +
|
|
|
'</tr>';
|
|
|
list_index++;
|
|
@@ -297,7 +299,7 @@ $(document).ready(() => {
|
|
|
$('#code-list input:checked').each(function () {
|
|
|
const tr = $(this).parents('tr');
|
|
|
const length = tr.children('td').length;
|
|
|
- const detail = length === 4 ? tr.children('td').eq(0).text() + '_' + tr.children('td').eq(2).text() : '0';
|
|
|
+ const detail = length === 5 ? tr.children('td').eq(0).text() + '_' + tr.children('td').eq(2).text() : '0';
|
|
|
const quantity = tr.attr('quantity');
|
|
|
const de_qu = detail + ';' + quantity;
|
|
|
data_detail.push(de_qu);
|
|
@@ -312,7 +314,7 @@ $(document).ready(() => {
|
|
|
$('#code-list input:checked').each(function () {
|
|
|
const tr = $(this).parents('tr');
|
|
|
const length = tr.children('td').length;
|
|
|
- const detail = length === 4 ? tr.children('td').eq(0).text() + '_' + tr.children('td').eq(2).text() : '0';
|
|
|
+ const detail = length === 5 ? tr.children('td').eq(0).text() + '_' + tr.children('td').eq(2).text() : '0';
|
|
|
const quantity = tr.attr('quantity');
|
|
|
const de_qu = detail + ';' + quantity;
|
|
|
data_detail.push(de_qu);
|
|
@@ -470,6 +472,8 @@ function getAuditList() {
|
|
|
function maketablelist(status){
|
|
|
// 金额位数
|
|
|
const decimal = totalPriceUnit;
|
|
|
+ // 单价位数
|
|
|
+ const updecimal = unitPriceUnit;
|
|
|
|
|
|
let html = '';
|
|
|
|
|
@@ -523,7 +527,7 @@ function maketablelist(status){
|
|
|
'<td data-site="1">'+ name +'</td>' +
|
|
|
'<td data-site="2"><input class="form-control input-sm" type="text" placeholder="变更详情" value="' + detail + '"></td>' +
|
|
|
'<td data-site="3">'+ unit +'</td>' +
|
|
|
- '<td data-site="4">'+ roundnum(price, decimal) +'</td>' +
|
|
|
+ '<td data-site="4">'+ roundnum(price, updecimal) +'</td>' +
|
|
|
'<td data-site="5">'+ roundnum(oamount, numdecimal) +'</td>' +
|
|
|
'<td data-site="6">'+ roundnum(parseFloat(price).mul(parseFloat(oamount)),decimal) +'</td>' +
|
|
|
'<td data-site="7"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" placeholder="请输入变更数量" value="'+ (scnum != '-' ? roundnum(scnum, numdecimal) : '') +'"></td>' +
|
|
@@ -537,7 +541,7 @@ function maketablelist(status){
|
|
|
let radionWhiteList = $('#change-whitelist').val() !== '' ? $('#change-whitelist').val().split('^_^') : [];
|
|
|
//判断是否添加空白清单
|
|
|
if(status == 'addwhite'){
|
|
|
- let trlist = ['','',changeUnits.t.unit,makedecimalzero(decimal),makedecimalzero(changeUnits.t.value),makedecimalzero(changeUnits.t.value),'',0];
|
|
|
+ let trlist = ['','',changeUnits.m.unit,makedecimalzero(decimal),makedecimalzero(findDecimal(changeUnits.m.unit)),makedecimalzero(findDecimal(changeUnits.m.unit)),'',0];
|
|
|
radionWhiteList.push(trlist.join(';'));
|
|
|
}
|
|
|
|
|
@@ -570,7 +574,7 @@ function maketablelist(status){
|
|
|
'<td data-site="1"><input class="form-control input-sm" type="text" value="'+ name +'" placeholder="请输入名称"></td>' +
|
|
|
'<td data-site="2"><input class="form-control input-sm" type="text" value="'+ detail +'" placeholder="变更详情"></td>' +
|
|
|
'<td data-site="3"><select class="form-control input-sm">'+ optionlist +'</select></td>' +
|
|
|
- '<td data-site="4"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ decimal +')" value="'+ roundnum(price, decimal) +'" placeholder="请输入单价"></td>' +
|
|
|
+ '<td data-site="4"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ updecimal +')" value="'+ roundnum(price, updecimal) +'" placeholder="请输入单价"></td>' +
|
|
|
'<td data-site="5"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" value="'+ roundnum(oamount, numdecimal) +'" placeholder="请输入数量"></td>' +
|
|
|
'<td data-site="6">'+ ototal +'</td>' +
|
|
|
'<td data-site="7"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" value="'+ roundnum(scnum, numdecimal) +'" placeholder="请输入变更数量"></td>' +
|
|
@@ -621,7 +625,8 @@ function totalamount(decimal){
|
|
|
|
|
|
// 找出单位对应的小数位数值
|
|
|
function findDecimal(unit) {
|
|
|
- let value = 2;
|
|
|
+ let value = precision.other.value;
|
|
|
+ const changeUnits = precision;
|
|
|
for (const d in changeUnits) {
|
|
|
if (changeUnits[d].unit !== undefined && changeUnits[d].unit === unit) {
|
|
|
value = changeUnits[d].value;
|