Pārlūkot izejas kodu

同步药品信息到580医院

zhangqin 3 nedēļas atpakaļ
vecāks
revīzija
0c23f8371d

+ 7 - 0
src/api/hisStore/storeProduct.js

@@ -109,4 +109,11 @@ export function getStoreProductColumns(query) {
   })
 }
 
+// 同步商品到580
+export function sync580(productId) {
+  return request({
+    url: '/store/store/storeProduct/sync580/'+productId,
+    method: 'post'
+  })
+}
 

+ 27 - 1
src/views/hisStore/storeProduct/index.vue

@@ -271,6 +271,17 @@
         >导出</el-button>
       </el-col>
 
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-refresh"
+          size="mini"
+          :disabled="multiple"
+          @click="handleSync"
+          v-hasPermi="['store:storeProduct:sync']"
+        >同步</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -906,7 +917,8 @@ import {
   addOrEdit,
   exportStoreProduct,
   importTemplate,
-  batchModify
+  batchModify,
+  sync580
 } from "@/api/hisStore/storeProduct";
 import { getAllStoreProductCategory } from "@/api/hisStore/storeProductCategory";
 import { getAllStoreProductRule } from "@/api/hisStore/storeProductRule";
@@ -1675,6 +1687,20 @@ export default {
       }).then(response => {
         this.download(response.msg);
       }).catch(function() {});
+    },
+    /** 同步按钮操作 */
+    handleSync (row) {
+      const productIds = row.productId || this.ids;
+      this.$confirm('是否确认同步商品编号为"' + productIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return sync580(productIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("同步成功");
+      }).catch(function() {});
     }
   }
 };