123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595 |
- 'use strict';
- /**
- * 期计量 - 期列表页面 js
- *
- * @author Mai
- * @date 2018/12/7
- * @version
- */
- $(function () {
- const getGroupAuditHtml = function (group) {
- return group.map(u => { return `<small class="d-inline-block text-dark mx-1" title="${u.role}" data-auditorId="${u.aid}">${u.name}</small>`; }).join('');
- };
- const getAuditTypeHtml = function (type) {
- if (type === auditType.key.common) return '';
- return `<div class="li-subscript"><span class="badge badge-pill badge-${auditType.info[type].class} p-1 badge-bg-small"><small>${auditType.info[type].short}</small></span></div>`;
- };
- const getAuditTypeText = function (type) {
- if (type === auditType.key.common) return '';
- return `<span class="text-${auditType.info[type].class}">${auditType.info[type].long}</span>`;
- };
- // 获取审批流程
- $('a[data-target="#sp-list" ]').on('click', function () {
- const data = {
- order: $(this).attr('m-order'),
- };
- postData('/tender/' + tenderId + '/measure/material/auditors', data, function (result) {
- const { auditHistory, auditors2, user } = result
- let auditorsHTML = [];
- auditors2.forEach((group, idx) => {
- if (idx === 0) {
- auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
- <span class="text-muted">${getGroupAuditHtml(group)}</span>
- <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
- </li>`);
- } else if(idx === auditors2.length -1 && idx !== 0) {
- auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-stop-circle fa-rotate-90"></i></span>
- <span class="text-muted">${getGroupAuditHtml(group)}</span>
- <div class="d-flex ml-auto">
- ${getAuditTypeHtml(group[0].audit_type)}
- <span class="badge badge-light badge-pill ml-auto"><small>终审</small></span>
- </div>
- </li>`);
- } else {
- auditorsHTML.push(`<li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-chevron-circle-down"></i></span>
- <span class="text-muted">${getGroupAuditHtml(group)}</span>
- <div class="d-flex ml-auto">
- ${getAuditTypeHtml(group[0].audit_type)}
- <span class="badge badge-light badge-pill"><small>${transFormToChinese(idx)}审</small></span>
- </div>
- </li>`);
- }
- });
- $('#auditor-list').empty()
- $('#auditor-list').append(auditorsHTML.join(''));
- let historyHTML = [];
- auditHistory.forEach((his, idx) => {
- if (idx === auditHistory.length - 1 && auditHistory.length !== 1) {
- historyHTML.push(`<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a></div>`);
- }
- historyHTML.push(`<div class="${idx < auditHistory.length - 1 ? 'fold-card' : ''}">`);
- historyHTML.push(`<div class="text-center text-muted">${idx+1}#</div>`);
- historyHTML.push(`<ul class="timeline-list list-unstyled mt-2 ${ idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'last-auditor-list' : '' }">`);
- his.forEach((group, index) => {
- if (index === 0) {
- historyHTML.push(`<li class="timeline-list-item pb-2">
- <div class="timeline-item-date">
- ${group.beginYear}
- <span>${group.beginDate}</span>
- <span>${group.beginTime}</span>
- </div>
- <div class="timeline-item-tail"></div>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">原报</span>
- <span class="pull-right text-success">${idx !== 0 ? '重新' : '' }上报审批</span>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <div class="card-text p-2 py-3 row">
- <div class="col">
- <span class="h6">${user.name}</span>
- <span class="text-muted ml-1">${user.role}</span>
- </div>
- <div class="col">
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>`);
- }
- historyHTML.push(`<li class="timeline-list-item pb-2 ${ group.status === auditConst.status.uncheck && idx === auditHistory.length - 1 && auditHistory.length !== 1 ? 'is_uncheck' : ''}">`);
- if (group.endYear) {
- historyHTML.push(`<div class="timeline-item-date">${group.endYear}<span>${group.endDate}</span><span>${group.endTime}</span></div>`);
- }
- if (index < his.length - 1) {
- historyHTML.push('<div class="timeline-item-tail"></div>');
- }
- if (group.status === auditConst.status.checked) {
- historyHTML.push('<div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>');
- } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) {
- historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>');
- } else if (group.status === auditConst.status.checking) {
- historyHTML.push('<div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>');
- } else {
- historyHTML.push('<div class="timeline-item-icon bg-secondary text-light"></div>');
- }
- historyHTML.push('<div class="timeline-item-content">');
- const statuStr = group.status !== auditConst.status.uncheck ?
- `<span class="pull-right ${auditConst.statusClass[group.status]}">${auditConst.statusString[group.status]}</span>` : '';
- historyHTML.push(`<div class="py-1">
- <span class="text-black-50">
- ${ !group.is_final ? group.audit_order + '' : '终' }审 ${getAuditTypeText(group.audit_type)}
- </span>
- ${statuStr}
- </div>`);
- historyHTML.push('<div class="card"><div class="card-body px-3 py-0">');
- for (const [i, auditor] of group.auditors.entries()) {
- historyHTML.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
- historyHTML.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.role}</span></div>`);
- historyHTML.push('<div class="col">');
- if (auditor.status === auditConst.status.checked) {
- historyHTML.push('<span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>');
- } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) {
- historyHTML.push('<span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>');
- }
- historyHTML.push('</div>');
- if (auditor.opinion) {
- historyHTML.push(`<div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i>${auditor.opinion}</div>`);
- }
- historyHTML.push('</div>');
- }
- historyHTML.push('</div></div>');
- historyHTML.push('</div>');
- historyHTML.push('</li>');
- });
- historyHTML.push('</div>');
- historyHTML.push('</ul>');
- });
- $('#audit-list').empty();
- $('#audit-list').append(historyHTML.join(''));
- });
- });
- // 展开/收起历史审核记录
- $('#audit-list').on('click', 'a', function() {
- const type = $(this).data('target')
- const auditCard = $(this).parent().parent()
- console.log('auditCard', auditCard)
- if (type === 'show') {
- $(this).data('target', 'hide')
- auditCard.find('.fold-card').slideDown('swing', () => {
- auditCard.find('#end-target').text($(this).data('idx') + '#')
- auditCard.find('#fold-btn').text('收起历史审核记录')
- })
- } else {
- $(this).data('target', 'show')
- auditCard.find('.fold-card').slideUp('swing', () => {
- auditCard.find('#end-target').text('1#')
- auditCard.find('#fold-btn').text('展开历史审核记录')
- })
- }
- });
- function formatDate(date) {
- if (!date) return '';
- date = new Date(date)
- const year = date.getFullYear();
- let mon = date.getMonth() + 1;
- let day = date.getDate();
- let hour = date.getHours();
- let minute = date.getMinutes();
- let scond = date.getSeconds();
- if (mon < 10) {
- mon = '0' + mon.toString();
- }
- if (day < 10) {
- day = '0' + day.toString();
- }
- if (hour < 10) {
- hour = '0' + hour.toString();
- }
- if (minute < 10) {
- minute = '0' + minute.toString();
- }
- if (scond < 10) {
- scond = '0' + scond.toString();
- }
- return `${year}<span>${mon}-${day}</span><span>${hour}:${minute}:${scond}</span>`;
- };
- // 计量期选中
- $('.select-stage-order').on('click', function () {
- const stageList = $('.select-stage-order:checked');
- if (stageList.length === 0) {
- $('#show_order').hide();
- $('#s_order').val('');
- } else {
- const order_array = [];
- for (let s = 0; s < stageList.length; s++) {
- order_array.push(stageList.eq(s).data('order'));
- // console.log(stageList.eq(s));
- }
- $('#show_order').html('第<b class="mx-2">' + order_array.join(',') + '</b>期');
- $('#show_order').show();
- $('#s_order').val(order_array.join(','));
- if (stageList.length > 1) {
- if($('#material_unitPrice').is(':hidden')){
- $('#unitPrice_dl').prop('checked', true);
- }
- $('#material_unitPrice').show();
- } else {
- $('#material_unitPrice').hide();
- $('#unitPrice_gy').prop('checked', true);
- }
- }
- });
- let interval;
- let stop = false;
- // 提交表单判断
- $('#addMaterial').click(function () {
- $(this).attr('disabled', true);
- if ($('#s_order').val() == '') {
- toastr.error('请选择计量期');
- $(this).removeAttr('disabled');
- return false;
- }
- $(this).text('正在生成新一期数据中,请勿刷新本页!...');
- const _self = $(this);
- const stage_id = [];
- $('#add-qi input[name="stage_id[]"]:checked').each(function () {
- stage_id.push(parseInt($(this).val()));
- });
- const is_stage_self = parseInt($('input[name="is_stage_self"]:checked').val());
- if (is_stage_self && stage_id.length > 12) {
- toastr.error('独立调差下最多选择12个计量期');
- $(this).removeAttr('disabled').text('确认添加');
- return false;
- }
- const newMaterialData = {
- s_order: $('#s_order').val(),
- period: $('#add-qi input[name="period"]').val(),
- stage_id,
- is_stage_self,
- qty_source: parseInt($('#add-qi input[name="qty_source"]:checked').val()),
- };
- if (lastMaterialListNum === 0) {
- console.log(newMaterialData);
- postData(preUrl + '/measure/material/add', newMaterialData, function (result) {
- window.location.href = preUrl + '/measure/material/' + result.order;
- }, function () {
- _self.attr('disabled', false).text('确认添加');
- });
- return;
- }
- $('#add-qi').modal('hide');
- $('#okedit').modal('show');
- interval = setInterval(progress, 50);
- 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();
- });
- let value = 0;
- function progress(){
- if (stop) {
- setTimeout(function () {
- $('#add-qi').modal('show');
- $('#okedit').modal('hide');
- value = 0;
- clearInterval(interval);
- }, 500);
- }
- if (value < 100) {
- value = parseInt(value) + 1;
- $("#material-progress").css("width", value + "%").text(value + "%");
- } else if (value === 100) {
- value = parseInt(value) + 1;
- value = 30;
- }
- };
- let editPeriod = null;
- $('.edit-material').on('click', function () {
- const order = parseInt($(this).data('order'));
- const mid = parseInt($(this).data('mid'));
- $('#edit-period').val('');
- $('#edit-name').val('第 ' + order + ' 期');
- $('#edit-mid').val(mid);
- const m_period = $(this).data('period');
- const period = [];
- for (const p of m_period.split('~')) {
- if (p && p !== '') {
- period.push(new Date(p));
- }
- }
- $('#edit-period').val(m_period);
- editPeriod = !editPeriod ? $('#edit-period').datepicker().data('datepicker') : editPeriod;
- editPeriod.clear();
- if (period.length > 0) {
- editPeriod.selectDate(period);
- }
- });
- $('#row-view').on('show.bs.modal', function () {
- let html = '';
- for (const col of materialColShow) {
- html += `<tr><td>${col.name}</td><td><input type="checkbox" value="${col.value}" ${col.checked ? 'checked=""' : ''}></td></tr>`;
- }
- $('#material_col_table').html(html);
- });
- $('#set_material_list_show_btn').on('click', function () {
- // 至少展示一个
- const material_col_data = [];
- $('#material_col_table input').each(function () {
- material_col_data.push({
- name: $(this).parents('tr').children('td').eq(0).text(),
- value: $(this).val(),
- checked: $(this).is(':checked'),
- });
- });
- postData('/tender/' + tenderId + '/measure/material/save/data', { type: 'material_col_set', material_col_data }, function (result) {
- window.location.reload();
- });
- });
- });
- function checkForm () {
- if ($('#edit-period').val() == '') {
- toastr.error('请选择调差周期');
- return false;
- }
- // const date = $('#edit-date').val();
- // const period = $('#edit-period').val();
- // const startDate = period.split('~')[0];
- // const endDate = period.split('~')[1];
- // if (startDate.indexOf(date) === -1 && endDate.indexOf(date) === -1) {
- // toastr.error('所选日期与当前月份不匹配,请重新选择');
- // $('#edit-period').parents('.form-group').find('.text-danger').remove();
- // $('#edit-period').parents('.form-group').append('<small class="text-danger">所选日期与当前月份不匹配,请重新选择</small>');
- // return false;
- // }
- };
|