|
@@ -440,7 +440,7 @@ let repositoryGljObj = {
|
|
|
me.rationLibs = result.data[0].rationLibs;
|
|
|
$(".navbar-text").append(
|
|
|
"<a href='/stdGljRepository/main'>人材机库</a><i class='fa fa-angle-right fa-fw'></i>" +
|
|
|
- result.data[0].dispName
|
|
|
+ result.data[0].dispName
|
|
|
);
|
|
|
pageOprObj.gljLibName = result.data[0].dispName;
|
|
|
}
|
|
@@ -1230,7 +1230,7 @@ let repositoryGljObj = {
|
|
|
let distTypeVal =
|
|
|
me.distTypeTree.distTypes[
|
|
|
me.distTypeTree.prefix +
|
|
|
- me.currentEditingGlj[me.setting.header[args.col].dataCode]
|
|
|
+ me.currentEditingGlj[me.setting.header[args.col].dataCode]
|
|
|
].data.fullName;
|
|
|
args.sheet.setValue(args.row, args.col, distTypeVal);
|
|
|
} else {
|
|
@@ -1477,6 +1477,33 @@ let repositoryGljObj = {
|
|
|
false
|
|
|
);
|
|
|
},
|
|
|
+ editCode: async function () {
|
|
|
+ const sheet = this.workBook.getSheet(0);
|
|
|
+ const row = sheet.getActiveRowIndex();
|
|
|
+ const glj = this.currentCache[row];
|
|
|
+ if (!glj) {
|
|
|
+ alert('请选中工料机!');
|
|
|
+ $('#edit-code').modal('hide');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const newCode = $('#edit-code-text').val();
|
|
|
+ if (!newCode) {
|
|
|
+ alert('编号不可为空!');
|
|
|
+ $('#edit-code-text').focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.gljList.some(item => item.ID !== glj.ID && item.code === newCode)) {
|
|
|
+ alert('编号已存在!');
|
|
|
+ $('#edit-code-text').focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (newCode === glj.code) {
|
|
|
+ $('#edit-code').modal('hide');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.mixUpdateRequest([{ ...glj, code: newCode }], [], []);
|
|
|
+ $('#edit-code').modal('hide');
|
|
|
+ },
|
|
|
onContextmenuOpr: function () {
|
|
|
let me = repositoryGljObj;
|
|
|
$.contextMenu({
|
|
@@ -1511,8 +1538,23 @@ let repositoryGljObj = {
|
|
|
sheet.setActiveCell(target.row, target.col);
|
|
|
}
|
|
|
return {
|
|
|
- callback: function () {},
|
|
|
+ callback: function () { },
|
|
|
items: {
|
|
|
+ edit: {
|
|
|
+ name: "修改编号",
|
|
|
+ disabled: function () {
|
|
|
+ return (
|
|
|
+ locked || !(me.currentCache && me.currentCache[target.row])
|
|
|
+ );
|
|
|
+ },
|
|
|
+ icon: "fa-edit",
|
|
|
+ callback: function (key, opt) {
|
|
|
+ if (me.currentCache[target.row]) {
|
|
|
+ $('#edit-code').modal('show');
|
|
|
+ $('#edit-code-text').val(me.currentCache[target.row].code || '');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
delete: {
|
|
|
name: "删除",
|
|
|
disabled: function () {
|
|
@@ -1944,8 +1986,8 @@ let repositoryGljObj = {
|
|
|
if (!priceProperties || priceProperties.length === 0) {
|
|
|
pasteObj.basePrice =
|
|
|
!isNaN(parseFloat(pasteObj.basePrice)) &&
|
|
|
- pasteObj.basePrice &&
|
|
|
- typeof pasteObj.basePrice !== "undefined"
|
|
|
+ pasteObj.basePrice &&
|
|
|
+ typeof pasteObj.basePrice !== "undefined"
|
|
|
? parseFloat(pasteObj.basePrice)
|
|
|
: 0;
|
|
|
} else {
|
|
@@ -2069,7 +2111,7 @@ let repositoryGljObj = {
|
|
|
info.cellRange.colCount >= 5 &&
|
|
|
info.cellRange.colCount <= me.setting.header.length &&
|
|
|
info.cellRange.col + info.cellRange.colCount - 1 >=
|
|
|
- me.colMapping.fieldToCol["gljType"]
|
|
|
+ me.colMapping.fieldToCol["gljType"]
|
|
|
) {
|
|
|
for (let i = 0; i < items.length; i++) {
|
|
|
if (me.isValidObj(items[i])) {
|
|
@@ -2486,7 +2528,7 @@ let gljTypeTreeOprObj = {
|
|
|
pNode.isParent = false;
|
|
|
}
|
|
|
},
|
|
|
- error: function () {},
|
|
|
+ error: function () { },
|
|
|
});
|
|
|
return true;
|
|
|
},
|
|
@@ -2524,7 +2566,7 @@ let gljTypeTreeOprObj = {
|
|
|
success: function (result, textStatus, status) {
|
|
|
console.log(status + " : " + result);
|
|
|
},
|
|
|
- error: function () {},
|
|
|
+ error: function () { },
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -2595,10 +2637,10 @@ let gljTypeTreeOprObj = {
|
|
|
btn.bind("click", function () {
|
|
|
treeNode.doing = true;
|
|
|
let rawNode = {
|
|
|
- ParentID: treeNode.ID,
|
|
|
- NextSiblingID: -1,
|
|
|
- Name: "新增子节点",
|
|
|
- },
|
|
|
+ ParentID: treeNode.ID,
|
|
|
+ NextSiblingID: -1,
|
|
|
+ Name: "新增子节点",
|
|
|
+ },
|
|
|
lastNodeId = -1;
|
|
|
if (treeNode.items.length > 0) {
|
|
|
lastNodeId = treeNode.items[treeNode.items.length - 1].ID;
|
|
@@ -2725,7 +2767,7 @@ $(document).ready(function () {
|
|
|
},
|
|
|
function () {
|
|
|
let resizeRate =
|
|
|
- (SlideResize.resizeWidth * 100) / $("#midContent").width(),
|
|
|
+ (SlideResize.resizeWidth * 100) / $("#midContent").width(),
|
|
|
sheetRate = 100 - resizeRate;
|
|
|
$("#slideResizeLeft").css("width", `${resizeRate}%`);
|
|
|
$("#GLJListSheet").css("width", `${sheetRate}%`);
|
|
@@ -2751,4 +2793,13 @@ $(document).ready(function () {
|
|
|
repositoryGljObj.mixUpdateRequest(updateArr, [], []);
|
|
|
$("#moveTo").modal("hide");
|
|
|
});
|
|
|
+
|
|
|
+ // 修改编号弹窗
|
|
|
+ $('#edit-code').on('shown.bs.modal', function () {
|
|
|
+ $('#edit-code-text').focus();
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#edit-code-confirm').click(async () => {
|
|
|
+ await repositoryGljObj.editCode();
|
|
|
+ });
|
|
|
});
|