|
@@ -124,24 +124,6 @@ function getNodeList(node) {
|
|
|
}
|
|
|
|
|
|
$(document).ready(() => {
|
|
|
- // 提示窗
|
|
|
- toastr.options = {
|
|
|
- "closeButton": false,
|
|
|
- "debug": false,
|
|
|
- "newestOnTop": false,
|
|
|
- "progressBar": false,
|
|
|
- "positionClass": "toast-top-center",
|
|
|
- "preventDuplicates": false,
|
|
|
- "onclick": null,
|
|
|
- "showDuration": "300",
|
|
|
- "hideDuration": "1000",
|
|
|
- "timeOut": "5000",
|
|
|
- "extendedTimeOut": "1000",
|
|
|
- "showEasing": "swing",
|
|
|
- "hideEasing": "linear",
|
|
|
- "showMethod": "fadeIn",
|
|
|
- "hideMethod": "fadeOut"
|
|
|
- };
|
|
|
// 界面布局
|
|
|
autoFlashHeight();
|
|
|
// 初始化 台账树结构 数据结构
|
|
@@ -315,18 +297,9 @@ $(document).ready(() => {
|
|
|
if (c.uamount) {
|
|
|
const vamount = (!c.vamount || checkZero(c.vamount)) ? 0 : c.vamount;
|
|
|
if (c.uamount > vamount) {
|
|
|
- toast('变更令:' + c.code + ' 超计,请修改本期计量后,再提交', 'error');
|
|
|
+ toastr.error('变更令:' + c.code + ' 超计,请修改本期计量后,再提交');
|
|
|
return;
|
|
|
}
|
|
|
- // if (!c.vamount || checkZero(c.vamount)) {
|
|
|
- // toast('变更令:' + c.code + ' 当前不可使用', 'error');
|
|
|
- // return;
|
|
|
- // } else {
|
|
|
- // if (c.uamount > c.vamount) {
|
|
|
- // toast('变更令:' + c.code + ' 超计,请修改本期计量后,再提交', 'error');
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // }
|
|
|
data.change.push({ cid: c.cid, cbid: c.cbid, qty: c.uamount });
|
|
|
}
|
|
|
}
|
|
@@ -413,11 +386,10 @@ $(document).ready(() => {
|
|
|
const sheet = this.spread.getActiveSheet();
|
|
|
if (this.changes) {
|
|
|
sheet.setSelection(0, 0, 1, 1);
|
|
|
- //SpreadJsObj.loadSheetData(sheet, SpreadJsObj.DataType.Data, this.changes);
|
|
|
this._filterChange(!$('#filterEmpty')[0].checked, $('#matchPos')[0].checked);
|
|
|
this._loadChangeDetail(this.changes[0]);
|
|
|
} else {
|
|
|
- toast('查询变更令有误,请刷新页面后重试', 'warning');
|
|
|
+ toastr.error('查询变更令有误,请刷新页面后重试');
|
|
|
}
|
|
|
}
|
|
|
_filterChange(filterEmpty, matchPosName) {
|
|
@@ -428,10 +400,8 @@ $(document).ready(() => {
|
|
|
if ((filterVisible && matchVisible) || (c.org_uamount)) {
|
|
|
this.displayChanges.push(c);
|
|
|
}
|
|
|
- //c.visible = filterVisible && matchVisible;
|
|
|
}
|
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), SpreadJsObj.DataType.Data, this.displayChanges);
|
|
|
- //SpreadJsObj.refreshTreeRowVisible(this.spread.getActiveSheet());
|
|
|
}
|
|
|
loadChanges(data) {
|
|
|
this.callData = data;
|
|
@@ -527,19 +497,19 @@ $(document).ready(() => {
|
|
|
}
|
|
|
if (col.field.indexOf('_dgn_') > 0) {
|
|
|
if (node.b_code && node.b_code !== '') {
|
|
|
- toast('仅项目节可输入设计数量');
|
|
|
+ toastr.error('仅项目节可输入设计数量');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
}
|
|
|
} else if (col.field !== 'postil') {
|
|
|
if (node.children && node.children.length > 0) {
|
|
|
- toast('清单父项不可计量', 'error');
|
|
|
+ toastr.error('清单父项不可计量');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
} else {
|
|
|
const nodePos = stagePos.getLedgerPos(node.id);
|
|
|
if (nodePos && nodePos.length > 0) {
|
|
|
- toast('该清单有部位明细,请在部位明细处计量', 'error');
|
|
|
+ toastr.error('该清单有部位明细,请在部位明细处计量');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
}
|
|
@@ -638,7 +608,7 @@ $(document).ready(() => {
|
|
|
for (let iCol = range.col; iCol < range.col + range.colCount; iCol++) {
|
|
|
const col = info.sheet.zh_setting.cols[iCol];
|
|
|
if ((stageField.indexOf(col.field) === -1) && setting.dgnUpFields.indexOf(col.field) === -1) {
|
|
|
- toast('不可修改此数据', 'error');
|
|
|
+ toastr.error('不可修改此数据');
|
|
|
info.cancel = true;
|
|
|
return;
|
|
|
}
|
|
@@ -892,7 +862,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
// 台账模式下,不可新增
|
|
|
if (checkTzMeasureType() && !posData) {
|
|
|
- toast('台账模式不可新增部位明细数据', 'error');
|
|
|
+ toastr.error('台账模式不可新增部位明细数据');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return ;
|
|
|
}
|
|
@@ -900,15 +870,15 @@ $(document).ready(() => {
|
|
|
//const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
const node = stagePosSpreadObj.stageTreeNode;
|
|
|
if (!node) {
|
|
|
- toast('数据错误, 请刷新页面后再试', 'warning');
|
|
|
+ toastr.warning('数据错误, 请刷新页面后再试');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
} else if (info.editingText !== '' && node.children && node.children > 0) {
|
|
|
- toast('父节点不可插入部位明细', 'error');
|
|
|
+ toastr.error('父节点不可插入部位明细');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
} else if (info.editingText !== '' && !node.b_code || node.b_code === '') {
|
|
|
- toast('项目节不可插入部位明细', 'error');
|
|
|
+ toastr.error('项目节不可插入部位明细');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
}
|
|
@@ -916,7 +886,7 @@ $(document).ready(() => {
|
|
|
const data = {};
|
|
|
if (col.field === 'name') {
|
|
|
if ((!info.editingText || info.editingText === '') && posData) {
|
|
|
- toast('部位名称不可为空', 'error', 'exclamation-circle');
|
|
|
+ toastr.error('部位名称不可为空');
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
} else if (!posData) {
|
|
@@ -933,7 +903,7 @@ $(document).ready(() => {
|
|
|
data.updateData = {pid: posData.id, lid: posData.lid, name: info.editingText};
|
|
|
}
|
|
|
} else if (!posData) {
|
|
|
- toast('新增部位请先输入名称', 'warning');
|
|
|
+ toastr.warning('新增部位请先输入名称');
|
|
|
} else {
|
|
|
data.updateType = 'update';
|
|
|
data.updateData = {pid: posData.id, lid: posData.lid};
|
|
@@ -969,14 +939,14 @@ $(document).ready(() => {
|
|
|
const col = info.sheet.zh_setting.cols[iCol];
|
|
|
if (validField.indexOf(col.field) === -1) {
|
|
|
if (checkTzMeasureType()) {
|
|
|
- toast('不可修改此数据', 'error');
|
|
|
+ toastr.error('不可修改此数据');
|
|
|
info.cancel = true;
|
|
|
return;
|
|
|
} else {
|
|
|
for (let iRow = range.row; iRow < range.row + range.rowCount; iRow) {
|
|
|
const pos = sortData(iRow);
|
|
|
if (pos.add_stage !== stage.id || pos.add_times !== stage.times) {
|
|
|
- toast('不可修改此数据', 'error');
|
|
|
+ toastr.error('不可修改此数据');
|
|
|
info.cancel = true;
|
|
|
return;
|
|
|
}
|
|
@@ -995,7 +965,7 @@ $(document).ready(() => {
|
|
|
if (sortData && (info.cellRange.row >= sortData.length)) {
|
|
|
data.updateType = 'add';
|
|
|
if (info.cellRange.col !== 0) {
|
|
|
- toast('新增部位请先输入名称', 'warning');
|
|
|
+ toastr.warning('新增部位请先输入名称');
|
|
|
self.loadCurPosData();
|
|
|
return;
|
|
|
}
|
|
@@ -1068,7 +1038,7 @@ $(document).ready(() => {
|
|
|
for (const iCol of validCols) {
|
|
|
const colSetting = sheet.zh_setting.cols[iCol];
|
|
|
if (colSetting.field === 'name') {
|
|
|
- toast('部位名称不能为空', 'error');
|
|
|
+ toastr.error('部位名称不能为空');
|
|
|
return;
|
|
|
}
|
|
|
data[colSetting.field] = null;
|
|
@@ -1595,17 +1565,17 @@ $(document).ready(() => {
|
|
|
formData.append('lid', node.id);
|
|
|
for (const file of files) {
|
|
|
if (file === undefined) {
|
|
|
- toast('未选择上传文件!', 'error');
|
|
|
+ toastr.error('未选择上传文件!');
|
|
|
return false;
|
|
|
}
|
|
|
const filesize = file.size;
|
|
|
if (filesize > 10 * 1024 * 1024) {
|
|
|
- toast('存在上传文件大小过大!', 'error');
|
|
|
+ toastr.error('存在上传文件大小过大!');
|
|
|
return false;
|
|
|
}
|
|
|
const fileext = '.' + file.name.toLowerCase().split('.').splice(-1)[0];
|
|
|
if (whiteList.indexOf(fileext) === -1) {
|
|
|
- toast('只能上传指定格式的附件!', 'error');
|
|
|
+ toastr.error('只能上传指定格式的附件!');
|
|
|
return false;
|
|
|
}
|
|
|
formData.append('size', filesize);
|
|
@@ -1619,7 +1589,7 @@ $(document).ready(() => {
|
|
|
getAllList();
|
|
|
getNodeList(node.id);
|
|
|
}, function () {
|
|
|
- toast('附件上传失败', 'error');
|
|
|
+ toastr.error('附件上传失败');
|
|
|
});
|
|
|
$('#upload-file').val('');
|
|
|
});
|
|
@@ -1661,7 +1631,7 @@ $(document).ready(() => {
|
|
|
} else {
|
|
|
$('#showAttachment').hide();
|
|
|
$('#showAttachment').attr('file-id', '');
|
|
|
- toast('附件信息获取失败', 'error');
|
|
|
+ toastr.error('附件信息获取失败');
|
|
|
}
|
|
|
});
|
|
|
$('body').on('click', '#btn-att a', function () {
|
|
@@ -1726,7 +1696,7 @@ $(document).ready(() => {
|
|
|
$('#btn-att a').eq(2).hide();
|
|
|
$('#btn-att a').eq(3).hide();
|
|
|
}, function () {
|
|
|
- toast('附件上传失败', 'error');
|
|
|
+ toastr.error('附件上传失败');
|
|
|
});
|
|
|
$('#change-att-btn').val('');
|
|
|
} else if (content === 'del') {
|
|
@@ -1754,12 +1724,12 @@ $(document).ready(() => {
|
|
|
const fileext = name.substr(name.indexOf("."));
|
|
|
const filesize = file.size;
|
|
|
if (filesize > 10 * 1024 * 1024) {
|
|
|
- toast('文件大小过大!', 'error');
|
|
|
+ toastr.error('文件大小过大!');
|
|
|
$('#change-att-btn').val('');
|
|
|
return false;
|
|
|
}
|
|
|
if (whiteList.indexOf(fileext) === -1) {
|
|
|
- toast('只能上传指定格式的附件!', 'error');
|
|
|
+ toastr.error('只能上传指定格式的附件!');
|
|
|
$('#change-att-btn').val('');
|
|
|
return false;
|
|
|
}
|