|
@@ -566,8 +566,12 @@ $(document).ready(() => {
|
|
|
judgeChange();
|
|
|
});
|
|
|
$('body').on('click', '#change_form input[type="checkbox"]', function (e, previous) {
|
|
|
- console.log($(this).val());
|
|
|
- console.log($(this).attr('name'));
|
|
|
+ const typecheck = [];
|
|
|
+ $.each($('#change_form input[name="type[]"]:checked'), function () {
|
|
|
+ typecheck.push($(this).val());
|
|
|
+ });
|
|
|
+ changeInfo.type = typecheck.join(',');
|
|
|
+ judgeChange();
|
|
|
});
|
|
|
|
|
|
});
|
|
@@ -583,9 +587,10 @@ function tableDataRemake(changeListData) {
|
|
|
for (const cl of changeList) {
|
|
|
const clinfo = cl.split(';');
|
|
|
// console.log(clinfo);
|
|
|
- const listinfo = changeListData.find(function (item) {
|
|
|
- return item.b_code === clinfo[0] && item.name === clinfo[1] && item.unit_price === parseFloat(clinfo[4])
|
|
|
- });
|
|
|
+ const listinfo = changeListData[clinfo[8] - 1];
|
|
|
+ // const listinfo = changeListData.find(function (item) {
|
|
|
+ // return item.b_code === clinfo[0] && item.name === clinfo[1] && item.unit_price === parseFloat(clinfo[4])
|
|
|
+ // });
|
|
|
// if (listinfo === undefined) {
|
|
|
// toastr.warning('台账清单列表已不存在'+ clinfo[0] +',故删除之');
|
|
|
// continue;
|
|
@@ -630,6 +635,11 @@ function changeFormRemake() {
|
|
|
$('#change_form select[name="quality"]').val(changeInfo.quality);
|
|
|
$('#change_form select[name="company"]').val(changeInfo.company);
|
|
|
$('#change_form input[name="charge"][value="'+ changeInfo.charge +'"]').prop('checked', true);
|
|
|
+ $('#change_form input[name="type[]"]').prop('checked', false);
|
|
|
+ const typecheck = changeInfo.type.split(',');
|
|
|
+ for (const type of typecheck) {
|
|
|
+ $('#change_form input[name="type[]"][value="'+ type +'"]').prop('checked', true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//判断元素是否在数组中,相当于php的in_array();
|