Commit 84481144 authored by chenzj's avatar chenzj

新增sap同步计量单位

parent edabc44b
......@@ -56,3 +56,11 @@ export function delUnitmeasure(measureId) {
method: 'delete'
})
}
// 同步sap单位
export function sapSynUnitmeasure() {
return request({
url: '/mes/md/unitmeasure/sapSynchro',
method: 'post'
})
}
......@@ -66,6 +66,16 @@
v-hasPermi="['mes:md:unitmeasure:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
:loading="syncLoading"
type="primary"
icon="el-icon-refresh"
size="mini"
@click="handleSynchronism"
v-hasPermi="['mes:md:mditem:edit']"
>同步</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
......@@ -73,6 +83,7 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="单位编码" align="center" prop="measureCode" />
<el-table-column label="单位名称" align="center" prop="measureName" />
<el-table-column label="单位名称说明" align="center" prop="measureNameLone" />
<el-table-column label="是否是主单位" align="center" prop="primaryFlag" >
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.primaryFlag"/>
......@@ -167,7 +178,7 @@
</template>
<script>
import { listUnitmeasure,listPrimaryUnitmeasure, getUnitmeasure, delUnitmeasure, addUnitmeasure, updateUnitmeasure } from "@/api/mes/md/unitmeasure";
import { listUnitmeasure,listPrimaryUnitmeasure, getUnitmeasure, delUnitmeasure, addUnitmeasure, updateUnitmeasure,sapSynUnitmeasure } from "@/api/mes/md/unitmeasure";
export default {
name: "Unitmeasure",
......@@ -190,6 +201,8 @@ export default {
unitmeasureList: [],
//主单位列表
measureOptions: [],
syncLoading: false,
// 弹出层标题
title: "",
// 是否显示弹出层
......@@ -200,6 +213,7 @@ export default {
pageSize: 10,
measureCode: null,
measureName: null,
measureNameLone: null,
primaryFlag: null,
primaryId: null,
changeRate: null,
......@@ -248,6 +262,7 @@ export default {
measureId: null,
measureCode: null,
measureName: null,
measureNameLone: null,
primaryFlag: null,
primaryId: null,
changeRate: null,
......@@ -293,6 +308,18 @@ export default {
this.open = true;
this.title = "修改单位";
});
},
/** 同步SAP */
handleSynchronism() {
this.syncLoading = true;
this.reset();
sapSynUnitmeasure().then(res => {
if(res.code === 200) {
this.$modal.msgSuccess("同步成功");
this.getList();
}
this.syncLoading = false;
});
},
/** 提交按钮 */
submitForm() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment