Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
commit
d86cedd4bf
|
|
@ -3,7 +3,11 @@ ENV = 'development'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
#VUE_APP_BASE_API = 'http://10.0.11.127:8000/api'
|
#VUE_APP_BASE_API = 'http://10.0.11.127:8000/api'
|
||||||
VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
#VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
||||||
|
#VUE_APP_BASE_API = 'https://testsearch.ctc.ac.cn/api'
|
||||||
|
|
||||||
|
VUE_APP_BASE_API = 'http://47.95.0.242:9101/api'
|
||||||
|
|
||||||
|
|
||||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||||
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,31 @@ export function deletes(data)
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function createDocument(data) {
|
||||||
|
return request({
|
||||||
|
url: '/quality/document/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDocumentList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/quality/document/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function deleteDocument(id) {
|
||||||
|
return request({
|
||||||
|
url: `/quality/document/${id}/`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function updateDocument(id, data) {
|
||||||
|
return request({
|
||||||
|
url: `/quality/document/${id}/`,
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -194,7 +194,12 @@ export const asyncRoutes = [
|
||||||
meta: { title: '任务执行', perms: ['my_inspecttask'] },
|
meta: { title: '任务执行', perms: ['my_inspecttask'] },
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'InspectDoc',
|
||||||
|
name: 'InspectDoc',
|
||||||
|
component: () => import('@/views/qualityinspect/inspectdoc.vue'),
|
||||||
|
meta: { title: '质量文档', perms: ['inspectdoc'] }
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,274 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddContent"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="contentList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
max-height="600"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="文件名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件描述">
|
||||||
|
<template slot-scope="scope">{{ scope.row.description }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件格式">
|
||||||
|
<template slot-scope="scope">{{ scope.row.file_.mime }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="文件下载">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.file_.file">
|
||||||
|
<el-link :href="scope.row.file_.file" type="primary">下载</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="200px"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
:disabled="!checkPermission(['content'])"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleEdit(scope)"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
:disabled="!checkPermission(['content'])"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="contentList.count > 0"
|
||||||
|
:total="contentList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getDocumentList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="dialogType === 'edit' ? '编辑资料' : '新增资料'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="Content"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-form-item label="文档名称" prop="name">
|
||||||
|
<el-input v-model="Content.name" placeholder="文档名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="" prop="description">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="4"
|
||||||
|
v-model="Content.description"
|
||||||
|
placeholder="文档描述"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文档描述" prop="file" v-if="dialogVisible">
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:action="upUrl"
|
||||||
|
:on-preview="handlePreview"
|
||||||
|
:on-success="handleUpSuccess"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:headers="upHeaders"
|
||||||
|
:file-list="fileList"
|
||||||
|
:limit="1"
|
||||||
|
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary">上传文件</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getDocumentList,
|
||||||
|
createDocument,
|
||||||
|
deleteDocument,
|
||||||
|
updateDocument,
|
||||||
|
} from "@/api/inspection";
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import { getDictList, getDictTypeList } from "@/api/dict";
|
||||||
|
import { upUrl, upHeaders } from "@/api/file";
|
||||||
|
const defaultContent = {
|
||||||
|
name: "",
|
||||||
|
description: "",
|
||||||
|
file:null
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination, Treeselect },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
upHeaders: upHeaders(),
|
||||||
|
upUrl: upUrl(),
|
||||||
|
fileList:[],
|
||||||
|
Content: defaultContent,
|
||||||
|
|
||||||
|
typeOptions: [],
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
contentList: {
|
||||||
|
count:0
|
||||||
|
},
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
filterOrgText: "",
|
||||||
|
treeLoding: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {
|
||||||
|
filterOrgText(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handlePreview(file) {
|
||||||
|
if ("url" in file) {
|
||||||
|
window.open(file.url);
|
||||||
|
} else {
|
||||||
|
window.open(file.response.data.path);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleUpSuccess(res, file, filelist) {
|
||||||
|
this.Content.file = res.data.id;
|
||||||
|
|
||||||
|
},
|
||||||
|
handleRemove(file, filelist){
|
||||||
|
this.Content.file = null;
|
||||||
|
},
|
||||||
|
checkPermission,
|
||||||
|
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getDocumentList().then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.contentList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleAddContent() {
|
||||||
|
this.Content = Object.assign({}, defaultContent);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.fileList=[]
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.Content = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogType = "edit";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
if (this.Content.file) {
|
||||||
|
this.fileList = [
|
||||||
|
{
|
||||||
|
name:this.Content.file_.name,
|
||||||
|
url: this.Content.file,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleteDocument(scope.row.id);
|
||||||
|
this.getList();
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async confirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogType === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
console.log(this.Content)
|
||||||
|
updateDocument(this.Content.id, this.Content).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createDocument(this.Content).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -2,9 +2,13 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
|
||||||
<el-card>
|
<el-card>
|
||||||
|
<el-input v-model="memberName" style="width: 380px" placeholder="请输入内容"></el-input>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="reset">重置</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="subinspecttasklist"
|
:data="subinspecttasklist"
|
||||||
|
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
stripe
|
stripe
|
||||||
|
|
@ -31,9 +35,10 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="巡查公司数">
|
<el-table-column align="center" label="巡查公司数">
|
||||||
<template slot-scope="scope">{{ scope.row.depts_count }}</template>
|
<template slot-scope="scope">{{ scope.row.depts_count }}</template>
|
||||||
</el-table-column>
|
</el-table-column >
|
||||||
<el-table-column align="center" label="组长">
|
<el-table-column align="center"
|
||||||
<template slot-scope="scope">
|
label="组长">
|
||||||
|
<template slot-scope="scope" >
|
||||||
<span v-for="item in scope.row.members" v-bind:key="item.member">
|
<span v-for="item in scope.row.members" v-bind:key="item.member">
|
||||||
|
|
||||||
<el-tag v-if="item.type=='组长'" effect="plain">{{
|
<el-tag v-if="item.type=='组长'" effect="plain">{{
|
||||||
|
|
@ -48,10 +53,11 @@
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="200px"
|
width="200px"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link @click="handleClick(scope)" type="primary">执行</el-link>
|
<el-link @click="handleClick(scope)" type="primary">执行</el-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -81,6 +87,8 @@ export default {
|
||||||
subinspecttasklist:[],
|
subinspecttasklist:[],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
memberName:"",
|
||||||
|
memberlist:[],
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -103,12 +111,17 @@ export default {
|
||||||
getsubinspecttaskselflist().then((response) => {
|
getsubinspecttaskselflist().then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.subinspecttasklist = response.data;
|
this.subinspecttasklist = response.data;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleClick(scope){
|
handleClick(scope){
|
||||||
this.$router.push({name: "myTaskdos", params: { id: scope.row.id,leaders:scope.row.members }, })
|
this.$router.push({name: "myTaskdos", params: { id: scope.row.id,leaders:scope.row.members }, })
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleFilter() {
|
handleFilter() {
|
||||||
|
|
@ -116,6 +129,32 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
search() {
|
||||||
|
for(var i=0;i<this.subinspecttasklist.length;i++ )
|
||||||
|
{
|
||||||
|
for(var j=0;j<this.subinspecttasklist[i].members.length;j++ )
|
||||||
|
{
|
||||||
|
|
||||||
|
if(this.subinspecttasklist[i].members[j].member__name==this.memberName && this.subinspecttasklist[i].members[j].type=="组长")
|
||||||
|
{
|
||||||
|
console.log(this.memberName)
|
||||||
|
|
||||||
|
this.memberlist.push(this.subinspecttasklist[i],)
|
||||||
|
console.log( this.memberlist)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
this.subinspecttasklist=this.memberlist;
|
||||||
|
this.memberlist=[];
|
||||||
|
},
|
||||||
|
reset(){
|
||||||
|
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue