WorkFlowAudit.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view>
  3. <uni-forms ref="form" labelPosition="left" labelAlign="left" @submit="submitForm">
  4. <view class="uni-form-item uni-column" v-show="isShowHand">
  5. <view class="title"><text class="uni-form-item__title">手送资料:</text></view>
  6. <radio-group @change="radioChange">
  7. <view style="background-color: #fff;">
  8. <label class="radio"><radio value="有" />有</label>
  9. <label class="radio"><radio value="无" />无</label>
  10. </view>
  11. </radio-group>
  12. </view>
  13. <view class="uni-form-item uni-column" v-show="isShowUnit">
  14. <view class="title"><text class="uni-form-item__title">经办人部门</text></view>
  15. <view class="uni-input-wrapper" style="justify-content: left;">
  16. <picker mode="selector" :value="unitCode" :range="array" range-key="fullName" @change="bindPickerChange" v-model="unitCode" style="width: 100%;" >
  17. <view class="uni-input">{{array.length>0?array[index].fullName:'--请选择--'}}</view>
  18. </picker>
  19. </view>
  20. </view>
  21. <view style="margin-bottom: 120px;">
  22. </view>
  23. <view class="uni-btn-v uni-column">
  24. <button type="primary" form-type="submit" style="border-radius: 15px;" >保存</button>
  25. </view>
  26. </uni-forms>
  27. </view>
  28. </template>
  29. <script>
  30. import {WorkFlowAudit,WorkFlowSave} from "@/common/api/commonApi.js";
  31. import {Decimal} from 'decimal.js'; //decimal计算
  32. export default {
  33. data() {
  34. return {
  35. array:[],
  36. radioValue:'',
  37. unitCode:'',
  38. index:0 ,
  39. isShowHand:false, //是否显示手送资料
  40. isShowUnit:false //是否显示经办人部门
  41. }
  42. },
  43. onLoad(){
  44. //console.info(page.path);
  45. console.info(uni.getStorageSync('storage_state'));
  46. //console.info(this);
  47. this.$util.persistLogin(this);
  48. //console.info(this.$store.state.user);
  49. },
  50. onUnload() {
  51. },
  52. created: function() {
  53. this.GetDropDown();
  54. },
  55. updated:function(){
  56. },
  57. methods: {
  58. /**
  59. * 手动提交
  60. * @param {Object} form
  61. */
  62. submitForm(e) {
  63. console.info('submitForm');
  64. let _this=this;
  65. if(_this.isShowHand){
  66. if(this.$util.isEmpty(this.radioValue))
  67. {
  68. uni.showToast({
  69. icon:"none",
  70. title:"请选择手送资料",
  71. duration:3000
  72. });
  73. return;
  74. }
  75. }
  76. if(_this.isShowUnit){
  77. if(this.$util.isEmpty(this.unitCode))
  78. {
  79. uni.showToast({
  80. icon:"none",
  81. title:"请选择经办人部门",
  82. duration:3000
  83. });
  84. return;
  85. }
  86. }
  87. //return;
  88. let hand=this.radioValue;
  89. let unitCode=this.unitCode;
  90. let procedureName=this.$util.getQuery("procedureName"); //流程名
  91. let applicationCode=this.$util.getQuery("applicationCode"); //流程审核项的主键ID
  92. let procedureCode=this.$util.getQuery("procedureCode"); //流程编码
  93. let projectCode=this.$util.getState(this,'projectCode');
  94. let userCode=this.$util.getState(this,'userCode');
  95. var data={procedureName:procedureName,applicationCode:applicationCode,procedureCode:procedureCode,projectCode:projectCode,unitCode:unitCode,hand:hand,userCode:userCode};
  96. console.info('data:',data);
  97. //return;
  98. WorkFlowSave(data).then((res)=>{
  99. console.info("提交应答");
  100. console.info(res);
  101. if(!res.isSuccess){
  102. uni.showToast({
  103. title:res.errMsg,
  104. duration:4000,
  105. icon:'none'
  106. })
  107. }
  108. else{
  109. let usercode=_this.$util.getState(_this,'userCode');
  110. let userid=_this.$store.state.user.userID;
  111. let un=this.$store.state.name;
  112. let url="http://1.193.162.246:18403/reception?type=gcy&usercode="+usercode+"&userid="+userid+"&actCode="+res.data+"&un="+encodeURIComponent(un);
  113. console.info("workflow url",url);
  114. //return;
  115. location.href=url;
  116. }
  117. });
  118. },
  119. GetDropDown:function(){
  120. let that=this;
  121. let userCode=this.$util.getState(this,'userCode');
  122. let procedureCode=this.$util.getQuery("procedureCode");
  123. WorkFlowAudit(userCode,procedureCode).then((res)=>{
  124. console.info('WorkFlowAudit:',res);
  125. that.isShowHand=res.isShowHand;
  126. that.isShowUnit=res.isShowUnit;
  127. res.list.forEach(function(item,index,array){
  128. that.$set(that.array,index,item);
  129. });
  130. that.array.unshift({unitCode:'',funllCode:'',fullName:'--请选择--'});
  131. //赋默认值
  132. //that.viseType=that.array[0];
  133. //console.info(that.viseType);
  134. if(that.isShowHand==false&&that.isShowUnit==false){
  135. that.submitForm();
  136. }
  137. });
  138. },
  139. /* 经办人部门选择 */
  140. bindPickerChange: function(e) {
  141. //console.log('picker发送选择改变,携带值为:' + e.detail.value);
  142. console.info('bindPickerChange',e.detail.value);
  143. this.index = e.detail.value;
  144. this.unitCode=this.array[this.index].unitCode;
  145. console.info(this.unitCode);
  146. },
  147. /* 单选按钮选择 */
  148. radioChange: function(evt) {
  149. console.info('radioChange',evt.target.value);
  150. this.radioValue = evt.target.value;
  151. },
  152. }
  153. }
  154. </script>
  155. <style scoped>
  156. /* 头条小程序组件内不能引入字体 */
  157. /* #ifdef MP-TOUTIAO */
  158. @font-face {
  159. font-family: uniicons;
  160. font-weight: normal;
  161. font-style: normal;
  162. src: url("~@/static/uni.ttf") format("truetype");
  163. }
  164. /* #endif */
  165. page {
  166. display: flex;
  167. flex-direction: column;
  168. box-sizing: border-box;
  169. background-color: #efeff4;
  170. min-height: 100%;
  171. height: auto;
  172. }
  173. view {
  174. font-size: 14px;
  175. line-height: inherit;
  176. }
  177. .uni-form-item__title {
  178. font-size: 16px;
  179. line-height: 24px;
  180. }
  181. .uni-input-wrapper {
  182. /* #ifndef APP-NVUE */
  183. display: flex;
  184. /* #endif */
  185. padding: 8px 13px;
  186. flex-direction: row;
  187. flex-wrap: nowrap;
  188. background-color: #FFFFFF;
  189. }
  190. .title{
  191. background-color: #efefef;
  192. }
  193. .uni-input {
  194. height: 28px;
  195. line-height: 28px;
  196. font-size: 15px;
  197. padding: 0px;
  198. flex: 1;
  199. background-color: #FFFFFF;
  200. }
  201. .uni-icon {
  202. font-family: uniicons;
  203. font-size: 24px;
  204. font-weight: normal;
  205. font-style: normal;
  206. width: 24px;
  207. height: 24px;
  208. line-height: 24px;
  209. margin-left:15px;
  210. color: #999999;
  211. }
  212. .uni-eye-active {
  213. color: #007AFF;
  214. }
  215. .uni-btn-v{
  216. position: fixed;
  217. bottom: 0;
  218. width:100%;
  219. }
  220. .header-slot-box {
  221. font-size:15px;
  222. margin: 5px 5px;
  223. width:20%;
  224. justify-content: center;
  225. }
  226. .body-slot-box {
  227. font-size:15px;
  228. margin: 5px 5px;
  229. width:40%;
  230. justify-content: center;
  231. }
  232. .footer-slot-box {
  233. font-size:15px;
  234. margin: 5px 5px;
  235. width:40%;
  236. justify-content: center;
  237. }
  238. .uni-textarea textarea{
  239. font-size:15px;
  240. }
  241. .content {
  242. padding: 40rpx;
  243. background-color: #fff;
  244. }
  245. /* 上传控件 */
  246. .uploadControl {
  247. border: 1rpx solid #eee;
  248. border-radius: 10rpx;
  249. width: 130rpx;
  250. display: block;
  251. height: 130rpx;
  252. text-align: center;
  253. line-height: 130rpx;
  254. font-size: 30rpx;
  255. color: #888;
  256. background-color: #eeeeee;
  257. }
  258. .topicon >>> .icon{
  259. border: #4CD964 2upx solid;
  260. }
  261. </style>