提交 417d2970 编写于 作者: tony001's avatar tony001

增加切换组织部门功能

上级 5726a2c3
......@@ -22,6 +22,7 @@
</div>
</template>
<script lang = 'ts'>
import { Http } from '@/utils/http/http';
import { Vue, Component, Inject } from "vue-property-decorator";
@Component({})
......@@ -110,17 +111,33 @@ export default class AppOrgSector extends Vue {
let item: any = this.selectedOrgArray.find((_item: any) => {
return _item.srforgsectorid === data;
});
if (item.srforgsectorid && item.srforgsectorname) {
this.selectedOrgId = item.srforgsectorid;
this.selectedOrgName = item.srforgsectorname;
this.reload();
this.switchDepartment(data).then((response:any) =>{
if (response.status == 200) {
if (item.srforgsectorid && item.srforgsectorname) {
this.selectedOrgId = item.srforgsectorid;
this.selectedOrgName = item.srforgsectorname;
}
this.updateStoreOrgData(item);
this.reload();
}else{
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data?response.data.message:(this.$t('components.appOrgSector.errorSwitch') as string) });
}
}).catch((error:any) =>{
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('components.appOrgSector.errorSwitch') as string) });
})
}
}
this.updateStoreOrgData(item);
/**
* 调用远端切换部门接口
*
* @memberof AppOrgSector
*/
public async switchDepartment(data:any){
return await Http.getInstance().post(`/oumaps/switch`,data,false);
}
/**
* 更新仓库Org信息
* 更新仓库部门信息
*
* @memberof AppOrgSector
*/
......
......@@ -11,6 +11,10 @@ export default {
indexPage: 'home page',
continue: 'to continue browsing',
},
appOrgSector:{
successSwitch:'The switch was successful',
errorSwitch:'The switchover failed',
},
appAutocomplete: {
error: 'Error',
miss: 'Missing parameter ',
......
......@@ -11,6 +11,10 @@ export default {
indexPage: '首页',
continue: '继续浏览',
},
appOrgSector:{
successSwitch:'切换成功',
errorSwitch:'切换失败',
},
appAutocomplete: {
error: '错误',
miss: '缺少参数',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册