Browse Source

feat:[模板管理][sp021]

ouqian
luojie 1 month ago
parent
commit
8befa8a505
4 changed files with 177 additions and 199 deletions
  1. +66
    -84
      src/components/Template/BaseInfoFormPackage.vue
  2. +94
    -100
      src/components/Template/DecimalInput.vue
  3. +11
    -11
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  4. +6
    -4
      src/views/business/comps/template/formConfig/gsp/gsp015.js

+ 66
- 84
src/components/Template/BaseInfoFormPackage.vue View File

@ -104,10 +104,10 @@
<span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span> <span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span>
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button" <HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]" :item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.subKey)" />
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" />
<HandleFormItem class="ml-10" v-else-if="sItem.thirdType === 'button'" type="button" <HandleFormItem class="ml-10" v-else-if="sItem.thirdType === 'button'" type="button"
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]" :item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.thirdKey)" />
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.thirdKey)" />
</div> </div>
<div v-else-if="sItem.type === 'clickable'" class="flex1"> <div v-else-if="sItem.type === 'clickable'" class="flex1">
@ -212,49 +212,52 @@
<div v-else-if="sItem.type === 'input' || sItem.type === 'inputNumber'" class="flex flex1"> <div v-else-if="sItem.type === 'input' || sItem.type === 'inputNumber'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" @blur="onBlur(key, $event)" class="flex1" :item="sItem" :type="sItem.type" @blur="onBlur(key, $event)" class="flex1" :item="sItem"
v-model="formFields[key]" @copy="onCopy(sItem, key)" :error="errors[key]"
v-model="formFields[key]" @copy="onCopy(sItem, key)" :error="errors[key]" :ref="key"
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> @update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(sItem.subKey, e, type)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'input'" type="input" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)"
@update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div>
<span v-else-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span>
<div v-else-if="sItem.subType === 'button'">
<HandleFormItem class="ml-10" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.subKey)" />
</div>
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'" type="clickable"
@clickable="handleClickable(sItem, sItem.subKey)" :item="getClickableItem(sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="isRegent(sItem, 'subType')" :type="sItem.subType"
:item="getRegentItem(sItem, 'subType')" sourceFrom="baseInfoFormPackage"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" />
<div>
<template v-if="isShowSub(sItem)">
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(sItem.subKey, e, type)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'input'" type="input" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)"
:ref="sItem.subKey" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div>
<span v-else-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText)
}}</span>
<div v-else-if="sItem.subType === 'button'">
<HandleFormItem class="ml-10" type="button" :item="getButtonItem(sItem)"
:value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" />
</div>
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'" type="clickable"
@clickable="handleClickable(sItem, sItem.subKey)" :item="getClickableItem(sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="isRegent(sItem, 'subType')" :type="sItem.subType"
:item="getRegentItem(sItem, 'subType')" sourceFrom="baseInfoFormPackage"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:value="formFields[sItem.subKey]" />
</template>
<div v-if="isShowSub(sItem,'thirdType')">
<HandleFormItem class="ml-10" v-if="sItem.thirdType === 'button'" type="button" <HandleFormItem class="ml-10" v-if="sItem.thirdType === 'button'" type="button"
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.thirdKey)" />
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.thirdKey)" />
</div> </div>
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1 ml-10"> <div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1 ml-10">
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? <div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ?
@ -269,44 +272,9 @@
:orange-bg="orangeBgFields[sItem.otherCode]" /> :orange-bg="orangeBgFields[sItem.otherCode]" />
</div> </div>
</div> </div>
<!-- <div class="clickable" :class="getFillType(sItem.subFillType)" v-else-if = "sItem.subType ==='clickable'" @click="handleClickable(sItem,$event)">
<span v-if="formFields[sItem.subKey]">{{ formFields[sItem.subKey] }}</span>
<span v-else class="default-placeholder-text">请选择</span>
</div> -->
</div> </div>
<!-- <div v-else-if="sItem.type === 'inputNumber'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="inputNumber" @blur="onBlur(key, $event)" class="flex1" :item="sItem"
@input="onInputNumberChange(key, $event)" :value="formFields[key]"
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)"
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)"
@change="(e, type) => onSelectChange(sItem.subKey, e, type)"
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false"
:orange-bg="orangeBgFields[sItem.subKey]" />
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{
formFields[sItem.subKey] }}</div>
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button"
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="sItem.subType === 'clickable'"
@clickable="handleClickable(sItem, sItem.subKey)" :error="errors[sItem.subKey]"
type="clickable" @update:error="errors[sItem.subKey] = false"
@resetRecord="resetRecord(sItem.subKey)" :item="getClickableItem(sItem)"
:value="formFields[sItem.subKey]" />
<HandleFormItem :field-item-label="fieldItemLabel"
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10"
v-else-if="isRegent(sItem, 'subType')" sourceFrom="baseInfoFormPackage"
:error="errors[sItem.subKey]" :type="sItem.subType"
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)"
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)"
:item="getRegentItem(sItem, 'subType')" :value="formFields[sItem.subKey]" />
</div> -->
<div v-else-if="sItem.type === 'clickable'" class="flex flex1"> <div v-else-if="sItem.type === 'clickable'" class="flex flex1">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" <HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
type="clickable" @clickable="handleClickable(sItem, key)" :error="errors[key]" type="clickable" @clickable="handleClickable(sItem, key)" :error="errors[key]"
@ -337,7 +305,7 @@
:orange-bg="orangeBgFields[sItem.thirdKey]" /> :orange-bg="orangeBgFields[sItem.thirdKey]" />
<HandleFormItem class="ml-10" v-if="sItem.fourthType === 'button'" type="button" <HandleFormItem class="ml-10" v-if="sItem.fourthType === 'button'" type="button"
:item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]" :item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]"
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.fourthKey)" />
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.fourthKey)" />
</div> </div>
</div> </div>
@ -427,6 +395,20 @@ export default {
}; };
}, },
methods: { methods: {
isShowSub(item,type){
if(type === 'thirdType'){
if (item.hasOwnProperty("showThird")) {
return item.showThird
}
return item.thirdType && item.thirdKey;
}
if (item.hasOwnProperty("showSub")) {
return item.showSub
} else if (item.subType === 'text') {//span
return true;
}
return item.subType && item.subKey;
},
remoteMethod(query, sItem, key) { remoteMethod(query, sItem, key) {
this.$emit('remoteMethod', { query, sItem, key, formFields: this.formFields }) this.$emit('remoteMethod', { query, sItem, key, formFields: this.formFields })
}, },
@ -439,11 +421,11 @@ export default {
this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields }) this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields })
}, },
// //
handleClickButton(e, item, val, data,key) {
handleClickButton(e, item, val, data, key) {
if (!item.isClearForm) { if (!item.isClearForm) {
this.formFields[item.subKey] = val;
this.formFields[key] = val;
} }
this.$emit("clickButton", item, data,key,this.formFields)
this.$emit("clickButton", item, data, key, this.formFields)
}, },
// //
getButtonItem(sItem) { getButtonItem(sItem) {

+ 94
- 100
src/components/Template/DecimalInput.vue View File

@ -38,6 +38,7 @@ export default {
internalValue: this.value !== null && this.value !== undefined ? String(this.value) : '', internalValue: this.value !== null && this.value !== undefined ? String(this.value) : '',
oldValue: null, oldValue: null,
oldPattern: null, oldPattern: null,
isNA: this.value !== null && this.value !== undefined ? /^NA$/i.test(String(this.value).toUpperCase()) : false,
patternRules: [ patternRules: [
{ name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i }, { name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i },
{ name: 'FRACTION', pattern: /^\d+(\/\d+)*$/, inputPattern: /^(\d+\/?)*$/ } { name: 'FRACTION', pattern: /^\d+(\/\d+)*$/, inputPattern: /^(\d+\/?)*$/ }
@ -51,9 +52,11 @@ export default {
this.internalValue = ''; this.internalValue = '';
this.oldValue = null; this.oldValue = null;
this.oldPattern = null; this.oldPattern = null;
this.isNA = false;
} else { } else {
const strVal = String(newVal); const strVal = String(newVal);
this.internalValue = strVal; this.internalValue = strVal;
this.isNA = /^NA$/i.test(strVal.toUpperCase());
this.updateOldValue(strVal); this.updateOldValue(strVal);
} }
}, },
@ -84,123 +87,118 @@ export default {
handleInput(val) { handleInput(val) {
if (val === '') { if (val === '') {
this.internalValue = ''; this.internalValue = '';
this.isNA = false;
this.$emit('input', ''); this.$emit('input', '');
return; return;
} }
// NA
if (this.isNA) {
// NANA
this.internalValue = 'NA';
this.$emit('input', 'NA');
return;
}
const upperVal = val.toUpperCase(); const upperVal = val.toUpperCase();
let cleaned = val; let cleaned = val;
let matchedRule = null; let matchedRule = null;
if (this.oldPattern) {
// oldValue
if (val.startsWith(this.oldValue)) {
// inputPattern
if (this.oldPattern.inputPattern.test(val)) {
matchedRule = this.oldPattern;
cleaned = val;
} else {
// FRACTION
if (this.oldPattern.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, '');
const parts = cleaned.split('/');
const validParts = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '') {
validParts.push(parts[i]);
}
}
cleaned = validParts.join('/');
matchedRule = this.oldPattern;
} else {
cleaned = this.oldValue || '';
this.internalValue = cleaned;
return;
}
}
} else if (this.oldPattern.inputPattern.test(val)) {
// inputPattern
matchedRule = this.oldPattern;
cleaned = val;
} else {
//
matchedRule = this.getMatchingRule(val);
if (!matchedRule) {
cleaned = this.oldValue || '';
this.internalValue = cleaned;
return;
}
}
// NAFRACTION
// NA
if (/^NA$/i.test(upperVal)) {
matchedRule = { name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i };
cleaned = upperVal;
this.isNA = true;
} else if (upperVal === 'N' || upperVal === 'A') {
// NA
matchedRule = { name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i };
cleaned = upperVal;
} else { } else {
// FRACTION
matchedRule = this.getMatchingRule(val); matchedRule = this.getMatchingRule(val);
if (matchedRule) {
if (matchedRule.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, '');
const parts = cleaned.split('/');
const validParts = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '') {
validParts.push(parts[i]);
}
}
if (matchedRule) {
if (matchedRule.name === 'FRACTION') {
cleaned = val.replace(/[^\d/]/g, '');
const parts = cleaned.split('/');
const validParts = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '' || i === parts.length - 1) {
validParts.push(parts[i]);
} }
cleaned = validParts.join('/');
} else {
cleaned = upperVal;
} }
cleaned = validParts.join('/');
} else { } else {
cleaned = val
.replace(/[^\d.-]/g, '')
.replace(/^(-)\1+/, '$1');
cleaned = upperVal;
}
} else {
//
cleaned = val
.replace(/[^\d.-]/g, '')
.replace(/^(-)\1+/, '$1');
const firstDotIndex = cleaned.indexOf('.');
if (firstDotIndex !== -1) {
const before = cleaned.slice(0, firstDotIndex);
const after = cleaned.slice(firstDotIndex + 1).replace(/\./g, '');
cleaned = before + '.' + after;
}
//
const firstDotIndex = cleaned.indexOf('.');
if (firstDotIndex !== -1) {
const before = cleaned.slice(0, firstDotIndex);
const after = cleaned.slice(firstDotIndex + 1).replace(/\./g, '');
cleaned = before + '.' + after;
}
if (this.decimalDigits > 0 && cleaned.includes('.')) {
const [intPart, decPart = ''] = cleaned.split('.');
cleaned = intPart + '.' + decPart.slice(0, this.decimalDigits);
} else if (this.decimalDigits === 0) {
cleaned = cleaned.split('.')[0];
}
//
if (this.decimalDigits > 0 && cleaned.includes('.')) {
const [intPart, decPart = ''] = cleaned.split('.');
cleaned = intPart + '.' + decPart.slice(0, this.decimalDigits);
} else if (this.decimalDigits === 0) {
cleaned = cleaned.split('.')[0];
}
if (cleaned === '.') cleaned = '0.';
else if (cleaned === '-.') cleaned = '-0.';
else if (cleaned.startsWith('.')) cleaned = '0' + cleaned;
else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2);
//
if (cleaned === '.') cleaned = '0.';
else if (cleaned === '-.') cleaned = '-0.';
else if (cleaned.startsWith('.')) cleaned = '0' + cleaned;
else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2);
if (cleaned.includes('.')) {
const [int, dec] = cleaned.split('.');
let newInt = int;
if (/^-?0+\d/.test(int)) {
newInt = int.replace(/^-?0+(\d)/, '$1');
} else if (int === '' || int === '-') {
newInt = int + '0';
} else if (int === '00' || /^-00+$/.test(int)) {
newInt = int.startsWith('-') ? '-0' : '0';
}
cleaned = newInt + '.' + dec;
} else {
if (/^-?0+\d/.test(cleaned)) {
cleaned = cleaned.replace(/^-?0+(\d)/, '$1');
} else if (cleaned === '00' || /^-00+$/.test(cleaned)) {
cleaned = cleaned.startsWith('-') ? '-0' : '0';
}
//
if (cleaned.includes('.')) {
const [int, dec] = cleaned.split('.');
let newInt = int;
if (/^-?0+\d/.test(int)) {
newInt = int.replace(/^-?0+(\d)/, '$1');
} else if (int === '' || int === '-') {
newInt = int + '0';
} else if (int === '00' || /^-00+$/.test(int)) {
newInt = int.startsWith('-') ? '-0' : '0';
}
cleaned = newInt + '.' + dec;
} else {
if (/^-?0+\d/.test(cleaned)) {
cleaned = cleaned.replace(/^-?0+(\d)/, '$1');
} else if (cleaned === '00' || /^-00+$/.test(cleaned)) {
cleaned = cleaned.startsWith('-') ? '-0' : '0';
} }
} }
} }
this.internalValue = cleaned; this.internalValue = cleaned;
// emit
if (cleaned === '' || cleaned === '-') { if (cleaned === '' || cleaned === '-') {
this.$emit('input', cleaned === '-' ? '-' : ''); this.$emit('input', cleaned === '-' ? '-' : '');
} else if (matchedRule && matchedRule.name !== 'FRACTION') { } else if (matchedRule && matchedRule.name !== 'FRACTION') {
this.$emit('input', cleaned); this.$emit('input', cleaned);
} else if (cleaned.includes('/')) { } else if (cleaned.includes('/')) {
this.$emit('input', cleaned); this.$emit('input', cleaned);
} else if (cleaned.includes('.')) {
// emit
this.$emit('input', cleaned);
} else if (matchedRule && matchedRule.name === 'FRACTION') {
// FRACTION
this.$emit('input', cleaned);
} else { } else {
//
const num = parseFloat(cleaned); const num = parseFloat(cleaned);
this.$emit('input', isNaN(num) ? '' : num); this.$emit('input', isNaN(num) ? '' : num);
} }
@ -238,6 +236,7 @@ export default {
if (val === '') { if (val === '') {
this.oldValue = null; this.oldValue = null;
this.oldPattern = null; this.oldPattern = null;
this.isNA = false;
this.$emit('input', ''); this.$emit('input', '');
this.$emit('blur', ''); this.$emit('blur', '');
return; return;
@ -245,17 +244,20 @@ export default {
const upperVal = val.toUpperCase(); const upperVal = val.toUpperCase();
//
for (const rule of this.patternRules) { for (const rule of this.patternRules) {
if (rule.pattern.test(upperVal)) { if (rule.pattern.test(upperVal)) {
this.oldValue = upperVal; this.oldValue = upperVal;
this.oldPattern = rule; this.oldPattern = rule;
this.internalValue = upperVal; this.internalValue = upperVal;
this.isNA = /^NA$/i.test(upperVal);
this.$emit('input', upperVal); this.$emit('input', upperVal);
this.$emit('blur', upperVal); this.$emit('blur', upperVal);
return; return;
} }
} }
//
if (val.includes('/')) { if (val.includes('/')) {
const parts = val.split('/'); const parts = val.split('/');
const validParts = parts.filter(part => part !== ''); const validParts = parts.filter(part => part !== '');
@ -292,20 +294,12 @@ export default {
return; return;
} }
if (this.oldValue && this.oldPattern) {
const partialMatch = this.oldPattern.inputPattern && this.oldPattern.inputPattern.test(val);
if (!partialMatch) {
this.internalValue = this.oldValue;
this.$emit('input', this.oldValue);
this.$emit('blur', this.oldValue);
return;
}
}
//
let formatted = this.handleDecimalDigits(val); let formatted = this.handleDecimalDigits(val);
this.internalValue = formatted; this.internalValue = formatted;
this.$emit('input', parseFloat(formatted));
this.$emit('blur', parseFloat(formatted));
const num = parseFloat(formatted);
this.$emit('input', isNaN(num) ? '' : num);
this.$emit('blur', isNaN(num) ? '' : num);
} }
} }
}; };

