detail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  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_name" 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="array1">
  65. <view class="picks">{{ item.experiment_type ? item.experiment_type : '选择试验类型' }}</view>
  66. </picker>
  67. <picker @change="bindChange($event, 'product')" :range="array2">
  68. <view class="picks">{{ item.product ? item.product : '选择产品线' }}</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="form_group">
  93. <view class="lable">附件上传</view>
  94. <view class="tag" @click="dshow = true"><text class="span">最大上传5个</text></view>
  95. </view>
  96. <view class="form_group">
  97. <uni-file-picker :limit="5" @select="upload($event, item)" file-mediatype="all">
  98. <button class="up">
  99. <text class="icon">&#xe604;</text>
  100. <text>选择文件</text>
  101. </button>
  102. </uni-file-picker>
  103. <view class="ufiles">
  104. <view class="fil" v-for="(item, index) in item.unstructured" :key="index" @click="look(item)">
  105. <view v-if="item.fileType">
  106. <view class="icon" v-if="item.fileType.toLowerCase() == '.png' || item.fileType.toLowerCase() == '.jpg'">&#xe63e;</view>
  107. </view>
  108. <view class="icon" v-else>&#xeb66;</view>
  109. <view class="name">
  110. <view class="omit">{{ item.name }}</view>
  111. <view class="desc">{{ (item.size / 1024).toFixed(2) }}kb</view>
  112. </view>
  113. <view class="del" @click.stop="del(item)">删除</view>
  114. <view class="clear"></view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="vtitle">设置审批人员</view>
  119. <view class="form_group" @click="select('1')">
  120. <view class="lable">需求审核-产品经理或主管人员</view>
  121. <view class="tag">
  122. <text class="span">{{ item.WTXQSH_NAME }}</text>
  123. <text class="icon more">&#xe631;</text>
  124. </view>
  125. </view>
  126. <view class="form_group" @click="select('2')">
  127. <view class="lable">试验审核-试验对接人</view>
  128. <view class="tag">
  129. <text class="span">{{ item.WTSYSH_NAME }}</text>
  130. <text class="icon more">&#xe631;</text>
  131. </view>
  132. </view>
  133. <view class="form_group" @click="select('3')">
  134. <view class="lable">需求批准-本部门领导</view>
  135. <view class="tag">
  136. <text class="span">{{ item.WTXQPZ_NAME }}</text>
  137. <text class="icon more">&#xe631;</text>
  138. </view>
  139. </view>
  140. <view class="form_group" @click="select('4')">
  141. <view class="lable">试验批准</view>
  142. <view class="tag">
  143. <text class="span">{{ item.WTSYPZ_NAME }}</text>
  144. <text class="icon more">&#xe631;</text>
  145. </view>
  146. </view>
  147. <view class="form_group" @click="select('5')">
  148. <view class="lable">任务分派-任务分派人</view>
  149. <view class="tag">
  150. <text class="span">{{ item.WTRWFP_NAME }}</text>
  151. <text class="icon more">&#xe631;</text>
  152. </view>
  153. </view>
  154. <view class="vtitle">样机</view>
  155. <view class="form_group" v-for="(item, index) in list" :key="index">
  156. <view class="lable">{{item.items.__df3EGbLwLuQbY18mt6a.value}}</view>
  157. <view class="tag">
  158. <text class="span">{{item.items.__Y8VlxrNmQKyOx0qZWl3.value}}</text>
  159. <text class="icon more">&#xe631;</text>
  160. </view>
  161. </view>
  162. <!--
  163. <view class="form_group">
  164. <view class="lable">GH560</view>
  165. <view class="tag">
  166. <text class="span">XH890656565556</text>
  167. <text class="icon more">&#xe631;</text>
  168. </view>
  169. </view>-->
  170. <view class="footer" v-if="btnshow">
  171. <view class="flex">
  172. <view class="f"><button class="btn br" @click="validate()">保存</button></view>
  173. <view class="f"><button class="btn br" @click="submission()">提交</button></view>
  174. <view class="f" v-if="state == 1"><button class="btn br back" @click="back()">回退</button></view>
  175. </view>
  176. </view>
  177. <u-popup :show="dshow" mode="center" @close="dshow = false" round="5" closeable customStyle="width:92%">
  178. <view class="popup">
  179. <u-divider text="模板下载"></u-divider>
  180. <view class="citem" @click="download('https://img-operation.csdnimg.cn/csdn/silkroad/img/1670234405428.jpg')">
  181. <view class="title omit">提交流程面板提交流程面板提交流程面板</view>
  182. <view class="xz">点击下载</view>
  183. </view>
  184. <view class="citem" @click="download('https://img-operation.csdnimg.cn/csdn/silkroad/img/1670234405428.jpg')">
  185. <view class="title omit">提交流程面板提交流程面板提交流程面板</view>
  186. <view class="xz">点击下载</view>
  187. </view>
  188. <view class="citem" @click="download('https://img-operation.csdnimg.cn/csdn/silkroad/img/1670234405428.jpg')">
  189. <view class="title omit">提交流程面板提交流程面板提交流程面板</view>
  190. <view class="xz">点击下载</view>
  191. </view>
  192. </view>
  193. </u-popup>
  194. <u-popup :show="show" mode="bottom" @close="show = false" closeable round="15">
  195. <view class="popup">
  196. <u-divider text="提交流程面板"></u-divider>
  197. <scroll-view scroll-y="true" style="height: 450rpx;">
  198. <view v-for="(item, index) in nextNodes" :key="index" class="bitem" @click="bselect(item, 'nextNodes')">
  199. <view class="icon select check" v-if="item.check">&#xe600;</view>
  200. <view class="icon select" v-else>&#xe8bb;</view>
  201. <view class="title">{{ item.name }}</view>
  202. <view class="xze" v-if="stues=='任务分派'||stues=='报告编制'||stues=='报告审核'">
  203. <view class="users omit">
  204. <text>{{tname}}</text>
  205. </view>
  206. <view class="icon" @click.stop="selectApprovers()">&#xeb25;</view>
  207. </view>
  208. </view>
  209. <textarea placeholder="意见" style="height: 120px;" maxlength="200" v-model="itemt.attitude" />
  210. </scroll-view>
  211. <view class="confrim-btn"><button class="btn" @click="submit()">确定</button></view>
  212. </view>
  213. </u-popup>
  214. <u-popup :show="bshow" mode="bottom" @close="bshow = false" closeable round="15">
  215. <view class="popup">
  216. <u-divider text="回退流程面板"></u-divider>
  217. <scroll-view scroll-y="true" style="height: 300rpx;">
  218. <view v-for="(item, index) in backNodes" :key="index" class="bitem" @click="bselect(item, 'backNodes')">
  219. <view class="icon select check" v-if="item.check">&#xe600;</view>
  220. <view class="icon select" v-else>&#xe8bb;</view>
  221. <view class="title">{{ item.name }}</view>
  222. </view>
  223. </scroll-view>
  224. <view class="confrim-btn"><button class="btn" @click="workflowsback()">确定</button></view>
  225. </view>
  226. </u-popup>
  227. </view>
  228. </template>
  229. <script>
  230. let qrcode = require('@/common/code.js');
  231. export default {
  232. data() {
  233. return {
  234. ip: this.http.urls.ip,
  235. p: {},
  236. item: {},
  237. current: 0,
  238. radio: [
  239. {
  240. name: '正式报告'
  241. },
  242. {
  243. name: '仅原始数据'
  244. },
  245. {
  246. name: '协助试验'
  247. }
  248. ],
  249. id: '',
  250. items: {
  251. document: {
  252. items: {}
  253. }
  254. },
  255. users: [],
  256. array1: ['整机性能', '系统性能', '台架', '可靠性','部件'], //实验类型1
  257. array2: ['装载机', '平地机', '叉车', '推土机','小型机','挖掘机','压缩机','起重机','压路机','农机','高空作业平台','其他'], //实验类型2
  258. show: false,
  259. bshow: false,
  260. dshow: false,
  261. itemt: {},
  262. up: {},
  263. content: '标题',
  264. nextNodes: [],
  265. backNodes: [],
  266. touser: {
  267. nodeid: '1649917385058',
  268. isToPerson: true,
  269. userids: '__jFFZYvLIG6uFc7CdBMg'
  270. },
  271. list: [],
  272. btnshow: false,
  273. state: 0,
  274. btitem: {
  275. applicationId: '__gAPYBW4YxB3UePM3lqO',
  276. exparams: {},
  277. formId: '__0FLGNncOS1lz0T9jsFn',
  278. id: '__79Wtw03ya4dJUDGPyAN',
  279. isRelate: 'true',
  280. parentId: '',
  281. sign: '',
  282. subDocuments: [],
  283. templateForm: '',
  284. versions: '0'
  285. },
  286. stues:'',
  287. secauser:{},
  288. tname:''
  289. };
  290. },
  291. onLoad(e) {
  292. this.id = e.id;
  293. //传过来的id
  294. this.stues=e.sta;
  295. this.state = e.ste;
  296. if (e.ste == 1) {
  297. this.getDocuments();
  298. } else if (e.ste == 2) {
  299. this.empty();
  300. }
  301. //选中审批人员监听函数,其它类型的参考这个
  302. uni.$on('selectu', res => {
  303. console.log('selectu:' + JSON.stringify(res));
  304. this.itemt.submitTo=[];
  305. var su={isToPerson:true};
  306. var u="";
  307. this.tname='';
  308. res.forEach(item => {
  309. su.nodeid=item.nodeId;
  310. u+=item.id+';';
  311. this.tname+=item.name+',';
  312. });
  313. su.userids=u;
  314. console.log('su:' + JSON.stringify(su));
  315. this.itemt.submitTo.push(su);
  316. console.log('su:' + JSON.stringify(this.itemt));
  317. this.convert();
  318. });
  319. //选中审批人员监听函数,其它类型的参考这个
  320. uni.$on('select', res => {
  321. console.log('asd2:' + JSON.stringify(res));
  322. if (res.ste == 1) {
  323. this.item.WTXQSH = res.items.__psLiBtymgDqatneDeJM.value;
  324. } else if (res.ste == 2) {
  325. this.item.WTSYSH = res.items.__d9UDIcG9cd9TPsauffQ.value;
  326. } else if (res.ste == 3) {
  327. this.item.WTXQPZ = res.items.__EaOA4o6je5WFAGSDelj.value;
  328. } else if (res.ste == 4) {
  329. this.item.WTSYPZ = res.items.__cDWoqYpeJkPwLjignVY.value;
  330. } else if (res.ste == 5) {
  331. this.item.WTRWFP = res.items.__vhLhnW6B7JBtaxiXkQ3.value;
  332. }
  333. console.log('item2:' + JSON.stringify(this.item));
  334. this.convert();
  335. });
  336. },
  337. methods: {
  338. //选择实验类型
  339. bindChange(e, type) {
  340. this.item[type] = this.array1[e.target.value];
  341. this.$forceUpdate();
  342. },
  343. //下载模板
  344. download(url) {
  345. const a = document.createElement('a');
  346. a.href = url;
  347. a.download = 'download';
  348. a.click();
  349. this.dshow = false;
  350. },
  351. //提交或回退
  352. bselect(e, tag) {
  353. this[tag].forEach(item => {
  354. item.check = false;
  355. });
  356. e.check = true;
  357. this.itemt.nextNodeIds = [];
  358. this.itemt.nextNodeIds.push(e.id);
  359. this.secauser=this.itemt;
  360. this.secauser.nodeid=e.id;
  361. this.$forceUpdate();
  362. }, //详情
  363. getDocuments() {
  364. this.http.request({
  365. url: this.http.urls.documents + this.id,
  366. data: this.item,
  367. success: res => {
  368. this.item = res.data.data.items;
  369. this.p = res.data.data;
  370. this.getUsers();
  371. this.yj_list();
  372. //console.log('this.p:' + JSON.stringify(res));
  373. //保存数据
  374. this.btitem.id = res.data.data.id;
  375. this.btitem.formId = res.data.data.formid;
  376. this.btitem.versions = res.data.data.versions;
  377. this.btitem.parentId = '';
  378. if (this.item.unstructured) {
  379. this.item.unstructured = JSON.parse(this.item.unstructured);
  380. } else {
  381. this.item.unstructured = [];
  382. }
  383. if (this.p.lastFlowOperation == undefined || this.p.auditorList.includes(this.getUser().id)) {
  384. this.btnshow = true;
  385. }
  386. //this.current=res.data.data.items.report_type;
  387. if (this.item.report_type == '正式报告') {
  388. this.current = 0;
  389. } else if (this.item.report_type == '仅原始数据') {
  390. this.current = 1;
  391. } else if (this.item.report_type == '协助试验') {
  392. this.current = 2;
  393. }
  394. this.iteml = res.data.data;
  395. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  396. this.items.docId = this.iteml.id;
  397. this.items.id = this.iteml.id;
  398. this.items.formId = this.iteml.formid;
  399. this.items.parentId = '';
  400. this.items.subSelects = [];
  401. this.items.templateForm = '';
  402. this.items.viewId = '';
  403. this.items.document.items = this.item;
  404. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  405. this.items.document.exparams = {};
  406. this.items.document.formId = this.iteml.formid;
  407. this.items.document.id = this.iteml.id;
  408. this.items.document.parentId = '';
  409. this.items.document.sign = '';
  410. this.items.document.stateId = this.iteml.stateid;
  411. this.items.document.subDocuments = [];
  412. this.items.document.templateForm = '';
  413. this.items.document.versions = '0';
  414. }
  415. });
  416. },
  417. empty() {
  418. this.btnshow = true;
  419. this.http.request({
  420. url: this.http.urls.empty,
  421. data: this.item,
  422. success: res => {
  423. this.item = res.data.data.items;
  424. this.p = res.data.data;
  425. this.getUsers();
  426. //保存数据
  427. this.btitem.id = res.data.data.id;
  428. this.btitem.formId = res.data.data.formid;
  429. this.btitem.versions = res.data.data.versions;
  430. this.btitem.parentId = '';
  431. console.log('this.p1:' + JSON.stringify(this.p));
  432. //this.current=res.data.data.items.report_type;
  433. if (this.item.report_type == '正式报告') {
  434. this.current = 0;
  435. } else if (this.item.report_type == '仅原始数据') {
  436. this.current = 1;
  437. } else if (this.item.report_type == '协助试验') {
  438. this.current = 2;
  439. }
  440. this.iteml = res.data.data;
  441. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  442. this.items.docId = this.iteml.id;
  443. this.items.id = this.iteml.id;
  444. this.items.formId = this.iteml.formid;
  445. this.items.parentId = '';
  446. this.items.subSelects = [];
  447. this.items.templateForm = '';
  448. this.items.viewId = '';
  449. this.items.document.items = this.item;
  450. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  451. this.items.document.exparams = {};
  452. this.items.document.formId = this.iteml.formid;
  453. this.items.document.id = this.iteml.id;
  454. this.items.document.parentId = '';
  455. this.items.document.sign = '';
  456. this.items.document.stateId = this.iteml.stateid;
  457. this.items.document.subDocuments = [];
  458. this.items.document.templateForm = '';
  459. this.items.document.versions = '0';
  460. }
  461. });
  462. },
  463. //获取全部用户用于显示名字
  464. getUsers() {
  465. this.http.request({
  466. url: this.http.urls.user_list,
  467. success: res => {
  468. this.users = res.data.data;
  469. this.convert();
  470. }
  471. });
  472. },
  473. convert() {
  474. this.users.forEach(item => {
  475. if (this.item.WTXQSH == item.ID) {
  476. this.item.WTXQSH_NAME = item.NAME;
  477. }
  478. if (this.item.WTSYSH == item.ID) {
  479. this.item.WTSYSH_NAME = item.NAME;
  480. }
  481. if (this.item.WTXQPZ == item.ID) {
  482. this.item.WTXQPZ_NAME = item.NAME;
  483. }
  484. if (this.item.WTSYPZ == item.ID) {
  485. this.item.WTSYPZ_NAME = item.NAME;
  486. }
  487. if (this.item.WTRWFP == item.ID) {
  488. this.item.WTRWFP_NAME = item.NAME;
  489. }
  490. if (this.item.applicant == item.ID) {
  491. this.item.applicant_name = item.NAME;
  492. }
  493. });
  494. this.$forceUpdate();
  495. },
  496. //选择结果形式
  497. change(e) {
  498. this.current = e;
  499. console.log('aa:' + this.radio[this.current].name);
  500. this.item.report_type = this.radio[this.current].name;
  501. },
  502. //选择审批人员
  503. select(e) {
  504. uni.navigateTo({
  505. url: '/pages/index/select?ste=' + e
  506. });
  507. },
  508. //选择审批人员
  509. selectApprovers(e) {
  510. uni.navigateTo({
  511. url: '/pages/index/selectApprovers?item=' + JSON.stringify(this.secauser)
  512. });
  513. },
  514. //选择文件上传
  515. upload(e, item) {
  516. uni.showLoading({ title: '正在上传.....', mask: true });
  517. e.tempFilePaths.forEach((temp, index) => {
  518. uni.uploadFile({
  519. url: this.http.urls.upload,
  520. filePath: temp,
  521. name: 'files',
  522. formData: {
  523. applicationId: '__gAPYBW4YxB3UePM3lqO',
  524. allowedTypes: '00',
  525. fieldId: this.id + '_unstructured',
  526. fileSaveMode: '00',
  527. path: 'ITEM_PATH',
  528. actionType: ''
  529. },
  530. header: { accessToken: this.getUser().accessToken },
  531. success: res => {
  532. uni.hideLoading();
  533. let data = JSON.parse(res.data);
  534. if (data.errcode == 0) {
  535. this.item.unstructured.push({
  536. name: data.data[0].fileName,
  537. path: data.data[0].filePath,
  538. size: data.data[0].fileSize,
  539. fileType: data.data[0].fileType
  540. });
  541. this.$forceUpdate();
  542. } else {
  543. uni.showModal({ content: '上传失败', showCancel: false });
  544. }
  545. },
  546. fail: res => {
  547. uni.hideLoading();
  548. uni.showModal({ content: '上传失败', showCancel: false });
  549. }
  550. });
  551. });
  552. },
  553. //删除上传的文件
  554. del(item) {
  555. this.item.unstructured.splice(this.item.unstructured.indexOf(item), 1);
  556. },
  557. //文件预览
  558. look(item) {
  559. console.log('asd:' + JSON.stringify(item));
  560. uni.openDocument({
  561. //新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。
  562. filePath: this.ip + item.path,
  563. showMenu: true,
  564. success: res => {
  565. console.log('打开文档成功');
  566. }
  567. });
  568. },
  569. //提交
  570. add() {
  571. this.http.request({
  572. url: this.http.urls.user_task_add,
  573. data: this.item,
  574. method: 'POST',
  575. success: res => {
  576. uni.showModal({
  577. title: '提示',
  578. content: '提交成功',
  579. showCancel: false,
  580. success: res => {
  581. if (res.confirm) {
  582. uni.navigateBack();
  583. }
  584. }
  585. });
  586. }
  587. });
  588. },
  589. //保存
  590. validate() {
  591. this.btitem.items = this.item;
  592. this.http.request({
  593. url: this.http.urls.validate + '/' + this.btitem.id + '/withoutValid?' + this.btitem.parentId,
  594. data: this.btitem,
  595. method: 'PUT',
  596. success: res => {
  597. console.log('validate1:' + JSON.stringify(res));
  598. if (res.data.errcode == 0) {
  599. uni.$emit('index');
  600. uni.redirectTo({
  601. url: '/pages/index/index'
  602. });
  603. } else {
  604. uni.showModal({
  605. title: '提示',
  606. content: res.data.data.errmsg,
  607. showCancel: false,
  608. success: res => {
  609. if (res.confirm) {
  610. //uni.navigateBack();
  611. }
  612. }
  613. });
  614. return;
  615. }
  616. }
  617. });
  618. },
  619. yj_list() {
  620. this.http.request({
  621. url: this.http.urls.yj_list +
  622. 'parentId=' +
  623. this.id,
  624. method: 'POST',
  625. success: res => {
  626. console.log('res2:' + JSON.stringify(res));
  627. if (res.data.errcode == 0) {
  628. res.data.data.data.forEach(item => {
  629. this.list.push(item);
  630. });
  631. }
  632. }
  633. });
  634. },
  635. //提交流程面板
  636. submission() {
  637. this.http.request({
  638. url: this.http.urls.documents + this.id + '/panels/submission',
  639. data: this.items,
  640. method: 'POST',
  641. success: res => {
  642. //this.item=res.data.data;
  643. console.log('zx22:' + JSON.stringify(res));
  644. this.show = true;
  645. this.title = res.data.data.name;
  646. this.nextNodes = res.data.data.nextNodes;
  647. this.itemt.flowId = res.data.data.flowId;
  648. this.itemt.flowType = '80';
  649. this.itemt.currentNodeId = res.data.data.currentNodeId;
  650. this.itemt.attitude = '';
  651. this.itemt.signature = '';
  652. this.itemt.submitTo = [];
  653. this.itemt.circulatorInfo = '';
  654. this.itemt.subFlowApproverInfo = '';
  655. this.itemt.subFlowApproverInfoAll = '';
  656. this.itemt.document = this.items.document;
  657. //this.content=res.data.data.formname;
  658. }
  659. });
  660. }, //提交流程
  661. submit() {
  662. //this.itemt.document.items.purpose="试验目的5656";
  663. //this.itemt.document.items.title="标题5656";
  664. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  665. this.itemt.docId = this.iteml.id;
  666. this.itemt.id = this.iteml.id;
  667. this.itemt.formId = this.iteml.formid;
  668. this.itemt.parentId = '';
  669. this.itemt.subFlowApprover = [];
  670. this.itemt.subSelects = [];
  671. //this.itemt.submitTo = [];
  672. this.itemt.templateForm = '';
  673. this.itemt.viewId = '';
  674. if(this.stues=='任务分派'||this.stues=='报告编制'||this.stues=='报告审核'){
  675. if(this.itemt.submitTo.length == 0){
  676. uni.showModal({
  677. title: '提示',
  678. content: '请选择审批人',
  679. showCancel: false,
  680. success: res => {
  681. if (res.confirm) {
  682. // uni.navigateBack();
  683. }
  684. }
  685. });
  686. return;
  687. }
  688. }
  689. this.http.request({
  690. url: this.http.urls.documents + this.id + '/workflows/submit',
  691. data: this.itemt,
  692. method: 'PUT',
  693. success: res => {
  694. //this.item=res.data.data;
  695. console.log('zx22:' + JSON.stringify(res));
  696. this.show = false;
  697. uni.$emit('index');
  698. uni.redirectTo({
  699. url: '/pages/index/index'
  700. });
  701. //this.content=res.data.data.formname;
  702. }
  703. });
  704. }, //刷新数据
  705. //回退流程面板
  706. back() {
  707. this.http.request({
  708. url: this.http.urls.documents + this.id + '/panels/back',
  709. data: this.items,
  710. method: 'POST',
  711. success: res => {
  712. //this.item=res.data.data;
  713. console.log('zx22:' + JSON.stringify(res.data.data));
  714. this.bshow = true;
  715. this.title = res.data.data.name;
  716. this.backNodes = res.data.data.backNodes;
  717. this.itemt.flowId = res.data.data.flowId;
  718. this.itemt.flowType = '81';
  719. this.itemt.currentNodeId = res.data.data.currentNodeId;
  720. this.itemt.attitude = '';
  721. this.itemt.signature = '';
  722. //this.itemt.submitTo = [];
  723. this.itemt.circulatorInfo = '';
  724. this.itemt.subFlowApproverInfo = '';
  725. this.itemt.subFlowApproverInfoAll = '';
  726. this.itemt.document = this.items.document;
  727. //this.content=res.data.data.formname;
  728. }
  729. });
  730. }, //提交回退流程
  731. workflowsback() {
  732. //this.itemt.document.items.purpose="试验目的111";
  733. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  734. this.itemt.docId = this.iteml.id;
  735. this.itemt.id = this.iteml.id;
  736. this.itemt.formId = this.iteml.formid;
  737. this.itemt.parentId = '';
  738. this.itemt.subFlowApprover = [];
  739. this.itemt.subSelects = [];
  740. //this.itemt.submitTo = [];
  741. this.itemt.templateForm = '';
  742. this.itemt.viewId = '';
  743. this.http.request({
  744. url: this.http.urls.documents + this.id + '/workflows/back',
  745. data: this.itemt,
  746. method: 'PUT',
  747. success: res => {
  748. //this.item=res.data.data;
  749. console.log('zx22:' + JSON.stringify(res));
  750. this.bshow = false;
  751. uni.$emit('index');
  752. uni.redirectTo({
  753. url: '/pages/index/index'
  754. });
  755. //this.content=res.data.data.formname;
  756. }
  757. });
  758. }
  759. }
  760. };
  761. </script>
  762. <style lang="scss">
  763. .pages {
  764. padding-bottom: 85px;
  765. }
  766. </style>