diff --git a/src/api/process/branchPro.js b/src/api/process/branchPro.js
index 5e077de..3e01e21 100644
--- a/src/api/process/branchPro.js
+++ b/src/api/process/branchPro.js
@@ -10,52 +10,99 @@ export function listType(query) {
}
// 查询详细
-export function getType(dictId) {
+export function getType(orgId) {
return request({
- url: '/system/dict/type/' + dictId,
+ url: '/system/subOrg/' + orgId,
method: 'get'
})
}
// 新增
export function addType(data) {
- console.log(data)
+ let dataList = handle(data)
return request({
- url: '/system/dict/type',
+ url: '/system/subOrg',
method: 'post',
- data: data
+ data: dataList
})
}
// 修改
export function updateType(data) {
+ let dataList = handle(data)
return request({
- url: '/system/dict/type',
+ url: '/system/subOrg',
method: 'put',
- data: data
+ data: dataList
})
}
+//对数据进行处理
+function handle(data) {
+ let dataList = {
+ id:data.id,
+ orgName: data.orgName,
+ address: data.address,
+
+ isDepartment: "1",
+ isProvince: data.isProvince,
+ orgHeadUserId: data.orgHeadUserId,
+ orgHeadUserName: data.orgHeadUserName,
+ parentId: data.parentId,
+ roleList: [
+ {
+ "deptRoleId": 1,
+ "userId": data.manager
+ },
+ {
+ "deptRoleId": 2,
+ "userId": data.safety
+ },
+ {
+ "deptRoleId": 3,
+ "userId": data.quality
+ },
+ {
+ "deptRoleId": 4,
+ "userId": data.pro
+ },
+ {
+ "deptRoleId": 5,
+ "userId": data.mechanic
+ },
+ {
+ "deptRoleId": 6,
+ "userId": data.documenter
+ },
+ {
+ "deptRoleId": 7,
+ "userId": data.construction
+ },
+ {
+ "deptRoleId": 8,
+ "userId": data.materialman
+ },
+ {
+ "deptRoleId": 9,
+ "userId": data.other
+ }
+ ]
+ }
+ return dataList;
+}
+
// 删除
-export function delType(dictId) {
+export function delType(orgId) {
return request({
- url: '/system/dict/type/' + dictId,
+ url: '/system/subOrg/' + orgId,
method: 'delete'
})
}
-// 刷新
-export function refreshCache() {
+// 审批/提交/撤回
+export function changeStatus(orgId,reviewerStatus) {
return request({
- url: '/system/dict/type/refreshCache',
- method: 'delete'
- })
-}
-
-// 获取选择框列表
-export function optionselect() {
- return request({
- url: '/system/dict/type/optionselect',
- method: 'get'
+ url: '/system/subOrg/changeStatus/'+orgId+"/"+reviewerStatus,
+ method: 'put'
})
}
diff --git a/src/views/process/branchPro/index.vue b/src/views/process/branchPro/index.vue
index b6a821e..6fa3a41 100644
--- a/src/views/process/branchPro/index.vue
+++ b/src/views/process/branchPro/index.vue
@@ -43,11 +43,9 @@