feat: consulting/device 新增设备台账
This commit is contained in:
parent
86d9b9a3cb
commit
4761c5ae21
|
@ -0,0 +1,19 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
export function getDeviceList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/consulting/device/',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function DeviceImp(data) {
|
||||||
|
return request({
|
||||||
|
url: '/consulting/device/imp/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
|
@ -203,6 +203,11 @@ export const asyncRoutes = [
|
||||||
name: 'professional',
|
name: 'professional',
|
||||||
component: () => import('@/views/consulting/professional.vue'),
|
component: () => import('@/views/consulting/professional.vue'),
|
||||||
meta: { title: '专业领域要求', perms: ['professional_view'] }
|
meta: { title: '专业领域要求', perms: ['professional_view'] }
|
||||||
|
},{
|
||||||
|
path: 'device',
|
||||||
|
name: 'device',
|
||||||
|
component: () => import('@/views/consulting/device.vue'),
|
||||||
|
meta: { title: '设备台账', perms: ['policy_view'] }
|
||||||
}, {
|
}, {
|
||||||
path: 'validation',
|
path: 'validation',
|
||||||
name: 'validation',
|
name: 'validation',
|
||||||
|
|
|
@ -0,0 +1,243 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="输入公司名称、设备名称、规格型号、生产厂家、检测参数、采购时间搜索"
|
||||||
|
style="width: 600px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleSearch">搜索</el-button>
|
||||||
|
<el-button type="primary"
|
||||||
|
@click="importExcel"
|
||||||
|
icon="el-icon-upload"
|
||||||
|
:disabled="checkPermission['device_import']"
|
||||||
|
>导入Excel</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="700"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column align="left" label="公司名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.company_name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="设备名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.device_name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="设备编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.device_number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="规格型号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.spec }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="生产厂家">
|
||||||
|
<template slot-scope="scope">{{ scope.row.manufactor }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="检测参数">
|
||||||
|
<template slot-scope="scope">{{ scope.row.dec_parameter }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="量程">
|
||||||
|
<template slot-scope="scope">{{ scope.row.range }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="精度">
|
||||||
|
<template slot-scope="scope">{{ scope.row.precision }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="其他技术参数">
|
||||||
|
<template slot-scope="scope">{{ scope.row.other_parameter }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="使用部门">
|
||||||
|
<template slot-scope="scope">{{ scope.row.department }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="采购时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.procurement_time }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="资产原值">
|
||||||
|
<template slot-scope="scope">{{ scope.row.original_price }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="资产净值">
|
||||||
|
<template slot-scope="scope">{{ scope.row.current_price }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="原值是否含基建">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.is_infrastructure" type="success">是</el-tag>
|
||||||
|
<el-tag v-else type="danger">否</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="基建原值占比(%)">
|
||||||
|
<template slot-scope="scope">{{ scope.row.infras_percentage }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="是否有说明书">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.is_instructions" type="success">是</el-tag>
|
||||||
|
<el-tag v-else type="danger">否</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="保管人">
|
||||||
|
<template slot-scope="scope">{{ scope.row.custodian }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="存放地点">
|
||||||
|
<template slot-scope="scope">{{ scope.row.depositor }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="设备联系人">
|
||||||
|
<template slot-scope="scope">{{ scope.row.contacts }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="联系电话">
|
||||||
|
<template slot-scope="scope">{{ scope.row.tel }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="left" label="备注">
|
||||||
|
<template slot-scope="scope">{{ scope.row.remark }}</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="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="Content"
|
||||||
|
label-width="80px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1">
|
||||||
|
|
||||||
|
<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,.pdf,.zip"
|
||||||
|
>
|
||||||
|
<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()">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getDeviceList,
|
||||||
|
DeviceImp,
|
||||||
|
} from "@/api/device";
|
||||||
|
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 { upUrl, upHeaders } from "@/api/file";
|
||||||
|
const defaultContent = {
|
||||||
|
excel_path:''
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination, Treeselect },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
upHeaders: upHeaders(),
|
||||||
|
upUrl: upUrl(),
|
||||||
|
fileList:[],
|
||||||
|
Content: defaultContent,
|
||||||
|
listLoading:false,
|
||||||
|
dialogVisible: false,
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
search:'',
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
contentList: {
|
||||||
|
count:0
|
||||||
|
},
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {
|
||||||
|
filterOrgText(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSearch(){
|
||||||
|
this.listQuery.page = 1
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handlePreview(file) {
|
||||||
|
if ("url" in file) {
|
||||||
|
window.open(file.url);
|
||||||
|
} else {
|
||||||
|
window.open(file.response.data.path);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleUpSuccess(res, file, filelist) {
|
||||||
|
let that =this;
|
||||||
|
if (res.code == 201){
|
||||||
|
that.Content.excel_path = res.data.path;
|
||||||
|
}else{
|
||||||
|
that.$message.error(res.msg);
|
||||||
|
that.Content.excel_path = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
importExcel(){
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleRemove(file, filelist){
|
||||||
|
this.Content.file = null;
|
||||||
|
},
|
||||||
|
checkPermission,
|
||||||
|
getList() {
|
||||||
|
getDeviceList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.contentList = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async confirm(){
|
||||||
|
let that = this;
|
||||||
|
this.dialogVisible = false;
|
||||||
|
DeviceImp(that.Content).then(res => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
that.getList(listQuery)
|
||||||
|
that.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "上传成功"
|
||||||
|
})
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -115,8 +115,11 @@ import { options } from "runjs";
|
||||||
params: "",
|
params: "",
|
||||||
result: 10,
|
result: 10,
|
||||||
handle_result:0,
|
handle_result:0,
|
||||||
|
field:"",
|
||||||
|
a_class:true,
|
||||||
task2do: 0
|
task2do: 0
|
||||||
},
|
},
|
||||||
|
type: "add",
|
||||||
titleOption: {
|
titleOption: {
|
||||||
add: "新增能力验证结果",
|
add: "新增能力验证结果",
|
||||||
edit: "能力验证结果编辑",
|
edit: "能力验证结果编辑",
|
||||||
|
|
|
@ -704,7 +704,7 @@ class ImpMixin:
|
||||||
# 对于能力验证和监督检查进行有则跳过无则更新操作。
|
# 对于能力验证和监督检查进行有则跳过无则更新操作。
|
||||||
if repalce:
|
if repalce:
|
||||||
if types.lower()== 'pt':
|
if types.lower()== 'pt':
|
||||||
model_info = mymodel.objects.filter(name=data.get('name'), number=data.get('number'))
|
model_info = mymodel.objects.filter(name=data.get('name'), number=data.get('number'), params=data.get('params'))
|
||||||
if model_info:
|
if model_info:
|
||||||
i = i + 1
|
i = i + 1
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue