Переглянути джерело

【修改】销售政策新增、编辑

zhouhao 2 роки тому
батько
коміт
e3fe3a205b

+ 21 - 3
src/views/sales_policy/components/AddPolicy.vue

@@ -227,7 +227,19 @@
 
             <pl-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
               <template slot-scope="scope">
-                {{ scope.row.orgPrice }}
+                <template v-if="scope.row.fang">
+                  {{ scope.row.orgPrice }}
+                </template>
+                <el-input
+                  v-else
+                  v-model.number="scope.row.orgPrice"
+                  class="yinput"
+                  type="number"
+                  placeholder="请输入原供价"
+                  size="mini"
+                  @mousewheel.native.prevent
+                  @change="setText($event, scope.$index, scope.row, 'orgPrice')"
+                />
               </template>
             </pl-table-column>
             <pl-table-column prop="priceType" label="价格类型" align="left" min-width="150">
@@ -362,7 +374,7 @@
           <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
             <div>
               <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
-              <el-button type="primary" size="mini" @click="handleSave">保存</el-button>
+              <el-button type="primary" size="mini" @click="handleSave"  v-loading.fullscreen.lock="fullscreenLoading">保存</el-button>
             </div>
             <!--            <el-pagination-->
             <!--              :current-page="dcurrentPage"-->
@@ -534,7 +546,8 @@ export default {
       sleectBox: { currentPage: 1 },
       dpageSize: 10,
       dcurrentPage: 1,
-      rebateList: []
+      rebateList: [],
+      fullscreenLoading:false
     }
   },
   computed: {
@@ -910,7 +923,10 @@ export default {
       // this.dataList.push(this.addList[this.addList.length-1])
     },
     handleSave() {
+      this.fullscreenLoading = true
+
       if (!this.dataList.length) {
+        this.fullscreenLoading = false
         return
       }
       for (let i = 0; i < this.dataList.length; i++) {
@@ -936,6 +952,8 @@ export default {
         this.dataList = []
         this.dcurrentPage = 1
         this.sleectBox.currentPage = 1
+        this.fullscreenLoading = false
+
         this.$successMsg('保存成功')
 
         this.handletwoList()

+ 21 - 3
src/views/sales_policy/components/editPolicy.vue

@@ -229,7 +229,19 @@
               </pl-table-column>
               <pl-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
                 <template slot-scope="scope">
-                  {{ scope.row.orgPrice }}
+                  <template v-if="scope.row.fang">
+                    {{ scope.row.orgPrice }}
+                  </template>
+                  <el-input
+                    v-else
+                    v-model.number="scope.row.orgPrice"
+                    class="yinput"
+                    type="number"
+                    placeholder="请输入原供价"
+                    size="mini"
+                    @mousewheel.native.prevent
+                    @change="setText($event, scope.$index, scope.row, 'orgPrice')"
+                  />
                 </template>
               </pl-table-column>
               <pl-table-column prop="priceType" label="价格类型" align="left" min-width="150">
@@ -365,7 +377,7 @@
           <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
             <div>
               <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
-              <el-button type="primary" size="mini" @click="handleSave">保存</el-button>
+              <el-button type="primary" size="mini" @click="handleSave"   v-loading.fullscreen.lock="fullscreenLoading">保存</el-button>
             </div>
             <!--            <el-pagination-->
             <!--              :current-page="dcurrentPage"-->
@@ -549,7 +561,9 @@ export default {
       rebateList: [],
       cid: '',
       cpolicyId: '',
-      region: 0
+      region: 0,
+      fullscreenLoading:false
+
     }
   },
   computed: {
@@ -952,7 +966,9 @@ export default {
       // this.dataList.push(this.addList[this.addList.length-1])
     },
     handleSave() {
+      this.fullscreenLoading = true
       if (!this.dataList.length) {
+        this.fullscreenLoading = false
         return
       }
       for (let i = 0; i < this.dataList.length; i++) {
@@ -979,6 +995,8 @@ export default {
         this.dataList = []
         this.sleectBox.currentPage = 1
         this.dcurrentPage = 1
+        this.fullscreenLoading = false
+
         this.$successMsg('保存成功')
         this.handletwoList()
       })