Commit 066d98f1 by huangqy

1111

parent 363f6125
......@@ -22,6 +22,7 @@
<el-button v-show="yiWei" size="small" style="margin-right: 5px;" @click="changeNew">确认</el-button>
<el-form-item>
<el-button type="warning" @click="changeLocation">移位</el-button>
<el-button type="primary" @click="changeRoadway">调整巷道库区</el-button>
</el-form-item>
</el-form>
......@@ -42,7 +43,7 @@
<el-card style="height: 620px; overflow: auto;">
<div v-for="(item,index) in this.ArrayListX" :key="index">
<ul :style="index === 10 ? 'margin-top: 40px; grid-template-columns: repeat('+ item.length +', 3.4%);' : 'grid-template-columns: repeat('+ item.length +', 3.4%);'" >
<li v-for="(items,k) in item" :key="k+''+index" @click="onClick(items)" :style="items.select ? 'border: 1px solid black' : ''"
<li v-for="(items,k) in item" :key="k+''+index" @click="onClick(items)" :style="items.preWzdm === '0000000000' ? 'border: 2px solid blue' : items.select ? 'border: 2px solid black' : ''"
:class="items.x === 0 || items.y === 0 ? 'box' : items.status === 'E' ? 'boxE' : items.status === 'P' ? 'boxP': items.status === 'F' ? 'boxF' : items.status === 'A' ? 'boxA' : items.status === 'W' ? 'boxW' : items.status === 'C' ? 'boxC' : '' ">
{{ items.x === 0 ? items.y : items.y ===0 ? items.x : ''}}
</li>
......@@ -70,6 +71,36 @@
</el-col>
</el-row>
<!-- 新建弹出框 -->
<el-dialog :append-to-body="true" title="调整巷道库区" :visible.sync="dialogVisible" width="500px" :close-on-click-modal="false">
<!-- 表单区域 -->
<el-form :model="roadData" :rules="roadDataRules" ref="fromRef" size="medium" label-position="right">
<el-form-item label="巷道编码 :" prop="positionCode">
<el-input
placeholder="请输入巷道编码"
v-model="roadData.positionCode"
/>
</el-form-item>
<el-form-item label="所属库区 :" prop="sskq">
<el-select
style="width: 100%"
placeholder="请选择所属库区"
v-model="roadData.sskq">
<el-option label="成品区" :value="1"></el-option>
<el-option label="空托盘区" :value="2"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" type="danger" size="medium">取 消</el-button>
<el-button type="primary" @click="subRoadData()" size="medium">提 交</el-button>
</span>
</el-dialog>
</el-card>
</div>
</div>
......@@ -87,6 +118,17 @@ export default {
oldPositionCode: '',
newPositionCode: ''
},
roadData: {
},
roadDataRules: {
positionCode: [
{ required: true, message: '此项为必填项', trigger: 'blur' },
],
sskq: [
{ required: true, message: '此项为必填项', trigger: 'blur' },
],
},
layerList: [],
xyData: [],
maxXy: {},
......@@ -94,6 +136,7 @@ export default {
ArrayListY:[],
rightForm: {},
lastSelect: [],
dialogVisible: false
}
},
created () {
......@@ -117,7 +160,7 @@ export default {
for(var i=0;i<=res.data[0].maxRow;i++){
this.ArrayListY = [];
for(var j=0;j<=res.data[0].maxRank;j++){
this.ArrayListY.push({x: j, y: i, status: this.findStatus(j, i), positionCode: this.findPositionCode(j, i) });
this.ArrayListY.push({x: j, y: i, status: this.findStatus(j, i), positionCode: this.findPositionCode(j, i), preWzdm: this.findPreWzdm(j, i) });
}
this.ArrayListX.push(this.ArrayListY);
}
......@@ -147,6 +190,15 @@ export default {
}
return '';
},
findPreWzdm(x, y) {
var resA = this.xyData.filter(i => i.vrank === x)
if (resA) {
if (resA.find(j => j.vrow === y)) {
return resA.find(j => j.vrow === y).preWzdm
}
}
return '';
},
async changeLayer() {
await this.getRackByLayer()
this.ArrayListX = []
......@@ -186,6 +238,26 @@ export default {
this.formData.newPositionCode = this.select.positionCode
this.select.select = false
},
changeRoadway() {
if (!this.select) {
return this.$message.warning('请先选择一个货位')
}
this.roadData.positionCode = this.select.positionCode
this.dialogVisible = true
},
subRoadData() {
this.roadData.storeCode = JSON.parse(sessionStorage.getItem('storeList'))
this.$refs.fromRef.validate(async falg => {
if (!falg) return this.$message.error(res.message)
// 提交信息
const { data: res } = await this.$axios.post('/abcdefg', this.roadData)
if (!res.data) return this.$message.error(res.message)
// 提交信息成功后要关闭对话框,并且刷新数据
this.$message.success(res.message)
this.dialogVisible = false
this.changeLayer()
})
},
async changeLocation() {
this.formData.storeCode = JSON.parse(sessionStorage.getItem('storeList'))
if (this.formData.oldPositionCode && this.formData.newPositionCode) {
......
......@@ -338,7 +338,7 @@ export default {
// 关闭弹出框时重置表单数据
addClose() {
this.formData = {}
this.formData.remark = ''
// 通过ref来拿到表单,之后通过表单控件的方法实现重置
this.$refs.addFromRef.resetFields()
},
......@@ -346,6 +346,7 @@ export default {
// 显示新建窗口
async addClick () {
if (this.data.length === 0) return this.$message.warning('暂无可执行的货位配置')
this.getStore()
this.dialogVisible = true
this.title = '新建货位'
},
......
......@@ -104,7 +104,7 @@
</el-col>
</el-row>
</el-card>
<bo-small-title>湿度阈值设置 :</bo-small-title>
<bo-small-title>湿度阈值设置 :</bo-small-title>
<el-card>
<el-row>
<el-col :span="12">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论