|
@@ -1,33 +1,36 @@
|
|
|
<template>
|
|
|
- <!-- 静态 免疫程序 immuneProce-->
|
|
|
- <div class="immuneProce">
|
|
|
+ <div class="ImmuneProce">
|
|
|
<h2 style="margin-bottom: 20px;padding-bottom:7px;border-bottom:2px solid #ddd">免疫程序</h2>
|
|
|
<header id="header">
|
|
|
-
|
|
|
- <el-row type="flex">
|
|
|
+ <el-row type="flex" :gutter="20">
|
|
|
<el-col :span="4">
|
|
|
- <el-select v-model="value" placeholder="请选择">
|
|
|
- <el-option label="1区" value="11"></el-option>
|
|
|
- <el-option label="2区" value="22"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-input v-model="search" placeholder="请选择"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-select v-model="value" placeholder="请选择">
|
|
|
- <el-option label="1舍" value="13"></el-option>
|
|
|
- <el-option label="2舍" value="24"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-button type="primary" @click="getImmuneProceList">查找</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-select v-model="value" placeholder="请选择">
|
|
|
- <el-option label="可用" value="15"></el-option>
|
|
|
- <el-option label="可用" value="26"></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-button type="primary" @click="add">新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">查找</el-button>
|
|
|
+ <el-select v-model="formData.vaccineStyle" @change="S_change" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in $store.state['vaccineStyle']"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">新增</el-button>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button
|
|
|
+ v-for="item in $store.state['sheepType']"
|
|
|
+ :key="item.value"
|
|
|
+ :type="formData.target==item.value?'primary':''"
|
|
|
+ @click="onTargetType(item.value)"
|
|
|
+ >{{ item.label }}</el-button>
|
|
|
+ </el-button-group>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</header>
|
|
@@ -38,30 +41,36 @@
|
|
|
:data="tableData"
|
|
|
tooltip-effect="dark"
|
|
|
style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column prop="a" label="屠宰批次"></el-table-column>
|
|
|
- <el-table-column prop="b" label="产品名称"></el-table-column>
|
|
|
- <el-table-column prop="c" label="排酸时间"></el-table-column>
|
|
|
- <el-table-column prop="d" label="排酸前重量"></el-table-column>
|
|
|
- <el-table-column prop="e" label="排酸后重量"></el-table-column>
|
|
|
- <el-table-column prop="f" label="排酸损耗"></el-table-column>
|
|
|
- <el-table-column prop="g" label="负责人员"></el-table-column>
|
|
|
- <!-- <el-table-column label="操作" width="150">
|
|
|
+ <el-table-column prop="id" label="序号" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="vaccineName" label="疫苗名称"></el-table-column>
|
|
|
+ <el-table-column prop="disease" label="疫病种类"></el-table-column>
|
|
|
+ <el-table-column prop="vaccineTime" label="免疫时间"></el-table-column>
|
|
|
+ <el-table-column label="免疫类型">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div v-for="item in $store.state['vaccineStyle']" :key="item.value">
|
|
|
+ <span
|
|
|
+ v-if="item.value == scope.row['vaccineStyle']"
|
|
|
+ >{{ item.label }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="免疫剂量">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div>{{ scope.row.vaccineDosage + scope.row.unit}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="bodyPart" label="注射部位"></el-table-column>
|
|
|
+ <el-table-column prop="remark" label="备注"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
|
|
|
<el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
|
|
|
<el-button slot="reference" type="text" size="small">删除</el-button>
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
- <div style="margin-top: 20px">
|
|
|
- <el-button @click="toggleSelection([tableData[1], tableData[2]])">切换第二、第三行的选中状态</el-button>
|
|
|
- <el-button @click="toggleSelection()">取消选择</el-button>
|
|
|
- <el-button @click="inStore">入待宰栏</el-button>
|
|
|
- </div>
|
|
|
|
|
|
<el-row type="flex" justify="end">
|
|
|
<el-col :span="8" class="pagination">
|
|
@@ -69,97 +78,210 @@
|
|
|
@current-change="pageChange"
|
|
|
background
|
|
|
layout="prev, pager, next"
|
|
|
- :page-count="10"
|
|
|
+ :page-count="Number(totalPages)"
|
|
|
></el-pagination>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</article>
|
|
|
</section>
|
|
|
+
|
|
|
+ <el-dialog title="新增/编辑" :visible.sync="isShow" width="40%">
|
|
|
+ <el-row type="flex">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-form
|
|
|
+ ref="addImmuneProce"
|
|
|
+ :model="formData"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="140px"
|
|
|
+ >
|
|
|
+ <el-form-item label="免疫类型">
|
|
|
+ <el-radio-group v-model="formData.vaccineStyle">
|
|
|
+ <el-radio
|
|
|
+ v-for="item in $store.state['vaccineStyle']"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ >{{ item.label }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="羊类型">
|
|
|
+ <el-checkbox-group v-model="formData.sheepTypeArr">
|
|
|
+ <el-checkbox
|
|
|
+ v-for="item in $store.state['sheepType']"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ >{{ item.label }}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="目标羊编号">
|
|
|
+ <el-input v-model="formData.target"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="免疫时间">
|
|
|
+ <el-input v-model="formData.vaccineTime"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="免疫剂量及单位">
|
|
|
+ <el-row type="flex" :gutter="20">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-input v-model="formData.vaccineDosage"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-input v-model="formData.unit"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="注射部位">
|
|
|
+ <el-input v-model="formData.bodyPart"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input type="textarea" v-model="formData.remark"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="isShow=false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('addImmuneProce')">保 存</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import {
|
|
|
+ reqImmuneProceList,
|
|
|
+ reqAddOrUpdateImmuneProce,
|
|
|
+ reqDelImmuneProce
|
|
|
+} from "@/api/antiepidemic.js";
|
|
|
|
|
|
-const pageSize = 10
|
|
|
-const tableData = [
|
|
|
- {
|
|
|
- a: "15463",
|
|
|
- b: "胴体",
|
|
|
- c: "2020-07-14",
|
|
|
- d: "49kg",
|
|
|
- e: "48kg",
|
|
|
- f: "1.6%",
|
|
|
- g: "张小刚",
|
|
|
- },
|
|
|
- {
|
|
|
- a: "15463",
|
|
|
- b: "带骨羊前腿",
|
|
|
- c: "2020-07-14",
|
|
|
- d: "49kg",
|
|
|
- e: "48kg",
|
|
|
- f: "1.6%",
|
|
|
- g: "张小刚",
|
|
|
- },
|
|
|
- {
|
|
|
- a: "15463",
|
|
|
- b: "羔羊肉卷",
|
|
|
- c: "2020-07-14",
|
|
|
- d: "49kg",
|
|
|
- e: "48kg",
|
|
|
- f: "1.6%",
|
|
|
- g: "张小刚",
|
|
|
- },
|
|
|
- {
|
|
|
- a: "15463",
|
|
|
- b: "胴体",
|
|
|
- c: "2020-07-14",
|
|
|
- d: "49kg",
|
|
|
- e: "48kg",
|
|
|
- f: "1.6%",
|
|
|
- g: "张小刚",
|
|
|
- },
|
|
|
- {
|
|
|
- a: "15463",
|
|
|
- b: "羔羊肉卷",
|
|
|
- c: "2020-07-14",
|
|
|
- d: "49kg",
|
|
|
- e: "48kg",
|
|
|
- f: "1.6%",
|
|
|
- g: "张小刚",
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- ]
|
|
|
+const pageSize = 10;
|
|
|
+const rules = {};
|
|
|
|
|
|
export default {
|
|
|
+ name: "ImmuneProce",
|
|
|
data() {
|
|
|
return {
|
|
|
- value: "",
|
|
|
- multipleSelection: [],
|
|
|
- page: 1,
|
|
|
- tableData
|
|
|
+ search: "",
|
|
|
+ pageNum: 1,
|
|
|
+ tableData: [],
|
|
|
+ totalPages: 0,
|
|
|
+ isShow: false,
|
|
|
+ formData: {
|
|
|
+ vaccineStyle: this.$store.state["vaccineStyle"][1].value,
|
|
|
+ sheepTypeArr: [this.$store.state["vaccineStyle"][1].value],
|
|
|
+ target: this.$store.state["sheepType"][0].value,
|
|
|
+ vaccineName: "山羊口疮弱毒细胞冻干苗",
|
|
|
+ disease: "山羊口疮",
|
|
|
+ vaccineTime: "怀孕母羊分娩前20-30天和10-20天各注射1次",
|
|
|
+ vaccineDosage: "2",
|
|
|
+ unit: "ml",
|
|
|
+ bodyPart: "注射部位",
|
|
|
+ remark: "备注"
|
|
|
+ },
|
|
|
+ isAdd: false,
|
|
|
+ rules
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ // 免疫程序列表
|
|
|
+ this.getImmuneProceList();
|
|
|
+ },
|
|
|
methods: {
|
|
|
- toggleSelection(rows) {
|
|
|
- if (rows) {
|
|
|
- rows.forEach(row => {
|
|
|
- this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
+ submitForm(formName) {
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.formData.sheepType = this.formData.sheepTypeArr.reduce(
|
|
|
+ (total, num) => {
|
|
|
+ return total + num;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ console.log(this.formData.sheepType);
|
|
|
+ reqAddOrUpdateImmuneProce(this.formData)
|
|
|
+ .then(res => {
|
|
|
+ // 免疫程序列表
|
|
|
+ this.getImmuneProceList();
|
|
|
+ this.$message.success("成功!");
|
|
|
+ // this.isShow = false
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("失败!");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 点击按钮组
|
|
|
+ onTargetType(target) {
|
|
|
+ this.formData.target = target;
|
|
|
+ this.formData.sheepTypeArr = [target];
|
|
|
+ this.getImmuneProceList();
|
|
|
+ },
|
|
|
+ // 下拉选择框改变
|
|
|
+ S_change() {
|
|
|
+ this.getImmuneProceList();
|
|
|
+ },
|
|
|
+ // 免疫程序列表
|
|
|
+ getImmuneProceList() {
|
|
|
+ reqImmuneProceList({
|
|
|
+ searchStr: this.search,
|
|
|
+ pageSize,
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ vaccineStyle: this.formData.vaccineStyle,
|
|
|
+ target: this.formData.target
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.tableData = res.content;
|
|
|
+ this.totalPages = res.totalPages;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
});
|
|
|
- } else {
|
|
|
- this.$refs.multipleTable.clearSelection();
|
|
|
- }
|
|
|
},
|
|
|
- // 入待宰栏
|
|
|
- inStore() {},
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val;
|
|
|
+ add() {
|
|
|
+ this.isShow = true;
|
|
|
+ // 有id是update 没id是add
|
|
|
+ delete this.formData.id;
|
|
|
+ },
|
|
|
+ edit(row) {
|
|
|
+ // 数据回填
|
|
|
+ console.log(row.target);
|
|
|
+ this.formData = row;
|
|
|
+ let temp = this.$store.state["sheepType"].map(item => {
|
|
|
+ if((row.target & item.value) == item.value) return item.value
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.formData.sheepTypeArr = temp;
|
|
|
+ this.isShow = true;
|
|
|
+ },
|
|
|
+ del(row) {
|
|
|
+ reqDelImmuneProce(row.id)
|
|
|
+ .then(res => {
|
|
|
+ // 免疫程序列表
|
|
|
+ this.getImmuneProceList();
|
|
|
+ if (res.code == "success") {
|
|
|
+ this.$message.success(res.msg);
|
|
|
+ }
|
|
|
+ if (res.errCode == "delete failed") {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("删除失败!");
|
|
|
+ });
|
|
|
},
|
|
|
- edit(row) {},
|
|
|
- del(row) {},
|
|
|
pageChange(p) {
|
|
|
console.log(p);
|
|
|
+ this.pageNum = p;
|
|
|
+ // 免疫程序列表
|
|
|
+ this.getImmuneProceList();
|
|
|
}
|
|
|
}
|
|
|
};
|