|
@@ -960,25 +960,29 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- //添加删除判断,只能删除未开始的营期
|
|
|
- console.log(row.periodStatus)
|
|
|
- if(row.periodStatus !== 1){
|
|
|
- this.$message.error('营期处于进行中或者结束,不能删除');
|
|
|
- return;
|
|
|
- }
|
|
|
+ async handleDelete(row) {
|
|
|
const periodIds = row.periodId || this.ids;
|
|
|
- this.$confirm('是否确认删除该营期?', "提示", {
|
|
|
+
|
|
|
+ try {
|
|
|
+ await this.$confirm('是否确认删除该营期?', "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delPeriod(periodIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
+ });
|
|
|
+
|
|
|
+ const res = await delPeriod(periodIds);
|
|
|
+
|
|
|
+ if (res && res.code === 200) {
|
|
|
+ this.getList(); // 刷新列表
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const queryParams = this.queryParams;
|