master
lion 3 years ago
parent d378008ab8
commit d56033e0da

@ -199,71 +199,71 @@
{{form.accept_goods_admin?form.accept_goods_admin.name:''}}
</div>
</div>
</template>
<!-- 审核 -->
<template v-slot:checkRecord v-if="formDataType=='checkrecord'">
<div style="width:600px">
审核
</div>
</template>
<template v-slot:checkForm v-if="formDataType=='checkrecord'">
<el-form-item prop='checkForm.status' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">状态
</div>
<div class="xy-table-item-content">
<el-select v-model="checkForm.status" placeholder="请选择" style="width:200px">
<el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</el-form-item>
<el-form-item prop='checkForm.status' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">审核
</div>
<div class="xy-table-item-content">
<el-select v-model="checkForm.level" @change="selectLevel" placeholder="请选择" style="width:200px;margin-right:10px">
<el-option v-for="(item,index) in form.visit_area.audit_admin" :key="item.level" :label="item.type_name" :value="item.level">
</el-option>
</el-select>
<span>
{{check_admin_name}}
</span>
</div>
</div>
</el-form-item>
<el-form-item prop='checkForm.reason' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="checkForm.reason" placeholder="请输入备注" style="width:300px"></el-input>
</div>
</div>
</el-form-item>
</template>
<template v-slot:codeForm>
<div class="xy-table-item">
<div class="xy-table-item-label">
核销码
</div>
<div class="xy-table-item-content">
<el-input v-model="codeForm.code" ref="codeInput" placeholder="请输入核销码或扫码" style="width:300px"></el-input>
</div>
</div>
</template>
<template v-slot:footerContent>
<div>
<Button ghost type="primary" @click="reset"></Button>
<Button v-if="formDataType=='checkrecord'" type="primary" @click="checkSubmit"></Button>
<Button v-if="formDataType=='coderecord'" type="primary" @click="codeSubmit"></Button>
</div>
</template>
<!-- 审核 -->
<template v-slot:checkRecord v-if="formDataType=='checkrecord'">
<div style="width:600px">
审核
</div>
</template>
<template v-slot:checkForm v-if="formDataType=='checkrecord'&&isCheck">
<el-form-item prop='checkForm.status' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">状态
</div>
<div class="xy-table-item-content">
<el-select v-model="checkForm.status" placeholder="请选择" style="width:200px">
<el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</el-form-item>
<!-- <el-form-item prop='checkForm.status' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">审核
</div>
<div class="xy-table-item-content">
<el-select v-model="checkForm.level" @change="selectLevel" placeholder="请选择" style="width:200px;margin-right:10px">
<el-option v-for="(item,index) in form.visit_area.audit_admin" :key="item.level" :label="item.type_name" :value="item.level">
</el-option>
</el-select>
<span>
{{check_admin_name}}
</span>
</div>
</div>
</el-form-item> -->
<el-form-item prop='checkForm.reason' style="margin-bottom:20px">
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="checkForm.reason" placeholder="请输入备注" style="width:300px"></el-input>
</div>
</div>
</el-form-item>
</template>
<template v-slot:codeForm v-if="formDataType=='coderecord'">
<div class="xy-table-item">
<div class="xy-table-item-label">
核销码
</div>
<div class="xy-table-item-content">
<el-input v-model="codeForm.code" ref="codeInput" placeholder="请输入核销码或扫码" style="width:300px"></el-input>
</div>
</div>
</template>
<template v-slot:footerContent>
<div>
<Button ghost type="primary" @click="reset"></Button>
<Button v-if="formDataType=='checkrecord'&&isCheck" type="primary" @click="checkSubmit"></Button>
<Button v-if="formDataType=='coderecord'" type="primary" @click="codeSubmit"></Button>
</div>
</template>
</xy-dialog>
@ -271,20 +271,25 @@
</div>
</template>
<script>
import {
save
} from "@/api/visit/check.js"
import {
cancelCode
<script>
import {
save
} from "@/api/visit/check.js"
import {
cancelCode
} from "@/api/gate"
import {
getInfo
} from '@/api/user.js'
import Cookies from 'js-cookie'
export default {
components: {},
data() {
return {
isShow: false,
id: '',
formDataType:'',
id: '',
userId: '',
formDataType: '',
formData: {
visitinfo: "",
date: "",
@ -307,19 +312,19 @@
visitorinfos: "",
accpet_department_id: "",
accept_admin_id: "",
accept_goods_admin_id: "",
checkRecord:'',
checkForm:{},
codeForm:{}
accept_goods_admin_id: "",
checkRecord: '',
checkForm: {},
codeForm: {}
},
form: {},
checkForm:{},//
codeForm:{},//
codeType:'',
gateAdminId:'',
check_admin_name:"",
form: {},
checkForm: {}, //
codeForm: {}, //
codeType: '',
gateAdminId: '',
check_admin_name: "",
followTable: [{
label: "姓名",
prop: "name",
@ -339,35 +344,53 @@
prop: "idcard",
width: 200
}
],
statusList: [{
id: 0,
value: "待审核"
},
{
id: 1,
value: "通过"
},
{
id: 2,
value: "驳回"
},
],
statusList: [{
id: 0,
value: "待审核"
},
{
id: 1,
value: "通过"
},
{
id: 2,
value: "驳回"
},
],
isCheck:false
}
},
created() {
// this.getVisitTime()
this.getUserId()
},
watch: {
isShow(newVal) {
if (newVal) {
this.checkForm.visit_id = this.form.id
this.codeForm.type = parseInt(this.codeType)
this.codeForm.admin_id = parseInt(this.gateAdminId)
if(this.formDataType=='coderecord'){
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
if (newVal) {
let that = this
if (this.formDataType == 'checkrecord') {
this.checkForm.visit_id = this.form.id
for (let item of that.form.audit) {
console.log('item', item.audit_admin_id)
if (item.audit_admin_id == that.userId) {
console.log(item.audit_admin_id == that.userId)
that.checkForm.level = item.level
that.checkForm.id = item.id
that.checkForm.audit_admin_id = item.audit_admin_id
that.isCheck = true
return
}
}
}
if (this.formDataType == 'coderecord') {
this.codeForm.type = parseInt(this.codeType)
this.codeForm.admin_id = parseInt(this.gateAdminId)
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
}
} else {
this.reset()
@ -375,49 +398,53 @@
}
},
methods: {
selectLevel(val){
this.form.audit.map(item=>{
if(item.level==val){
this.checkForm.level = item.level
this.checkForm.id = item.id
this.checkForm.audit_admin_id = item.audit_admin_id
this.check_admin_name = item.audit_admin?item.audit_admin.name:''
}
})
},
reset(){
this.formDataType=''
this.checkForm = {}
this.check_admin_name = ''
this.codeForm={}
this.codeType = ''
this.gateAdminId=''
this.isShow = false
this.$refs['dialog'].reset()
},
checkSubmit(){
console.log(this.checkForm)
// return
let that = this
// this.form.id = this.id
save({
...that.checkForm
}).then(res => {
this.$successMessage('审核成功')
this.isShow = false
this.$emit('refresh')
})
},
codeSubmit(){
let that = this
console.log(this.codeForm)
cancelCode({
...that.codeForm
}).then(res => {
this.$successMessage('核销成功')
this.isShow = false
this.$emit('refresh')
})
selectLevel(val) {
this.form.audit.map(item => {
if (item.level == val) {
this.checkForm.level = item.level
this.checkForm.id = item.id
this.checkForm.audit_admin_id = item.audit_admin_id
this.check_admin_name = item.audit_admin ? item.audit_admin.name : ''
}
})
},
async getUserId() {
const res = await getInfo()
this.userId = res.id
},
reset() {
this.formDataType = ''
this.checkForm = {}
this.check_admin_name = ''
this.codeForm = {}
this.codeType = ''
this.gateAdminId = ''
this.isShow = false
this.$refs['dialog'].reset()
},
checkSubmit() {
console.log(this.checkForm)
// return
let that = this
// this.form.id = this.id
save({
...that.checkForm
}).then(res => {
this.$successMessage('审核成功')
this.isShow = false
this.$emit('refresh')
})
},
codeSubmit() {
let that = this
console.log(this.codeForm)
cancelCode({
...that.codeForm
}).then(res => {
this.$successMessage('核销成功')
this.isShow = false
this.$emit('refresh')
})
}
}

Loading…
Cancel
Save