lilei 3 år sedan
förälder
incheckning
ebc850b017
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      src/views/productManagement/productInfo/edit.vue

+ 6 - 0
src/views/productManagement/productInfo/edit.vue

@@ -94,8 +94,10 @@
               style="margin-left: 5px;"></a-button>
           </a-form-model-item>
           <a-form-model-item label="产品分类" prop="productType">
+            <a-spin v-if="loadingPtype" size="small" />
             <a-cascader
               :disabled="isEdit"
+              v-if="!loadingPtype&&productTypeList.length"
               @change="changeProductType"
               expand-trigger="hover"
               :options="productTypeList"
@@ -106,6 +108,7 @@
               v-model="form.productType"
               ref="productType"
               @keydown.enter.native="nextFocus('productType', 'specialPrice', $event)" />
+            <a-button v-if="!loadingPtype&&productTypeList.length==0" type="link" @click="getProductType">重新加载</a-button>
           </a-form-model-item>
 
           <a-form-model-item label="经销批发价" prop="specialPrice">
@@ -240,6 +243,7 @@ export default {
   data () {
     return {
       spinning: false,
+      loadingPtype: false,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
@@ -413,12 +417,14 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
+      this.loadingPtype = true
       dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {
           this.productTypeList = []
         }
+        this.loadingPtype = false
       })
     },
     pageInit () {