配种记录修改

This commit is contained in:
zyk 2025-12-21 23:45:59 +08:00
parent e06f4a1d89
commit cef7915037

View File

@ -386,8 +386,15 @@
</template>
</el-dialog>
</div>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
<script setup name="Breeding_records">
import {
listBreeding_records,
@ -447,11 +454,15 @@ const data = reactive({
breedType: [
{required: true, message: "配种方式不能为空", trigger: "change"}
]
}
},
submitting: false
})
const {queryParams, form, rules} = toRefs(data)
/** 获取配种方式文字显示 */
function getBreedTypeText(breedType) {
if (breedType === 1) return '同期发情'
@ -489,6 +500,7 @@ function handleSortChange({column, prop, order}) {
//
function cancel() {
open.value = false
submitting.value = false
reset()
}
@ -618,6 +630,28 @@ function getRamInfoByTags() {
}
}
// /** */
// function submitForm() {
// proxy.$refs["Breeding_recordsRef"].validate(valid => {
// if (valid) {
// if (form.value.id != null) {
// updateBreeding_records(form.value).then(response => {
// proxy.$modal.msgSuccess("")
// open.value = false
// getList()
// })
// } else {
// addBreeding_records(form.value).then(response => {
// proxy.$modal.msgSuccess("")
// open.value = false
// getList()
// })
// }
// }
// })
// }
/** 提交按钮 */
/** 提交按钮 */
function submitForm() {
proxy.$refs["Breeding_recordsRef"].validate(valid => {
@ -627,12 +661,18 @@ function submitForm() {
proxy.$modal.msgSuccess("修改成功")
open.value = false
getList()
}).catch(error => {
console.error('修改失败:', error)
proxy.$modal.msgError("修改失败,请查看控制台")
})
} else {
addBreeding_records(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功")
open.value = false
getList()
}).catch(error => {
console.error('新增失败:', error)
proxy.$modal.msgError("新增失败,请查看控制台")
})
}
}