8 Commits

Author SHA1 Message Date
aixianling
382be3d32f feat(AppInsuranceApply): 添加保险申请材料上传功能
- 移除了未使用的组件导入
- 新增了 formImages 数组,定义了需要上传的图片类型和验证规则
- 在证件信息卡片中添加了图片上传功能
- 使用 ai-uploader 组件实现图片上传- 添加了图片预览功能
2024-12-30 18:04:01 +08:00
aixianling
a7c3b22f87 feat(xumu): 新增投保申请功能
- 添加投保申请列表和新增页面
- 实现养殖场、承保公司、保险产品等选择功能
- 添加投保对象选择功能,支持耳标号选择
- 实现投保申请数据的查询、新增、编辑和删除
-优化表格组件,增加隐藏操作列的功能
- 更新耳标号选择组件,支持自定义请求地址
2024-12-30 18:01:13 +08:00
aixianling
3585cceca8 refactor(ui): 优化搜索栏组件的样式和布局
-移除了 AiPullDown 组件的绝对定位样式
- 调整了 AiSearchBar 组件的网格布局和样式
- 优化了展开和收缩功能的实现方式
- 修复了一些潜在的样式冲突和显示问题
2024-12-30 10:29:07 +08:00
aixianling
908e65f136 feat(xumu): 新增死亡登记功能
- 添加死亡登记列表页面和新增/编辑页面
- 实现死亡登记数据的查询、新增、编辑和删除功能
-集成审批流,支持再次提交审批
- 优化搜索功能,支持多条件筛选
2024-12-27 18:06:36 +08:00
aixianling
7828af24fd feat(xumu): 新增淘汰登记功能
- 添加 AppOutManage组件,包含新增和列表页面- 实现淘汰登记的新增、编辑、审核等功能
-集成字典加载、表格展示、搜索筛选等模块
-优化表单验证和图片上传功能
2024-12-27 18:00:52 +08:00
aixianling
185630ad2c refactor(xumu): 移除 AppTreatmentManage 列表页搜索框中不必要的字典属性
- 删除了原场耳标号、生物芯片耳标号和电子耳标号输入框中的 dict 属性
- 优化了代码结构,
2024-12-27 16:49:04 +08:00
aixianling
67c4c8032e style(layout): 调整搜索栏左侧区域高度
- 将 .left 类的 height 属性从3px
- 此调整旨在 32px 修改为 3优化搜索栏的视觉效果和布局
2024-12-27 16:48:33 +08:00
aixianling
39ce5404c1 feat(ui): 优化搜索栏布局和功能
- 为 AiInput 组件添加 placeholder 属性
- 重构 AiSearchBar 组件布局,使用 grid 替代 flex- 调整搜索栏样式
2024-12-27 16:45:43 +08:00
18 changed files with 1033 additions and 79 deletions

View File

@@ -0,0 +1,35 @@
<script>
import add from "./add.vue";
import list from "./list.vue";
export default {
name: "AppDeathManage",
label: "死亡登记",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
let {hash} = this.$route
return hash == "#add" ? add : list
}
},
data() {
return {}
}
}
</script>
<template>
<section class="AppDeathManage">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<style scoped lang="scss">
.AppDeathManage {
height: 100%;
}
</style>

View File

