测试问题修改

master
zhangdi 1 year ago
parent 6f0457633a
commit a086b2993a
  1. 69
      src/views/businessManagement/ordinary.vue
  2. 4
      src/views/device/deviceSystem.vue
  3. 4
      src/views/goodsManagement/reciviceList.vue
  4. 757
      src/views/labManagement/inspectionManagement.vue
  5. 4
      src/views/system/dept.vue
  6. 32
      src/views/system/user.vue
  7. 2
      src/views/workbench/index.vue
  8. 4
      vue.config.js

@ -45,8 +45,10 @@
<el-button v-show="permission.ordinaryClose && row.status == 101" @click="handleClone(row)">关闭</el-button> <el-button v-show="permission.ordinaryClose && row.status == 101" @click="handleClone(row)">关闭</el-button>
<el-button v-show="permission.ordinaryConfirm && row.status == 201" @click="reciveOrder(row)">确认</el-button> <el-button v-show="permission.ordinaryConfirm && row.status == 201" @click="reciveOrder(row)">确认</el-button>
<!-- 维修人员驳回 -->
<el-button v-show="permission.ordinaryRefuse && row.status == 201" @click="repairReject(row)">驳回</el-button> <el-button v-show="permission.ordinaryRefuse && row.status == 201" @click="repairReject(row)">驳回</el-button>
<el-button @click="handleExport(row)" <el-button @click="handleExport(row)"
v-show="row.status == 104 || row.status == 403 || row.status == 202 || row.status == 203 || row.status == 204">报告</el-button> v-show="row.status == 104 || row.status == 403 || row.status == 202 || row.status == 203 || row.status == 204">报告</el-button>
@ -1572,20 +1574,20 @@ export default {
handleReject() { handleReject() {
this.$refs.rejectForm.validate((valid) => { this.$refs.rejectForm.validate((valid) => {
if (valid) { if (valid) {
if (this.role_id == '1839552581620793346') { // if (this.role_id == '1839552581620793346') {
let query = { let query = {
id: this.rejectForm.id, id: this.rejectForm.id,
repaiRejectReason: this.rejectForm.reason repaiRejectReason: this.rejectForm.reason
}
servicemanReject(query).then(res => {
if (res.data.code == 200) {
this.$message.success('驳回成功')
this.rejectForm = {}
this.rejectVisible = false
this.onLoad()
}
})
} }
servicemanReject(query).then(res => {
if (res.data.code == 200) {
this.$message.success('驳回成功')
this.rejectForm = {}
this.rejectVisible = false
this.onLoad()
}
})
// }
} }
}) })
@ -1715,7 +1717,23 @@ export default {
this.$message.error('请至少填写一条维修材料信息') this.$message.error('请至少填写一条维修材料信息')
} else { } else {
let data = [] let data = []
let goodsList = []
this.tableData.map((item, index) => { this.tableData.map((item, index) => {
goodsList.push({
productId: item.id,
productName: item.productName,
applyNum: item.number,
orderId: this.repairForm.id,
materialName: item.productName,
materialCount: item.number,
materialPrice: item.price,
bigClassId: item.productType.node,
rule: item.rule,
unit: item.unit,
xh: item.xh,
inventoryId: item.inventoryId
// outNum:""
})
data.push({ data.push({
orderId: this.repairForm.id, orderId: this.repairForm.id,
materialName: item.productName, materialName: item.productName,
@ -1746,14 +1764,15 @@ export default {
query.discount = 0 query.discount = 0
} }
let query1 = { let query1 = {
details: data, details: goodsList,
applyUserId: this.userInfo.user_id, //Id applyUserId: this.userInfo.user_id, //Id
applyUser: this.userInfo.user_name, // applyUser: this.userInfo.user_name, //
applyTime: moment().format('YYYY-MM-DD HH:mm:ss'), //(yyyy-MM-dd HH:mm:ss) applyTime: moment().format('YYYY-MM-DD HH:mm:ss'), //(yyyy-MM-dd HH:mm:ss)
status: 0, status: 0,
workId: this.addForm.id, workId: this.repairForm.id,
remark:'维修单申领' remark: '维修单申领'
} }
editData(query).then(res => { editData(query).then(res => {
@ -2015,15 +2034,15 @@ export default {
workId: this.addForm.id, workId: this.addForm.id,
} }
// applyGoods(query1).then(res => { // applyGoods(query1).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
servicemanReceive({ id: this.addForm.id }).then(res => { servicemanReceive({ id: this.addForm.id }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('提交成功') this.$message.success('提交成功')
this.dialogVisible = false this.dialogVisible = false
this.onLoad() this.onLoad()
} }
}) })
} }
// }) // })
} }
} else { } else {

@ -127,8 +127,8 @@
format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="请选择生产时间"> format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="请选择生产时间">
</el-date-picker> </el-date-picker>
</el-form-item> --> </el-form-item> -->
<el-form-item label="描述" prop="supplier"> <el-form-item label="备注" prop="supplier">
<el-input style="width: 98%;" :disabled="viewType == 'view'" placeholder="请输入描述" <el-input style="width: 98%;" :disabled="viewType == 'view'" placeholder="请输入备注"
v-model="addForm.description"></el-input> v-model="addForm.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="关联实验室" prop="lab"> <el-form-item label="关联实验室" prop="lab">

@ -12,7 +12,7 @@
<el-table-column label="型号" prop="xh"></el-table-column> <el-table-column label="型号" prop="xh"></el-table-column>
<el-table-column label="参数" prop="rule"></el-table-column> <el-table-column label="参数" prop="rule"></el-table-column>
<el-table-column label="申领数量" prop="applyNum"></el-table-column> <el-table-column label="申领数量" prop="applyNum"></el-table-column>
<el-table-column label="出库数量" prop="outNum"></el-table-column> <el-table-column label="实际出库数量" prop="outNum"></el-table-column>
<el-table-column label="归还日期" prop="returnTime"></el-table-column> <el-table-column label="归还日期" prop="returnTime"></el-table-column>
</el-table> </el-table>
</template> </template>
@ -57,7 +57,7 @@
<el-table-column label="型号" :resizable="false" prop="xh"></el-table-column> <el-table-column label="型号" :resizable="false" prop="xh"></el-table-column>
<el-table-column label="参数" :resizable="false" prop="rule"></el-table-column> <el-table-column label="参数" :resizable="false" prop="rule"></el-table-column>
<el-table-column label="申领数量" :resizable="false" prop="applyNum"></el-table-column> <el-table-column label="申领数量" :resizable="false" prop="applyNum"></el-table-column>
<el-table-column label="出库数量" :resizable="false" prop="outNum" v-if="receiveForm.status != 0"> <el-table-column label="实际出库数量" :resizable="false" prop="outNum" v-if="receiveForm.status != 0">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number @change="changeCount(scope.row)" :disabled="viewType != 'import'" style="width:98%" <el-input-number @change="changeCount(scope.row)" :disabled="viewType != 'import'" style="width:98%"
:min="0" :max="scope.row.applyNum" v-model="scope.row.outNum" label="出库数量"></el-input-number> :min="0" :max="scope.row.applyNum" v-model="scope.row.outNum" label="出库数量"></el-input-number>

@ -1,46 +1,43 @@
<template> <template>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<basic-container> <basic-container>
<avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
@row-save="rowSave" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
@search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> @refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button v-show="permission.contentAdd" type="primary" size="small" <el-button v-show="permission.contentAdd" type="primary" size="small" @click="handleAdd">新建</el-button>
@click="handleAdd">新建</el-button> </template>
</template> <template slot-scope="{ row }" slot="isOpen">
<template slot-scope="{ row }" slot="isOpen"> <el-tag :type="row.isOpen == 0 ? 'danger' : 'success'">{{ row.isOpen == 0 ? '停用' : '启用'
<el-tag :type="row.isOpen == 0 ? 'danger' : 'success'">{{ row.isOpen == 0 ? '停用' : '启用' }}</el-tag>
}}</el-tag> </template>
</template> <template slot-scope="{ row }" slot="menu">
<template slot-scope="{ row }" slot="menu"> <el-button v-show="permission.contentView" @click="handleView(row)">查看</el-button>
<el-button v-show="permission.contentView" @click="handleView(row)">查看</el-button> <el-button v-show="permission.contentEdit" @click="handleEdit(row)">编辑</el-button>
<el-button v-show="permission.contentEdit" @click="handleEdit(row)">编辑</el-button> <el-button @click="startPlan(row)" v-show="row.isOpen == 0 && permission.contentSetting">启用</el-button>
<el-button @click="startPlan(row)" <el-button @click="stopPlan(row)" v-show="row.isOpen == 1 && permission.contentSetting">停用</el-button>
v-show="row.isOpen == 0 && permission.contentSetting">启用</el-button> <el-button @click="deletePlan(row)" v-show="permission.contentDelete">删除</el-button>
<el-button @click="stopPlan(row)" <el-button @click="handleDownload(row)" v-show="permission.contentDelete">下载</el-button>
v-show="row.isOpen == 1 && permission.contentSetting">停用</el-button> <el-button type="primary" @click="handleExportDevice(row)">导出</el-button>
<el-button @click="deletePlan(row)" v-show="permission.contentDelete">删除</el-button> <!-- <el-button @click="handleImport(row)">导入</el-button> -->
<el-button @click="handleDownload(row)" </template>
v-show="permission.contentDelete">下载</el-button> </avue-crud>
<el-button type="primary" @click="handleExportDevice(row)">导出</el-button> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :append-to-body="true" width="70%"
<!-- <el-button @click="handleImport(row)">导入</el-button> --> :close-on-click-modal="false">
</template> <addDialog :unitData="unitData" :title="dialogTitle" :detailForm="detailForm" ref="addDialog">
</avue-crud> </addDialog>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :append-to-body="true" width="70%" :close-on-click-modal="false"> <span slot="footer" class="dialog-footer">
<addDialog :unitData="unitData" :title="dialogTitle" :detailForm="detailForm" ref="addDialog"> <el-button @click="handleCancel"> </el-button>
</addDialog> <el-button v-show="dialogTitle != '查看'" type="primary" @click="handleConfirm"> </el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="handleCancel"> </el-button> </el-dialog>
<el-button v-show="dialogTitle != '查看'" type="primary" @click="handleConfirm"> </el-button> </basic-container>
</span> </el-col>
</el-dialog> </el-row>
</basic-container>
</el-col>
</el-row>
</template> </template>
<script> <script>
@ -49,337 +46,341 @@ import { mapGetters } from "vuex";
import JSZip from 'jszip'; import JSZip from 'jszip';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import { getLimsTree, planCreate, getContentList, getPlanDetail, dealPlan, deletePlan, editPlan } from '@/api/labManagement/inspectionManagement' import { getLimsTree, planCreate, getContentList, getPlanDetail, dealPlan, deletePlan, editPlan } from '@/api/labManagement/inspectionManagement'
import { exportBlob1 } from "@/api/common"; import { exportBlob1 } from "@/api/common";
import { downloadXls } from "@/util/util"; import { downloadXls } from "@/util/util";
export default { export default {
components: { components: {
addDialog addDialog
}, },
data() { data() {
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('请输入密码')); callback(new Error('请输入密码'));
} else { } else {
callback(); callback();
} }
}; };
const validatePass2 = (rule, value, callback) => { const validatePass2 = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('请再次输入密码')); callback(new Error('请再次输入密码'));
} else if (value !== this.form.password) { } else if (value !== this.form.password) {
callback(new Error('两次输入密码不一致!')); callback(new Error('两次输入密码不一致!'));
} else { } else {
callback(); callback();
} }
}; };
return { return {
dialogTitle: '', dialogTitle: '',
form: {}, form: {},
search: {}, search: {},
roleBox: false, roleBox: false,
excelBox: false, excelBox: false,
platformBox: false, platformBox: false,
initFlag: true, initFlag: true,
selectionList: [], selectionList: [],
query: {}, query: {},
loading: true, loading: true,
platformLoading: false, platformLoading: false,
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0 total: 0
}, },
platformPage: { platformPage: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0 total: 0
}, },
init: { init: {
roleTree: [], roleTree: [],
deptTree: [], deptTree: [],
}, },
props: { props: {
label: "title", label: "title",
value: "key" value: "key"
}, },
roleGrantList: [], roleGrantList: [],
roleTreeObj: [], roleTreeObj: [],
treeDeptId: '', treeDeptId: '',
treeData: [ treeData: [
], ],
unitData: [], unitData: [],
treeOption: { treeOption: {
nodeKey: 'id', nodeKey: 'id',
addBtn: false, addBtn: false,
menu: false, menu: false,
size: 'small', size: 'small',
props: { props: {
labelText: '标题', labelText: '标题',
label: 'title', label: 'title',
value: 'value', value: 'value',
children: 'children' children: 'children'
} }
}, },
option: { option: {
height: 'auto', height: 'auto',
calcHeight: 80, calcHeight: 80,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 6, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
addBtn: false, addBtn: false,
viewBtn: false, viewBtn: false,
editBtn: false, editBtn: false,
delBtn: false, delBtn: false,
dialogType: 'dialog', dialogType: 'dialog',
dialogClickModal: false, dialogClickModal: false,
searchShowBtn: false, searchShowBtn: false,
refreshBtn: false, refreshBtn: false,
columnBtn: false, columnBtn: false,
menuWidth: 300, menuWidth: 300,
searchShowBtn: false,   // searchShowBtn: false,   //
        refreshBtn: false,      // refreshBtn: false,      //
        columnBtn: false,       // columnBtn: false,       //
        gridBtn:false, gridBtn: false,
        excelBtn: false,       // Excel excelBtn: false,       // Excel
        printBtn: false,       // printBtn: false,       //
        filterBtn: false,      // filterBtn: false,      //
column: [ column: [
{ {
label: "巡检计划单号", label: "巡检计划单号",
labelWidth: 120, labelWidth: 120,
prop: "planCode", prop: "planCode",
search: true, search: true,
overHidden: true, overHidden: true,
}, },
{ {
label: "单位名称", label: "单位名称",
labelWidth: 120, labelWidth: 120,
prop: "deptName", prop: "deptName",
search: true, search: true,
overHidden: true, overHidden: true,
}, },
{ {
label: "巡检内容", label: "巡检内容",
labelWidth: 120, labelWidth: 120,
prop: "planContent", prop: "planContent",
overHidden: true, overHidden: true,
}, },
{ {
label: "是否启用", label: "是否启用",
labelWidth: 120, labelWidth: 120,
prop: "isOpen", prop: "isOpen",
overHidden: true, overHidden: true,
slot: true slot: true
}, },
{ {
label: "创建时间", label: "创建时间",
labelWidth: 120, labelWidth: 120,
prop: "createTime", prop: "createTime",
overHidden: true, overHidden: true,
}, },
// { // {
// label: "/", // label: "/",
// labelWidth: 120, // labelWidth: 120,
// prop: "major", // prop: "major",
// labelWidth: 120, // labelWidth: 120,
// overHidden: true, // overHidden: true,
// }, // },
// { // {
// label: "", // label: "",
// labelWidth: 120, // labelWidth: 120,
// overHidden: true, // overHidden: true,
// prop: "remark", // prop: "remark",
// }, // },
], ],
}, },
data: [], data: [],
dialogVisible: false, dialogVisible: false,
addForm: {}, addForm: {},
detailForm: {} detailForm: {}
}; };
}, },
computed: { computed: {
...mapGetters(["userInfo", "permission"]), ...mapGetters(["userInfo", "permission"]),
}, },
mounted() { mounted() {
this.tableData = this.mergeTableRow(this.tableData, ['majorName']) this.tableData = this.mergeTableRow(this.tableData, ['majorName'])
console.log('userInfo--------------->', this.userInfo) console.log('userInfo--------------->', this.userInfo)
this.getLeftLab() this.getLeftLab()
// if(this.userInfo.role_id == '1846419477876510721'){ // if(this.userInfo.role_id == '1846419477876510721'){
// this.search.deptName = this.userInfo.deptName // this.search.deptName = this.userInfo.deptName
// } // }
}, },
methods: { methods: {
handleExportDevice(row) { handleExportDevice(row) {
let query = JSON.parse(JSON.stringify(row)) let query = JSON.parse(JSON.stringify(row))
exportBlob1(`/api/lab-ops/maintenance/maintenance-plan-report`, query).then(res => { exportBlob1(`/api/lab-ops/maintenance/maintenance-plan-report`, query).then(res => {
downloadXls(res.data, "巡检计划.xlsx"); downloadXls(res.data, "巡检计划.xlsx");
}) })
}, },
objectSpanMethod({ row, column, rowIndex, columnIndex }) { objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// console.log('row--------------->',row) // console.log('row--------------->',row)
// console.log('column--------------->',column) // console.log('column--------------->',column)
// console.log('rowIndex--------------->',rowIndex) // console.log('rowIndex--------------->',rowIndex)
// console.log('columnIndex--------------->',columnIndex) // console.log('columnIndex--------------->',columnIndex)
const span = column['property'] + '-span' const span = column['property'] + '-span'
if (row[span]) { if (row[span]) {
return row[span] return row[span]
} }
}, },
// //
startPlan(row) { startPlan(row) {
this.$confirm('确定启用该计划?', '提示', { this.$confirm('确定启用该计划?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
dealPlan({ id: row.id, isOpen: 1 }).then(res => { dealPlan({ id: row.id, isOpen: 1 }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('启用成功') this.$message.success('启用成功')
this.onLoad() this.onLoad()
} }
}) })
}) })
}, },
// //
stopPlan(row) { stopPlan(row) {
this.$confirm('确定停用该计划?', '提示', { this.$confirm('确定停用该计划?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
dealPlan({ id: row.id, isOpen: 0 }).then(res => { dealPlan({ id: row.id, isOpen: 0 }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$message.success('停用成功') this.$message.success('停用成功')
this.onLoad() this.onLoad()
} }
}) })
}) })
}, },
deletePlan(row) { deletePlan(row) {
this.$confirm('确定删除该计划?', '提示', { if (row.isOpen == 1) {
confirmButtonText: '确定', this.$message.error('请先停用巡检计划!')
cancelButtonText: '取消', return false
type: 'warning' }
}).then(() => { this.$confirm('确定删除该计划?', '提示', {
deletePlan({ ids: row.id }).then(res => { confirmButtonText: '确定',
if (res.data.code == 200) { cancelButtonText: '取消',
this.$message.success('删除成功') type: 'warning'
this.onLoad() }).then(() => {
} deletePlan({ ids: row.id }).then(res => {
}) if (res.data.code == 200) {
}) this.$message.success('删除成功')
}, this.onLoad()
getFile(url) { }
return new Promise((resolve, reject) => { })
//blob })
let xmlhttp = new XMLHttpRequest(); },
xmlhttp.open("GET", url, true); getFile(url) {
xmlhttp.responseType = "blob"; return new Promise((resolve, reject) => {
xmlhttp.onload = function () { //blob
if (xmlhttp.status == 200) { let xmlhttp = new XMLHttpRequest();
resolve(xmlhttp.response); xmlhttp.open("GET", url, true);
} else { xmlhttp.responseType = "blob";
reject(xmlhttp.response); xmlhttp.onload = function () {
} if (xmlhttp.status == 200) {
}; resolve(xmlhttp.response);
xmlhttp.send(); } else {
}); reject(xmlhttp.response);
}, }
// };
handleDownload(row) { xmlhttp.send();
getPlanDetail({ id: row.id }).then(res => { });
let data = res.data.data.attaches },
if (data.length > 1) { //
const zip = new JSZip(); handleDownload(row) {
// getPlanDetail({ id: row.id }).then(res => {
const blogTitle = '合同.zip' let data = res.data.data.attaches
const cache = {}; if (data.length > 1) {
const promises = []; const zip = new JSZip();
data.forEach(item => { //
if (item.link) { const blogTitle = '合同.zip'
const promise = this.getFile(item.link).then(data => { const cache = {};
// *, ArrayBuffer const promises = [];
const arr_name = item.name.split("/"); data.forEach(item => {
const file_name = arr_name[arr_name.length - 1]; // * if (item.link) {
zip.file(file_name, data, { binary: true }); // * const promise = this.getFile(item.link).then(data => {
cache[file_name] = data; // *, ArrayBuffer
}); const arr_name = item.name.split("/");
promises.push(promise); const file_name = arr_name[arr_name.length - 1]; // *
} zip.file(file_name, data, { binary: true }); // *
}); cache[file_name] = data;
Promise.all(promises).then(() => { });
zip.generateAsync({ promises.push(promise);
type: "blob", compression: 'DEFLATE', // *STORE: ; DEFLATE }
compressionOptions: { });
level: 9 // * 1~91: 9: Promise.all(promises).then(() => {
} zip.generateAsync({
}).then(content => { type: "blob", compression: 'DEFLATE', // *STORE: ; DEFLATE
saveAs(content, blogTitle); // *file-saver compressionOptions: {
}); level: 9 // * 1~91: 9:
}); }
} else if (data.length == 1) { }).then(content => {
fetch(data[0].link, { saveAs(content, blogTitle); // *file-saver
method: 'get', });
heanders: { });
'Content-Type': 'application/json;charset=UTF-8' } else if (data.length == 1) {
} fetch(data[0].link, {
}) method: 'get',
.then(res => res.blob()) heanders: {
.then(blob => { 'Content-Type': 'application/json;charset=UTF-8'
const link = document.createElement('a') }
link.style.display = 'none' })
link.download = data[0].name// .then(res => res.blob())
link.href = URL.createObjectURL(blob) .then(blob => {
const link = document.createElement('a')
link.style.display = 'none'
link.download = data[0].name//
link.href = URL.createObjectURL(blob)
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
// URL a // URL a
URL.revokeObjectURL(link.href) URL.revokeObjectURL(link.href)
document.body.removeChild(link) document.body.removeChild(link)
}) })
}else{ } else {
this.$message.error('该巡检内容没有维护合同附件') this.$message.error('该巡检内容没有维护合同附件')
} }
}) })
}, },
/** /**
* 方法一 * 方法一
* table合并行通用 */ * table合并行通用 */
mergeTableRow(data, merge) { mergeTableRow(data, merge) {
if (!merge || merge.length === 0) { if (!merge || merge.length === 0) {
return data return data
} }
merge.forEach((m) => { merge.forEach((m) => {
const mList = {} const mList = {}
data = data && data.map((v, index) => { data = data && data.map((v, index) => {
const rowVal = v[m] const rowVal = v[m]
if (mList[rowVal] && mList[rowVal].newIndex === index) { if (mList[rowVal] && mList[rowVal].newIndex === index) {
mList[rowVal]['num']++ mList[rowVal]['num']++
mList[rowVal]['newIndex']++ mList[rowVal]['newIndex']++
data[mList[rowVal]['index']][m + '-span'].rowspan++ data[mList[rowVal]['index']][m + '-span'].rowspan++
v[m + '-span'] = { v[m + '-span'] = {
rowspan: 0, rowspan: 0,
colspan: 0 colspan: 0
} }
} else { } else {
mList[rowVal] = { num: 1, index: index, newIndex: index + 1 } mList[rowVal] = { num: 1, index: index, newIndex: index + 1 }
v[m + '-span'] = { v[m + '-span'] = {
rowspan: 1, rowspan: 1,
colspan: 1 colspan: 1
} }
} }
return v return v
}) })
}) })
return data return data
}, },
handleAdd() { handleAdd() {
this.dialogTitle = '新建' this.dialogTitle = '新建'
@ -508,34 +509,34 @@ export default {
}) })
} }
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
let query = { let query = {
deptName: this.search.deptName ? this.search.deptName : null, // deptName: this.search.deptName ? this.search.deptName : null, //
current: this.page.currentPage, // current: this.page.currentPage, //
size: this.page.pageSize // size: this.page.pageSize //
} }
this.loading = true this.loading = true
getContentList(query).then(res => { getContentList(query).then(res => {
this.data = res.data.data.records this.data = res.data.data.records
this.page.total = res.data.data.total this.page.total = res.data.data.total
this.loading = false this.loading = false
}) })
}, },
} }
}; };
</script> </script>
<style> <style>
.box { .box {
height: 800px; height: 800px;
} }
.el-scrollbar { .el-scrollbar {
height: 100%; height: 100%;
} }
.box .el-scrollbar__wrap { .box .el-scrollbar__wrap {
overflow: scroll; overflow: scroll;
} }
</style> </style>

