|
|
|
@ -154,6 +154,30 @@
|
|
|
|
|
v-hasPermi="['tcZz/netManage:zdgzxm:export']"
|
|
|
|
|
>导出</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-upload
|
|
|
|
|
style="display: inline-block; margin: 0 10px"
|
|
|
|
|
class='upload-demo'
|
|
|
|
|
ref="upload"
|
|
|
|
|
action="1"
|
|
|
|
|
:limit="1"
|
|
|
|
|
accept=".xlsx, .xls"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:http-request="exportFile"
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" size="mini">导入</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<el-button type="success" size="mini" @click="enable" :disabled="multiple"
|
|
|
|
|
>启用</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="banned"
|
|
|
|
|
autofocus
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
>禁用</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table v-loading="loading" :data="zdgzxmList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
@ -299,7 +323,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listZdgzxm, getZdgzxm, delZdgzxm, addZdgzxm, updateZdgzxm, exportZdgzxm } from "@/api/tcZz/netManage/zdgzxm";
|
|
|
|
|
import { listZdgzxm, getZdgzxm, delZdgzxm, addZdgzxm, updateZdgzxm, exportZdgzxm, updateIsStatus, importExcel } from "@/api/tcZz/netManage/zdgzxm";
|
|
|
|
|
export default {
|
|
|
|
|
name: "Zdgzxm",
|
|
|
|
|
//注释字典
|
|
|
|
@ -370,7 +394,8 @@
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fileList:[],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -452,6 +477,30 @@
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
//批量启用
|
|
|
|
|
enable(row) {
|
|
|
|
|
this.isStatusFuc(row, 1);
|
|
|
|
|
},
|
|
|
|
|
//批量禁用
|
|
|
|
|
banned(row) {
|
|
|
|
|
this.isStatusFuc(row, 2);
|
|
|
|
|
},
|
|
|
|
|
isStatusFuc(row, e) {
|
|
|
|
|
const ids = row.id || this.ids.join(",");
|
|
|
|
|
const src = e == 1 ? "启动" : "禁用";
|
|
|
|
|
this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(function () {
|
|
|
|
|
return updateIsStatus({ ids: ids, isStatus: e });
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.getList(e);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/**查看按钮操作 */
|
|
|
|
|
handleInfo(row){
|
|
|
|
|
this.reset();
|
|
|
|
@ -536,13 +585,31 @@
|
|
|
|
|
}, '重点工作项目_'+ new Date().getTime() +'.xlsx')
|
|
|
|
|
this.exportLoading = false;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 导入按钮操作 */
|
|
|
|
|
exportFile(e) {
|
|
|
|
|
let downloadLoadingInstance = Loading.service({
|
|
|
|
|
text: "正在导入数据,请稍候",
|
|
|
|
|
spinner: "el-icon-loading",
|
|
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
});
|
|
|
|
|
let a = new FormData();
|
|
|
|
|
a.append("file", e.file);
|
|
|
|
|
importExcel(a)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
downloadLoadingInstance.close();
|
|
|
|
|
this.$model.msgSuccess("导入成功");
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
downloadLoadingInstance.close();
|
|
|
|
|
this.$model.msgError("导入失败");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scope>
|
|
|
|
|
::v-deep .el-textarea {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|