作者 雷海东

算法功能注释

... ... @@ -34,19 +34,19 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
<a-button type="primary" icon="download" @click="handleExportXls('工资算法')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
</a-upload> -->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-dropdown> -->
</div>
<!-- table区域-begin -->
... ... @@ -94,7 +94,8 @@
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a @click="handleDetail(record)">详情</a>
<!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
... ... @@ -106,7 +107,7 @@
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</a-dropdown> -->
</span>
</a-table>
... ...
... ... @@ -115,7 +115,8 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="劳动合同周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contractTime">
<j-date placeholder="请选择劳动合同周期" v-model="model.contractTime" style="width: 100%" />
<!-- <j-date placeholder="请选择劳动合同周期" v-model="model.contractTime" style="width: 100%" /> -->
<a-range-picker @change="onChange" v-model="contractTime" />
</a-form-model-item>
</a-col>
</a-row>
... ... @@ -149,6 +150,7 @@ export default {
xs: { span: 24 },
sm: { span: 16 },
},
contractTime: [],
model: {
userName: '', //姓名
idCard: '', //身份证号
... ... @@ -167,9 +169,18 @@ export default {
jobId: [{ required: true, message: '请输入工号!' }],
jobTitle: [{ required: true, message: '请选择岗位!' }],
userName: [{ required: true, message: '请输入姓名!' }],
idCard: [{ required: true, message: '请输入身份证号!' } ,
{ pattern: /^([1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X))|([1|5|7][0-9]{6}(18|19|20)[0-9]{2}((0[1-9])|(1[0-2]))(([0|1|2])([0-9])|3[0|1])[0-9]{3}[0-9Xx])|((1|5|7)[0-9]{6}(18|19|20)[0-9]{2}((0[1-9])|(1[0-2]))(([0|1|2])([0-9])|3[0|1])[0-9]{3})$/, message: '请输入正确格式的身份证号!' }],
bankCard: [{ required: true, message: '请输入银行卡号!' },{pattern:/^\d{16,19}$/ , message:"请输入正确的银行卡号"}],
idCard: [
{ required: true, message: '请输入身份证号!' },
{
pattern:
/^([1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X))|([1|5|7][0-9]{6}(18|19|20)[0-9]{2}((0[1-9])|(1[0-2]))(([0|1|2])([0-9])|3[0|1])[0-9]{3}[0-9Xx])|((1|5|7)[0-9]{6}(18|19|20)[0-9]{2}((0[1-9])|(1[0-2]))(([0|1|2])([0-9])|3[0|1])[0-9]{3})$/,
message: '请输入正确格式的身份证号!',
},
],
bankCard: [
{ required: true, message: '请输入银行卡号!' },
{ pattern: /^\d{16,19}$/, message: '请输入正确的银行卡号' },
],
basicSalary: [{ required: true, message: '请输入基本工资!' }],
phone: [{ required: true, message: '请输入手机号!' }, { validator: this.validatePhone }],
socialCompany: [{ required: true, message: '请输入社保公司!' }],
... ... @@ -203,6 +214,17 @@ export default {
this.modelDefault = JSON.parse(JSON.stringify(this.model))
},
methods: {
onChange(date, dateString) {
console.log(date, dateString)
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
},
validatePhone(rule, value, callback) {
// console.log(this.currentPhone)
if (!value) {
... ... @@ -217,7 +239,7 @@ export default {
// console.log(value)
if (value === this.currentPhone) {
callback()
}else if (res.result && res.result.length <= 0) {
} else if (res.result && res.result.length <= 0) {
callback()
} else {
callback('手机号已存在!')
... ... @@ -257,29 +279,30 @@ export default {
httpurl += this.url.edit
method = 'put'
}
if (this.model.jobTitle === 'OfficeAdministrative') {
this.model.jobName= '办公室行政人员'
} else if (this.model.jobTitle === 'WorkshopDirector') {
this.model.jobName= '车间管理员'
} else if (this.model.jobTitle === 'WorkshopTechnicalManager') {
this.model.jobName= '车间技术总管'
} else if (this.model.jobTitle === 'WorkshopTechnician') {
this.model.jobName= '车间技术员'
} else if (this.model.jobTitle === 'WorkshopAuxiliaryPersonnel') {
this.model.jobName= '车间辅助人员'
} else if (this.model.jobTitle === 'PurchasingOfficer') {
this.model.jobName= '采购员'
} else if (this.model.jobTitle === 'ProcurementSupervisor') {
this.model.jobName= '采购主管'
} else if (this.model.jobTitle === 'Assembler') {
this.model.jobName= '装配工'
} else if (this.model.jobTitle === 'AssemblySupervisor') {
this.model.jobName= '装配主管'
} else if (this.model.jobTitle === 'OtherWorker') {
this.model.jobName= '其他'
} else if (this.model.jobTitle === 'WorkshopGeneralWorker') {
this.model.jobName= '普工'
}
this.model.jobName = '办公室行政人员'
} else if (this.model.jobTitle === 'WorkshopDirector') {
this.model.jobName = '车间管理员'
} else if (this.model.jobTitle === 'WorkshopTechnicalManager') {
this.model.jobName = '车间技术总管'
} else if (this.model.jobTitle === 'WorkshopTechnician') {
this.model.jobName = '车间技术员'
} else if (this.model.jobTitle === 'WorkshopAuxiliaryPersonnel') {
this.model.jobName = '车间辅助人员'
} else if (this.model.jobTitle === 'PurchasingOfficer') {
this.model.jobName = '采购员'
} else if (this.model.jobTitle === 'ProcurementSupervisor') {
this.model.jobName = '采购主管'
} else if (this.model.jobTitle === 'Assembler') {
this.model.jobName = '装配工'
} else if (this.model.jobTitle === 'AssemblySupervisor') {
this.model.jobName = '装配主管'
} else if (this.model.jobTitle === 'OtherWorker') {
this.model.jobName = '其他'
} else if (this.model.jobTitle === 'WorkshopGeneralWorker') {
this.model.jobName = '普工'
}
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
... ...