oaTool.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. layui.define(['tool'], function (exports) {
  2. const layer = layui.layer, tool = layui.tool, form = layui.form, table = layui.table, upload = layui.upload;
  3. // 查找指定的元素在数组中的位置
  4. Array.prototype.indexOf = function (val) {
  5. for (var i = 0; i < this.length; i++) {
  6. if (this[i] == val) {
  7. return i;
  8. }
  9. }
  10. return -1;
  11. };
  12. // 通过索引删除数组元素
  13. Array.prototype.remove = function (val) {
  14. var index = this.indexOf(val);
  15. if (index > -1) {
  16. this.splice(index, 1);
  17. }
  18. };
  19. //格式化文件大小
  20. function renderSize(value) {
  21. if (null == value || value == '') {
  22. return "0 Bytes";
  23. }
  24. var unitArr = new Array("Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
  25. var index = 0;
  26. var srcsize = parseFloat(value);
  27. index = Math.floor(Math.log(srcsize) / Math.log(1024));
  28. var size = srcsize / Math.pow(1024, index);
  29. size = size.toFixed(2);//保留的小数位数
  30. return size + unitArr[index];
  31. }
  32. const obj = {
  33. addFile: function (options) {
  34. console.log(options)
  35. let that = this;
  36. let settings = {
  37. type: 0,
  38. btn: 'uploadBtn',
  39. box: 'fileBox',
  40. url: "/admin/api/upload",
  41. accept: 'file', //普通文件
  42. exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z|txt|wps|avi|wmv|mpg|mov|rm|swf|flv|mp4|dwg|dxf|dwt|xmind', //只允许上传文件格式
  43. colmd: 4,
  44. isSave: false,
  45. uidDelete: false,
  46. ajaxSave: null,
  47. ajaxDelete: null
  48. };
  49. console.log(123123)
  50. let opts = $.extend({}, settings, options);
  51. let box = $('#' + opts.box);
  52. let boxInput = box.find('[data-type="file"]');
  53. console.log("wozaizheliyo")
  54. //删除
  55. box.on('click', '.btn-delete', function () {
  56. // let file_id = $(this).data('id');
  57. let file_id = $(this).parent().parent().data('id');
  58. let uid = $(this).data('uid');
  59. // if (uid != login_admin && opts.uidDelete == true) {
  60. // layer.msg('你不是该文件的上传人,无权限删除');
  61. // return false;
  62. // }
  63. let idsStr = boxInput.val(), idsArray = [];
  64. if (typeof idsStr !== 'undefined' && idsStr != '') {
  65. idsArray = idsStr.split(",");
  66. idsArray.remove(file_id);
  67. }
  68. layer.confirm('确定删除该附件吗?', {
  69. icon: 3,
  70. title: '提示'
  71. }, function (index) {
  72. if (typeof (opts.ajaxDelete) === "function") {
  73. //ajax删除
  74. if (opts.type == 1) {
  75. opts.ajaxDelete(file_id);
  76. } else {
  77. opts.ajaxDelete(idsArray.join(','));
  78. }
  79. } else {
  80. //虚拟删除
  81. boxInput.val(idsArray.join(','));
  82. $('#fileItem' + file_id).remove();
  83. }
  84. layer.close(index);
  85. });
  86. })
  87. //多附件上传
  88. upload.render({
  89. elem: '#' + opts.btn,
  90. url: opts.url,
  91. accept: opts.accept,
  92. exts: opts.exts,
  93. multiple: true,
  94. before: function (obj) {
  95. layer.msg('上传中...', {icon: 16, time: 0});
  96. },
  97. done: function (res) {
  98. if (res.code == 0) {
  99. //上传成功
  100. if (opts.type == 0) {
  101. let idsStr = boxInput.val(), idsArray = [];
  102. if (typeof idsStr !== 'undefined' && idsStr != '') {
  103. idsArray = idsStr.split(",");
  104. }
  105. idsArray.push(res.data.id);
  106. let filesize = renderSize(res.data.filesize);
  107. let type_icon = 'icon-sucaiziyuan';
  108. let view_btn = '<a class="blue" href="' + res.data.filepath + '" download="' + res.data.name + '" target="_blank" title="下载查看"><i class="iconfont icon-tuiguangshezhi"></i></a>';
  109. if (res.data.fileext == 'pdf') {
  110. type_icon = 'icon-lunwenguanli';
  111. view_btn = '<span class="file-view-pdf blue" data-href="' + res.data.filepath + '" title="在线查看"><i class="iconfont icon-yuejuan"></i></span>';
  112. }
  113. if (res.data.fileext == 'jpg' || res.data.fileext == 'jpeg' || res.data.fileext == 'png' || res.data.fileext == 'gif') {
  114. type_icon = 'icon-sucaiguanli';
  115. view_btn = '<span class="file-view-img blue" data-href="' + res.data.filepath + '" title="在线查看"><i class="iconfont icon-tupianguanli"></i></span>';
  116. }
  117. let temp = `<div class="layui-col-md${opts.colmd}" id="fileItem${res.data.id}">
  118. <div class="file-card">
  119. <i class="file-icon iconfont ${type_icon}"></i>
  120. <div class="file-info">
  121. <div class="file-title">${res.data.name}</div>
  122. <div class="file-ops">${filesize},一分钟前</div>
  123. </div>
  124. <div class="file-tool">${view_btn}<span class="btn-delete red" data-id="${res.data.id}" title="删除"><i class="iconfont icon-shanchu"></i></span></div>
  125. </div>
  126. </div>`;
  127. boxInput.val(idsArray.join(','));
  128. box.append(temp);
  129. if (typeof (opts.ajaxSave) === "function" && opts.isSave == true) {
  130. opts.ajaxSave(idsArray.join(','));
  131. } else {
  132. layer.msg(res.msg);
  133. }
  134. }
  135. if (opts.type == 1) {
  136. if (typeof (opts.ajaxSave) === "function" && opts.isSave == true) {
  137. opts.ajaxSave(res);
  138. }
  139. }
  140. } else {
  141. layer.msg(res.msg);
  142. }
  143. }
  144. });
  145. },
  146. //选择部门
  147. departmentPicker: function (type, callback) {
  148. let select_type = type == 1 ? 'radio' : 'checkbox', departmentTable;
  149. layer.open({
  150. type: 1,
  151. title: '选择部门',
  152. area: ['500px', '536px'],
  153. content: `<div style="width:468px; height:420px; padding:12px;">
  154. <div id="departmentBox"></div>
  155. </div>`,
  156. success: function () {
  157. departmentTable = table.render({
  158. elem: '#departmentBox'
  159. , url: "/api/index/get_department"
  160. , page: false //开启分页
  161. , cols: [[
  162. {type: select_type, title: '选择'}
  163. , {field: 'id', width: 80, title: '编号', align: 'center'}
  164. , {field: 'title', title: '部门名称'}
  165. ]]
  166. });
  167. },
  168. btn: ['确定'],
  169. btnAlign: 'c',
  170. yes: function () {
  171. var checkStatus = table.checkStatus(departmentTable.config.id);
  172. var data = checkStatus.data;
  173. if (data.length > 0) {
  174. callback(data);
  175. layer.closeAll();
  176. } else {
  177. layer.msg('请选择部门');
  178. return;
  179. }
  180. }
  181. })
  182. },
  183. //选择岗位
  184. positionPicker: function (type, callback) {
  185. let select_type = type == 1 ? 'radio' : 'checkbox', positionTable;
  186. layer.open({
  187. title: '选择岗位',
  188. type: 1,
  189. area: ['390px', '436px'],
  190. content: '<div style="padding:12px"><div id="positionBox"></div></div>',
  191. success: function () {
  192. positionTable = table.render({
  193. elem: '#positionBox'
  194. , url: "/api/index/get_position"
  195. , page: false //开启分页
  196. , cols: [[
  197. {type: select_type, title: '选择'}
  198. , {field: 'id', width: 80, title: '编号', align: 'center'}
  199. , {field: 'name', title: '岗位名称'}
  200. ]]
  201. });
  202. },
  203. btn: ['确定'],
  204. btnAlign: 'c',
  205. yes: function () {
  206. var checkStatus = table.checkStatus(positionTable.config.id);
  207. var data = checkStatus.data;
  208. if (data.length > 0) {
  209. callback(data);
  210. layer.closeAll();
  211. } else {
  212. layer.msg('请选择岗位');
  213. return;
  214. }
  215. }
  216. })
  217. },
  218. //选择服务类型
  219. servicePicker: function (type, callback) {
  220. let select_type = type == 1 ? 'radio' : 'checkbox', departmentTable;
  221. var serviceTable;
  222. layer.open({
  223. title: '选择服务类型',
  224. area: ['500px', '536px'],
  225. type: 1,
  226. content: '<div class="picker-table"><div id="serviceTable"></div></div>',
  227. success: function () {
  228. serviceTable = table.render({
  229. elem: '#serviceTable'
  230. , url: '/api/index/get_services'
  231. , page: false
  232. , cols: [[
  233. {type: select_type, title: '选择'}
  234. , {field: 'id', width: 100, title: '编号', align: 'center'}
  235. , {field: 'title', title: '服务名称'}
  236. ]]
  237. });
  238. },
  239. btn: ['确定'],
  240. btnAlign: 'c',
  241. yes: function () {
  242. var checkStatus = table.checkStatus(serviceTable.config.id);
  243. var data = checkStatus.data;
  244. if (data.length > 0) {
  245. callback(data);
  246. layer.closeAll();
  247. } else {
  248. layer.msg('请选择服务类型');
  249. return;
  250. }
  251. }
  252. })
  253. },
  254. //选择委托单位
  255. customerPicker: function (callback) {
  256. var customeTable;
  257. layer.open({
  258. title: '选择委托单位',
  259. area: ['600px', '580px'],
  260. type: 1,
  261. content: '<div class="picker-table">\
  262. <form class="layui-form pb-2">\
  263. <div class="layui-input-inline" style="width:480px;">\
  264. <input type="text" name="keywords" placeholder="委托单位" class="layui-input" autocomplete="off" />\
  265. </div>\
  266. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_customer">提交搜索</button>\
  267. </form>\
  268. <div id="customerTable"></div></div>',
  269. success: function () {
  270. customeTable = table.render({
  271. elem: '#customerTable'
  272. , url: '/admin/project.cost/get_customer'
  273. , page: true //开启分页
  274. , limit: 10
  275. , cols: [[
  276. {type: 'radio', title: '选择'},
  277. {field: 'id', width: 80, title: '编号', align: 'center'},
  278. {field: 'title', title: '评审单位名称', align: 'center'},
  279. {field: 'nickname', title: '评审单位负责人', align: 'center'},
  280. {field: 'mobile', title: '评审单位负责人电话', align: 'center'},
  281. {field: 'address', title: ' 评审单位地址', align: 'center'}
  282. ]]
  283. });
  284. //客户搜索提交
  285. form.on('submit(search_customer)', function (data) {
  286. customeTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  287. return false;
  288. });
  289. },
  290. btn: ['确定'],
  291. btnAlign: 'c',
  292. yes: function () {
  293. var checkStatus = table.checkStatus(customeTable.config.id);
  294. var data = checkStatus.data;
  295. if (data.length > 0) {
  296. callback(data[0]);
  297. layer.closeAll();
  298. } else {
  299. layer.msg('请先选择评审单位');
  300. return false;
  301. }
  302. }
  303. })
  304. },
  305. //请款选择造价项目
  306. ProjectPicker: function (callback) {
  307. var projectTable;
  308. layer.open({
  309. title: '选择造价项目',
  310. area: ['600px', '580px'],
  311. type: 1,
  312. content: '<div class="picker-table">\
  313. <form class="layui-form pb-2">\
  314. <div class="layui-input-inline" style="width:480px;">\
  315. <input type="text" name="keywords" placeholder="造价项目" class="layui-input" autocomplete="off" />\
  316. </div>\
  317. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_customer">提交搜索</button>\
  318. </form>\
  319. <div id="customerTable"></div></div>',
  320. success: function () {
  321. projectTable = table.render({
  322. elem: '#customerTable'
  323. , url: '/admin/project.api/get_project'
  324. , page: true //开启分页
  325. , limit: 10
  326. , cols: [[
  327. {type: 'radio', title: '选择'},
  328. {field: 'id', width: 80, title: '编号', align: 'center'},
  329. {field: 'project_name', title: '项目名称', align: 'center'},
  330. {field: 'sent_review_cost', title: '送审服务费', align: 'center'},
  331. {field: 'entrust_unit_name', title: '委托单位', align: 'center'},
  332. ]]
  333. });
  334. //客户搜索提交
  335. form.on('submit(search_customer)', function (data) {
  336. projectTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  337. return false;
  338. });
  339. },
  340. btn: ['确定'],
  341. btnAlign: 'c',
  342. yes: function () {
  343. var checkStatus = table.checkStatus(projectTable.config.id);
  344. var data = checkStatus.data;
  345. if (data.length > 0) {
  346. callback(data[0]);
  347. layer.closeAll();
  348. } else {
  349. layer.msg('请先选择项目');
  350. return false;
  351. }
  352. }
  353. })
  354. },
  355. //选择造价项目
  356. addProject: function (callback) {
  357. var projectTable;
  358. layer.open({
  359. title: '选择造价项目',
  360. area: ['600px', '580px'],
  361. type: 1,
  362. content: '<div class="picker-table">\
  363. <form class="layui-form pb-2">\
  364. <div class="layui-input-inline" style="width:480px;">\
  365. <input type="text" name="keywords" placeholder="造价项目" class="layui-input" autocomplete="off" />\
  366. </div>\
  367. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_customer">提交搜索</button>\
  368. </form>\
  369. <div id="customerTable"></div></div>',
  370. success: function () {
  371. projectTable = table.render({
  372. elem: '#customerTable'
  373. , url: '/admin/project.api/get_self_project'
  374. , page: true //开启分页
  375. , limit: 10
  376. , cols: [[
  377. {type: 'radio', title: '选择'},
  378. {field: 'id', width: 80, title: '编号', align: 'center'},
  379. {field: 'project_name', title: '项目名称', align: 'center'},
  380. {field: 'entrust_unit_name', title: '委托单位', align: 'center'},
  381. {field: 'review_unit_name', title: '评审单位', align: 'center'},
  382. ]]
  383. });
  384. //客户搜索提交
  385. form.on('submit(search_customer)', function (data) {
  386. projectTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  387. return false;
  388. });
  389. },
  390. btn: ['确定'],
  391. btnAlign: 'c',
  392. yes: function () {
  393. var checkStatus = table.checkStatus(projectTable.config.id);
  394. var data = checkStatus.data;
  395. if (data.length > 0) {
  396. callback(data[0]);
  397. layer.closeAll();
  398. } else {
  399. layer.msg('请先选择项目');
  400. return false;
  401. }
  402. }
  403. })
  404. },
  405. //选择合同
  406. contractPicker: function (callback) {
  407. var contractTable;
  408. layer.open({
  409. title: '选择合同',
  410. area: ['720px', '580px'],
  411. type: 1,
  412. content: '<div class="picker-table">\
  413. <form class="layui-form pb-2">\
  414. <div class="layui-input-inline" style="width:600px;">\
  415. <input type="text" name="keywords" placeholder="合同名称" class="layui-input" autocomplete="off" />\
  416. </div>\
  417. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_contract">提交搜索</button>\
  418. </form>\
  419. <div id="contractTable"></div></div>',
  420. success: function () {
  421. contractTable = table.render({
  422. elem: '#contractTable'
  423. , url: '/contract/api/get_contract'
  424. , page: true //开启分页
  425. , limit: 10
  426. , cols: [[
  427. {type: 'radio', title: '选择'}
  428. , {field: 'code', width: 168, title: '合同编号', align: 'center'}
  429. , {field: 'name', title: '合同名称'}
  430. , {field: 'customer_name', title: '客户名称', width: 240}
  431. ]]
  432. });
  433. //合同搜索提交
  434. form.on('submit(search_contract)', function (data) {
  435. contractTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  436. return false;
  437. });
  438. },
  439. btn: ['确定'],
  440. btnAlign: 'c',
  441. yes: function () {
  442. var checkStatus = table.checkStatus(contractTable.config.id);
  443. var data = checkStatus.data;
  444. if (data.length > 0) {
  445. callback(data[0]);
  446. layer.closeAll();
  447. } else {
  448. layer.msg('请先选择合同');
  449. return false;
  450. }
  451. }
  452. })
  453. },
  454. //选择项目
  455. // projectPicker: function (callback) {
  456. // var projectTable;
  457. // let projectLayer = layer.open({
  458. // title: '选择项目',
  459. // area: ['600px', '580px'],
  460. // type: 1,
  461. // content: '<div class="picker-table">\
  462. // <form class="layui-form pb-2">\
  463. // <div class="layui-input-inline" style="width:480px;">\
  464. // <input type="text" name="keywords" placeholder="项目名称" class="layui-input" autocomplete="off" />\
  465. // </div>\
  466. // <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_project">提交搜索</button>\
  467. // </form>\
  468. // <div id="projectTable"></div></div>',
  469. // success: function () {
  470. // projectTable = table.render({
  471. // elem: '#projectTable'
  472. // , url: '/project/api/get_project'
  473. // , page: true //开启分页
  474. // , limit: 10
  475. // , cols: [[
  476. // {type: 'radio', title: '选择'}
  477. // , {field: 'id', width: 100, title: '编号', align: 'center'}
  478. // , {field: 'title', title: '项目名称'}
  479. // ]]
  480. // });
  481. // //合同搜索提交
  482. // form.on('submit(search_project)', function (data) {
  483. // projectTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  484. // return false;
  485. // });
  486. // },
  487. // btn: ['确定'],
  488. // btnAlign: 'c',
  489. // yes: function () {
  490. // var checkStatus = table.checkStatus(projectTable.config.id);
  491. // var data = checkStatus.data;
  492. // if (data.length > 0) {
  493. // callback(data[0]);
  494. // layer.close(projectLayer);
  495. // } else {
  496. // layer.msg('请先选择项目');
  497. // return false;
  498. // }
  499. // }
  500. // })
  501. // },
  502. //选择任务
  503. getEntrust: function (callback) {
  504. var entrustTable;
  505. let taskLayer = layer.open({
  506. title: '选择委托单位',
  507. area: ['600px', '580px'],
  508. type: 1,
  509. content: '<div class="picker-table">\
  510. <form class="layui-form pb-2">\
  511. <div class="layui-input-inline" style="width:480px;">\
  512. <input type="text" name="keywords" placeholder="委托单位" class="layui-input" autocomplete="off" />\
  513. </div>\
  514. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="entrustSearch">提交搜索</button>\
  515. </form>\
  516. <div id="entrustTable"></div></div>',
  517. success: function () {
  518. entrustTable = table.render({
  519. elem: '#entrustTable'
  520. , url: '/admin/project.api/get_entrust'
  521. , page: true //开启分页
  522. , limit: 10
  523. , cols: [[
  524. {type: 'radio', title: '选择'},
  525. {field: 'id', width: 80, title: '编号', align: 'center'},
  526. {field: 'title', title: '评审单位名称', align: 'center'},
  527. {field: 'nickname', title: '评审单位负责人', align: 'center'},
  528. {field: 'mobile', title: '评审单位负责人电话', align: 'center'},
  529. {field: 'address', title: ' 评审单位地址', align: 'center'}
  530. ]]
  531. });
  532. //合同搜索提交
  533. form.on('submit(entrustSearch)', function (data) {
  534. entrustTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  535. return false;
  536. });
  537. },
  538. btn: ['确定'],
  539. btnAlign: 'c',
  540. yes: function () {
  541. var checkStatus = table.checkStatus(entrustTable.config.id);
  542. var data = checkStatus.data;
  543. if (data.length > 0) {
  544. callback(data[0]);
  545. layer.close(taskLayer);
  546. } else {
  547. layer.msg('请先选择任务主题');
  548. return false;
  549. }
  550. }
  551. })
  552. }
  553. };
  554. //选择部门
  555. $('body').on('click', '.picker-depament', function () {
  556. let that = $(this);
  557. let callback = function (data) {
  558. that.val(data[0].title);
  559. that.next().val(data[0].id);
  560. }
  561. obj.departmentPicker(1, callback);
  562. });
  563. $('body').on('click', '.picker-depaments', function () {
  564. let that = $(this), ids = [], names = [];
  565. let callback = function (data) {
  566. for (var i = 0; i < data.length; i++) {
  567. ids.push(data[i].id);
  568. names.push(data[i].title);
  569. }
  570. that.val(names.join(','));
  571. that.next().val(ids.join(','));
  572. }
  573. obj.departmentPicker(2, callback);
  574. });
  575. //选择岗位
  576. $('body').on('click', '.picker-position', function () {
  577. let that = $(this);
  578. let callback = function (data) {
  579. that.val(data[0].name);
  580. that.next().val(data[0].id);
  581. }
  582. obj.positionPicker(1, callback);
  583. });
  584. $('body').on('click', '.picker-positions', function () {
  585. let that = $(this), ids = [], names = [];
  586. let callback = function (data) {
  587. for (var i = 0; i < data.length; i++) {
  588. ids.push(data[i].id);
  589. names.push(data[i].name);
  590. }
  591. that.val(names.join(','));
  592. that.next().val(ids.join(','));
  593. }
  594. obj.positionPicker(2, callback);
  595. });
  596. //选择服务
  597. $('body').on('click', '.picker-service', function () {
  598. let that = $(this);
  599. let callback = function (data) {
  600. that.val(data[0].title);
  601. that.next().val(data[0].id);
  602. }
  603. obj.servicePicker(1, callback);
  604. });
  605. $('body').on('click', '.picker-services', function () {
  606. let that = $(this), ids = [], names = [];
  607. let callback = function (data) {
  608. for (var i = 0; i < data.length; i++) {
  609. ids.push(data[i].id);
  610. names.push(data[i].title);
  611. }
  612. that.val(names.join(','));
  613. that.next().val(ids.join(','));
  614. }
  615. obj.servicePicker(2, callback);
  616. });
  617. //选择客户
  618. $('body').on('click', '.picker-customer', function () {
  619. let that = $(this);
  620. let callback = function (data) {
  621. that.val(data.name);
  622. that.next().val(data.id);
  623. }
  624. obj.customerPicker(callback);
  625. });
  626. //选择合同
  627. $('body').on('click', '.picker-contract', function () {
  628. let that = $(this);
  629. let callback = function (data) {
  630. that.val(data.name);
  631. that.next().val(data.id);
  632. }
  633. obj.contractPicker(callback);
  634. });
  635. //选择项目
  636. $('body').on('click', '.picker-project', function () {
  637. let that = $(this);
  638. let callback = function (data) {
  639. that.val(data.title);
  640. that.next().val(data.id);
  641. }
  642. obj.projectPicker(callback);
  643. });
  644. exports('oaTool', obj);
  645. });