2 Commits

4 changed files with 76 additions and 5 deletions
Split View
  1. +57
    -4
      src/components/Template/HandleFormItem.vue
  2. +14
    -1
      src/views/business/comps/template/comps/gsp/GSP015.vue
  3. +1
    -0
      src/views/business/comps/template/comps/sp/SP0021.vue
  4. +4
    -0
      src/views/business/comps/template/formConfig/gsp/gsp015.js

+ 57
- 4
src/components/Template/HandleFormItem.vue View File

@ -72,13 +72,20 @@
</div>
<div v-else-if="type === 'radioTree'" class="flex1 radio-tree-container"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '') + (error ? ' form-error-border' : '') + (item.noBorder ? ' no-border' : '') + (item.layout === 'horizontal' ? ' flex' : '')">
<el-radio-group v-model="inputValue" :disabled="getDisabled()" @change="onRadioTreeChange">
<el-radio-group v-model="inputValue.checkedValues" :disabled="getDisabled()" @input="onRadioTreeChange">
<div v-for="option in item.options" :key="option.value" class="radio-tree-item">
<el-radio :label="option.value">
{{ option.label }}
</el-radio>
<div v-if="isShowOtherByCheckboxTree(option.value) && inputValue.checkedValues === option.value"
class="checkbox-tree-input-container">
<el-input maxlength="100" v-model="inputValue.otherValues[option.value]"
:disabled="getDisabled()" placeholder="请输入"
@blur="onCheckboxTreeOtherBlur(option.value, $event)" />
</div>
</div>
</el-radio-group>
</div>
<el-date-picker v-else-if="type === 'dateTime' || type === 'datePicker'"
:type="type === 'dateTime' ? 'datetime' : 'date'" class="flex1"
@ -305,9 +312,11 @@ export default {
}));
} else if (this.type === 'fqyq' && !this.value) {
initialValue = { mainRadio: '', subRadio: '', inputValue: "" };
} else if (this.type === 'checkboxTree' && !this.value) {
} else if ((this.type === 'checkboxTree') && !this.value) {
const defaultCheckedValue = getDefaultValueByOptions(this.item.options || []);
initialValue = { checkedValues: defaultCheckedValue, otherValues: {} };
} else if ((this.type === 'radioTree') && !this.value) {
initialValue = { checkedValues: "", otherValues: {} };
}
const { type } = this;
return {
@ -748,7 +757,7 @@ export default {
},
getFillTypeStyle(type) {
const { fillType } = this.item;
const filterType = ["attachment", "checkboxTag", "fqyq", "checkboxTree", "radio"]
const filterType = ["attachment", "checkboxTag", "fqyq", "checkboxTree", "radio","radioTree"]
const typeObj = {
actFill: "orange-border",//
blxjsh: "orange-border",//
@ -863,7 +872,9 @@ export default {
this.onCommonHandleSaveRecord(this.inputValue);
},
onRadioTreeChange(val) {
this.inputValue = val;
this.inputValue.checkedValues = val;
this.currentHandleType = 'checkboxTreeCheckbox';
this.currentCheckboxTreeValue = val;
this.onCommonHandleSaveRecord(this.inputValue);
},
//
@ -1126,6 +1137,16 @@ export default {
}
return o[currentHandleType];
},
getRadioTreeInfo() {
const { checkedValues, otherValues } = this.inputValue;
const { checkedValues: oldCheckedValues, otherValues: oldOtherValues } = this.oldValue;
const { currentHandleType, currentCheckboxTreeValue } = this;
const o = {
"checkboxTreeCheckbox": { oldValue: oldCheckedValues, newValue: checkedValues, des: "" },
"checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}`, key: this.fieldKey + "_" + checkedValues },
}
return o[currentHandleType];
},
async onCommonHandleSaveRecord(val) {
const isEmpty = isValueEmpty(this.inputValue);
if (this.error && !isEmpty) {
@ -1197,6 +1218,17 @@ export default {
isOldValueEmpty = this.isUnSubmitted(current.key);
}
} else if(this.type === "radioTree"){
const current = this.getRadioTreeInfo();
const { oldValue = {}, newValue = {} } = current;
if (this.currentHandleType === "checkboxTreeCheckbox") {
isSame = isEqual(oldValue, newValue);
console.log(oldValue,newValue,oldValue !== newValue,"newValue")
isOldValueEmpty = oldValue === newValue;
} else {
isSame = isEqual(current.oldValue, current.newValue);
isOldValueEmpty = this.isUnSubmitted(current.key);
}
} else if (this.type === "checkbox") {
isSame = isEqual(this.oldValue, this.inputValue)
@ -1221,6 +1253,7 @@ export default {
//
isUnSubmitted(key) {
const finallyKey = key || this.fieldKey;
console.log(this.getSubmittedCodes(),finallyKey,"finallyKey")
const has = this.getSubmittedCodes().includes(finallyKey)
return !has;
},
@ -1289,10 +1322,23 @@ export default {
recordOldVlaue = `${oldValue?.label || ''}:${oldValue?.checked ? '勾选' : '未勾选'}`;
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`;
isModify = newValue.checked !== undefined;
} else {
recordOldVlaue = `${current.des + (current.oldValue || '')}`;
recordValue = `${current.des + (current.newValue || '')}`;
finallyKey = current.key;
isModify = !!current.oldValue;
}
} else if (this.type === "radioTree") {
const current = this.getRadioTreeInfo();
if (this.currentHandleType === "checkboxTreeCheckbox") {
const { oldValue = {}, newValue = {} } = current;
recordOldVlaue = `${oldValue || ''}`;
recordValue = `${newValue || ''}`;
isModify = newValue !== oldValue;
} else {
recordOldVlaue = `${current.des + (current.oldValue || '')}`;
recordValue = `${current.des + (current.newValue || '')}`;
finallyKey = current.key;
isModify = !!current.oldValue;
}
} else if (this.type === "checkbox") {
@ -2120,4 +2166,11 @@ export default {
.record-row{
text-align: left;
}
.radio-tree-item{
display: flex;
align-items: center;
&:not(:last-child) {
margin-bottom: 10px;
}
}
</style>

+ 14
- 1
src/views/business/comps/template/comps/gsp/GSP015.vue View File

@ -222,9 +222,19 @@ export default {
};
},
mounted() {
if (this.fillType === "actFill") {
setTimeout(() => {
this.handleUpdateCode();
}, 0);
}
},
methods: {
handleUpdateCode(){
const refs = ["jyTableRef"]
const {ecDataList = [],ybsmDataList= []} = this.fromData;
console.log(this.formData,"fff")
},
//blog
async handleBeforeDownload({ html2pdf, options, pdfContent }) {
this.$modal.loading()
@ -431,6 +441,7 @@ export default {
deleteConfig(item, type = "ybsmDataList") {
if (this.formData[type].length > 1) {
const configIndex = this.formData[type].findIndex(config => config.id === item.id);
console.log(configIndex,item,"configIndex")
if (configIndex > -1) {
const newList = [...this.formData[type]]
newList.splice(configIndex, 1);
@ -478,6 +489,7 @@ export default {
...ybsmTableData,
jyStepTableFormData: jyTableData.stepTableFormData,
jyHeaderSelectFields: jyTableData.headerSelectFields,
id: item.id,
};
});
const eData = ecDataList.map((item, index) => {
@ -486,6 +498,7 @@ export default {
return {
...ecFormData,
...ecTableData,
id: item.id,
};
});
return {

+ 1
- 0
src/views/business/comps/template/comps/sp/SP0021.vue View File

@ -124,6 +124,7 @@ export default {
},
methods: {
//
deleteConfig(item) {
// ybsmDataList
if (this.formData.ybsmDataList.length > 1) {

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

@ -118,6 +118,8 @@ export const getQyTableColumns = ($this) => {
width: 200,
bodyType: 'input',
bodyFillType: 'preFill',
subBodyType:"span",
subBodyKey: "qybhCode",
},
{
label: '制剂编号',
@ -209,6 +211,8 @@ export const getJyTableColumns = ($this) => {
width: 200,
bodyType: 'input',
bodyFillType: 'preFill',
subBodyType:"span",
subBodyKey: "jybhCode",
},
{
label: '取样编号',

Loading…
Cancel
Save