| | |
| | | barCodeStart: 0, |
| | | barCodeEnd: 100000, |
| | | deviceList: [ |
| | | { |
| | | valueKey: '', |
| | | deviceNo: '', |
| | | progress: 0, |
| | | deviceLength: '', |
| | | deviceWidth: '' |
| | | } |
| | | // { |
| | | // valueKey: '', |
| | | // deviceNo: '', |
| | | // progress: 0, |
| | | // deviceLength: '', |
| | | // deviceWidth: '' |
| | | // } |
| | | ] |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | getDeviceLengthPlaceholder: function () { |
| | | var box = this.getAutoTrackDeviceBox(); |
| | | return box && box.along ? '默认: ' + box.along : ''; |
| | | return box && box.along ? '参考: ' + box.along : ''; |
| | | }, |
| | | getDeviceWidthPlaceholder: function () { |
| | | var box = this.getAutoTrackDeviceBox(); |
| | | return box && box.across ? '默认: ' + box.across : ''; |
| | | return box && box.across ? '参考: ' + box.across : ''; |
| | | }, |
| | | loadDeviceForm: function (type, value) { |
| | | this.resetDeviceForm(); |
| | |
| | | barCodeStart: 0, |
| | | barCodeEnd: 100000, |
| | | deviceList: [ |
| | | { |
| | | valueKey: '', |
| | | deviceNo: '', |
| | | progress: 0, |
| | | deviceLength: '', |
| | | deviceWidth: '' |
| | | } |
| | | // { |
| | | // valueKey: '', |
| | | // deviceNo: '', |
| | | // progress: 0, |
| | | // deviceLength: '', |
| | | // deviceWidth: '' |
| | | // } |
| | | ], |
| | | ...json |
| | | }; |
| | |
| | | }); |
| | | }, |
| | | addDeviceForm: function () { |
| | | const defaultDeviceBox = this.getAutoTrackDeviceBox(); |
| | | this.deviceForm.deviceList.push({ |
| | | valueKey: '', |
| | | deviceNo: '', |
| | | progress: 0, |
| | | deviceLength: '', |
| | | deviceWidth: '' |
| | | deviceLength: "", |
| | | deviceWidth: "" |
| | | }); |
| | | }, |
| | | applyDeviceForm: function () { |
| | |
| | | if ( |
| | | !this.deviceForm.deviceList || |
| | | this.deviceForm.deviceList.length === 0 || |
| | | this.deviceForm.deviceList.some((item) => item.deviceNo === '') |
| | | this.deviceForm.deviceList.some((item) => item.deviceNo === '' || item.deviceLength === '' || item.deviceWidth === '') |
| | | ) { |
| | | this.showMessage('warning', '设备列表不能为空'); |
| | | return; |
| | |
| | | delete payload.rgvNo; |
| | | self.deviceForm.deviceList.forEach((item) => { |
| | | item.valueKey = valueKey; |
| | | // 允许通过属性面板覆盖默认设备像素尺寸(沿轨道/垂直轨道) |
| | | var deviceLength = toInt(item.deviceLength, 0); |
| | | var deviceWidth = toInt(item.deviceWidth, 0); |
| | | if (deviceLength > 0) { |
| | | item.deviceLength = String(deviceLength); |
| | | } else { |
| | | delete item.deviceLength; |
| | | } |
| | | if (deviceWidth > 0) { |
| | | item.deviceWidth = String(deviceWidth); |
| | | } else { |
| | | delete item.deviceWidth; |
| | | } |
| | | }); |
| | | self.deviceForm.trackId = String(trackId); |
| | | self.deviceForm.barCodeStart = toInt(self.deviceForm.barCodeStart, 0); |
| | |
| | | newElement.value = JSON.stringify({ |
| | | trackId: this.getNextDeviceTrackId(null), |
| | | deviceList: [ |
| | | { |
| | | valueKey: '', |
| | | deviceNo: '', |
| | | progress: 0 |
| | | } |
| | | // { |
| | | // valueKey: '', |
| | | // deviceNo: '', |
| | | // progress: 0 |
| | | // } |
| | | ] |
| | | }); |
| | | } |