feat(xumu): 新增淘汰审核功能
- 添加 AppOutAudit组件作为淘汰审核的主入口- 实现 add.vue 页面,用于展示和编辑淘汰审核详情 - 创建 list.vue 页面,用于展示淘汰审核列表 - 在 AppOutManage 中将淘汰日期字段从 createTime改为 outTime
This commit is contained in:
35
project/xumu/AppOutAudit/AppOutAudit.vue
Normal file
35
project/xumu/AppOutAudit/AppOutAudit.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppSellAudit",
|
||||||
|
label: "淘汰审核",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#audit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppSellAudit">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppSellAudit {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
157
project/xumu/AppOutAudit/add.vue
Normal file
157
project/xumu/AppOutAudit/add.vue
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "oaAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isAudit ? `${appName}审批` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isAudit: v => v.$route.hash == "#audit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "身长测量照片", prop: "heightPic"},
|
||||||
|
{label: "生物芯片照片", prop: "biochipPic"},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPic"},
|
||||||
|
{label: "其他说明照片", prop: "otherPic"},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/breed/out/getAuditInfo", null, {params: {id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/breed/out/audit", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="oaAdd" showBack content-string="blank">
|
||||||
|
<el-form size="small" label-width="120px" :model="detail" ref="detail">
|
||||||
|
<ai-card title="基础信息">
|
||||||
|
<div class="grid c-4">
|
||||||
|
<el-form-item label="生物芯片耳标号" class="row">
|
||||||
|
<b v-text="detail.biochipEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖场" prop="farmId">
|
||||||
|
<b v-text="detail.farmName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖舍" prop="houseId">
|
||||||
|
<b v-text="detail.houseName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="养殖栏" prop="penId">
|
||||||
|
<b v-text="detail.penName"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电子耳标号" prop="electronicEarNumber">
|
||||||
|
<b v-text="detail.electronicEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原厂耳标号" prop="category">
|
||||||
|
<b v-text="detail.originalEarNumber"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别" prop="category">
|
||||||
|
<b v-text="detail.category"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品种" prop="variety">
|
||||||
|
<b v-text="detail.variety"/>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="row flex">
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" value-is-url readonly/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="淘汰信息">
|
||||||
|
<el-form-item label="淘汰原因">
|
||||||
|
<b v-text="dict.getLabel('outReason',detail.reason)"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="淘汰时间">
|
||||||
|
<b v-text="detail.outTime"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<b v-text="detail.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="审核信息">
|
||||||
|
<div class="grid">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}">
|
||||||
|
<ai-select v-model="detail.auditStatus" dict="auditStatus"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="意见">
|
||||||
|
<ai-input type="textarea" :rows="3" v-model="detail.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item>
|
||||||
|
<el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item>
|
||||||
|
<el-form-item label="审核人">{{ detail.auditName }}</el-form-item>
|
||||||
|
<el-form-item label="意见">{{ detail.remarks }}</el-form-item>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isAudit">
|
||||||
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.oaAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
111
project/xumu/AppOutAudit/list.vue
Normal file
111
project/xumu/AppOutAudit/list.vue
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "养殖场", prop: "userName", format: (v, row) => `${[row.farmName, row.houseName, row.penName].join("-")}`},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "类别", prop: "category", dict: "category", width: 120},
|
||||||
|
{label: "品种", prop: "variety", dict: "variety", width: 120},
|
||||||
|
{label: "日龄(天)", prop: "age", width: 80},
|
||||||
|
{label: "淘汰时间", prop: "outTime"},
|
||||||
|
{label: "淘汰原因", prop: "reason", width: 80},
|
||||||
|
{label: "登记时间", prop: "createTime"},
|
||||||
|
{label: "操作人", prop: "userName", width: 100},
|
||||||
|
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "oaList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
search: {
|
||||||
|
deep: true,
|
||||||
|
handler() {
|
||||||
|
this.page.pageNum = 1
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getTableData() {
|
||||||
|
this.instance.post("/api/breed/out/getAuditPage", {...this.page, ...this.search}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus}))
|
||||||
|
this.page.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getTableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page class="oaList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-select placeholder="全部养殖场" v-model="search.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖舍" v-model="search.houseId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.farmId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部养殖栏" v-model="search.penId" :instance="instance" :action="`/api/siteUser/querySiteById?id=${search.houseId||-1}`" :prop="{label:'name'}"/>
|
||||||
|
<ai-select placeholder="全部审核状态" v-model="search.auditStatus" dict="auditStatus"/>
|
||||||
|
<ai-search label="淘汰日期">
|
||||||
|
<el-date-picker v-model="search.outBeginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker v-model="search.outEndDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-search label="登记日期">
|
||||||
|
<el-date-picker v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="原场耳标号" v-model="search.originalEarNumber"/>
|
||||||
|
<ai-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber"/>
|
||||||
|
<ai-input placeholder="电子耳标号" v-model="search.electronicEarNumber"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/breed/out/exportAudit" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
|
||||||
|
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
|
||||||
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<div class="table-options">
|
||||||
|
<template v-if="['1'].includes(row.auditStatus)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.oaList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -122,9 +122,9 @@ export default {
|
|||||||
</ai-card>
|
</ai-card>
|
||||||
<ai-card title="淘汰录入">
|
<ai-card title="淘汰录入">
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<el-form-item label="淘汰日期" prop="createTime" :rules="[{required:true,message:'请选择淘汰日期'}]">
|
<el-form-item label="淘汰日期" prop="outTime" :rules="[{required:true,message:'请选择淘汰日期'}]">
|
||||||
<el-date-picker v-if="isAdd||isEdit" v-model="detail.createTime"/>
|
<el-date-picker v-if="isAdd||isEdit" v-model="detail.outTime"/>
|
||||||
<b v-text="detail.createTime"/>
|
<b v-text="detail.outTime"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="淘汰原因" prop="reason" :rules="[{required:true,message:'请选择淘汰原因'}]">
|
<el-form-item label="淘汰原因" prop="reason" :rules="[{required:true,message:'请选择淘汰原因'}]">
|
||||||
<ai-select v-if="isAdd||isEdit" v-model="detail.reason" dict="outReason"/>
|
<ai-select v-if="isAdd||isEdit" v-model="detail.reason" dict="outReason"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user