|
@@ -470,7 +470,7 @@ $(document).ready(() => {
|
|
|
const code = $.trim(tr.children('td[data-site="0"]').children('input').val()) || $.trim(tr.children('td[data-site="0"]').text());
|
|
|
const name = $.trim(tr.children('td[data-site="1"]').children('input').val()) || $.trim(tr.children('td[data-site="1"]').text());
|
|
|
const bwmx = $.trim(tr.children('td[data-site="2"]').children('input').val()) || $.trim(tr.children('td[data-site="2"]').text());
|
|
|
- const unit = $.trim(tr.children('td[data-site="4"]').children('select').val()) || $.trim(tr.children('td[data-site="4"]').text());
|
|
|
+ const unit = tr.children('td[data-site="4"]').children('select').val() === '' ? tr.children('td[data-site="4"]').children('select').val() : $.trim(tr.children('td[data-site="4"]').children('select').val()) || $.trim(tr.children('td[data-site="4"]').text());
|
|
|
const price = (tr.children('td[data-site="5"]').children('input').val() != '-' ? tr.children('td[data-site="5"]').children('input').val() : '') || tr.children('td[data-site="5"]').text();
|
|
|
const oamount = (tr.children('td[data-site="6"]').children('input').val() != '-' ? tr.children('td[data-site="6"]').children('input').val() : '') || tr.children('td[data-site="6"]').text();
|
|
|
const scnum = tr.children('td[data-site="8"]').children('input').val() != '-' ? tr.children('td[data-site="8"]').children('input').val() : '';
|
|
@@ -500,6 +500,7 @@ $(document).ready(() => {
|
|
|
const name = $.trim(tr.children('td[data-site="1"]').children('input').val());
|
|
|
const bwmx = $.trim(tr.children('td[data-site="2"]').children('input').val());
|
|
|
const unit = $(this).val();
|
|
|
+ tr.children('td[data-site="4"]').children('select').val($(this).val());
|
|
|
const price = tr.children('td[data-site="5"]').children('input').val() != '-' ? tr.children('td[data-site="5"]').children('input').val() : '';
|
|
|
let oamount = tr.children('td[data-site="6"]').children('input').val() != '-' ? tr.children('td[data-site="6"]').children('input').val() : '';
|
|
|
let scnum = tr.children('td[data-site="8"]').children('input').val() != '-' ? tr.children('td[data-site="8"]').children('input').val() : '';
|
|
@@ -614,12 +615,12 @@ function maketablelist(status){
|
|
|
'<td data-site="0">'+ code +'</td>' +
|
|
|
'<td data-site="1">'+ name +'</td>' +
|
|
|
'<td data-site="2">'+ bwmx +'</td>' +
|
|
|
- '<td data-site="3"><input class="form-control input-sm" type="text" placeholder="变更详情" value="' + detail + '"></td>' +
|
|
|
+ '<td data-site="3"><input class="form-control form-control-sm" type="text" placeholder="变更详情" value="' + detail + '"></td>' +
|
|
|
'<td data-site="4">'+ unit +'</td>' +
|
|
|
'<td data-site="5">'+ roundnum(price, updecimal) +'</td>' +
|
|
|
'<td data-site="6">'+ roundnum(oamount, numdecimal) +'</td>' +
|
|
|
'<td data-site="7">'+ roundnum(parseFloat(price).mul(parseFloat(oamount)),decimal) +'</td>' +
|
|
|
- '<td data-site="8"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" placeholder="请输入变更数量" value="'+ (scnum != '-' ? roundnum(scnum, numdecimal) : '') +'"></td>' +
|
|
|
+ '<td data-site="8"><input class="form-control form-control-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" placeholder="请输入变更数量" value="'+ (scnum != '-' ? roundnum(scnum, numdecimal) : '') +'"></td>' +
|
|
|
'<td data-site="9">'+ sctotal +'</td>'+
|
|
|
deteletr +'</tr>';
|
|
|
index ++;
|
|
@@ -630,7 +631,7 @@ function maketablelist(status){
|
|
|
let radionWhiteList = $('#change-whitelist').val() !== '' ? $('#change-whitelist').val().split('^_^') : [];
|
|
|
//判断是否添加空白清单
|
|
|
if(status == 'addwhite'){
|
|
|
- let trlist = ['','','',changeUnits.m.unit,makedecimalzero(decimal),makedecimalzero(findDecimal(changeUnits.m.unit)),makedecimalzero(findDecimal(changeUnits.m.unit)),'',0];
|
|
|
+ let trlist = ['','','','','','','','',0];
|
|
|
radionWhiteList.push(trlist.join(';'));
|
|
|
}
|
|
|
|
|
@@ -646,8 +647,7 @@ function maketablelist(status){
|
|
|
let detail = radionArray[7];
|
|
|
let ototal = price != '' && oamount != '' ? roundnum(parseFloat(price).mul(parseFloat(oamount)),decimal) : '';
|
|
|
let sctotal = price != '' && scnum != '' ? roundnum(parseFloat(price).mul(parseFloat(scnum)),decimal) : '';
|
|
|
-
|
|
|
- let optionlist = '';
|
|
|
+ let optionlist = '<option></option>';
|
|
|
for (const j in changeUnits) {
|
|
|
if (changeUnits[j].unit !== undefined && changeUnits[j].unit === unit) {
|
|
|
optionlist += '<option selected="selected">'+ changeUnits[j].unit +'</option>';
|
|
@@ -660,15 +660,15 @@ function maketablelist(status){
|
|
|
let numdecimal = findDecimal(unit);
|
|
|
|
|
|
html += '<tr class="clist" data-lid="' + whiteIndex + '" data-index="' + whiteIndex + '">' +
|
|
|
- '<td data-site="0"><input class="form-control input-sm" type="text" value="'+ code +'" placeholder="清单编号"></td>' +
|
|
|
- '<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="'+ bwmx +'" placeholder="变更部位"></td>' +
|
|
|
- '<td data-site="3"><input class="form-control input-sm" type="text" value="'+ detail +'" placeholder="变更详情"></td>' +
|
|
|
- '<td data-site="4"><select class="form-control input-sm">'+ optionlist +'</select></td>' +
|
|
|
- '<td data-site="5"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ updecimal +')" value="'+ roundnum(price, updecimal) +'" placeholder="请输入单价"></td>' +
|
|
|
- '<td data-site="6"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" value="'+ roundnum(oamount, numdecimal) +'" placeholder="请输入数量"></td>' +
|
|
|
+ '<td data-site="0"><input class="form-control form-control-sm" type="text" value="'+ code +'" placeholder="清单编号"></td>' +
|
|
|
+ '<td data-site="1"><input class="form-control form-control-sm" type="text" value="'+ name +'" placeholder="名称"></td>' +
|
|
|
+ '<td data-site="2"><input class="form-control form-control-sm" type="text" value="'+ bwmx +'" placeholder="变更部位"></td>' +
|
|
|
+ '<td data-site="3"><input class="form-control form-control-sm" type="text" value="'+ detail +'" placeholder="变更详情"></td>' +
|
|
|
+ '<td data-site="4"><select class="form-control form-control-sm">'+ optionlist +'</select></td>' +
|
|
|
+ '<td data-site="5"><input class="form-control form-control-sm" type="text" onkeyup="RegNum(this,event,'+ updecimal +')" value="'+ roundnum(price, updecimal) +'" placeholder="请输入单价"></td>' +
|
|
|
+ '<td data-site="6"><input class="form-control form-control-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" value="'+ roundnum(oamount, numdecimal) +'" placeholder="请输入数量"></td>' +
|
|
|
'<td data-site="7">'+ ototal +'</td>' +
|
|
|
- '<td data-site="8"><input class="form-control input-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" value="'+ roundnum(scnum, numdecimal) +'" placeholder="请输入变更数量"></td>' +
|
|
|
+ '<td data-site="8"><input class="form-control form-control-sm" type="text" onkeyup="RegNum(this,event,'+ numdecimal +')" value="'+ roundnum(scnum, numdecimal) +'" placeholder="请输入变更数量"></td>' +
|
|
|
'<td data-site="9">'+ sctotal +'</td>'+
|
|
|
deteletr +'</tr>';
|
|
|
whiteIndex ++;
|