Browse Source

用户关注结构物返回部门信息

master
巴林闲侠 2 years ago
parent
commit
6e46976a69
  1. 8
      api/app/lib/controllers/organization/user.js
  2. 5
      weapp/package/troubleshooting/shootingForm/index.js
  3. 4
      weapp/utils/getApiUrl.js

8
api/app/lib/controllers/organization/user.js

@ -385,7 +385,11 @@ async function getStructuresUsers(ctx, next) {
delete: false delete: false
}, },
attributes: ['id', 'name', 'username', 'structure'], attributes: ['id', 'name', 'username', 'structure'],
order: [['id', 'asc']] order: [['id', 'asc']],
include: [{
model: models.Department,
attributes: ['id', 'name',],
}]
}) })
let structs = await models.Project.findAll({ let structs = await models.Project.findAll({
@ -398,7 +402,7 @@ async function getStructuresUsers(ctx, next) {
rslt.push({ rslt.push({
id: s.id, id: s.id,
name: s.name, 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; ctx.status = 200;

5
weapp/package/troubleshooting/shootingForm/index.js

@ -1,5 +1,5 @@
// package/troubleshooting/shootingForm/index.js // package/troubleshooting/shootingForm/index.js
import { getPatrolRecordIssueHandleById, getStructuresUsers } from "../../../utils/getApiUrl"; import { getPatrolRecordIssueHandleById, getStructuresUsers, editPatrolRecordIssueHandle } from "../../../utils/getApiUrl";
import { Request } from "../../../common"; import { Request } from "../../../common";
const moment = require("../../../utils/moment"); const moment = require("../../../utils/moment");
@ -251,6 +251,9 @@ Page({
} }
} }
Request.put(editPatrolRecordIssueHandle(this.data.shootingid), confirmData).then(res => {
})
}, },
/** /**

4
weapp/utils/getApiUrl.js

@ -44,3 +44,7 @@ exports.getPatrolRecordIssueHandleById = (id) => {
exports.getStructuresUsers = () => { exports.getStructuresUsers = () => {
return `/structures/users` return `/structures/users`
} }
exports.editPatrolRecordIssueHandle = (id) => {
return '/patrolRecord/issue/handle/' + id
}
Loading…
Cancel
Save