detail.vue 17 KB

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