zhangdan 4 years ago
parent
commit
48f6ac088d
2 changed files with 24 additions and 4 deletions
  1. 22 2
      src/views/recoveryManage/recoveryPriceSet.vue
  2. 2 2
      vue.config.js

+ 22 - 2
src/views/recoveryManage/recoveryPriceSet.vue

@@ -35,11 +35,15 @@
         <!-- <template v-else> {{ record.accountPrice }} </template> -->
       </template>
       <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
+      <template slot="action" slot-scope="text,index, record">
         <div class="editable-row-operations">
           <span >
             <!-- <a @click="() => save(record.id, record.accountPrice)" style="margin-right: 8px;">保存</a> -->
-            <a-popconfirm title="确定要保存吗?" @confirm="() => save(record.id,record.advicePrice)">
+            <a-popconfirm title="确定要保存吗?" @confirm="() => save(record.id,record.advicePrice)" @cancel="cancel(record,index)">
+              <template slot="title">
+                <p> 保存</p>
+                <p> 取消 </p>
+              </template>
               <a>保存</a>
             </a-popconfirm>
           </span>
@@ -83,6 +87,7 @@ export default {
           this.loadData = res.data
           this.loadData.forEach((item, index) => {
             item.no = index + 1
+            item.currentValue = item.advicePrice
           })
         }
       })
@@ -95,12 +100,14 @@ export default {
           this.loadData = res.data
           this.loadData.forEach((item, index) => {
             item.no = index + 1
+            item.currentValue = item.advicePrice
           })
         }
       })
     },
     // 改变回收价格
     handleChange (value, id) {
+      console.log(value)
       const newData = [...this.loadData]
       const target = newData.filter(item => id === item.id)[0]
       console.log(target, '-----------')
@@ -119,6 +126,7 @@ export default {
               this.loadData = res.data
               this.loadData.forEach((item, index) => {
                 item.no = index + 1
+                item.currentValue = item.advicePrice
               })
             }
           })
@@ -126,6 +134,18 @@ export default {
           this.$message.warning(res.message)
         }
       })
+    },
+    cancel (item, index) {
+      console.log(index, this.loadData, '------lllllllll')
+      if (item.currentValue) {
+        item.advicePrice = item.currentValue
+      } else {
+        this.$nextTick(() => {
+          item.advicePrice = ''
+          this.loadData[index].advicePrice = ''
+          console.log(item.advicePrice, '-----pppppp')
+        })
+      }
     }
 
   }

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.16.224:8301/gc-admin/',
-        // target: 'https://lese.test.zyucgj.com/gc-admin',
+        target: 'http://192.168.16.213:8301/gc-admin/',
+        // target: ' https://lese.test.zyucgj.com/gc-admin',
         ws: false,
         changeOrigin: true,
         pathRewrite: {