detail.vue 16 KB

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