123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497 |
- <template>
- <div class="app-container">
- <el-tabs v-model="activeName" @tab-click="handleTabClick">
- <el-tab-pane label="体况、粪便评分标准" name="first">
- <div class="operation">
- <el-button class="import" style="float: right;" @click="handleImport">导入</el-button>
- <el-button class="export" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
- </div>
- <div class="table1">
- <el-table
- :key="table1.tableKey"
- v-loading="table1.listLoading"
- element-loading-text="给我一点时间"
- :data="table1.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (table1.pageNum-1) * table1.pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配方名称" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="体况评分标准" align="center" min-width="300px">
- <el-table-column label="体况评分标准(分)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数据来源" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column label="粪便评分标准" align="center" min-width="300px">
- <el-table-column label="粪便评分标准(分)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数据来源" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-tab-pane>
- <el-tab-pane label="宾州筛、粪便筛标准范围" name="second">
- <div class="operation">
- <el-button class="import" style="float: right;" @click="handleImport">导入</el-button>
- <el-button class="export" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
- </div>
- <div class="table2">
- <el-table
- :key="table2.tableKey"
- v-loading="table2.listLoading"
- element-loading-text="给我一点时间"
- :data="table2.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (table2.pageNum-1) * table2.pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牲畜类别" align="center" min-width="200px">
- <el-table-column label="牲畜父类" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牲畜子类" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column label="宾州筛" align="center" min-width="200px">
- <el-table-column label="宾州筛一层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="宾州筛二层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="宾州筛三层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="宾州筛四层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数据来源" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column label="粪便筛" align="center" min-width="300px">
- <el-table-column label="粪便筛一层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="粪便筛二层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="粪便筛三层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="粪便筛四层(%)" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="数据来源" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button class="miniSuccess" @click="handleUpdate(row)">编辑</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-tab-pane>
- </el-tabs>
- <!-- 体况、粪便评分标准 -->
- <el-dialog :title="textMap[table1.dialogStatus]" :visible.sync="table1.dialogFormVisible" :close-on-click-modal="false" width="80%">
- <div class="app-add">
- <el-form ref="temp" :rules="table2.rules" :model="table2.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
- <el-row>
- <el-col :span="12">
- <h3 style="width: 160px;float: left;">配方</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="配方名称:" prop="location">
- <span>{{ table1.temp.location }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <h3 style="width: 160px;float: left;">体况评分标准</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="体况评分标准(分):" prop="location">
- <el-select v-model="table1.temp.location" placeholder="评分标准" class="filter-item" style="width: 100%;">
- <el-option v-for="item in physicalList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="数据来源:" prop="location">
- <el-input v-model="table1.temp.brandName" type="textarea" placeholder="1-255字符":autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <h3 style="width: 160px;float: left;">粪便评分标准</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="粪便评分标准(分):" prop="location">
- <el-select v-model="table1.temp.location" placeholder="评分标准" class="filter-item" style="width: 100%;">
- <el-option v-for="item in physicalList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="数据来源:" prop="location">
- <el-input v-model="table1.temp.brandName" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button class="cancel" @click="table1.dialogFormVisible = false; ">关闭</el-button>
- <el-button class="success" :disabled="isokDisable" @click="updateData()">确认</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 宾州筛、粪便筛标准范围 -->
- <el-dialog :title="textMap[table2.dialogStatus]" :visible.sync="table2.dialogFormVisible" :close-on-click-modal="false" width="80%">
- <div class="app-add">
- <el-form ref="temp" :rules="table2.rules" :model="table2.temp" label-position="right" label-width="160px" style="width: 90%;margin:0 auto 50px">
- <el-row>
- <el-col :span="8">
- <h3 style="width: 160px;float: left;">牲畜类别</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="牲畜父类:" prop="location">
- <span>{{ table2.temp.location }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牲畜子类:" prop="location">
- <span>{{ table2.temp.location }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <h3 style="width: 160px;float: left;">宾州筛</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="宾州筛第一层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width: 1%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="宾州筛第二层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width: 1%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="宾州筛第三层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width: 2%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="宾州筛第四层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width: 2%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="数据来源:" prop="location">
- <el-input v-model="table2.temp.brandName" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <h3 style="width: 160px;float: left;">粪便筛</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="粪便筛第一层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width:2%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="粪便筛第二层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width:2%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="粪便筛第三层(%):" prop="location">
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最小值" />
- <span style="width:2%;">-</span>
- <el-input v-model="table2.temp.brandName" type="number" style="width:46%;" placeholder="最大值" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="数据来源:" prop="location">
- <el-input v-model="table2.temp.brandName" type="textarea" placeholder="1-255字符" :autosize="{ minRows: 1, maxRows: 4}" style="width:100%;" maxlength="255" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button class="cancel" @click="table2.dialogFormVisible = false; ">关闭</el-button>
- <el-button class="success" :disabled="isokDisable" @click="updateData()">确认</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { GetDataByName } from '@/api/common'
- export default {
- name: 'StandardParameters',
- data() {
- return {
- activeName: 'first',
- physicalList: [{ id: 0, name: '2.5' }, { id: 1, name: '2.75' }, { id: 2, name: '3' }, { id: 3, name: '3.25' }, { id: 4, name: '3.5' }, { id: 5, name: '3.75' }, { id: 6, name: '4+' }], // 标准体况评分
- faecesList: [{ id: 0, name: '1' }, { id: 1, name: '2' }, { id: 2, name: '3' }, { id: 3, name: '4' }, { id: 4, name: '5' }], // 标准粪便评分
- table1: {
- getdataListParm: {
- name: 'getAssetList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- enable: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: true,
- // 编辑
- dialogFormVisible: false,
- dialogStatus: '',
- temp: {},
- rules: {}
- },
- table2: {
- getdataListParm: {
- name: 'getAssetList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- enable: ''
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: true,
- // 编辑
- dialogFormVisible: false,
- dialogStatus: '',
- temp: {},
- rules: {}
- },
- textMap: {
- update: '编辑'
- },
- isokDisable: false,
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' }
- }
- },
- created() {
- this.getList()
- },
- methods: {
- handleTabClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'first') {
- this.getList()
- } else if (tab.name === 'second') {
- this.getList2()
- }
- },
- getList() {
- this.table1.listLoading = true
- GetDataByName(this.table1.getdataListParm).then(response => {
- console.log('table1数据', response.data.list)
- if (response.data.list !== null) {
- this.table1.list = response.data.list
- this.table1.pageNum = response.data.pageNum
- this.table1.pageSize = response.data.pageSize
- .table1.total = response.data.total
- } else {
- this.table1.list = []
- }
- setTimeout(() => {
- this.table1.listLoading = false
- }, 100)
- })
- },
- getList2() {
- this.table2.listLoading = true
- GetDataByName(this.table2.getdataListParm).then(response => {
- console.log('table1数据', response.data.list)
- if (response.data.list !== null) {
- this.table2.list = response.data.list
- this.table2.pageNum = response.data.pageNum
- this.table2.pageSize = response.data.pageSize
- if (response.data.total) {
- this.table2.total = response.data.total
- }
- } else {
- this.table2.list = []
- }
- setTimeout(() => {
- this.table2.listLoading = false
- }, 100)
- })
- },
- // 编辑
- handleUpdate() {
- if (this.activeName === 'first') {
- console.log('点击了体况、粪便评分标准编辑')
- this.table1.dialogStatus = 'update'
- this.table1.dialogFormVisible = true
- } else if (this.activeName === 'second') {
- console.log('点击了宾州筛、粪便筛标准范围编辑')
- this.table2.dialogStatus = 'update'
- this.table2.dialogFormVisible = true
- }
- },
- updateData() {
- if (this.activeName === 'first') {
- console.log('点击了体况、粪便评分标准编辑保存')
- } else if (this.activeName === 'second') {
- console.log('点击了宾州筛、粪便筛标准范围编辑保存')
- }
- },
- // 导出
- handleExport() {
- if (this.activeName === 'first') {
- console.log('体况、粪便评分标准/导出')
- } else if (this.activeName === 'second') {
- console.log('宾州筛、粪便筛标准范围/导出')
- }
- },
- // 导入
- handleImport() {
- if (this.activeName === 'first') {
- console.log('体况、粪便评分标准/导入')
- } else if (this.activeName === 'second') {
- console.log('宾州筛、粪便筛标准范围/导入')
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .operation{
- position: relative;
- height: 50px;
- .export{position: absolute;right: 110px;bottom: 10px;}
- .import{position: absolute;right: 0;bottom: 10px;}
- }
- </style>
|