| | |
| | | <el-form-item label="生命状态" prop="machineLifeStatus"> |
| | | <el-select v-model="form.machineLifeStatus" placeholder="" style="width: 240px"> |
| | | <el-option v-for="item in options.machineLifeStatus" :key="item.value" :label="item.label" |
| | | :value="item.value" /> |
| | | :value="item.value - 0" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="所属机器组" prop="groupId"> |
| | | <!-- <el-input style="width: 240px" v-model="form.groupId" placeholder="所属机器组" clearable></el-input> --> |
| | | <el-form-item label="所属设备组" prop="groupId"> |
| | | <!-- <el-input style="width: 240px" v-model="form.groupId" placeholder="" clearable></el-input> --> |
| | | <el-tree-select v-model="form.groupId" node-key="id" :props="props" :data="options.groupId" |
| | | filterable style="width: 240px" /> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="工位编号" prop="workstationId"> |
| | | <el-input style="width: 240px" v-model="form.workstationId" placeholder="未绑定" |
| | | <el-form-item label="工位编号" prop="workstationCode"> |
| | | <el-input style="width: 240px" v-model="form.workstationCode" placeholder="未绑定" |
| | | disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="工位名称" prop="code"> |
| | | <el-input style="width: 240px" v-model="form.code" placeholder="未绑定" disabled></el-input> |
| | | <el-form-item label="工位名称" prop="workstationName"> |
| | | <el-input style="width: 240px" v-model="form.workstationName" placeholder="未绑定" |
| | | disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | |
| | | <el-form-item label="使用状态" prop="machineUseStatus"> |
| | | <el-select v-model="form.machineUseStatus" placeholder="" style="width: 240px"> |
| | | <el-option v-for="item in options.machineUseStatus" :key="item.value" :label="item.label" |
| | | :value="item.value" /> |
| | | :value="item.value - 0" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | }, |
| | | mode: "add", |
| | | titleMap: { |
| | | add: '新建机器台账', |
| | | edit: '编辑机器台账', |
| | | add: '新建设备台账', |
| | | edit: '编辑设备台账', |
| | | // show: '查看' |
| | | }, |
| | | visible: false, |
| | |
| | | softwareVersion: '', |
| | | groupId: '', |
| | | linkWay: '', |
| | | machineCode: '', |
| | | workstationId: '', |
| | | workstationCode: '', |
| | | workstationName: '', |
| | | code: '', |
| | | status: '', |
| | | invoiceValue: '', |
| | |
| | | })) |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/device-types/page?keyWord=¤t=1&size=-1').then(res => { |
| | | this.$HTTP.get('/api/smis/device-types/page?keyWord=¤t=1&size=-1').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.machineTypeId = res.data.records.map(item => ({ |
| | | label: item.name, |
| | |
| | | })) |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/employee/tree').then(res => { |
| | | this.$HTTP.get('/api/smis/employee/tree').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.employeeId = res.data |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/group/tree?groupCategory=1&groupType=group_machine').then(res => { |
| | | this.$HTTP.get('/api/smis/group/tree?groupCategory=1&groupType=group_machine').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.groupId = res.data |
| | | } |
| | | }) |
| | | this.$HTTP.get('/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1').then(res => { |
| | | this.$HTTP.get('/api/smis/organization/tree?groupType=group_organization&groupCategory=1').then(res => { |
| | | if (res.code === 200) { |
| | | this.options.organizationId = res.data |
| | | } |
| | |
| | | this.form[item] = '' |
| | | }) |
| | | if (params.id) { |
| | | this.$HTTP.get(`/api/blade-cps/machine/detail/${params.id}`).then(res => { |
| | | this.$HTTP.get(`/api/smis/machine/detail/${params.id}`).then(res => { |
| | | if (res.code === 200) { |
| | | this.form = { |
| | | ...this.form, |
| | |
| | | let res |
| | | try { |
| | | if (this.form.id) { |
| | | res = await this.$HTTP.put('/api/blade-cps/machine', data).catch(() => { |
| | | res = await this.$HTTP.put('/api/smis/machine', data).catch(() => { |
| | | throw new Error() |
| | | }) |
| | | } else { |
| | | res = await this.$HTTP.post('/api/blade-cps/machine', data).catch(() => { |
| | | res = await this.$HTTP.post('/api/smis/machine', data).catch(() => { |
| | | throw new Error() |
| | | }) |
| | | } |
| | |
| | | this.visible = false; |
| | | this.$message.success("操作成功") |
| | | } else { |
| | | this.$alert(res.message, "提示", { type: 'error' }) |
| | | this.$alert(res.msg, "提示", { type: 'error' }) |
| | | } |
| | | } else { |
| | | return false; |