addSanfangHetong.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="sfht-info-page">
  3. <view class="icon-title-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <text class="nav-bar-title">新增三方合同</text>
  6. </view>
  7. <!-- form -->
  8. <view class="sfht-form-box">
  9. <!-- 合同模板 -->
  10. <view class="form-label-select form-radius-box">
  11. <view class="phone-form-label"><text class="form-label-require"></text>合同模板</view>
  12. <picker :range="data.mobanList" mode='selector' :value="data.mobanIndex" range-key="name"
  13. @change="onMobanSelect" class="select-picker-box">
  14. <view class="form-radio-select">
  15. <view v-if="data.mobanList[data.mobanIndex]">{{ data.mobanList[data.mobanIndex].name}}</view>
  16. <icon></icon>
  17. </view>
  18. </picker>
  19. </view>
  20. <!-- 客户信息 -->
  21. <kehuCardVue></kehuCardVue>
  22. <!-- 家政人员 -->
  23. <jiazhengCardVue></jiazhengCardVue>
  24. <template v-if="data.mobanIndex == 0">
  25. <!-- 合同信息 -->
  26. <hetongCardVue></hetongCardVue>
  27. <!-- 其他约定 -->
  28. <qiTaYueDingVue></qiTaYueDingVue>
  29. <!-- 家政签名 -->
  30. <qianMingVue></qianMingVue>
  31. </template>
  32. <common-dialog ref="commonDialogRef" title="提示" :showQuxiao="false" content="请完善社会信用代码与服务监督热线"
  33. @confirm-btn="handleConfirm"></common-dialog>
  34. </view>
  35. <view class="sfht-info-btn-box">
  36. <button type="default" class="phone-green-btn" @click="handleAdd">创建合同</button>
  37. </view>
  38. </view>
  39. </template>
  40. <script setup>
  41. import {
  42. ref,
  43. reactive,
  44. nextTick
  45. } from "vue";
  46. import {
  47. onLoad
  48. } from "@dcloudio/uni-app";
  49. import * as httpApi from "@/api/sanfang.js"
  50. import hetongCardVue from "./components/hetongCard.vue";
  51. import jiazhengCardVue from "./components/jiazhengCard.vue";
  52. import kehuCardVue from "./components/kehuCard.vue";
  53. import qianMingVue from "./components/qianMing.vue";
  54. import qiTaYueDingVue from "./components/qiTaYueDing.vue";
  55. import commonDialog from '@/components/dialog/commonDialog.vue';
  56. import {
  57. useHetong
  58. } from "./useHetong.js"
  59. const {
  60. provideHetong
  61. } = useHetong()
  62. const emits = defineEmits('select-kehu')
  63. const data = reactive({
  64. mobanList: [],
  65. mobanIndex: null,
  66. hetong: {
  67. htId: 1, // 合同模板id
  68. baochou: '', // 基本月报酬
  69. qita: '', // 其他服务
  70. bingren: '', // 病人病情
  71. dizhi: '', // 服务地址
  72. fafangri: '', // 工资发放日
  73. fangshi: 1, // 服务方式,1住家型,2非住家型
  74. fsShijian: '', // 非住家型服务时间
  75. fuwufei: '', // 服务费
  76. fuwufeiRate: '', // 服务费百分比
  77. fzHaizi: '', // 辅助照顾孩子人数
  78. fzHzNianling: '', // 辅助照顾孩子年龄
  79. huli: '', // 产妇护理
  80. jiabingEndDate: '', // 甲丙服务结束时间
  81. jiabingStartDate: '', // 甲丙服务开始时间
  82. jiandurexian: '', // 服务监督热线
  83. jiayiEndDate: '', // 甲乙服务结束时间
  84. jiayiStartDate: '', // 甲乙服务开始时间
  85. khId: '', // 客户ID
  86. khName: '', // 客户姓名
  87. khIdcard: '', // 客户身份证号
  88. laoren: '', // 照顾老人人数
  89. leixing: 1, // 服务类型,1普通家务保姆,2钟点工保姆,3育儿嫂,4其他
  90. lrnianling: '', // 照顾老人年龄: 60,70,80
  91. lxName: '', // 其他服务类型名称
  92. mianji: '', // 住房面积
  93. qita: '', // 基本月报酬
  94. qzHaizi: '', // 全职照顾孩子人数
  95. qzHzNianliang: '', // 全职照顾孩子年龄
  96. realName: '', // 家政姓名
  97. renkou: '', // 常驻人口数
  98. tianshu: '', // 基本月报酬天数
  99. userId: '', // 家政员ID
  100. xinyongdaima: '', // 统一社会信用代码
  101. xiuxi: '', // 休息天数
  102. khUserName: '', // 客户电话
  103. shentizhuangkuang: 1, // 身体状态,1 能自理 ,2半自理, 3不能自理
  104. beizhu: '', // 备注
  105. qianming: '',
  106. },
  107. })
  108. const commonDialogRef = ref(null)
  109. // 穿透式传参
  110. provideHetong(data)
  111. const jzRef = ref(null)
  112. function handleSelct(code) {
  113. if (code == 'kh') {
  114. khRef.value.handleShow();
  115. } else {
  116. jzRef.value.handleShow();
  117. }
  118. }
  119. function goUpPage() {
  120. uni.navigateBack()
  121. }
  122. function getMoban() {
  123. httpApi.getMobanList().then(res => {
  124. data.mobanList = res.data;
  125. // 初始化默认选中
  126. data.mobanIndex = 0;
  127. })
  128. }
  129. function onMobanSelect(da) {
  130. data.mobanIndex = da.detail.value
  131. }
  132. function handleQianming(da) {
  133. data.qianming = da;
  134. }
  135. function handleAdd() {
  136. const opt = Object({}, {...data.hetong},{htId:data.mobanList[data.mobanIndex].id })
  137. httpApi.getSanfangAdd(data.hetong).then(res => {
  138. if (res.data) {
  139. uni.showToast({
  140. title: "创建成功",
  141. success() {
  142. uni.navigateBack()
  143. }
  144. })
  145. }
  146. })
  147. }
  148. function handleConfirm() {
  149. uni.redirectTo({
  150. url: '/pages/admin/my/jzInfo' // 跳转完善
  151. })
  152. }
  153. onLoad(() => {
  154. httpApi.getSanfangCheck().then(res => {
  155. if (res.data) {
  156. getMoban();
  157. } else {
  158. commonDialogRef.value.handleShow()
  159. }
  160. })
  161. })
  162. </script>
  163. <style>
  164. </style>