Jelajahi Sumber

电子签名

maxiaoxiao 3 bulan lalu
induk
melakukan
9dd0b3a0ed
1 mengubah file dengan 19 tambahan dan 1 penghapusan
  1. 19 1
      pages/index/common/hcDetails.vue

+ 19 - 1
pages/index/common/hcDetails.vue

@@ -91,6 +91,15 @@
 					<uni-forms-item label="其它说明" name="notes" required>
 						<uni-easyinput v-model="checkform.notes" type="textarea" placeholder="请输入其它说明" />
 					</uni-forms-item>
+					<uni-forms-item label="数字签名" name="notes" required>
+						<img v-if="checkform.dataUrl" :url="checkform.dataUrl"></img>
+						<view style="width: 100% ;height: 250rpx;" v-else>
+							<l-signature disableScroll ref="signatureRef" penColor="red" :penSize="5"
+								:openSmooth="true"></l-signature>
+							<button size="mini" @click="$refs.signatureRef.clear()">撤消</button>
+							<button size="mini" @click="savesign">保存</button>
+						</view>
+					</uni-forms-item>
 				</uni-forms>
 			</view>
 		</view>
@@ -274,7 +283,6 @@
 			save() {
 				let a = this.decList.find(d => d.value == this.checkform.dlbm)
 				if (a) this.checkform.dlmc = a.text;
-
 				console.log(this.checkform, 'fjs')
 				this.$refs.checkRef.validate().then(res => {
 					hcWork(this.checkform).then(response => {
@@ -283,6 +291,16 @@
 					})
 				})
 			},
+			savesign() {
+				this.$refs.signatureRef.canvasToTempFilePath({
+					success: (res) => {
+						console.log(res, '---')
+						uploadFile(res.tempFilePath, (data) => {
+							this.checkform.dataUrl = data.path
+						})
+					}
+				})
+			},
 			tj() {
 				uni.$globalData = this.nowobj
 				this.$tab.navigateTo('/pages/index/common/tjDialog')