addwt.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view>
  3. <view class="title">检测申请方填写</view>
  4. <view class="form_group">
  5. <view class="label">委托单编号</view>
  6. <view class="tag" @click="qr()">
  7. <text class="icon more">&#xe631;</text>
  8. <text class="icon span code">&#xe621;</text>
  9. <text class="span" style="padding-right: 5px;">{{ item.code }}</text>
  10. </view>
  11. </view>
  12. <view class="form_group">
  13. <view class="label">委托单编号</view>
  14. <view class="tag">
  15. <text class="icon more">&#xe631;</text>
  16. <text class="span">W000003496</text>
  17. </view>
  18. </view>
  19. <view class="form_group">
  20. <view class="label">结果形式</view>
  21. <view class="tag">
  22. <u-subsection :list="radio" :current="current" @change="change"></u-subsection>
  23. </view>
  24. </view>
  25. <view class="title">设置审批人员</view>
  26. <view class="form_group" @click="select()">
  27. <view class="label omit" style="width: 200px;">需求审核-产品经理或主管人员</view>
  28. <view class="tag">
  29. <text class="icon more">&#xe631;</text>
  30. <text class="span"></text>
  31. </view>
  32. </view>
  33. <view class="form_group" @click="select()">
  34. <view class="label omit" style="width: 200px;">试验审核-试验对接人</view>
  35. <view class="tag">
  36. <text class="icon more">&#xe631;</text>
  37. <text class="span"></text>
  38. </view>
  39. </view>
  40. <view class="title">样机</view>
  41. <view class="form_group">
  42. <view class="label">委托单编号</view>
  43. <view class="tag">
  44. <text class="icon more">&#xe631;</text>
  45. <text class="span">W000003496</text>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. let qrcode = require('@/common/code.js');
  52. export default {
  53. data() {
  54. return {
  55. item: {
  56. "id": "__4iXbTxbNmabPEfT6ewn1",
  57. "authorDeptIndex": "ZMMMGm5mnGCE4WvWFeI",
  58. "initiator": "__jFFZYvLIG6uFc7CdBMg",
  59. "audituser": "__jFFZYvLIG6uFc7CdBMg",
  60. "istmp": false,
  61. "versions": 9,
  62. "stateid": "__4iXbTxbNmabPEfT6ewn1-__NyhM8l0gFY9Y1llAFbF",
  63. "lastFlowOperation": "80",
  64. "auditorList": "{\"1649917430749\":[]}",
  65. "coAuditorList": "{\"1649917409179\":[]}",
  66. "stateInt": 1048576,
  67. "authorId": "__jFFZYvLIG6uFc7CdBMg",
  68. "formname": "检测主流程/examine",
  69. "formid": "__0FLGNncOS1lz0T9jsFn",
  70. "items": {
  71. "wt_num": "W100002553",
  72. "purpose": "667",
  73. "bg_template": null,
  74. "conclu_dept": null,
  75. "title": "1",
  76. "experiment_type": "整机性能",
  77. "rp_unstructured": null,
  78. "conclu_type": null,
  79. "test_ypmc": null,
  80. "WTXQSH": "__jFFZYvLIG6uFc7CdBMg",
  81. "WTRWFP": "__jFFZYvLIG6uFc7CdBMg",
  82. "unstructured": null,
  83. "b_inventory_wtnum": "W000002553",
  84. "test_conclusion": null,
  85. "test_ypnum": null,
  86. "NORO": "1",
  87. "tel": "15807800591",
  88. "conclu_wt_dept": "实验中心",
  89. "WTXQPZ": "__jFFZYvLIG6uFc7CdBMg",
  90. "test_template": null,
  91. "product": "装载机",
  92. "item": null,
  93. "conclu_remarks": null,
  94. "WTSYSH": "__jFFZYvLIG6uFc7CdBMg",
  95. "ste": "2",
  96. "conclu_sam_name": null,
  97. "test_factory": null,
  98. "wt_template": null,
  99. "report_type": "正式报告",
  100. "dept": "实验中心",
  101. "pro": null,
  102. "item_num": "1",
  103. "applicant": "__jFFZYvLIG6uFc7CdBMg",
  104. "OLDUSER": null,
  105. "WTSYPZ": "__jFFZYvLIG6uFc7CdBMg",
  106. "test_yptype": null,
  107. "appearance": null,
  108. "test_dept": "柳工",
  109. "b_inventory_title": "1",
  110. "teststa": null
  111. }
  112. },
  113. current: 0,
  114. radio: [{
  115. name: '正式报告'
  116. }, {
  117. name: '仅原始数据'
  118. }, {
  119. name: '协助试验'
  120. }]
  121. };
  122. },
  123. onLoad(e) {
  124. console.log('eeee:' + JSON.stringify(e));
  125. //传过来的id
  126. if (e.id) {
  127. /* this.http.request({
  128. url: this.http.urls.xxxx + e.id,
  129. success: res => {
  130. this.item = res.data.data;
  131. }
  132. }); */
  133. }
  134. //选中审批人员监听函数,其它类型的参考这个
  135. uni.$on('select', res => {
  136. console.log('asd:' + JSON.stringify(res));
  137. });
  138. },
  139. methods: {
  140. qr() {
  141. // 调用uni提供的调用相机api
  142. uni.chooseImage({
  143. sizeType: ['original'],
  144. sourceType: ['camera'],
  145. count: 1,
  146. success: res => {
  147. const tempFilePaths = res.tempFilePaths[0]; // 获取到二维码图片的链接
  148. qrcode.decode(tempFilePaths); // 解析二维码图片
  149. qrcode.callback = r => {
  150. this.item.code = r;
  151. console.log("asd:" + r);
  152. this.$forceUpdate();
  153. };
  154. }
  155. });
  156. },
  157. //选择结果形式
  158. change(e) {
  159. this.current = e;
  160. console.log('aa:' + this.radio[this.current].name);
  161. },
  162. //选择审批人员
  163. select() {
  164. uni.navigateTo({
  165. url: '/pages/index/select'
  166. });
  167. },
  168. //提交
  169. add() {
  170. this.http.request({
  171. url: this.http.urls.user_task_add,
  172. data: this.item,
  173. method: 'POST',
  174. success: res => {
  175. uni.showModal({
  176. title: '提示',
  177. content: '提交成功',
  178. showCancel: false,
  179. success: res => {
  180. if (res.confirm) {
  181. uni.navigateBack();
  182. }
  183. }
  184. });
  185. }
  186. });
  187. }
  188. }
  189. };
  190. </script>
  191. <style lang="scss">
  192. .title {
  193. padding: 12px;
  194. font-weight: bold;
  195. font-size: 16px;
  196. }
  197. .tag {
  198. float: right;
  199. margin-top: -18px;
  200. width: 70%;
  201. text-align: left;
  202. .span {
  203. float: right;
  204. color: #545555;
  205. }
  206. .code {
  207. font-size: 25px;
  208. }
  209. .more {
  210. float: right;
  211. margin-top: 2px;
  212. color: darkgray;
  213. }
  214. .uni-label-pointer {
  215. padding: 5px;
  216. }
  217. }
  218. </style>