|
|
@@ -1695,15 +1695,6 @@ $(document).ready(function() {
|
|
|
data[c] = $('#htdetail_' + c + ' input').val();
|
|
|
}
|
|
|
}
|
|
|
- const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : {};
|
|
|
- for (const attr of attributeSet) {
|
|
|
- if (attr.type === 'long_text') {
|
|
|
- attrInfo[attr.field] = $('#htdetail_' + attr.field + ' textarea').val();
|
|
|
- continue;
|
|
|
- }
|
|
|
- attrInfo[attr.field] = $('#htdetail_' + attr.field + ' input').val();
|
|
|
- }
|
|
|
- data.attribute_json = JSON.stringify(attrInfo);
|
|
|
if (data.c_code === '' || data.name === '') {
|
|
|
toastr.warning('合同编号和合同名称不能为空');
|
|
|
return;
|
|
|
@@ -1729,6 +1720,34 @@ $(document).ready(function() {
|
|
|
toastr.warning('合同金额不能小于累计应' + name);
|
|
|
return;
|
|
|
}
|
|
|
+ const attrInfo = node.attribute_json ? JSON.parse(node.attribute_json) : {};
|
|
|
+ for (const attr of attributeSet) {
|
|
|
+ if (attr.type === 'long_text') {
|
|
|
+ attrInfo[attr.field] = $('#htdetail_' + attr.field + ' textarea').val();
|
|
|
+ // 判断长度超过1000字提示
|
|
|
+ if (attrInfo[attr.field] && attrInfo[attr.field].length > 1000) {
|
|
|
+ toastr.warning((attr.alias || attr.name) + '内容不能超过1000字');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ } else if (attr.type === 'number') {
|
|
|
+ attrInfo[attr.field] = $('#htdetail_' + attr.field + ' input').val();
|
|
|
+ if (!/^\d+(\.\d+)?$/.test(attrInfo[attr.field])) {
|
|
|
+ toastr.warning((attr.alias || attr.name) + '只能输入数字');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ } else if (attr.type === 'text') {
|
|
|
+ attrInfo[attr.field] = $('#htdetail_' + attr.field + ' input').val();
|
|
|
+ if (attrInfo[attr.field] && attrInfo[attr.field].length > 255) {
|
|
|
+ toastr.warning((attr.alias || attr.name) + '内容不能超过255字');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ attrInfo[attr.field] = $('#htdetail_' + attr.field + ' input').val();
|
|
|
+ }
|
|
|
+ data.attribute_json = JSON.stringify(attrInfo);
|
|
|
// if (data.party_b === '') {
|
|
|
// toastr.warning('签订单位(乙方)不能为空');
|
|
|
// return;
|