Blame view

pages/workFlow/operate/index.vue 2.38 KB
290144e9   易尊强   第一次
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  <template>
  	<view class="operate-v">
  		<scroll-view class="operate-area" scroll-y>
  			<view class="u-p-l-32 u-p-r-32 u-p-t-10"
  				v-if="config.eventType === 'revoke' || config.eventType === 'recall'">
  				<u-input v-model="dataForm.handleOpinion" type="textarea" placeholder="请输入撤回原因" height="500" />
  			</view>
  			<view class="ncc-wrap">
  				<u-form :model="dataForm" label-position="left" label-width="150" class="ncc-form"
  					v-if="config.eventType === 'audit' || config.eventType === 'reject'">
  					<u-form-item label="审批意见" prop="handleOpinion">
  						<u-input v-model="dataForm.handleOpinion" type="textarea" placeholder="请输入审批意见" />
  					</u-form-item>
  					<u-form-item label="加签人员" prop="freeApproverUserId"
  						v-if="config.eventType === 'audit' && config.hasFreeApprover">
  						<ncc-org-select v-model="dataForm.freeApproverUserId" />
  					</u-form-item>
  					<u-form-item label="抄送人员" prop="copyIds" v-if="config.isCustomCopy">
  						<ncc-org-select v-model="dataForm.copyIds" multiple />
  					</u-form-item>
  					<u-form-item label="审批签名" prop="signImg" v-if="config.hasSign">
  						<Signature ref="sig" v-model="dataForm.signImg"></Signature>
  					</u-form-item>
  				</u-form>
  			</view>
  		</scroll-view>
  		<view class="flowBefore-actions">
  			<u-button class="buttom-btn" type="primary" @click="handleClick">{{config.title}}</u-button>
  		</view>
  	</view>
  </template>
  
  <script>
  	import Signature from '../components/sin-signature/sin-signature.vue'
  	export default {
  		components: {
  			Signature,
  		},
  		data() {
  			return {
  				config: {},
  				dataForm: {
  					handleOpinion: '',
  					signImg: '',
  					copyIds: '',
  					freeApproverUserId: ''
  				},
  			};
  		},
  		onLoad(option) {
  			const config = JSON.parse(decodeURIComponent(option.config))
  			uni.setNavigationBarTitle({
  				title: config.title
  			});
  			this.config = config
  		},
  		methods: {
  			handleClick() {
  				if (this.config.hasSign && !this.dataForm.signImg) {
  					uni.showToast({
  						title: '请签名',
  						icon: 'none'
  					})
  					return
  				}
  				const query = {
  					...this.dataForm,
  					eventType: this.config.eventType
  				}
  				uni.$emit('operate', query);
  				uni.navigateBack();
  			}
  		}
  	}
  </script>
  
  <style lang="scss">
  	page {
  		height: 100%;
  	}
  
  	.operate-v {
  		height: 100%;
  		display: flex;
  		flex-direction: column;
  
  		.operate-area {
  			flex: 1;
  		}
  	}
  </style>