detail.vue 23 KB

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