| | |
| | | import serviceutils from "./serviceutils"; |
| | | const Multipart = require('../utils/Multipart.min'); |
| | | const $f = require('./baserequest'); |
| | | const util = require('../utils/util'); |
| | | |
| | | |
| | | module.exports = { |
| | | /** |
| | |
| | | $f.get(fun1); |
| | | }, |
| | | |
| | | //上传自巡查 |
| | | uploadSelfPatrol: function (userId, taskId, selfPatrol, paths, fun) { |
| | | const fields = [ |
| | | { |
| | | //上传应急自巡查 |
| | | uploadSelfPatrol: function (userId, taskId, selfPatrol,namePairs, paths, fun) { |
| | | const fields = [{ |
| | | name: 'params', |
| | | value: JSON.stringify([selfPatrol]), |
| | | }, |
| | |
| | | name: 'taskId', |
| | | value: taskId, |
| | | }, |
| | | { |
| | | name: 'fileNames', |
| | | value: JSON.stringify(namePairs), |
| | | } |
| | | ]; |
| | | const files = []; |
| | | paths.forEach(p => { |
| | |
| | | r.path1 = r.path1.split(';').map((value, index) => { |
| | | return $f.basePicUrl + value; |
| | | }); |
| | | r._files = serviceutils.formatLedgerPath(r.path1) |
| | | r._fileType = serviceutils.judgeLedgerFileType(r._files) |
| | | } |
| | | cb.success(res); |
| | | }; |
| | | |
| | | $f.get(fun1); |
| | | }, |
| | | }; |
| | | |
| | | // 签署自巡查承诺 |
| | | signPromise: function ( |
| | | userId, |
| | | fun, |
| | | ) { |
| | | let cb = { |
| | | url: '/selfPatrol/promise', |
| | | params: { |
| | | userId: userId, |
| | | }, |
| | | }; |
| | | Object.assign(cb, fun); |
| | | |
| | | $f.post(cb); |
| | | }, |
| | | }; |