@@ -0,0 +1,163 @@
<script>
import {mapState} from "vuex"
const formImages = [
{label: "身长测量照片", prop: "heightPic", rules: {required: true, message: '请上传 身长测量照片'}},
{label: "生物芯片照片", prop: "biochipPic", rules: {required: true, message: '请上传 生物芯片照片'}},
{label: "防疫耳标照片", prop: "preventionPic", rules: {required: true, message: '请上传 防疫耳标照片'}},
{label: "其他说明照片", prop: "otherPic", rules: {required: true, message: '请上传 其他说明照片'}},
]
export default {
name: "deathAdd",
props: {
instance: Function,
permissions: Function,
dict: Object
},
data() {
return {
formImages,
detail: {},
form: {}
}
},
computed: {
...mapState(["user"]),
userinfo: v => v.user.info || {},
isAdd: v => !v.$route.query.id,
isEdit: v => v.$route.query.edit == 1,
isAuthing: v => v.detail.auditStatus == 1,
pageTitle: v => {
const appName = v.$parent.menuName || v.$parent.$options.label
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
},
},
methods: {
back(params = {}) {
this.$router.push(params)
},
getDetail(id) {
return id && this.instance.post("/api/breed/death/page", {biochipEarNumber: id}).then(res => {
if (res?.data?.records) {
const detail = res.data.records[0] || {}
if (detail.picture) {
Object.entries(JSON.parse(detail.picture)).forEach(([key, value]) => {
detail[key] = value
})
}
return this.detail = {...detail}
}
})
},
submit() {
this.$refs.detail.validate().then(() => {
const {biochipEarNumber, id, deathTime, heightPic, biochipPic, preventionPic, otherPic, reason, remarks} = this.detail
this.instance.post("/api/breed/death/addOrEdit", {
biochipEarNumber, id, deathTime, picture: {heightPic, biochipPic, preventionPic, otherPic}, reason, remarks
}).then(res => {
if (res?.code == 0 && res?.data != 1) {
this.$confirm("是否返回列表页?", "提交成功").then(() => this.back()).catch(() => this.getDetail(biochipEarNumber))
}
})
})
},
handleAudit() {
this.$refs.form.validate().then(() => {
const {id} = this.detail
this.instance.post("/api/breed/death/audit", null, {params: {id, ...this.form}}).then(res => {
if (res?.code == 0) {
this.$message.success("操作成功")
this.back()
}
})
})
}
},
created() {
this.dict.load("yesOrNo", "category", "variety", "deathReason")
this.getDetail(this.$route.query.id)
}
}
</script>
<template>
<ai-page :title="pageTitle" class="deathAdd" showBack content-string="blank">
<el-form size="small" label-width="120px" :model="detail" ref="detail">
<ai-card title="基础信息">
<div class="grid c-4">
<ai-input class="row" v-model="detail.biochipEarNumber" placeholder="请输入耳标号按回车查询,或扫描耳标号" @input="getDetail"/>
<el-form-item label="生物芯片耳标号">
<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>
</ai-card>
<ai-card title="上传照片">
<div class="grid c-4">
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
</el-form-item>
</div>
</ai-card>
<ai-card title="死亡录入">
<div class="grid">
<el-form-item label="死亡日期" prop="createTime" :rules="[{required:true,message:'请选择死亡日期'}]">
<el-date-picker v-if="isAdd||isEdit" v-model="detail.createTime"/>
<b v-text="detail.createTime"/>
</el-form-item>
<el-form-item label="死亡原因" prop="reason" :rules="[{required:true,message:'请选择死亡原因'}]">
<ai-select v-if="isAdd||isEdit" v-model="detail.reason" dict="deathReason"/>
<b v-text="detail.reason"/>
</el-form-item>
<el-form-item label="备注" prop="remark" class="row">
<ai-input type="textarea" :row="3" v-model="detail.remark" :edit="isAdd||isEdit"/>
</el-form-item>
</div>
</ai-card>
<ai-card title="审批信息" v-if="isAuthing">
<el-form :model="form" size="small" ref="form" label-width="120px">
<el-form-item label="是否同意" prop="auditStatus" :rules="[{required:true,message:'请选择是否同意'}]">
<ai-select v-model="form.auditStatus" :select-list="[{dictValue: 2, dictName: '同意'}, {dictValue: 3, dictName: '不同意'}]"/>
</el-form-item>
<el-form-item label="审批意见" prop="auditReason">
<el-input type="textarea" :row="3" v-model="form.auditReason" clearable placeholder="请输入"/>
</el-form-item>
</el-form>
</ai-card>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submit" v-if="isAdd||isEdit">提交</el-button>
<el-button type="primary" @click="handleAudit" v-if="isAuthing">提交</el-button>
<el-button @click="back">返回</el-button>
</div>
</ai-page>
</template>
<style scoped lang="scss">
.deathAdd {
.el-date-editor {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,143 @@
<script>
import {mapState} from "vuex"
const columns = [
{label: "序号", type: "index"},
{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: "deathTime"},
{label: "死亡原因", prop: "reason", dict: "deathReason", width: 80},
{label: "登记时间", prop: "createTime"},
{label: "操作人", prop: "userName", width: 100},
{label: "审核状态", prop: "auditStatus", dict: "auditStatus", width: 80},
]
export default {
name: "deathList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
columns,
tableData: [],
page: {pageNum: 1, pageSize: 10, total: 0},
search: {},
dialog: false,
form: {}
}
},
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/death/page", {...this.page, ...this.search}).then(res => {
if (res?.data) {
this.tableData = res.data?.records
this.page.total = res.data.total
}
})
},
handleDelete(id) {
this.$confirm("确定删除该条数据?").then(() => {
this.instance.post("/api/breed/weight/del", null, {
params: {id}
}).then(res => {
if (res?.code == 0) {
this.getTableData()
}
})
})
},
handleAuditAgain(id) {
this.$confirm("是否要再次提交审批?").then(() => {
this.instance.post("/api/breed/death/audit", null, {
params: {id, auditStatus: 1}
}).then(res => {
if (res?.code == '0') {
this.$message.success("提交成功")
this.getTableData()
}
})
})
}
},
created() {
this.dict.load("auditStatus", "category", "variety")
this.getTableData()
}
}
</script>
<template>
<ai-page class="deathList" :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.deathBeginDate" type="datetime" placeholder="开始日期" size="small"/>
<el-date-picker v-model="search.deathEndDate" 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>
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
<ai-download :instance="instance" url="/api/breed/death/export" :params="{...search,...page}" :fileName="`死亡导出表-${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">
<el-button v-if="row.auditStatus==1" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
<template v-else>
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber,edit:1}})">编辑</el-button>
<el-button v-if="row.auditStatus==3" type="text" @click="handleAuditAgain(row.id)">再次提交</el-button>
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
</template>
</div>
</template>
</el-table-column>
</ai-table>
</ai-page>
</template>
<style scoped lang="scss">
.deathList {
height: 100%;
.deleteBtn {
color: $errorColor;
}
}
</style>

