|
@@ -83,7 +83,10 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="状态">
|
|
|
<template v-slot="scope">
|
|
|
- <div v-for="item in $store.state['prductSheedStatus']" :key="item.value">
|
|
|
+ <div
|
|
|
+ v-for="item in $store.state['prductSheedStatus']"
|
|
|
+ :key="item.value"
|
|
|
+ >
|
|
|
<span v-if="item.value == scope.row['status']">{{ item.label }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -93,7 +96,7 @@
|
|
|
<el-row type="flex" justify="end" style="margin-top: 20px">
|
|
|
<el-col :span="14">
|
|
|
<el-button @click="toggleSelection()">取消选择</el-button>
|
|
|
- <el-button type="primary" plain @click="add">
|
|
|
+ <el-button type="primary" plain @click="create">
|
|
|
生成批次
|
|
|
<i class="el-icon-arrow-right el-icon--right"></i>
|
|
|
</el-button>
|
|
@@ -136,7 +139,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { reqBatchList, reqAddBatch, reqSeedEweSheepList } from "@/api/production.js";
|
|
|
+import {
|
|
|
+ reqBatchList,
|
|
|
+ reqAddBatch,
|
|
|
+ reqSeedEweSheepList
|
|
|
+} from "@/api/production.js";
|
|
|
|
|
|
const pageSize = 10;
|
|
|
const rules = {};
|
|
@@ -184,11 +191,11 @@ export default {
|
|
|
this.getBatchList();
|
|
|
// 获取批次管理列表
|
|
|
this.getSeedSheepList();
|
|
|
- // this.$message.success("成功11!");
|
|
|
if (res.errCode) {
|
|
|
this.$message.error(res.errMsg);
|
|
|
} else {
|
|
|
- this.$message.success("成功");
|
|
|
+ this.$message.success("生产批次成功!");
|
|
|
+ this.toggleSelection();
|
|
|
}
|
|
|
// 清空选项
|
|
|
this.toggleSelection();
|
|
@@ -196,7 +203,7 @@ export default {
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.log(err);
|
|
|
- this.$message.error("失败22!");
|
|
|
+ this.$message.error("生产批次失败!");
|
|
|
});
|
|
|
} else {
|
|
|
return false;
|
|
@@ -240,14 +247,16 @@ export default {
|
|
|
toggleSelection(rows) {
|
|
|
if (rows) {
|
|
|
rows.forEach(row => {
|
|
|
- this.$refs.multipleTableCreateBatch.toggleRowSelection(row);
|
|
|
+ this.$refs["multipleTableCreateBatch"].toggleRowSelection(
|
|
|
+ row
|
|
|
+ );
|
|
|
});
|
|
|
} else {
|
|
|
- this.$refs.multipleTableCreateBatch.clearSelection();
|
|
|
+ this.$refs["multipleTableCreateBatch"].clearSelection();
|
|
|
}
|
|
|
},
|
|
|
// 创建批次
|
|
|
- add() {
|
|
|
+ create() {
|
|
|
if (this.multipleSelection.length <= 0) {
|
|
|
this.$message.warning("请选择羊");
|
|
|
return;
|
|
@@ -263,13 +272,11 @@ export default {
|
|
|
this.btnFlag = v;
|
|
|
},
|
|
|
pageChange(p) {
|
|
|
- console.log(p);
|
|
|
this.pageNum = p;
|
|
|
// 批次列表
|
|
|
this.getBatchList();
|
|
|
},
|
|
|
pageChange_2(p) {
|
|
|
- console.log(p);
|
|
|
this.pageNum_2 = p;
|
|
|
// 获取批次管理列表
|
|
|
this.getSeedSheepList();
|