作者 雷海东

算法功能注释

@@ -34,19 +34,19 @@ @@ -34,19 +34,19 @@
34 34
35 <!-- 操作按钮区域 --> 35 <!-- 操作按钮区域 -->
36 <div class="table-operator"> 36 <div class="table-operator">
37 - <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> 37 + <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
38 <a-button type="primary" icon="download" @click="handleExportXls('工资算法')">导出</a-button> 38 <a-button type="primary" icon="download" @click="handleExportXls('工资算法')">导出</a-button>
39 - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> 39 + <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
40 <a-button type="primary" icon="import">导入</a-button> 40 <a-button type="primary" icon="import">导入</a-button>
41 - </a-upload> 41 + </a-upload> -->
42 <!-- 高级查询区域 --> 42 <!-- 高级查询区域 -->
43 - <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> 43 + <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
44 <a-dropdown v-if="selectedRowKeys.length > 0"> 44 <a-dropdown v-if="selectedRowKeys.length > 0">
45 <a-menu slot="overlay"> 45 <a-menu slot="overlay">
46 <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> 46 <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
47 </a-menu> 47 </a-menu>
48 <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> 48 <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
49 - </a-dropdown> 49 + </a-dropdown> -->
50 </div> 50 </div>
51 51
52 <!-- table区域-begin --> 52 <!-- table区域-begin -->
@@ -94,7 +94,8 @@ @@ -94,7 +94,8 @@
94 <a @click="handleEdit(record)">编辑</a> 94 <a @click="handleEdit(record)">编辑</a>
95 95
96 <a-divider type="vertical" /> 96 <a-divider type="vertical" />
97 - <a-dropdown> 97 + <a @click="handleDetail(record)">详情</a>
  98 + <!-- <a-dropdown>
98 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> 99 <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
99 <a-menu slot="overlay"> 100 <a-menu slot="overlay">
100 <a-menu-item> 101 <a-menu-item>
@@ -106,7 +107,7 @@ @@ -106,7 +107,7 @@
106 </a-popconfirm> 107 </a-popconfirm>
107 </a-menu-item> 108 </a-menu-item>
108 </a-menu> 109 </a-menu>
109 - </a-dropdown> 110 + </a-dropdown> -->
110 </span> 111 </span>
111 112
112 </a-table> 113 </a-table>
@@ -115,7 +115,8 @@ @@ -115,7 +115,8 @@
115 </a-col> 115 </a-col>
116 <a-col :span="24"> 116 <a-col :span="24">
117 <a-form-model-item label="劳动合同周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contractTime"> 117 <a-form-model-item label="劳动合同周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contractTime">
118 - <j-date placeholder="请选择劳动合同周期" v-model="model.contractTime" style="width: 100%" /> 118 + <!-- <j-date placeholder="请选择劳动合同周期" v-model="model.contractTime" style="width: 100%" /> -->
  119 + <a-range-picker @change="onChange" v-model="contractTime" />
119 </a-form-model-item> 120 </a-form-model-item>
120 </a-col> 121 </a-col>
121 </a-row> 122 </a-row>
@@ -149,6 +150,7 @@ export default { @@ -149,6 +150,7 @@ export default {
149 xs: { span: 24 }, 150 xs: { span: 24 },
150 sm: { span: 16 }, 151 sm: { span: 16 },
151 }, 152 },
  153 + contractTime: [],
