|
@@ -18,6 +18,13 @@
|
|
|
<el-form-item label="设备地址:">
|
|
<el-form-item label="设备地址:">
|
|
|
<el-input v-model="formInline.deviceIp" placeholder="设备地址"></el-input>
|
|
<el-input v-model="formInline.deviceIp" placeholder="设备地址"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="关联煎药区" prop="decoctionAreaCode">
|
|
|
|
|
+ <el-select v-model="formInline.decoctionAreaCode" placeholder="请选择备用煎药区" filterable>
|
|
|
|
|
+ <el-option v-for="item in stationOptions" :key="item.id"
|
|
|
|
|
+ :label="item.areaName" :value="item.areaCode" :disabled="item.state !== 0"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="启用状态:" required>
|
|
<el-form-item label="启用状态:" required>
|
|
|
<el-radio-group v-model="formInline.status">
|
|
<el-radio-group v-model="formInline.status">
|
|
|
<el-radio :label="0">开启</el-radio>
|
|
<el-radio :label="0">开启</el-radio>
|
|
@@ -30,6 +37,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { getDeviceDetail, addDevice, updateDevice } from "@/api/decoct/device";
|
|
import { getDeviceDetail, addDevice, updateDevice } from "@/api/decoct/device";
|
|
|
|
|
+import { getDecoctStationOptions } from '@/api/decoct';
|
|
|
export default {
|
|
export default {
|
|
|
props: {
|
|
props: {
|
|
|
disabled: {
|
|
disabled: {
|
|
@@ -41,6 +49,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
formInline: {
|
|
formInline: {
|
|
|
|
|
+ decoctionAreaCode: void 0,
|
|
|
deviceName: '',
|
|
deviceName: '',
|
|
|
deviceType: '',
|
|
deviceType: '',
|
|
|
deviceCode: '',
|
|
deviceCode: '',
|
|
@@ -49,6 +58,8 @@ export default {
|
|
|
status: 0,
|
|
status: 0,
|
|
|
},
|
|
},
|
|
|
loading: false,
|
|
loading: false,
|
|
|
|
|
+ // 煎药区
|
|
|
|
|
+ stationOptions: [],
|
|
|
typeOptions: []
|
|
typeOptions: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -56,6 +67,7 @@ export default {
|
|
|
this.getDicts("device_type").then((response) => {
|
|
this.getDicts("device_type").then((response) => {
|
|
|
this.typeOptions = response.data;
|
|
this.typeOptions = response.data;
|
|
|
});
|
|
});
|
|
|
|
|
+ getDecoctStationOptions().then((response) => {this.stationOptions = response.data;}, () => []);
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
openDialog() {
|
|
openDialog() {
|
|
@@ -80,6 +92,7 @@ export default {
|
|
|
// 修改
|
|
// 修改
|
|
|
toUpdate() {
|
|
toUpdate() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
+ this.formInline.decoctionAreaName = this.formInline.decoctionAreaCode == null ? '' : (this.stationOptions.find(option => option.areaCode === this.formInline.decoctionAreaCode) || {}).areaName || '';
|
|
|
updateDevice(this.formInline).then((response) => {
|
|
updateDevice(this.formInline).then((response) => {
|
|
|
this.msgSuccess('修改成功')
|
|
this.msgSuccess('修改成功')
|
|
|
this.$emit('success')
|
|
this.$emit('success')
|
|
@@ -90,6 +103,7 @@ export default {
|
|
|
// 新增
|
|
// 新增
|
|
|
toAdd() {
|
|
toAdd() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
+ this.formInline.decoctionAreaName = this.formInline.decoctionAreaCode == null ? '' : (this.stationOptions.find(option => option.areaCode === this.formInline.decoctionAreaCode) || {}).areaName || '';
|
|
|
addDevice(this.formInline).then((response) => {
|
|
addDevice(this.formInline).then((response) => {
|
|
|
this.msgSuccess('新增成功')
|
|
this.msgSuccess('新增成功')
|
|
|
this.$emit('success')
|
|
this.$emit('success')
|
|
@@ -103,7 +117,6 @@ export default {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.edit-dialog {
|
|
.edit-dialog {
|
|
|
- height: 400px;
|
|
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
|
&-formInline{
|
|
&-formInline{
|
|
|
width: 330px;
|
|
width: 330px;
|