|
@@ -266,239 +266,250 @@ $(function () {
|
|
|
$('#add-qi').modal('hide');
|
|
|
$('#okedit').modal('show');
|
|
|
interval = setInterval(progress, 50);
|
|
|
- postData(preUrl + '/measure/material/gcl/load', { stage_id, is_stage_self }, function (result) {
|
|
|
- // console.log(result);
|
|
|
- const ledger = result.ledger;
|
|
|
- const pos = result.pos;
|
|
|
- const gclList = result.gclList;
|
|
|
- const selfList = result.selfList;
|
|
|
- // 整理material,针对上期是独立单价并多个不同值的单独设置值进行部分值去除
|
|
|
- const materialListForSelf = _.uniqWith(_.orderBy(result.materialListForSelf, ['ms_id'], ['desc']), function(item1, item2) {
|
|
|
- return item1.xmj_id === item2.xmj_id && item1.gcl_id === item2.gcl_id && item1.mx_id === item2.mx_id && item1.mb_id === item2.mb_id;
|
|
|
- });
|
|
|
- console.log(materialListForSelf, result.materialListForSelf);
|
|
|
- const insertGclList = [];
|
|
|
- const insertList = [];
|
|
|
- const insertSelfList = [];// 需要单独添加的明细清单工料含量列表
|
|
|
- const removeGclList = [];
|
|
|
- const hadQtySelfList = [];
|
|
|
- if (is_stage_self) {
|
|
|
- for (const sid of stage_id) {
|
|
|
- const curLedger = _.find(result.curLedgerData, {sid: sid});
|
|
|
- const curPos = _.find(result.curPosData, {sid: sid});
|
|
|
- gclGatherModel.loadLedgerData(_.cloneDeep(ledger), curLedger.ledgerData);
|
|
|
- gclGatherModel.loadPosData(_.cloneDeep(pos), curPos.posData);
|
|
|
- const gclGatherData = gclGatherModel.gatherGclData();
|
|
|
- // console.log(gclGatherData);
|
|
|
- const insertGcl = [];
|
|
|
- for (const g of gclList) {
|
|
|
- const gcl = _.find(gclGatherData, function (item) {
|
|
|
- return item.leafXmjs && item.leafXmjs.length > 0 && _.findIndex(item.leafXmjs, {gcl_id: g.gcl_id}) !== -1;
|
|
|
- });
|
|
|
- if (gcl) {
|
|
|
- const ig = _.find(insertGcl, {gcl});
|
|
|
- if (ig) {
|
|
|
- if (_.findIndex(ig.bills, {mb_id: g.mb_id}) === -1) {
|
|
|
- ig.bills.push(g);
|
|
|
- }
|
|
|
- } else {
|
|
|
- insertGcl.push({
|
|
|
- bills: [g],
|
|
|
- gcl,
|
|
|
- leafXmjs: _.filter(gcl.leafXmjs, function (item) {
|
|
|
- return item.gather_qty !== undefined && item.gather_qty !== null
|
|
|
- }),
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- removeGclList.push(g);
|
|
|
- }
|
|
|
- }
|
|
|
- for (const one of insertGcl) {
|
|
|
- if (one.leafXmjs && one.leafXmjs.length > 0) {
|
|
|
- for (const xmj of one.leafXmjs) {
|
|
|
- const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' }) !== -1;// 区分单独计量的明细工料含量
|
|
|
- if (is_self) {
|
|
|
- const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' });
|
|
|
- for (const bill of billsList) {
|
|
|
- if (!_.find(hadQtySelfList, bill)) {
|
|
|
- hadQtySelfList.push(bill);
|
|
|
- }
|
|
|
- insertSelfList.push({
|
|
|
- gcl_id: xmj.gcl_id,
|
|
|
- mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
- xmj_id: xmj.id ? xmj.id : null,
|
|
|
- contract_qty: xmj.contract_qty,
|
|
|
- qc_qty: xmj.qc_qty,
|
|
|
- qc_minus_qty: xmj.qc_minus_qty,
|
|
|
- gather_qty: xmj.gather_qty,
|
|
|
- quantity: bill.quantity,
|
|
|
- expr: bill.expr,
|
|
|
- mb_id: bill.mb_id,
|
|
|
- order: bill.order,
|
|
|
- sid,
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- const newgcl = _.find(gclList, { gcl_id: xmj.gcl_id });
|
|
|
- for (const bill of one.bills) {
|
|
|
- insertList.push({
|
|
|
- gcl_id: xmj.gcl_id,
|
|
|
- mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
- xmj_id: xmj.id ? xmj.id : null,
|
|
|
- contract_qty: xmj.contract_qty,
|
|
|
- qc_qty: xmj.qc_qty,
|
|
|
- qc_minus_qty: xmj.qc_minus_qty,
|
|
|
- gather_qty: xmj.gather_qty,
|
|
|
- quantity: bill.quantity,
|
|
|
- expr: bill.expr,
|
|
|
- mb_id: bill.mb_id,
|
|
|
- order: bill.order,
|
|
|
- sid,
|
|
|
- });
|
|
|
- if (!newgcl) {
|
|
|
- if (_.findIndex(insertGclList, { gcl_id: xmj.gcl_id }) === -1) {
|
|
|
- insertGclList.push({
|
|
|
- gcl_id: xmj.gcl_id,
|
|
|
- quantity: bill.quantity,
|
|
|
- expr: bill.expr,
|
|
|
- old_quantity: bill.quantity,
|
|
|
- old_expr: bill.expr,
|
|
|
- mb_id: bill.mb_id,
|
|
|
- order: bill.order,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- const curLedgerData = result.curLedgerData;
|
|
|
- const curPosData = result.curPosData;
|
|
|
- gclGatherModel.loadLedgerData(_.cloneDeep(ledger), curLedgerData);
|
|
|
- gclGatherModel.loadPosData(_.cloneDeep(pos), curPosData);
|
|
|
- const gclGatherData = gclGatherModel.gatherGclData();
|
|
|
- const insertGcl = [];
|
|
|
- for (const g of gclList) {
|
|
|
- const gcl = _.find(gclGatherData, function (item) {
|
|
|
- return item.leafXmjs && item.leafXmjs.length > 0 && _.findIndex(item.leafXmjs, {gcl_id: g.gcl_id}) !== -1;
|
|
|
- });
|
|
|
- if (gcl) {
|
|
|
- const ig = _.find(insertGcl, {gcl});
|
|
|
- if (ig) {
|
|
|
- if (_.findIndex(ig.bills, {mb_id: g.mb_id}) === -1) {
|
|
|
- ig.bills.push(g);
|
|
|
- }
|
|
|
- } else {
|
|
|
- insertGcl.push({
|
|
|
- bills: [g],
|
|
|
- gcl,
|
|
|
- leafXmjs: _.filter(gcl.leafXmjs, function (item) {
|
|
|
- return item.gather_qty !== undefined && item.gather_qty !== null || (item.qc_minus_qty !== undefined && item.qc_minus_qty !== null)
|
|
|
- }),
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- removeGclList.push(g);
|
|
|
- }
|
|
|
- }
|
|
|
- for (const one of insertGcl) {
|
|
|
- if (one.leafXmjs && one.leafXmjs.length > 0) {
|
|
|
- for (const xmj of one.leafXmjs) {
|
|
|
- const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null }) !== -1;// 区分单独计量的明细工料含量
|
|
|
- if (is_self) {
|
|
|
- const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null });
|
|
|
- for (const bill of billsList) {
|
|
|
- hadQtySelfList.push(bill);
|
|
|
- insertSelfList.push({
|
|
|
- gcl_id: xmj.gcl_id,
|
|
|
- mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
- xmj_id: xmj.id ? xmj.id : null,
|
|
|
- contract_qty: xmj.contract_qty,
|
|
|
- qc_qty: xmj.qc_qty,
|
|
|
- qc_minus_qty: xmj.qc_minus_qty,
|
|
|
- gather_qty: xmj.gather_qty,
|
|
|
- quantity: bill.quantity,
|
|
|
- expr: bill.expr,
|
|
|
- mb_id: bill.mb_id,
|
|
|
- order: bill.order,
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- const newgcl = _.find(gclList, { gcl_id: xmj.gcl_id });
|
|
|
- for (const bill of one.bills) {
|
|
|
- insertList.push({
|
|
|
- gcl_id: xmj.gcl_id,
|
|
|
- mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
- xmj_id: xmj.id ? xmj.id : null,
|
|
|
- contract_qty: xmj.contract_qty,
|
|
|
- qc_qty: xmj.qc_qty,
|
|
|
- qc_minus_qty: xmj.qc_minus_qty,
|
|
|
- gather_qty: xmj.gather_qty,
|
|
|
- quantity: bill.quantity,
|
|
|
- expr: bill.expr,
|
|
|
- mb_id: bill.mb_id,
|
|
|
- order: bill.order,
|
|
|
- });
|
|
|
- if (!newgcl) {
|
|
|
- insertGclList.push({
|
|
|
- gcl_id: xmj.gcl_id,
|
|
|
- quantity: bill.quantity,
|
|
|
- expr: bill.expr,
|
|
|
- old_quantity: bill.quantity,
|
|
|
- old_expr: bill.expr,
|
|
|
- mb_id: bill.mb_id,
|
|
|
- order: bill.order,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 通过比较materialListForSelf和hadQtySelfList不重合部分,得出本期为null的gather_qty列表,插入到insertSelfList中
|
|
|
- const pushSelfList = _.xorWith(materialListForSelf, hadQtySelfList, _.isEqual);
|
|
|
- if (pushSelfList.length > 0) {
|
|
|
- for (const ps of pushSelfList) {
|
|
|
- insertSelfList.push({
|
|
|
- gcl_id: ps.gcl_id,
|
|
|
- mx_id: ps.mx_id,
|
|
|
- xmj_id: ps.xmj_id,
|
|
|
- contract_qty: null,
|
|
|
- qc_qty: null,
|
|
|
- qc_minus_qty: null,
|
|
|
- gather_qty: null,
|
|
|
- quantity: ps.quantity,
|
|
|
- expr: ps.expr,
|
|
|
- mb_id: ps.mb_id,
|
|
|
- order: ps.order,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- // 可能需要新增list_gcl表
|
|
|
- newMaterialData.material_list = insertList;
|
|
|
- newMaterialData.material_self_list = insertSelfList;
|
|
|
- newMaterialData.insertGclList = insertGclList;
|
|
|
- newMaterialData.removeGclList = removeGclList;
|
|
|
- console.log(newMaterialData);
|
|
|
- console.log(insertSelfList);
|
|
|
- postData(preUrl + '/measure/material/add', newMaterialData, function (result) {
|
|
|
- window.location.href = preUrl + '/measure/material/' + result.order;
|
|
|
- }, function () {
|
|
|
- stop = true;
|
|
|
- clearInterval(interval);
|
|
|
- console.log(_self.parents('div[id="add-qi"]'));
|
|
|
- $('#add-qi').modal('show');
|
|
|
- $('#okedit').modal('hide');
|
|
|
- _self.parents('div[id="add-qi"]').modal('show');
|
|
|
- _self.attr('disabled', false).text('确认添加');
|
|
|
- });
|
|
|
- return;
|
|
|
+ postData(preUrl + '/measure/material/add', newMaterialData, function (result) {
|
|
|
+ window.location.href = preUrl + '/measure/material/' + result.order;
|
|
|
+ }, function () {
|
|
|
+ stop = true;
|
|
|
+ clearInterval(interval);
|
|
|
+ console.log(_self.parents('div[id="add-qi"]'));
|
|
|
+ $('#add-qi').modal('show');
|
|
|
+ $('#okedit').modal('hide');
|
|
|
+ _self.parents('div[id="add-qi"]').modal('show');
|
|
|
+ _self.attr('disabled', false).text('确认添加');
|
|
|
});
|
|
|
+ // postData(preUrl + '/measure/material/gcl/load', { stage_id, is_stage_self }, function (result) {
|
|
|
+ // // console.log(result);
|
|
|
+ // const ledger = result.ledger;
|
|
|
+ // const pos = result.pos;
|
|
|
+ // const gclList = result.gclList;
|
|
|
+ // const selfList = result.selfList;
|
|
|
+ // // 整理material,针对上期是独立单价并多个不同值的单独设置值进行部分值去除
|
|
|
+ // const materialListForSelf = _.uniqWith(_.orderBy(result.materialListForSelf, ['ms_id'], ['desc']), function(item1, item2) {
|
|
|
+ // return item1.xmj_id === item2.xmj_id && item1.gcl_id === item2.gcl_id && item1.mx_id === item2.mx_id && item1.mb_id === item2.mb_id;
|
|
|
+ // });
|
|
|
+ // console.log(materialListForSelf, result.materialListForSelf);
|
|
|
+ // const insertGclList = [];
|
|
|
+ // const insertList = [];
|
|
|
+ // const insertSelfList = [];// 需要单独添加的明细清单工料含量列表
|
|
|
+ // const removeGclList = [];
|
|
|
+ // const hadQtySelfList = [];
|
|
|
+ // if (is_stage_self) {
|
|
|
+ // for (const sid of stage_id) {
|
|
|
+ // const curLedger = _.find(result.curLedgerData, {sid: sid});
|
|
|
+ // const curPos = _.find(result.curPosData, {sid: sid});
|
|
|
+ // gclGatherModel.loadLedgerData(_.cloneDeep(ledger), curLedger.ledgerData);
|
|
|
+ // gclGatherModel.loadPosData(_.cloneDeep(pos), curPos.posData);
|
|
|
+ // const gclGatherData = gclGatherModel.gatherGclData();
|
|
|
+ // // console.log(gclGatherData);
|
|
|
+ // const insertGcl = [];
|
|
|
+ // for (const g of gclList) {
|
|
|
+ // const gcl = _.find(gclGatherData, function (item) {
|
|
|
+ // return item.leafXmjs && item.leafXmjs.length > 0 && _.findIndex(item.leafXmjs, {gcl_id: g.gcl_id}) !== -1;
|
|
|
+ // });
|
|
|
+ // if (gcl) {
|
|
|
+ // const ig = _.find(insertGcl, {gcl});
|
|
|
+ // if (ig) {
|
|
|
+ // if (_.findIndex(ig.bills, {mb_id: g.mb_id}) === -1) {
|
|
|
+ // ig.bills.push(g);
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // insertGcl.push({
|
|
|
+ // bills: [g],
|
|
|
+ // gcl,
|
|
|
+ // leafXmjs: _.filter(gcl.leafXmjs, function (item) {
|
|
|
+ // return item.gather_qty !== undefined && item.gather_qty !== null
|
|
|
+ // }),
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // removeGclList.push(g);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // for (const one of insertGcl) {
|
|
|
+ // if (one.leafXmjs && one.leafXmjs.length > 0) {
|
|
|
+ // for (const xmj of one.leafXmjs) {
|
|
|
+ // const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' }) !== -1;// 区分单独计量的明细工料含量
|
|
|
+ // if (is_self) {
|
|
|
+ // const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' });
|
|
|
+ // for (const bill of billsList) {
|
|
|
+ // if (!_.find(hadQtySelfList, bill)) {
|
|
|
+ // hadQtySelfList.push(bill);
|
|
|
+ // }
|
|
|
+ // insertSelfList.push({
|
|
|
+ // gcl_id: xmj.gcl_id,
|
|
|
+ // mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
+ // xmj_id: xmj.id ? xmj.id : null,
|
|
|
+ // contract_qty: xmj.contract_qty,
|
|
|
+ // qc_qty: xmj.qc_qty,
|
|
|
+ // qc_minus_qty: xmj.qc_minus_qty,
|
|
|
+ // gather_qty: xmj.gather_qty,
|
|
|
+ // quantity: bill.quantity,
|
|
|
+ // expr: bill.expr,
|
|
|
+ // mb_id: bill.mb_id,
|
|
|
+ // order: bill.order,
|
|
|
+ // sid,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // const newgcl = _.find(gclList, { gcl_id: xmj.gcl_id });
|
|
|
+ // for (const bill of one.bills) {
|
|
|
+ // insertList.push({
|
|
|
+ // gcl_id: xmj.gcl_id,
|
|
|
+ // mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
+ // xmj_id: xmj.id ? xmj.id : null,
|
|
|
+ // contract_qty: xmj.contract_qty,
|
|
|
+ // qc_qty: xmj.qc_qty,
|
|
|
+ // qc_minus_qty: xmj.qc_minus_qty,
|
|
|
+ // gather_qty: xmj.gather_qty,
|
|
|
+ // quantity: bill.quantity,
|
|
|
+ // expr: bill.expr,
|
|
|
+ // mb_id: bill.mb_id,
|
|
|
+ // order: bill.order,
|
|
|
+ // sid,
|
|
|
+ // });
|
|
|
+ // if (!newgcl) {
|
|
|
+ // if (_.findIndex(insertGclList, { gcl_id: xmj.gcl_id }) === -1) {
|
|
|
+ // insertGclList.push({
|
|
|
+ // gcl_id: xmj.gcl_id,
|
|
|
+ // quantity: bill.quantity,
|
|
|
+ // expr: bill.expr,
|
|
|
+ // old_quantity: bill.quantity,
|
|
|
+ // old_expr: bill.expr,
|
|
|
+ // mb_id: bill.mb_id,
|
|
|
+ // order: bill.order,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // const curLedgerData = result.curLedgerData;
|
|
|
+ // const curPosData = result.curPosData;
|
|
|
+ // gclGatherModel.loadLedgerData(_.cloneDeep(ledger), curLedgerData);
|
|
|
+ // gclGatherModel.loadPosData(_.cloneDeep(pos), curPosData);
|
|
|
+ // const gclGatherData = gclGatherModel.gatherGclData();
|
|
|
+ // const insertGcl = [];
|
|
|
+ // for (const g of gclList) {
|
|
|
+ // const gcl = _.find(gclGatherData, function (item) {
|
|
|
+ // return item.leafXmjs && item.leafXmjs.length > 0 && _.findIndex(item.leafXmjs, {gcl_id: g.gcl_id}) !== -1;
|
|
|
+ // });
|
|
|
+ // if (gcl) {
|
|
|
+ // const ig = _.find(insertGcl, {gcl});
|
|
|
+ // if (ig) {
|
|
|
+ // if (_.findIndex(ig.bills, {mb_id: g.mb_id}) === -1) {
|
|
|
+ // ig.bills.push(g);
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // insertGcl.push({
|
|
|
+ // bills: [g],
|
|
|
+ // gcl,
|
|
|
+ // leafXmjs: _.filter(gcl.leafXmjs, function (item) {
|
|
|
+ // return item.gather_qty !== undefined && item.gather_qty !== null || (item.qc_minus_qty !== undefined && item.qc_minus_qty !== null)
|
|
|
+ // }),
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // removeGclList.push(g);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // for (const one of insertGcl) {
|
|
|
+ // if (one.leafXmjs && one.leafXmjs.length > 0) {
|
|
|
+ // for (const xmj of one.leafXmjs) {
|
|
|
+ // const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null }) !== -1;// 区分单独计量的明细工料含量
|
|
|
+ // if (is_self) {
|
|
|
+ // const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null });
|
|
|
+ // for (const bill of billsList) {
|
|
|
+ // hadQtySelfList.push(bill);
|
|
|
+ // insertSelfList.push({
|
|
|
+ // gcl_id: xmj.gcl_id,
|
|
|
+ // mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
+ // xmj_id: xmj.id ? xmj.id : null,
|
|
|
+ // contract_qty: xmj.contract_qty,
|
|
|
+ // qc_qty: xmj.qc_qty,
|
|
|
+ // qc_minus_qty: xmj.qc_minus_qty,
|
|
|
+ // gather_qty: xmj.gather_qty,
|
|
|
+ // quantity: bill.quantity,
|
|
|
+ // expr: bill.expr,
|
|
|
+ // mb_id: bill.mb_id,
|
|
|
+ // order: bill.order,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // const newgcl = _.find(gclList, { gcl_id: xmj.gcl_id });
|
|
|
+ // for (const bill of one.bills) {
|
|
|
+ // insertList.push({
|
|
|
+ // gcl_id: xmj.gcl_id,
|
|
|
+ // mx_id: xmj.mx_id ? xmj.mx_id : '',
|
|
|
+ // xmj_id: xmj.id ? xmj.id : null,
|
|
|
+ // contract_qty: xmj.contract_qty,
|
|
|
+ // qc_qty: xmj.qc_qty,
|
|
|
+ // qc_minus_qty: xmj.qc_minus_qty,
|
|
|
+ // gather_qty: xmj.gather_qty,
|
|
|
+ // quantity: bill.quantity,
|
|
|
+ // expr: bill.expr,
|
|
|
+ // mb_id: bill.mb_id,
|
|
|
+ // order: bill.order,
|
|
|
+ // });
|
|
|
+ // if (!newgcl) {
|
|
|
+ // insertGclList.push({
|
|
|
+ // gcl_id: xmj.gcl_id,
|
|
|
+ // quantity: bill.quantity,
|
|
|
+ // expr: bill.expr,
|
|
|
+ // old_quantity: bill.quantity,
|
|
|
+ // old_expr: bill.expr,
|
|
|
+ // mb_id: bill.mb_id,
|
|
|
+ // order: bill.order,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 通过比较materialListForSelf和hadQtySelfList不重合部分,得出本期为null的gather_qty列表,插入到insertSelfList中
|
|
|
+ // const pushSelfList = _.xorWith(materialListForSelf, hadQtySelfList, _.isEqual);
|
|
|
+ // if (pushSelfList.length > 0) {
|
|
|
+ // for (const ps of pushSelfList) {
|
|
|
+ // insertSelfList.push({
|
|
|
+ // gcl_id: ps.gcl_id,
|
|
|
+ // mx_id: ps.mx_id,
|
|
|
+ // xmj_id: ps.xmj_id,
|
|
|
+ // contract_qty: null,
|
|
|
+ // qc_qty: null,
|
|
|
+ // qc_minus_qty: null,
|
|
|
+ // gather_qty: null,
|
|
|
+ // quantity: ps.quantity,
|
|
|
+ // expr: ps.expr,
|
|
|
+ // mb_id: ps.mb_id,
|
|
|
+ // order: ps.order,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 可能需要新增list_gcl表
|
|
|
+ // newMaterialData.material_list = insertList;
|
|
|
+ // newMaterialData.material_self_list = insertSelfList;
|
|
|
+ // newMaterialData.insertGclList = insertGclList;
|
|
|
+ // newMaterialData.removeGclList = removeGclList;
|
|
|
+ // console.log(newMaterialData);
|
|
|
+ // console.log(insertSelfList);
|
|
|
+ // postData(preUrl + '/measure/material/add', newMaterialData, function (result) {
|
|
|
+ // window.location.href = preUrl + '/measure/material/' + result.order;
|
|
|
+ // }, function () {
|
|
|
+ // stop = true;
|
|
|
+ // clearInterval(interval);
|
|
|
+ // console.log(_self.parents('div[id="add-qi"]'));
|
|
|
+ // $('#add-qi').modal('show');
|
|
|
+ // $('#okedit').modal('hide');
|
|
|
+ // _self.parents('div[id="add-qi"]').modal('show');
|
|
|
+ // _self.attr('disabled', false).text('确认添加');
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // });
|
|
|
// $(this).parents('form').submit();
|
|
|
});
|
|
|
|