152 model: { 154 model: {
153 userName: '', //姓名 155 userName: '', //姓名
154 idCard: '', //身份证号 156 idCard: '', //身份证号
@@ -167,9 +169,18 @@ export default { @@ -167,9 +169,18 @@ export default {
167 jobId: [{ required: true, message: '请输入工号!' }], 169 jobId: [{ required: true, message: '请输入工号!' }],
168 jobTitle: [{ required: true, message: '请选择岗位!' }], 170 jobTitle: [{ required: true, message: '请选择岗位!' }],
169 userName: [{ required: true, message: '请输入姓名!' }], 171 userName: [{ required: true, message: '请输入姓名!' }],
170 - idCard: [{ required: true, message: '请输入身份证号!' } ,  
171 - { 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: '请输入正确格式的身份证号!' }],  
172 - bankCard: [{ required: true, message: '请输入银行卡号!' },{pattern:/^\d{16,19}$/ , message:"请输入正确的银行卡号"}], 172 + idCard: [
  173 + { required: true, message: '请输入身份证号!' },
  174 + {
  175 + pattern:
  176 + /^([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})$/,
  177 + message: '请输入正确格式的身份证号!',
  178 + },
  179 + ],
  180 + bankCard: [
  181 + { required: true, message: '请输入银行卡号!' },
  182 + { pattern: /^\d{16,19}$/, message: '请输入正确的银行卡号' },
  183 + ],
173 basicSalary: [{ required: true, message: '请输入基本工资!' }], 184 basicSalary: [{ required: true, message: '请输入基本工资!' }],
174 phone: [{ required: true, message: '请输入手机号!' }, { validator: this.validatePhone }], 185 phone: [{ required: true, message: '请输入手机号!' }, { validator: this.validatePhone }],
175 socialCompany: [{ required: true, message: '请输入社保公司!' }], 186 socialCompany: [{ required: true, message: '请输入社保公司!' }],
@@ -203,6 +214,17 @@ export default { @@ -203,6 +214,17 @@ export default {
203 this.modelDefault = JSON.parse(JSON.stringify(this.model)) 214 this.modelDefault = JSON.parse(JSON.stringify(this.model))
204 }, 215 },
205 methods: { 216 methods: {
  217 + onChange(date, dateString) {
  218 + console.log(date, dateString)
  219 + console.log('值:', dateString)
  220 + const startDate = dateString[0]
  221 + const endDate = dateString[1]
  222 +
  223 + console.log('开始日期:', startDate)
  224 + this.model.contractTime = (startDate+"-"+endDate)
  225 + console.log(this.model.contractTime)
  226 + // this.model.contractTime=endDate
  227 + },
206 validatePhone(rule, value, callback) { 228 validatePhone(rule, value, callback) {
207 // console.log(this.currentPhone) 229 // console.log(this.currentPhone)
208 if (!value) { 230 if (!value) {
@@ -217,7 +239,7 @@ export default { @@ -217,7 +239,7 @@ export default {
217 // console.log(value) 239 // console.log(value)
218 if (value === this.currentPhone) { 240 if (value === this.currentPhone) {
219 callback() 241 callback()
220 - }else if (res.result && res.result.length <= 0) { 242 + } else if (res.result && res.result.length <= 0) {
221 callback() 243 callback()
222 } else { 244 } else {
223 callback('手机号已存在!') 245 callback('手机号已存在!')
@@ -257,28 +279,29 @@ export default { @@ -257,28 +279,29 @@ export default {
257 httpurl += this.url.edit 279 httpurl += this.url.edit
258 method = 'put' 280 method = 'put'
259 } 281 }
  282 +
260 if (this.model.jobTitle === 'OfficeAdministrative') { 283 if (this.model.jobTitle === 'OfficeAdministrative') {
261 - this.model.jobName= '办公室行政人员' 284 + this.model.jobName = '办公室行政人员'
262 } else if (this.model.jobTitle === 'WorkshopDirector') { 285 } else if (this.model.jobTitle === 'WorkshopDirector') {
263 - this.model.jobName= '车间管理员' 286 + this.model.jobName = '车间管理员'
264 } else if (this.model.jobTitle === 'WorkshopTechnicalManager') { 287 } else if (this.model.jobTitle === 'WorkshopTechnicalManager') {
265 - this.model.jobName= '车间技术总管' 288 + this.model.jobName = '车间技术总管'
266 } else if (this.model.jobTitle === 'WorkshopTechnician') { 289 } else if (this.model.jobTitle === 'WorkshopTechnician') {
267 - this.model.jobName= '车间技术员' 290 + this.model.jobName = '车间技术员'
268 } else if (this.model.jobTitle === 'WorkshopAuxiliaryPersonnel') { 291 } else if (this.model.jobTitle === 'WorkshopAuxiliaryPersonnel') {
269 - this.model.jobName= '车间辅助人员' 292 + this.model.jobName = '车间辅助人员'
270 } else if (this.model.jobTitle === 'PurchasingOfficer') { 293 } else if (this.model.jobTitle === 'PurchasingOfficer') {
271 - this.model.jobName= '采购员' 294 + this.model.jobName = '采购员'
272 } else if (this.model.jobTitle === 'ProcurementSupervisor') { 295 } else if (this.model.jobTitle === 'ProcurementSupervisor') {
273 - this.model.jobName= '采购主管' 296 + this.model.jobName = '采购主管'
274 } else if (this.model.jobTitle === 'Assembler') { 297 } else if (this.model.jobTitle === 'Assembler') {
275 - this.model.jobName= '装配工' 298 + this.model.jobName = '装配工'
276 } else if (this.model.jobTitle === 'AssemblySupervisor') { 299 } else if (this.model.jobTitle === 'AssemblySupervisor') {
277 - this.model.jobName= '装配主管' 300 + this.model.jobName = '装配主管'
278 } else if (this.model.jobTitle === 'OtherWorker') { 301 } else if (this.model.jobTitle === 'OtherWorker') {
279 - this.model.jobName= '其他' 302 + this.model.jobName = '其他'
280 } else if (this.model.jobTitle === 'WorkshopGeneralWorker') { 303 } else if (this.model.jobTitle === 'WorkshopGeneralWorker') {
281 - this.model.jobName= '普工' 304 + this.model.jobName = '普工'
282 } 305 }
283 httpAction(httpurl, this.model, method) 306 httpAction(httpurl, this.model, method)
284 .then((res) => { 307 .then((res) => {