Commit 6904c3e6 authored by jingnan's avatar jingnan 👀

紧急领用申请eslint报错样式修改

parent 923b4f06
<template> <template>
<div> <div>
<dee-as-com <dee-as-com
ref="applyTable" ref="applyTable"
class="list-table" class="list-table"
:basic-data="{ selectData,selectionRows }" :basic-data="{ selectData,selectionRows }"
:lay-config="{ typeName: 'OutStorageUse', layKey: 'outStorageUseApplyList' }" :lay-config="{ typeName: 'OutStorageUse', layKey: 'outStorageUseApplyList' }"
@tableToolHandler="tableToolHandler" @tableToolHandler="tableToolHandler"
@selectionChange="selectionChange" @selectionChange="selectionChange"
/> />
<dee-dialog <dee-dialog
title="发起领用申请" title="发起领用申请"
:dialog-visible="dialogVisible" :dialog-visible="dialogVisible"
>
<div style="margin-bottom: 20px;font-size: 14px;font-weight: bolder;">确认提交吗?</div>
<div style="text-align: center;">
<el-button type="primary" @click="confirm">确 定</el-button>
<el-button @click="cancle">取 消</el-button>
</div>
</dee-dialog>
<dee-dialog
title="选择审批领导"
:dialog-visible="setPersonVisible"
>
<dee-form
ref="form"
label-width="100"
:form="form"
:form-data="formData"
:rules="rules"
> >
<div style="margin-bottom: 20px;font-size: 14px;font-weight: bolder;">确认提交吗?</div> <el-button type="primary" @click="setPersonConfirm">确 定</el-button>
<div style="text-align: center;"> <el-button @click="setPersonCancle">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button> </dee-form>
<el-button @click="cancle">取 消</el-button> </dee-dialog>
</div> </div>
</dee-dialog> </template>
<dee-dialog
title="选择审批领导" <script>
:dialog-visible="setPersonVisible" import { post } from '@/utils/http'
>
<dee-form export default {
ref="form" name: 'UseApply',
label-width="100" componentName: '领用申请',
:form="form" components: { },
:form-data="formData" props: {
:rules="rules" selectData: {
> type: Object,
<el-button type="primary" @click="setPersonConfirm">确 定</el-button> default: () => {}
<el-button @click="setPersonCancle">取 消</el-button> }
</dee-form> },
</dee-dialog> data() {
</div> return {
</template> dialogVisible: false,
setPersonVisible: false,
<script> selectionRows: [],
import { post } from '@/utils/http' form: {},
formData: [{
export default { split: 1,
name: 'UseApply', data: [
componentName: '领用申请',
components: { },
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {
dialogVisible: false,
setPersonVisible: false,
selectionRows: [],
form: {},
formData: [{
split: 1,
data: [
{
title: '设置审批领导',
key: 'userIds',
component: {
clearable: true,
name: 'el-select',
placeholder: '请选择',
multiple: true,
options: []
}
}]
}],
rules: {
userIds: [
{
required: true,
message: '请填写审批领导',
trigger: ['blur', 'change']
}
]
}
}
},
created() {
const httpParams = {
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'fieldName': 'source.name',
'operator': 'IN',
'value': ['项目部审批人员']
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'source',
'pageFrom': 1,
'pageSize': 9999
},
{ {
'name': 'target', title: '设置审批领导',
'pageFrom': 1, key: 'userIds',
'pageSize': 9999 component: {
} clearable: true,
], name: 'el-select',
'sortItem': [ placeholder: '请选择',
multiple: true,
options: []
}
}]
}],
rules: {
userIds: [
{ {
'fieldName': 'modifyTime', required: true,
'sortOrder': 'desc' message: '请填写审批领导',
trigger: ['blur', 'change']
} }
] ]
} }
post('/DxGroupMemberLink/search', httpParams).then(res => { }
const arr = [] },
const ids = [] created() {
res.items.content.forEach(item => { const httpParams = {
if (ids.indexOf(item.target.id) === -1) { 'pageFrom': 1,
ids.push(item.target.id) 'pageSize': 9999,
arr.push({ 'searchItems': {
value: item.target.id, 'children': [],
label: item.target.name + '/' + item.target.number 'items': [
}) {
} 'fieldName': 'source.name',
}) 'operator': 'IN',
this.formData[0].data.forEach(item => { 'value': ['项目部审批人员']
if (item.key === 'userIds') {
item.component.options = arr
} }
/** ],
'operator': 'AND'
},
'openProps': [
{
'name': 'source',
'pageFrom': 1,
'pageSize': 9999
},
{
'name': 'target',
'pageFrom': 1,
'pageSize': 9999
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
post('/DxGroupMemberLink/search', httpParams).then(res => {
const arr = []
const ids = []
res.items.content.forEach(item => {
if (ids.indexOf(item.target.id) === -1) {
ids.push(item.target.id)
arr.push({
value: item.target.id,
label: item.target.name + '/' + item.target.number
})
}
})
this.formData[0].data.forEach(item => {
if (item.key === 'userIds') {
item.component.options = arr
}
/**
item.key === 'userIds' && (item.component.options = arr.map(row => { item.key === 'userIds' && (item.component.options = arr.map(row => {
return { return {
value: row.value, value: row.value,
...@@ -140,82 +140,81 @@ ...@@ -140,82 +140,81 @@
} }
)) ))
*/ */
})
}).catch((err) => {
console.log(err)
}) })
}).catch((err) => {
console.log(err)
})
},
methods: {
tableToolHandler(e) {
console.log(e.key.btnValue)
if (e.key.btnValue === 'UseApply') {
this.useApply()
}
}, },
methods: { useApply() {
tableToolHandler(e) { this.dialogVisible = true
console.log(e.key.btnValue) },
if (e.key.btnValue === 'UseApply') { confirm() {
this.useApply() let isUrgentUse = 0
this.selectionRows.forEach(item => {
if (item.typeName !== 'UrgentUse') {
isUrgentUse++
} }
}, })
useApply() { if (isUrgentUse === 0) {
this.dialogVisible = true // 紧急领用选人
}, this.dialogVisible = false
confirm() { this.setPersonVisible = true
let isUrgentUse = 0 } else if (isUrgentUse === this.selectionRows.length) {
this.selectionRows.forEach(item => { post('/OutStorageRequest/outStorageOut/submit?applyIds=' + this.selectionRows.map(item => Number(item.id))).then(res => {
if (item.typeName !== 'UrgentUse') { this.$utils.showMessageSuccess('提交成功')
isUrgentUse++ this.$refs.applyTable.$refs.asCom.getData()
} }).catch(() => {
}) this.$utils.showMessageWarning('出现异常,提交失败')
if (isUrgentUse === 0) { }).finally(() => {
// 紧急领用选人
this.dialogVisible = false this.dialogVisible = false
this.setPersonVisible = true })
} else if (isUrgentUse === this.selectionRows.length) { } else {
post('/OutStorageRequest/outStorageOut/submit?applyIds=' + this.selectionRows.map(item => Number(item.id))).then(res => { this.dialogVisible = false
this.$utils.showMessageSuccess('提交成功') this.$utils.showMessageWarning('紧急领用不能和其他领用类型一起提交')
}
},
cancle() {
this.dialogVisible = false
},
setPersonConfirm() {
const ids = []
if (this.selectionRows && this.selectionRows.length) {
this.selectionRows.forEach(item => ids.push(item.id))
}
if (this.form.userIds && this.form.userIds.length !== 0) {
post('/OutStorageRequest/creator/apply?userIds=' + this.form.userIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
setTimeout(() => {
this.$refs.applyTable.$refs.asCom.getData() this.$refs.applyTable.$refs.asCom.getData()
}).catch(() => { }, 1500)
this.$utils.showMessageWarning('出现异常,提交失败') }).catch(err => {
}).finally(() => { this.$utils.showMessageWarning('出现异常,提交失败')
this.dialogVisible = false console.log(err)
}) }).finally(() => {
} else {
this.dialogVisible = false this.dialogVisible = false
this.$utils.showMessageWarning('紧急领用不能和其他领用类型一起提交') this.setPersonVisible = false
} this.$set(this.form, 'userIds', '')
}, })
cancle() { } else {
this.dialogVisible = false this.$utils.showMessageWarning('请选择审批领导')
},
setPersonConfirm() {
const ids = []
if (this.selectionRows && this.selectionRows.length) {
this.selectionRows.forEach(item => ids.push(item.id))
}
if (this.form.userIds && this.form.userIds.length !== 0) {
post('/OutStorageRequest/creator/apply?userIds=' + this.form.userIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
setTimeout(() => {
this.$refs.applyTable.$refs.asCom.getData()
}, 1500)
}).catch(err => {
this.$utils.showMessageWarning('出现异常,提交失败')
console.log(err)
}).finally(() => {
this.dialogVisible = false
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
})
} else {
this.$utils.showMessageWarning('请选择审批领导')
}
},
setPersonCancle() {
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
},
selectionChange(val) {
this.selectionRows = val
} }
},
setPersonCancle() {
this.setPersonVisible = false
this.$set(this.form, 'userIds', '')
},
selectionChange(val) {
this.selectionRows = val
} }
} }
</script> }
</script>
<style></style> <style></style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment