index.vue 41 KB

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