index.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285
  1. <template>
  2. <page-meta root-font-size="system" />
  3. <view class="process_container">
  4. <!-- 主表单 -->
  5. <uni-card spacing="0">
  6. <view class="main_container">
  7. <uni-forms ref="$mainForm" :modelValue="mainFormValue" :rules="$mainFormRules" label-position="left"
  8. :label-width="125" :border="true">
  9. <view v-for="(elem, index) in formElements" :key="index">
  10. <uni-forms-item v-if="'0' != elem.canEdit && '8' != elem.type" :name="elem.elementId"
  11. :label="elem.elementName">
  12. <!-- 关联变量输入框 -->
  13. <!-- 计算出差天数 -->
  14. <uni-easyinput v-if="undefined != elem.bindTimeRange && elem.elementName == '出差天数'"
  15. :type="fieldTypeDict[elem.fieldType] || 'text'"
  16. :value="calculateBusinessDifference(elem, formElements)" placeholder=""
  17. :disabled="true"></uni-easyinput>
  18. <uni-easyinput v-else-if="undefined != elem.bindTimeRange"
  19. :type="fieldTypeDict[elem.fieldType] || 'text'"
  20. :value="calculateTimeDifference(elem, formElements)" placeholder=""
  21. :disabled="true"></uni-easyinput>
  22. <!-- 金额转大写 -->
  23. <uni-easyinput v-else-if="elem.elementName.endsWith('大写')" placeholder=""
  24. :value="computedNumberToChineseCurrency(elem, formElements)" :disabled="true" ></uni-easyinput>
  25. <!-- 主表关联变量输入框 -->
  26. <!-- 数值输入框 -->
  27. <uni-easyinput v-else-if="'1' == elem.fieldType && elem.BddzText" type="digit"
  28. :value="computedBddzTextValue(elem)" @input="digitInput($event, elem)" placeholder=""
  29. :disabled="true"></uni-easyinput>
  30. <!-- 输入框 -->
  31. <uni-easyinput v-else-if="elem.BddzText" :type="fieldTypeDict[elem.fieldType] || 'text'"
  32. :value="computedBddzTextValue(elem)" placeholder="" :disabled="true"></uni-easyinput>
  33. <!-- 数值输入框 -->
  34. <uni-easyinput v-else-if="'0' == elem.type && '1' == elem.fieldType"
  35. :disabled="'0' == elem.canEdit" type="digit"
  36. :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" @input="digitInput($event, elem)"
  37. v-model="elem.defaultValue"
  38. placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
  39. <!-- 输入框 -->
  40. <uni-easyinput v-else-if="'0' == elem.type" :disabled="'0' == elem.canEdit"
  41. :type="fieldTypeDict[elem.fieldType] || 'text'"
  42. :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue"
  43. placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
  44. <!-- 富文本输入框 -->
  45. <uni-easyinput v-else-if="'1' == elem.type" :disabled="'0' == elem.canEdit"
  46. :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue"
  47. placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"
  48. type="textarea"></uni-easyinput>
  49. <!-- 下拉框 -->
  50. <picker class="picker_container" v-else-if="'2' == elem.type"
  51. @change="bindPickerChange($event, elem)" :value="elem.defaultValue"
  52. :range="formatDict(elem.typeDetail.enum)">
  53. <view class="uni-input input_text">
  54. <!-- 设置默认值为第一个选项 -->
  55. {{ elem.defaultValue ? elem.defaultValue : elem.defaultValue =
  56. elem.typeDetail.enum[0].enumVname }}
  57. </view>
  58. </picker>
  59. <!-- 数据选择器 -->
  60. <uni-data-checkbox v-else-if="'4' == elem.type" v-model="elem.defaultValue"
  61. :localdata="formatCheckbox(elem)"
  62. @change="changeDataSingleCheckBox($event, elem)"></uni-data-checkbox>
  63. <uni-data-checkbox v-else-if="'5' == elem.type" multiple v-model="elem.defaultValue"
  64. :localdata="formatCheckbox(elem)"
  65. @change="changeDataCheckBox($event, elem)"></uni-data-checkbox>
  66. <!-- 开始时间选择器 -->
  67. <uni-datetime-picker :end="formElements[elem.endElemIndex].defaultValue"
  68. @change="setTimeRange(elem)"
  69. @click.native.stop
  70. v-else-if="'9' == elem.type && undefined != elem.endElemIndex"
  71. v-model="elem.defaultValue" :clear-icon="false" type="datetime" />
  72. <!-- 结束时间选择器 -->
  73. <uni-datetime-picker :start="formElements[elem.startElemIndex].defaultValue"
  74. @change="setTimeRange(elem)"
  75. @click.native.stop
  76. v-else-if="'9' == elem.type && undefined != elem.startElemIndex"
  77. v-model="elem.defaultValue" :clear-icon="false" type="datetime" />
  78. <!-- 其他时间选择器 -->
  79. <!-- 年月日 时分秒 -->
  80. <uni-datetime-picker v-else-if="'9' == elem.type && BUKA_MODELID != processInfo.modelId"
  81. @click.native.stop
  82. v-model="elem.defaultValue" type="datetime" />
  83. <!-- 补卡流程专用 -->
  84. <uni-datetime-picker v-else-if="'9' == elem.type && BUKA_MODELID == processInfo.modelId"
  85. @click.native.stop
  86. v-model="elem.defaultValue" type="datetime"
  87. :start="`${formElements[0].defaultValue} 00:00:00`"
  88. :end="`${formElements[0].defaultValue} 23:59:59`" @change="bukaTimeChange" />
  89. <!-- 年月日 -->
  90. <uni-datetime-picker v-else-if="'3' == elem.type"
  91. @click.native.stop
  92. v-model="elem.defaultValue" type="date" />
  93. <!-- 签名 -->
  94. <view v-else-if="'13' == elem.type">
  95. <view v-if="elem.defaultValue == ''">
  96. <uni-row>
  97. <uni-col :span="24">
  98. <button type="primary" @click="handleSignature(index)">手动签名</button>
  99. </uni-col>
  100. <uni-col :span="24">
  101. <button style="margin-top: 5px;" type="primary" @click="onclickAutosealButton(index)">一键签名</button>
  102. </uni-col>
  103. </uni-row>
  104. </view>
  105. <view v-else class="signature_img">
  106. <img style="width: 100%;" mode="widthFix" @click="handleSignature(index)"
  107. :src="config.baseUrlPre + elem.sealImgPath"
  108. :alt="elem.elementName + '签名'" />
  109. </view>
  110. </view>
  111. </uni-forms-item>
  112. </view>
  113. </uni-forms>
  114. </view>
  115. </uni-card>
  116. <!-- 重复表单 -->
  117. <view v-if="groupCanEdit && repeatingForm.elementItem.length > 0" class="repeating_table">
  118. <uni-card v-for="(form, tableIndex) in repeatingForm.elements" spacing="0" :key="tableIndex">
  119. <uni-forms :ref="(el) => $repeatingForms[tableIndex] = el" :modelValue="repeatingFormsValue[tableIndex]"
  120. :rules="$repFormRules" label-position="left" :label-width="125" :border="true">
  121. <uni-forms-item :name="elem.tableField" v-for="(elem, itemIndex) in form"
  122. :label="repeatingForm.elementItem[itemIndex].elementName.slice(3)" :key="itemIndex">
  123. <!-- 自定义关联变量 -->
  124. <uni-easyinput v-if="repeatingForm.elementItem[itemIndex].bddzText" :placeholder="''"
  125. :type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'"
  126. placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"
  127. :value="calculateRepeatingFormExpression(elem, form)" :disabled="true"></uni-easyinput>
  128. <!-- 数值输入框 -->
  129. <uni-easyinput v-else-if="'1' == repeatingForm.elementItem[itemIndex].fieldType.value"
  130. placeholder="请输入内容" v-model="elem.defaultValue" @input="digitInput($event, elem)"
  131. placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="digit"></uni-easyinput>
  132. <!-- 输入框 -->
  133. <uni-easyinput v-else placeholder="请输入内容" v-model="elem.defaultValue"
  134. placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="text"></uni-easyinput>
  135. </uni-forms-item>
  136. </uni-forms>
  137. <view class="repeating_table_button_container">
  138. <uni-row>
  139. <uni-col :span="10" :offset="1">
  140. <button @click="addRepeatingFormItem(tableIndex)" type="primary">新增</button>
  141. </uni-col>
  142. <uni-col :span="10" :offset="2">
  143. <button @click="delRepeatingFormItem(tableIndex)"
  144. :disabled="repeatingForm.elements.length <= 1" type="warn">删除</button>
  145. </uni-col>
  146. </uni-row>
  147. </view>
  148. </uni-card>
  149. </view>
  150. <!-- 上传附件 -->
  151. <view class="file_picker_container">
  152. <!-- 注意事项 -->
  153. <uni-card v-if="processInfo.precautions" spacing="0">
  154. <view class="precautions_content">
  155. <text class="precautions_label">注意事项:</text>
  156. <text class="precautions_text">{{ processInfo.precautions }}</text>
  157. </view>
  158. </uni-card>
  159. <uni-card title="上传附件" :extra="`${fileList.length}/50`" spacing="0">
  160. <uni-file-picker ref="filePicker" v-model="fileList" :auto-upload="true" mode="list" :limit="50"
  161. :limitLength="50" file-mediatype="all" @select="handleFileSelect" @progress="handleFileProgress"
  162. @success="handleFileSuccess" @fail="handleFileFail" @delete="handleFileDelete" />
  163. </uni-card>
  164. </view>
  165. <view class="submit_button_container">
  166. <uni-card spacing="0" padding="0">
  167. <button :disabled="!button_state" :loading="!button_state" type="primary" class="submit_button"
  168. @click="submitProcess">提交</button>
  169. </uni-card>
  170. </view>
  171. </view>
  172. <view style="height: 5px; margin-top: 10px;"></view>
  173. <!-- 签字版弹出层 -->
  174. <uni-popup ref="signaturePopup" @maskClick="closeSignaturePopup">
  175. <view class="signature_container" :class="{ 'signature_container_landscape': isLandscape }">
  176. <view class="signature_content">
  177. <l-signature ref="signatureRef" v-if="signaturePopupShow" :landscape="isLandscape" :penSize="8"
  178. :minLineWidth="4" :maxLineWidth="12" :openSmooth="true" :preferToDataURL="true"
  179. backgroundColor="#ffffff" penColor="black"></l-signature>
  180. </view>
  181. <view class="signature_button_container">
  182. <uni-row :gutter="10">
  183. <uni-col :span="6">
  184. <button type="warn" @click="onclickSignatureButton('undo')">撤销</button>
  185. </uni-col>
  186. <uni-col :span="6">
  187. <button type="warn" @click="onclickSignatureButton('clear')">清空</button>
  188. </uni-col>
  189. <uni-col :span="6">
  190. <button type="primary" @click="onclickSignatureButton('save')">保存</button>
  191. </uni-col>
  192. <uni-col :span="6">
  193. <button @click="onclickSignatureButton('landscape')">全屏</button>
  194. </uni-col>
  195. <!-- <uni-col :span="24">
  196. <button type="primary" @click="onclickAutosealButton()">一键签名</button>
  197. </uni-col> -->
  198. </uni-row>
  199. </view>
  200. </view>
  201. </uni-popup>
  202. </template>
  203. <script setup lang="ts">
  204. import { onMounted, reactive, ref, computed, nextTick, onUnmounted } from 'vue'
  205. import { onLoad, onUnload } from '@dcloudio/uni-app'
  206. import { useUserStore } from '@/store/user.js'
  207. import $modal from '@/plugins/modal.js'
  208. import $tab from '@/plugins/tab.js'
  209. import { convertToChineseCurrency } from '@/utils/ygoa.js'
  210. import { calCommonExp } from '@/utils/rpn.js'
  211. import { getProcessInfo, getProcessForm, submitProcessForm, uploadFile, getAttendanceSegment } from '@/api/work.js'
  212. import { useConfigStore } from '@/store/config.js'
  213. import { getProcessFlowInfo, getProcessFormInfo, getProcessFormInfoInFlow, getProcessFlow, submitProcessFlow, cancelProcessFlow, uploadSignatureImg, uploadSignatureBoardImg, getSeal } from '@/api/process.js'
  214. import config from '@/config.js'
  215. const configStore = useConfigStore()
  216. const fieldTypeDict = {
  217. '0': 'text',
  218. '1': 'digit'
  219. }
  220. //补卡申请流程模板id
  221. const BUKA_MODELID = ref('995804554666003')
  222. let processInfo = reactive({
  223. modelName: '流程申请',
  224. reqOffice: 0,
  225. control: '',
  226. formId: '',
  227. modelId: '',
  228. tmodelId: '',
  229. isMoreIns: '',
  230. pathJudgeType: '',
  231. form: [],
  232. precautions: ''
  233. })
  234. const userStore = useUserStore()
  235. const title = ref('')
  236. //考勤页面传入的补卡信息
  237. const bukaObj = ref({
  238. bukaDate: '',
  239. bukaType: '',
  240. bukaTime: ''
  241. })
  242. // 防止时间选择器误触发返回
  243. const isDatePickerShowing = ref(false)
  244. onLoad((options) => {
  245. const { modelName, modelId, control, bukaDate, bukaType } = options
  246. processInfo.modelName = modelName
  247. processInfo.modelId = modelId
  248. processInfo.control = control
  249. title.value = userStore.user.name + '的' + processInfo.modelName
  250. // 设置导航栏标题
  251. uni.setNavigationBarTitle({
  252. title: title.value
  253. });
  254. if (bukaDate && bukaType) {
  255. const workStartTime = configStore.signInTimeRange?.[1] || "09:00:00"
  256. const workEndTime = configStore.signOutTimeRange?.[0] || "17:30:00"
  257. const bukaTime = bukaDate + ' ' + ('上班' == bukaType ? workStartTime : workEndTime)
  258. bukaObj.value = { bukaDate, bukaType, bukaTime }
  259. }
  260. })
  261. onMounted(() => {
  262. initProcessInfo().then(() => {
  263. initProcessForm()
  264. })
  265. })
  266. function initProcessInfo() {
  267. return new Promise<void>((resolve, reject) => {
  268. getProcessInfo(processInfo)
  269. .then(({ returnParams }) => {
  270. const { formId, tmodelId, isMoreIns, pathJudgeType, reqOffice, precautions } = returnParams.flow[0]
  271. processInfo.formId = formId
  272. processInfo.tmodelId = tmodelId
  273. processInfo.isMoreIns = isMoreIns
  274. processInfo.pathJudgeType = pathJudgeType
  275. processInfo.reqOffice = reqOffice
  276. processInfo.precautions = precautions || ''
  277. resolve()
  278. })
  279. })
  280. }
  281. const formElements = ref([])
  282. const repeatingForm = ref({
  283. elementItem: [],
  284. elements: []
  285. })
  286. const hideArr=['冲','借款','借款单号','结余','申请日期']
  287. const groupCanEdit = ref(false)
  288. function initProcessForm() {
  289. getProcessForm(userStore.user, processInfo).then(({ returnParams }) => {
  290. returnParams.formElements.forEach(element => {
  291. if (hideArr.includes(element.elementName)) {
  292. element.type = "8";
  293. }
  294. });
  295. //对补卡申请的时间选择器进行处理
  296. if (BUKA_MODELID.value == processInfo.modelId) {
  297. returnParams.formElements.forEach(element => {
  298. if (element.type === "9" || "日期" == element.elementName) {
  299. element.type = "8";
  300. }
  301. if ("补卡类型" == element.elementName) {
  302. element.defaultValue = bukaObj.value.bukaType
  303. }
  304. });
  305. const dateElement = {
  306. defaultValue: bukaObj.value.bukaDate || new Date().toISOString().substring(0, 10),
  307. elementName: '补卡日期',
  308. type: '3'
  309. }
  310. const timeElement = {
  311. defaultValue: bukaObj.value.bukaTime,
  312. elementName: '补卡时间',
  313. type: '9'
  314. }
  315. returnParams.formElements.splice(0, 0, dateElement)
  316. returnParams.formElements.splice(8, 0, timeElement)
  317. formElements.value = returnParams.formElements
  318. } else {
  319. formElements.value = returnParams.formElements
  320. }
  321. repeatingForm.value = returnParams.repeatingForm
  322. // console.log('formElements', formElements.value);
  323. if (returnParams.groupCanEdit == 1) {
  324. groupCanEdit.value = true
  325. }
  326. getValidateRules()
  327. computedMainFormValue()
  328. // 生成第一个重复表数据
  329. if (groupCanEdit.value && repeatingForm.value) {
  330. addRepeatingFormItem(0)
  331. }
  332. bindTimeRangeData()
  333. })
  334. }
  335. //单选框(补卡类型)
  336. function changeDataSingleCheckBox(e, elem) {
  337. // console.log('单选框切换事件',e.detail.value);
  338. const workStartTime = configStore.signInTimeRange[0]?.[1] || "09:00:00"
  339. const workEndTime = configStore.signOutTimeRange[1]?.[0] || "17:30:00"
  340. // console.log(workStartTime)
  341. if (BUKA_MODELID.value == processInfo.modelId && '' != formElements.value[0].defaultValue) {
  342. if ('上班' == e.detail.value) {
  343. formElements.value[8].defaultValue = formElements.value[0].defaultValue + ' ' + workStartTime
  344. } else if ('下班' == e.detail.value) {
  345. formElements.value[8].defaultValue = formElements.value[0].defaultValue + ' ' + workEndTime
  346. }
  347. }
  348. }
  349. const timeRangeItems = ref([
  350. ['开始时间', '结束时间', '多少小时'],
  351. ['出发时间', '预计返回时间'],
  352. ['出差时间', '返回时间', '出差天数'],
  353. ['出门时间', '预计返回时间'],
  354. ['开始时间', '结束时间', '合计小时'],
  355. ])
  356. // 关联时间变量
  357. function bindTimeRangeData() {
  358. return new Promise<void>((resolve) => {
  359. timeRangeItems.value.forEach((range) => {
  360. const [startName, endName, bindName] = range;
  361. // 找到 startName 和 endName 的索引
  362. const startIndex = formElements.value.findIndex((item) => item.elementName === startName);
  363. const endIndex = formElements.value.findIndex((item) => item.elementName === endName);
  364. const formatDate = (date) => {
  365. const pad = (num) => num.toString().padStart(2, '0');
  366. return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
  367. }
  368. // 只有找到 startName 和 endName 后,才检查 bindName
  369. if (startIndex !== -1 && endIndex !== -1) {
  370. formElements.value[startIndex].defaultValue = formatDate(new Date())
  371. if (bindName) {
  372. const bindIndex = formElements.value.findIndex((item) => item.elementName === bindName);
  373. if (bindIndex !== -1) {
  374. // 所有匹配项都存在,保存索引
  375. formElements.value[startIndex].endElemIndex = endIndex;
  376. formElements.value[endIndex].startElemIndex = startIndex;
  377. formElements.value[bindIndex].bindTimeRange = {
  378. startIndex,
  379. endIndex
  380. };
  381. setAttendanceSegment() // 获取班次信息
  382. }
  383. } else {
  384. // 没有 bindName,仅保存 start 和 end 的索引
  385. formElements.value[startIndex].endElemIndex = endIndex;
  386. formElements.value[endIndex].startElemIndex = startIndex;
  387. }
  388. // TODO 加班开始时间默认当天下班时间 请假时间默认当天上班时间
  389. }
  390. });
  391. resolve(); // 返回一个 resolved 状态的 Promise
  392. });
  393. }
  394. // 计算时间差
  395. function calculateBusinessDifference(item, form) {
  396. return item.defaultValue = (calculateTimeDifference(item, form) / 7).toFixed(2)
  397. }
  398. function calculateTimeDifference(item, form) {
  399. // 获取 开始时间 和 结束时间
  400. const { startIndex, endIndex } = item.bindTimeRange;
  401. const startTime = new Date(form[startIndex].defaultValue);
  402. const endTime = new Date(form[endIndex].defaultValue);
  403. // 检查时间是否合法
  404. if (isNaN(startTime.getTime()) || isNaN(endTime.getTime())) {
  405. return item.defaultValue = 0
  406. }
  407. // 请假申请的时间差 表单项为合计小时
  408. const type = item.elementName == '合计小时' ? '非工作时间' : '工作时间'
  409. // 计算时间差
  410. const timeDifferenceInHours = calculateWorkingHours(startTime, endTime, type);
  411. // const timeDifferenceInMs = endTime - startTime;
  412. // let timeDifferenceInHours = (timeDifferenceInMs / (1000 * 60 * 60)).toFixed(1);
  413. // let timeDifferenceInHours = (timeDifferenceInMs / (1000 * 60 * 60))
  414. // // 计算小数部分
  415. // const decimalPart = timeDifferenceInHours - Math.floor(timeDifferenceInHours)
  416. // if (decimalPart >= 0.5) {
  417. // // 如果小数部分大于等于 0.5,向上取整到 0.5 的倍数
  418. // timeDifferenceInHours = Math.floor(timeDifferenceInHours) + 0.5;
  419. // } else {
  420. // // 如果小数部分小于 0.5,向下取整到 0.5 的倍数
  421. // timeDifferenceInHours = Math.floor(timeDifferenceInHours);
  422. // }
  423. // 保存到 defaultValue
  424. return item.defaultValue = Number(timeDifferenceInHours.toFixed(2));
  425. }
  426. let workingPeriods = []
  427. let workDays = [] // 0为周日
  428. function setAttendanceSegment() {
  429. getAttendanceSegment(userStore.user.unitId).then(({ returnParams }) => {
  430. const workTime = returnParams[0].work_time.split(';')
  431. workDays = returnParams[0].work_days.split(',')
  432. for (const time of workTime) {
  433. if (time == '') continue
  434. const times = time.split(',')
  435. const obj = {
  436. start: times[0],
  437. end: times[1]
  438. }
  439. workingPeriods.push(obj)
  440. }
  441. if (workingPeriods.length == 0) {
  442. workingPeriods = [
  443. { start: "09:00", end: "12:00" }, // 上午
  444. { start: "13:30", end: "17:30" }, // 下午
  445. ]
  446. }
  447. workDays = workDays.map(item => Number(item))
  448. const sundayIndex = workDays.findIndex(item => item == 7)
  449. // console.log('workDays: ',workDays);
  450. if (sundayIndex != -1) {
  451. workDays[sundayIndex] = 0
  452. }
  453. if (workDays.length == 0) {
  454. workDays = [1, 2, 3, 4, 5, 6, 0] // 0为周日
  455. }
  456. })
  457. }
  458. function calculateWorkingHours(startTime, endTime, type) {
  459. // 将时间字符串解析为分钟数
  460. const formatTime = (timeString) => {
  461. const [hours, minutes] = timeString.split(":").map(Number)
  462. return hours * 60 + minutes
  463. };
  464. // 计算两个时间段的重叠部分
  465. const calculateOverlap = (start1, end1, start2, end2) => {
  466. const overlapStart = Math.max(start1, start2)
  467. const overlapEnd = Math.min(end1, end2)
  468. return Math.max(0, overlapEnd - overlapStart) // 如果无重叠返回 0
  469. };
  470. // 将 Date 转化为当天的分钟数
  471. const dateToMinutes = (date) => date.getHours() * 60 + date.getMinutes()
  472. // 判断日期是否是工作日
  473. const isRestdays = (date) => !workDays.includes(date.getDay())
  474. // 确保 startTime 和 endTime 是 Date 类型
  475. if (!(startTime instanceof Date) || !(endTime instanceof Date)) {
  476. throw new Error("startTime 和 endTime 必须是 Date 类型")
  477. }
  478. // 将时间范围分解为每天的计算
  479. const startDate = new Date(startTime)
  480. const endDate = new Date(endTime)
  481. startDate.setHours(0, 0, 0, 0)
  482. endDate.setHours(0, 0, 0, 0)
  483. let totalMinutes = 0
  484. // 遍历时间范围的每一天
  485. for (
  486. let currentDate = new Date(startDate);
  487. currentDate <= endDate;
  488. currentDate.setDate(currentDate.getDate() + 1)
  489. ) {
  490. const isStartDay = currentDate.getTime() === startDate.getTime();
  491. const isEndDay = currentDate.getTime() === endDate.getTime();
  492. // 当天的起始和结束时间
  493. const dayStart = isStartDay ? dateToMinutes(startTime) : 0;
  494. const dayEnd = isEndDay ? dateToMinutes(endTime) : 1440; // 1440 = 24 * 60
  495. // TODO 改为配置选择
  496. if (type == "工作时间") {
  497. // 如果当前日期不是工作日,跳过
  498. if (isRestdays(currentDate)) continue;
  499. // 计算工作时间段内的时间
  500. workingPeriods.forEach((period) => {
  501. const periodStart = formatTime(period.start);
  502. const periodEnd = formatTime(period.end);
  503. totalMinutes += calculateOverlap(dayStart, dayEnd, periodStart, periodEnd);
  504. });
  505. } else if (type == "非工作时间") {
  506. if (isRestdays(currentDate)) {
  507. // 计算非工作日时间差
  508. const midnight = new Date(currentDate)
  509. midnight.setHours(24, 0, 0, 0)
  510. const timeDiffInMs = dayEnd - dayStart
  511. totalMinutes += timeDiffInMs
  512. continue
  513. }
  514. // 计算非工作时间段的时间
  515. let nonWorkingMinutes = 0;
  516. let current = dayStart;
  517. for (const period of workingPeriods) {
  518. const periodStart = formatTime(period.start);
  519. const periodEnd = formatTime(period.end);
  520. if (current < periodStart) {
  521. nonWorkingMinutes += calculateOverlap(current, dayEnd, current, periodStart);
  522. }
  523. current = Math.max(current, periodEnd);
  524. }
  525. if (current < dayEnd) {
  526. nonWorkingMinutes += dayEnd - current;
  527. }
  528. totalMinutes += nonWorkingMinutes;
  529. }
  530. }
  531. // 转换为小时
  532. return totalMinutes / 60;
  533. }
  534. function setTimeRange(e) {
  535. // console.log('setTimeRange', e)
  536. }
  537. // 生成人民币大写
  538. function computedNumberToChineseCurrency(item, form) {
  539. const elem = form.find(elem => !elem.elementName.endsWith('大写') && (elem.BddzText == item.BddzText || elem.elementName == item.BddzText.slice(3)))
  540. if(elem != null) {
  541. return item.defaultValue = convertToChineseCurrency(elem.defaultValue);
  542. } else {
  543. return '';
  544. }
  545. }
  546. function computedBddzTextValue(item) {
  547. const mainIndex = formElements.value.findIndex(({ elementName }) => elementName == item.BddzText.slice(3))
  548. const reIndex = repeatingForm.value.elementItem.findIndex(({ elementName }) => elementName == item.BddzText)
  549. if (mainIndex != -1) {
  550. return item.defaultValue = formElements.value[mainIndex].defaultValue
  551. }
  552. if (reIndex != -1) {
  553. return computedValueToRepeatingForm(item)
  554. }
  555. }
  556. //合计金额计算
  557. function computedValueToRepeatingForm(item) {
  558. const index = repeatingForm.value.elementItem.findIndex(({ elementName }) => elementName.slice(3) == item.BddzText.slice(3))
  559. let result = 0
  560. for (const formItem of repeatingForm.value.elements) {
  561. result += Number(formItem[index].defaultValue) || 0
  562. }
  563. return item.defaultValue = Number(result.toFixed(2))
  564. }
  565. // 下拉框
  566. function bindPickerChange(e, item) {
  567. const index = e.detail.value;
  568. item.defaultValue = item.typeDetail.enum[index].enumVname
  569. }
  570. function formatDict(dict) {
  571. return dict.map(({ enumVname }) => enumVname)
  572. }
  573. //数据选择器
  574. function formatCheckbox(elem) {
  575. let dict = elem.typeDetail.enum
  576. // elem['checkBox'] = ''
  577. return dict.map((item, index) => ({
  578. text: item.enumVname,
  579. value: item.enumVname
  580. }));
  581. }
  582. function changeDataCheckBox(e, elem) {
  583. elem['checkBox'] = e.detail.value.join(",")
  584. }
  585. // 新增重复表表单
  586. function addRepeatingFormItem(index) {
  587. const form = repeatingForm.value.elementItem.map(({ tableField, bddzText }) => {
  588. const item = {
  589. name: tableField,
  590. defaultValue: '',
  591. bddzText
  592. }
  593. return item
  594. })
  595. repeatingForm.value.elements.splice(index + 1, 0, form)
  596. }
  597. // 删除重复表表单
  598. function delRepeatingFormItem(index) {
  599. $modal.confirm('', '确认删除该详情表数据')
  600. .then(() => {
  601. repeatingForm.value.elements.splice(index, 1)
  602. $repeatingForms.value.splice(index, 1)
  603. })
  604. .catch(() => { })
  605. }
  606. function digitInput(event, item) {
  607. // 获取输入框当前的值
  608. let currentValue = event;
  609. // 过滤非数字和小数点的字符
  610. currentValue = currentValue.replace(/[^0-9.]/g, '');
  611. // 处理前导零的情况:
  612. // 如果当前值没有小数点(即是整数),去掉前导零
  613. if (currentValue.indexOf('.') === -1) {
  614. currentValue = currentValue.replace(/^0+(?=\d)/, ''); // 只有当有数字跟随时才去掉前导零
  615. } else {
  616. // 如果包含小数点,处理整数部分的前导零,保留小数部分
  617. let parts = currentValue.split('.');
  618. parts[0] = parts[0].replace(/^0+(?=\d)/, ''); // 只去掉整数部分的前导零
  619. currentValue = parts.join('.'); // 重新拼接
  620. }
  621. // 防止多个小数点
  622. const parts = currentValue.split('.');
  623. let finalValue;
  624. if (parts.length > 2) {
  625. // 如果有多个小数点,保留第一个小数点及后续数字
  626. finalValue = parts[0] + '.' + parts[1];
  627. } else {
  628. finalValue = currentValue;
  629. }
  630. // 更新最终结果到 item
  631. nextTick(() => {
  632. item.defaultValue = finalValue;
  633. event = finalValue; // 更新输入框的值
  634. });
  635. return event;
  636. }
  637. // 计算重复表关联变量表达式结果值
  638. function calculateRepeatingFormExpression(item, form) {
  639. // 提取表达式中的变量名
  640. const variablePattern = /my:[\u4e00-\u9fa5]+/g;
  641. let match;
  642. let expression = item.bddzText
  643. // 替换表达式中的变量
  644. while ((match = variablePattern.exec(item.bddzText)) !== null) {
  645. const variableName = match[0]; // 完整变量名
  646. // 找到 重复表 中对应的索引
  647. const index = repeatingForm.value.elementItem.findIndex(item => item.elementName === variableName);
  648. if (index !== -1) {
  649. const value = form[index]?.defaultValue || 0;
  650. expression = expression.replace(match[0], value);
  651. } else {
  652. // 未匹配到的变量替换为 0
  653. expression = expression.replace(match[0], 0);
  654. }
  655. }
  656. if (/[^0-9\+\-\*\/\(\)\.]/.test(expression)) {
  657. console.error('错误的表达式:', expression);
  658. $modal.msg('自动计算错误,请手动输入')
  659. return item.defaultValue = 0;
  660. }
  661. return item.defaultValue = Number(calCommonExp(expression).toFixed(2)); // 返回填充后的表达式
  662. }
  663. const fileList = ref([]) // 文件列表
  664. const fileSeqs = ref([])
  665. const filePicker = ref(null)
  666. async function handleFileSelect(files) { // 新增文件
  667. // console.log('handleFileSelect', files.tempFiles)
  668. files.tempFiles.forEach(file => {
  669. const data = {
  670. name: file.name,
  671. filePath: file.path,
  672. }
  673. uploadFile(data)
  674. .then(res => {
  675. file.seq = res.returnParams
  676. fileSeqs.value.push({ 'seq': res.returnParams, 'path': file.path })
  677. fileList.value.push(file)
  678. $modal.msgSuccess('文件' + data.name + '上传成功')
  679. // console.log('handleFileSelect fileList: ',fileList);
  680. // file.seq = res.returnParams
  681. })
  682. .catch(err => {
  683. $modal.msgError('文件' + data.name + '上传失败,请删除重新上传')
  684. switch (err) {
  685. case -201:
  686. console.log('文件上传失败 未找到该文件');
  687. break;
  688. case -20201:
  689. console.log('文件上传失败 返回值不是JSON字符串');
  690. break;
  691. }
  692. })
  693. })
  694. // console.log('UploadFiles', files.tempFiles);
  695. }
  696. function handleFileProgress(file, progress) {
  697. // console.log('handleFileProgress', file, progress);
  698. }
  699. function handleFileSuccess(file, res) {
  700. // console.log('handleFileSuccess', file, res);
  701. }
  702. function handleFileFail(file, err) {
  703. // console.log('handleFileFail', file, err);
  704. }
  705. function handleFileDelete(file) { // 移除文件
  706. // console.log('handleDelete', file)
  707. fileSeqs.value.splice(fileSeqs.value.findIndex(({ path }) => path == file.tempFilePath))
  708. }
  709. //表单校验
  710. const $mainForm = ref(null)
  711. const mainFormValue = ref({})
  712. const $repeatingForms = ref([])
  713. const repeatingFormsValue = ref([])
  714. const formatTypeDict = {
  715. '0': 'string',
  716. '1': 'number'
  717. }
  718. // 校验重复表
  719. function validateRepeatingForm() {
  720. // 设置重复表校验数据
  721. repeatingFormsValue.value = repeatingForm.value.elements.map((item, index) => {
  722. return computed(() => {
  723. const obj = {};
  724. item.forEach(({ name, defaultValue }) => {
  725. obj[name] = defaultValue;
  726. });
  727. return obj;
  728. }).value
  729. })
  730. // console.log('$repeatingForms: ',$repeatingForms.value);
  731. // console.log('repeatingFormsValue: ',repeatingFormsValue.value);
  732. // 重复表数据校验
  733. // BUG validate()校验无效
  734. $repeatingForms.value.forEach((form) => {
  735. // console.log('form: ',form);
  736. form.validate().then(res => {
  737. console.log('验证成功:', res);
  738. }).catch(err => {
  739. console.log('验证失败:', err);
  740. });
  741. })
  742. }
  743. function validateRepeatingForm2() {
  744. // 设置重复表校验数据
  745. repeatingFormsValue.value = repeatingForm.value.elements.map((item, index) => {
  746. return computed(() => {
  747. const obj = {};
  748. item.forEach(({ name, defaultValue }) => {
  749. obj[name] = defaultValue;
  750. });
  751. return obj;
  752. }).value
  753. })
  754. // 验证重复表单数据
  755. let flag = true
  756. for (let i = 0; i < repeatingFormsValue.value.length; i++) {
  757. const item = repeatingFormsValue.value[i]
  758. // 遍历 elementItem 来获取字段名称,确保顺序一致
  759. for (let j = 0; j < repeatingForm.value.elementItem.length; j++) {
  760. const fieldElement = repeatingForm.value.elementItem[j]
  761. const fieldName = fieldElement.tableField || fieldElement.name
  762. const fieldValue = item[fieldName]
  763. if (fieldValue == '' || fieldValue === undefined || fieldValue === null) {
  764. const name = fieldElement.elementName.slice(3)
  765. $modal.msgError(`详情表${name}不能为空`)
  766. return false
  767. }
  768. }
  769. }
  770. return flag
  771. }
  772. // 设置表单校验规则
  773. const $mainFormRules = ref({})
  774. const $repFormRules = ref({})
  775. function getValidateRules() {
  776. $repFormRules.value = computed(() => {
  777. const obj = {};
  778. repeatingForm.value.elementItem.forEach(elem => {
  779. obj[elem.tableField] = {
  780. rules: [
  781. {
  782. required: true,
  783. },
  784. // {
  785. // 类型判断 数值型使用string会出错
  786. // formatTypeDict: formatTypeDict[elem.fieldType.value] || 'string',
  787. // }
  788. ],
  789. label: elem.elementName.slice(3)
  790. };
  791. });
  792. return obj;
  793. }).value
  794. $mainFormRules.value = computed(() => {
  795. const obj = {};
  796. formElements.value.forEach(elem => {
  797. if (!('0' != elem.canEdit && '8' != elem.type)) return
  798. obj[elem.elementId] = {
  799. rules: [
  800. {
  801. required: '1' == elem.noNull,
  802. },
  803. // {
  804. // format: formatTypeDict[elem.fieldType] || 'string',
  805. // }
  806. ],
  807. label: elem.elementName
  808. };
  809. });
  810. return obj;
  811. }).value
  812. }
  813. const button_state = ref(true)
  814. function computedMainFormValue() {
  815. // 设置主表校验数据
  816. mainFormValue.value = computed(() => {
  817. const obj = {};
  818. formElements.value.forEach(elem => {
  819. if (!('0' != elem.canEdit && '8' != elem.type)) return
  820. obj[elem.elementId] = elem.defaultValue;
  821. });
  822. return obj;
  823. }).value
  824. }
  825. function submitProcess() { // 提交表单
  826. // 禁用提交按钮
  827. button_state.value = false
  828. // validateMainForm()
  829. computedMainFormValue()
  830. // console.log('mainFormValue: ',mainFormValue.value);
  831. // console.log('$mainFormRules: ',$mainFormRules.value);
  832. // console.log('$mainForm: ',$mainForm.value);
  833. // 主表数据校验
  834. $mainForm.value.validate().then(res => {
  835. // 重复表数据校验
  836. // validateRepeatingForm()
  837. if (groupCanEdit.value){
  838. if (!validateRepeatingForm2()) {
  839. button_state.value = true
  840. return
  841. }
  842. }
  843. // 保存表单数据
  844. // processInfo.form = formElements.value.map(({ checkBox, tableField, defaultValue }) => {
  845. // // console.log('tableField: ',checkBox,tableField,defaultValue);
  846. // if(checkBox!==''){
  847. // const arr =testValue.value.split(",")
  848. // arr.forEach(item=>{
  849. // processInfo.form.push({name: tableField+"_showfxx", value: item})
  850. // })
  851. // return { name: tableField, value: testValue.value }
  852. // }
  853. // return { name: tableField, value: defaultValue }
  854. // })
  855. //补卡时间处理
  856. if (BUKA_MODELID.value == processInfo.modelId) {
  857. const workStartIndex = formElements.value.findIndex(element => element.elementName === "上班时间")
  858. const workEndIndex = formElements.value.findIndex(element => element.elementName === "下班时间")
  859. const workTypeIndex = formElements.value.findIndex(element => element.elementName === "补卡类型")
  860. const workTimeIndex = formElements.value.findIndex(element => element.elementName === "补卡时间")
  861. const workDateIndex = formElements.value.findIndex(element => element.elementName === "补卡日期")
  862. const DateIndex = formElements.value.findIndex(element => element.elementName === "日期")
  863. formElements.value[DateIndex].defaultValue = formElements.value[workDateIndex].defaultValue
  864. if ('上班' == formElements.value[workTypeIndex].defaultValue) {
  865. formElements.value[workStartIndex].defaultValue = formElements.value[workTimeIndex].defaultValue
  866. } else if ('下班' == formElements.value[workTypeIndex].defaultValue) {
  867. formElements.value[workEndIndex].defaultValue = formElements.value[workTimeIndex].defaultValue
  868. }
  869. // formElements.value.splice(workTimeIndex,1)
  870. // formElements.value.splice(workDateIndex,1)
  871. // console.log('f1',formElements.value);
  872. }
  873. const formArray = [];
  874. formElements.value.forEach(({ checkBox, tableField, defaultValue }) => {
  875. // if (checkBox) {
  876. // const items = checkBox.split(",").filter(item => item.trim() !== '');
  877. // items.forEach(item => {
  878. // formArray.push({ name: `${tableField}_showfxx`, value: item.trim() });
  879. // });
  880. // formArray.push({ name: tableField, value: checkBox });
  881. // } else {
  882. // formArray.push({ name: tableField, value: defaultValue });
  883. // }
  884. if (tableField != undefined) {
  885. formArray.push({ name: tableField, value: defaultValue });
  886. }
  887. });
  888. processInfo.form = formArray;
  889. console.log('f2', formArray);
  890. repeatingForm.value.elements.forEach((item, index) => {
  891. const newItem = item.map(({ name, defaultValue }) => {
  892. return {
  893. name: name + '_' + (index + 1),
  894. value: defaultValue
  895. }
  896. })
  897. processInfo.form.push(...newItem)
  898. })
  899. // 保存附件ID
  900. const seqs = fileSeqs.value.map(({ seq }) => seq)
  901. if (processInfo.reqOffice == 1 && seqs.length == 0) {
  902. button_state.value = true
  903. $modal.msgError('请上传附件')
  904. return
  905. }
  906. // 二次确认
  907. $modal.confirm('', '确认提交该流程?')
  908. .then(() => {
  909. submitProcessForm(userStore.user, processInfo, seqs).then(res => {
  910. if (res.returnMsg.includes('提交失败')) {
  911. // 启用提交按钮
  912. button_state.value = true
  913. $modal.msgError(res.returnMsg)
  914. } else {
  915. $modal.msgSuccess(res.returnMsg)
  916. // 通知列表刷新数据
  917. uni.$emit('ReloadProcessData');
  918. setTimeout(() => {
  919. // 返回上一页
  920. $tab.navigateBack();
  921. }, 1000)
  922. }
  923. })
  924. })
  925. .catch(() => {
  926. // 用户取消,恢复按钮状态
  927. button_state.value = true
  928. })
  929. }).catch(err => {
  930. button_state.value = true
  931. $modal.msgError('表单填写错误')
  932. });
  933. }
  934. const signaturePopup = ref(null)
  935. const signatureRef = ref(null)
  936. const signaturePopupShow = ref(false)
  937. const isLandscape = ref(false)
  938. const signatureItemIndex = ref(-1)
  939. function handleSignature(index) {
  940. signatureItemIndex.value = index
  941. signaturePopup.value.open()
  942. initSignature()
  943. }
  944. // 初始化签字板
  945. function initSignature() {
  946. signaturePopupShow.value = false
  947. setTimeout(() => {
  948. signaturePopupShow.value = true
  949. }, 100)
  950. }
  951. // 点击签字板按钮
  952. function onclickSignatureButton(event) {
  953. // console.log('onclickSignatureButton: ', event);
  954. switch (event) {
  955. case 'undo':
  956. signatureRef.value.undo()
  957. break;
  958. case 'clear':
  959. signatureRef.value.clear()
  960. break;
  961. case 'save':
  962. signatureRef.value.canvasToTempFilePath({
  963. success: (res : LSignatureToFileSuccess) => {
  964. if (res.isEmpty) {
  965. $modal.msgError('签名不能为空!')
  966. return
  967. }
  968. // 判断上传文件是否是base64
  969. if (res.tempFilePath.substring(0, 'data:image/png;base64,'.length) == 'data:image/png;base64,') {
  970. const _fileData = res.tempFilePath
  971. uploadSignatureBoardImg(userStore.user.useId, _fileData, formElements.value[signatureItemIndex.value].tableField)
  972. .then(({ returnParams }) => {
  973. formElements.value[signatureItemIndex.value].defaultValue = returnParams.sealInsID
  974. formElements.value[signatureItemIndex.value].sealImgPath = returnParams.path
  975. signatureItemIndex.value = -1
  976. signaturePopupShow.value = false
  977. signaturePopup.value.close()
  978. })
  979. } else {
  980. // 转 base64
  981. wx.getFileSystemManager().readFile({
  982. filePath: res.tempFilePath,
  983. encoding: 'base64',
  984. success: fileData => {
  985. const _fileData = 'data:image/png;base64,' + fileData.data
  986. uploadSignatureBoardImg(userStore.user.useId, _fileData, formElements.value[signatureItemIndex.value].tableField)
  987. .then(({ returnParams }) => {
  988. formElements.value[signatureItemIndex.value].defaultValue = returnParams.sealInsID
  989. formElements.value[signatureItemIndex.value].sealImgPath = returnParams.path
  990. signatureItemIndex.value = -1
  991. signaturePopupShow.value = false
  992. signaturePopup.value.close()
  993. })
  994. }
  995. })
  996. }
  997. }
  998. } as LSignatureToTempFilePathOptions)
  999. break;
  1000. case 'landscape':
  1001. isLandscape.value = !isLandscape.value
  1002. initSignature()
  1003. break;
  1004. }
  1005. }
  1006. function onclickAutosealButton(index) {
  1007. if (signatureItemIndex.value != -1) index = signatureItemIndex.value
  1008. getSeal(userStore.user.useId).then(({ returnParams }) => {
  1009. formElements.value[index].defaultValue = returnParams.sealFileId.universalid
  1010. formElements.value[index].sealImgPath = returnParams.sealFileId.path
  1011. signaturePopupShow.value = false
  1012. signaturePopup.value.close()
  1013. })
  1014. }
  1015. function closeSignaturePopup() {
  1016. signatureItemIndex.value = -1
  1017. signaturePopupShow.value = false
  1018. }
  1019. </script>
  1020. <style lang="scss" scoped>
  1021. .process_container {
  1022. position: relative;
  1023. ::v-deep .uni-forms {
  1024. .uni-forms-item__label {
  1025. font-size: calc(1rem + 0px) !important;
  1026. line-height: calc(1rem + 0px) !important;
  1027. font-weight: 600;
  1028. }
  1029. .uni-forms-item__content {
  1030. .uni-easyinput__content-textarea {
  1031. font-size: calc(14px + 1.2*(1rem - 16px)) !important;
  1032. font-weight: 500;
  1033. }
  1034. .uni-easyinput__content-input {
  1035. font-size: calc(14px + 1.2*(1rem - 16px)) !important;
  1036. font-weight: 500;
  1037. color: #333;
  1038. }
  1039. .uni-date {
  1040. .uni-icons {
  1041. font-size: calc(22px + 1.2*(1rem - 16px)) !important;
  1042. font-weight: 500;
  1043. }
  1044. .uni-date__x-input {
  1045. height: auto;
  1046. font-size: calc(14px + 1.2*(1rem - 16px)) !important;
  1047. font-weight: 500;
  1048. }
  1049. }
  1050. }
  1051. }
  1052. ::v-deep button {
  1053. font-size: calc(18px + .5*(1rem - 16px));
  1054. }
  1055. .main_container {
  1056. // min-height: 30vh;
  1057. }
  1058. .picker_container {
  1059. border: 1px solid #e5e5e5;
  1060. background-color: #fff;
  1061. border-radius: 4px;
  1062. // box-sizing: border-box;
  1063. .input_text {
  1064. color: #333;
  1065. font-size: calc(14px + .5*(1rem - 16px));
  1066. line-height: 35px;
  1067. height: 35px;
  1068. padding: 0 0 0 10px;
  1069. }
  1070. }
  1071. .repeating_table {
  1072. ::v-deep .uni-forms-item--border {
  1073. padding: 5px 0 !important;
  1074. }
  1075. .repeating_table_button_container {
  1076. margin-top: 5px;
  1077. button {
  1078. height: 36px;
  1079. line-height: 36px;
  1080. color: #fff;
  1081. }
  1082. .add {
  1083. background-color: #1ca035;
  1084. }
  1085. .del {
  1086. background-color: #e64340;
  1087. }
  1088. }
  1089. }
  1090. .file_picker_container {
  1091. ::v-deep .uni-card {
  1092. .uni-card__header-content-title {
  1093. font-size: calc(15px + .5*(1rem - 16px));
  1094. font-weight: 700;
  1095. }
  1096. .uni-card__header-extra-text {
  1097. font-size: calc(15px + .5*(1rem - 16px));
  1098. }
  1099. }
  1100. .precautions_content {
  1101. padding: 15px;
  1102. line-height: 1.6;
  1103. .precautions_label {
  1104. font-size: calc(14px + .5*(1rem - 16px));
  1105. font-weight: 600;
  1106. color: #ff0000;
  1107. }
  1108. .precautions_text {
  1109. font-size: calc(14px + .5*(1rem - 16px));
  1110. color: #ff0000;
  1111. word-break: break-all;
  1112. }
  1113. }
  1114. }
  1115. .is-disabled {
  1116. color: #666 !important;
  1117. }
  1118. .submit_button_container {
  1119. position: sticky;
  1120. z-index: 10;
  1121. width: 100%;
  1122. bottom: 10px;
  1123. .submit_button {
  1124. background-color: #007aff !important;
  1125. color: #fff !important;
  1126. }
  1127. .submit_button::after {
  1128. border: 1px solid rgba(0, 0, 0, .2);
  1129. border-radius: 10px;
  1130. box-sizing: border-box;
  1131. content: " ";
  1132. height: 200%;
  1133. left: 0;
  1134. position: absolute;
  1135. top: 0;
  1136. -webkit-transform: scale(.5);
  1137. transform: scale(.5);
  1138. -webkit-transform-origin: 0 0;
  1139. transform-origin: 0 0;
  1140. width: 200%;
  1141. border-top-width: 1px;
  1142. border-right-width: 1px;
  1143. border-bottom-width: 1px;
  1144. border-left-width: 1px;
  1145. border-top-style: solid;
  1146. border-right-style: solid;
  1147. border-bottom-style: solid;
  1148. border-left-style: solid;
  1149. border-top-color: rgba(0, 0, 0, 0.2);
  1150. border-right-color: rgba(0, 0, 0, 0.2);
  1151. border-bottom-color: rgba(0, 0, 0, 0.2);
  1152. border-left-color: rgba(0, 0, 0, 0.2);
  1153. border-image-source: initial;
  1154. border-image-slice: initial;
  1155. border-image-width: initial;
  1156. border-image-outset: initial;
  1157. border-image-repeat: initial;
  1158. border-top-left-radius: 10px;
  1159. border-top-right-radius: 10px;
  1160. border-bottom-right-radius: 10px;
  1161. border-bottom-left-radius: 10px;
  1162. }
  1163. }
  1164. }
  1165. ::v-deep .uni-calendar__content {
  1166. margin: -20px;
  1167. margin-top: 20px;
  1168. // 防止鸿蒙系统上日期选择器误触发返回
  1169. pointer-events: auto;
  1170. .uni-calendar__header {
  1171. .uni-calendar__header-text {
  1172. font-size: calc(14px + .5*(1rem - 16px)) !important;
  1173. }
  1174. .uni-calendar__backtoday {
  1175. padding: 2px 8px 2px 10px !important;
  1176. font-size: calc(0.75rem + 0px) !important;
  1177. }
  1178. }
  1179. .uni-calendar__box {
  1180. .uni-calendar__weeks {
  1181. .uni-calendar__weeks-day {
  1182. .uni-calendar__weeks-day-text {
  1183. font-size: calc(14px + .5*(1rem - 16px)) !important;
  1184. }
  1185. }
  1186. .uni-calendar__weeks-item {
  1187. .uni-calendar-item__weeks-box-item {
  1188. .uni-calendar-item__weeks-box-circle {
  1189. width: calc(8px + .5*(1rem - 16px)) !important;
  1190. height: calc(8px + .5*(1rem - 16px)) !important;
  1191. top: calc(5px - .25*(1rem - 16px)) !important;
  1192. right: calc(5px - .25*(1rem - 16px)) !important;
  1193. }
  1194. .uni-calendar-item__weeks-box-text {
  1195. font-size: calc(14px + .5*(1rem - 16px)) !important;
  1196. }
  1197. .uni-calendar-item__weeks-lunar-text {
  1198. font-size: calc(12px + .5*(1rem - 16px)) !important;
  1199. }
  1200. }
  1201. }
  1202. }
  1203. }
  1204. .uni-date-changed {
  1205. .uni-date-changed--time-date {
  1206. font-size: calc(14px + 1*(1rem - 16px)) !important;
  1207. }
  1208. .uni-datetime-picker-text {
  1209. font-size: calc(14px + 1*(1rem - 16px)) !important;
  1210. }
  1211. }
  1212. }
  1213. </style>