|
|
@@ -8,7 +8,8 @@
|
|
|
<view class="sfht-form-box">
|
|
|
<!-- 合同模板 -->
|
|
|
<view class="form-label-select form-radius-box">
|
|
|
- <view class="phone-form-label"><text class="form-label-require"></text>合同模板</view>
|
|
|
+ <view class="phone-form-label"><text class="form-label-require"></text>合同模板
|
|
|
+ <i @click="handlePreviewPdf">预览</i></view>
|
|
|
<picker :range="data.mobanList" mode='selector' :value="data.mobanIndex" range-key="name"
|
|
|
@change="onMobanSelect" class="select-picker-box">
|
|
|
<view class="form-radio-select">
|
|
|
@@ -44,6 +45,9 @@
|
|
|
<button type="default" class="phone-green-btn" @click="handleUpdate"
|
|
|
v-if="data.type == 'editorHetong'">更新合同</button>
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
+ <pdfPreviewVue ref="pdfRef"></pdfPreviewVue>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -64,6 +68,7 @@
|
|
|
import qianMingVue from "./components/qianMing.vue";
|
|
|
import qiTaYueDingVue from "./components/qiTaYueDing.vue";
|
|
|
import commonDialog from '@/components/dialog/commonDialog.vue';
|
|
|
+ import pdfPreviewVue from "./components/pdfPreview.vue";
|
|
|
|
|
|
import {
|
|
|
useHetong
|
|
|
@@ -117,14 +122,14 @@
|
|
|
xinyongdaima: '', // 统一社会信用代码
|
|
|
xiuxi: '', // 休息天数
|
|
|
khUserName: '', // 客户电话
|
|
|
- shentiqingkuang: 0, // 身体状态,1 能自理 ,2半自理, 3不能自理
|
|
|
+ shentiqingkuang: 0, // 身体状态,1 能自理 ,2半自理, 3不能自理
|
|
|
beizhu: '', // 备注
|
|
|
qianmingBase64: '',
|
|
|
id: null,
|
|
|
- jutidizhi: '',
|
|
|
+ jutidizhi: '',
|
|
|
},
|
|
|
type: null,
|
|
|
- timer: null
|
|
|
+ timer: null
|
|
|
})
|
|
|
|
|
|
const commonDialogRef = ref(null)
|
|
|
@@ -133,6 +138,7 @@
|
|
|
provideHetong(data)
|
|
|
|
|
|
const jzRef = ref(null)
|
|
|
+ const pdfRef = ref(null)
|
|
|
|
|
|
function handleSelct(code) {
|
|
|
if (code == 'kh') {
|
|
|
@@ -142,6 +148,11 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function handlePreviewPdf() {
|
|
|
+ const imgList = data.mobanList[data.mobanIndex] && data.mobanList[data.mobanIndex].base64List;
|
|
|
+ imgList && pdfRef.value.showPDF(imgList)
|
|
|
+ }
|
|
|
+
|
|
|
function goUpPage() {
|
|
|
uni.navigateBack()
|
|
|
}
|
|
|
@@ -163,63 +174,71 @@
|
|
|
}
|
|
|
|
|
|
function handleAdd() {
|
|
|
- uni.showLoading({
|
|
|
- title: '创建中...',
|
|
|
- mask: true
|
|
|
- });
|
|
|
+ if (!data.hetong.jiabingStartDate || data.hetong.jiabingEndDate || data.hetong.qianmingBase64) {
|
|
|
+ toast('请确认合同必填项是否完整')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: '创建中...',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
const opt = Object.assign({}, {
|
|
|
...data.hetong,
|
|
|
htId: data.mobanList[data.mobanIndex].id
|
|
|
})
|
|
|
httpApi.getSanfangAdd(opt).then(res => {
|
|
|
if (res.data) {
|
|
|
- uni.hideLoading()
|
|
|
+ uni.hideLoading()
|
|
|
uni.showToast({
|
|
|
title: "创建成功",
|
|
|
- duration:2000,
|
|
|
+ duration: 2000,
|
|
|
success() {
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack()
|
|
|
- },2000)
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 2000)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
- uni.hideLoading()
|
|
|
- }).
|
|
|
- finally(() => {
|
|
|
- clearTimeout(data.timer);
|
|
|
- data.timer = null;
|
|
|
- })
|
|
|
+ uni.hideLoading()
|
|
|
+ }).
|
|
|
+ finally(() => {
|
|
|
+ clearTimeout(data.timer);
|
|
|
+ data.timer = null;
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function handleUpdate() {
|
|
|
-
|
|
|
- uni.showLoading({
|
|
|
- title: '更新中...',
|
|
|
- mask: true
|
|
|
- });
|
|
|
+ if (!data.hetong.jiabingStartDate || data.hetong.jiabingEndDate || data.hetong.qianmingBase64) {
|
|
|
+ toast('请确认合同必填项是否完整')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ title: '更新中...',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
const opt = Object.assign({}, {
|
|
|
...data.hetong,
|
|
|
htId: data.mobanList[data.mobanIndex].id
|
|
|
})
|
|
|
httpApi.getSanfangUpdate(opt).then(res => {
|
|
|
if (res.data) {
|
|
|
- uni.hideLoading()
|
|
|
+ uni.hideLoading()
|
|
|
uni.showToast({
|
|
|
title: "更新成功",
|
|
|
- duration:2000,
|
|
|
- mask: true,
|
|
|
+ duration: 2000,
|
|
|
+ mask: true,
|
|
|
success() {
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack()
|
|
|
- },2000)
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 2000)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
- uni.hideLoading()
|
|
|
- })
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
function handleConfirm() {
|
|
|
@@ -242,7 +261,7 @@
|
|
|
id
|
|
|
}).then(res => {
|
|
|
Object.assign(data.hetong, res.data)
|
|
|
-
|
|
|
+
|
|
|
console.log('ccccc', res.data)
|
|
|
})
|
|
|
})
|