+ 11
- 11
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -305,9 +305,9 @@ export default {
const { rowData } = val; const { rowData } = val;
let postData = { let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
} }
this.startConfigRequest(postData); this.startConfigRequest(postData);
}, },
@ -321,9 +321,9 @@ export default {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,// nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
kc: total, kc: total,
kcdw: unit, kcdw: unit,
} }
@ -342,14 +342,14 @@ export default {
} }
}) })
let postData = { let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
bh: mybh, bh: mybh,
nd: rowData.actSolutionConcentration || 0, nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.currentFormData.studySubjectId,
studyId: this.currentFormData.studyId,
studyFormId: this.currentFormData.id,
list: list list: list
} }
this.subPackageRequest(postData); this.subPackageRequest(postData);

+ 6
- 4
src/views/business/comps/template/formConfig/gsp/gsp015.js View File

@ -90,6 +90,8 @@ export const getYbsmFormConfig = ($this) => {
subKey: "startButton", subKey: "startButton",
buttonName:"开始", buttonName:"开始",
thirdType: 'button', thirdType: 'button',
showSub:$this.fillType === 'actFill',
showThird:$this.fillType === 'actFill',
thirdKey: 'endButton', thirdKey: 'endButton',
thirdButtonName:"结束", thirdButtonName:"结束",
}, },
@ -159,7 +161,7 @@ export const getQyTableColumns = ($this) => {
prop: 'ysqywz', prop: 'ysqywz',
width: 180, width: 180,
bodyType: 'select', bodyType: 'select',
options: $this.getDictOptions('business_qywz'),
bodyOptions: $this.getDictOptions('business_qywz'),
bodyFillType: 'actFill', bodyFillType: 'actFill',
}, },
{ {
@ -167,7 +169,7 @@ export const getQyTableColumns = ($this) => {
prop: 'sjqywz', prop: 'sjqywz',
width: 180, width: 180,
bodyType: 'select', bodyType: 'select',
options: $this.getDictOptions('business_qywz'),
bodyOptions: $this.getDictOptions('business_qywz'),
bodyFillType: 'actFill', bodyFillType: 'actFill',
compareTo: 'ysqywz', compareTo: 'ysqywz',
}, },
@ -192,8 +194,8 @@ export const getQyTableColumns = ($this) => {
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
copyFrom: 'ysqyldw',
compareTo: 'ysqyldw',
copyFrom: 'ysqyl',
compareTo: 'ysqyl',
}, },
] ]
} }

Loading…
Cancel
Save