This commit is contained in:
fan 2020-07-20 13:39:11 +08:00
commit 29c89cf4a7
2 changed files with 30 additions and 13 deletions

View File

@ -113,3 +113,12 @@ export function getCmdList(lineCode, params) {
params: params
});
}
// 获取指令列表
export function postCopyCmd(data) {
return request({
url: `/api/cmd/copy`,
method: 'post',
data
});
}

View File

@ -9,6 +9,7 @@
</template>
<script>
import { postCopyCmd } from '@/api/management/dictionary'
export default {
name: 'EditCondition',
@ -22,8 +23,8 @@ export default {
return {
dialogVisible: false,
formModel: {
fromId: '',
fromName: '',
fromCode: '',
fromName: '',
targetIds: '',
deviceType: []
},
@ -78,21 +79,28 @@ export default {
this.lineCode = lineCode;
this.targetList = [];
this.taskStatusList.forEach(item => {
item.value = item.id;
item.label = item.name;
if (item.code != lineCode) {
this.targetList.push(item);
} else {
this.formModel.fromId = item.id;
this.formModel.fromName = item.name;
}
});
item.value = item.code;
item.label = item.name;
if (item.code != lineCode) {
this.targetList.push(item);
} else {
this.formModel.fromCode = item.code;
this.formModel.fromName = item.name;
}
})
}
},
doSave() {
this.$refs.dataform.validateForm(() => {
console.log('确定');
this.handleClose();
const param = {
fromLineCode: this.formModel.fromCode,
targetLineCodes: this.formModel.targetIds,
operateObjects: this.formModel.deviceType
}
postCopyCmd(param).then(res => {
this.handleClose();
this.$message.success('复制指令成功!');
})
});
},
handleClose() {