|
@@ -97,7 +97,7 @@
|
|
|
type="danger"
|
|
|
size="mini"
|
|
|
v-privilege="activeMenu + 'DELETE'"
|
|
|
- @click="but_del()"
|
|
|
+ @click="but_del_plural()"
|
|
|
>删除</el-button>
|
|
|
<div style="float:right; text-align: right;">
|
|
|
<el-button
|
|
@@ -266,7 +266,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item
|
|
|
label="动力系统代码"
|
|
|
prop="powercode"
|
|
@@ -277,9 +277,7 @@
|
|
|
:disabled="dialog.editorBox.type !== 'add'"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
label="动力系统名称"
|
|
@@ -291,6 +289,8 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item
|
|
|
label="使用状态"
|
|
@@ -311,20 +311,6 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item
|
|
|
- label="排序"
|
|
|
- prop="sort"
|
|
|
- >
|
|
|
- <el-input clearable
|
|
|
- style="width: 100%;"
|
|
|
- v-model="dialog.editorBox.form.data.sort"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<span
|
|
@@ -666,7 +652,10 @@ export default {
|
|
|
sort: that.tableFormDataObj[key].sort
|
|
|
})
|
|
|
}
|
|
|
- that.axios.put('pass/ems/v1/tcm0325s/', SubmitData)
|
|
|
+ console.log(SubmitData)
|
|
|
+ that.axios.put('pass/ems/v1/tcm0325s/', SubmitData, {
|
|
|
+ contentType: 'application/json'
|
|
|
+ })
|
|
|
.then(function (res) {
|
|
|
if (res.code === '0') {
|
|
|
that.$message({
|
|
@@ -687,66 +676,46 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- but_del () {
|
|
|
- let that = this;
|
|
|
- if (that.multipleSelection.length > 0) {
|
|
|
- that.$refs['dialog_form_arr'].validate((valid, obj) => {
|
|
|
- if (valid) {
|
|
|
- that.loading = true;
|
|
|
- let SubmitData = [];
|
|
|
- for (let key in that.tableFormDataObj) {
|
|
|
- SubmitData.push({
|
|
|
- powerdetecdepartment: that.tableFormDataObj[key].powerdetecdepartment,
|
|
|
- powercode: that.tableFormDataObj[key].powercode,
|
|
|
- powername: that.tableFormDataObj[key].powername,
|
|
|
- usestate: that.tableFormDataObj[key].usestate,
|
|
|
- sort: that.tableFormDataObj[key].sort
|
|
|
- })
|
|
|
- }
|
|
|
- that.axios.delete('pass/ems/v1/tcm0325s/', SubmitData)
|
|
|
- .then(function (res) {
|
|
|
+ but_del_plural () {
|
|
|
+ let that = this;
|
|
|
+ if (that.multipleSelection.length > 0) {
|
|
|
+ let SubmitData = [];
|
|
|
+ for (let item of that.multipleSelection) {
|
|
|
+ SubmitData.push({
|
|
|
+ powerdetecdepartment: item.powerdetecdepartment,
|
|
|
+ powercode: item.powercode,
|
|
|
+ powername: item.powername,
|
|
|
+ usestate: item.usestate,
|
|
|
+ sort: item.sort
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.$confirm('是否删除已选数据?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ state: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ that.axios.delete('pass/ems/v1/tcm0325s/', {
|
|
|
+ data: SubmitData,
|
|
|
+ contentType: 'application/json;charset=UTF-8'
|
|
|
+ })
|
|
|
+ .then(function (res) {
|
|
|
if (res.code === '0') {
|
|
|
that.$message({
|
|
|
- message: '删除成功',
|
|
|
- type: 'success'
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success'
|
|
|
});
|
|
|
that.getTableData();
|
|
|
- that.dialog.editorBox.show = false;
|
|
|
- } else {
|
|
|
- that.$message.error(res.message);
|
|
|
- }
|
|
|
- that.loading = false;
|
|
|
- })
|
|
|
- .catch(function () {
|
|
|
- that.loading = false;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ }).catch(function () {
|
|
|
});
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error('至少要选择一条数据');
|
|
|
+ }
|
|
|
}
|
|
|
- // but_del (row) {
|
|
|
- // let that = this;
|
|
|
- // that.$confirm('是否删除该条数据?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // state: 'warning'
|
|
|
- // }).then(() => {
|
|
|
- // that.axios.delete('pass/ems/v1/tcm0325s/' + row.powercode)
|
|
|
- // .then(function (res) {
|
|
|
- // if (res.code === '0') {
|
|
|
- // that.$message({
|
|
|
- // message: '删除成功',
|
|
|
- // type: 'success'
|
|
|
- // });
|
|
|
- // that.getTableData();
|
|
|
- // } else {
|
|
|
- // that.$message.error(res.message);
|
|
|
- // }
|
|
|
- // }).catch(function () {
|
|
|
- // });
|
|
|
- // }).catch(() => {
|
|
|
- // });
|
|
|
- // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|