Browse Source

Merge branch 'lyz_dev' of http://1.94.207.143:3000/chongqing/store-admin into lyz_dev

Mcal 1 tuần trước cách đây
mục cha
commit
1c07a88634
2 tập tin đã thay đổi với 21 bổ sung12 xóa
  1. 11 5
      src/api/currency.js
  2. 10 7
      src/views/currency/list.vue

+ 11 - 5
src/api/currency.js

@@ -1,12 +1,11 @@
 import request from '@/utils/request'
 
-
 // 获取货币列表
 export function getCurrencyList(param) {
   return request({
-      url: 'backendApi/currency/list',
-      method: 'get',
-      params: param
+    url: 'backendApi/currency/list',
+    method: 'get',
+    params: param
   })
 }
 
@@ -18,4 +17,11 @@ export function saveCurrency(data) {
     data: data
   })
 }
-
+// 修改货币
+export function updateCurrency(data) {
+  return request({
+    url: 'backendApi/currency/updateCurrency',
+    method: 'post',
+    data: data
+  })
+}

+ 10 - 7
src/views/currency/list.vue

@@ -130,7 +130,7 @@
     <FuintQrCode :showDialog="openQrCode" :qr="qr" @closeDialog="closeDialog" />
   </div>
   </template>
-  
+
   <script>
   import FuintQrCode from "@/components/Fuint/QrCode";
   import { getToken } from "@/utils/auth";
@@ -199,7 +199,7 @@
         rules: {
           name: [
             { required: true, message: "货币名称不能为空", trigger: "blur" },
-            
+
           ],
           symbol:[
             { required: true, message: "货币符号不能为空", trigger: "blur" },
@@ -286,7 +286,11 @@
         this.$refs["form"].validate((valid) => {
           if (valid) {
             if(this.form.id){
-
+              updateCurrency(this.form).then((response) => {
+                this.$modal.msgSuccess('修改成功')
+                this.open = false
+                this.getList()
+              })
             }else{
                 saveCurrency(this.form).then(response => {
                     this.$modal.msgSuccess("新增成功");
@@ -322,14 +326,14 @@
       // 修改按钮操作
       handleUpdate(row) {
         this.reset();
-      
+
         this.title = "编辑货币";
         this.open = true;
         const {id,name,symbol} = row
         this.form={id,name,symbol}
-        
+
       },
-     
+
       handleUploadSuccess(file) {
         this.form.logo = file.data.fileName;
       },
@@ -359,4 +363,3 @@
     text-align: left;
   }
   </style>
-