3 İşlemeler 92bc7cdfdc ... 89c68058e8

Yazar SHA1 Mesaj Tarih
  dongfeng 89c68058e8 BUG3216【整车性能DVP】基本信息页面,点击保存按钮没反应,控制台报错 10 ay önce
  dongfeng e2997a7c4e Merge remote-tracking branch 'origin/qirui-v2' into qirui-v2 10 ay önce
  dongfeng 6b227b97d1 BUG3217 【整车项目DVP】DVP计划,新建DVP页面,试用车用途描述字段是必填项但可以输入空格 10 ay önce

+ 20 - 22
src/views/fullVehicle/baseInfo/baseInfo/index.vue

@@ -114,23 +114,17 @@
           <!-- 需求负责人 -->
           <a-col :xl="12" :lg="8" :md="12" :sm="24" :xs="24">
             <a-form-item :label="$t('base.info.requirement.owner')">
-              <span v-if="!isEdit" class="ml8">{{ baseInfo.owner }}</span>
+              <span v-if="!isEdit" class="ml8">{{ ownerName }}</span>
               <a-select
                 v-else
                 class="select-width"
-                v-model="owner"
+                v-model="baseInfo.owner"
                 :filter-option="filterOption"
+                :options="requirementOwnerList"
                 :placeholder="$t('base.info.please-choose-owner')"
-                showSearch
-                @change="changeOwner"
-              >
+                @change="handleOwnerChange"
+                showSearch>
                 <a-icon slot="suffixIcon" type="search"/>
-                <a-select-option
-                  v-for="item in requirementOwnerList"
-                  :key="item.userId"
-                >
-                  {{ item.fullname }}
-                </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -162,6 +156,7 @@ export default {
       isEdit: false,      // 编辑标识
       owner: undefined,   // 责任人
       requirementOwnerList: [],      // 责任人字典
+      ownerName: undefined
     };
   },
   created() {},
@@ -179,6 +174,7 @@ export default {
       _that.$api.initDvpBasicInformation(data).then(res =>{
         if (res.flag){
           _that.baseInfo = res.data;
+          _that.ownerName = res.data.owner;
           //处理"年",只显示年份不显示后面日期与时间
           if (_that.baseInfo.year){
             _that.baseInfo.year = _that.baseInfo.year.slice(0,4)
@@ -197,21 +193,23 @@ export default {
     getRequirementOwner(){
       this.$api.getAllUsers().then(res =>{
         if (res.flag){
-          this.requirementOwnerList = res.data;
-        } else {
-          this.$message.error(res.message, 1);
+          let userList = res.data;
+          userList.forEach(item =>{
+            let options = {
+              label: item.fullname,  //后端返回的不是驼峰命名,所以这样写
+              value: item.userId
+            };
+            this.requirementOwnerList.push(options);
+          });
         }
       });
     },
     // 保存
     doSave() {
-      if (!this.owner) {
-        return this.$message.warning(this.$t('base.info.please-choose-owner'), 1);
-      }
       //基本信息保存请求参数-目前只能更改需求负责人
       let basicInfoData = {
         dvpId: this.$store.getters.dvpId,
-        ownerId: this.owner,
+        ownerId: this.baseInfo.ownerId,
         dvpType: 0,
       };
       //保存基本信息-需求负责人
@@ -228,15 +226,15 @@ export default {
     // 编辑
     doEdit() {
       this.isEdit = true;
-    },
-    // 责任人下拉选项变换时
-    changeOwner(value, options) {
-      this.owner = options ? options.data.key : undefined;
     },
 		// 下拉选项过滤
 		filterOption(input, option) {
 			return (option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0);
 		},
+    // 下拉选改变
+    handleOwnerChange(val) {
+      this.baseInfo.ownerId = val;
+    }
   },
   computed: {},
   filters: {}

+ 1 - 1
src/views/fullVehicle/dvpPlan/AddModal/addDvpTest.vue

@@ -21,7 +21,7 @@
           <!--试验车用途描述-->
           <a-col :md="12" :sm="12">
             <a-form-item :required='true' :label="$t('plan.dvp.description-of-the-purpose-of-the-test-vehicle')">
-              <a-input v-model="formData.vehicleUse" :maxLength="128" :placeholder="$t('plan.dvp.please_enter-description-of-the-purpose-of-the-test-vehicle')"/>
+              <a-input v-model.trim="formData.vehicleUse" :maxLength="128" :placeholder="$t('plan.dvp.please_enter-description-of-the-purpose-of-the-test-vehicle')"/>
             </a-form-item>
           </a-col>
 				</a-row>