View File

@@ -1,6 +1,5 @@
<script>
import {mapState} from "vuex"
import AiSelect from "dui/packages/basic/AiSelect.vue";
const columns = [
{label: "序号", type: "index"},
@@ -15,7 +14,6 @@ const columns = [
]
export default {
name: "etAdd",
components: {AiSelect},
props: {
instance: Function,
permissions: Function,

View File

@@ -0,0 +1,35 @@
<script>
import add from "./add.vue";
import list from "./list.vue";
export default {
name: "AppInsuranceApply",
label: "投保申请",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
let {hash} = this.$route
return hash == "#add" ? add : list
}
},
created() {
this.dict.load("auditStatus", "insureType", "insureStatus", "category", "variety")
},
}
</script>
<template>
<section class="AppInsuranceApply">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<style scoped lang="scss">
.AppInsuranceApply {
height: 100%;
}
</style>

View File

@@ -0,0 +1,142 @@
<script>
import {mapState} from "vuex"
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
const columns = [
{label: "序号", type: "index"},
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
{label: "类别", prop: "category", dict: "category"},
{label: "品种", prop: "variety", dict: "variety"},
]
const formImages = [
{label: "身长测量照片", prop: "heightPic", rules: {required: true, message: '请上传 身长测量照片'}},
{label: "生物芯片照片", prop: "biochipPic", rules: {required: true, message: '请上传 生物芯片照片'}},
{label: "防疫耳标照片", prop: "preventionPic", rules: {required: true, message: '请上传 防疫耳标照片'}},
{label: "其他说明照片", prop: "otherPic", rules: {required: true, message: '请上传 其他说明照片'}},
]
export default {
name: "iaAdd",
components: {AiEartagPicker},
props: {
instance: Function,
permissions: Function,
dict: Object
},
data() {
return {
detail: {detailList: []},
columns, formImages,
companyList: []
}
},
computed: {
...mapState(["user"]),
userinfo: v => v.user.info || {},
pageTitle: v => {
const appName = v.$parent.menuName || v.$parent.$options.label
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
},
isAdd: v => !v.$route.query.id,
isEdit: v => v.$route.query.edit == 1,
},
methods: {
back(params = {}) {
this.$router.push(params)
},
getDetail() {
const {id} = this.$route.query
return id && this.instance.post("/api/insurance/apply/getInfo", null, {params: {id}}).then(res => {
if (res?.data) {
const detail = res.data
detail.detailList = detail.weightList || []
return this.detail = {...detail}
}
})
},
getCompanies() {
this.instance.post("/api/insurance/apply/getCompany").then(res => {
if (res?.data) {
this.companyList = res.data
}
})
},
getProducts(id) {
const item = this.companyList.find(e => e.id == id)
return item?.children || []
},
submit() {
this.$refs.detail.validate().then(() => {
this.form.biochipEarNumber = this.detail.biochipEarNumber
this.instance.post("/api/insurance/apply/addOrEdit", this.form).then(res => {
if (res?.code == 0) {
this.dialog = false
this.getDetail()
}
})
})
}
},
created() {
this.getCompanies()
this.getDetail()
}
}
</script>
<template>
<ai-page :title="pageTitle" class="iaAdd" showBack content-string="blank">
<el-form size="small" label-width="120px" :model="detail" ref="detail">
<ai-card title="基础信息">
<div class="grid">
<el-form-item label="养殖场" prop="farmId" :rules="{required:true,message:'请选择 养殖场'}">
<ai-select v-if="isAdd||isEdit" v-model="detail.farmId" :instance="instance" :action="`/api/siteUser/querySiteByUserId?userId=${userinfo.id}`" :prop="{label:'name'}"/>
<b v-else v-text="detail.farmName"/>
</el-form-item>
<el-form-item label="承保公司" prop="companyId" :rules="{required:true,message:'请选择 承保公司'}">
<ai-select v-if="isAdd||isEdit" v-model="detail.companyId" :select-list="companyList" :prop="{label:'name'}"/>
<b v-else v-text="detail.companyName"/>
</el-form-item>
<el-form-item label="保险产品" prop="productType" :rules="{required:true,message:'请选择 保险产品'}">
<ai-select v-if="isAdd||isEdit" v-model="detail.productType" :select-list="getProducts(detail.companyId)" :prop="{label:'name',value:'productType'}"
@select="v=>$set(detail,'insureType',v.children[0].insureType)"/>
<b v-else v-text="detail.productType"/>
</el-form-item>
<el-form-item label="投保类型">
<ai-input :value="dict.getLabel('insureType',detail.insureType)" placeholder="根据保险产品自动带出" :edit="isAdd||isEdit" readonly/>
</el-form-item>
<el-form-item label="联系人">
<ai-input v-model="detail.contacts" :edit="isAdd||isEdit"/>
</el-form-item>
<el-form-item label="联系电话">
<ai-input v-model="detail.phone" :edit="isAdd||isEdit"/>
</el-form-item>
</div>
</ai-card>
<ai-card title="投保对象">
<template #right>
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance"
:action="`/insurance/apply/getEarNumberList?farmId=${detail.farmId}`">
<el-button type="text">选择</el-button>
</ai-eartag-picker>
</template>
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
</ai-card>
<ai-card title="证件信息">
<div class="grid c-4">
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
</el-form-item>
</div>
</ai-card>
</el-form>
<div slot="footer">
<el-button @click="back">返回</el-button>
</div>
</ai-page>
</template>
<style scoped lang="scss">
.iaAdd {
}
</style>

View File

@@ -0,0 +1,119 @@
<script>
import {mapState} from "vuex"
const columns = [
{label: "序号", type: "index"},
{label: "投保单号", prop: "orderNo"},
{label: "所属养殖场", prop: "farmName"},
{label: "投保类型", prop: "insureType", dict: "insureType"},
{label: "承保公司", prop: "companyName"},
{label: "投保时间", prop: "createTime"},
{label: "投保状态", prop: "status", width: 160, dict: "insureStatus"},
{label: "审核状态", prop: "auditStatus", width: 120, dict: "auditStatus"},
{label: "申请人", prop: "applyName", width: 120},
]
export default {
name: "iaList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
columns,
tableData: [],
page: {pageNum: 1, pageSize: 10, total: 0},
search: {},
dialog: false,
form: {}
}
},
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/insurance/apply/page", {...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
}
})
},
handleDelete(id) {
this.$confirm("确定删除该条数据?").then(() => {
this.instance.post("/api/insurance/apply/del", null, {
params: {id}
}).then(res => {
if (res?.code == 0) {
this.getTableData()
}
})
})
},
},
created() {
this.getTableData()
}
}
</script>
<template>
<ai-page class="iaList" :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-input placeholder="投保订单号" v-model="search.orderNo"/>
<ai-select placeholder="全部投保类型" v-model="search.insureType" dict="insureType"/>
<ai-select placeholder="全部投保状态" v-model="search.status" dict="insureStatus"/>
<ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/>
<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>
</template>
</ai-search-bar>
<ai-search-bar>
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
<ai-download :instance="instance" url="/api/insurance/apply/export" :params="{...search,...page}" :fileName="`投保申请导出表-${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="['00','03'].includes(row.permit)">
<el-button type="text" @click="$router.push({hash:'#add',query:{id:row.id,edit:1}})">编辑</el-button>
<el-button type="text" @click="handleDelete(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">
.iaList {
height: 100%;
.deleteBtn {
color: $errorColor;
}
}
</style>

