Commit 84481144 authored by chenzj's avatar chenzj

新增sap同步计量单位

parent edabc44b
...@@ -56,3 +56,11 @@ export function delUnitmeasure(measureId) { ...@@ -56,3 +56,11 @@ export function delUnitmeasure(measureId) {
method: 'delete' method: 'delete'
}) })
} }
// 同步sap单位
export function sapSynUnitmeasure() {
return request({
url: '/mes/md/unitmeasure/sapSynchro',
method: 'post'
})
}
...@@ -66,6 +66,16 @@ ...@@ -66,6 +66,16 @@
v-hasPermi="['mes:md:unitmeasure:export']" v-hasPermi="['mes:md:unitmeasure:export']"
>导出</el-button> >导出</el-button>
</el-col> </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> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -73,6 +83,7 @@ ...@@ -73,6 +83,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="单位编码" align="center" prop="measureCode" /> <el-table-column label="单位编码" align="center" prop="measureCode" />
<el-table-column label="单位名称" align="center" prop="measureName" /> <el-table-column label="单位名称" align="center" prop="measureName" />
<el-table-column label="单位名称说明" align="center" prop="measureNameLone" />
<el-table-column label="是否是主单位" align="center" prop="primaryFlag" > <el-table-column label="是否是主单位" align="center" prop="primaryFlag" >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.primaryFlag"/> <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.primaryFlag"/>
...@@ -167,7 +178,7 @@ ...@@ -167,7 +178,7 @@
</template> </template>
<script> <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 { export default {
name: "Unitmeasure", name: "Unitmeasure",
...@@ -190,6 +201,8 @@ export default { ...@@ -190,6 +201,8 @@ export default {
unitmeasureList: [], unitmeasureList: [],
//主单位列表 //主单位列表
measureOptions: [], measureOptions: [],
syncLoading: false,
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -200,6 +213,7 @@ export default { ...@@ -200,6 +213,7 @@ export default {
pageSize: 10, pageSize: 10,
measureCode: null, measureCode: null,
measureName: null, measureName: null,
measureNameLone: null,
primaryFlag: null, primaryFlag: null,
primaryId: null, primaryId: null,
changeRate: null, changeRate: null,
...@@ -248,6 +262,7 @@ export default { ...@@ -248,6 +262,7 @@ export default {
measureId: null, measureId: null,
measureCode: null, measureCode: null,
measureName: null, measureName: null,
measureNameLone: null,
primaryFlag: null, primaryFlag: null,
primaryId: null, primaryId: null,
changeRate: null, changeRate: null,
...@@ -293,6 +308,18 @@ export default { ...@@ -293,6 +308,18 @@ export default {
this.open = true; this.open = true;
this.title = "修改单位"; 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() { 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