borrowing.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <template>
  2. <view class="page">
  3. <view class="vtitle">借用人信息</view>
  4. <view class="form_group">
  5. <view class="lable">扫码</view>
  6. <view class="tag" @click="sm=true">
  7. <text class="span" style="width: 90%;">{{ code }}</text>
  8. <text class="icon code">&#xe60e;</text>
  9. </view>
  10. </view>
  11. <view class="form_group" v-if="op == '设备借用11'">
  12. <view class="lable">设备所属部门</view>
  13. <view class="tag">
  14. <view class="span">
  15. <picker @change="bindChange($event, 'dept')" :range="array1">
  16. <view class="picks">{{ item.dept ? item.dept : '选择2' }}</view>
  17. </picker>
  18. </view>
  19. <text class="icon more">&#xe631;</text>
  20. </view>
  21. </view>
  22. <view class="form_group">
  23. <view class="lable">借用人</view>
  24. <view class="tag">
  25. <input v-model="item.borrower" placeholder="输入借用人" />
  26. <text class="icon more">&#xe631;</text>
  27. </view>
  28. </view>
  29. <view class="form_group">
  30. <view class="lable">借用人部门</view>
  31. <view class="tag">
  32. <text class="span">{{ item.UNIT }}</text>
  33. <text class="icon more">&#xe631;</text>
  34. </view>
  35. </view>
  36. <view class="form_group">
  37. <view class="lable">手机号</view>
  38. <view class="tag">
  39. <input v-model="item.tel" placeholder="输入手机号" />
  40. <text class="icon more">&#xe631;</text>
  41. </view>
  42. </view>
  43. <view class="vtitle">借用设备信息</view>
  44. <view v-if="id">
  45. <view v-for="(item, index) in list" :key="index" class="item">
  46. <view class="form_group">
  47. <view class="lable">序号</view>
  48. <view class="tag">
  49. <text class="span">{{ index + 1 }}</text>
  50. </view>
  51. </view>
  52. <view class="form_group">
  53. <view class="lable">计量编号</view>
  54. <view class="tag">
  55. <text class="span">{{ item.items.__9ahUISXb1tM05xyD8UZ.value }}</text>
  56. </view>
  57. </view>
  58. <view class="form_group">
  59. <view class="lable">设备名称</view>
  60. <view class="tag">
  61. <text class="span">{{ item.items.__XrMyKpQJ7SfuTIhC0sk.value }}</text>
  62. </view>
  63. </view>
  64. <view class="form_group">
  65. <view class="lable">型号规格</view>
  66. <view class="tag">
  67. <text class="span">{{ item.items.__u8C4lICfaKzYYXt29WH.value }}</text>
  68. </view>
  69. </view>
  70. <view class="form_group">
  71. <view class="lable">测量范围</view>
  72. <view class="tag">
  73. <text class="span">{{ item.items.__aFNTBUh2rsvSMhRBU3Y.value }}</text>
  74. </view>
  75. </view>
  76. <view class="form_group">
  77. <view class="lable">最大允许误差</view>
  78. <view class="tag">
  79. <text class="span">{{ item.items.__J7HDuFkewsz1IRUnFKD.value }}</text>
  80. </view>
  81. </view>
  82. <view class="form_group">
  83. <view class="lable">内部编号</view>
  84. <view class="tag">
  85. <text class="span">{{ item.items.__F9KplKpwzKDy4ZQZMtI.value }}</text>
  86. </view>
  87. </view>
  88. <view class="form_group"><!-- <button class="btn del" @click="del(item)">移除</button> --></view>
  89. </view>
  90. </view>
  91. <view v-else>
  92. <view v-for="(item, index) in list" :key="index" class="item">
  93. <view class="form_group">
  94. <view class="lable">序号</view>
  95. <view class="tag">
  96. <text class="span">{{ index + 1 }}</text>
  97. </view>
  98. </view>
  99. <view class="form_group">
  100. <view class="lable">计量编号</view>
  101. <view class="tag">
  102. <text class="span">{{ item.items.__b5UmDDfLaCJJdn5F4JF.value }}</text>
  103. </view>
  104. </view>
  105. <view class="form_group">
  106. <view class="lable">设备名称</view>
  107. <view class="tag">
  108. <text class="span">{{ item.items.__FwAgiHdxI4bCZaKNs4A.value }}</text>
  109. </view>
  110. </view>
  111. <view class="form_group">
  112. <view class="lable">型号规格</view>
  113. <view class="tag">
  114. <text class="span">{{ item.items.__drInpQcmkMf2iWseaRR.value }}</text>
  115. </view>
  116. </view>
  117. <view class="form_group">
  118. <view class="lable">测量范围</view>
  119. <view class="tag">
  120. <text class="span">{{ item.items.__XcfZD8dzEQb5qURydpP.value }}</text>
  121. </view>
  122. </view>
  123. <view class="form_group">
  124. <view class="lable">最大允许误差</view>
  125. <view class="tag">
  126. <text class="span">{{ item.items.__ARvSmuzLwNLg6TlB4tV.value }}</text>
  127. </view>
  128. </view>
  129. <view class="form_group">
  130. <view class="lable">内部编号</view>
  131. <view class="tag">
  132. <text class="span">{{ item.items.__BEViJOuGBdPWSxES5Z5.value }}</text>
  133. </view>
  134. </view>
  135. <view class="form_group"><button class="btn del" @click="del(item)">移除</button></view>
  136. </view>
  137. </view>
  138. <u-empty v-if="list.length == 0"></u-empty>
  139. <view class="footer">
  140. <view class="flex">
  141. <view class="f"><button class="btn br" @click="submission()">提交</button></view>
  142. <!-- <view class="f" v-if="state == 1"><button class="btn br back" @click="back()">回退</button></view>
  143. <view class="f"><button class="btn" @click="validate()">保存</button></view>-->
  144. </view>
  145. </view>
  146. <u-popup :show="show" mode="bottom" @close="show = false" closeable round="15">
  147. <view class="popup">
  148. <u-divider text="提交流程面板"></u-divider>
  149. <scroll-view scroll-y="true" style="height: 450rpx;">
  150. <view v-for="(item, index) in nextNodes" :key="index" class="bitem" @click="bselect(item, 'nextNodes')">
  151. <view class="icon select check" v-if="item.check">&#xe600;</view>
  152. <view class="icon select" v-else>&#xe8bb;</view>
  153. <view class="title">{{ item.name }}</view>
  154. </view>
  155. <textarea placeholder="意见" style="height: 120px;" maxlength="200" v-model="itemt.attitude" />
  156. </scroll-view>
  157. <view class="confrim-btn"><button class="btn" @click="submit()">确定</button></view>
  158. </view>
  159. </u-popup>
  160. <u-popup :show="bshow" mode="bottom" @close="bshow = false" closeable round="15">
  161. <view class="popup">
  162. <u-divider text="回退流程面板"></u-divider>
  163. <scroll-view scroll-y="true" style="height: 450rpx;">
  164. <view v-for="(item, index) in backNodes" :key="index" class="bitem" @click="bselect(item, 'backNodes')">
  165. <view class="icon select check" v-if="item.check">&#xe600;</view>
  166. <view class="icon select" v-else>&#xe8bb;</view>
  167. <view class="title">{{ item.name }}</view>
  168. </view>
  169. <textarea placeholder="意见" style="height: 120px;" maxlength="200" v-model="itemt.attitude" />
  170. </scroll-view>
  171. <view class="confrim-btn"><button class="btn" @click="workflowsback()">确定</button></view>
  172. </view>
  173. </u-popup>
  174. <mumu-get-qrcode @success="qrcodeSucess" @error="qrcodeError" v-if="sm"></mumu-get-qrcode>
  175. </view>
  176. </template>
  177. <script>
  178. import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue';
  179. export default {
  180. components: {
  181. mumuGetQrcode
  182. },
  183. data() {
  184. return {
  185. sm:false,//扫码
  186. array1: ['类型1', '类型2', '类型3', '类型4'], //实验类型1
  187. bitem: {
  188. applicationId: '__gAPYBW4YxB3UePM3lqO',
  189. exparams: {},
  190. formId: '__0FLGNncOS1lz0T9jsFn',
  191. id: '__79Wtw03ya4dJUDGPyAN',
  192. isRelate: 'undefined',
  193. parentId: '',
  194. sign: '',
  195. subDocuments: [],
  196. templateForm: '',
  197. versions: '0'
  198. },
  199. btitem: {
  200. applicationId: '__gAPYBW4YxB3UePM3lqO',
  201. exparams: {},
  202. formId: '__0FLGNncOS1lz0T9jsFn',
  203. id: '__79Wtw03ya4dJUDGPyAN',
  204. isRelate: 'undefined',
  205. parentId: '',
  206. sign: '',
  207. subDocuments: [],
  208. templateForm: '',
  209. versions: '0'
  210. },
  211. geteq: {
  212. DEVID: '202209211603170016',
  213. allow: 'false',
  214. appId: '__gAPYBW4YxB3UePM3lqO',
  215. datetime: '1670485443880',
  216. detp: '',
  217. fieldid: '__iLwKGJTxD89ZKnFzo2Y',
  218. formId: '__w9J1gxcIWgXmNw6pE1F',
  219. isEdit: 'true',
  220. mutil: 'true',
  221. parentId: '__NYI0rVs0LXbiW21z6Nv',
  222. searchForm: 'false',
  223. selectOne: 'false',
  224. viewId: '__WLVxKX6e0Pq0cTwdNUQ'
  225. },
  226. item: {},
  227. op: '设备借用',
  228. current: 0,
  229. code: '',
  230. list: [],
  231. show: false,
  232. bshow: false,
  233. itemt: {},
  234. up: {},
  235. id: '',
  236. content: '标题',
  237. nextNodes: [],
  238. backNodes: [],
  239. items: {
  240. document: {
  241. items: {}
  242. }
  243. },
  244. runViewDialogConfirmScript: {
  245. docId: "__DIl607e1fsiknRgGRQj",
  246. document: {
  247. items: {
  248. group: "",
  249. depttool: "",
  250. UNIT: "柳工",
  251. borrower: "",
  252. tel: "",
  253. remarks: ""
  254. },
  255. },
  256. fieldId: "__0TQu1UrRbMZVX1UvtBL",
  257. formId: "__w9J1gxcIWgXmNw6pE1F",
  258. viewId: "__WLVxKX6e0Pq0cTwdNUQ",
  259. _selects: "__sIJiL5GlxEYoL095Vo9",
  260. },
  261. };
  262. },
  263. onLoad(e) {
  264. this.op = e.op;
  265. this.id = e.id;
  266. if (e.ste == 1) {
  267. /* this.http.request({
  268. url: this.http.urls.xxxx + e.id,
  269. success: res => {
  270. this.item = res.data.data;
  271. }
  272. }); */
  273. this.getDocuments();
  274. } else {
  275. this.empty();
  276. }
  277. //选中审批人员监听函数,其它类型的参考这个
  278. uni.$on('select', res => {
  279. console.log('asd:' + JSON.stringify(res));
  280. });
  281. },
  282. onReady() {
  283. uni.setNavigationBarTitle({
  284. title: this.op
  285. });
  286. },
  287. methods: {
  288. //提交或回退
  289. bselect(e, tag) {
  290. this[tag].forEach(item => {
  291. item.check = false;
  292. });
  293. e.check = true;
  294. this.itemt.nextNodeIds = [];
  295. this.itemt.nextNodeIds.push(e.id);
  296. this.$forceUpdate();
  297. }, //详情
  298. qr() {
  299. // 调用uni提供的调用相机api
  300. uni.chooseImage({
  301. sizeType: ['original'],
  302. sourceType: ['camera'],
  303. count: 1,
  304. success: res => {
  305. const tempFilePaths = res.tempFilePaths[0]; // 获取到二维码图片的链接
  306. qrcode.decode(tempFilePaths); // 解析二维码图片
  307. qrcode.callback = r => {
  308. var r1 = r.split('*')[1]
  309. this.code = r1;
  310. if (!this.code) {
  311. uni.showModal({
  312. title: '提示',
  313. content: '该二维码无法识别!!',
  314. showCancel: false,
  315. success: res => {
  316. if (res.confirm) {
  317. // uni.navigateBack();
  318. }
  319. }
  320. });
  321. return;
  322. }
  323. this.geteq.DEVID = this.code;
  324. if (this.list.length == 0) {
  325. this.getEq();
  326. } else {
  327. this.list.forEach(item => {
  328. if (item.items.__2sfNVgOh5Bzq6lXRVuM.value == this.geteq
  329. .DEVID) {
  330. uni.showModal({
  331. title: '提示',
  332. content: '该设备已经选择过了',
  333. showCancel: false,
  334. success: res => {
  335. if (res.confirm) {
  336. // uni.navigateBack();
  337. }
  338. }
  339. });
  340. } else {
  341. this.getEq();
  342. }
  343. });
  344. }
  345. console.log('asd:' + r);
  346. this.$forceUpdate();
  347. };
  348. }
  349. });
  350. },
  351. //扫码成功
  352. qrcodeSucess(data) {
  353. this.sm=false;
  354. uni.showModal({
  355. title: '成功',
  356. content: data //识别的数据
  357. });
  358. var r1 = data.split('*')[1]
  359. this.code = r1;
  360. this.geteq.DEVID = this.code;
  361. if (this.list.length == 0) {
  362. this.getEq();
  363. } else {
  364. this.list.forEach(item => {
  365. if (item.items.__2sfNVgOh5Bzq6lXRVuM.value == this.geteq
  366. .DEVID) {
  367. uni.showModal({
  368. title: '提示',
  369. content: '该设备已经选择过了',
  370. showCancel: false,
  371. success: res => {
  372. if (res.confirm) {
  373. // uni.navigateBack();
  374. }
  375. }
  376. });
  377. } else {
  378. this.getEq();
  379. }
  380. });
  381. }
  382. },
  383. qrcodeError(err) {
  384. console.log(err);
  385. uni.showModal({
  386. title: '摄像头授权失败',
  387. content: '摄像头授权失败,请检测当前浏览器是否有摄像头权限。',
  388. success: res => {
  389. console.log('asd:' + JSON.stringify(res));
  390. this.sm=false;
  391. }
  392. });
  393. },
  394. //选择结果形式
  395. change(e) {
  396. this.current = e;
  397. console.log('aa:' + this.radio[this.current].name);
  398. },
  399. //选择实验类型
  400. bindChange(e, type) {
  401. this.item[type] = this.array1[e.target.value];
  402. this.$forceUpdate();
  403. },
  404. //选择审批人员
  405. select() {
  406. uni.navigateTo({
  407. url: '/pages/index/select'
  408. });
  409. },
  410. //详情
  411. getDocuments() {
  412. this.http.request({
  413. url: this.http.urls.documents + this.id,
  414. data: this.item,
  415. success: res => {
  416. this.item = res.data.data.items;
  417. //this.p = res.data.data;
  418. //console.log('res.data.data:' + JSON.stringify(res.data.data));
  419. this.boor_list();
  420. this.iteml = res.data.data;
  421. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  422. this.items.docId = this.iteml.id;
  423. this.items.id = this.iteml.id;
  424. this.items.formId = this.iteml.formid;
  425. this.items.parentId = '';
  426. this.items.subSelects = [];
  427. this.items.templateForm = '';
  428. this.items.viewId = '';
  429. this.items.document.items = this.item;
  430. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  431. this.items.document.exparams = {};
  432. this.items.document.formId = this.iteml.formid;
  433. this.items.document.id = this.iteml.id;
  434. this.items.document.parentId = '';
  435. this.items.document.sign = '';
  436. this.items.document.stateId = this.iteml.stateid;
  437. this.items.document.subDocuments = [];
  438. this.items.document.templateForm = '';
  439. this.items.document.versions = '0';
  440. }
  441. });
  442. },
  443. getEq() {
  444. this.http.request({
  445. url: this.http.urls.eq_list +
  446. 'parentId=' +
  447. this.geteq.parentid,
  448. data: this.geteq,
  449. method: 'POST',
  450. success: res => {
  451. //console.log('res2:' + JSON.stringify(res.data.data.data));
  452. if (res.data.errcode == 0) {
  453. if (res.data.data.data.length>0) {
  454. res.data.data.data.forEach(item => {
  455. this.list.push(item);
  456. });
  457. }else{
  458. uni.showModal({
  459. title: '提示',
  460. content: '该设备不在该部门或者正在在借用中',
  461. showCancel: false,
  462. success: res => {
  463. if (res.confirm) {
  464. // uni.navigateBack();
  465. }
  466. }
  467. });
  468. }
  469. }
  470. }
  471. });
  472. },
  473. boor_list() {
  474. this.http.request({
  475. url: this.http.urls.boor_list +
  476. 'parentId=' +
  477. this.id,
  478. method: 'POST',
  479. success: res => {
  480. console.log('res2:' + JSON.stringify(res));
  481. if (res.data.errcode == 0) {
  482. res.data.data.data.forEach(item => {
  483. this.list.push(item);
  484. });
  485. }
  486. }
  487. });
  488. },
  489. empty() {
  490. var url = '';
  491. if (this.op == '设备借用') {
  492. url = this.http.urls.borr_empty;
  493. } else {
  494. url = this.http.urls.return_empty;
  495. }
  496. this.http.request({
  497. url: url,
  498. data: this.item,
  499. success: res => {
  500. this.item = res.data.data.items;
  501. this.bitem.id = res.data.data.id;
  502. this.bitem.formId = res.data.data.formid;
  503. this.bitem.versions = res.data.data.versions;
  504. this.geteq.parentid = res.data.data.id;
  505. //创建时组建提交流程面板请求数据
  506. this.iteml = res.data.data;
  507. this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
  508. this.items.docId = this.iteml.id;
  509. this.items.id = this.iteml.id;
  510. this.items.formId = this.iteml.formid;
  511. this.items.parentId = '';
  512. this.items.subSelects = [];
  513. this.items.templateForm = '';
  514. this.items.viewId = '';
  515. this.items.document.items = this.item;
  516. this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
  517. this.items.document.exparams = {};
  518. this.items.document.formId = this.iteml.formid;
  519. this.items.document.id = this.iteml.id;
  520. this.items.document.parentId = '';
  521. this.items.document.sign = '';
  522. this.items.document.stateId = this.iteml.stateid;
  523. this.items.document.subDocuments = [];
  524. this.items.document.templateForm = '';
  525. this.items.document.versions = '0';
  526. //console.log('res2:' + JSON.stringify(res.data.data));
  527. }
  528. });
  529. },
  530. //移除借用设备信息
  531. del(item) {
  532. this.list.splice(this.list.indexOf(item), 1);
  533. },
  534. tool_borrowing_empty() {
  535. this.list.forEach(item => {
  536. this.http.request({
  537. url: this.http.urls.tool_borrowing_empty,
  538. data: this.item,
  539. success: res => {
  540. console.log('tool_borrowing_empty:' + JSON.stringify(res));
  541. //this.item = res.data.data.items;
  542. console.log('this.bitem:' + JSON.stringify(this.bitem));
  543. this.btitem.id = res.data.data.id;
  544. this.btitem.formId = res.data.data.formid;
  545. this.btitem.versions = res.data.data.versions;
  546. this.btitem.parentId = this.bitem.id;
  547. //this.btitem.parent=this.bitem.id;
  548. this.btitem.items = res.data.data.items;
  549. this.btitem.items.HERST = item.items.__SH6ZSHZMqHeGHDFLAaO.value; //
  550. this.btitem.items.TYPBZ = item.items.__drInpQcmkMf2iWseaRR.value; //
  551. this.btitem.items.EQKTX = item.items.__FwAgiHdxI4bCZaKNs4A.value; //
  552. this.btitem.items.FBL = item.items.__Tyyw12PleIHLPjjJWsV.value; //
  553. this.btitem.items.TPLNR = item.items.__a7cgJzxvCbcNNH0KjCn.value; //
  554. this.btitem.items.EQUNR = item.items.__b5UmDDfLaCJJdn5F4JF.value; //
  555. this.btitem.items.NUMBER = item.items.__2sfNVgOh5Bzq6lXRVuM.value;
  556. this.btitem.items.CLFW = item.items.__XcfZD8dzEQb5qURydpP.value; //
  557. this.btitem.items.borrowing_date = this.util.getDate('time'); //借用日期
  558. this.btitem.items.ZQDDJ = item.items.__Rhr5ihIebMolSIr8CKn.value; //
  559. this.btitem.items.ZDYXWC = item.items.__ARvSmuzLwNLg6TlB4tV.value; //
  560. this.btitem.items.STTXU = item.items.__SBtfwetYprHFQ5J2MAn.value; //
  561. this.btitem.items.SERGE = item.items.__qyobrAFN4PtseWXiY5A.value; //
  562. this.btitem.items.INTNUM = item.items.__BEViJOuGBdPWSxES5Z5.value; //
  563. this.btitem.items.NPLDA = item.items.__R8QpJNSHAVFaYwHnVCo.value; //
  564. //this.btitem.items.toolstate=0;//借用日期
  565. this.btitem.items.DEVID = item.items.__2sfNVgOh5Bzq6lXRVuM.value;
  566. console.log('this.btitem1:' + JSON.stringify(this.btitem));
  567. this.validate();
  568. //console.log('res2:' + JSON.stringify(res.data.data));
  569. }
  570. });
  571. });
  572. },
  573. //提交
  574. validate() {
  575. this.http.request({
  576. url: this.http.urls.validate +
  577. '?parentId=' +
  578. this.btitem.parentId,
  579. data: this.btitem,
  580. method: 'POST',
  581. success: res => {
  582. console.log('validate1:' + JSON.stringify(res));
  583. this.updateparent(this.btitem.parentId, res.data.data.id);
  584. }
  585. });
  586. },
  587. updateparent(parent, id) {
  588. this.http.request({
  589. url: this.http.urls.update_parent + 'parent=' + parent + '&id=' + id +
  590. '&table=tlk_tool_borrowing',
  591. method: 'POST',
  592. success: res => {
  593. console.log('validate1:' + JSON.stringify(res));
  594. }
  595. });
  596. },
  597. //提交流程面板
  598. submission() {
  599. //this.validatet();
  600. this.http.request({
  601. url: this.http.urls.documents + this.bitem.id + '/panels/submission',
  602. data: this.items,
  603. method: 'POST',
  604. success: res => {
  605. //this.item=res.data.data;
  606. //console.log('zx22:' + JSON.stringify(res));
  607. this.show = true;
  608. this.title = res.data.data.name;
  609. this.nextNodes = res.data.data.nextNodes;
  610. this.itemt.flowId = res.data.data.flowId;
  611. this.itemt.flowType = '80';
  612. this.itemt.currentNodeId = res.data.data.currentNodeId;
  613. this.itemt.attitude = '';
  614. this.itemt.signature = '';
  615. this.itemt.submitTo = '';
  616. this.itemt.circulatorInfo = '';
  617. this.itemt.subFlowApproverInfo = '';
  618. this.itemt.subFlowApproverInfoAll = '';
  619. this.itemt.document = this.items.document;
  620. //this.content=res.data.data.formname;
  621. }
  622. });
  623. }, //提交流程
  624. submit() {
  625. //this.itemt.document.items.purpose="试验目的5656";
  626. //this.itemt.document.items.title="标题5656";
  627. if (this.itemt.document.items.borrower == '' || this.itemt.document.items.borrower == null) {
  628. uni.showModal({
  629. title: '提示',
  630. content: '请填写借用人',
  631. showCancel: false,
  632. success: res => {
  633. if (res.confirm) {
  634. //uni.navigateBack();
  635. }
  636. }
  637. });
  638. return;
  639. }
  640. if (this.itemt.document.items.tel == '' || this.itemt.document.items.tel == null) {
  641. uni.showModal({
  642. title: '提示',
  643. content: '请填写手机号',
  644. showCancel: false,
  645. success: res => {
  646. if (res.confirm) {
  647. //uni.navigateBack();
  648. }
  649. }
  650. });
  651. return;
  652. }
  653. this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
  654. this.itemt.docId = this.iteml.id;
  655. this.itemt.id = this.iteml.id;
  656. this.itemt.formId = this.iteml.formid;
  657. this.itemt.parentId = '';
  658. this.itemt.subFlowApprover = [];
  659. this.itemt.subSelects = [];
  660. this.itemt.submitTo = [];
  661. this.itemt.templateForm = '';
  662. this.itemt.viewId = '';
  663. this.http.request({
  664. url: this.http.urls.documents + this.id + '/workflows/submit',
  665. data: this.itemt,
  666. method: 'PUT',
  667. success: res => {
  668. //this.item=res.data.data;
  669. console.log('zx22:' + JSON.stringify(res));
  670. if (res.data.errcode == 0) {
  671. uni.showModal({
  672. title: '提示',
  673. content: res.data.data,
  674. showCancel: false,
  675. success: res => {
  676. if (res.confirm) {
  677. uni.navigateBack();
  678. }
  679. }
  680. });
  681. if (this.id == null) {
  682. this.tool_borrowing_empty();
  683. }
  684. } else {
  685. uni.showModal({
  686. title: '提示',
  687. content: res.data.errmsg,
  688. showCancel: false,
  689. success: res => {
  690. if (res.confirm) {
  691. //uni.navigateBack();
  692. }
  693. }
  694. });
  695. }
  696. this.show = false;
  697. this.title = res.data.data.name;
  698. this.nextNodes = res.data.data.nextNodes;
  699. }
  700. });
  701. }, //刷新数据
  702. //提交
  703. add() {
  704. this.http.request({
  705. url: this.http.urls.user_task_add,
  706. data: this.item,
  707. method: 'POST',
  708. success: res => {
  709. uni.showModal({
  710. title: '提示',
  711. content: '提交成功',
  712. showCancel: false,
  713. success: res => {
  714. if (res.confirm) {
  715. uni.navigateBack();
  716. }
  717. }
  718. });
  719. }
  720. });
  721. }
  722. }
  723. };
  724. </script>
  725. <style lang="scss">
  726. .page {
  727. padding-bottom: 80px;
  728. }
  729. .item {
  730. margin-bottom: 10px;
  731. }
  732. .del {
  733. width: 70%;
  734. background-color: #e64340;
  735. }
  736. </style>