V1 2023.01.31
/**
* textField onChange
* @param value 当前值
*/
export function onChangePartNumber({ value }) {
// setTimeout("console.log('111test222')", 2000);
//setTimeout("function aa35(){console.log('setTimeout test!');myFun();}", 2000);
// setTimeout(myFun,2000)
// myFun();
// }
// function myFun() {
// console.log('onChange', value);
// value = this.$('textField_lco7nipr').getValue();
//value2 = this.$('textField_lcogesr2').getValue();
// console.log("value2" + value2);
// var scbm = this.$('textField_lcogesr2').getValue();
var scbm = this.$('textField_lcogesr2').getValue();
console.log("scbm: " + scbm);
var nYear = scbm.substr(5, 2);
var nNumber = scbm.substr(7, 4);
console.log("year: " + nYear);
console.log("number: " + nNumber);
// 获取当前年份
var dTemp = new Date();
var dCurrent = dTemp.getFullYear();
var dC2 = new String(dCurrent);
dC2 = dC2.substr(2, 2);
// 取年份后两位与nYear作比较。相等则nNumber+1,否则Nnumber等于1
console.log("nYear: " + nYear);
console.log("dC2: " + dC2);
if (nYear === dC2) {
nNumber = nNumber * 1 + 1;
}
else {
nNumber = 1;
}
console.log("nNumber " + nNumber);
var sqsl = this.$('numberField_lco7nipy').getValue();
console.log("sqsl: " + sqsl);
var arr = [];
this.$("tableField_lcol37bs").setValue(arr);
for (var i = 0; i < sqsl; i++) {
var sNum = "0000" + (nNumber * 1 + i);
console.log("sNum: " + sNum);
sNum = sNum.substr(sNum.length - 4, 4);
console.log("sNum: " + sNum);
// var jsbm = alert(i);
arr.push({
"textField_lcol9u4i": sNum
});
}
this.$("tableField_lcol37bs").setValue();
this.$("tableField_lcol37bs").setValue(arr);
// this.$('textField_lco7niqo').setValue(arr[sqsl-1]);
this.$('textField_lco7niqo').setValue(nNumber * 1 + sqsl - 1);
}
/**
* textField onChange
* @param value 当前值
export function onChangeinsertlist({ value }) {
// 获取控件【编码申请数量】的值,作为循环的结束节点
// 循环【本次开始后四位】+1,得到每一行的后四位bmhsw
// let arr = [];
// var sqsl = this.$('numberField_lco7nipy').getValue();
// var kshsw = this.$('textField_lcoiqysl').getValue();
// for (var i = 0; i < sqsl; i++)
// arr.push({
// "textField_lcol9u4i": "0000"+(kshsw*1+i)
// })
// this.$("tableField_lcol37bs").setValue(arr);
// var a7788b3322 = this.$("tableField_lcol37bs").getValue();
}*/