detail.vue 15 KB

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