View File

@@ -0,0 +1,35 @@
<script>
import add from "./add.vue";
import list from "./list.vue";
export default {
name: "AppOutManage",
label: "淘汰登记",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
let {hash} = this.$route
return hash == "#add" ? add : list
}
},
data() {
return {}
}
}
</script>
<template>
<section class="AppOutManage">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<style scoped lang="scss">
.AppOutManage {
height: 100%;
}
</style>

View File

@@ -0,0 +1,163 @@
<script>
import {mapState} from "vuex"
const formImages = [
{label: "身长测量照片", prop: "heightPic", rules: {required: true, message: '请上传 身长测量照片'}},
{label: "生物芯片照片", prop: "biochipPic", rules: {required: true, message: '请上传 生物芯片照片'}},
{label: "防疫耳标照片", prop: "preventionPic", rules: {required: true, message: '请上传 防疫耳标照片'}},
{label: "其他说明照片", prop: "otherPic", rules: {required: true, message: '请上传 其他说明照片'}},
]
export default {
name: "outAdd",
props: {
instance: Function,
permissions: Function,
dict: Object
},
data() {
return {
formImages,
detail: {},
form: {}
}
},
computed: {
...mapState(["user"]),
userinfo: v => v.user.info || {},
isAdd: v => !v.$route.query.id,
isEdit: v => v.$route.query.edit == 1,
isAuthing: v => v.detail.auditStatus == 1,
pageTitle: v => {
const appName = v.$parent.menuName || v.$parent.$options.label
return v.$route.query.id ? v.isEdit ? `编辑${appName}` : `${appName}详情` : `新增${appName}`
},
},
methods: {
back(params = {}) {
this.$router.push(params)
},
getDetail(id) {
return id && this.instance.post("/api/breed/out/page", {biochipEarNumber: id}).then(res => {
if (res?.data?.records) {
const detail = res.data.records[0] || {}
if (detail.picture) {
Object.entries(JSON.parse(detail.picture)).forEach(([key, value]) => {
detail[key] = value
})
}
return this.detail = {...detail}
}
})
},
submit() {
this.$refs.detail.validate().then(() => {
const {biochipEarNumber, id, outTime, heightPic, biochipPic, preventionPic, otherPic, reason, remarks} = this.detail
this.instance.post("/api/breed/out/addOrEdit", {
biochipEarNumber, id, outTime, picture: {heightPic, biochipPic, preventionPic, otherPic}, reason, remarks
}).then(res => {
if (res?.code == 0 && res?.data != 1) {
this.$confirm("是否返回列表页?", "提交成功").then(() => this.back()).catch(() => this.getDetail(biochipEarNumber))
}
})
})
},
handleAudit() {
this.$refs.form.validate().then(() => {
const {id} = this.detail
this.instance.post("/api/breed/out/audit", null, {params: {id, ...this.form}}).then(res => {
if (res?.code == 0) {
this.$message.success("操作成功")
this.back()
}
})
})
}
},
created() {
this.dict.load("yesOrNo", "category", "variety", "outReason")
this.getDetail(this.$route.query.id)
}
}
</script>
<template>
<ai-page :title="pageTitle" class="outAdd" showBack content-string="blank">
<el-form size="small" label-width="120px" :model="detail" ref="detail">
<ai-card title="基础信息">
<div class="grid c-4">
<ai-input class="row" v-model="detail.biochipEarNumber" placeholder="请输入耳标号按回车查询,或扫描耳标号" @input="getDetail"/>
<el-form-item label="生物芯片耳标号">
<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>
</ai-card>
<ai-card title="上传照片">
<div class="grid c-4">
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
<ai-uploader v-if="isAdd||isEdit" v-model="detail[img.prop]" :instance="instance" :limit="1" value-is-url/>
<el-image :src="detail[img.prop]" :preview-src-list="[detail[img.prop]]" v-else/>
</el-form-item>
</div>
</ai-card>
<ai-card title="淘汰录入">
<div class="grid">
<el-form-item label="淘汰日期" prop="createTime" :rules="[{required:true,message:'请选择淘汰日期'}]">
<el-date-picker v-if="isAdd||isEdit" v-model="detail.createTime"/>
<b v-text="detail.createTime"/>
</el-form-item>
<el-form-item label="淘汰原因" prop="reason" :rules="[{required:true,message:'请选择淘汰原因'}]">
<ai-select v-if="isAdd||isEdit" v-model="detail.reason" dict="outReason"/>
<b v-text="detail.reason"/>
</el-form-item>
<el-form-item label="备注" prop="remark" class="row">
<ai-input type="textarea" :row="3" v-model="detail.remark" :edit="isAdd||isEdit"/>
</el-form-item>
</div>
</ai-card>
<ai-card title="审批信息" v-if="isAuthing">
<el-form :model="form" size="small" ref="form" label-width="120px">
<el-form-item label="是否同意" prop="auditStatus" :rules="[{required:true,message:'请选择是否同意'}]">
<ai-select v-model="form.auditStatus" :select-list="[{dictValue: 2, dictName: '同意'}, {dictValue: 3, dictName: '不同意'}]"/>
</el-form-item>
<el-form-item label="审批意见" prop="auditReason">
<el-input type="textarea" :row="3" v-model="form.auditReason" clearable placeholder="请输入"/>
</el-form-item>
</el-form>
</ai-card>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submit" v-if="isAdd||isEdit">提交</el-button>
<el-button type="primary" @click="handleAudit" v-if="isAuthing">提交</el-button>
<el-button @click="back">返回</el-button>
</div>
</ai-page>
</template>
<style scoped lang="scss">
.outAdd {
.el-date-editor {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,143 @@
<script>
import {mapState} from "vuex"
const columns = [
{label: "序号", type: "index"},
{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: "outList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
columns,
tableData: [],
page: {pageNum: 1, pageSize: 10, total: 0},
search: {},
dialog: false,
form: {}
}
},
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/page", {...this.page, ...this.search}).then(res => {
if (res?.data) {
this.tableData = res.data?.records
this.page.total = res.data.total
}
})
},
handleDelete(id) {
this.$confirm("确定删除该条数据?").then(() => {
this.instance.post("/api/breed/weight/del", null, {
params: {id}
}).then(res => {
if (res?.code == 0) {
this.getTableData()
}
})
})
},
handleAuditAgain(id) {
this.$confirm("是否要再次提交审批?").then(() => {
this.instance.post("/api/breed/out/audit", null, {
params: {id, auditStatus: 1}
}).then(res => {
if (res?.code == '0') {
this.$message.success("提交成功")
this.getTableData()
}
})
})
}
},
created() {
this.dict.load("auditStatus", "category", "variety")
this.getTableData()
}
}
</script>
<template>
<ai-page class="outList" :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>
<el-button type="primary" icon="iconfont iconAdd" @click="$router.push({hash:'#add'})">新增</el-button>
<ai-download :instance="instance" url="/api/breed/out/export" :params="{...search,...page}" :fileName="`淘汰导出表-${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">
<el-button v-if="row.auditStatus==1" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
<template v-else>
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber}})">查看</el-button>
<el-button v-if="row.auditStatus==2" type="text" @click="$router.push({hash:'#add',query:{id:row.biochipEarNumber,edit:1}})">编辑</el-button>
<el-button v-if="row.auditStatus==3" type="text" @click="handleAuditAgain(row.id)">再次提交</el-button>
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
</template>
</div>
</template>
</el-table-column>
</ai-table>
</ai-page>
</template>
<style scoped lang="scss">
.outList {
height: 100%;
.deleteBtn {
color: $errorColor;
}
}
</style>

