Browse Source

bug修改门类管理-著录界面管理

master
z_yu 3 years ago
parent
commit
9aaf656ddf
  1. 2
      src/views/category/form.vue
  2. 27
      src/views/components/category/PreviewForm.vue

2
src/views/category/form.vue

@ -78,10 +78,12 @@ export default {
if (item.value !== 3) {
item.typeState = true
}
this.form.isType = 3
} else if (this.selectedCategory.isType === 3) {
if (item.value !== 4) {
item.typeState = true
}
this.form.isType = 4
}
})
},

27
src/views/components/category/PreviewForm.vue

@ -22,7 +22,19 @@
/>
<!-- text / number / textarea / popover -->
<!-- :validate-event="isDisabled" -->
<el-input v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date' && item.fieldName !== 'barcode' " v-model="addOrUpdateForm[item.fieldName]" :type="item.isInputClass === 'popover'? 'text' : item.isInputClass" :rows="item.isInputClass === 'textarea' ? 3 : ''" :class="{'input-popover':(item.isInputClass === 'popover')}" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="!isDisabled" @keyup.enter.native="isRepeatHandle(item)" @blur="isRepeatHandle(item)">
<el-input
v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date' && item.fieldName !== 'barcode' "
v-model="addOrUpdateForm[item.fieldName]"
:type="item.isInputClass === 'popover'? 'text' : item.isInputClass"
:rows="item.isInputClass === 'textarea' ? 3 : ''"
:class="{'input-popover':(item.isInputClass === 'popover')}"
:style="{ width: item.editLength+'px'}"
:disabled="isDisabled"
:validate-event="!isDisabled"
@keyup.enter.native="isRepeatHandle(item)"
@input="autoAddZero(item.isFilling, item.fieldName, addOrUpdateForm[item.fieldName], item.fillingDigit)"
@blur="isRepeatHandle(item)"
>
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-weibiaoti-2" @click="handleCurrentFieldName(item)" />
</el-input>
<!-- date -->
@ -133,6 +145,9 @@ export default {
arcId: function(newValue, oldValue) {
},
parentsId: function(newValue, oldValue) {
},
formPreviewData: function() {
this.editFormRow()
}
},
created() {
@ -243,6 +258,12 @@ export default {
this.currentFieldName = item.fieldName
this.getAllSubset(item)
},
//
autoAddZero(isFilling, fieldName, value, fillingDigit) {
if (isFilling) {
this.addOrUpdateForm[fieldName] = value.toString().padStart(fillingDigit, '0').slice(-1 * fillingDigit)
}
},
//
editFormRow() {
this.rules = {}
@ -259,13 +280,13 @@ export default {
this.$set(this.addOrUpdateForm, item.fieldName, null) // unkonwn
}
}
this.rules[item.fieldName] = [
this.$set(this.rules, item.fieldName, [
{
required: !!item.isRequired,
message: (item.isInputClass === 'text' ? '请输入' : '请选择') + item.fieldCnName,
trigger: item.isInputClass === 'text' ? 'blur' : 'change'
}
]
])
})
},
//

Loading…
Cancel
Save