|
|
@@ -293,6 +293,7 @@ let coeOprObj = {
|
|
|
}
|
|
|
else {
|
|
|
updateObj[dataCode] = inputT;
|
|
|
+ me.setOptionList(dataCode,inputT,updateObj);
|
|
|
updateArr.push(updateObj);
|
|
|
me.save([], updateArr, [], true);
|
|
|
}
|
|
|
@@ -323,6 +324,7 @@ let coeOprObj = {
|
|
|
else{
|
|
|
newCoe.serialNo = ++me.currentMaxNo;
|
|
|
newCoe[dataCode] = inputT;
|
|
|
+ me.setOptionList(dataCode,inputT,newCoe);
|
|
|
addArr.push(newCoe);
|
|
|
me.save(addArr, [], [], true, function (result) {
|
|
|
me.updateCurrentCoeList(result);
|
|
|
@@ -331,6 +333,18 @@ let coeOprObj = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ setOptionList:function (dataCode,inputT,obj) {
|
|
|
+ if(dataCode == "option_codes"){//所选人材的情况,要获取人材机下拉列表
|
|
|
+ inputT = inputT.replace(/[\s\r\n]/g, "")//去掉空格换行等字符
|
|
|
+ let optionList = [];
|
|
|
+ let options = inputT.split("|");
|
|
|
+ for(let code of options){
|
|
|
+ let name = gljAdjOprObj.getGljName(code,gljAdjOprObj.gljList,true);
|
|
|
+ if(name) optionList.push({text:name,value:code});
|
|
|
+ }
|
|
|
+ obj.option_list = optionList;
|
|
|
+ }
|
|
|
+ },
|
|
|
onClipboardPasting: function (sender, info) {
|
|
|
let me = coeOprObj, maxCol = info.cellRange.col + info.cellRange.colCount - 1;
|
|
|
if(maxCol > me.setting.header.length){
|
|
|
@@ -798,11 +812,11 @@ let gljAdjOprObj = {
|
|
|
workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
|
|
|
workBook.commandManager().setShortcutKey('gljAdjDel', GC.Spread.Commands.Key.del, false, false, false, false);
|
|
|
},
|
|
|
- getGljName: function (gljCode, gljList) {
|
|
|
+ getGljName: function (gljCode, gljList,withSpecs) {//withSpecs 是否带上规格型号
|
|
|
let rst = null;
|
|
|
for(let i = 0, len = gljList.length; i < len; i++){
|
|
|
if(gljCode === gljList[i].code){
|
|
|
- rst = gljList[i].name;
|
|
|
+ rst = withSpecs == true ?gljList[i].name +" - "+gljList[i].specs :gljList[i].name;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -817,7 +831,7 @@ let gljAdjOprObj = {
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: '/stdGljRepository/api/getGljItemsOccupied',
|
|
|
- data: {repId: pageObj.gljLibID, occupation: '-_id code name'},
|
|
|
+ data: {repId: pageObj.gljLibID, occupation: '-_id code name specs'},
|
|
|
dataType: 'json',
|
|
|
timeout: 5000,
|
|
|
success:function(result){
|