失效按钮 页面项目

main
yangzhicheng 12 months ago
parent 13ce81c0f2
commit da9f152be5
  1. 3
      src/api/inspection/inspectionroute.js
  2. 50
      src/views/inspection/inspectionroute.vue
  3. 12
      src/views/inspection/inspectionrouteDetail.vue

@ -58,12 +58,13 @@ export const takeEffect = (ids) => {
}) })
} }
export const lapse = (ids) => { export const lapse = (ids, reason) => {
return request({ return request({
url: '/api/inspection/inspectionRoute/lapse', url: '/api/inspection/inspectionRoute/lapse',
method: 'post', method: 'post',
params: { params: {
ids, ids,
reason,
} }
}) })
} }

@ -56,6 +56,22 @@
<el-button v-if="permission.inspectionroute_delete" @click="rowDel(row)" type="text">删除</el-button> <el-button v-if="permission.inspectionroute_delete" @click="rowDel(row)" type="text">删除</el-button>
</template> </template>
</avue-crud> </avue-crud>
<el-dialog title="失效"
append-to-body
:visible.sync="cancelBox"
width="555px">
<avue-form :option="cancelOption" v-model="cancelForm" ref="cancelForm">
</avue-form>
<div class="container">
<span>
<el-button type="primary"
size="small"
plain
@click="handleDetailCancel">失效
</el-button>
</span>
</div>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
@ -72,6 +88,7 @@
search:{}, search:{},
query: {}, query: {},
loading: true, loading: true,
cancelBox: false,
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -136,6 +153,25 @@
}, },
] ]
}, },
cancelForm: {},
cancelOption: {
height: 'auto',
calcHeight: 210,
emptyBtn:false,
submitBtn:false,
tip: false,
border: true,
index: false,
selection: true,
column: [
{
label: "取消原因",
type: "textarea",
prop: "cancelReason",
span: 24
},
]
},
data: [] data: []
}; };
}, },
@ -197,6 +233,8 @@
return remove(row.id); return remove(row.id);
}) })
.then(() => { .then(() => {
const cancelReason = this.findObject(this.cancelOption.column, "cancelReason");
cancelReason.value = ' ';
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
@ -271,21 +309,25 @@
this.$message.warning("请选择至少一条数据"); this.$message.warning("请选择至少一条数据");
return; return;
} }
this.cancelBox = true;
},
handleDetailCancel() {
this.$confirm("是否将选择数据改为失效状态?", { this.$confirm("是否将选择数据改为失效状态?", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
return lapse(this.ids); return lapse(this.ids, this.cancelForm.cancelReason);
}) })
.then(() => { .then(() => {
this.cancelBox = false;
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
}); });
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection()
}); });
}, },
handleExport() { handleExport() {
@ -350,4 +392,8 @@
background-color: #3366cc !important; background-color: #3366cc !important;
color: #FFFFFF !important; color: #FFFFFF !important;
} }
.container {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
</style> </style>

@ -39,6 +39,7 @@
{ {
label: "路线编号", label: "路线编号",
prop: "routeNo", prop: "routeNo",
display: true,
span: 8, span: 8,
}, },
{ {
@ -106,6 +107,7 @@
{ {
label: "取消原因", label: "取消原因",
prop: "cancelReason", prop: "cancelReason",
span: 8,
}, },
] ]
}, },
@ -132,9 +134,13 @@
this.addUpdateShowButton = false; this.addUpdateShowButton = false;
this.frame_class = 'frame_class'; this.frame_class = 'frame_class';
}else{ }else{
const column = this.findObject(this.option.column, "routeNo"); const routeNo = this.findObject(this.option.column, "routeNo");
column.value = ' '; routeNo.value = ' ';
column.disabled = true; routeNo.disabled = true;
const iStatus = this.findObject(this.option.column, "istatus");
iStatus.display = false;
const cancelReason = this.findObject(this.option.column, "cancelReason");
cancelReason.display = false;
this.readonlyForm = false; this.readonlyForm = false;
this.addUpdateShowButton = true; this.addUpdateShowButton = true;
this.frame_class = null; this.frame_class = null;

Loading…
Cancel
Save