|
@@ -889,6 +889,7 @@ export default {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
const _this = this;
|
|
|
+ this.deviceModel.part_id = this.getPartId(this.deviceModel.frame_id)
|
|
|
/** 新增 */
|
|
|
if (!this.deviceModel.id) {
|
|
|
API_Device.add(this.deviceModel).then(r => {
|
|
@@ -965,6 +966,15 @@ export default {
|
|
|
this.getTypeFrame(shopId)
|
|
|
})
|
|
|
},
|
|
|
+ getPartId(frame_id) {
|
|
|
+ let frame= {}
|
|
|
+ frame = this.partFrames.filter(p => p.id === frame_id)[0]
|
|
|
+ if (frame.part_id != null) {
|
|
|
+ return frame.part_id
|
|
|
+ } else {
|
|
|
+ return this.$store.getters.partId
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
initWebSocket: function() {
|
|
|
var stockbase = DeviceUrl.replace('http', 'ws')
|