Merge branch 'main' of http://e19510c831.iok.la/admin/zhyc-sheep-ui
This commit is contained in:
commit
0ff9255150
@ -124,9 +124,29 @@
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="Breeding_recordsList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="Breeding_recordsList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange"
|
||||
:default-sort="{prop: 'createTime', order: 'descending'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="耳号" align="center" prop="eweManageTags" width="120" fixed="left" />
|
||||
<!-- 创建日期作为第一列,支持排序 -->
|
||||
<el-table-column
|
||||
label="创建日期"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
fixed="left"
|
||||
sortable="custom"
|
||||
sort-by="createTime"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耳号" align="center" prop="eweManageTags" width="120" />
|
||||
<el-table-column label="品种" align="center" prop="eweVariety" width="100" />
|
||||
<el-table-column label="事件类型" align="center" width="100">
|
||||
<template #default="scope">
|
||||
@ -135,7 +155,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="配种公羊" align="center" prop="ramManageTags" width="120" />
|
||||
<el-table-column label="配种公羊品种" align="center" prop="ramVariety" width="120" />
|
||||
<el-table-column label="配种方式" align="center" prop="matingType" width="100" />
|
||||
<el-table-column label="配种方式" align="center" prop="matingType" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ getBreedTypeText(scope.row.breedType) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="月龄" align="center" prop="eweMonthAge" width="80" />
|
||||
<el-table-column label="配种时羊只类别" align="center" prop="sheepType" width="120" />
|
||||
<el-table-column label="胎次" align="center" prop="eweParity" width="80" />
|
||||
@ -197,11 +221,6 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="创建人" align="center" prop="createBy" width="100" />
|
||||
<el-table-column label="创建日期" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所在牧场" align="center" prop="ranchName" width="120" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160" fixed="right">
|
||||
<template #default="scope">
|
||||
@ -366,9 +385,17 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Breeding_records">
|
||||
import { listBreeding_records, getBreeding_records, delBreeding_records, addBreeding_records, updateBreeding_records, getSheepInfoByTags, getLatestBreedPlanByEweTags } from "@/api/Breeding_records/Breeding_records"
|
||||
import {
|
||||
listBreeding_records,
|
||||
getBreeding_records,
|
||||
delBreeding_records,
|
||||
addBreeding_records,
|
||||
updateBreeding_records,
|
||||
getSheepInfoByTags,
|
||||
getLatestBreedPlanByEweTags
|
||||
} from "@/api/Breeding_records/Breeding_records"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const {proxy} = getCurrentInstance()
|
||||
|
||||
const Breeding_recordsList = ref([])
|
||||
const open = ref(false)
|
||||
@ -398,25 +425,43 @@ const data = reactive({
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
pregnancyResult: null,
|
||||
isPregnancyChecked: null
|
||||
isPregnancyChecked: null,
|
||||
// 添加排序参数
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc'
|
||||
},
|
||||
rules: {
|
||||
eweManageTags: [
|
||||
{ required: true, message: "母羊耳号不能为空", trigger: "blur" }
|
||||
{required: true, message: "母羊耳号不能为空", trigger: "blur"}
|
||||
],
|
||||
ramManageTags: [
|
||||
{ required: true, message: "公羊耳号不能为空", trigger: "blur" }
|
||||
{required: true, message: "公羊耳号不能为空", trigger: "blur"}
|
||||
],
|
||||
technician: [
|
||||
{ required: true, message: "技术员不能为空", trigger: "blur" }
|
||||
{required: true, message: "技术员不能为空", trigger: "blur"}
|
||||
],
|
||||
breedType: [
|
||||
{ required: true, message: "配种方式不能为空", trigger: "change" }
|
||||
{required: true, message: "配种方式不能为空", trigger: "change"}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const {queryParams, form, rules} = toRefs(data)
|
||||
|
||||
/** 获取配种方式文字显示 */
|
||||
function getBreedTypeText(breedType) {
|
||||
if (breedType === 1) return '同期发情'
|
||||
if (breedType === 2) return '本交'
|
||||
return '-'
|
||||
}
|
||||
|
||||
/** 获取孕检结果标签类型 */
|
||||
function getPregnancyResultType(result) {
|
||||
if (result === '怀孕') return 'success'
|
||||
if (result === '空怀') return 'danger'
|
||||
if (result === '疑似怀孕') return 'warning'
|
||||
return 'info'
|
||||
}
|
||||
|
||||
/** 查询配种记录列表 */
|
||||
function getList() {
|
||||
@ -428,6 +473,13 @@ function getList() {
|
||||
})
|
||||
}
|
||||
|
||||
// 表格排序变化处理
|
||||
function handleSortChange({column, prop, order}) {
|
||||
queryParams.value.orderByColumn = prop
|
||||
queryParams.value.isAsc = order === 'ascending' ? 'asc' : 'desc'
|
||||
getList()
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
@ -584,12 +636,13 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除配种记录编号为"' + _ids + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除配种记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delBreeding_records(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
@ -599,33 +652,12 @@ function handleExport() {
|
||||
}, `配种记录_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
/** 获取孕检结果类型 */
|
||||
function getPregnancyResultType(result) {
|
||||
if (result === '怀孕') {
|
||||
return 'success'
|
||||
} else if (result === '空怀') {
|
||||
return 'danger'
|
||||
} else if (result === '疑似怀孕') {
|
||||
return 'warning'
|
||||
} else {
|
||||
return 'info'
|
||||
}
|
||||
}
|
||||
|
||||
getList()
|
||||
// 页面初始化
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-table {
|
||||
font-size: 13px;
|
||||
}
|
||||
.el-table .cell {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.el-divider {
|
||||
margin: 16px 0;
|
||||
}
|
||||
.el-divider--horizontal {
|
||||
margin: 16px 0;
|
||||
}
|
||||
/* 样式保持不变 */
|
||||
</style>
|
||||
@ -89,6 +89,12 @@
|
||||
|
||||
<el-table v-loading="loading" :data="Pregnancy_TestList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 日期作为第一列 -->
|
||||
<el-table-column label="孕检日期" align="center" prop="datetime" width="120" fixed="left">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耳号" align="center" prop="manageTags" width="120" />
|
||||
<el-table-column label="品种" align="center" prop="variety" width="100" />
|
||||
<el-table-column label="事件类型" align="center" width="80">
|
||||
@ -96,11 +102,6 @@
|
||||
<span>孕检</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="孕检日期" align="center" prop="datetime" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="孕检结果" align="center" prop="result" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getResultTagType(scope.row.result)">
|
||||
|
||||
@ -75,10 +75,6 @@
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
@ -125,14 +121,15 @@
|
||||
|
||||
<el-table v-loading="loading" :data="SpermList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="耳号" align="center" prop="manageTags" width="120" />
|
||||
<el-table-column label="电子耳号" align="center" prop="electronicTags" width="120" />
|
||||
<el-table-column label="月龄" align="center" prop="monthAge" width="80" />
|
||||
<el-table-column label="采精日期" align="center" prop="pickDate" width="120">
|
||||
<!-- 日期作为第一列 -->
|
||||
<el-table-column label="采精日期" align="center" prop="pickDate" width="120" fixed="left">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.pickDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耳号" align="center" prop="manageTags" width="120" />
|
||||
<el-table-column label="电子耳号" align="center" prop="electronicTags" width="120" />
|
||||
<el-table-column label="月龄" align="center" prop="monthAge" width="80" />
|
||||
<el-table-column label="采精量(ml)" align="center" prop="amount" width="100" />
|
||||
<el-table-column label="精液密度" align="center" prop="density" width="100" />
|
||||
<el-table-column label="精液活力" align="center" prop="vitallity" width="100" />
|
||||
@ -258,9 +255,9 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Sperm">
|
||||
import { listSperm, getSperm, delSperm, addSperm, updateSperm } from "@/api/Sperm/Sperm"
|
||||
import {listSperm, getSperm, delSperm, addSperm, updateSperm} from "@/api/Sperm/Sperm"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const {proxy} = getCurrentInstance()
|
||||
|
||||
const SpermList = ref([])
|
||||
const open = ref(false)
|
||||
@ -292,18 +289,18 @@ const data = reactive({
|
||||
},
|
||||
rules: {
|
||||
manageTags: [
|
||||
{ required: true, message: "耳号不能为空", trigger: "blur" }
|
||||
{required: true, message: "耳号不能为空", trigger: "blur"}
|
||||
],
|
||||
pickDate: [
|
||||
{ required: true, message: "采精日期不能为空", trigger: "blur" }
|
||||
{required: true, message: "采精日期不能为空", trigger: "blur"}
|
||||
],
|
||||
amount: [
|
||||
{ required: true, message: "采精量不能为空", trigger: "blur" }
|
||||
{required: true, message: "采精量不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const {queryParams, form, rules} = toRefs(data)
|
||||
|
||||
/** 查询采精记录列表 */
|
||||
function getList() {
|
||||
@ -404,12 +401,13 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除采精记录编号为"' + _ids + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除采精记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delSperm(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@ -130,14 +130,15 @@
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="weaning_recordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="耳号" align="center" prop="earNumber" width="100" />
|
||||
<el-table-column label="品种" align="center" prop="breed" width="100" />
|
||||
<el-table-column label="事件类型" align="center" prop="eventType" width="100" />
|
||||
<el-table-column label="断奶日期" align="center" prop="datetime" width="120">
|
||||
<!-- 日期作为第一列 -->
|
||||
<el-table-column label="断奶日期" align="center" prop="datetime" width="120" fixed="left">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耳号" align="center" prop="earNumber" width="100" />
|
||||
<el-table-column label="品种" align="center" prop="breed" width="100" />
|
||||
<el-table-column label="事件类型" align="center" prop="eventType" width="100" />
|
||||
<el-table-column label="性别" align="center" prop="gender" width="80" />
|
||||
<el-table-column label="父号" align="center" prop="fatherNumber" width="100" />
|
||||
<el-table-column label="母号" align="center" prop="motherNumber" width="100" />
|
||||
|
||||
@ -303,6 +303,7 @@ function reset() {
|
||||
id: null,
|
||||
treatId: null,
|
||||
sheepId: null,
|
||||
sheepNo: null,
|
||||
datetime: null,
|
||||
sheepType: null,
|
||||
gender: null,
|
||||
|
||||
@ -471,7 +471,7 @@ function handleDelete(row) {
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/disinfect/export', { ...queryParams }, `disinfect_${Date.now()}.xlsx`)
|
||||
proxy.download('biosafety/disinfect/export', { ...queryParams }, `消毒_${Date.now()}.xlsx`)
|
||||
}
|
||||
|
||||
/* ---------- 下拉数据 ---------- */
|
||||
|
||||
@ -490,7 +490,7 @@ function handleDelete(row) {
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/deworm/export', { ...queryParams }, `deworm_${Date.now()}.xlsx`)
|
||||
proxy.download('biosafety/health/export', { ...queryParams }, `保健_${Date.now()}.xlsx`)
|
||||
}
|
||||
|
||||
/* ------------------ 药品/处方/下拉 ------------------ */
|
||||
|
||||
@ -489,7 +489,7 @@ function handleDelete(row) {
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/deworm/export', { ...queryParams }, `deworm_${Date.now()}.xlsx`)
|
||||
proxy.download('biosafety/immunity/export', { ...queryParams }, `免疫_${Date.now()}.xlsx`)
|
||||
}
|
||||
|
||||
/* ------------------ 药品/处方/下拉 ------------------ */
|
||||
|
||||
@ -238,7 +238,7 @@ function handleDelete(row) {
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download('system/medicine/export', { ...queryParams.value }, `medicine_${new Date().getTime()}.xlsx`)
|
||||
proxy.download('system/medicine/export', { ...queryParams.value }, `药品_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@ -220,7 +220,7 @@ function handleDelete(row) {
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/type/export', {
|
||||
...queryParams.value
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
}, `药品类型_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@ -180,7 +180,7 @@ function handleDelete(row) {
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/unit/export', {
|
||||
...queryParams.value
|
||||
}, `unit_${new Date().getTime()}.xlsx`)
|
||||
}, `药品计量单位_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@ -220,7 +220,7 @@ function handleDelete(row) {
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/usage/export', {
|
||||
...queryParams.value
|
||||
}, `usage_${new Date().getTime()}.xlsx`)
|
||||
}, `药品使用方法_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@ -504,7 +504,7 @@ function cancel() {
|
||||
* 调用后端通用导出接口,文件名带时间戳
|
||||
*/
|
||||
function handleExport() {
|
||||
proxy.download('biosafety/prescription/export', { ...queryParams.value }, `prescription_${Date.now()}.xlsx`)
|
||||
proxy.download('biosafety/prescription/export', { ...queryParams.value }, `处方_${Date.now()}.xlsx`)
|
||||
}
|
||||
|
||||
// 初始化:加载列表
|
||||
|
||||
@ -527,9 +527,9 @@ function handleDelete(row) {
|
||||
/* 导出 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'bisosafety/quarantine/export',
|
||||
'/biosafety/quarantine/export',
|
||||
queryParams,
|
||||
`quarantine_${Date.now()}.xlsx`
|
||||
`检疫_${Date.now()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -729,7 +729,7 @@ function handleDelete(row) {
|
||||
.then(() => { getList(); proxy.$modal.msgSuccess('删除成功') })
|
||||
}
|
||||
function handleExport() {
|
||||
proxy.download('treatment/treatment/export', { ...queryParams }, `treatment_${Date.now()}.xlsx`)
|
||||
proxy.download('treatment/treatment/export', { ...queryParams }, `治疗记录_${Date.now()}.xlsx`)
|
||||
}
|
||||
function resetForm(formObj) {
|
||||
Object.assign(formObj, {
|
||||
|
||||
@ -342,7 +342,7 @@ function handleExport() {
|
||||
proxy.download(
|
||||
'biosafety/usageInfo/export',
|
||||
{ ...queryParams.value },
|
||||
`usage_${new Date().getTime()}.xlsx`
|
||||
`药品使用记录_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -99,14 +99,15 @@
|
||||
|
||||
<el-table v-loading="loading" :data="drymilkList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="耳号" align="center" prop="manageTags" />
|
||||
<el-table-column label="品种" align="center" prop="variety" />
|
||||
<el-table-column label="事件类型" align="center" prop="eventType" />
|
||||
<el-table-column label="干奶日期" align="center" prop="datetime" width="180">
|
||||
<!-- 日期作为第一列 -->
|
||||
<el-table-column label="干奶日期" align="center" prop="datetime" width="180" fixed="left">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耳号" align="center" prop="manageTags" />
|
||||
<el-table-column label="品种" align="center" prop="variety" />
|
||||
<el-table-column label="事件类型" align="center" prop="eventType" />
|
||||
<el-table-column label="是否使用乳头封闭剂" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.status === 1 ? '是' : '否' }}</span>
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['feed:FeedList:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['feed:FeedList:edit']">修改</el-button>
|
||||
@ -49,11 +49,11 @@
|
||||
<span>{{ scope.row.rootPlan ? parseTime(scope.row.rootPlan.planDate, '{y}-{m}-{d}') : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配料日期" align="center" prop="deployDate" width="180">
|
||||
<!-- <el-table-column label="配料日期" align="center" prop="deployDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.deployDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)">详情</el-button>
|
||||
@ -75,11 +75,11 @@
|
||||
<el-form-item label="饲草班人员" prop="zookeeper">
|
||||
<el-input v-model="form.zookeeper" placeholder="请输入饲草班人员名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配料日期" prop="deployDate">
|
||||
<!-- <el-form-item label="配料日期" prop="deployDate">
|
||||
<el-date-picker clearable v-model="form.deployDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择配料日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@ -102,7 +102,7 @@
|
||||
|
||||
<el-divider content-position="left">配料列表</el-divider>
|
||||
|
||||
<el-table :data="showFeedList.formulaList" stripe border style="width: 100%" max-height="300">
|
||||
<el-table :data="showFeedList.rootFormula.sgFormulaList" stripe border style="width: 100%" max-height="300">
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<!-- <el-table-column label="原料编号" prop="materialId" align="center" /> -->
|
||||
<el-table-column label="原料" align="center">
|
||||
@ -186,6 +186,7 @@
|
||||
openModel.value = "view"
|
||||
title.value = "配料清单详情"
|
||||
console.log("查看配料清单", row)
|
||||
console.log("HandView", showFeedList.value)
|
||||
}
|
||||
|
||||
/** 查询配料清单列表 */
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
<el-table v-loading="loading" :data="FeedStatisticList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="UUID" align="center" prop="id" />
|
||||
<el-table-column label="UID" align="center" prop="id" />
|
||||
<el-table-column label="配方编号" align="center" prop="formulaId" />
|
||||
<el-table-column label="配方批号" align="center" prop="formulaBatchId" />
|
||||
<el-table-column label="羊只数量" align="center" prop="sheepFoldCount" />
|
||||
@ -93,7 +93,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日期" prop="planDate">
|
||||
<el-date-picker clearable v-model="showFeedStatistic.feedDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择时间">
|
||||
placeholder="请选择时间" @change="handleDeployDateChange(showFeedStatistic, $event)">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -102,7 +102,11 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Plus" @click="handleAddMaterial()">添加</el-button>
|
||||
<el-button type="primary" icon="Plus" @click="handleAddMaterial()"
|
||||
:disabled="
|
||||
showFeedStatistic.feedDate == null
|
||||
|| showFeedStatistic.formulaId === null
|
||||
|| showFeedStatistic.formulaBatchId == null">添加</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
@ -152,7 +156,11 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Plus" @click="handleAddSheep()">添加</el-button>
|
||||
<el-button type="primary" icon="Plus" @click="handleAddSheep()"
|
||||
:disabled ="
|
||||
showFeedStatistic.feedDate == null
|
||||
|| showFeedStatistic.formulaId == null
|
||||
|| showFeedStatistic.formulaBatchId == null">添加</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-table :data="showFeedStatistic.sheepFoldList" :rules="rules"
|
||||
@ -231,6 +239,7 @@
|
||||
const openModel = ref('')
|
||||
// 编辑状态
|
||||
const isEdit = ref(true)
|
||||
|
||||
const showFeedStatistic = ref({})
|
||||
|
||||
// 用于存储羊舍名称的字典
|
||||
@ -362,9 +371,10 @@
|
||||
|
||||
// 处理配方批号变化 & 当确定批号时加载初始数据
|
||||
function handleFormulaBatchIdChange(row, $event) {
|
||||
if (row.formulaId && row.formulaBatchId) {
|
||||
if (row.formulaId && row.formulaBatchId && row.feedDate) {
|
||||
queryParams.value.formulaId = row.formulaId
|
||||
queryParams.value.formulaBatchId = row.formulaBatchId
|
||||
queryParams.value.feedDate = row.feedDate
|
||||
queryParams.value.id = null // 清空 ID,防止影响查询
|
||||
// console.log("加载初始数据,查询参数:", queryParams.value)
|
||||
initFeedStatistic(queryParams.value).then(response => {
|
||||
@ -374,6 +384,13 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function handleDeployDateChange(showFeedStatistic, event) {
|
||||
// 日期改变时回调
|
||||
if (showFeedStatistic.feedDate) {
|
||||
handleFormulaBatchIdChange(showFeedStatistic, event);
|
||||
}
|
||||
}
|
||||
// 查看详情
|
||||
function handleMaterialView(row) {
|
||||
showFeedStatistic.value = row
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
<el-form-item label="饲养阶段" prop="feedStage">
|
||||
<el-input v-model="queryParams.feedStage" placeholder="请输入饲养阶段" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批号" prop="batchId">
|
||||
<!-- <el-form-item label="批号" prop="batchId">
|
||||
<el-input v-model="queryParams.batchId" placeholder="请输入批号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
|
||||
@ -93,6 +93,12 @@
|
||||
|
||||
<el-table v-loading="loading" :data="miscarriageList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 日期作为第一列 -->
|
||||
<el-table-column label="流产日期" align="center" prop="datetime" width="100" fixed="left">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耳号" align="center" prop="bsManageTags" />
|
||||
<el-table-column label="品种" align="center" prop="variety" />
|
||||
<el-table-column label="事件类型" align="center">
|
||||
@ -100,11 +106,6 @@
|
||||
<span>流产</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流产日期" align="center" prop="datetime" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流产原因" align="center" prop="reason" />
|
||||
<el-table-column label="配种类型" align="center" prop="matingTypeName" />
|
||||
<el-table-column label="配种日期" align="center" prop="matingDate" width="100">
|
||||
@ -244,9 +245,17 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Miscarriage">
|
||||
import { listMiscarriage, getMiscarriage, delMiscarriage, addMiscarriage, updateMiscarriage, getSheepInfo, getReasonOptions } from "@/api/miscarriage/miscarriage"
|
||||
import {
|
||||
listMiscarriage,
|
||||
getMiscarriage,
|
||||
delMiscarriage,
|
||||
addMiscarriage,
|
||||
updateMiscarriage,
|
||||
getSheepInfo,
|
||||
getReasonOptions
|
||||
} from "@/api/miscarriage/miscarriage"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const {proxy} = getCurrentInstance()
|
||||
|
||||
const miscarriageList = ref([])
|
||||
const open = ref(false)
|
||||
@ -276,24 +285,24 @@ const data = reactive({
|
||||
},
|
||||
rules: {
|
||||
manageTags: [
|
||||
{ required: true, message: "耳号不能为空", trigger: "blur" }
|
||||
{required: true, message: "耳号不能为空", trigger: "blur"}
|
||||
],
|
||||
datetime: [
|
||||
{ required: true, message: "事件日期不能为空", trigger: "blur" }
|
||||
{required: true, message: "事件日期不能为空", trigger: "blur"}
|
||||
],
|
||||
reason: [
|
||||
{ required: true, message: "流产原因不能为空", trigger: "change" }
|
||||
{required: true, message: "流产原因不能为空", trigger: "change"}
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "是否列胎次不能为空", trigger: "change" }
|
||||
{required: true, message: "是否列胎次不能为空", trigger: "change"}
|
||||
],
|
||||
exposeType: [
|
||||
{ required: true, message: "是否见胎不能为空", trigger: "change" }
|
||||
{required: true, message: "是否见胎不能为空", trigger: "change"}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const {queryParams, form, rules} = toRefs(data)
|
||||
|
||||
/** 查询流产记录列表 */
|
||||
function getList() {
|
||||
@ -427,12 +436,13 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除流产记录编号为"' + _ids + '"的数据项?').then(function() {
|
||||
proxy.$modal.confirm('是否确认删除流产记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delMiscarriage(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@ -70,7 +70,8 @@
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['sheep_death:death:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -80,7 +81,8 @@
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['sheep_death:death:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -90,7 +92,8 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['sheep_death:death:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -99,52 +102,58 @@
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['sheep_death:death:export']"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deathList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" width="80" />
|
||||
<el-table-column label="管理耳号" align="center" prop="manageTags" width="120" />
|
||||
<el-table-column label="品种" align="center" prop="variety" width="100" />
|
||||
<el-table-column label="事件类型" align="center" prop="eventType" width="100" />
|
||||
<el-table-column label="死亡日期" align="center" prop="deathDate" width="120">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- 日期作为第一列 -->
|
||||
<el-table-column label="死亡日期" align="center" prop="deathDate" width="120" fixed="left">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.deathDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="死亡时羊只类别" align="center" prop="sheepType" width="130" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" width="80"/>
|
||||
<el-table-column label="管理耳号" align="center" prop="manageTags" width="120"/>
|
||||
<el-table-column label="品种" align="center" prop="variety" width="100"/>
|
||||
<el-table-column label="事件类型" align="center" prop="eventType" width="100"/>
|
||||
<el-table-column label="死亡时羊只类别" align="center" prop="sheepType" width="130"/>
|
||||
<el-table-column label="性别" align="center" prop="gender" width="80">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.gender === 1 ? '母' : scope.row.gender === 2 ? '公' : '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日龄" align="center" prop="dayAge" width="80" />
|
||||
<el-table-column label="胎次" align="center" prop="parity" width="80" />
|
||||
<el-table-column label="疾病类型ID" align="center" prop="diseaseTypeId" width="120" />
|
||||
<el-table-column label="疾病子类型ID" align="center" prop="diseaseSubtypeId" width="130" />
|
||||
<el-table-column label="死淘去向" align="center" prop="disposalDirection" width="100" />
|
||||
<el-table-column label="技术员" align="center" prop="technician" width="100" />
|
||||
<el-table-column label="处理人" align="center" prop="handler" width="100" />
|
||||
<el-table-column label="羊舍" align="center" prop="sheepfoldName" width="120" />
|
||||
<el-table-column label="班组" align="center" prop="workGroup" width="100" />
|
||||
<el-table-column label="繁育状态" align="center" prop="breedStatus" width="100" />
|
||||
<el-table-column label="死亡时产后天数" align="center" prop="postLambingDay" width="130" />
|
||||
<el-table-column label="死亡时泌乳天数" align="center" prop="lactationDay" width="130" />
|
||||
<el-table-column label="死亡时怀孕天数" align="center" prop="gestationDay" width="130" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" width="100" />
|
||||
<el-table-column label="日龄" align="center" prop="dayAge" width="80"/>
|
||||
<el-table-column label="胎次" align="center" prop="parity" width="80"/>
|
||||
<el-table-column label="疾病类型ID" align="center" prop="diseaseTypeId" width="120"/>
|
||||
<el-table-column label="疾病子类型ID" align="center" prop="diseaseSubtypeId" width="130"/>
|
||||
<el-table-column label="死淘去向" align="center" prop="disposalDirection" width="100"/>
|
||||
<el-table-column label="技术员" align="center" prop="technician" width="100"/>
|
||||
<el-table-column label="处理人" align="center" prop="handler" width="100"/>
|
||||
<el-table-column label="羊舍" align="center" prop="sheepfoldName" width="120"/>
|
||||
<el-table-column label="班组" align="center" prop="workGroup" width="100"/>
|
||||
<el-table-column label="繁育状态" align="center" prop="breedStatus" width="100"/>
|
||||
<el-table-column label="死亡时产后天数" align="center" prop="postLambingDay" width="130"/>
|
||||
<el-table-column label="死亡时泌乳天数" align="center" prop="lactationDay" width="130"/>
|
||||
<el-table-column label="死亡时怀孕天数" align="center" prop="gestationDay" width="130"/>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" width="100"/>
|
||||
<el-table-column label="创建日期" align="center" prop="createTime" width="120">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="comment" width="150" />
|
||||
<el-table-column label="备注" align="center" prop="comment" width="150"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['sheep_death:death:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['sheep_death:death:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['sheep_death:death:edit']">修改
|
||||
</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['sheep_death:death:remove']">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -183,17 +192,15 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="疾病类型ID" prop="diseaseTypeId">
|
||||
<el-input-number v-model="form.diseaseTypeId" placeholder="请输入疾病类型ID" :min="0" />
|
||||
<el-input-number v-model="form.diseaseTypeId" placeholder="请输入疾病类型ID" :min="0"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="疾病子类型ID" prop="diseaseSubtypeId">
|
||||
<el-input-number v-model="form.diseaseSubtypeId" placeholder="请输入疾病子类型ID" :min="0" />
|
||||
<el-input-number v-model="form.diseaseSubtypeId" placeholder="请输入疾病子类型ID" :min="0"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -202,14 +209,14 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="死淘去向" prop="disposalDirection">
|
||||
<el-select v-model="form.disposalDirection" placeholder="请选择死淘去向">
|
||||
<el-option label="深埋" value="深埋" />
|
||||
<el-option label="无害化" value="无害化" />
|
||||
<el-option label="深埋" value="深埋"/>
|
||||
<el-option label="无害化" value="无害化"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="技术员" prop="technician">
|
||||
<el-input v-model="form.technician" placeholder="请输入技术员" />
|
||||
<el-input v-model="form.technician" placeholder="请输入技术员"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -217,12 +224,12 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="处理人" prop="handler">
|
||||
<el-input v-model="form.handler" placeholder="请输入处理人" />
|
||||
<el-input v-model="form.handler" placeholder="请输入处理人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组" prop="workGroup">
|
||||
<el-input v-model="form.workGroup" placeholder="请输入班组" />
|
||||
<el-input v-model="form.workGroup" placeholder="请输入班组"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -230,7 +237,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="comment">
|
||||
<el-input v-model="form.comment" type="textarea" placeholder="请输入内容" />
|
||||
<el-input v-model="form.comment" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -2,7 +2,10 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="单据日期" prop="docDate">
|
||||
<el-input v-model="queryParams.docDate" placeholder="请输入单据日期" clearable @keyup.enter="handleQuery" />
|
||||
<!-- <el-input v-model="queryParams.docDate" placeholder="请输入单据日期" clearable @keyup.enter="handleQuery" /> -->
|
||||
<el-date-picker clearable v-model="queryParams.docDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择时间" @change="handleQuery">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="businessType">
|
||||
<el-input v-model="queryParams.businessType" placeholder="请输入业务类型" clearable @keyup.enter="handleQuery" />
|
||||
@ -20,8 +23,9 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" >
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stock:in:add']" v-show="false">新增</el-button>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stock:in:add']"
|
||||
v-show="false">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
@ -119,7 +123,7 @@
|
||||
<script setup name="In">
|
||||
import { listIn, getIn, delIn, addIn, updateIn } from "@/api/stock/in"
|
||||
import { getToken } from "@/utils/auth"
|
||||
import { isVisible } from "element-plus/es/utils/index.mjs"
|
||||
import { isVisible } from "element-plus/es/utils/index.mjs"
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const inList = ref([])
|
||||
|
||||
@ -2,20 +2,13 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="存货" prop="materialName">
|
||||
<el-input
|
||||
v-model="queryParams.materialName"
|
||||
placeholder="请输入存货"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入存货" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="productionDate">
|
||||
<el-input
|
||||
v-model="queryParams.productionDate"
|
||||
placeholder="请输入生产日期"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<!-- <el-input v-model="queryParams.productionDate" placeholder="请输入生产日期" clearable @keyup.enter="handleQuery" /> -->
|
||||
<el-date-picker clearable v-model="queryParams.productionDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请输入生产日期" @change="handleQuery">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
@ -25,45 +18,24 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['stock:management:add']"
|
||||
>新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['stock:management:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['stock:management:edit']"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['stock:management:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['stock:management:remove']"
|
||||
>删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['stock:management:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['stock:management:export']"
|
||||
>导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['stock:management:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport" v-hasPermi="['stock:management:import']">导入</el-button>
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport"
|
||||
v-hasPermi="['stock:management:import']">导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -83,19 +55,16 @@
|
||||
<el-table-column label="失效预警" align="center" prop="expirationAlarm" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['stock:management:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['stock:management:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['stock:management:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['stock:management:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改饲喂计划对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
@ -119,18 +88,12 @@
|
||||
<el-input v-model="form.currentStock" placeholder="请输入现存量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="productionDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.productionDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
<el-date-picker clearable v-model="form.productionDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择生产日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="失效日期" prop="expirationDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.expirationDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
<el-date-picker clearable v-model="form.expirationDate" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择失效日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@ -169,37 +132,37 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Management">
|
||||
import { listManagement, getManagement, delManagement, addManagement, updateManagement } from "@/api/stock/management"
|
||||
import { getToken } from "@/utils/auth"
|
||||
const { proxy } = getCurrentInstance()
|
||||
import { listManagement, getManagement, delManagement, addManagement, updateManagement } from "@/api/stock/management"
|
||||
import { getToken } from "@/utils/auth"
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const managementList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
const managementList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
materialName: null,
|
||||
productionDate: null,
|
||||
},
|
||||
rules: {
|
||||
materialId: [
|
||||
{ required: true, message: "存货编码不能为空", trigger: "blur" }
|
||||
],
|
||||
materialName: [
|
||||
{ required: true, message: "存货不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
})
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
materialName: null,
|
||||
productionDate: null,
|
||||
},
|
||||
rules: {
|
||||
materialId: [
|
||||
{ required: true, message: "存货编码不能为空", trigger: "blur" }
|
||||
],
|
||||
materialName: [
|
||||
{ required: true, message: "存货不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
})
|
||||
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
@ -228,129 +191,129 @@ const data = reactive({
|
||||
}
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true
|
||||
}
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false
|
||||
upload.isUploading = false
|
||||
proxy.$refs["uploadRef"].handleRemove(file)
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
getList()
|
||||
}
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询物资管理列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listManagement(queryParams.value).then(response => {
|
||||
managementList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
materialManagementCode: null,
|
||||
materialId: null,
|
||||
materialName: null,
|
||||
batchId: null,
|
||||
materialSpecification: null,
|
||||
materialUnit: null,
|
||||
currentStock: null,
|
||||
stockAlarm: null,
|
||||
productionDate: null,
|
||||
expirationDate: null,
|
||||
expirationAlarm: null
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true
|
||||
}
|
||||
proxy.resetForm("managementRef")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.materialManagementCode)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加物资管理"
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _materialManagementCode = row.materialManagementCode || ids.value
|
||||
getManagement(_materialManagementCode).then(response => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = "修改物资管理"
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["managementRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.materialManagementCode != null) {
|
||||
updateManagement(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addManagement(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _materialManagementCodes = row.materialManagementCode || ids.value
|
||||
proxy.$modal.confirm('是否确认删除物资管理编号为"' + _materialManagementCodes + '"的数据项?').then(function() {
|
||||
return delManagement(_materialManagementCodes)
|
||||
}).then(() => {
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false
|
||||
upload.isUploading = false
|
||||
proxy.$refs["uploadRef"].handleRemove(file)
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('stock/management/export', {
|
||||
...queryParams.value
|
||||
}, `management_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
/** 查询物资管理列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listManagement(queryParams.value).then(response => {
|
||||
managementList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
getList()
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
materialManagementCode: null,
|
||||
materialId: null,
|
||||
materialName: null,
|
||||
batchId: null,
|
||||
materialSpecification: null,
|
||||
materialUnit: null,
|
||||
currentStock: null,
|
||||
stockAlarm: null,
|
||||
productionDate: null,
|
||||
expirationDate: null,
|
||||
expirationAlarm: null
|
||||
}
|
||||
proxy.resetForm("managementRef")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.materialManagementCode)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加物资管理"
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _materialManagementCode = row.materialManagementCode || ids.value
|
||||
getManagement(_materialManagementCode).then(response => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = "修改物资管理"
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["managementRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.materialManagementCode != null) {
|
||||
updateManagement(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addManagement(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _materialManagementCodes = row.materialManagementCode || ids.value
|
||||
proxy.$modal.confirm('是否确认删除物资管理编号为"' + _materialManagementCodes + '"的数据项?').then(function () {
|
||||
return delManagement(_materialManagementCodes)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('stock/management/export', {
|
||||
...queryParams.value
|
||||
}, `management_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user