瀏覽代碼

问题1 无法选择 原因是获取到列表后可能会修改一些选项导致重新获取接口,选择按钮走接口时被禁用,这个接口速度比较慢

问题2 无法进行下一步, 因为选择品牌不在范围内,在选择主阀时先清空品牌列表 获取到结果之后重新显示正确的品牌列表
xiaohaizhao 9 月之前
父節點
當前提交
700af244ab
共有 2 個文件被更改,包括 56 次插入149 次删除
  1. 0 108
      src/optionSystem/selectOption/add copy.vue
  2. 56 41
      src/optionSystem/selectOption/components/DieFa.vue

+ 0 - 108
src/optionSystem/selectOption/add copy.vue

@@ -1,108 +0,0 @@
-<template>
-  <div style="display: inline">
-    <el-dropdown @command="onShow">
-      <el-button type="primary" size="small"> {{ $t("阀门选型") }} </el-button>
-      <el-dropdown-menu slot="dropdown">
-        <el-dropdown-item
-          :command="item.value"
-          v-for="item in valvetypeList"
-          :key="item.value"
-          >{{ $t(item.remarks) }}</el-dropdown-item
-        >
-      </el-dropdown-menu>
-    </el-dropdown>
-    <el-dialog
-      custom-class="custom-select-option_class"
-      :visible.sync="drawer"
-      width="1100px"
-      append-to-body
-      :show-close="false"
-    >
-      <component
-        :position="position"
-        @close="drawer = false"
-        :is="formComponent"
-        v-on="$listeners"
-      ></component>
-    </el-dialog>
-  </div>
-</template>
-    
-<script>
-import { mapGetters } from "vuex";
-export default {
-  props: ["position"],
-  data() {
-    return {
-      drawer: false,
-      type: "",
-      valvetypeList: [],
-    };
-  },
-  provide() {
-    return {
-      valvetype: () => this.type,
-    };
-  },
-  computed: {
-    ...mapGetters({
-      loading: "loading",
-    }),
-
-    formComponent() {
-      switch (this.type) {
-        case "蝶阀":
-          return () =>
-            import("@/optionSystem/selectOption/components/DieFa.vue");
-          break;
-        default:
-          break;
-      }
-    },
-  },
-  methods: {
-    onShow(type) {
-      this.type = type;
-      this.drawer = true;
-    },
-    onSubmit() {
-      this.$refs.target.$refs["form"].validate(async (valid) => {
-        if (!valid) return false;
-        this.$refs.target.onSubmit(() => {
-          this.$refs.target.refresh();
-          this.drawer = false;
-        });
-      });
-    },
-    optionList() {
-      this.$store.dispatch("optiontypeselect", "valvetype").then((res) => {
-        this.valvetypeList = res.data;
-        console.log(this.valvetypeList, "阀门类型");
-      });
-    },
-  },
-  created() {
-    this.optionList();
-  },
-};
-</script>
-<style scoped>
-.dialog-footer {
-  margin-top: 32px;
-  text-align: center;
-}
-/deep/.el-dialog__header {
-  display: none !important;
-}
-/deep/.el-dialog__body {
-  padding-top: 0 !important;
-}
-</style>
-<style>
-@media screen and (max-width: 1800px) {
-  .custom-select-option_class.el-dialog {
-    margin-top: 10px !important;
-  }
-}
-</style>
-    

+ 56 - 41
src/optionSystem/selectOption/components/DieFa.vue

@@ -222,31 +222,33 @@
             ></MySelect>
           </div>
         </div>
-        <div
-          class="option-line"
-          v-if="guangtouParam.content.where.drivetype == '电动'"
-        >
-          <div class="item">
-            <div class="label">{{ $t("品牌") }}:</div>
-            <MySelect
-              @click="
-                Search('excelParam', 'actuatorbrand');
-                calcTableHieght('excelRef');
-              "
-              :disabled="!excelParam.content.where.actuatordrivetype"
-              :options="actuatorbrand"
-              v-model="excelParam.content.where.actuatorbrand"
-            ></MySelect>
+        <div v-if="actuatorbrand.length">
+          <div
+            class="option-line"
+            v-if="guangtouParam.content.where.drivetype == '电动'"
+          >
+            <div class="item">
+              <div class="label">{{ $t("品牌") }}:</div>
+              <MySelect
+                @click="
+                  Search('excelParam', 'actuatorbrand');
+                  calcTableHieght('excelRef');
+                "
+                :disabled="!excelParam.content.where.actuatordrivetype"
+                :options="actuatorbrand"
+                v-model="excelParam.content.where.actuatorbrand"
+              ></MySelect>
+            </div>
           </div>
