WorkFlowAudit.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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=="-1"){
  102. uni.showToast({
  103. title:'要审核的记录不存在',
  104. duration:4000,
  105. icon:'none'
  106. })
  107. }
  108. else if(res=="-2"){
  109. uni.showToast({
  110. title:'此记录已经被审核,不能重复审核',
  111. duration:4000,
  112. icon:'none'
  113. })
  114. }
  115. else{
  116. uni.navigateBack({
  117. delta:3
  118. });
  119. /* uni.navigateTo({
  120. url:'/pages/template/requisitiondetail/requisitiondetail?id='+applicationCode
  121. }); */
  122. }
  123. });
  124. },
  125. GetDropDown:function(){
  126. let that=this;
  127. let userCode=this.$util.getState(this,'userCode');
  128. let procedureCode=this.$util.getQuery("procedureCode");
  129. WorkFlowAudit(userCode,procedureCode).then((res)=>{
  130. console.info('WorkFlowAudit:',res);
  131. that.isShowHand=res.isShowHand;
  132. that.isShowUnit=res.isShowUnit;
  133. res.list.forEach(function(item,index,array){
  134. that.$set(that.array,index,item);
  135. });
  136. that.array.unshift({unitCode:'',funllCode:'',fullName:'--请选择--'});
  137. //赋默认值
  138. //that.viseType=that.array[0];
  139. //console.info(that.viseType);
  140. if(that.isShowHand==false&&that.isShowUnit==false){
  141. that.submitForm();
  142. }
  143. });
  144. },
  145. /* 经办人部门选择 */
  146. bindPickerChange: function(e) {
  147. //console.log('picker发送选择改变,携带值为:' + e.detail.value);
  148. console.info('bindPickerChange',e.detail.value);
  149. this.index = e.detail.value;
  150. this.unitCode=this.array[this.index].unitCode;
  151. console.info(this.unitCode);
  152. },
  153. /* 单选按钮选择 */
  154. radioChange: function(evt) {
  155. console.info('radioChange',evt.target.value);
  156. this.radioValue = evt.target.value;
  157. },
  158. }
  159. }
  160. </script>
  161. <style scoped>
  162. /* 头条小程序组件内不能引入字体 */
  163. /* #ifdef MP-TOUTIAO */
  164. @font-face {
  165. font-family: uniicons;
  166. font-weight: normal;
  167. font-style: normal;
  168. src: url("~@/static/uni.ttf") format("truetype");
  169. }
  170. /* #endif */
  171. page {
  172. display: flex;
  173. flex-direction: column;
  174. box-sizing: border-box;
  175. background-color: #efeff4;
  176. min-height: 100%;
  177. height: auto;
  178. }
  179. view {
  180. font-size: 14px;
  181. line-height: inherit;
  182. }
  183. .uni-form-item__title {
  184. font-size: 16px;
  185. line-height: 24px;
  186. }
  187. .uni-input-wrapper {
  188. /* #ifndef APP-NVUE */
  189. display: flex;
  190. /* #endif */
  191. padding: 8px 13px;
  192. flex-direction: row;
  193. flex-wrap: nowrap;
  194. background-color: #FFFFFF;
  195. }
  196. .title{
  197. background-color: #efefef;
  198. }
  199. .uni-input {
  200. height: 28px;
  201. line-height: 28px;
  202. font-size: 15px;
  203. padding: 0px;
  204. flex: 1;
  205. background-color: #FFFFFF;
  206. }
  207. .uni-icon {
  208. font-family: uniicons;
  209. font-size: 24px;
  210. font-weight: normal;
  211. font-style: normal;
  212. width: 24px;
  213. height: 24px;
  214. line-height: 24px;
  215. margin-left:15px;
  216. color: #999999;
  217. }
  218. .uni-eye-active {
  219. color: #007AFF;
  220. }
  221. .uni-btn-v{
  222. position: fixed;
  223. bottom: 0;
  224. width:100%;
  225. }
  226. .header-slot-box {
  227. font-size:15px;
  228. margin: 5px 5px;
  229. width:20%;
  230. justify-content: center;
  231. }
  232. .body-slot-box {
  233. font-size:15px;
  234. margin: 5px 5px;
  235. width:40%;
  236. justify-content: center;
  237. }
  238. .footer-slot-box {
  239. font-size:15px;
  240. margin: 5px 5px;
  241. width:40%;
  242. justify-content: center;
  243. }
  244. .uni-textarea textarea{
  245. font-size:15px;
  246. }
  247. .content {
  248. padding: 40rpx;
  249. background-color: #fff;
  250. }
  251. /* 上传控件 */
  252. .uploadControl {
  253. border: 1rpx solid #eee;
  254. border-radius: 10rpx;
  255. width: 130rpx;
  256. display: block;
  257. height: 130rpx;
  258. text-align: center;
  259. line-height: 130rpx;
  260. font-size: 30rpx;
  261. color: #888;
  262. background-color: #eeeeee;
  263. }
  264. .topicon >>> .icon{
  265. border: #4CD964 2upx solid;
  266. }
  267. </style>