|
|
@@ -0,0 +1,692 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-card class="box-card" :style="DivStyle">
|
|
|
+ <div slot="header">
|
|
|
+ <span>
|
|
|
+ <i class="icon icon-table2">位置树</i>
|
|
|
+ </span>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-select ref="refQueryProjectType" style="margin-right:10px; margin-top: -4px;" size="mini" v-model="QueryProjectTypeId" clearable filterable placeholder="按设备类型查询" @change="ProjectTypeChangeHandler" @clear="ProjectTypeClearHandler">
|
|
|
+ <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" size="mini" style="margin-right:10px; margin-top: -4px;" @click="newEntity">新增检测地点</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="newPositionEntity">新增安装位置</el-button>
|
|
|
+ </span>
|
|
|
+ <!--<el-form ref="form" :inline="true" style="float: right; margin-top: -10px;">
|
|
|
+ <el-form-item label="样品名称">
|
|
|
+ <el-input size="mini" style="width: 165px;" v-model="keyword" placeholder="请输入样品名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="seachdata">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>-->
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-tree style="height: 570px; overflow: auto;" draggable highlight-current :expand-on-click-node="true" node-key="id" :data="customerTreeList" :props="orgtreeprops"
|
|
|
+ :default-expanded-keys="defaultSelect" @node-click="orgtreeNodeClick" ref="orgmanagetree">
|
|
|
+ </el-tree>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-table :data="entityList" border style="height: 570px; overflow: auto;" size="small">
|
|
|
+ <el-table-column label="操作" width="150" align="center" fixed>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.Parentid !== 0">
|
|
|
+ <el-button type="primary" plain size="mini" @click="editEntity(scope.row)"
|
|
|
+ title="编辑">编辑</el-button>
|
|
|
+ <el-button plain size="mini" @click="deleteConfirm(scope.row)" title="删除"
|
|
|
+ style="margin-left: 3px">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-for="column in tableColumns"
|
|
|
+ :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip :key="column.prop" ></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ jstimehandle(scope.row.CreateOn+'') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!--分页-->
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </el-card>
|
|
|
+ <!--新增、编辑样品类型-->
|
|
|
+ <el-dialog title="检测地点信息" :visible.sync="dialogVisible" width="720px" size="small">
|
|
|
+ <el-form :model="formData" ref="EntityForm" label-width="120px" label-position="top">
|
|
|
+ <el-form-item label="受检单位" required>
|
|
|
+ <!--<el-select ref="ThrUnitSelect" v-model="formData.ThrUnitId" style="width:100%" placeholder="请选择" filterable >
|
|
|
+ <el-option v-for="item in thrUnitList" :key="item.Id" :label="item.Fullname" :value="item.Id"></el-option>
|
|
|
+ </el-select>-->
|
|
|
+ <el-input v-model="formData.ThrUnit" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="检测地点名称" required>
|
|
|
+ <el-input v-model="formData.PositionName" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false" size="small">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveEntity()" size="small">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="安装位置信息" :visible.sync="positionDialogVisible" width="720px" size="small">
|
|
|
+ <el-form :model="formData" ref="EntityForm2" label-width="120px">
|
|
|
+
|
|
|
+ <el-form-item label="检测地点">
|
|
|
+ <el-select v-model="formData.ParentId" style="width:100%" placeholder="请选择" filterable required>
|
|
|
+ <el-option v-for="item in customerOrigList" :key="item.Id" :label="item.PositionName" :value="item.Id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="设备类型" prop="ProjectTypeId" required>
|
|
|
+ <el-select ref="refProjectTypeId" v-model="formData.ProjectTypeId" style="width:100%" filterable placeholder="请选择">
|
|
|
+ <el-option v-for="item in projectTypeList" :key="item.id" :label="item.FullName" :value="item.Id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="位置名称" required>
|
|
|
+ <el-input v-model="formData.PositionName" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="排序码" required>
|
|
|
+ <el-input-number v-model="formData.SortCode" :step="1" :min="0" label="排序码"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="positionDialogVisible = false" size="small">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="savePositionEntity()" size="small">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!--<el-dialog title="编辑" :visible.sync="dialogVisible" width="720px" size="small">
|
|
|
+ <el-form :model="formData" ref="EntityForm" label-width="120px">
|
|
|
+
|
|
|
+ <el-form-item label="上级位置">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-input ref="nodeRootInput" v-model="tmpShowSelectNodeName" placeholder="请输入" readonly style="width: 100%">
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-button-group>
|
|
|
+ <el-button @click="setNodeParentZero">根节点</el-button>
|
|
|
+ <el-button @click="setNodeParentCurrent">当前</el-button>
|
|
|
+ <el-popover
|
|
|
+ placement="top-start"
|
|
|
+ title="其它节点"
|
|
|
+ width="200"
|
|
|
+ v-model="otherNodeVisible"
|
|
|
+ trigger="manual">
|
|
|
+ <el-cascader :options="customerTreeList" :props="orgtreeprops" v-model="selectedorg" @change="getProject"
|
|
|
+ change-on-select placeholder="请选择位置" clearable filterable style="width: 100%"></el-cascader>
|
|
|
+ <el-button slot="reference" @click="otherNodeVisible = !otherNodeVisible">其它</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </el-button-group>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="客户位置名称">
|
|
|
+ <el-input v-model="formData.PositionName" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!–<el-form-item label="位置类型">
|
|
|
+ <el-input v-model="formData.PositionTypeId" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>–>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveEntity()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>-->
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { mapGetters } from 'vuex'
|
|
|
+ import api from '@/api/lims/customerposition'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ name: 'customerposition',
|
|
|
+ props: {
|
|
|
+ CustomerId: Number,
|
|
|
+ DivStyle: String,
|
|
|
+ },
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ QueryProjectTypeId: null,
|
|
|
+ otherNodeVisible: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ positionDialogVisible: false,
|
|
|
+ defaultSelect: [],
|
|
|
+ customerTreeList: [],
|
|
|
+ customerOrigList: [],
|
|
|
+ projectTypeList: [],
|
|
|
+ selectedorg: [],
|
|
|
+ thrUnitList: [],
|
|
|
+ selectNodeId: '0',
|
|
|
+ selectNodeName: '根节点',
|
|
|
+ tmpShowSelectNodeName: '',
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'PositionName',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ //列表数据
|
|
|
+ entityList: [],
|
|
|
+ //分页参数
|
|
|
+ size: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ currentItemCount: 0,
|
|
|
+ //列表排序
|
|
|
+ Column: {
|
|
|
+ Order: '',
|
|
|
+ Prop: ''
|
|
|
+ },
|
|
|
+ formDataReset: {
|
|
|
+ Id: 0,
|
|
|
+ CustomerId: 0,
|
|
|
+ ParentId: 0,
|
|
|
+ AuthCode: '',
|
|
|
+ PositionName: '',
|
|
|
+ PositionCode: '',
|
|
|
+ PositionType: '',
|
|
|
+ PositionTypeId: 1,
|
|
|
+ ProjectType: '',
|
|
|
+ ProjectTypeId: 0,
|
|
|
+ SortCode: 0,
|
|
|
+ CreateOn: '',
|
|
|
+ CreateUserId: 0,
|
|
|
+ CreateBy: '',
|
|
|
+ ModifiedOn: '',
|
|
|
+ ModifiedUserId: '',
|
|
|
+ ModifiedBy: '',
|
|
|
+
|
|
|
+ },
|
|
|
+ formData: {
|
|
|
+ Id: 0,
|
|
|
+ CustomerId: 0,
|
|
|
+ ParentId: 0,
|
|
|
+ AuthCode: '',
|
|
|
+ PositionName: '',
|
|
|
+ PositionCode: '',
|
|
|
+ PositionType: '',
|
|
|
+ PositionTypeId: 0,
|
|
|
+ ProjectType: '',
|
|
|
+ ProjectTypeId: 0,
|
|
|
+ SortCode: 0,
|
|
|
+ CreateOn: '',
|
|
|
+ CreateUserId: 0,
|
|
|
+ CreateBy: '',
|
|
|
+ ModifiedOn: '',
|
|
|
+ ModifiedUserId: '',
|
|
|
+ ModifiedBy: '',
|
|
|
+
|
|
|
+ },
|
|
|
+ //查询时间
|
|
|
+ CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ prop: "PositionName",
|
|
|
+ label: '客户位置名称',
|
|
|
+ width: 200,
|
|
|
+ sort: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "PositionType",
|
|
|
+ label: '位置类型',
|
|
|
+ width: 100,
|
|
|
+ sort: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "ProjectType",
|
|
|
+ label: '设备类型',
|
|
|
+ sort: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "SortCode",
|
|
|
+ label: '排序码',
|
|
|
+ width: 80,
|
|
|
+ sort: true
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // {
|
|
|
+ // prop: "CreateOn",
|
|
|
+ // label: '创建时间',
|
|
|
+ // width: 100,
|
|
|
+ // sort: true
|
|
|
+ // },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: "CreateBy",
|
|
|
+ label: '创建人',
|
|
|
+ width: 100,
|
|
|
+ sort: true
|
|
|
+ },
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //查询列表
|
|
|
+ this.customerCheckBuildList()
|
|
|
+ this.gettreelist()
|
|
|
+ this.initDatas()
|
|
|
+ // this.getDictOptions()
|
|
|
+ this.getProjectType()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initEntity (id) {
|
|
|
+ if (id) {
|
|
|
+ api.getEntity(id, this.$axios).then(res => {
|
|
|
+ this.formData = res.data
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ ProjectTypeChangeHandler() {
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+
|
|
|
+ ProjectTypeClearHandler() {
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+
|
|
|
+ initDatas() {
|
|
|
+ //分页及列表条件
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ ParentId: this.selectNodeId + "",
|
|
|
+ CustomerId: this.CustomerId + "",
|
|
|
+ ProjectTypeId: this.QueryProjectTypeId + '',
|
|
|
+ outCustomer: 'true'
|
|
|
+ };
|
|
|
+
|
|
|
+ //访问接口
|
|
|
+ api.getList('', params, this.$axios).then(res => {
|
|
|
+ this.entityList = res.data.items;
|
|
|
+ this.currentItemCount = res.data.currentItemCount;
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 保存信息
|
|
|
+ saveEntity () {
|
|
|
+ if (!this.formData.ThrUnit) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '受检单位不能为空'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$refs['EntityForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.formData.CustomerId = this.CustomerId
|
|
|
+ this.formData.ParentId = 0
|
|
|
+ this.formData.PositionType = '检测地点'
|
|
|
+ this.formData.PositionTypeId = '1'
|
|
|
+ if (!this.formData.Id) {
|
|
|
+ this.addEntity()
|
|
|
+ } else {
|
|
|
+ this.updateEntity()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ savePositionEntity () {
|
|
|
+ if (!this.formData.ParentId) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '检测地点不能为空'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.formData.ProjectTypeId) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '设备类型不能为空'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.formData.PositionName) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '位置名称不能为空'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs['EntityForm2'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.formData.CustomerId = this.CustomerId
|
|
|
+ this.formData.PositionType = '安装位置'
|
|
|
+ this.formData.PositionTypeId = '2'
|
|
|
+ this.formData.ProjectType = this.$refs['refProjectTypeId'].selectedLabel
|
|
|
+ if (!this.formData.Id) {
|
|
|
+ this.addEntity()
|
|
|
+ } else {
|
|
|
+ this.updateEntity()
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ addEntity() {
|
|
|
+ api.addEntity(this.formData, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ //保存成功后,初始化数据,变成修改
|
|
|
+ this.formData.Id = res.data.item;
|
|
|
+ this.initDatas();
|
|
|
+ this.gettreelist();
|
|
|
+ this.customerCheckBuildList();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.positionDialogVisible = false
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ updateEntity() {
|
|
|
+ api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ //保存成功后,初始化数据,变成修改
|
|
|
+ this.initDatas();
|
|
|
+ this.gettreelist();
|
|
|
+ this.customerCheckBuildList();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.positionDialogVisible = false
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /*getDictOptions () {
|
|
|
+ api.getDictList(this.$axios).then(res => {
|
|
|
+ console.log(res.data.items)
|
|
|
+ this.thrUnitList = res.data.items['ThrUnitList']
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },*/
|
|
|
+
|
|
|
+
|
|
|
+ setNodeParentZero() {
|
|
|
+ this.formData.ParentId = 0;
|
|
|
+ this.tmpShowSelectNodeName = "根节点";
|
|
|
+ },
|
|
|
+
|
|
|
+ setNodeParentCurrent() {
|
|
|
+ this.formData.ParentId = this.selectNodeId;
|
|
|
+ this.tmpShowSelectNodeName = this.selectNodeName;
|
|
|
+ },
|
|
|
+
|
|
|
+ orgtreeNodeClick(data) {
|
|
|
+ this.selectNodeId = data.id + '';
|
|
|
+ this.selectNodeName = data.PositionName + '';
|
|
|
+
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.initDatas();
|
|
|
+ },
|
|
|
+
|
|
|
+ searchCommand(command) {
|
|
|
+ if (command == 'search') {
|
|
|
+ this.dialogVisible = true
|
|
|
+ } else if (command == 'clear') {
|
|
|
+ this.clearSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //列表排序功能
|
|
|
+ orderby(column) {
|
|
|
+ if (column.order == 'ascending') {
|
|
|
+ this.Column.Order = 'asc'
|
|
|
+ } else if (column.order == 'descending') {
|
|
|
+ this.Column.Order = 'desc'
|
|
|
+ }
|
|
|
+ this.Column.Prop = column.prop
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleCurrentChange(value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ handleSizeChange(value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initDatas()
|
|
|
+ },
|
|
|
+ deleteConfirm(row) {
|
|
|
+ this.$confirm('此操作将永久删除该位置, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.deleteEntity(row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteEntity(row) {
|
|
|
+ row.deleteConfirmFlag = false;
|
|
|
+ api.deleteEntity(row.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.initDatas();
|
|
|
+ this.gettreelist();
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ customerCheckBuildList() {
|
|
|
+ let params = {
|
|
|
+ CustomerId: this.CustomerId + "",
|
|
|
+ }
|
|
|
+ api.customerCheckBuildList(params, this.$axios).then(res => {
|
|
|
+ this.customerOrigList = res.data.items
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ gettreelist() {
|
|
|
+ let params = {
|
|
|
+ CustomerId: this.CustomerId + '',
|
|
|
+ };
|
|
|
+
|
|
|
+ api.customerPositionTreeOut(params, this.$axios).then(res => {
|
|
|
+ this.customerTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId',
|
|
|
+ 'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId');
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ editEntity (row) {
|
|
|
+ this.initEntity(row.Id)
|
|
|
+ if (row.PositionTypeId === '1') {
|
|
|
+ this.dialogVisible = true
|
|
|
+ } else {
|
|
|
+ this.positionDialogVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ formReset () {
|
|
|
+ this.formData.Id = 0
|
|
|
+ this.formData.CustomerId = 0
|
|
|
+ this.formData.ParentId = 0
|
|
|
+ this.formData.AuthCode = ''
|
|
|
+ this.formData.PositionName = ''
|
|
|
+ this.formData.PositionCode = ''
|
|
|
+ this.formData.PositionType = ''
|
|
|
+ this.formData.PositionTypeId = 0
|
|
|
+ this.formData.ProjectType = ''
|
|
|
+ this.formData.ProjectTypeId = 0
|
|
|
+ this.formData.SortCode = 0
|
|
|
+ this.formData.CreateOn = ''
|
|
|
+ this.formData.CreateUserId = 0
|
|
|
+ this.formData.CreateBy = ''
|
|
|
+ this.formData.ModifiedOn = ''
|
|
|
+ this.formData.ModifiedUserId = ''
|
|
|
+ this.formData.ModifiedBy = ''
|
|
|
+ },
|
|
|
+
|
|
|
+ newEntity () {
|
|
|
+ this.formReset()
|
|
|
+ this.dialogVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ newPositionEntity () {
|
|
|
+ this.formReset()
|
|
|
+ if (this.selectNodeId) {
|
|
|
+ this.formData.ParentId = parseInt(this.selectNodeId)
|
|
|
+ } else {
|
|
|
+ this.formData.ParentId = null
|
|
|
+ }
|
|
|
+ this.positionDialogVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ getParentNode(parentId) {
|
|
|
+ api.getEntity(parentId, this.$axios).then(res => {
|
|
|
+ this.tmpShowSelectNodeName = res.data.PositionName;
|
|
|
+ }).catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ jstimehandle(val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 10)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ formatDateTime(date) {
|
|
|
+ var y = date.getFullYear();
|
|
|
+ var m = date.getMonth() + 1;
|
|
|
+ m = m < 10 ? ('0' + m) : m;
|
|
|
+ var d = date.getDate();
|
|
|
+ d = d < 10 ? ('0' + d) : d;
|
|
|
+ var h = date.getHours();
|
|
|
+ var minute = date.getMinutes();
|
|
|
+ minute = minute < 10 ? ('0' + minute) : minute;
|
|
|
+ return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
|
|
|
+ },
|
|
|
+
|
|
|
+ //设备类型
|
|
|
+ getProjectType() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/testtype/testypetreeall', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.testTypeList = res.data.items
|
|
|
+ if (!_this.testTypeList) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for (var i = 0; i < _this.testTypeList.length; i++) {
|
|
|
+ if (_this.testTypeList[i].ParentId == 0) {
|
|
|
+ _this.projectTypeList.push(_this.testTypeList[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .triggerone {
|
|
|
+ font-size: 13px;
|
|
|
+ margin-left: 80px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .plab {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+</style>
|