|
@@ -441,6 +441,15 @@ $(document).ready(() => {
|
|
gclGatherData.splice(ggd, 1);
|
|
gclGatherData.splice(ggd, 1);
|
|
}
|
|
}
|
|
gclGatherData[ggd].code = gclGatherData[ggd].b_code;
|
|
gclGatherData[ggd].code = gclGatherData[ggd].b_code;
|
|
|
|
+ let hadcid = 0;
|
|
|
|
+ for (const xmj of gclGatherData[ggd].leafXmjs) {
|
|
|
|
+ if (_.findIndex(changeLedgerList, { id: xmj.gcl_id }) !== -1 || _.findIndex(changePosList, { id: xmj.mx_id, lid: xmj.gcl_id }) !== -1) {
|
|
|
|
+ xmj.cid = 1;
|
|
|
|
+ hadcid = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (hadcid !== 0) gclGatherData[ggd].cid = 1;
|
|
}
|
|
}
|
|
// 数组去重
|
|
// 数组去重
|
|
const dealBillList = result.dealBills;
|
|
const dealBillList = result.dealBills;
|
|
@@ -467,7 +476,7 @@ $(document).ready(() => {
|
|
const lid = gcl.leafXmjs !== undefined && gcl.leafXmjs !== null ? (gcl.leafXmjs.length !== 0 ? gcl.leafXmjs[0].gcl_id : false) : gcl.id;
|
|
const lid = gcl.leafXmjs !== undefined && gcl.leafXmjs !== null ? (gcl.leafXmjs.length !== 0 ? gcl.leafXmjs[0].gcl_id : false) : gcl.id;
|
|
if (lid) {
|
|
if (lid) {
|
|
listHtml += '<tr data-lid="' + lid + '"' + gclhtml + ' data-index="' + list_index + '" data-bwmx="">' +
|
|
listHtml += '<tr data-lid="' + lid + '"' + gclhtml + ' data-index="' + list_index + '" data-bwmx="">' +
|
|
- '<td class="text-center">' + list_index + '</td>' +
|
|
|
|
|
|
+ '<td class="text-center">' + list_index + (gcl.cid ? '<i class="text-danger" style="font-weight: 900">*</i>' : '') + '</td>' +
|
|
'<td>' + gcl.code + '</td>' +
|
|
'<td>' + gcl.code + '</td>' +
|
|
'<td class="text-left">' + gcl.name + '</td>' +
|
|
'<td class="text-left">' + gcl.name + '</td>' +
|
|
'<td class="text-center">' + unit + '</td>' +
|
|
'<td class="text-center">' + unit + '</td>' +
|
|
@@ -628,7 +637,7 @@ $(document).ready(() => {
|
|
const isCheck = $(this).hasClass('table-success') ? true : false;
|
|
const isCheck = $(this).hasClass('table-success') ? true : false;
|
|
const data_bwmx = $(this).attr('data-bwmx').split('$#$');
|
|
const data_bwmx = $(this).attr('data-bwmx').split('$#$');
|
|
const isDeal = $(this).data('gcl') !== undefined ? true : false;
|
|
const isDeal = $(this).data('gcl') !== undefined ? true : false;
|
|
- let codeHtml = '<tr quantity="'+ $(this).children('td').eq(5).text() +'" gcl_id="" mx_id=""><td colspan="7" class="colspan_1"> </td><td class="colspan_2"><input type="checkbox"></td></tr>';
|
|
|
|
|
|
+ let codeHtml = '<tr quantity="'+ $(this).children('td').eq(5).text() +'" gcl_id="" mx_id=""><td class="text-center">1</td><td colspan="7" class="colspan_1"> </td><td class="colspan_2"><input type="checkbox"></td></tr>';
|
|
if (isDeal) {
|
|
if (isDeal) {
|
|
const lid = $(this).data('lid');
|
|
const lid = $(this).data('lid');
|
|
let gcl = _.find(gclGatherData, function (item) {
|
|
let gcl = _.find(gclGatherData, function (item) {
|
|
@@ -638,7 +647,7 @@ $(document).ready(() => {
|
|
gcl = gclGatherData[$(this).data('gcl')];
|
|
gcl = gclGatherData[$(this).data('gcl')];
|
|
}
|
|
}
|
|
codeHtml = '';
|
|
codeHtml = '';
|
|
- for (const leaf of gcl.leafXmjs) {
|
|
|
|
|
|
+ for (const [index, leaf] of gcl.leafXmjs.entries()) {
|
|
const quantity = leaf.quantity !== undefined && leaf.quantity !== null ? leaf.quantity : 0;
|
|
const quantity = leaf.quantity !== undefined && leaf.quantity !== null ? leaf.quantity : 0;
|
|
const gcl_id = leaf.gcl_id ? leaf.gcl_id : '';
|
|
const gcl_id = leaf.gcl_id ? leaf.gcl_id : '';
|
|
const mx_id = leaf.mx_id ? leaf.mx_id : '';
|
|
const mx_id = leaf.mx_id ? leaf.mx_id : '';
|
|
@@ -651,7 +660,9 @@ $(document).ready(() => {
|
|
'checked' : '';
|
|
'checked' : '';
|
|
const isUsed = _.find(changeUsedData, { gcl_id: leaf.gcl_id, bwmx: (bwmx ? bwmx : leaf.jldy ? leaf.jldy : ''), oamount: leaf.quantity });
|
|
const isUsed = _.find(changeUsedData, { gcl_id: leaf.gcl_id, bwmx: (bwmx ? bwmx : leaf.jldy ? leaf.jldy : ''), oamount: leaf.quantity });
|
|
const isDisabled = isUsed ? 'disabled ' : '';
|
|
const isDisabled = isUsed ? 'disabled ' : '';
|
|
- codeHtml += '<tr quantity="' + quantity + '" gcl_id="' + gcl_id + '" mx_id="' + mx_id + '"><td>' + leaf.code + '</td>' +
|
|
|
|
|
|
+ codeHtml += '<tr quantity="' + quantity + '" gcl_id="' + gcl_id + '" mx_id="' + mx_id + '">' +
|
|
|
|
+ '<td class="text-center">' + (index+1) + (leaf.cid ? '<i class="text-danger" style="font-weight: 900">*</i>' : '') + '</td>' +
|
|
|
|
+ '<td>' + leaf.code + '</td>' +
|
|
'<td>' + (leaf.jldy ? leaf.jldy: '') + '</td>' +
|
|
'<td>' + (leaf.jldy ? leaf.jldy: '') + '</td>' +
|
|
'<td>' + (leaf.dwgc ? leaf.dwgc : '') + '</td>' +
|
|
'<td>' + (leaf.dwgc ? leaf.dwgc : '') + '</td>' +
|
|
'<td>' + (leaf.fbgc ? leaf.fbgc : '') + '</td>' +
|
|
'<td>' + (leaf.fbgc ? leaf.fbgc : '') + '</td>' +
|
|
@@ -662,9 +673,9 @@ $(document).ready(() => {
|
|
'></td></tr>';
|
|
'></td></tr>';
|
|
}
|
|
}
|
|
} else if (!isDeal && isCheck) {
|
|
} else if (!isDeal && isCheck) {
|
|
- codeHtml = '<tr quantity="'+ $(this).children('td').eq(5).text() +'" gcl_id="" mx_id=""><td colspan="7" class="colspan_1"> </td><td class="colspan_2"><input type="checkbox" checked></td></tr>';
|
|
|
|
|
|
+ codeHtml = '<tr quantity="'+ $(this).children('td').eq(5).text() +'" gcl_id="" mx_id=""><td class="text-center">1</td><td colspan="7" class="colspan_1"> </td><td class="colspan_2"><input type="checkbox" checked></td></tr>';
|
|
}
|
|
}
|
|
- $('#code-list').attr('data-index', $(this).children('td').eq(0).text());
|
|
|
|
|
|
+ $('#code-list').attr('data-index', parseInt($(this).children('td').eq(0).text()));
|
|
$('#code-input').val('');
|
|
$('#code-input').val('');
|
|
$('#code-input').siblings('a').hide();
|
|
$('#code-input').siblings('a').hide();
|
|
$('#code-list').html(codeHtml);
|
|
$('#code-list').html(codeHtml);
|
|
@@ -687,13 +698,13 @@ $(document).ready(() => {
|
|
const length = tr.children('td').length;
|
|
const length = tr.children('td').length;
|
|
const gcl_id = tr.attr('gcl_id');
|
|
const gcl_id = tr.attr('gcl_id');
|
|
const mx_id = tr.attr('mx_id');
|
|
const mx_id = tr.attr('mx_id');
|
|
- const bwmx = length === 8 ?
|
|
|
|
- tr.children('td').eq(0).text() + '!_!' +
|
|
|
|
|
|
+ const bwmx = length === 9 ?
|
|
tr.children('td').eq(1).text() + '!_!' +
|
|
tr.children('td').eq(1).text() + '!_!' +
|
|
tr.children('td').eq(2).text() + '!_!' +
|
|
tr.children('td').eq(2).text() + '!_!' +
|
|
tr.children('td').eq(3).text() + '!_!' +
|
|
tr.children('td').eq(3).text() + '!_!' +
|
|
- tr.children('td').eq(4).text() + '!_!' + gcl_id + '!_!' + mx_id + '!_!' +
|
|
|
|
- (tr.children('td').eq(5).text() !== '' ? tr.children('td').eq(5).text() : tr.children('td').eq(1).text()) : '0';
|
|
|
|
|
|
+ tr.children('td').eq(4).text() + '!_!' +
|
|
|
|
+ tr.children('td').eq(5).text() + '!_!' + gcl_id + '!_!' + mx_id + '!_!' +
|
|
|
|
+ (tr.children('td').eq(6).text() !== '' ? tr.children('td').eq(6).text() : tr.children('td').eq(2).text()) : '0';
|
|
const quantity = tr.attr('quantity');
|
|
const quantity = tr.attr('quantity');
|
|
const de_qu = bwmx + '*;*' + quantity;
|
|
const de_qu = bwmx + '*;*' + quantity;
|
|
data_bwmx.push(de_qu);
|
|
data_bwmx.push(de_qu);
|
|
@@ -710,13 +721,13 @@ $(document).ready(() => {
|
|
const length = tr.children('td').length;
|
|
const length = tr.children('td').length;
|
|
const gcl_id = tr.attr('gcl_id');
|
|
const gcl_id = tr.attr('gcl_id');
|
|
const mx_id = tr.attr('mx_id');
|
|
const mx_id = tr.attr('mx_id');
|
|
- const bwmx = length === 8 ?
|
|
|
|
- tr.children('td').eq(0).text() + '!_!' +
|
|
|
|
|
|
+ const bwmx = length === 9 ?
|
|
tr.children('td').eq(1).text() + '!_!' +
|
|
tr.children('td').eq(1).text() + '!_!' +
|
|
tr.children('td').eq(2).text() + '!_!' +
|
|
tr.children('td').eq(2).text() + '!_!' +
|
|
tr.children('td').eq(3).text() + '!_!' +
|
|
tr.children('td').eq(3).text() + '!_!' +
|
|
- tr.children('td').eq(4).text() + '!_!' + gcl_id + '!_!' + mx_id + '!_!' +
|
|
|
|
- (tr.children('td').eq(5).text() !== '' ? tr.children('td').eq(5).text() : tr.children('td').eq(1).text()) : '0';
|
|
|
|
|
|
+ tr.children('td').eq(4).text() + '!_!' +
|
|
|
|
+ tr.children('td').eq(5).text() + '!_!' + gcl_id + '!_!' + mx_id + '!_!' +
|
|
|
|
+ (tr.children('td').eq(6).text() !== '' ? tr.children('td').eq(6).text() : tr.children('td').eq(2).text()) : '0';
|
|
const quantity = tr.attr('quantity');
|
|
const quantity = tr.attr('quantity');
|
|
const de_qu = bwmx + '*;*' + quantity;
|
|
const de_qu = bwmx + '*;*' + quantity;
|
|
data_bwmx.push(de_qu);
|
|
data_bwmx.push(de_qu);
|
|
@@ -768,10 +779,55 @@ $(document).ready(() => {
|
|
$('input[name="code"]').val(code);
|
|
$('input[name="code"]').val(code);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ $('#select-list').change(function () {
|
|
|
|
+ const select = parseInt($(this).val());
|
|
|
|
+ let showListData = changeListData;
|
|
|
|
+ const value = $('#list-input').val();
|
|
|
|
+ if (select === 1) {
|
|
|
|
+ if (value !== '') {
|
|
|
|
+ $('#list-input').siblings('a').show();
|
|
|
|
+ showListData = _.filter(changeListData, function (c) {
|
|
|
|
+ return ((c.code && c.code.indexOf(value) !== -1) || (c.name && c.name.indexOf(value) !== -1)) && c.cid;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ $('#list-input').siblings('a').hide();
|
|
|
|
+ showListData = _.filter(changeListData, function (c) {
|
|
|
|
+ return c.cid;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (value !== '') {
|
|
|
|
+ $('#list-input').siblings('a').show();
|
|
|
|
+ showListData = _.filter(changeListData, function (c) {
|
|
|
|
+ return (c.code && c.code.indexOf(value) !== -1) || (c.name && c.name.indexOf(value) !== -1);
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ $('#list-input').siblings('a').hide();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ makeListTable(changeListData, showListData);
|
|
|
|
+ $('#table-list-select tr').removeClass('table-warning');
|
|
|
|
+ $('#code-input').val('');
|
|
|
|
+ $('#code-input').siblings('a').hide();
|
|
|
|
+ $('#code-list').html('');
|
|
|
|
+ $('#code-select-all').prop('checked', false);
|
|
|
|
+ });
|
|
|
|
+
|
|
$('#list-input').on('valuechange', function (e, previous) {
|
|
$('#list-input').on('valuechange', function (e, previous) {
|
|
|
|
+ const select = parseInt($('#select-list').val());
|
|
const value = $(this).val();
|
|
const value = $(this).val();
|
|
let showListData = changeListData;
|
|
let showListData = changeListData;
|
|
- if (value !== '') {
|
|
|
|
|
|
+ if (select === 1 && value !== '') {
|
|
|
|
+ $(this).siblings('a').show();
|
|
|
|
+ showListData = _.filter(changeListData, function (c) {
|
|
|
|
+ return ((c.code && c.code.indexOf(value) !== -1) || (c.name && c.name.indexOf(value) !== -1)) && c.cid;
|
|
|
|
+ });
|
|
|
|
+ } else if (select === 1 && value === '') {
|
|
|
|
+ $(this).siblings('a').hide();
|
|
|
|
+ showListData = _.filter(changeListData, function (c) {
|
|
|
|
+ return c.cid;
|
|
|
|
+ });
|
|
|
|
+ } else if (value !== '') {
|
|
$(this).siblings('a').show();
|
|
$(this).siblings('a').show();
|
|
showListData = _.filter(changeListData, function (c) {
|
|
showListData = _.filter(changeListData, function (c) {
|
|
return (c.code && c.code.indexOf(value) !== -1) || (c.name && c.name.indexOf(value) !== -1);
|
|
return (c.code && c.code.indexOf(value) !== -1) || (c.name && c.name.indexOf(value) !== -1);
|
|
@@ -802,7 +858,14 @@ $(document).ready(() => {
|
|
$(this).hide();
|
|
$(this).hide();
|
|
$(this).siblings('input').val('');
|
|
$(this).siblings('input').val('');
|
|
if ($(this).data('btn') === 'list') {
|
|
if ($(this).data('btn') === 'list') {
|
|
- makeListTable(changeListData);
|
|
|
|
|
|
+ const select = parseInt($('#select-list').val());
|
|
|
|
+ let showListData = changeListData;
|
|
|
|
+ if (select === 1) {
|
|
|
|
+ showListData = _.filter(changeListData, function (c) {
|
|
|
|
+ return c.cid;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ makeListTable(changeListData, showListData);
|
|
$('#table-list-select tr').removeClass('table-warning');
|
|
$('#table-list-select tr').removeClass('table-warning');
|
|
$('#code-list').html('');
|
|
$('#code-list').html('');
|
|
} else {
|
|
} else {
|
|
@@ -837,13 +900,13 @@ $(document).ready(() => {
|
|
const length = tr.children('td').length;
|
|
const length = tr.children('td').length;
|
|
const gcl_id = tr.attr('gcl_id');
|
|
const gcl_id = tr.attr('gcl_id');
|
|
const mx_id = tr.attr('mx_id');
|
|
const mx_id = tr.attr('mx_id');
|
|
- const bwmx = length === 8 ?
|
|
|
|
- tr.children('td').eq(0).text() + '!_!' +
|
|
|
|
|
|
+ const bwmx = length === 9 ?
|
|
tr.children('td').eq(1).text() + '!_!' +
|
|
tr.children('td').eq(1).text() + '!_!' +
|
|
tr.children('td').eq(2).text() + '!_!' +
|
|
tr.children('td').eq(2).text() + '!_!' +
|
|
tr.children('td').eq(3).text() + '!_!' +
|
|
tr.children('td').eq(3).text() + '!_!' +
|
|
- tr.children('td').eq(4).text() + '!_!' + gcl_id + '!_!' + mx_id + '!_!' +
|
|
|
|
- (tr.children('td').eq(5).text() !== '' ? tr.children('td').eq(5).text() : tr.children('td').eq(1).text()) : '0';
|
|
|
|
|
|
+ tr.children('td').eq(4).text() + '!_!' +
|
|
|
|
+ tr.children('td').eq(5).text() + '!_!' + gcl_id + '!_!' + mx_id + '!_!' +
|
|
|
|
+ (tr.children('td').eq(6).text() !== '' ? tr.children('td').eq(6).text() : tr.children('td').eq(2).text()) : '0';
|
|
const quantity = tr.attr('quantity');
|
|
const quantity = tr.attr('quantity');
|
|
const de_qu = bwmx + '*;*' + quantity;
|
|
const de_qu = bwmx + '*;*' + quantity;
|
|
data_bwmx.push(de_qu);
|
|
data_bwmx.push(de_qu);
|
|
@@ -1174,10 +1237,10 @@ function makeCodeTable(search = '') {
|
|
}
|
|
}
|
|
for(let i = 0; i < $('#code-list tr').length; i++) {
|
|
for(let i = 0; i < $('#code-list tr').length; i++) {
|
|
const length = $('#code-list tr').eq(i).children('td').length;
|
|
const length = $('#code-list tr').eq(i).children('td').length;
|
|
- if (length === 8) {
|
|
|
|
- const code = $('#code-list tr').eq(i).children('td').eq(0).text();
|
|
|
|
- const name = $('#code-list tr').eq(i).children('td').eq(1).text();
|
|
|
|
- const jldy = $('#code-list tr').eq(i).children('td').eq(5).text();
|
|
|
|
|
|
+ if (length === 9) {
|
|
|
|
+ const code = $('#code-list tr').eq(i).children('td').eq(1).text();
|
|
|
|
+ const name = $('#code-list tr').eq(i).children('td').eq(2).text();
|
|
|
|
+ const jldy = $('#code-list tr').eq(i).children('td').eq(6).text();
|
|
const isShow = code.indexOf(search) !== -1 || name.indexOf(search) !== -1 || jldy.indexOf(search) !== -1;
|
|
const isShow = code.indexOf(search) !== -1 || name.indexOf(search) !== -1 || jldy.indexOf(search) !== -1;
|
|
$('#code-list tr').eq(i).css('display', (isShow ? 'table-row' : 'none'));
|
|
$('#code-list tr').eq(i).css('display', (isShow ? 'table-row' : 'none'));
|
|
} else {
|
|
} else {
|