diff --git a/api/app/lib/controllers/organization/user.js b/api/app/lib/controllers/organization/user.js index 95bb780..26fad93 100644 --- a/api/app/lib/controllers/organization/user.js +++ b/api/app/lib/controllers/organization/user.js @@ -62,7 +62,7 @@ const MD5 = require('crypto-js/md5'); // } // } -async function getDepMessage(ctx, next) { +async function getDepMessage (ctx, next) { let error = { name: 'FindError', message: '获取部门列表失败' }; let rslt = []; try { @@ -105,7 +105,7 @@ async function getDepMessage(ctx, next) { } } -async function createDept(ctx, next) { +async function createDept (ctx, next) { const models = ctx.fs.dc.models; try { let rslt = ctx.request.body; @@ -119,7 +119,7 @@ async function createDept(ctx, next) { } } -async function updateDept(ctx, next) { +async function updateDept (ctx, next) { try { const models = ctx.fs.dc.models; const { id } = ctx.params; @@ -137,7 +137,7 @@ async function updateDept(ctx, next) { } } -async function delDept(ctx, next) { +async function delDept (ctx, next) { let errMsg = "删除部门失败"; try { const models = ctx.fs.dc.models; @@ -167,7 +167,7 @@ async function delDept(ctx, next) { } } -async function getUser(ctx, next) { +async function getUser (ctx, next) { try { const models = ctx.fs.dc.models; const { depId } = ctx.params; @@ -207,7 +207,7 @@ async function getUser(ctx, next) { } } -async function creatUser(ctx, next) { +async function creatUser (ctx, next) { let errMsg = "新建用户失败" try { const models = ctx.fs.dc.models; @@ -249,7 +249,7 @@ async function creatUser(ctx, next) { } -async function updateUser(ctx, next) { +async function updateUser (ctx, next) { let errMsg = "修改用户失败" try { const models = ctx.fs.dc.models; @@ -293,7 +293,7 @@ async function updateUser(ctx, next) { } } -async function deleteUser(ctx, next) { +async function deleteUser (ctx, next) { try { const models = ctx.fs.dc.models; const { ids } = ctx.params; @@ -315,7 +315,7 @@ async function deleteUser(ctx, next) { } } -async function resetPwd(ctx, next) { +async function resetPwd (ctx, next) { try { const models = ctx.fs.dc.models; const { id } = ctx.params; @@ -342,7 +342,7 @@ async function resetPwd(ctx, next) { * @params {userId-用户Id} ctx * @request.body {password-用户新密码} ctx */ -async function updateUserPassword(ctx, next) { +async function updateUserPassword (ctx, next) { try { const models = ctx.fs.dc.models; const { userId } = ctx.params; @@ -376,7 +376,7 @@ async function updateUserPassword(ctx, next) { } } -async function getStructuresUsers(ctx, next) { +async function getStructuresUsers (ctx, next) { try { const models = ctx.fs.dc.models; @@ -385,7 +385,11 @@ async function getStructuresUsers(ctx, next) { delete: false }, attributes: ['id', 'name', 'username', 'structure'], - order: [['id', 'asc']] + order: [['id', 'asc']], + include: [{ + model: models.Department, + attributes: ['id', 'name',], + }] }) let structs = await models.Project.findAll({ @@ -398,7 +402,7 @@ async function getStructuresUsers(ctx, next) { rslt.push({ id: s.id, name: s.name, - users: userRes.filter(x => x.structure && x.structure.find(v => v == s.id)).map(d => { return { id: d.id, name: d.name } }) + users: userRes.filter(x => x.structure && x.structure.find(v => v == s.id)).map(d => { return { id: d.id, name: d.name, department: d.department } }) }); }) ctx.status = 200; diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index 3c83d91..7133fdf 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -1,5 +1,5 @@ // package/troubleshooting/shootingForm/index.js -import { getPatrolRecordIssueHandleById, getStructuresUsers } from "../../../utils/getApiUrl"; +import { getPatrolRecordIssueHandleById, getStructuresUsers, editPatrolRecordIssueHandle } from "../../../utils/getApiUrl"; import { Request } from "../../../common"; const moment = require("../../../utils/moment"); @@ -248,9 +248,12 @@ Page({ nextState = 2 confirmData = { ...confirmData, - + } } + Request.put(editPatrolRecordIssueHandle(this.data.shootingid), confirmData).then(res => { + + }) }, /** diff --git a/weapp/utils/getApiUrl.js b/weapp/utils/getApiUrl.js index 4ebde63..154285b 100644 --- a/weapp/utils/getApiUrl.js +++ b/weapp/utils/getApiUrl.js @@ -43,4 +43,8 @@ exports.getPatrolRecordIssueHandleById = (id) => { exports.getStructuresUsers = () => { return `/structures/users` +} + +exports.editPatrolRecordIssueHandle = (id) => { + return '/patrolRecord/issue/handle/' + id } \ No newline at end of file