配种记录修改
This commit is contained in:
parent
e06f4a1d89
commit
cef7915037
@ -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("新增失败,请查看控制台")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user