-        </div>
-        <div class="option-line" v-else>
-          <div class="item">
-            <div class="label">{{ $t("品牌") }}:</div>
-            <MySelect
-              @click="Search('excelParam', 'actuatorbrand')"
-              :options="actuatorbrand"
-              v-model="excelParam.content.where.actuatorbrand"
-            ></MySelect>
+          <div class="option-line" v-else>
+            <div class="item">
+              <div class="label">{{ $t("品牌") }}:</div>
+              <MySelect
+                @click="Search('excelParam', 'actuatorbrand')"
+                :options="actuatorbrand"
+                v-model="excelParam.content.where.actuatorbrand"
+              ></MySelect>
+            </div>
           </div>
         </div>
         <div
@@ -319,7 +321,6 @@
             ></MySelect>
           </div>
         </div>
-
         <div
           class="option-line"
           v-show="guangtouParam.content.where.drivetype == '气动'"
@@ -382,9 +383,8 @@
                 size="mini"
                 @click="selectTarget(scope.data, '执行器')"
                 :disabled="
-                  loading ||
-                  (guangtouParam.content.where.drivetype == '电动' &&
-                    resultArr.length == 2)
+                  guangtouParam.content.where.drivetype == '电动' &&
+                  resultArr.length == 2
                 "
                 >{{ $t("选择") }}</el-button
               >
@@ -421,9 +421,8 @@
               size="mini"
               @click="selectTarget(scope.data, '执行器')"
               :disabled="
-                loading ||
-                (guangtouParam.content.where.drivetype == '电动' &&
-                  resultArr.length == 2)
+                guangtouParam.content.where.drivetype == '电动' &&
+                resultArr.length == 2
               "
               >{{ $t("选择") }}</el-button
             >
@@ -535,7 +534,9 @@
                     guangtouParam.content.where.drivetype == "电动" &&
                     resultArr[1] &&
                     resultArr[1].gearboxname
-                      ? ` + ${$t('减速箱')}:${resultArr[1] && resultArr[1].gearboxname}`
+                      ? ` + ${$t("减速箱")}:${
+                          resultArr[1] && resultArr[1].gearboxname
+                        }`
                       : ""
                   }}</span
                 >
@@ -721,14 +722,18 @@
             </td>
           </tr>
           <tr>
-            <td class="title">{{ $t(product.itemno ? "牌价" : "最低经销价") }}</td>
+            <td class="title">
+              {{ $t(product.itemno ? "牌价" : "最低经销价") }}
+            </td>
             <td class="text2">
               ¥{{
                 Object.keys(product).length
                   ? tool.formatAmount(product.price, 2)
                   : "xxxxxx"
               }}
-                <div style="color:#1C1919;font-weight: normal;font-size: 12px;">*{{$t('非标准产品,当前价格仅供参考')}}!</div>
+              <div style="color: #1c1919; font-weight: normal; font-size: 12px">
+                *{{ $t("非标准产品,当前价格仅供参考") }}!
+              </div>
             </td>
           </tr>
         </table>
@@ -755,7 +760,9 @@
           @click="onSubmit"
           class="normal-btn-width"
           v-if="active == 4"
-          >{{ $t(position == "单独选型" ? "保存选型单" : "确认添加") }}</el-button
+          >{{
+            $t(position == "单独选型" ? "保存选型单" : "确认添加")
+          }}</el-button
         >
       </div>
     </div>
@@ -984,7 +991,8 @@ export default {
             whereKeys[i].indexOf("maxrounddiameter") != -1 ||
             whereKeys[i].indexOf("maxsquarewidth") != -1 ||
             whereKeys[i].indexOf("torque") != -1 ||
-            whereKeys[i].indexOf("drivetype") != -1 || whereKeys[i].indexOf('caliber') != -1
+            whereKeys[i].indexOf("drivetype") != -1 ||
+            whereKeys[i].indexOf("caliber") != -1
           )
             continue;
           this[type].content.where[whereKeys[i]] = "";
@@ -1144,11 +1152,17 @@ export default {
       }
     },
     async onSubmit() {
-      this.$confirm(this.$t(this.position == '单独选型' ? '是否确认保存':"确认加入单据吗") + "?", this.$t("提示"), {
-        confirmButtonText: this.$t("确定"),
-        cancelButtonText: this.$t("取消"),
-        type: "warning",
-      })
+      this.$confirm(
+        this.$t(
+          this.position == "单独选型" ? "是否确认保存" : "确认加入单据吗"
+        ) + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          type: "warning",
+        }
+      )
         .then(async () => {
           let mainvalve = Object.keys(this.guangtouParam.content.where)
             .filter((v) => v.indexOf("condition") == -1)
@@ -1202,6 +1216,7 @@ export default {
         this.excelParam.content.where.flh = data.flh;
         this.excelParam.content.where.maxsquarewidth = data.maxsquarewidth;
         this.excelParam.content.where.maxrounddiameter = data.maxrounddiameter;
+        this.actuatorbrand = [];
         if (this.guangtouParam.content.where.drivetype == "电动") {
           this.excelParam.content.where.caliber = this.resultArr[0].caliber;
         }