@ -260,6 +260,7 @@ export default {
}); });
// //
done(row); done(row);
this.onLoad();
}, error => { }, error => {
window.console.log(error); window.console.log(error);
loading(); loading();
@ -273,8 +274,10 @@ export default {
}); });
// //
done(row); done(row);
this.onLoad();
}, error => { }, error => {
window.console.log(error); window.console.log(error);
loading(); loading();
}); });
}, },
@ -387,6 +390,7 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
this.data = []
getLazyList(this.parentId, Object.assign(params, this.query)).then(res => { getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
this.data = res.data.data; this.data = res.data.data;
this.loading = false; this.loading = false;

@ -728,14 +728,14 @@ export default {
row.deptId = func.join(row.deptId); row.deptId = func.join(row.deptId);
row.roleId = func.join(row.roleId); row.roleId = func.join(row.roleId);
row.postId = func.join(row.postId); row.postId = func.join(row.postId);
if (row.deptId.split(',').length > 1) { // if (row.deptId.split(',').length > 1) {
this.$message({ // this.$message({
type: "error", // type: "error",
message: "所属部门只能选择一个!" // message: ""
}); // });
loading(); // loading();
return false // return false
} // }
add(row).then(() => { add(row).then(() => {
this.initFlag = false; this.initFlag = false;
this.onLoad(this.page); this.onLoad(this.page);
@ -753,14 +753,14 @@ export default {
row.deptId = func.join(row.deptId); row.deptId = func.join(row.deptId);
row.roleId = func.join(row.roleId); row.roleId = func.join(row.roleId);
row.postId = func.join(row.postId); row.postId = func.join(row.postId);
if (row.deptId.split(',').length > 1) { // if (row.deptId.split(',').length > 1) {
this.$message({ // this.$message({
type: "error", // type: "error",
message: "所属部门只能选择一个!" // message: ""
}); // });
loading(); // loading();
return false // return false
} // }
update(row).then(() => { update(row).then(() => {
this.initFlag = false; this.initFlag = false;
this.onLoad(this.page); this.onLoad(this.page);

@ -893,7 +893,7 @@ export default {
{ {
name: '维修数量', name: '维修数量',
type: 'bar', type: 'bar',
barWidth: this.numData == 1 ? 50 : null, barWidth: this.numData == 1 ? 30 : 30,
data: this.peopleNum, data: this.peopleNum,
itemStyle: { itemStyle: {
color: '#2478f2' color: '#2478f2'

@ -28,8 +28,8 @@ module.exports = {
//本地服务接口地址 //本地服务接口地址
// target: 'http://localhost', // target: 'http://localhost',
// target:'http://192.168.0.111:80', // target:'http://192.168.0.111:80',
// target:'http://192.168.1.12:10001', target:'http://192.168.1.12:10001',
target:'http://192.168.1.4:10001', // target:'http://192.168.1.4:10001',
// target:'http://192.168.0.116:80', // target:'http://192.168.0.116:80',
// target:'http://192.168.0.108:80', // target:'http://192.168.0.108:80',
//远程演示服务地址,可用于直接启动项目 //远程演示服务地址,可用于直接启动项目

Loading…
Cancel
Save