|
|
@@ -13,34 +13,40 @@
|
|
|
<!-- 计算出差天数 -->
|
|
|
<uni-easyinput v-if="undefined != elem.bindTimeRange && elem.elementName == '出差天数'"
|
|
|
:type="fieldTypeDict[elem.fieldType] || 'text'"
|
|
|
- :value="calculateBusinessDifference(elem, formElements)"
|
|
|
- placeholder="" :disabled="true"></uni-easyinput>
|
|
|
+ :value="calculateBusinessDifference(elem, formElements)" placeholder=""
|
|
|
+ :disabled="true"></uni-easyinput>
|
|
|
|
|
|
<uni-easyinput v-else-if="undefined != elem.bindTimeRange"
|
|
|
:type="fieldTypeDict[elem.fieldType] || 'text'"
|
|
|
- :value="calculateTimeDifference(elem, formElements)" placeholder="" :disabled="true"></uni-easyinput>
|
|
|
+ :value="calculateTimeDifference(elem, formElements)" placeholder=""
|
|
|
+ :disabled="true"></uni-easyinput>
|
|
|
<!-- 金额转大写 -->
|
|
|
<uni-easyinput v-else-if="elem.elementName.endsWith('大写')" placeholder=""
|
|
|
:value="computedNumberToChineseCurrency(elem, formElements)"></uni-easyinput>
|
|
|
<!-- 主表关联变量输入框 -->
|
|
|
<!-- 数值输入框 -->
|
|
|
- <uni-easyinput v-else-if="'1' == elem.fieldType && elem.BddzText"
|
|
|
- type="digit" :value="computedBddzTextValue(elem)" @input="digitInput($event, elem)" placeholder="" :disabled="true"></uni-easyinput>
|
|
|
+ <uni-easyinput v-else-if="'1' == elem.fieldType && elem.BddzText" type="digit"
|
|
|
+ :value="computedBddzTextValue(elem)" @input="digitInput($event, elem)" placeholder=""
|
|
|
+ :disabled="true"></uni-easyinput>
|
|
|
<!-- 输入框 -->
|
|
|
- <uni-easyinput v-else-if="elem.BddzText"
|
|
|
- :type="fieldTypeDict[elem.fieldType] || 'text'"
|
|
|
+ <uni-easyinput v-else-if="elem.BddzText" :type="fieldTypeDict[elem.fieldType] || 'text'"
|
|
|
:value="computedBddzTextValue(elem)" placeholder="" :disabled="true"></uni-easyinput>
|
|
|
<!-- 数值输入框 -->
|
|
|
- <uni-easyinput v-else-if="'0' == elem.type && '1' == elem.fieldType" :disabled="'0' == elem.canEdit" type="digit" :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" @input="digitInput($event, elem)"
|
|
|
- v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
|
|
|
+ <uni-easyinput v-else-if="'0' == elem.type && '1' == elem.fieldType"
|
|
|
+ :disabled="'0' == elem.canEdit" type="digit"
|
|
|
+ :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" @input="digitInput($event, elem)"
|
|
|
+ v-model="elem.defaultValue"
|
|
|
+ placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
|
|
|
<!-- 输入框 -->
|
|
|
<uni-easyinput v-else-if="'0' == elem.type" :disabled="'0' == elem.canEdit"
|
|
|
:type="fieldTypeDict[elem.fieldType] || 'text'"
|
|
|
- :placeholder="'0' == elem.canEdit ? '' : '请输入内容'"
|
|
|
- v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
|
|
|
+ :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue"
|
|
|
+ placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"></uni-easyinput>
|
|
|
<!-- 富文本输入框 -->
|
|
|
<uni-easyinput v-else-if="'1' == elem.type" :disabled="'0' == elem.canEdit"
|
|
|
- :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="textarea"></uni-easyinput>
|
|
|
+ :placeholder="'0' == elem.canEdit ? '' : '请输入内容'" v-model="elem.defaultValue"
|
|
|
+ placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"
|
|
|
+ type="textarea"></uni-easyinput>
|
|
|
<!-- 下拉框 -->
|
|
|
<picker class="picker_container" v-else-if="'2' == elem.type"
|
|
|
@change="bindPickerChange($event, elem)" :value="elem.defaultValue"
|
|
|
@@ -52,7 +58,12 @@
|
|
|
</view>
|
|
|
</picker>
|
|
|
<!-- 数据选择器 -->
|
|
|
- <uni-data-checkbox v-else-if="'5' == elem.type" multiple v-model="elem.defaultValue" :localdata="formatCheckbox(elem)" @change="changeDataCheckBox($event,elem)"></uni-data-checkbox>
|
|
|
+ <uni-data-checkbox v-else-if="'4' == elem.type" v-model="elem.defaultValue"
|
|
|
+ :localdata="formatCheckbox(elem)"
|
|
|
+ @change="changeDataSingleCheckBox($event, elem)"></uni-data-checkbox>
|
|
|
+ <uni-data-checkbox v-else-if="'5' == elem.type" multiple v-model="elem.defaultValue"
|
|
|
+ :localdata="formatCheckbox(elem)"
|
|
|
+ @change="changeDataCheckBox($event, elem)"></uni-data-checkbox>
|
|
|
<!-- 开始时间选择器 -->
|
|
|
<uni-datetime-picker :end="formElements[elem.endElemIndex].defaultValue"
|
|
|
@change="setTimeRange(elem)"
|
|
|
@@ -65,8 +76,13 @@
|
|
|
v-model="elem.defaultValue" :clear-icon="false" type="datetime" />
|
|
|
<!-- 其他时间选择器 -->
|
|
|
<!-- 年月日 时分秒 -->
|
|
|
- <uni-datetime-picker v-else-if="'9' == elem.type" v-model="elem.defaultValue"
|
|
|
- type="datetime" />
|
|
|
+ <uni-datetime-picker v-else-if="'9' == elem.type && BUKA_MODELID != processInfo.modelId"
|
|
|
+ v-model="elem.defaultValue" type="datetime" />
|
|
|
+ <!-- 补卡流程专用 -->
|
|
|
+ <uni-datetime-picker v-else-if="'9' == elem.type && BUKA_MODELID == processInfo.modelId"
|
|
|
+ v-model="elem.defaultValue" type="datetime"
|
|
|
+ :start="`${formElements[0].defaultValue} 00:00:00`"
|
|
|
+ :end="`${formElements[0].defaultValue} 23:59:59`" @change="bukaTimeChange" />
|
|
|
<!-- 年月日 -->
|
|
|
<uni-datetime-picker v-else-if="'3' == elem.type" v-model="elem.defaultValue" type="date" />
|
|
|
</uni-forms-item>
|
|
|
@@ -82,11 +98,17 @@
|
|
|
<uni-forms-item :name="elem.tableField" v-for="(elem, itemIndex) in form"
|
|
|
:label="repeatingForm.elementItem[itemIndex].elementName.slice(3)" :key="itemIndex">
|
|
|
<!-- 自定义关联变量 -->
|
|
|
- <uni-easyinput v-if="repeatingForm.elementItem[itemIndex].bddzText" :placeholder="''" :type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" :value="calculateRepeatingFormExpression(elem, form)" :disabled="true"></uni-easyinput>
|
|
|
+ <uni-easyinput v-if="repeatingForm.elementItem[itemIndex].bddzText" :placeholder="''"
|
|
|
+ :type="fieldTypeDict[repeatingForm.elementItem[itemIndex].fieldType.value] || 'text'"
|
|
|
+ placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))"
|
|
|
+ :value="calculateRepeatingFormExpression(elem, form)" :disabled="true"></uni-easyinput>
|
|
|
<!-- 数值输入框 -->
|
|
|
- <uni-easyinput v-else-if="'1' == repeatingForm.elementItem[itemIndex].fieldType.value" placeholder="请输入内容" v-model="elem.defaultValue" @input="digitInput($event, elem)" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="digit"></uni-easyinput>
|
|
|
+ <uni-easyinput v-else-if="'1' == repeatingForm.elementItem[itemIndex].fieldType.value"
|
|
|
+ placeholder="请输入内容" v-model="elem.defaultValue" @input="digitInput($event, elem)"
|
|
|
+ placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="digit"></uni-easyinput>
|
|
|
<!-- 输入框 -->
|
|
|
- <uni-easyinput v-else placeholder="请输入内容" v-model="elem.defaultValue" placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="text"></uni-easyinput>
|
|
|
+ <uni-easyinput v-else placeholder="请输入内容" v-model="elem.defaultValue"
|
|
|
+ placeholderStyle="font-size: calc(14px + 1.2*(1rem - 16px))" type="text"></uni-easyinput>
|
|
|
</uni-forms-item>
|
|
|
</uni-forms>
|
|
|
<view class="repeating_table_button_container">
|
|
|
@@ -105,8 +127,8 @@
|
|
|
<!-- 上传附件 -->
|
|
|
<view class="file_picker_container">
|
|
|
<uni-card title="上传附件" :extra="`${fileList.length}/50`" spacing="0">
|
|
|
- <uni-file-picker ref="filePicker" v-model="fileList" :auto-upload="true" mode="list" :limit="50" :limitLength="50"
|
|
|
- file-mediatype="all" @select="handleFileSelect" @progress="handleFileProgress"
|
|
|
+ <uni-file-picker ref="filePicker" v-model="fileList" :auto-upload="true" mode="list" :limit="50"
|
|
|
+ :limitLength="50" file-mediatype="all" @select="handleFileSelect" @progress="handleFileProgress"
|
|
|
@success="handleFileSuccess" @fail="handleFileFail" @delete="handleFileDelete" />
|
|
|
</uni-card>
|
|
|
</view>
|
|
|
@@ -129,11 +151,15 @@ import $tab from '@/plugins/tab.js'
|
|
|
import { convertToChineseCurrency } from '@/utils/ygoa.js'
|
|
|
import { calCommonExp } from '@/utils/rpn.js'
|
|
|
import { getProcessInfo, getProcessForm, submitProcessForm, uploadFile, getAttendanceSegment } from '@/api/work.js'
|
|
|
+import { useConfigStore } from '@/store/config.js'
|
|
|
|
|
|
+const configStore = useConfigStore()
|
|
|
const fieldTypeDict = {
|
|
|
'0': 'text',
|
|
|
'1': 'digit'
|
|
|
}
|
|
|
+//补卡申请流程模板id
|
|
|
+const BUKA_MODELID = ref('995804554666003')
|
|
|
let processInfo = reactive({
|
|
|
modelName: '流程申请',
|
|
|
reqOffice: 0,
|
|
|
@@ -147,8 +173,14 @@ let processInfo = reactive({
|
|
|
})
|
|
|
const userStore = useUserStore()
|
|
|
const title = ref('')
|
|
|
+//考勤页面传入的补卡信息
|
|
|
+const bukaObj = ref({
|
|
|
+ bukaDate: '',
|
|
|
+ bukaType: '',
|
|
|
+ bukaTime: ''
|
|
|
+})
|
|
|
onLoad((options) => {
|
|
|
- const { modelName, modelId, control } = options
|
|
|
+ const { modelName, modelId, control, bukaDate, bukaType } = options
|
|
|
processInfo.modelName = modelName
|
|
|
processInfo.modelId = modelId
|
|
|
processInfo.control = control
|
|
|
@@ -157,6 +189,12 @@ onLoad((options) => {
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: title.value
|
|
|
});
|
|
|
+ if (bukaDate && bukaType) {
|
|
|
+ const workStartTime = configStore.signInTimeRange?.[1] || "09:00:00"
|
|
|
+ const workEndTime = configStore.signOutTimeRange?.[0] || "17:30:00"
|
|
|
+ const bukaTime = bukaDate + ' ' + ('上班' == bukaType ? workStartTime : workEndTime)
|
|
|
+ bukaObj.value = { bukaDate, bukaType, bukaTime }
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
onMounted(() => {
|
|
|
@@ -188,8 +226,34 @@ const repeatingForm = ref({
|
|
|
|
|
|
function initProcessForm() {
|
|
|
getProcessForm(userStore.user, processInfo).then(({ returnParams }) => {
|
|
|
- formElements.value = returnParams.formElements
|
|
|
+ //对补卡申请的时间选择器进行处理
|
|
|
+ if (BUKA_MODELID.value == processInfo.modelId) {
|
|
|
+ returnParams.formElements.forEach(element => {
|
|
|
+ if (element.type === "9" || "日期" == element.elementName) {
|
|
|
+ element.type = "8";
|
|
|
+ }
|
|
|
+ if ("补卡类型" == element.elementName) {
|
|
|
+ element.defaultValue = bukaObj.value.bukaType
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const dateElement = {
|
|
|
+ defaultValue: bukaObj.value.bukaDate || new Date().toISOString().substring(0, 10),
|
|
|
+ elementName: '补卡日期',
|
|
|
+ type: '3'
|
|
|
+ }
|
|
|
+ const timeElement = {
|
|
|
+ defaultValue: bukaObj.value.bukaTime,
|
|
|
+ elementName: '补卡时间',
|
|
|
+ type: '9'
|
|
|
+ }
|
|
|
+ returnParams.formElements.splice(0, 0, dateElement)
|
|
|
+ returnParams.formElements.splice(8, 0, timeElement)
|
|
|
+ formElements.value = returnParams.formElements
|
|
|
+ } else {
|
|
|
+ formElements.value = returnParams.formElements
|
|
|
+ }
|
|
|
repeatingForm.value = returnParams.repeatingForm
|
|
|
+ // console.log('formElements', formElements.value);
|
|
|
getValidateRules()
|
|
|
computedMainFormValue()
|
|
|
// 生成第一个重复表数据
|
|
|
@@ -200,6 +264,21 @@ function initProcessForm() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//单选框(补卡类型)
|
|
|
+function changeDataSingleCheckBox(e, elem) {
|
|
|
+ // console.log('单选框切换事件',e.detail.value);
|
|
|
+ const workStartTime = configStore.signInTimeRange?.[1] || "09:00:00"
|
|
|
+ const workEndTime = configStore.signOutTimeRange?.[0] || "17:30:00"
|
|
|
+ // console.log(workStartTime)
|
|
|
+ if (BUKA_MODELID.value == processInfo.modelId && '' != formElements.value[0].defaultValue) {
|
|
|
+ if ('上班' == e.detail.value) {
|
|
|
+ formElements.value[8].defaultValue = formElements.value[0].defaultValue + ' ' + workStartTime
|
|
|
+ } else if ('下班' == e.detail.value) {
|
|
|
+ formElements.value[8].defaultValue = formElements.value[0].defaultValue + ' ' + workEndTime
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const timeRangeItems = ref([
|
|
|
['开始时间', '结束时间', '多少小时'],
|
|
|
['出发时间', '预计返回时间'],
|
|
|
@@ -216,12 +295,12 @@ function bindTimeRangeData() {
|
|
|
// 找到 startName 和 endName 的索引
|
|
|
const startIndex = formElements.value.findIndex((item) => item.elementName === startName);
|
|
|
const endIndex = formElements.value.findIndex((item) => item.elementName === endName);
|
|
|
-
|
|
|
+
|
|
|
const formatDate = (date) => {
|
|
|
- const pad = (num) => num.toString().padStart(2, '0');
|
|
|
- return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
|
+ const pad = (num) => num.toString().padStart(2, '0');
|
|
|
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 只有找到 startName 和 endName 后,才检查 bindName
|
|
|
if (startIndex !== -1 && endIndex !== -1) {
|
|
|
formElements.value[startIndex].defaultValue = formatDate(new Date())
|
|
|
@@ -250,14 +329,14 @@ function bindTimeRangeData() {
|
|
|
}
|
|
|
// 计算时间差
|
|
|
function calculateBusinessDifference(item, form) {
|
|
|
- return item.defaultValue = (calculateTimeDifference(item, form)/7).toFixed(2)
|
|
|
+ return item.defaultValue = (calculateTimeDifference(item, form) / 7).toFixed(2)
|
|
|
}
|
|
|
function calculateTimeDifference(item, form) {
|
|
|
// 获取 开始时间 和 结束时间
|
|
|
const { startIndex, endIndex } = item.bindTimeRange;
|
|
|
const startTime = new Date(form[startIndex].defaultValue);
|
|
|
const endTime = new Date(form[endIndex].defaultValue);
|
|
|
-
|
|
|
+
|
|
|
// 检查时间是否合法
|
|
|
if (isNaN(startTime.getTime()) || isNaN(endTime.getTime())) {
|
|
|
return item.defaultValue = 0
|
|
|
@@ -431,19 +510,20 @@ function formatDict(dict) {
|
|
|
return dict.map(({ enumVname }) => enumVname)
|
|
|
}
|
|
|
//数据选择器
|
|
|
-function formatCheckbox(elem){
|
|
|
+function formatCheckbox(elem) {
|
|
|
let dict = elem.typeDetail.enum
|
|
|
// elem['checkBox'] = ''
|
|
|
return dict.map((item, index) => ({
|
|
|
text: item.enumVname,
|
|
|
- value: item.enumVname
|
|
|
+ value: item.enumVname
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
-function changeDataCheckBox(e,elem){
|
|
|
- elem['checkBox']=e.detail.value.join(",")
|
|
|
+function changeDataCheckBox(e, elem) {
|
|
|
+ elem['checkBox'] = e.detail.value.join(",")
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// 新增重复表表单
|
|
|
function addRepeatingFormItem(index) {
|
|
|
const form = repeatingForm.value.elementItem.map(({ tableField, bddzText }) => {
|
|
|
@@ -466,40 +546,40 @@ function delRepeatingFormItem(index) {
|
|
|
.catch(() => { })
|
|
|
}
|
|
|
function digitInput(event, item) {
|
|
|
- // 获取输入框当前的值
|
|
|
- let currentValue = event;
|
|
|
-
|
|
|
- // 过滤非数字和小数点的字符
|
|
|
- currentValue = currentValue.replace(/[^0-9.]/g, '');
|
|
|
-
|
|
|
- // 处理前导零的情况:
|
|
|
- // 如果当前值没有小数点(即是整数),去掉前导零
|
|
|
- if (currentValue.indexOf('.') === -1) {
|
|
|
- currentValue = currentValue.replace(/^0+(?=\d)/, ''); // 只有当有数字跟随时才去掉前导零
|
|
|
- } else {
|
|
|
- // 如果包含小数点,处理整数部分的前导零,保留小数部分
|
|
|
- let parts = currentValue.split('.');
|
|
|
- parts[0] = parts[0].replace(/^0+(?=\d)/, ''); // 只去掉整数部分的前导零
|
|
|
- currentValue = parts.join('.'); // 重新拼接
|
|
|
- }
|
|
|
-
|
|
|
- // 防止多个小数点
|
|
|
- const parts = currentValue.split('.');
|
|
|
- let finalValue;
|
|
|
- if (parts.length > 2) {
|
|
|
- // 如果有多个小数点,保留第一个小数点及后续数字
|
|
|
- finalValue = parts[0] + '.' + parts[1];
|
|
|
- } else {
|
|
|
- finalValue = currentValue;
|
|
|
- }
|
|
|
-
|
|
|
- // 更新最终结果到 item
|
|
|
- nextTick(() => {
|
|
|
- item.defaultValue = finalValue;
|
|
|
- event = finalValue; // 更新输入框的值
|
|
|
- });
|
|
|
-
|
|
|
- return event;
|
|
|
+ // 获取输入框当前的值
|
|
|
+ let currentValue = event;
|
|
|
+
|
|
|
+ // 过滤非数字和小数点的字符
|
|
|
+ currentValue = currentValue.replace(/[^0-9.]/g, '');
|
|
|
+
|
|
|
+ // 处理前导零的情况:
|
|
|
+ // 如果当前值没有小数点(即是整数),去掉前导零
|
|
|
+ if (currentValue.indexOf('.') === -1) {
|
|
|
+ currentValue = currentValue.replace(/^0+(?=\d)/, ''); // 只有当有数字跟随时才去掉前导零
|
|
|
+ } else {
|
|
|
+ // 如果包含小数点,处理整数部分的前导零,保留小数部分
|
|
|
+ let parts = currentValue.split('.');
|
|
|
+ parts[0] = parts[0].replace(/^0+(?=\d)/, ''); // 只去掉整数部分的前导零
|
|
|
+ currentValue = parts.join('.'); // 重新拼接
|
|
|
+ }
|
|
|
+
|
|
|
+ // 防止多个小数点
|
|
|
+ const parts = currentValue.split('.');
|
|
|
+ let finalValue;
|
|
|
+ if (parts.length > 2) {
|
|
|
+ // 如果有多个小数点,保留第一个小数点及后续数字
|
|
|
+ finalValue = parts[0] + '.' + parts[1];
|
|
|
+ } else {
|
|
|
+ finalValue = currentValue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新最终结果到 item
|
|
|
+ nextTick(() => {
|
|
|
+ item.defaultValue = finalValue;
|
|
|
+ event = finalValue; // 更新输入框的值
|
|
|
+ });
|
|
|
+
|
|
|
+ return event;
|
|
|
}
|
|
|
// 计算重复表关联变量表达式结果值
|
|
|
function calculateRepeatingFormExpression(item, form) {
|
|
|
@@ -629,7 +709,7 @@ function validateRepeatingForm2() {
|
|
|
$modal.msgError(`详情表 ${name} 数据填写错误`)
|
|
|
flag = false
|
|
|
return
|
|
|
- }
|
|
|
+ }
|
|
|
ItemIndex++
|
|
|
}
|
|
|
flag = true
|
|
|
@@ -708,7 +788,7 @@ function submitProcess() { // 提交表单
|
|
|
return
|
|
|
}
|
|
|
// 保存表单数据
|
|
|
-
|
|
|
+
|
|
|
// processInfo.form = formElements.value.map(({ checkBox, tableField, defaultValue }) => {
|
|
|
// // console.log('tableField: ',checkBox,tableField,defaultValue);
|
|
|
// if(checkBox!==''){
|
|
|
@@ -720,23 +800,43 @@ function submitProcess() { // 提交表单
|
|
|
// }
|
|
|
// return { name: tableField, value: defaultValue }
|
|
|
// })
|
|
|
-
|
|
|
+ //补卡时间处理
|
|
|
+ if (BUKA_MODELID.value == processInfo.modelId) {
|
|
|
+ const workStartIndex = formElements.value.findIndex(element => element.elementName === "上班时间")
|
|
|
+ const workEndIndex = formElements.value.findIndex(element => element.elementName === "下班时间")
|
|
|
+ const workTypeIndex = formElements.value.findIndex(element => element.elementName === "补卡类型")
|
|
|
+ const workTimeIndex = formElements.value.findIndex(element => element.elementName === "补卡时间")
|
|
|
+ const workDateIndex = formElements.value.findIndex(element => element.elementName === "补卡日期")
|
|
|
+ const DateIndex = formElements.value.findIndex(element => element.elementName === "日期")
|
|
|
+ formElements.value[DateIndex].defaultValue = formElements.value[workDateIndex].defaultValue
|
|
|
+ if ('上班' == formElements.value[workTypeIndex].defaultValue) {
|
|
|
+ formElements.value[workStartIndex].defaultValue = formElements.value[workTimeIndex].defaultValue
|
|
|
+ } else if ('下班' == formElements.value[workTypeIndex].defaultValue) {
|
|
|
+ formElements.value[workEndIndex].defaultValue = formElements.value[workTimeIndex].defaultValue
|
|
|
+ }
|
|
|
+ // formElements.value.splice(workTimeIndex,1)
|
|
|
+ // formElements.value.splice(workDateIndex,1)
|
|
|
+ // console.log('f1',formElements.value);
|
|
|
+ }
|
|
|
const formArray = [];
|
|
|
-
|
|
|
+
|
|
|
formElements.value.forEach(({ checkBox, tableField, defaultValue }) => {
|
|
|
- if (checkBox) {
|
|
|
- const items = checkBox.split(",").filter(item => item.trim() !== '');
|
|
|
- items.forEach(item => {
|
|
|
- formArray.push({ name: `${tableField}_showfxx`, value: item.trim() });
|
|
|
- });
|
|
|
- formArray.push({ name: tableField, value: checkBox });
|
|
|
- } else {
|
|
|
+ // if (checkBox) {
|
|
|
+ // const items = checkBox.split(",").filter(item => item.trim() !== '');
|
|
|
+ // items.forEach(item => {
|
|
|
+ // formArray.push({ name: `${tableField}_showfxx`, value: item.trim() });
|
|
|
+ // });
|
|
|
+ // formArray.push({ name: tableField, value: checkBox });
|
|
|
+ // } else {
|
|
|
+ // formArray.push({ name: tableField, value: defaultValue });
|
|
|
+ // }
|
|
|
+ if (tableField != undefined) {
|
|
|
formArray.push({ name: tableField, value: defaultValue });
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
processInfo.form = formArray;
|
|
|
-
|
|
|
+ console.log('f2', formArray);
|
|
|
repeatingForm.value.elements.forEach((item, index) => {
|
|
|
const newItem = item.map(({ name, defaultValue }) => {
|
|
|
return {
|
|
|
@@ -926,18 +1026,22 @@ function submitProcess() { // 提交表单
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
::v-deep .uni-calendar__content {
|
|
|
margin: -20px;
|
|
|
margin-top: 20px;
|
|
|
+
|
|
|
.uni-calendar__header {
|
|
|
.uni-calendar__header-text {
|
|
|
font-size: calc(14px + .5*(1rem - 16px)) !important;
|
|
|
}
|
|
|
+
|
|
|
.uni-calendar__backtoday {
|
|
|
padding: 2px 8px 2px 10px !important;
|
|
|
font-size: calc(0.75rem + 0px) !important;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.uni-calendar__box {
|
|
|
.uni-calendar__weeks {
|
|
|
.uni-calendar__weeks-day {
|
|
|
@@ -945,6 +1049,7 @@ function submitProcess() { // 提交表单
|
|
|
font-size: calc(14px + .5*(1rem - 16px)) !important;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.uni-calendar__weeks-item {
|
|
|
.uni-calendar-item__weeks-box-item {
|
|
|
.uni-calendar-item__weeks-box-circle {
|
|
|
@@ -953,9 +1058,11 @@ function submitProcess() { // 提交表单
|
|
|
top: calc(5px - .25*(1rem - 16px)) !important;
|
|
|
right: calc(5px - .25*(1rem - 16px)) !important;
|
|
|
}
|
|
|
+
|
|
|
.uni-calendar-item__weeks-box-text {
|
|
|
font-size: calc(14px + .5*(1rem - 16px)) !important;
|
|
|
}
|
|
|
+
|
|
|
.uni-calendar-item__weeks-lunar-text {
|
|
|
font-size: calc(12px + .5*(1rem - 16px)) !important;
|
|
|
}
|
|
|
@@ -963,10 +1070,12 @@ function submitProcess() { // 提交表单
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.uni-date-changed {
|
|
|
.uni-date-changed--time-date {
|
|
|
font-size: calc(14px + 1*(1rem - 16px)) !important;
|
|
|
}
|
|
|
+
|
|
|
.uni-datetime-picker-text {
|
|
|
font-size: calc(14px + 1*(1rem - 16px)) !important;
|
|
|
}
|