detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <template>
  2. <view>
  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. <button class="btn ws" @click="submission()">提交</button>
  142. <button class="btn ws" @click="back()" v-if="state == 1">回退</button>
  143. </view>
  144. <u-popup :show="show" mode="bottom">
  145. <view class="content">
  146. <scroll-view scroll-y="true" style="height: 300rpx;">
  147. <view>
  148. <view>提交流程面板</view>
  149. <view v-for="(item, index) in nextNodes" :key="index" style="float: left;">{{ item.name }}:</view>
  150. <u-radio-group @change="radioGroupChange"><u-radio v-for="(item, index) in nextNodes" :key="index" :name="item.id"></u-radio></u-radio-group>
  151. </view>
  152. </scroll-view>
  153. <view class="confrim-btn"><u-button @click="submit()">确定</u-button></view>
  154. </view>
  155. </u-popup>
  156. <u-popup :show="bshow" mode="bottom">
  157. <view class="content">
  158. <scroll-view scroll-y="true" style="height: 300rpx;">
  159. <view>
  160. <view>回退流程面板</view>
  161. <view v-for="(item, index) in backNodes" :key="index" style="float: left;">{{ item.name }}:</view>
  162. <u-radio-group @change="radioGroupChange"><u-radio v-for="(item, index) in backNodes" :key="index" :name="item.id"></u-radio></u-radio-group>
  163. </view>
  164. </scroll-view>
  165. <view class="confrim-btn"><u-button @click="workflowsback()">确定</u-button></view>
  166. </view>
  167. </u-popup>
  168. </view>
  169. </template>
  170. <script>
  171. let qrcode = require('@/common/code.js');
  172. export default {
  173. data() {
  174. return {
  175. p: {},
  176. item: {},
  177. current: 0,
  178. radio: [
  179. {
  180. name: '正式报告'
  181. },
  182. {
  183. name: '仅原始数据'
  184. },
  185. {
  186. name: '协助试验'
  187. }
  188. ],
  189. id: '',
  190. items: {
  191. document: {
  192. items: {}
  193. }
  194. },
  195. show: false,
  196. bshow: false,
  197. itemt: {},
  198. up: {},
  199. content: '标题',
  200. nextNodes: [],
  201. backNodes: [],
  202. touser: {
  203. nodeid: '1649917385058',
  204. isToPerson: true,
  205. userids: '__jFFZYvLIG6uFc7CdBMg'
  206. },
  207. btnshow: false,
  208. state: 0
  209. };
  210. },
  211. onLoad(e) {
  212. this.id = e.id;
  213. //传过来的id
  214. this.state = e.ste;
  215. if (e.ste == 1) {
  216. /* this.http.request({
  217. url: this.http.urls.xxxx + e.id,
  218. success: res => {
  219. this.item = res.data.data;
  220. }
  221. }); */
  222. this.getDocuments();
  223. } else if (e.ste == 2) {
  224. this.empty();
  225. }
  226. //选中审批人员监听函数,其它类型的参考这个
  227. uni.$on('select', res => {
  228. console.log('asd2:' + JSON.stringify(res));
  229. if (res.ste == 1) {
  230. this.item.WTXQSH = res.items.__L5a8n9ZH5gJC0CL1s6X.value;
  231. } else if (res.ste == 2) {
  232. this.item.WTSYSH = res.items.__0ils0bIBD7Vf90TjVb3.value;
  233. } else if (res.ste == 3) {
  234. this.item.WTXQPZ = res.items.__uiMgMPHg9jmqTXzwdzl.value;
  235. } else if (res.ste == 4) {
  236. this.item.WTSYPZ = res.items.__WSh3KXD8wfeyU3FbipN.value;
  237. } else if (res.ste == 5) {
  238. this.item.WTRWFP = res.items.__IzBqxyYJhOYJntHpmEv.value;
  239. }
  240. });
  241. },
  242. methods: {
  243. // 选中任一radio时,由radio-group触发
  244. radioGroupChange(e) {
  245. // console.log(e);
  246. this.itemt.nextNodeIds = [];
  247. this.itemt.nextNodeIds.push(e);
  248. }, //详情
  249. getDocuments() {
  250. this.http.request({
  251. url: this.http.urls.documents + this.id,
  252. data: this.item,
  253. loading: 'false',
  254. success: res => {
  255. this.item = res.data.data.items;
  256. this.p = res.data.data;
  257. if (this.p.lastFlowOperation == undefined || this.p.auditorList.includes(this.getUser().id)) {
  258. console.log('this.p1:' + JSON.stringify(this.p));
  259. this.btnshow = true;
  260. }
  261. //this.current=res.data.data.items.report_type;
  262. if (this.item.report_type == '正式报告') {
  263. this.current = 0;
  264. } else if (this.item.report_type == '仅原始数据') {
  265. this.current = 1;
  266. } else if (this.item.report_type == '协助试验') {
  267. this.current = 2;
  268. }
  269. this.iteml = res.data.data;
  270. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  271. this.items.docId = this.iteml.id;
  272. this.items.id = this.iteml.id;
  273. this.items.formId = this.iteml.formid;
  274. this.items.parentId = '';
  275. this.items.subSelects = [];
  276. this.items.templateForm = '';
  277. this.items.viewId = '';
  278. this.items.document.items = this.item;
  279. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  280. this.items.document.exparams = {};
  281. this.items.document.formId = this.iteml.formid;
  282. this.items.document.id = this.iteml.id;
  283. this.items.document.parentId = '';
  284. this.items.document.sign = '';
  285. this.items.document.stateId = this.iteml.stateid;
  286. this.items.document.subDocuments = [];
  287. this.items.document.templateForm = '';
  288. this.items.document.versions = '0';
  289. }
  290. });
  291. },
  292. empty() {
  293. this.btnshow = true;
  294. this.http.request({
  295. url: this.http.urls.empty,
  296. data: this.item,
  297. success: res => {
  298. console.log('res2:' + JSON.stringify(res));
  299. this.item = res.data.data.items;
  300. this.p = res.data.data;
  301. console.log('this.p1:' + JSON.stringify(this.p));
  302. //this.current=res.data.data.items.report_type;
  303. if (this.item.report_type == '正式报告') {
  304. this.current = 0;
  305. } else if (this.item.report_type == '仅原始数据') {
  306. this.current = 1;
  307. } else if (this.item.report_type == '协助试验') {
  308. this.current = 2;
  309. }
  310. this.iteml = res.data.data;
  311. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  312. this.items.docId = this.iteml.id;
  313. this.items.id = this.iteml.id;
  314. this.items.formId = this.iteml.formid;
  315. this.items.parentId = '';
  316. this.items.subSelects = [];
  317. this.items.templateForm = '';
  318. this.items.viewId = '';
  319. this.items.document.items = this.item;
  320. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  321. this.items.document.exparams = {};
  322. this.items.document.formId = this.iteml.formid;
  323. this.items.document.id = this.iteml.id;
  324. this.items.document.parentId = '';
  325. this.items.document.sign = '';
  326. this.items.document.stateId = this.iteml.stateid;
  327. this.items.document.subDocuments = [];
  328. this.items.document.templateForm = '';
  329. this.items.document.versions = '0';
  330. }
  331. });
  332. },
  333. //选择结果形式
  334. change(e) {
  335. this.current = e;
  336. console.log('aa:' + this.radio[this.current].name);
  337. this.item.report_type = this.radio[this.current].name;
  338. },
  339. //选择审批人员
  340. select(e) {
  341. uni.navigateTo({
  342. url: '/pages/index/select?ste=' + e
  343. });
  344. },
  345. //提交
  346. add() {
  347. this.http.request({
  348. url: this.http.urls.user_task_add,
  349. data: this.item,
  350. method: 'POST',
  351. success: res => {
  352. uni.showModal({
  353. title: '提示',
  354. content: '提交成功',
  355. showCancel: false,
  356. success: res => {
  357. if (res.confirm) {
  358. uni.navigateBack();
  359. }
  360. }
  361. });
  362. }
  363. });
  364. },
  365. //提交流程面板
  366. submission() {
  367. this.http.request({
  368. url: this.http.urls.documents + this.id + '/panels/submission',
  369. data: this.items,
  370. method: 'POST',
  371. success: res => {
  372. //this.item=res.data.data;
  373. console.log('zx22:' + JSON.stringify(res));
  374. this.show = true;
  375. this.title = res.data.data.name;
  376. this.nextNodes = res.data.data.nextNodes;
  377. this.itemt.flowId = res.data.data.flowId;
  378. this.itemt.flowType = '80';
  379. this.itemt.currentNodeId = res.data.data.currentNodeId;
  380. this.itemt.attitude = '';
  381. this.itemt.signature = '';
  382. this.itemt.submitTo = '';
  383. this.itemt.circulatorInfo = '';
  384. this.itemt.subFlowApproverInfo = '';
  385. this.itemt.subFlowApproverInfoAll = '';
  386. this.itemt.document = this.items.document;
  387. //this.content=res.data.data.formname;
  388. }
  389. });
  390. }, //提交流程
  391. submit() {
  392. //this.itemt.document.items.purpose="试验目的5656";
  393. //this.itemt.document.items.title="标题5656";
  394. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  395. this.itemt.docId = this.iteml.id;
  396. this.itemt.id = this.iteml.id;
  397. this.itemt.formId = this.iteml.formid;
  398. this.itemt.parentId = '';
  399. this.itemt.subFlowApprover = [];
  400. this.itemt.subSelects = [];
  401. this.itemt.submitTo = [];
  402. this.itemt.templateForm = '';
  403. this.itemt.viewId = '';
  404. this.http.request({
  405. url: this.http.urls.documents + this.id + '/workflows/submit',
  406. data: this.itemt,
  407. method: 'PUT',
  408. success: res => {
  409. //this.item=res.data.data;
  410. console.log('zx22:' + JSON.stringify(res));
  411. this.show = false;
  412. this.title = res.data.data.name;
  413. this.nextNodes = res.data.data.nextNodes;
  414. uni.$emit('index');
  415. uni.redirectTo({
  416. url: '/pages/index/index'
  417. });
  418. //this.content=res.data.data.formname;
  419. }
  420. });
  421. }, //刷新数据
  422. //回退流程面板
  423. back() {
  424. this.http.request({
  425. url: this.http.urls.documents + this.id + '/panels/back',
  426. data: this.items,
  427. method: 'POST',
  428. success: res => {
  429. //this.item=res.data.data;
  430. console.log('zx22:' + JSON.stringify(res.data.data));
  431. this.bshow = true;
  432. this.title = res.data.data.name;
  433. this.backNodes = res.data.data.backNodes;
  434. this.itemt.flowId = res.data.data.flowId;
  435. this.itemt.flowType = '81';
  436. this.itemt.currentNodeId = res.data.data.currentNodeId;
  437. this.itemt.attitude = '';
  438. this.itemt.signature = '';
  439. this.itemt.submitTo = '';
  440. this.itemt.circulatorInfo = '';
  441. this.itemt.subFlowApproverInfo = '';
  442. this.itemt.subFlowApproverInfoAll = '';
  443. this.itemt.document = this.items.document;
  444. //this.content=res.data.data.formname;
  445. }
  446. });
  447. }, //提交回退流程
  448. workflowsback() {
  449. //this.itemt.document.items.purpose="试验目的111";
  450. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  451. this.itemt.docId = this.iteml.id;
  452. this.itemt.id = this.iteml.id;
  453. this.itemt.formId = this.iteml.formid;
  454. this.itemt.parentId = '';
  455. this.itemt.subFlowApprover = [];
  456. this.itemt.subSelects = [];
  457. this.itemt.submitTo = [];
  458. this.itemt.templateForm = '';
  459. this.itemt.viewId = '';
  460. this.http.request({
  461. url: this.http.urls.documents + this.id + '/workflows/back',
  462. data: this.itemt,
  463. method: 'PUT',
  464. success: res => {
  465. //this.item=res.data.data;
  466. console.log('zx22:' + JSON.stringify(res));
  467. this.bshow = false;
  468. this.title = res.data.data.name;
  469. this.nextNodes = res.data.data.nextNodes;
  470. uni.$emit('index');
  471. uni.redirectTo({
  472. url: '/pages/index/index'
  473. });
  474. //this.content=res.data.data.formname;
  475. }
  476. });
  477. }
  478. }
  479. };
  480. </script>
  481. <style lang="scss"></style>