|
@@ -199,7 +199,7 @@ $(document).ready(() => {
|
|
|
{title: '变更令号', field: 'code', width: 100, formatter: '@', readOnly: true, hAlign: 0, },
|
|
|
{title: '名称', field: 'name', width: 120, formatter: '@', readOnly: true, hAlign: 0,},
|
|
|
{title: '总数量', field: 'b_amount', width: 60, formatter: '@', readOnly: true, hAlign: 2, },
|
|
|
- {title: '可变更数量', field: 'vamount', width: 60, readOnly: true, hAlign: 2, },
|
|
|
+ {title: '可变更数量', field: 'vamount', width: 60, readOnly: true, hAlign: 2, getValue: function (data) {return data.vamount ? data.vamount + '' : '0';}},
|
|
|
{title: '本期计量', field: 'uamount', width: 60, formatter: '@', hAlign: 2, type: 'Number', },
|
|
|
],
|
|
|
emptyRows: 0,
|
|
@@ -208,7 +208,7 @@ $(document).ready(() => {
|
|
|
getColor: function (data, col, defaultColor) {
|
|
|
if (col.field === 'uamount') {
|
|
|
if (!data.vamount) {
|
|
|
- return data.uamount ? '#ff6f5c' : defaultColor;
|
|
|
+ return (data.uamount && data.uamount > 0) ? '#ff6f5c' : defaultColor;
|
|
|
} else if (data.uamount) {
|
|
|
return data.uamount > data.vamount ? '#ff6f5c' : defaultColor;
|
|
|
} else {
|
|
@@ -303,15 +303,20 @@ $(document).ready(() => {
|
|
|
const data = { target: self.callData, change: [] };
|
|
|
for (const c of self.displayChanges) {
|
|
|
if (c.uamount) {
|
|
|
- if (!c.vamount || checkZero(c.vamount)) {
|
|
|
- toast('变更令:' + c.code + ' 当前不可使用', 'error');
|
|
|
+ const vamount = (!c.vamount || checkZero(c.vamount)) ? 0 : c.vamount;
|
|
|
+ if (c.uamount > vamount) {
|
|
|
+ toast('变更令:' + c.code + ' 超计,请修改本期计量后,再提交', 'error');
|
|
|
return;
|
|
|
- } else {
|
|
|
- if (c.uamount > c.vamount) {
|
|
|
- toast('变更令:' + c.code + ' 超计,请修改本期计量后,再提交', 'error');
|
|
|
- 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 });
|
|
|
}
|
|
|
}
|
|
@@ -345,7 +350,7 @@ $(document).ready(() => {
|
|
|
if (change.cid === this.curChangeId) { return; }
|
|
|
|
|
|
this.curChangeId = change.cid;
|
|
|
- const inputs = $('input[type!=checkbox]', this.obj);
|
|
|
+ const inputs = $('input[type!=checkbox][type!=radio]', this.obj);
|
|
|
for (const i of inputs) {
|
|
|
const field = $(i).attr('name');
|
|
|
const text = (field && change[field]) ? change[field] : '';
|
|
@@ -355,7 +360,7 @@ $(document).ready(() => {
|
|
|
for (const ta of textareas) {
|
|
|
const field = $(ta).attr('name');
|
|
|
const text = (field && change[field]) ? change[field] : '';
|
|
|
- ta.innerText = text;
|
|
|
+ ta.textContent = text;
|
|
|
}
|
|
|
const html = [];
|
|
|
for (const a of change.attachments) {
|