View File

@@ -140,7 +140,7 @@ export default {
<el-form-item label="治疗日期" prop="treatmentTime" :rules="{required:true,message:'请选择 治疗日期'}">
<el-date-picker v-model="detail.treatmentTime"/>
</el-form-item>
<el-form-item v-for="item in formItems" v-bind="item">
<el-form-item v-for="(item,i) in formItems" :key="i" v-bind="item">
<ai-input v-model="detail[item.prop]"/>
</el-form-item>
</div>

View File

@@ -71,9 +71,9 @@ export default {
<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>
<el-input placeholder="原场耳标号" v-model="search.originalEarNumber" dict="authStatus" size="small" clearable/>
<el-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber" dict="authStatus" size="small" clearable/>
<el-input placeholder="电子耳标号" v-model="search.electronicEarNumber" dict="authStatus" size="small" clearable/>
<el-input placeholder="原场耳标号" v-model="search.originalEarNumber" size="small" clearable/>
<el-input placeholder="生物芯片耳标号" v-model="search.biochipEarNumber" size="small" clearable/>
<el-input placeholder="电子耳标号" v-model="search.electronicEarNumber" size="small" clearable/>
</template>
</ai-search-bar>
<ai-search-bar>

View File

@@ -5,7 +5,7 @@ import AiDialog from "dui/packages/basic/AiDialog.vue";
const columns = [
{label: "序号", type: "index"},
{label: "数据来源", prop: "source", dict: "source"},
{label: "数据来源", prop: "source", dict: "dataSources"},
{label: "重量", prop: "weight"},
{label: "称重时间", prop: "createTime"},
{label: "是否变更过", prop: "isUpdate", dict: "yesOrNo"},
@@ -72,7 +72,7 @@ export default {
}
},
created() {
this.dict.load("yesOrNo", "category", "variety", "source")
this.dict.load("yesOrNo", "category", "variety", "dataSources")
this.getDetail()
}
}

View File

@@ -4,7 +4,8 @@ export default {
props: {
instance: Function,
value: {default: () => []},
penId: {default: "", required: true}
action: {default: "/api/breed/earTag/getEarTagByPenId"},
penId: String
},
model: {
prop: "value",
@@ -18,18 +19,20 @@ export default {
}
},
watch: {
penId: {
action: {
immediate: true,
handler(v) {
this.getEartag(v)
handler() {
this.getEartag()
}
}
},
},
methods: {
getEartag(penId) {
penId && this.instance.post("/api/breed/earTag/getEarTagByPenId", null, {
params: {penId}
}).then(res => {
getEartag() {
let url = this.action
if (this.penId) {
url += `?penId=${this.penId}`
}
this.instance.post(url).then(res => {
if (res?.data) {
this.list = res.data
}
@@ -38,6 +41,7 @@ export default {
handleConfirm() {
this.dialog = false
this.$emit("input", this.selected)
this.$emit("select", this.list.filter(v => this.selected.includes(v.id)))
}
}
}
@@ -45,7 +49,10 @@ export default {
<template>
<section class="AiEartagPicker">
<el-select :value="value" clearable multiple placeholder="请选择">
<div v-if="$slots.default" @click="dialog=true">
<slot/>
</div>
<el-select v-else :value="value" clearable multiple placeholder="请选择">
<el-option v-for="op in list" :key="op.id" :label="op.earTag" :value="op.id"/>
<div slot="prefix" @click.stop="dialog=true"/>
</el-select>

View File

@@ -3,7 +3,8 @@ export default {
name: "AiInput",
props: {
value: {default: ""},
edit: {default: true}
edit: {default: true},
placeholder: {default: "请输入"}
},
model: {
prop: 'value',
@@ -14,7 +15,7 @@ export default {
<template>
<section class="AiInput">
<el-input v-if="edit" :value="value" size="small" placeholder="请输入" v-bind="$attrs"
<el-input v-if="edit" :value="value" size="small" :placeholder="placeholder" v-bind="$attrs"
@input="v=>$emit('input', v)" clearable autofocus/>
<b v-else v-text="value"/>
</section>

View File

@@ -50,11 +50,6 @@ export default {
<style lang="scss" scoped>
.AiPullDown {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 24px;
transform: translateY(100%);
background-color: #fff;
.line {

View File

@@ -35,7 +35,7 @@
</template>
</el-table-column>
</template>
<slot class="table-options" name="options"/>
<slot v-if="!hideOptions" class="table-options" name="options"/>
<template #empty>
<slot v-if="$scopedSlots.empty" name="empty"/>
<div v-else class="no-data" style="height:160px;"/>
@@ -96,7 +96,8 @@ export default {
dict: {default: () => dict},
pagerCount: {default: 5},
pageSizes: {default: () => [10, 20, 50, 100]},
pageConfig: Object
pageConfig: Object,
hideOptions: {type: Boolean, default: false},
},
data() {
return {

View File

@@ -1,12 +1,14 @@
<template>
<section class="AiSearchBar" :class="{bottomBorder,isSingleRow,expand}">
<div ref="AiSearchBarZone" class="searchLeftZone">
<slot name="left"/>
<section class="AiSearchBar grid" :class="{bottomBorder,isSingleRow}">
<div class="left">
<div class="flex wrap gridZone">
<slot name="left"/>
</div>
</div>
<div class="searchRightZone" ref="searchRightZone" v-if="$slots.right">
<div class="right" v-if="$slots.right">
<slot name="right"/>
</div>
<ai-pull-down v-if="!isSingleRow" v-model="expand"/>
<ai-pull-down class="row" v-if="!isSingleRow" v-model="expand"/>
</section>
</template>
@@ -15,7 +17,6 @@ export default {
name: "AiSearchBar",
props: {
bottomBorder: Boolean,
size: {default: "small"}
},
computed: {
isSingleRow: v => v.height <= 45
@@ -23,44 +24,33 @@ export default {
data() {
return {
height: 0,
rightHeight: 0,
searchBarStyle: {},
observer: null,
expand: false
}
},
methods: {
initSize() {
this.height = this.$refs?.AiSearchBarZone?.offsetHeight
this.rightHeight = this.$refs?.searchRightZone?.offsetHeight + 12
watch: {
expand: {
handler(v) {
this.$el.querySelector(".left").style.height = v ? 'auto' : '33px'
}
}
},
mounted() {
this.$nextTick(() => {
this.initSize()
this.observer = new ResizeObserver(this.initSize)
this.observer.observe(this.$refs?.AiSearchBarZone)
})
this.height = this.$el.querySelector(".left .gridZone").getBoundingClientRect().height
// 卡浏览器渲染帧,为了避免flex布局溢出后只显示尾部元素,先用auto 高度,再延时一帧再设置为33px
setTimeout(() => {
this.$el.querySelector(".left").style.height = "33px"
},50)
},
beforeDestroy() {
this.observer?.disconnect()
}
}
</script>
<style lang="scss" scoped>
.AiSearchBar {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 10px;
padding-bottom: 36px;
grid-template-columns: 1fr auto;
position: relative;
height: 64px;
overflow: hidden;
&.isSingleRow {
height: 44px;
padding-bottom: 12px;
}
@@ -68,46 +58,30 @@ export default {
border-bottom: 1px solid #eee;
}
&.expand {
.left {
padding-top: 1px;
height: auto;
}
:deep(.searchLeftZone ) {
flex: 1;
min-width: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
overflow: hidden;
//height: 40px;
.gridZone {
gap: 8px;
}
}
:deep(.searchRightZone ) {
:deep(.right ) {
display: flex;
align-items: center;
flex-shrink: 0;
align-self: flex-start;
width: 280px;
.el-input {
width: 280px;
}
* + button, * + div, * + section {
margin-left: 8px;
}
}
.el-input {
width: auto;
}
}
.AiPullDown {
margin-top: 8px;
}
:deep( .searchLeftZone > .el-button), :deep( .searchRightZone > .el-button ) {
margin-left: 0;
}
</style>