index.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286
  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. // 只有当 noNull 等于 '1' 时才进行非空验证
  764. if (fieldElement.noNull == '1' && (fieldValue == '' || fieldValue === undefined || fieldValue === null)) {
  765. const name = fieldElement.elementName.slice(3)
  766. $modal.msgError(`详情表${name}不能为空`)
  767. return false
  768. }
  769. }
  770. }
  771. return flag
  772. }
  773. // 设置表单校验规则
  774. const $mainFormRules = ref({})
  775. const $repFormRules = ref({})
  776. function getValidateRules() {
  777. $repFormRules.value = computed(() => {
  778. const obj = {};
  779. repeatingForm.value.elementItem.forEach(elem => {
  780. obj[elem.tableField] = {
  781. rules: [
  782. {
  783. required: true,
  784. },
  785. // {
  786. // 类型判断 数值型使用string会出错
  787. // formatTypeDict: formatTypeDict[elem.fieldType.value] || 'string',
  788. // }
  789. ],
  790. label: elem.elementName.slice(3)
  791. };
  792. });
  793. return obj;
  794. }).value
  795. $mainFormRules.value = computed(() => {
  796. const obj = {};
  797. formElements.value.forEach(elem => {
  798. if (!('0' != elem.canEdit && '8' != elem.type)) return
  799. obj[elem.elementId] = {
  800. rules: [
  801. {
  802. required: '1' == elem.noNull,
  803. },
  804. // {
  805. // format: formatTypeDict[elem.fieldType] || 'string',
  806. // }
  807. ],
  808. label: elem.elementName
  809. };
  810. });
  811. return obj;
  812. }).value
  813. }
  814. const button_state = ref(true)
  815. function computedMainFormValue() {
  816. // 设置主表校验数据
  817. mainFormValue.value = computed(() => {
  818. const obj = {};
  819. formElements.value.forEach(elem => {
  820. if (!('0' != elem.canEdit && '8' != elem.type)) return
  821. obj[elem.elementId] = elem.defaultValue;
  822. });
  823. return obj;
  824. }).value
  825. }
  826. function submitProcess() { // 提交表单
  827. // 禁用提交按钮
  828. button_state.value = false
  829. // validateMainForm()
  830. computedMainFormValue()
  831. // console.log('mainFormValue: ',mainFormValue.value);
  832. // console.log('$mainFormRules: ',$mainFormRules.value);
  833. // console.log('$mainForm: ',$mainForm.value);
  834. // 主表数据校验
  835. $mainForm.value.validate().then(res => {
  836. // 重复表数据校验
  837. // validateRepeatingForm()
  838. if (groupCanEdit.value){
  839. if (!validateRepeatingForm2()) {
  840. button_state.value = true
  841. return
  842. }
  843. }
  844. // 保存表单数据
  845. // processInfo.form = formElements.value.map(({ checkBox, tableField, defaultValue }) => {
  846. // // console.log('tableField: ',checkBox,tableField,defaultValue);
  847. // if(checkBox!==''){
  848. // const arr =testValue.value.split(",")
  849. // arr.forEach(item=>{
  850. // processInfo.form.push({name: tableField+"_showfxx", value: item})
  851. // })
  852. // return { name: tableField, value: testValue.value }
  853. // }
  854. // return { name: tableField, value: defaultValue }
  855. // })
  856. //补卡时间处理
  857. if (BUKA_MODELID.value == processInfo.modelId) {
  858. const workStartIndex = formElements.value.findIndex(element => element.elementName === "上班时间")
  859. const workEndIndex = formElements.value.findIndex(element => element.elementName === "下班时间")
  860. const workTypeIndex = formElements.value.findIndex(element => element.elementName === "补卡类型")
  861. const workTimeIndex = formElements.value.findIndex(element => element.elementName === "补卡时间")
  862. const workDateIndex = formElements.value.findIndex(element => element.elementName === "补卡日期")
  863. const DateIndex = formElements.value.findIndex(element => element.elementName === "日期")
  864. formElements.value[DateIndex].defaultValue = formElements.value[workDateIndex].defaultValue
  865. if ('上班' == formElements.value[workTypeIndex].defaultValue) {
  866. formElements.value[workStartIndex].defaultValue = formElements.value[workTimeIndex].defaultValue
  867. } else if ('下班' == formElements.value[workTypeIndex].defaultValue) {
  868. formElements.value[workEndIndex].defaultValue = formElements.value[workTimeIndex].defaultValue
  869. }
  870. // formElements.value.splice(workTimeIndex,1)
  871. // formElements.value.splice(workDateIndex,1)
  872. // console.log('f1',formElements.value);
  873. }
  874. const formArray = [];
  875. formElements.value.forEach(({ checkBox, tableField, defaultValue }) => {
  876. // if (checkBox) {
  877. // const items = checkBox.split(",").filter(item => item.trim() !== '');
  878. // items.forEach(item => {
  879. // formArray.push({ name: `${tableField}_showfxx`, value: item.trim() });
  880. // });
  881. // formArray.push({ name: tableField, value: checkBox });
  882. // } else {
  883. // formArray.push({ name: tableField, value: defaultValue });
  884. // }
  885. if (tableField != undefined) {
  886. formArray.push({ name: tableField, value: defaultValue });
  887. }
  888. });
  889. processInfo.form = formArray;
  890. console.log('f2', formArray);
  891. repeatingForm.value.elements.forEach((item, index) => {
  892. const newItem = item.map(({ name, defaultValue }) => {
  893. return {
  894. name: name + '_' + (index + 1),
  895. value: defaultValue
  896. }
  897. })
  898. processInfo.form.push(...newItem)
  899. })
  900. // 保存附件ID
  901. const seqs = fileSeqs.value.map(({ seq }) => seq)
  902. if (processInfo.reqOffice == 1 && seqs.length == 0) {
  903. button_state.value = true
  904. $modal.msgError('请上传附件')
  905. return
  906. }
  907. // 二次确认
  908. $modal.confirm('', '确认提交该流程?')
  909. .then(() => {
  910. submitProcessForm(userStore.user, processInfo, seqs).then(res => {
  911. if (res.returnMsg.includes('提交失败')) {
  912. // 启用提交按钮
  913. button_state.value = true
  914. $modal.msgError(res.returnMsg)
  915. } else {
  916. $modal.msgSuccess(res.returnMsg)
  917. // 通知列表刷新数据
  918. uni.$emit('ReloadProcessData');
  919. setTimeout(() => {
  920. // 返回上一页
  921. $tab.navigateBack();
  922. }, 1000)
  923. }
  924. })
  925. })
  926. .catch(() => {
  927. // 用户取消,恢复按钮状态
  928. button_state.value = true
  929. })
  930. }).catch(err => {
  931. button_state.value = true
  932. $modal.msgError('表单填写错误')
  933. });
  934. }
  935. const signaturePopup = ref(null)
  936. const signatureRef = ref(null)
  937. const signaturePopupShow = ref(false)
  938. const isLandscape = ref(false)
  939. const signatureItemIndex = ref(-1)
  940. function handleSignature(index) {
  941. signatureItemIndex.value = index
  942. signaturePopup.value.open()
  943. initSignature()
  944. }
  945. // 初始化签字板
  946. function initSignature() {
  947. signaturePopupShow.value = false
  948. setTimeout(() => {
  949. signaturePopupShow.value = true
  950. }, 100)
  951. }
  952. // 点击签字板按钮
  953. function onclickSignatureButton(event) {
  954. // console.log('onclickSignatureButton: ', event);
  955. switch (event) {
  956. case 'undo':
  957. signatureRef.value.undo()
  958. break;
  959. case 'clear':
  960. signatureRef.value.clear()
  961. break;
  962. case 'save':
  963. signatureRef.value.canvasToTempFilePath({
  964. success: (res : LSignatureToFileSuccess) => {
  965. if (res.isEmpty) {
  966. $modal.msgError('签名不能为空!')
  967. return
  968. }
  969. // 判断上传文件是否是base64
  970. if (res.tempFilePath.substring(0, 'data:image/png;base64,'.length) == 'data:image/png;base64,') {
  971. const _fileData = res.tempFilePath
  972. uploadSignatureBoardImg(userStore.user.useId, _fileData, formElements.value[signatureItemIndex.value].tableField)
  973. .then(({ returnParams }) => {
  974. formElements.value[signatureItemIndex.value].defaultValue = returnParams.sealInsID
  975. formElements.value[signatureItemIndex.value].sealImgPath = returnParams.path
  976. signatureItemIndex.value = -1
  977. signaturePopupShow.value = false
  978. signaturePopup.value.close()
  979. })
  980. } else {
  981. // 转 base64
  982. wx.getFileSystemManager().readFile({
  983. filePath: res.tempFilePath,
  984. encoding: 'base64',
  985. success: fileData => {
  986. const _fileData = 'data:image/png;base64,' + fileData.data
  987. uploadSignatureBoardImg(userStore.user.useId, _fileData, formElements.value[signatureItemIndex.value].tableField)
  988. .then(({ returnParams }) => {
  989. formElements.value[signatureItemIndex.value].defaultValue = returnParams.sealInsID
  990. formElements.value[signatureItemIndex.value].sealImgPath = returnParams.path
  991. signatureItemIndex.value = -1
  992. signaturePopupShow.value = false
  993. signaturePopup.value.close()
  994. })
  995. }
  996. })
  997. }
  998. }
  999. } as LSignatureToTempFilePathOptions)
  1000. break;
  1001. case 'landscape':
  1002. isLandscape.value = !isLandscape.value
  1003. initSignature()
  1004. break;
  1005. }
  1006. }
  1007. function onclickAutosealButton(index) {
  1008. if (signatureItemIndex.value != -1) index = signatureItemIndex.value
  1009. getSeal(userStore.user.useId).then(({ returnParams }) => {
  1010. formElements.value[index].defaultValue = returnParams.sealFileId.universalid
  1011. formElements.value[index].sealImgPath = returnParams.sealFileId.path
  1012. signaturePopupShow.value = false
  1013. signaturePopup.value.close()
  1014. })
  1015. }
  1016. function closeSignaturePopup() {
  1017. signatureItemIndex.value = -1
  1018. signaturePopupShow.value = false
  1019. }
  1020. </script>
  1021. <style lang="scss" scoped>
  1022. .process_container {
  1023. position: relative;
  1024. ::v-deep .uni-forms {
  1025. .uni-forms-item__label {
  1026. font-size: calc(1rem + 0px) !important;
  1027. line-height: calc(1rem + 0px) !important;
  1028. font-weight: 600;
  1029. }
  1030. .uni-forms-item__content {
  1031. .uni-easyinput__content-textarea {
  1032. font-size: calc(14px + 1.2*(1rem - 16px)) !important;
  1033. font-weight: 500;
  1034. }
  1035. .uni-easyinput__content-input {
  1036. font-size: calc(14px + 1.2*(1rem - 16px)) !important;
  1037. font-weight: 500;
  1038. color: #333;
  1039. }
  1040. .uni-date {
  1041. .uni-icons {
  1042. font-size: calc(22px + 1.2*(1rem - 16px)) !important;
  1043. font-weight: 500;
  1044. }
  1045. .uni-date__x-input {
  1046. height: auto;
  1047. font-size: calc(14px + 1.2*(1rem - 16px)) !important;
  1048. font-weight: 500;
  1049. }
  1050. }
  1051. }
  1052. }
  1053. ::v-deep button {
  1054. font-size: calc(18px + .5*(1rem - 16px));
  1055. }
  1056. .main_container {
  1057. // min-height: 30vh;
  1058. }
  1059. .picker_container {
  1060. border: 1px solid #e5e5e5;
  1061. background-color: #fff;
  1062. border-radius: 4px;
  1063. // box-sizing: border-box;
  1064. .input_text {
  1065. color: #333;
  1066. font-size: calc(14px + .5*(1rem - 16px));
  1067. line-height: 35px;
  1068. height: 35px;
  1069. padding: 0 0 0 10px;
  1070. }
  1071. }
  1072. .repeating_table {
  1073. ::v-deep .uni-forms-item--border {
  1074. padding: 5px 0 !important;
  1075. }
  1076. .repeating_table_button_container {
  1077. margin-top: 5px;
  1078. button {
  1079. height: 36px;
  1080. line-height: 36px;
  1081. color: #fff;
  1082. }
  1083. .add {
  1084. background-color: #1ca035;
  1085. }
  1086. .del {
  1087. background-color: #e64340;
  1088. }
  1089. }
  1090. }
  1091. .file_picker_container {
  1092. ::v-deep .uni-card {
  1093. .uni-card__header-content-title {
  1094. font-size: calc(15px + .5*(1rem - 16px));
  1095. font-weight: 700;
  1096. }
  1097. .uni-card__header-extra-text {
  1098. font-size: calc(15px + .5*(1rem - 16px));
  1099. }
  1100. }
  1101. .precautions_content {
  1102. padding: 15px;
  1103. line-height: 1.6;
  1104. .precautions_label {
  1105. font-size: calc(14px + .5*(1rem - 16px));
  1106. font-weight: 600;
  1107. color: #ff0000;
  1108. }
  1109. .precautions_text {
  1110. font-size: calc(14px + .5*(1rem - 16px));
  1111. color: #ff0000;
  1112. word-break: break-all;
  1113. }
  1114. }
  1115. }
  1116. .is-disabled {
  1117. color: #666 !important;
  1118. }
  1119. .submit_button_container {
  1120. position: sticky;
  1121. z-index: 10;
  1122. width: 100%;
  1123. bottom: 10px;
  1124. .submit_button {
  1125. background-color: #007aff !important;
  1126. color: #fff !important;
  1127. }
  1128. .submit_button::after {
  1129. border: 1px solid rgba(0, 0, 0, .2);
  1130. border-radius: 10px;
  1131. box-sizing: border-box;
  1132. content: " ";
  1133. height: 200%;
  1134. left: 0;
  1135. position: absolute;
  1136. top: 0;
  1137. -webkit-transform: scale(.5);
  1138. transform: scale(.5);
  1139. -webkit-transform-origin: 0 0;
  1140. transform-origin: 0 0;
  1141. width: 200%;
  1142. border-top-width: 1px;
  1143. border-right-width: 1px;
  1144. border-bottom-width: 1px;
  1145. border-left-width: 1px;
  1146. border-top-style: solid;
  1147. border-right-style: solid;
  1148. border-bottom-style: solid;
  1149. border-left-style: solid;
  1150. border-top-color: rgba(0, 0, 0, 0.2);
  1151. border-right-color: rgba(0, 0, 0, 0.2);
  1152. border-bottom-color: rgba(0, 0, 0, 0.2);
  1153. border-left-color: rgba(0, 0, 0, 0.2);
  1154. border-image-source: initial;
  1155. border-image-slice: initial;
  1156. border-image-width: initial;
  1157. border-image-outset: initial;
  1158. border-image-repeat: initial;
  1159. border-top-left-radius: 10px;
  1160. border-top-right-radius: 10px;
  1161. border-bottom-right-radius: 10px;
  1162. border-bottom-left-radius: 10px;
  1163. }
  1164. }
  1165. }
  1166. ::v-deep .uni-calendar__content {
  1167. margin: -20px;
  1168. margin-top: 20px;
  1169. // 防止鸿蒙系统上日期选择器误触发返回
  1170. pointer-events: auto;
  1171. .uni-calendar__header {
  1172. .uni-calendar__header-text {
  1173. font-size: calc(14px + .5*(1rem - 16px)) !important;
  1174. }
  1175. .uni-calendar__backtoday {
  1176. padding: 2px 8px 2px 10px !important;
  1177. font-size: calc(0.75rem + 0px) !important;
  1178. }
  1179. }
  1180. .uni-calendar__box {
  1181. .uni-calendar__weeks {
  1182. .uni-calendar__weeks-day {
  1183. .uni-calendar__weeks-day-text {
  1184. font-size: calc(14px + .5*(1rem - 16px)) !important;
  1185. }
  1186. }
  1187. .uni-calendar__weeks-item {
  1188. .uni-calendar-item__weeks-box-item {
  1189. .uni-calendar-item__weeks-box-circle {
  1190. width: calc(8px + .5*(1rem - 16px)) !important;
  1191. height: calc(8px + .5*(1rem - 16px)) !important;
  1192. top: calc(5px - .25*(1rem - 16px)) !important;
  1193. right: calc(5px - .25*(1rem - 16px)) !important;
  1194. }
  1195. .uni-calendar-item__weeks-box-text {
  1196. font-size: calc(14px + .5*(1rem - 16px)) !important;
  1197. }
  1198. .uni-calendar-item__weeks-lunar-text {
  1199. font-size: calc(12px + .5*(1rem - 16px)) !important;
  1200. }
  1201. }
  1202. }
  1203. }
  1204. }
  1205. .uni-date-changed {
  1206. .uni-date-changed--time-date {
  1207. font-size: calc(14px + 1*(1rem - 16px)) !important;
  1208. }
  1209. .uni-datetime-picker-text {
  1210. font-size: calc(14px + 1*(1rem - 16px)) !important;
  1211. }
  1212. }
  1213. }
  1214. </style>