|
@@ -2,7 +2,7 @@
|
|
|
<!-- 冰排追溯管理 -->
|
|
|
<div>
|
|
|
<actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
|
|
|
- @searchProtocol="searchProtocol"></actionBar>
|
|
|
+ @searchProtocol="searchProtocol" @handleScroll="handleScroll"></actionBar>
|
|
|
<div class="card_content">
|
|
|
<!-- 表单 -->
|
|
|
<tables :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
|
|
@@ -17,17 +17,20 @@
|
|
|
<div class="card_history">
|
|
|
<el-dialog title="历史记录" :visible.sync="historyVisible" width="90%" :close-on-click-modal="false"
|
|
|
@close="closeHistory">
|
|
|
- <tables :tableList="historyList" :tableData="historyData" @buttonData="historyButton"></tables>
|
|
|
+ <tables :historyFlag="true" :tableList="historyList" :tableData="historyData" @buttonData="historyButton">
|
|
|
+ </tables>
|
|
|
<!-- 分页 -->
|
|
|
<div v-if="historyTotal">
|
|
|
<pagination :total="historyTotal" :currentPage="historyPagination.PageIndex" @changeSize="historySize"
|
|
|
@changeCurrent="historyCurrent">
|
|
|
</pagination>
|
|
|
</div>
|
|
|
- <el-dialog width="500px" title="编辑" :visible.sync="innerVisible" append-to-body>
|
|
|
- <forms ref="childRules" :formNewList="editRuleList" :ruleForm="editRuleForm" :iceBank="true"
|
|
|
- labelWidth="100px" @handleScroll="handleScroll" @remoteMethod="remoteMethod" :key="Math.random()"></forms>
|
|
|
+ <el-dialog width="500px" title="编辑" :visible.sync="innerVisible" append-to-body :close-on-click-modal="false"
|
|
|
+ @close="closeNested">
|
|
|
+ <forms ref="editRules" :formNewList="editRuleList" :ruleForm="editRuleForm" :iceBank="true" labelWidth="100px"
|
|
|
+ @handleScroll="handleScroll" @remoteMethod="remoteMethod" :key="Math.random()"></forms>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="innerVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click="submit">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -36,8 +39,8 @@
|
|
|
<!-- 出入库 -->
|
|
|
<el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="600px" :close-on-click-modal="false"
|
|
|
@close="closeDialog">
|
|
|
- <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" :iceBank="true" labelWidth="100px"
|
|
|
- @handleScroll="handleScroll" @remoteMethod="remoteMethod" :key="Math.random()">
|
|
|
+ <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" :iceTracing="true" :iceBank="true"
|
|
|
+ labelWidth="100px" @handleScroll="handleScroll" @remoteMethod="remoteMethod">
|
|
|
</forms>
|
|
|
<span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
|
|
|
<el-button plain @click="staffDialogVisible = false">取 消</el-button>
|
|
@@ -73,9 +76,6 @@
|
|
|
freezerRules,
|
|
|
editRules
|
|
|
} from "./iceRaft.js";
|
|
|
- import {
|
|
|
- frozenState
|
|
|
- } from '@/assets/js/blockSort'
|
|
|
export default {
|
|
|
name: 'IceManagement',
|
|
|
components: {
|
|
@@ -101,13 +101,47 @@
|
|
|
}, {
|
|
|
type: 'select',
|
|
|
label: '状态',
|
|
|
- field: 'state',
|
|
|
+ field: 'status',
|
|
|
placeholder: '请选择状态',
|
|
|
- options: frozenState()
|
|
|
- }],
|
|
|
+ options: [{
|
|
|
+ bgcolor: '#606266',
|
|
|
+ label: '未入库',
|
|
|
+ value: '0',
|
|
|
+ }, {
|
|
|
+ bgcolor: '#409EFF',
|
|
|
+ label: '冷冻中',
|
|
|
+ value: '1',
|
|
|
+ }, {
|
|
|
+ bgcolor: '#67C23A',
|
|
|
+ label: '待使用',
|
|
|
+ value: '2',
|
|
|
+ }, {
|
|
|
+ bgcolor: '#E6A23C',
|
|
|
+ label: '使用中',
|
|
|
+ value: '3',
|
|
|
+ }, {
|
|
|
+ bgcolor: '#909399',
|
|
|
+ label: '已结束',
|
|
|
+ value: '4',
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ type: 'select',
|
|
|
+ label: '冷冻柜',
|
|
|
+ field: 'iceLockerId',
|
|
|
+ placeholder: '请选择冷冻柜',
|
|
|
+ options: []
|
|
|
+ }, {
|
|
|
+ type: 'select',
|
|
|
+ label: '保温箱',
|
|
|
+ field: 'coolerBoxId',
|
|
|
+ placeholder: '请选择保温箱',
|
|
|
+ options: []
|
|
|
+ }, ],
|
|
|
searchRuleForm: {
|
|
|
code: '',
|
|
|
- state: '',
|
|
|
+ status: '',
|
|
|
+ iceLockerId: null,
|
|
|
+ coolerBoxId: null,
|
|
|
},
|
|
|
searchValue: {},
|
|
|
tableList: employee(),
|
|
@@ -141,6 +175,7 @@
|
|
|
page: 1,
|
|
|
staffName: '',
|
|
|
limitNo: true,
|
|
|
+ limitNoil: true,
|
|
|
eventSource: null,
|
|
|
timer: null, //定时器名称
|
|
|
iceRaftId: null,
|
|
@@ -153,18 +188,20 @@
|
|
|
inStorageTime: '',
|
|
|
outStorageTime: '',
|
|
|
freezeClaim: '',
|
|
|
+ iceLockerId: '',
|
|
|
+ coolerBoxId: '',
|
|
|
},
|
|
|
iceRaftCode: '',
|
|
|
coldCupboard: {
|
|
|
field: 'iceLockerId',
|
|
|
- label: '冷藏柜',
|
|
|
- placeholder: '请选择冷藏柜',
|
|
|
+ label: '冷冻柜',
|
|
|
+ placeholder: '请选择冷冻柜',
|
|
|
type: 'searchSelect',
|
|
|
colWidth: 24,
|
|
|
multiple: false,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: '请选择冷藏柜',
|
|
|
+ message: '请选择冷冻柜',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
options: [],
|
|
@@ -273,49 +310,81 @@
|
|
|
this.formRuleList = freezerRules()
|
|
|
this.thermostat.options = []
|
|
|
this.formRuleList.unshift(this.thermostat)
|
|
|
- this.limitNo = true
|
|
|
+ this.limitNoil = true
|
|
|
this.getIncubator()
|
|
|
}
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
- // 重置冷藏柜、保温箱
|
|
|
+ // 重置冷冻柜、保温箱
|
|
|
resetSelect() {
|
|
|
this.page = 1
|
|
|
this.limitNo = true
|
|
|
+ this.limitNoil = true
|
|
|
this.staffName = ''
|
|
|
},
|
|
|
// 触底事件
|
|
|
- handleScroll() {
|
|
|
- if (this.limitNo) {
|
|
|
- if (this.operationType == 'come') {
|
|
|
+ handleScroll(type) {
|
|
|
+ if (this.operationType == 'come') {
|
|
|
+ if (this.limitNo) {
|
|
|
this.getFreezer()
|
|
|
- } else if (this.operationType == 'goOut') {
|
|
|
+ }
|
|
|
+ } else if (this.operationType == 'goOut') {
|
|
|
+ if (this.limitNoil) {
|
|
|
this.getIncubator()
|
|
|
- } else if (this.operationType == 'edit') {
|
|
|
- if (this.deposit) {
|
|
|
+ }
|
|
|
+ } else if (this.operationType == 'edit') {
|
|
|
+ if (this.deposit) {
|
|
|
+ if (this.limitNo) {
|
|
|
this.getFreezer()
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.limitNoil) {
|
|
|
this.getIncubator()
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (type == 'iceLockerId' && this.limitNo) {
|
|
|
+ this.getFreezer()
|
|
|
+ } else if (type == 'coolerBoxId' && this.limitNoil) {
|
|
|
+ this.getIncubator()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 搜索
|
|
|
remoteMethod(value) {
|
|
|
this.resetSelect()
|
|
|
this.staffName = value
|
|
|
- if (this.operationType == 'come') {
|
|
|
- this.getFreezer()
|
|
|
- } else if (this.operationType == 'goOut') {
|
|
|
- this.getIncubator()
|
|
|
+ if (this.operationType == 'edit') {
|
|
|
+ this.editRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (this.deposit) {
|
|
|
+ this.getFreezer()
|
|
|
+ } else {
|
|
|
+ this.getIncubator()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.operationType == 'come') {
|
|
|
+ this.formRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getFreezer()
|
|
|
+ } else if (this.operationType == 'goOut') {
|
|
|
+ this.getIncubator()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- // 获取冷藏柜列表
|
|
|
+ // 获取冷冻柜列表
|
|
|
getFreezer() {
|
|
|
let arrList = []
|
|
|
let params = {
|
|
|
page: this.page,
|
|
|
pageSize: 10,
|
|
|
+ status: '2',
|
|
|
name: this.staffName,
|
|
|
}
|
|
|
getIcelocker(params).then(res => {
|
|
@@ -332,21 +401,27 @@
|
|
|
arrList.push(arrData)
|
|
|
})
|
|
|
if (this.limitNo == true) {
|
|
|
- if (this.operationType == 'come' || this.operationType == 'goOut') {
|
|
|
- this.formRuleList.forEach(item => {
|
|
|
- if (item.type == 'searchSelect') {
|
|
|
- item.options = item.options.concat(arrList)
|
|
|
- }
|
|
|
- })
|
|
|
- console.log(this.formRuleList,22)
|
|
|
- } else if (this.operationType == 'edit') {
|
|
|
- this.editRuleList.forEach(item => {
|
|
|
- if (item.type == 'searchSelect') {
|
|
|
+ if (this.operationType != '') {
|
|
|
+ if (this.operationType == 'come' || this.operationType == 'goOut') {
|
|
|
+ this.formRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = item.options.concat(arrList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.operationType == 'edit') {
|
|
|
+ this.editRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = item.options.concat(arrList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formList.forEach(item => {
|
|
|
+ if (item.field == 'iceLockerId') {
|
|
|
item.options = item.options.concat(arrList)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- // this.coldCupboard.options = this.coldCupboard.options.concat(arrList)
|
|
|
}
|
|
|
if (arrList.length >= 10) {
|
|
|
this.page = ++this.page;
|
|
@@ -363,6 +438,7 @@
|
|
|
let params = {
|
|
|
page: this.page,
|
|
|
pageSize: 10,
|
|
|
+ status: '2',
|
|
|
name: this.staffName,
|
|
|
}
|
|
|
getCoolerBox(params).then(res => {
|
|
@@ -378,16 +454,24 @@
|
|
|
arrData.value = item1.id
|
|
|
arrList.push(arrData)
|
|
|
})
|
|
|
- if (this.limitNo == true) {
|
|
|
- if (this.operationType == 'come' || this.operationType == 'goOut') {
|
|
|
- this.formRuleList.forEach(item => {
|
|
|
- if (item.type == 'searchSelect') {
|
|
|
- item.options = item.options.concat(arrList)
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (this.operationType == 'edit') {
|
|
|
- this.editRuleList.forEach(item => {
|
|
|
- if (item.type == 'searchSelect') {
|
|
|
+ if (this.limitNoil == true) {
|
|
|
+ if (this.operationType != '') {
|
|
|
+ if (this.operationType == 'come' || this.operationType == 'goOut') {
|
|
|
+ this.formRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = item.options.concat(arrList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (this.operationType == 'edit') {
|
|
|
+ this.editRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = item.options.concat(arrList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formList.forEach(item => {
|
|
|
+ if (item.field == 'coolerBoxId') {
|
|
|
item.options = item.options.concat(arrList)
|
|
|
}
|
|
|
})
|
|
@@ -398,7 +482,7 @@
|
|
|
this.page = ++this.page;
|
|
|
} else {
|
|
|
// 已经没数据了 不需要增加数据
|
|
|
- this.limitNo = false;
|
|
|
+ this.limitNoil = false;
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -431,6 +515,7 @@
|
|
|
// 历史记录操作
|
|
|
historyButton(row, type) {
|
|
|
this.operationType = type
|
|
|
+ this.limitNo = true
|
|
|
if (type == 'edit') {
|
|
|
this.innerVisible = true
|
|
|
this.page = 1
|
|
@@ -439,21 +524,95 @@
|
|
|
this.deposit = true
|
|
|
this.getFreezer()
|
|
|
this.editRuleList.push(this.coldCupboard)
|
|
|
+ // 冷冻柜
|
|
|
+ this.editRuleForm.iceLockerId = String(row.iceLockerId)
|
|
|
} else {
|
|
|
this.deposit = false
|
|
|
this.getIncubator()
|
|
|
this.editRuleList.push(this.thermostat)
|
|
|
+ // 保温箱
|
|
|
+ this.editRuleForm.coolerBoxId = String(row.coolerBoxId)
|
|
|
}
|
|
|
+ this.editRuleForm.id = row.id
|
|
|
this.editRuleForm.code = this.iceRaftCode
|
|
|
this.editRuleForm.status = row.status
|
|
|
this.editRuleForm.inStorageTime = row.inStorageTime
|
|
|
this.editRuleForm.outStorageTime = row.outStorageTime
|
|
|
this.editRuleForm.freezeClaim = row.freezeClaim
|
|
|
+ if (row.status == '3') {
|
|
|
+ this.editRuleList.forEach(item => {
|
|
|
+ if (item.field == 'freezeClaim') {
|
|
|
+ item.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else if (type == 'del') {
|
|
|
+ this.delHistory(row.id)
|
|
|
}
|
|
|
},
|
|
|
// 编辑历史记录提交
|
|
|
submit() {
|
|
|
-
|
|
|
+ let flag = this.$refs['editRules'].validateForm();
|
|
|
+ if (flag) {
|
|
|
+ this.$confirm('确定修改该冰排信息吗, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let param = {
|
|
|
+ id: '',
|
|
|
+ iceLockerId: '',
|
|
|
+ coolerBoxId: '',
|
|
|
+ freezeClaim: '',
|
|
|
+ }
|
|
|
+ param.id = this.editRuleForm.id
|
|
|
+ param.iceLockerId = Number(this.editRuleForm.iceLockerId)
|
|
|
+ param.coolerBoxId = Number(this.editRuleForm.coolerBoxId)
|
|
|
+ param.freezeClaim = Number(this.editRuleForm.freezeClaim)
|
|
|
+ if (this.editRuleForm.outStorageTime == '') {
|
|
|
+ delete param.coolerBoxId
|
|
|
+ } else {
|
|
|
+ delete param.iceLockerId
|
|
|
+ }
|
|
|
+ putIceRaftRecord(param).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.innerVisible = false
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg
|
|
|
+ });
|
|
|
+ this.getHistory()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ // console.log('取消修改')
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error('表单信息不完整,请继续填写完整');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 删除历史记录
|
|
|
+ delHistory(id) {
|
|
|
+ this.$confirm('确定删除该冰排信息吗, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ delIceRaftRecord({
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功,请重新入库该冰排!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ this.getHistory()
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ // console.log('已取消删除')
|
|
|
+ });
|
|
|
},
|
|
|
changeSize(val) {
|
|
|
this.Pagination.PageSize = val
|
|
@@ -474,7 +633,18 @@
|
|
|
},
|
|
|
// 关闭历史记录
|
|
|
closeHistory() {
|
|
|
+ this.historyPagination.PageIndex = 1
|
|
|
this.historyVisible = false
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ // 嵌套弹窗
|
|
|
+ closeNested() {
|
|
|
+ this.staffName = ''
|
|
|
+ this.editRuleList.forEach(item => {
|
|
|
+ if (item.type == 'searchSelect') {
|
|
|
+ item.options = []
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 清空表单
|
|
|
closeDialog() {
|