|
|
@ -3,7 +3,7 @@ |
|
|
|
<el-row |
|
|
|
style="border: 1px solid chartreuse;margin-left: 10px;margin-right: 10px;margin-bottom: 10px;margin-top: 20px;min-height: 600px" |
|
|
|
> |
|
|
|
<form id="myForm" name="testForm" style="margin-top: 100px;"> |
|
|
|
<form id="myForm" name="testForm" style="margin-top: 10px;"> |
|
|
|
<el-row :gutter="5" type="flex" justify="center" align="middle" style="min-height: 40px"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-button type="primary" @click="enterSite1">进入</el-button> |
|
|
@ -96,6 +96,52 @@ |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="5" type="flex" justify="center" align="middle" style="min-height: 40px; margin-top: 50px"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-button type="primary" @click="enterSite3">进入</el-button> |
|
|
|
<el-button type="primary" @click="outSite3">离开</el-button> |
|
|
|
<el-button type="primary" @click="cleans3">清空货位</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="5" type="flex" align="bottom" justify="center"> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-checkbox @change="checkeds3" v-model="resultAll13" class="fla">全选</el-checkbox> |
|
|
|
<div v-for="(item,i) in deviceList3"> |
|
|
|
<div |
|
|
|
v-if="item.islock" |
|
|
|
style="float: left;margin-right: 5px;width: 120px;height: 120px;background-color: #FEC171;border-radius: 10%;" |
|
|
|
> |
|
|
|
<el-checkbox v-model="item.checked" style="margin-left: 20px;"/> |
|
|
|
<el-button size="mini" round style="margin-left: 18px; margin-block-end: 10px"> |
|
|
|
{{ '设备:' + item.device_code }} |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-else-if="item.hasGood != 0" |
|
|
|
style="float: left;margin-right: 5px;width: 120px;height: 120px;background-color: rgb(0, 238, 153);border-radius: 10%;" |
|
|
|
> |
|
|
|
<el-checkbox v-model="item.checked" style="margin-left: 20px;"/> |
|
|
|
<el-button size="mini" round style="margin-left: 18px;"> |
|
|
|
{{ '设备:' + item.device_code }} |
|
|
|
</el-button> |
|
|
|
<div style="font-size: 8px; margin-left: 10px; margin-block-end: 15px; margin-top: 18px"> |
|
|
|
{{ '物料类型:' + item.material_type }} |
|
|
|
</div> |
|
|
|
<div style="font-size: 8px; margin-left: 10px;">{{ '物料数量:' + item.quantity }}</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-else-if="item.hasGood === 0" |
|
|
|
style="float: left;margin-right: 5px;width: 120px;height: 120px;background-color: beige;border-radius: 10%;" |
|
|
|
> |
|
|
|
<el-checkbox v-model="item.checked" style="margin-left: 20px;"/> |
|
|
|
<el-button size="mini" round style="margin-left: 18px;"> |
|
|
|
{{ '设备:' + item.device_code }} |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</form> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
@ -114,8 +160,10 @@ export default { |
|
|
|
return { |
|
|
|
resultAll1: false, |
|
|
|
resultAll12: false, |
|
|
|
resultAll13: false, |
|
|
|
requestDialogVisible: false, |
|
|
|
requestDialogVisible2: false, |
|
|
|
requestDialogVisible3: false, |
|
|
|
responseDialogVisible: false, |
|
|
|
region: '', |
|
|
|
imgUrl: '站点', |
|
|
@ -140,6 +188,14 @@ export default { |
|
|
|
quantity: 0, |
|
|
|
remark: '' |
|
|
|
}, |
|
|
|
form3: { |
|
|
|
device_id: '', |
|
|
|
device_code: '', |
|
|
|
device_name: '', |
|
|
|
material_type: '', |
|
|
|
quantity: 0, |
|
|
|
remark: '' |
|
|
|
}, |
|
|
|
testdata: { |
|
|
|
check: null, |
|
|
|
device_code: null |
|
|
@ -147,8 +203,10 @@ export default { |
|
|
|
material_types: [], |
|
|
|
deviceList: [], |
|
|
|
deviceList2: [], |
|
|
|
deviceList3: [], |
|
|
|
deviceListOne: [], |
|
|
|
deviceListTwo: [], |
|
|
|
deviceListThree: [], |
|
|
|
currentDate: new Date(), |
|
|
|
getTime: '', |
|
|
|
getDate: '' |
|
|
@ -176,6 +234,11 @@ export default { |
|
|
|
this.deviceListTwo = data |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$nextTick(() => { |
|
|
|
deviceCrud.selectDeviceListFour().then(data => { |
|
|
|
this.deviceListThree = data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
cleans1() { |
|
|
@ -225,6 +288,29 @@ export default { |
|
|
|
this.resultAll12 = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
cleans3() { |
|
|
|
var obj = this.deviceList3 |
|
|
|
var arr = [] |
|
|
|
for (let i = 0; i < obj.length; i++) { |
|
|
|
if (obj[i].checked) { |
|
|
|
arr.push(obj[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
const data = { |
|
|
|
'data': arr |
|
|
|
} |
|
|
|
deviceCrud.cleans4(data).then(res => { |
|
|
|
this.$notify({ |
|
|
|
title: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 3000 |
|
|
|
}) |
|
|
|
for (let i = 0; i < arr.length; i++) { |
|
|
|
arr[i].checked = false |
|
|
|
} |
|
|
|
this.resultAll13 = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkeds(value) { |
|
|
|
this.deviceList.forEach((item) => { |
|
|
|
item.checked = value |
|
|
@ -237,6 +323,12 @@ export default { |
|
|
|
}) |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
checkeds3(value) { |
|
|
|
this.deviceList3.forEach((item) => { |
|
|
|
item.checked = value |
|
|
|
}) |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
enterSite1() { |
|
|
|
const data = { |
|
|
|
'data': this.deviceList, |
|
|
@ -289,6 +381,32 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
enterSite3() { |
|
|
|
const data = { |
|
|
|
'data': this.deviceList3, |
|
|
|
'islock': 'true' |
|
|
|
} |
|
|
|
deviceCrud.enterSite3(data).then(res => { |
|
|
|
this.$notify({ |
|
|
|
title: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 3000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
outSite3() { |
|
|
|
const data = { |
|
|
|
'data': this.deviceList3, |
|
|
|
'islock': 'false' |
|
|
|
} |
|
|
|
deviceCrud.enterSite3(data).then(res => { |
|
|
|
this.$notify({ |
|
|
|
title: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 3000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveRequest() { |
|
|
|
deviceCrud.addMaterial(this.form).then(res => { |
|
|
|
this.$notify({ |
|
|
@ -315,6 +433,19 @@ export default { |
|
|
|
console.log(err.response.data.message) |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveRequest3() { |
|
|
|
deviceCrud.addMaterial(this.form3).then(res => { |
|
|
|
this.$notify({ |
|
|
|
title: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 3000 |
|
|
|
}) |
|
|
|
this.requestDialogVisible3 = false |
|
|
|
}).catch(err => { |
|
|
|
this.requestDialogVisible3 = false |
|
|
|
console.log(err.response.data.message) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
return true |
|
|
@ -419,6 +550,44 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (let i = 0; i < data.msg.device3.length; i++) { |
|
|
|
const item = data.msg.device3[i] |
|
|
|
|
|
|
|
// 刷新页面第一次加载数据 |
|
|
|
if (that.deviceList3.length != data.msg.device3.length) { |
|
|
|
const obj = { |
|
|
|
device_code: item.device_code, |
|
|
|
hasGood: item.hasGood, |
|
|
|
material_type: item.material_type, |
|
|
|
quantity: item.quantity, |
|
|
|
remark: item.remark, |
|
|
|
islock: item.islock, |
|
|
|
checked: false |
|
|
|
} |
|
|
|
that.deviceList3.push(obj) |
|
|
|
} else { |
|
|
|
for (let j = 0; j < that.deviceList3.length; j++) { |
|
|
|
if (that.deviceList3[j].device_code == item.device_code) { |
|
|
|
if (that.deviceList3[j].hasGood != item.hasGood) { |
|
|
|
that.deviceList3[j].device_code = item.device_code |
|
|
|
that.deviceList3[j].hasGood = item.hasGood |
|
|
|
} |
|
|
|
if (that.deviceList3[j].material_type != item.material_type) { |
|
|
|
that.deviceList3[j].material_type = item.material_type |
|
|
|
} |
|
|
|
if (that.deviceList3[j].quantity != item.quantity) { |
|
|
|
that.deviceList3[j].quantity = item.quantity |
|
|
|
} |
|
|
|
if (that.deviceList3[j].remark != item.remark) { |
|
|
|
that.deviceList2[j].remark = item.remark |
|
|
|
} |
|
|
|
if (that.deviceList3[j].islock != item.islock) { |
|
|
|
that.deviceList3[j].islock = item.islock |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 监听socket错误 |
|
|
|
this.socket.onerror = function() { |
|
|
|