HolidayForm.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <template>
  2. <view>
  3. <cu-custom :backUrl="'/pages/index/index'" :isBack="true" bgColor="bg-gradual-blue" >
  4. <block slot="content">请假申请</block>
  5. </cu-custom>
  6. <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="!nodeFlag">
  7. <u-form-item label="请假人" borderBottom prop="createName">
  8. <u--input placeholder='请填写请假人' v-model="inputForm.createName" disabled></u--input>
  9. </u-form-item>
  10. <u-form-item label="请假部门" borderBottom prop="officeName">
  11. <u--input placeholder='请填写请假部门' v-model="inputForm.officeName" disabled></u--input>
  12. </u-form-item>
  13. <u-form-item label="请假类型" borderBottom prop="type" >
  14. <jp-picker v-model="inputForm.type" rangeKey="label" rangeValue="value" :range="[
  15. { label: '年假', value: '1' },
  16. { label: '事假', value: '2' },
  17. { label: '病假', value: '3' },
  18. { label: '调休假', value: '4' },
  19. { label: '婚假', value: '5' },
  20. { label: '产假', value: '6' },
  21. { label: '陪产假', value: '7' },
  22. { label: '其他', value: '8' },
  23. ]"></jp-picker>
  24. </u-form-item>
  25. <u-form-item label="开始时间" borderBottom prop="startDay" :required="true">
  26. <el-date-picker
  27. v-model="inputForm.startDay"
  28. type="date"
  29. placeholder="请选择开始时间"
  30. style="width:100%"
  31. size="default"
  32. placement="bottom-start"
  33. @change="checkTime"
  34. clearable>
  35. </el-date-picker>
  36. <el-select v-model="inputForm.beginTime" style="width: 50%" placeholder="请选择开始时间" @change="checkTime">
  37. <el-option value="上午" label="上午"></el-option>
  38. <el-option value="下午" label="下午"></el-option>
  39. </el-select>
  40. </u-form-item>
  41. <u-form-item label="结束时间" borderBottom prop="endDay" :required="true">
  42. <el-date-picker
  43. v-model="inputForm.endDay"
  44. type="date"
  45. placeholder="请选择日期"
  46. style="width:100%"
  47. size="default"
  48. placement="bottom-start"
  49. @change="checkTime"
  50. clearable>
  51. </el-date-picker>
  52. <el-select v-model="inputForm.endTime" style="width: 50%" placeholder="请选择结束时间" @change="checkTime">
  53. <el-option value="上午" label="上午"></el-option>
  54. <el-option value="下午" label="下午"></el-option>
  55. </el-select>
  56. </u-form-item>
  57. <u-form-item label="请假天数" borderBottom prop="days" :required="true">
  58. <u--input placeholder='请填写请假天数' v-model="inputForm.days" disabled></u--input>
  59. </u-form-item>
  60. <u-form-item label="请假原因" borderBottom prop="reason">
  61. <u--textarea placeholder='请输入请假原因' :rows="5" :maxlength="500" v-model="inputForm.reason" ></u--textarea>
  62. </u-form-item>
  63. <u-form-item label="附件">
  64. <el-upload
  65. class="upload-demo"
  66. :action="`http://mn79i2.natappfree.cc/api/public-modules-server/oss/file/webUpload/upload`"
  67. :on-remove="(file, fileList) => handleRemove(file, fileList, '','')"
  68. :file-list="inputForm.files"
  69. :on-success="(response, file, fileList) => handleUploadSuccess(response, file, fileList,'','')"
  70. :limit="3">
  71. <el-button size="small" type="primary">点击上传</el-button>
  72. <div slot="tip" class="el-upload__tip">只能上传不超过 3 个文件</div>
  73. </el-upload>
  74. </u-form-item>
  75. </u--form>
  76. <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-else-if="nodeFlag">
  77. <u-form-item label="请假人" borderBottom prop="createName">
  78. <u--input placeholder='请填写请假人' v-model="inputForm.createName" disabled></u--input>
  79. </u-form-item>
  80. <u-form-item label="请假部门" borderBottom prop="officeName">
  81. <u--input placeholder='请填写请假部门' v-model="inputForm.officeName" disabled></u--input>
  82. </u-form-item>
  83. <u-form-item label="请假类型" borderBottom prop="type" >
  84. <jp-picker v-model="inputForm.type" rangeKey="label" rangeValue="value" disabled :range="[
  85. { label: '年假', value: '1' },
  86. { label: '事假', value: '2' },
  87. { label: '病假', value: '3' },
  88. { label: '调休假', value: '4' },
  89. { label: '婚假', value: '5' },
  90. { label: '产假', value: '6' },
  91. { label: '陪产假', value: '7' },
  92. { label: '其他', value: '8' },
  93. ]"></jp-picker>
  94. </u-form-item>
  95. <u-form-item label="开始时间" borderBottom prop="startDay" :required="true">
  96. <el-date-picker
  97. v-model="inputForm.startDay"
  98. type="date"
  99. placeholder="请选择开始时间"
  100. style="width:100%"
  101. size="default"
  102. placement="bottom-start"
  103. @change="checkTime"
  104. :disabled="true"
  105. clearable>
  106. </el-date-picker>
  107. <el-select v-model="inputForm.beginTime" style="width: 50%" disabled placeholder="请选择开始时间" @change="checkTime">
  108. <el-option value="上午" label="上午"></el-option>
  109. <el-option value="下午" label="下午"></el-option>
  110. </el-select>
  111. </u-form-item>
  112. <u-form-item label="结束时间" borderBottom prop="endDay" :required="true">
  113. <el-date-picker
  114. :disabled="true"
  115. v-model="inputForm.endDay"
  116. type="date"
  117. placeholder="请选择日期"
  118. style="width:100%"
  119. size="default"
  120. placement="bottom-start"
  121. @change="checkTime"
  122. clearable>
  123. </el-date-picker>
  124. <el-select v-model="inputForm.endTime" style="width: 50%" disabled placeholder="请选择结束时间" @change="checkTime">
  125. <el-option value="上午" label="上午"></el-option>
  126. <el-option value="下午" label="下午"></el-option>
  127. </el-select>
  128. </u-form-item>
  129. <u-form-item label="请假天数" borderBottom prop="days" :required="true">
  130. <u--input placeholder='请填写请假天数' v-model="inputForm.days" disabled></u--input>
  131. </u-form-item>
  132. <u-form-item label="请假原因" borderBottom prop="reason">
  133. <u--textarea placeholder='请输入请假原因' :rows="5" :maxlength="500" v-model="inputForm.reason" disabled></u--textarea>
  134. </u-form-item>
  135. <u-form-item label="附件">
  136. <el-upload
  137. :disabled="true"
  138. class="upload-demo"
  139. :action="`http://localhost:2800/api/public-modules-server/oss/file/webUpload/upload`"
  140. :on-remove="(file, fileList) => handleRemove(file, fileList, '','')"
  141. :file-list="inputForm.files"
  142. :on-success="(response, file, fileList) => handleUploadSuccess(response, file, fileList,'','')"
  143. :limit="3">
  144. <el-button size="small" :disabled="true" type="primary">点击上传</el-button>
  145. <div slot="tip" class="el-upload__tip">只能上传不超过 3 个文件</div>
  146. </el-upload>
  147. </u-form-item>
  148. </u--form>
  149. </view>
  150. </template>
  151. <script>
  152. import holidayService from '@/api/jy/HolidayService'
  153. import CommonApi from '@/api/common/CommonApi'
  154. import {mapState, mapMutations, mapActions} from 'vuex'
  155. export default {
  156. components: {
  157. },
  158. computed: mapState({
  159. userInfo: (state) => state.user.userInfo,
  160. avatar: (state) => state.user.avatar
  161. }),
  162. data () {
  163. return {
  164. nodeFlag: false,
  165. loading: false,
  166. listData: [],
  167. fileList3: [],
  168. goodsListData: [],
  169. materialList: [],
  170. searchForm: {
  171. wareHouseType: '',
  172. },
  173. inputForm: {
  174. createName:'',
  175. officeName:'',
  176. id: '',
  177. startDay:"",
  178. beginTime:'',
  179. reason: '',
  180. endDay:"",
  181. endTime:'',
  182. type:'',
  183. files: [], // 附件信息
  184. procInsId: '',
  185. days:'',
  186. },
  187. rules: {
  188. 'type': [
  189. {
  190. required: true,
  191. message: '请假类型不能为空',
  192. trigger: ['blur', 'change']
  193. }
  194. ],
  195. 'startDay': [
  196. {
  197. required: true,
  198. message: '开始时间不能为空',
  199. trigger: ['blur', 'change']
  200. }
  201. ],
  202. 'endDay': [
  203. {
  204. required: true,
  205. message: '结束时间不能为空',
  206. trigger: ['blur', 'change']
  207. }
  208. ]
  209. }
  210. }
  211. },
  212. commonApi: null,
  213. // 页面加载时执行
  214. created() {
  215. this.commonApi = new CommonApi()
  216. this.inputForm.createName = this.userInfo.name
  217. this.inputForm.officeName = this.userInfo.officeDTO.name
  218. },
  219. props: {
  220. businessId: {
  221. type: String,
  222. default: ''
  223. },
  224. formReadOnly: {
  225. type: Boolean,
  226. default: false
  227. }
  228. },
  229. watch: {
  230. 'businessId': {
  231. handler (newVal) {
  232. if (this.businessId) {
  233. this.init(this.businessId)
  234. } else {
  235. this.$nextTick(() => {
  236. // this.$refs.inputForm.reset()
  237. })
  238. }
  239. },
  240. immediate: true,
  241. deep: false
  242. }
  243. },
  244. methods: {
  245. init (id) {
  246. this.nodeFlag = true
  247. this.inputForm.id = id
  248. if (id) {
  249. holidayService.queryById(id).then((data) => {
  250. this.commonApi.getTaskNameByProcInsId(data.procInsId).then((data) => {
  251. if (this.isNotEmpty(data)) {
  252. if (data === '调整重新发起' || this.isEmpty(data)) {
  253. this.nodeFlag = false
  254. } else {
  255. this.nodeFlag = true
  256. }
  257. }
  258. })
  259. this.inputForm = this.recover(this.inputForm, data)
  260. })
  261. }
  262. },
  263. formatDate(date) {
  264. const dateNew = new Date(date); // 将日期字符串转换为 Date 对象
  265. const year = dateNew.getFullYear();
  266. const month = (dateNew.getMonth() + 1).toString().padStart(2, '0');
  267. const day = dateNew.getDate().toString().padStart(2, '0');
  268. return `${year}-${month}-${day}`;
  269. },
  270. isEmpty(value) {
  271. let result = false;
  272. if (value == null || value == undefined) {
  273. result = true;
  274. }
  275. if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
  276. result = true;
  277. }
  278. if (typeof value == "object" && value instanceof Array && value.length === 0) {
  279. result = true;
  280. }
  281. return result;
  282. },
  283. isNotEmpty (value) {
  284. return !this.isEmpty(value)
  285. },
  286. /**
  287. * 判断是否为空
  288. */
  289. isNull(val) {
  290. if (val instanceof Array) {
  291. if (val.length === 0) return true;
  292. } else if (val instanceof Object) {
  293. if (JSON.stringify(val) === "{}") return true;
  294. } else {
  295. if (
  296. val === "null" ||
  297. val == null ||
  298. val === "undefined" ||
  299. val === undefined ||
  300. val === ""
  301. )
  302. return true;
  303. return false;
  304. }
  305. return false;
  306. },
  307. formatDateNew(date) {
  308. const year = date.getFullYear();
  309. const month = (date.getMonth() + 1).toString().padStart(2, '0');
  310. const day = date.getDate().toString().padStart(2, '0');
  311. const hours = date.getHours().toString().padStart(2, '0');
  312. const minutes = date.getMinutes().toString().padStart(2, '0');
  313. const seconds = date.getSeconds().toString().padStart(2, '0');
  314. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  315. },
  316. handleUploadSuccess (res, file, fileList, index, type) {
  317. // 将 fileList 转换为你期望的格式
  318. const formattedFiles = fileList.map(fileItem => {
  319. return {
  320. name: fileItem.name,
  321. size: fileItem.size,
  322. url: fileItem.response ? '/' + fileItem.response.url : fileItem.url,
  323. createBy: this.userInfo,
  324. by: this.userInfo.id,
  325. createTime: this.formatDateNew(new Date())
  326. };
  327. });
  328. this.inputForm.files = formattedFiles
  329. // 强制更新视图
  330. this.$forceUpdate();
  331. },
  332. handleRemove(file, fileList, index, type) {
  333. // 处理移除文件逻辑
  334. // file 是移除的文件
  335. // fileList 是当前文件列表
  336. const formattedFiles = fileList.map(fileItem => {
  337. return {
  338. name: fileItem.name,
  339. size: fileItem.size,
  340. url: '/' + fileItem.response.url,
  341. createBy: this.userInfo,
  342. by: this.userInfo.id,
  343. createTime: this.formatDateNew(new Date())
  344. };
  345. });
  346. this.inputForm.files = formattedFiles
  347. // 如果你想要更新文件列表,可以在这里更新 inputForm.fileInfoLost
  348. // this.inputForm.fileInfoLost = fileList;
  349. },
  350. saveForm(callback) {
  351. // 所有验证通过,执行保存操作
  352. if (this.isNotEmpty(this.inputForm.startDay)) {
  353. this.inputForm.startDay = this.formatDate(this.inputForm.startDay);
  354. }
  355. if (this.isNotEmpty(this.inputForm.endDay)) {
  356. this.inputForm.endDay = this.formatDate(this.inputForm.endDay);
  357. }
  358. return new Promise(async ( resolve, reject) => {
  359. let errors = [];
  360. if (this.isEmpty(this.inputForm.startDay) || this.isEmpty(this.inputForm.beginTime)){
  361. errors.push('请选择开始时间');
  362. }
  363. if (this.isEmpty(this.inputForm.endDay) || this.isEmpty(this.inputForm.endTime)){
  364. errors.push('请选择结束时间');
  365. }
  366. if (this.isEmpty(this.inputForm.type)){
  367. errors.push('请选择请假类型');
  368. }
  369. if (this.inputForm.type === '1'){
  370. if (this.isNotEmpty(this.inputForm.startDay) && this.isNotEmpty(this.inputForm.beginTime)
  371. && this.isNotEmpty(this.inputForm.endDay) && this.isNotEmpty(this.inputForm.endTime)) {
  372. await holidayService.checkType(this.inputForm).then((data)=>{
  373. let day=data.split(",")
  374. if (!day[0].includes(this.inputForm.days)){
  375. errors.push(data);
  376. }
  377. })
  378. }
  379. }
  380. if (errors.length > 0) {
  381. // 存在错误,显示提示信息
  382. errors.forEach(error => {
  383. uni.showToast({
  384. title: error,
  385. icon: 'none',
  386. duration: 1500
  387. });
  388. });
  389. reject('Form validation failed');
  390. } else {
  391. this.$refs.inputForm.validate().then(res => {
  392. this.inputForm.status = '2'
  393. this.inputForm.userId = this.userInfo.id
  394. console.log('this.inputForm.files', this.inputForm.files)
  395. holidayService.saveForm(this.inputForm).then((data) => {
  396. this.inputForm.id = data.businessId
  397. callback(data.businessTable, data.businessId, this.inputForm)
  398. this.$refs.inputForm.resetFields()
  399. this.loading = false
  400. }).catch(() => {
  401. this.$refs.inputForm.resetFields()
  402. }).catch((e) => {
  403. })
  404. })
  405. }
  406. });
  407. // this.$refs.inputForm.validate().then(() => {
  408. // uni.showLoading();
  409. // this.inputForm.status = '2';
  410. // this.holidayService.saveForm(this.inputForm).then(data => {
  411. // callback(data.businessTable, data.businessId,this.inputForm);
  412. // }).catch(error => {
  413. // });
  414. // }).catch(() => {
  415. // });
  416. },
  417. // 修改状态
  418. async updateStatusById (type, callback) {
  419. if (type === 'reject' || type === 'reback') {
  420. holidayService.queryById(this.inputForm.id).then((data) => {
  421. if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
  422. this.loading = false
  423. this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
  424. throw new Error()
  425. } else {
  426. if (type === 'reject') {
  427. // 驳回
  428. this.inputForm.status = '4'
  429. }
  430. if (type === 'reback') {
  431. // 撤回
  432. this.inputForm.status = '3'
  433. }
  434. if (type === 'reject' || type === 'reback') {
  435. let param = {status: this.inputForm.status, id: this.inputForm.id}
  436. holidayService.updateStatusById(param).then(() => {
  437. this.loading = false
  438. callback()
  439. })
  440. }
  441. }
  442. })
  443. } else if (type === 'hold') {
  444. holidayService.queryById(this.inputForm.id).then((data) => {
  445. if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
  446. this.loading = false
  447. this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
  448. throw new Error()
  449. } else {
  450. // 终止
  451. let param = {status: '1', id: this.inputForm.id}
  452. holidayService.updateStatusById(param).then(() => {
  453. this.loading = false
  454. callback()
  455. })
  456. }
  457. })
  458. }
  459. },
  460. reapplyForm (callback) {
  461. this.loading = true
  462. holidayService.queryById(this.inputForm.id).then((data) => {
  463. if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
  464. this.loading = false
  465. this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
  466. throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
  467. } else {
  468. this.startFormTrue(callback)
  469. }
  470. })
  471. },
  472. // 送审
  473. async startFormTrue (callback) {
  474. if (this.isNotEmpty(this.inputForm.startDay)) {
  475. this.inputForm.startDay = this.formatDate(this.inputForm.startDay);
  476. }
  477. if (this.isNotEmpty(this.inputForm.endDay)) {
  478. this.inputForm.endDay = this.formatDate(this.inputForm.endDay);
  479. }
  480. return new Promise((resolve, reject) => {
  481. let errors = [];
  482. if (this.isEmpty(this.inputForm.startDay) || this.isEmpty(this.inputForm.beginTime)){
  483. errors.push('请选择开始时间');
  484. }
  485. if (this.isEmpty(this.inputForm.endDay) || this.isEmpty(this.inputForm.endTime)){
  486. errors.push('请选择结束时间');
  487. }
  488. if (this.isEmpty(this.inputForm.type)){
  489. errors.push('请选择请假类型');
  490. }
  491. if (this.inputForm.type === '1'){
  492. holidayService.checkType(this.inputForm).then((data)=>{
  493. let day=data.split(",")
  494. if (!day[0].includes(this.inputForm.days)){
  495. errors.push(data);
  496. }
  497. })
  498. }
  499. if (errors.length > 0) {
  500. // 存在错误,显示提示信息
  501. errors.forEach(error => {
  502. uni.showToast({
  503. title: error,
  504. icon: 'none',
  505. duration: 2000
  506. });
  507. });
  508. reject('Form validation failed');
  509. } else {
  510. this.$refs.inputForm.validate().then(res => {
  511. this.inputForm.status = '2'
  512. holidayService.saveForm(this.inputForm).then((data) => {
  513. this.inputForm.id = data.businessId
  514. callback(data.businessTable, data.businessId, this.inputForm)
  515. this.$refs.inputForm.resetFields()
  516. this.loading = false
  517. }).catch(() => {
  518. this.$refs.inputForm.resetFields()
  519. }).catch((e) => {
  520. })
  521. })
  522. }
  523. });
  524. },
  525. // 通过
  526. async agreeForm (callback) {
  527. this.$refs.inputForm.validate().then(res => {
  528. if (this.inputForm.days >1) {
  529. this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
  530. if (this.isNotEmpty(data)) {
  531. if (data === '总经理审核') {
  532. this.inputForm.status = '5'
  533. } else {
  534. this.inputForm.status = '2'
  535. }
  536. }
  537. holidayService.saveForm(this.inputForm).then((data) => {
  538. callback(data.businessTable, data.businessId, this.inputForm)
  539. this.$refs.inputForm.resetFields()
  540. this.loading = false
  541. }).catch(() => {
  542. this.loading = false
  543. this.$refs.inputForm.resetFields()
  544. })
  545. })
  546. } else {
  547. this.inputForm.status = '5'
  548. holidayService.saveForm(this.inputForm).then((data) => {
  549. callback(data.businessTable, data.businessId, this.inputForm)
  550. this.$refs.inputForm.resetFields()
  551. this.loading = false
  552. }).catch(() => {
  553. this.loading = false
  554. this.$refs.inputForm.resetFields()
  555. })
  556. }
  557. })
  558. },
  559. checkType(){
  560. if (this.inputForm.type === '1'){
  561. holidayService.checkType(this.inputForm).then((data)=>{
  562. uni.showToast({
  563. title: data,
  564. icon: "none",
  565. duration:2000
  566. })
  567. })
  568. }
  569. },
  570. checkTime(){
  571. let differenceInDays =''
  572. let date1=new Date(this.inputForm.startDay)
  573. let date2=new Date(this.inputForm.endDay)
  574. if ((date2<date1) || (date2 === date1 && this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午')){
  575. uni.showToast({
  576. title: '开始时间不能小于结束时间',
  577. icon: "none",
  578. duration:2000
  579. })
  580. this.inputForm.startDay = ''
  581. this.inputForm.endDay = ''
  582. this.inputForm.beginTime = ''
  583. this.inputForm.endTime = ''
  584. }
  585. differenceInDays= Math.floor((date2 - date1) / (1000 * 60 * 60 * 24));
  586. if (differenceInDays === 0 || differenceInDays > 1){
  587. if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '下午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午') ){
  588. differenceInDays=differenceInDays+1
  589. }else if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '上午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '下午')){
  590. differenceInDays=differenceInDays+0.5
  591. }
  592. }else if (differenceInDays ===1){
  593. if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '下午') ){
  594. differenceInDays=differenceInDays+1
  595. }else if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '上午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '下午')){
  596. differenceInDays=differenceInDays+0.5
  597. }else if (this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午'){
  598. differenceInDays
  599. }
  600. }
  601. if (this.isNotEmpty(this.inputForm.beginTime) && this.isNotEmpty(this.inputForm.endTime)){
  602. this.inputForm.days = differenceInDays
  603. this.checkType()
  604. }
  605. }
  606. }
  607. }
  608. </script>
  609. <style>
  610. .cu-form-group .title {
  611. min-width: calc(4em + 40px);
  612. }
  613. </style>