|
@@ -66,7 +66,7 @@
|
|
|
</a-col>
|
|
|
<!--项目节点-->
|
|
|
<a-col :md="12" :sm="12">
|
|
|
- <a-form-item :required='true' :label="$t('plan.dvp.project-node')">
|
|
|
+ <a-form-item :required='nodeRequired' :label="$t('plan.dvp.project-node')">
|
|
|
<a-select allowClear v-model="formData.node" :options="projectNodeList" @change="handleProjectNode" :placeholder="$t('plan.dvp.please_select-project-node')"></a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -181,7 +181,9 @@ export default {
|
|
|
searchSelectData: {},
|
|
|
planStartTime: undefined,
|
|
|
planEndTime: undefined,
|
|
|
- formData: {}
|
|
|
+ formData: {},
|
|
|
+ /**项目节点是否必填 */
|
|
|
+ nodeRequired: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -212,13 +214,18 @@ export default {
|
|
|
this.$api.getProjectNodeList(data).then(res => {
|
|
|
if (res.flag){
|
|
|
let nodeList = res.data.dynamicConfig;
|
|
|
- nodeList.forEach(item => {
|
|
|
- let options = {
|
|
|
- label: item.name,
|
|
|
- value: item.id
|
|
|
- }
|
|
|
- this.projectNodeList.push(options);
|
|
|
- });
|
|
|
+ if (nodeList && nodeList.length > 0) {
|
|
|
+ nodeList.forEach(item => {
|
|
|
+ let options = {
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ }
|
|
|
+ this.projectNodeList.push(options);
|
|
|
+ });
|
|
|
+ this.nodeRequired = true;
|
|
|
+ } else {
|
|
|
+ this.nodeRequired = false;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -344,7 +351,7 @@ export default {
|
|
|
message.push(_this.$t('global-constant.please-select') + _this.$t('plan.dvp.study-director'));
|
|
|
}
|
|
|
// 项目节点
|
|
|
- if (!_this.formData.node) {
|
|
|
+ if (_this.nodeRequired && !_this.formData.node) {
|
|
|
message.push(_this.$t('global-constant.please-select') + _this.$t('plan.dvp.project-node'));
|
|
|
}
|
|
|
// 样车试验提供时间
|