作者 雷海东

工资基础信息劳动合同周期的修改

... ... @@ -248,10 +248,9 @@ export default {
title: '劳动合同周期',
align: 'center',
dataIndex: 'contractTime',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
},
{
title: '是否在职',
align: 'center',
... ... @@ -282,8 +281,8 @@ export default {
this.getSuperFieldList()
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
},
methods: {
... ...
... ... @@ -129,6 +129,7 @@
import { httpAction, getAction } from '@/api/manage'
import { message } from 'ant-design-vue'
import { duplicateCheck2 } from '@/api/api'
import moment from 'moment'
export default {
name: 'TblSalaryBaseForm',
props: {
... ... @@ -208,7 +209,6 @@ export default {
return this.disabled
},
},
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
... ... @@ -219,11 +219,7 @@ export default {
console.log('值:', dateString)
const startDate = dateString[0]
const endDate = dateString[1]
console.log('开始日期:', startDate)
this.model.contractTime = (startDate+"-"+endDate)
console.log(this.model.contractTime)
// this.model.contractTime=endDate
this.model.contractTime = startDate + '~' + endDate
},
validatePhone(rule, value, callback) {
// console.log(this.currentPhone)
... ... @@ -260,6 +256,18 @@ export default {
edit(record) {
this.model = Object.assign({}, record)
this.currentPhone = this.model.phone
if (record.contractTime !== '' && record.contractTime !== null && record.contractTime!==undefined) {
// 解析 contractTime 字段,假设它是类似 "2024-06-27~2024-07-30" 的字符串
const [startDateStr, endDateStr] = record.contractTime.split('~')
// 使用 Moment.js 将字符串转换为 Moment 对象
const startDate = moment(startDateStr, 'YYYY-MM-DD')
const endDate = moment(endDateStr, 'YYYY-MM-DD')
// 将转换后的日期范围设置到 contractTime 中
this.contractTime = [startDate, endDate]
}
this.visible = true
},
submitForm() {
... ...