|
@@ -267,6 +267,23 @@
|
|
|
|
|
|
|
|
|
</el-container>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="'确定' + (ids.length === 1 ? '出栏' : '批量出栏') + '耳标号' + eartags.join(',') + '的猪只?'"
|
|
|
+ :visible.sync="outVisible"
|
|
|
+ width="30%"
|
|
|
+ style="margin-top: 5%">
|
|
|
+ <span></span>
|
|
|
+ <el-form inline size="mini">
|
|
|
+ <el-form-item label="去向:">
|
|
|
+ <el-input v-model="whereGo" style="width: 300px"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="outVisible = false">取 消</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="deleteHandleBtn">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -330,7 +347,11 @@
|
|
|
pigstyList: [], // 所有栋舍
|
|
|
unitList: [], // 所有单元
|
|
|
unitSelectedList: [], // 根据栋舍限制的单元
|
|
|
- labelPosition: 'right'
|
|
|
+ labelPosition: 'right',
|
|
|
+ whereGo: '', // 出栏去向
|
|
|
+ outVisible: false, // 出栏确认弹窗
|
|
|
+ ids: [],
|
|
|
+ eartags: []
|
|
|
}
|
|
|
},
|
|
|
// components: {
|
|
@@ -519,39 +540,42 @@
|
|
|
// this.$refs.addOrUpdate.init(ids)
|
|
|
// })
|
|
|
// },
|
|
|
- // 出栏
|
|
|
+ // 出栏按钮点击
|
|
|
deleteHandle (pig) {
|
|
|
- var ids = pig ? [pig.id] : this.dataListSelections.map(item => {
|
|
|
+ this.outVisible = true
|
|
|
+ this.ids = pig ? [pig.id] : this.dataListSelections.map(item => {
|
|
|
return item.id
|
|
|
})
|
|
|
- var eartags = pig ? [pig.eartag] : this.dataListSelections.map(item => {
|
|
|
+ this.eartags = pig ? [pig.eartag] : this.dataListSelections.map(item => {
|
|
|
return item.eartag
|
|
|
})
|
|
|
- this.$confirm(`确定${pig ? '出栏' : '批量出栏'}耳标号${eartags.join(',')}的猪只?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl('/management/yearpigbase/such'),
|
|
|
- method: 'post',
|
|
|
- data: this.$http.adornData(ids, false)
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === 0) {
|
|
|
- this.$message({
|
|
|
- message: '操作成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1500,
|
|
|
- // onClose: () => {
|
|
|
- // this.getDataList()
|
|
|
- // }
|
|
|
- })
|
|
|
- this.getDataList()
|
|
|
- } else {
|
|
|
- this.$message.error(data.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {})
|
|
|
+ },
|
|
|
+ // 出栏请求
|
|
|
+ deleteHandleBtn () {
|
|
|
+ let data = {
|
|
|
+ ids: this.ids.join(','),
|
|
|
+ remark: this.whereGo
|
|
|
+ }
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/management/yearpigbase/such'),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData(data, false)
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === 0) {
|
|
|
+ this.outVisible = false
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ // onClose: () => {
|
|
|
+ // this.getDataList()
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ this.getDataList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
watch: {
|