This commit is contained in:
parent
126504f14f
commit
c5456955c9
|
|
@ -117,6 +117,7 @@
|
|||
ref="personExitFormRef"
|
||||
:exitFormData="exitFormData"
|
||||
:isExitUpload="isExitUpload"
|
||||
:isShanghai="isShanghai"
|
||||
v-if="dialogConfig.outerTitle === '人员出场'"
|
||||
/>
|
||||
|
||||
|
|
@ -187,6 +188,7 @@ export default {
|
|||
exitFormData: {},
|
||||
queryDetailsId: '',
|
||||
isExitUpload: 1, // 是否出场后上传文件 1:是 2:否
|
||||
isShanghai: 0, // 是否是上海工程
|
||||
getExitPersonListAPI,
|
||||
|
||||
slots: {
|
||||
|
|
@ -241,6 +243,7 @@ export default {
|
|||
// 人员出场
|
||||
onHandlePersonExit(data, type) {
|
||||
this.isExitUpload = type
|
||||
this.isShanghai = data.isShanghai
|
||||
const {
|
||||
name,
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -100,7 +100,13 @@ export default {
|
|||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
// 是否是上海工程
|
||||
isShanghai: {
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
personExitFormData: {
|
||||
|
|
@ -116,7 +122,9 @@ export default {
|
|||
fileList: [
|
||||
{
|
||||
trigger: 'change,blur',
|
||||
required: this.isExitUpload === 2,
|
||||
required:
|
||||
this.isExitUpload === 2 ||
|
||||
(this.isExitUpload !== 2 && this.isShanghai == 1),
|
||||
message: '请上传离场工资结算确认单',
|
||||
},
|
||||
],
|
||||
|
|
@ -128,40 +136,50 @@ export default {
|
|||
onHandleConfirmAddOrEditFun() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (this.isExitUpload === 1) {
|
||||
const { id, workerId, fileList, proId, subId, teamId } =
|
||||
this.personExitFormData
|
||||
const params = {
|
||||
id,
|
||||
proId,
|
||||
workerId,
|
||||
subId,
|
||||
teamId,
|
||||
exitWay: '后端',
|
||||
}
|
||||
const fileMsg = []
|
||||
const formData = new FormData()
|
||||
this.$refs.personExitFormRef.validate(async (valid) => {
|
||||
if (valid) {
|
||||
const {
|
||||
id,
|
||||
workerId,
|
||||
fileList,
|
||||
proId,
|
||||
subId,
|
||||
teamId,
|
||||
} = this.personExitFormData
|
||||
const params = {
|
||||
id,
|
||||
proId,
|
||||
workerId,
|
||||
subId,
|
||||
teamId,
|
||||
exitWay: '后端',
|
||||
}
|
||||
const fileMsg = []
|
||||
const formData = new FormData()
|
||||
|
||||
if (fileList.length > 0) {
|
||||
fileList.forEach((e) => {
|
||||
formData.append('files', e.raw)
|
||||
fileMsg.push({
|
||||
name: '工资结算确认单',
|
||||
type: 1,
|
||||
})
|
||||
})
|
||||
}
|
||||
if (fileList.length > 0) {
|
||||
fileList.forEach((e) => {
|
||||
formData.append('files', e.raw)
|
||||
fileMsg.push({
|
||||
name: '工资结算确认单',
|
||||
type: 1,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
formData.append('params', JSON.stringify(params))
|
||||
formData.append('fileMsg', JSON.stringify(fileMsg))
|
||||
const res = await addEntryPersonAPI(formData)
|
||||
formData.append('params', JSON.stringify(params))
|
||||
formData.append('fileMsg', JSON.stringify(fileMsg))
|
||||
const res = await addEntryPersonAPI(formData)
|
||||
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('出场成功')
|
||||
resolve()
|
||||
} else {
|
||||
this.$modal.msgError(res.msg)
|
||||
reject(new Error(res.msg))
|
||||
}
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('出场成功')
|
||||
resolve()
|
||||
} else {
|
||||
this.$modal.msgError(res.msg)
|
||||
reject(new Error(res.msg))
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$refs.personExitFormRef.validate(async (valid) => {
|
||||
if (valid) {
|
||||
|
|
|
|||
|
|
@ -75,13 +75,19 @@
|
|||
<span
|
||||
:style="{
|
||||
color:
|
||||
row.attStatus == 0
|
||||
? '#ef4444'
|
||||
: '#10b981',
|
||||
row.attStatus == 1 ||
|
||||
(row.attStatus == 0 &&
|
||||
row.isRepair == 1)
|
||||
? '#10b981'
|
||||
: '#ef4444',
|
||||
}"
|
||||
>
|
||||
{{
|
||||
row.attStatus == 0 ? '未打卡' : '已打卡'
|
||||
row.attStatus == 1 ||
|
||||
(row.attStatus == 0 &&
|
||||
row.isRepair == 1)
|
||||
? '已打卡'
|
||||
: '未打卡'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
<div class="data-item">
|
||||
<div class="data-label">累计补卡天数(人次)</div>
|
||||
<div class="data-value">
|
||||
{{ attendanceData.proRepairNum || 0 }}
|
||||
{{ attendanceData.repairNumHis || 0 }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue