detail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <template>
  2. <view class="pages">
  3. <view class="vtitle">检测申请方填写</view>
  4. <view class="form_group">
  5. <view class="lable">委托单编号</view>
  6. <view class="tag">
  7. <text class="span">{{ item.wt_num }}</text>
  8. <text class="icon more">&#xe631;</text>
  9. </view>
  10. </view>
  11. <view class="form_group">
  12. <view class="lable">标题</view>
  13. <view class="tag">
  14. <text class="span">{{ item.title }}</text>
  15. <text class="icon more">&#xe631;</text>
  16. </view>
  17. </view>
  18. <view class="form_group">
  19. <view class="lable">申请单位/部门</view>
  20. <view class="tag">
  21. <text class="span">{{ item.dept }}</text>
  22. <text class="icon more">&#xe631;</text>
  23. </view>
  24. </view>
  25. <view class="form_group">
  26. <view class="lable">试验目的</view>
  27. <view class="tag">
  28. <text class="span">{{ item.purpose }}</text>
  29. <text class="icon more">&#xe631;</text>
  30. </view>
  31. </view>
  32. <view class="form_group">
  33. <view class="lable">申请人</view>
  34. <view class="tag">
  35. <text class="span">{{ item.applicant }}</text>
  36. <text class="icon more">&#xe631;</text>
  37. </view>
  38. </view>
  39. <view class="form_group">
  40. <view class="lable">电话</view>
  41. <view class="tag">
  42. <text class="span">{{ item.tel }}</text>
  43. <text class="icon more">&#xe631;</text>
  44. </view>
  45. </view>
  46. <view class="form_group">
  47. <view class="lable">试验部门</view>
  48. <view class="tag">
  49. <text class="span">{{ item.test_dept }}</text>
  50. <text class="icon more">&#xe631;</text>
  51. </view>
  52. </view>
  53. <view class="form_group">
  54. <view class="lable">所属项目</view>
  55. <view class="tag">
  56. <text class="span">{{ item.item }}</text>
  57. <text class="icon more">&#xe631;</text>
  58. </view>
  59. </view>
  60. <view class="form_group">
  61. <view class="lable">试验类型</view>
  62. <view class="tag">
  63. <text class="span">
  64. <text>{{ item.product }}</text>
  65. /
  66. <text>{{ item.experiment_type }}</text>
  67. </text>
  68. <text class="icon more">&#xe631;</text>
  69. </view>
  70. </view>
  71. <view class="form_group">
  72. <view class="lable">项目编号</view>
  73. <view class="tag">
  74. <text class="icon more">&#xe631;</text>
  75. <text class="span">{{ item.item_num }}</text>
  76. </view>
  77. </view>
  78. <view class="form_group">
  79. <view class="lable">结果形式</view>
  80. <view class="tag"><u-subsection :list="radio" :current="current" @change="change"></u-subsection></view>
  81. </view>
  82. <view class="form_group">
  83. <view class="lable">模板</view>
  84. <view class="tag">
  85. <text class="icon more">&#xe631;</text>
  86. <text class="span">{{ item.item_num }}</text>
  87. </view>
  88. </view>
  89. <view class="vtitle">设置审批人员</view>
  90. <view class="form_group" @click="select('1')">
  91. <view class="lable">需求审核-产品经理或主管人员</view>
  92. <view class="tag">
  93. <text class="span">{{ item.WTXQSH }}</text>
  94. <text class="icon more">&#xe631;</text>
  95. </view>
  96. </view>
  97. <view class="form_group" @click="select('2')">
  98. <view class="lable">试验审核-试验对接人</view>
  99. <view class="tag">
  100. <text class="span">{{ item.WTSYSH }}</text>
  101. <text class="icon more">&#xe631;</text>
  102. </view>
  103. </view>
  104. <view class="form_group" @click="select('3')">
  105. <view class="lable">需求批准-本部门领导</view>
  106. <view class="tag">
  107. <text class="span">{{ item.WTXQPZ }}</text>
  108. <text class="icon more">&#xe631;</text>
  109. </view>
  110. </view>
  111. <view class="form_group" @click="select('4')">
  112. <view class="lable">试验批准</view>
  113. <view class="tag">
  114. <text class="span">{{ item.WTSYPZ }}</text>
  115. <text class="icon more">&#xe631;</text>
  116. </view>
  117. </view>
  118. <view class="form_group" @click="select('5')">
  119. <view class="lable">任务分派-任务分派人</view>
  120. <view class="tag">
  121. <text class="span">{{ item.WTRWFP }}</text>
  122. <text class="icon more">&#xe631;</text>
  123. </view>
  124. </view>
  125. <view class="vtitle">样机</view>
  126. <view class="form_group">
  127. <view class="lable">GH560</view>
  128. <view class="tag">
  129. <text class="span">XH890656565556</text>
  130. <text class="icon more">&#xe631;</text>
  131. </view>
  132. </view>
  133. <view class="form_group">
  134. <view class="lable">GH560</view>
  135. <view class="tag">
  136. <text class="span">XH890656565556</text>
  137. <text class="icon more">&#xe631;</text>
  138. </view>
  139. </view>
  140. <view class="footer" v-if="btnshow">
  141. <view class="flex">
  142. <view class="f"><button class="btn br" @click="submission()">提交</button></view>
  143. <view class="f"><button class="btn br back" @click="back()" v-if="state == 1">回退</button></view>
  144. </view>
  145. </view>
  146. <u-popup :show="show" mode="bottom">
  147. <view class="content">
  148. <scroll-view scroll-y="true" style="height: 300rpx;">
  149. <view>
  150. <view>提交流程面板</view>
  151. <view v-for="(item, index) in nextNodes" :key="index" style="float: left;">{{ item.name }}:</view>
  152. <u-radio-group @change="radioGroupChange"><u-radio v-for="(item, index) in nextNodes" :key="index" :name="item.id"></u-radio></u-radio-group>
  153. </view>
  154. </scroll-view>
  155. <view class="confrim-btn"><u-button @click="submit()">确定</u-button></view>
  156. </view>
  157. </u-popup>
  158. <u-popup :show="bshow" mode="bottom">
  159. <view class="content">
  160. <scroll-view scroll-y="true" style="height: 300rpx;">
  161. <view>
  162. <view>回退流程面板</view>
  163. <view v-for="(item, index) in backNodes" :key="index" style="float: left;">{{ item.name }}:</view>
  164. <u-radio-group @change="radioGroupChange"><u-radio v-for="(item, index) in backNodes" :key="index" :name="item.id"></u-radio></u-radio-group>
  165. </view>
  166. </scroll-view>
  167. <view class="confrim-btn"><u-button @click="workflowsback()">确定</u-button></view>
  168. </view>
  169. </u-popup>
  170. </view>
  171. </template>
  172. <script>
  173. let qrcode = require('@/common/code.js');
  174. export default {
  175. data() {
  176. return {
  177. p: {},
  178. item: {},
  179. current: 0,
  180. radio: [
  181. {
  182. name: '正式报告'
  183. },
  184. {
  185. name: '仅原始数据'
  186. },
  187. {
  188. name: '协助试验'
  189. }
  190. ],
  191. id: '',
  192. items: {
  193. document: {
  194. items: {}
  195. }
  196. },
  197. show: false,
  198. bshow: false,
  199. itemt: {},
  200. up: {},
  201. content: '标题',
  202. nextNodes: [],
  203. backNodes: [],
  204. touser: {
  205. nodeid: '1649917385058',
  206. isToPerson: true,
  207. userids: '__jFFZYvLIG6uFc7CdBMg'
  208. },
  209. btnshow: false,
  210. state: 0
  211. };
  212. },
  213. onLoad(e) {
  214. this.id = e.id;
  215. //传过来的id
  216. this.state = e.ste;
  217. if (e.ste == 1) {
  218. /* this.http.request({
  219. url: this.http.urls.xxxx + e.id,
  220. success: res => {
  221. this.item = res.data.data;
  222. }
  223. }); */
  224. this.getDocuments();
  225. } else if (e.ste == 2) {
  226. this.empty();
  227. }
  228. //选中审批人员监听函数,其它类型的参考这个
  229. uni.$on('select', res => {
  230. console.log('asd2:' + JSON.stringify(res));
  231. if (res.ste == 1) {
  232. this.item.WTXQSH = res.items.__L5a8n9ZH5gJC0CL1s6X.value;
  233. } else if (res.ste == 2) {
  234. this.item.WTSYSH = res.items.__0ils0bIBD7Vf90TjVb3.value;
  235. } else if (res.ste == 3) {
  236. this.item.WTXQPZ = res.items.__uiMgMPHg9jmqTXzwdzl.value;
  237. } else if (res.ste == 4) {
  238. this.item.WTSYPZ = res.items.__WSh3KXD8wfeyU3FbipN.value;
  239. } else if (res.ste == 5) {
  240. this.item.WTRWFP = res.items.__IzBqxyYJhOYJntHpmEv.value;
  241. }
  242. });
  243. },
  244. methods: {
  245. // 选中任一radio时,由radio-group触发
  246. radioGroupChange(e) {
  247. // console.log(e);
  248. this.itemt.nextNodeIds = [];
  249. this.itemt.nextNodeIds.push(e);
  250. }, //详情
  251. getDocuments() {
  252. this.http.request({
  253. url: this.http.urls.documents + this.id,
  254. data: this.item,
  255. loading: 'false',
  256. success: res => {
  257. this.item = res.data.data.items;
  258. this.p = res.data.data;
  259. if (this.p.lastFlowOperation == undefined || this.p.auditorList.includes(this.getUser().id)) {
  260. console.log('this.p1:' + JSON.stringify(this.p));
  261. this.btnshow = true;
  262. }
  263. //this.current=res.data.data.items.report_type;
  264. if (this.item.report_type == '正式报告') {
  265. this.current = 0;
  266. } else if (this.item.report_type == '仅原始数据') {
  267. this.current = 1;
  268. } else if (this.item.report_type == '协助试验') {
  269. this.current = 2;
  270. }
  271. this.iteml = res.data.data;
  272. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  273. this.items.docId = this.iteml.id;
  274. this.items.id = this.iteml.id;
  275. this.items.formId = this.iteml.formid;
  276. this.items.parentId = '';
  277. this.items.subSelects = [];
  278. this.items.templateForm = '';
  279. this.items.viewId = '';
  280. this.items.document.items = this.item;
  281. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  282. this.items.document.exparams = {};
  283. this.items.document.formId = this.iteml.formid;
  284. this.items.document.id = this.iteml.id;
  285. this.items.document.parentId = '';
  286. this.items.document.sign = '';
  287. this.items.document.stateId = this.iteml.stateid;
  288. this.items.document.subDocuments = [];
  289. this.items.document.templateForm = '';
  290. this.items.document.versions = '0';
  291. }
  292. });
  293. },
  294. empty() {
  295. this.btnshow = true;
  296. this.http.request({
  297. url: this.http.urls.empty,
  298. data: this.item,
  299. success: res => {
  300. console.log('res2:' + JSON.stringify(res));
  301. this.item = res.data.data.items;
  302. this.p = res.data.data;
  303. console.log('this.p1:' + JSON.stringify(this.p));
  304. //this.current=res.data.data.items.report_type;
  305. if (this.item.report_type == '正式报告') {
  306. this.current = 0;
  307. } else if (this.item.report_type == '仅原始数据') {
  308. this.current = 1;
  309. } else if (this.item.report_type == '协助试验') {
  310. this.current = 2;
  311. }
  312. this.iteml = res.data.data;
  313. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  314. this.items.docId = this.iteml.id;
  315. this.items.id = this.iteml.id;
  316. this.items.formId = this.iteml.formid;
  317. this.items.parentId = '';
  318. this.items.subSelects = [];
  319. this.items.templateForm = '';
  320. this.items.viewId = '';
  321. this.items.document.items = this.item;
  322. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  323. this.items.document.exparams = {};
  324. this.items.document.formId = this.iteml.formid;
  325. this.items.document.id = this.iteml.id;
  326. this.items.document.parentId = '';
  327. this.items.document.sign = '';
  328. this.items.document.stateId = this.iteml.stateid;
  329. this.items.document.subDocuments = [];
  330. this.items.document.templateForm = '';
  331. this.items.document.versions = '0';
  332. }
  333. });
  334. },
  335. //选择结果形式
  336. change(e) {
  337. this.current = e;
  338. console.log('aa:' + this.radio[this.current].name);
  339. this.item.report_type = this.radio[this.current].name;
  340. },
  341. //选择审批人员
  342. select(e) {
  343. uni.navigateTo({
  344. url: '/pages/index/select?ste=' + e
  345. });
  346. },
  347. //提交
  348. add() {
  349. this.http.request({
  350. url: this.http.urls.user_task_add,
  351. data: this.item,
  352. method: 'POST',
  353. success: res => {
  354. uni.showModal({
  355. title: '提示',
  356. content: '提交成功',
  357. showCancel: false,
  358. success: res => {
  359. if (res.confirm) {
  360. uni.navigateBack();
  361. }
  362. }
  363. });
  364. }
  365. });
  366. },
  367. //提交流程面板
  368. submission() {
  369. this.http.request({
  370. url: this.http.urls.documents + this.id + '/panels/submission',
  371. data: this.items,
  372. method: 'POST',
  373. success: res => {
  374. //this.item=res.data.data;
  375. console.log('zx22:' + JSON.stringify(res));
  376. this.show = true;
  377. this.title = res.data.data.name;
  378. this.nextNodes = res.data.data.nextNodes;
  379. this.itemt.flowId = res.data.data.flowId;
  380. this.itemt.flowType = '80';
  381. this.itemt.currentNodeId = res.data.data.currentNodeId;
  382. this.itemt.attitude = '';
  383. this.itemt.signature = '';
  384. this.itemt.submitTo = '';
  385. this.itemt.circulatorInfo = '';
  386. this.itemt.subFlowApproverInfo = '';
  387. this.itemt.subFlowApproverInfoAll = '';
  388. this.itemt.document = this.items.document;
  389. //this.content=res.data.data.formname;
  390. }
  391. });
  392. }, //提交流程
  393. submit() {
  394. //this.itemt.document.items.purpose="试验目的5656";
  395. //this.itemt.document.items.title="标题5656";
  396. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  397. this.itemt.docId = this.iteml.id;
  398. this.itemt.id = this.iteml.id;
  399. this.itemt.formId = this.iteml.formid;
  400. this.itemt.parentId = '';
  401. this.itemt.subFlowApprover = [];
  402. this.itemt.subSelects = [];
  403. this.itemt.submitTo = [];
  404. this.itemt.templateForm = '';
  405. this.itemt.viewId = '';
  406. this.http.request({
  407. url: this.http.urls.documents + this.id + '/workflows/submit',
  408. data: this.itemt,
  409. method: 'PUT',
  410. success: res => {
  411. //this.item=res.data.data;
  412. console.log('zx22:' + JSON.stringify(res));
  413. this.show = false;
  414. this.title = res.data.data.name;
  415. this.nextNodes = res.data.data.nextNodes;
  416. uni.$emit('index');
  417. uni.redirectTo({
  418. url: '/pages/index/index'
  419. });
  420. //this.content=res.data.data.formname;
  421. }
  422. });
  423. }, //刷新数据
  424. //回退流程面板
  425. back() {
  426. this.http.request({
  427. url: this.http.urls.documents + this.id + '/panels/back',
  428. data: this.items,
  429. method: 'POST',
  430. success: res => {
  431. //this.item=res.data.data;
  432. console.log('zx22:' + JSON.stringify(res.data.data));
  433. this.bshow = true;
  434. this.title = res.data.data.name;
  435. this.backNodes = res.data.data.backNodes;
  436. this.itemt.flowId = res.data.data.flowId;
  437. this.itemt.flowType = '81';
  438. this.itemt.currentNodeId = res.data.data.currentNodeId;
  439. this.itemt.attitude = '';
  440. this.itemt.signature = '';
  441. this.itemt.submitTo = '';
  442. this.itemt.circulatorInfo = '';
  443. this.itemt.subFlowApproverInfo = '';
  444. this.itemt.subFlowApproverInfoAll = '';
  445. this.itemt.document = this.items.document;
  446. //this.content=res.data.data.formname;
  447. }
  448. });
  449. }, //提交回退流程
  450. workflowsback() {
  451. //this.itemt.document.items.purpose="试验目的111";
  452. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  453. this.itemt.docId = this.iteml.id;
  454. this.itemt.id = this.iteml.id;
  455. this.itemt.formId = this.iteml.formid;
  456. this.itemt.parentId = '';
  457. this.itemt.subFlowApprover = [];
  458. this.itemt.subSelects = [];
  459. this.itemt.submitTo = [];
  460. this.itemt.templateForm = '';
  461. this.itemt.viewId = '';
  462. this.http.request({
  463. url: this.http.urls.documents + this.id + '/workflows/back',
  464. data: this.itemt,
  465. method: 'PUT',
  466. success: res => {
  467. //this.item=res.data.data;
  468. console.log('zx22:' + JSON.stringify(res));
  469. this.bshow = false;
  470. this.title = res.data.data.name;
  471. this.nextNodes = res.data.data.nextNodes;
  472. uni.$emit('index');
  473. uni.redirectTo({
  474. url: '/pages/index/index'
  475. });
  476. //this.content=res.data.data.formname;
  477. }
  478. });
  479. }
  480. }
  481. };
  482. </script>
  483. <style lang="scss">
  484. .pages{
  485. padding-bottom: 85px;
  486. }
  487. </style>