Browse Source

bug

feature
tianqian 2 years ago
parent
commit
0c995bcc27
  1. 53
      src/views/dataBoard/sida/cpts/fw02gxxq.vue
  2. 36
      src/views/dataBoard/sida/cpts/fw03zr.vue
  3. 2
      src/views/dataBoard/sida/cpts/fwBarOption01.js
  4. 2
      src/views/dataBoard/sida/cpts/fwBarOption04.js
  5. 2
      src/views/dataBoard/sida/cpts/fwBarOption05.js
  6. 1
      src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/addForm.vue
  7. 8
      src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/record.vue
  8. 215
      src/views/modules/shequzhili/tuceng/anquan/shebei/record.vue
  9. 8
      src/views/modules/shequzhili/tuceng/anquan/yinhuan/record.vue
  10. 9
      src/views/modules/shequzhili/tuceng/yingji/wuzi/record.vue
  11. 10
      src/views/modules/shequzhili/tuceng/zhonghe/shebei/record.vue

53
src/views/dataBoard/sida/cpts/fw02gxxq.vue

@ -1,7 +1,8 @@
<template> <template>
<div class="m-zyqd"> <div class="m-zyqd">
<div class="pieMain pieMain3"> <div class="pieMain pieMain3">
<div class="pie"><screen-echarts-frame @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame></div> <div class="pie"><screen-echarts-frame @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame>
</div>
<div class="legend"> <div class="legend">
<div class="legend-row" :key="'pie' + item.name" v-for="item in pieData" @click="handleClickItem(item)"> <div class="legend-row" :key="'pie' + item.name" v-for="item in pieData" @click="handleClickItem(item)">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.name }}</div>
@ -17,7 +18,9 @@
<script> <script>
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index'; import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
// import { pieOption } from './fwqdPieOption.js'; // import { pieOption } from './fwqdPieOption.js';
import { requestPostBi } from '@/js/dai/request-bipass'; import {
requestPostBi
} from '@/js/dai/request-bipass';
export default { export default {
props: { props: {
orgId: { orgId: {
@ -32,15 +35,16 @@ export default {
timer: null, timer: null,
pieChart: '', pieChart: '',
pieOption: { pieOption: {
color: ['#1A95FF', '#FF6138', '#2adcea', '#2cc4ad', '#7377f5', '#32de66', '#8155d4', '#c7ea48', '#ef47c2', 'd43349'], color: ['#1A95FF', '#FF6138', '#2adcea', '#2cc4ad', '#7377f5', '#32de66', '#8155d4', '#c7ea48',
'#ef47c2', 'd43349'
],
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
}, },
series: [ series: [{
{
name: '', name: '',
type: 'pie', type: 'pie',
radius: [40, 130], radius: [70, 130],
center: ['50%', '50%'], center: ['50%', '50%'],
// roseType: 'area', // roseType: 'area',
itemStyle: { itemStyle: {
@ -48,15 +52,22 @@ export default {
}, },
avoidLabelOverlap: false, avoidLabelOverlap: false,
labelLine: { labelLine: {
show: false show: true,
length: 50
}, },
label: { label: {
normal: { normal: {
position: 'inner',
show: true, show: true,
formatter: '{d}%', formatter: '{title|{b}}\n{d}%',
fontSize: 24, fontSize: 24,
color: '#FFFFFF' color: '#FFFFFF',
rich: {
title: {
fontSize: 12,
height: 25,
},
}
} }
}, },
emphasis: { emphasis: {
@ -67,12 +78,10 @@ export default {
} }
}, },
data: [] data: []
} }]
]
}, },
pieInitState: false, pieInitState: false,
pieData: [], pieData: [],
info: [] info: []
}; };
}, },
@ -82,7 +91,6 @@ export default {
mounted() { mounted() {
this.init(); this.init();
}, },
watch: { watch: {
currentTab() { currentTab() {
this.setPieData(); this.setPieData();
@ -96,24 +104,23 @@ export default {
await this.getInfo(); await this.getInfo();
this.getPie(); this.getPie();
}, },
// //
async getInfo() { async getInfo() {
let url = 'common_demand_response'; let url = 'common_demand_response';
this.$refs.pieChart.showLoading(); this.$refs.pieChart.showLoading();
const { data, code, msg } = await requestPostBi( const {
url, data,
{ code,
msg
} = await requestPostBi(url, {
queryParam: { queryParam: {
org_id: this.orgId, org_id: this.orgId,
start_date: this.searchDate[0], start_date: this.searchDate[0],
end_date: this.searchDate[1] end_date: this.searchDate[1]
} }
}, }, {
{
// mockId: 69366649, // mockId: 69366649,
} });
);
this.$refs.pieChart.hideLoading(); this.$refs.pieChart.hideLoading();
if (code === 0) { if (code === 0) {
if (data && Array.isArray(data) && data.length > 0) { if (data && Array.isArray(data) && data.length > 0) {
@ -156,7 +163,6 @@ export default {
async iniPieChart() { async iniPieChart() {
this.$refs.pieChart.clear(); this.$refs.pieChart.clear();
// pieChart // pieChart
this.pieOption.series[0].name = this.currentTab; this.pieOption.series[0].name = this.currentTab;
this.pieOption.series[0].data = this.pieData; this.pieOption.series[0].data = this.pieData;
this.$refs.pieChart.setOption(this.pieOption); this.$refs.pieChart.setOption(this.pieOption);
@ -164,7 +170,6 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style> <style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>
<style scoped lang="scss"> <style scoped lang="scss">
/deep/.pieMain3 { /deep/.pieMain3 {

36
src/views/dataBoard/sida/cpts/fw03zr.vue

@ -15,14 +15,15 @@
</el-col> </el-col>
</el-row> </el-row>
<div class="tablist"> <div class="tablist">
<div v-for="item in tabList" :key="item" :class="['item', { 'item-sel': currentTab == item }]" @click="changTab(item)">{{ item }}</div> <div v-for="item in tabList" :key="item" :class="['item', { 'item-sel': currentTab == item }]"
@click="changTab(item)">{{ item }}</div>
</div> </div>
<div> <div>
<div class="linecharts" v-if="resiCategoryData.length > 0"> <div class="linecharts" v-if="resiCategoryData.length > 0">
<div class="item" :key="index" v-for="(item, index) in resiCategoryData"> <div class="item" :key="index" v-for="(item, index) in resiCategoryData">
<div>{{ ('0' + (index + 1)).substr(-2) }}.</div> <div>{{ ('0' + (index + 1)).substr(-2) }}.</div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
<div class="item-progress"><b :style="{ width: + '0%' }"></b></div> <div class="item-progress"><b :style="{ 'width': item.per }"></b></div>
<div class="item-count"> <div class="item-count">
<b>{{ item.count }}</b> <b>{{ item.count }}</b>
</div> </div>
@ -41,7 +42,9 @@
</template> </template>
<script> <script>
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index'; import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
import { requestPostBi } from '@/js/dai/request-bipass'; import {
requestPostBi
} from '@/js/dai/request-bipass';
export default { export default {
props: { props: {
orgId: { orgId: {
@ -78,11 +81,12 @@ export default {
this.currentTab = item this.currentTab = item
if (item == '服务次数排名') { if (item == '服务次数排名') {
this.resiCategoryData = [...this.lineData1]; this.resiCategoryData = [...this.lineData1];
this.total = this.total1
} else { } else {
this.resiCategoryData = [...this.lineData2]; this.resiCategoryData = [...this.lineData2];
this.total = this.total2
} }
}, },
async init() { async init() {
this.getResiCategoryData(); this.getResiCategoryData();
}, },
@ -109,37 +113,37 @@ export default {
}, },
async getResiCategoryData() { async getResiCategoryData() {
let url = 'service_search_person'; let url = 'service_search_person';
const {
const { data, code, msg } = await requestPostBi( data,
url, code,
{ msg
} = await requestPostBi(url, {
queryParam: { queryParam: {
org_id: this.orgId, org_id: this.orgId,
start_date: this.searchDate[0], start_date: this.searchDate[0],
end_date: this.searchDate[1] end_date: this.searchDate[1]
} }
}, }, {
{
// mockId: 60031937, // mockId: 60031937,
} });
);
if (code === 0) { if (code === 0) {
this.info = data[0]; this.info = data[0];
console.log(this.info);
this.lineData1 = this.info.child_service_num.map(item => { this.lineData1 = this.info.child_service_num.map(item => {
return { return {
name: item.common_service_type_name, name: item.common_service_type_name,
count: item.service_num count: item.service_num,
per: (item.service_num / this.info.service_total * 100).toFixed(2) + '%'
}; };
}); });
console.log(this.lineData1);
this.lineData2 = this.info.child_service_person_num.map(item => { this.lineData2 = this.info.child_service_person_num.map(item => {
return { return {
name: item.common_service_type_name, name: item.common_service_type_name,
count: item.service_person_num count: item.service_person_num,
per: (item.service_person_num / this.info.service_person_total * 100).toFixed(2) + '%'
}; };
}); });
this.resiCategoryData = [...this.lineData1]; this.resiCategoryData = [...this.lineData1];
console.log(this.resiCategoryData)
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }

2
src/views/dataBoard/sida/cpts/fwBarOption01.js

@ -53,7 +53,7 @@ export function pieOption() {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
max: 1000,
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,

2
src/views/dataBoard/sida/cpts/fwBarOption04.js

@ -53,7 +53,7 @@ export function pieOption() {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
max: 1000,
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,

2
src/views/dataBoard/sida/cpts/fwBarOption05.js

@ -53,7 +53,7 @@ export function pieOption() {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
max: 1000,
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,

1
src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/addForm.vue

@ -341,6 +341,7 @@ export default {
if (code === 0) { if (code === 0) {
this.$message.success('操作成功'); this.$message.success('操作成功');
this.detailIdcopy=data.enterpriseId; this.detailIdcopy=data.enterpriseId;
// this.handleCancle(); // this.handleCancle();
// // this.resetData(); // // this.resetData();
// this.$emit('handleComfirm'); // this.$emit('handleComfirm');

8
src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/record.vue

@ -119,10 +119,11 @@
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<!-- v-if="formType == 'edit'" -->
<el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -202,6 +203,7 @@ export default {
watch: { watch: {
id: { id: {
handler(val) { handler(val) {
console.log("ddddddddddddd",val)
if (val.length > 0) { if (val.length > 0) {
this.btnDisabled = false; this.btnDisabled = false;
// this.getList(); // this.getList();
@ -343,10 +345,12 @@ export default {
}, },
async save(row) { async save(row) {
const params = { const params = {
...row,
enterpriseId: this.id, enterpriseId: this.id,
...row
}; };
console.log("params",params)
const url = `/actual/base/enterprise/addorupdate-patrol`; const url = `/actual/base/enterprise/addorupdate-patrol`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {

215
src/views/modules/shequzhili/tuceng/anquan/shebei/record.vue

@ -8,61 +8,40 @@
<div class="m-table-item"> <div class="m-table-item">
<el-table :data="tableData" class="resi-table" row-key="id" border style="width: 100%"> <el-table :data="tableData" class="resi-table" row-key="id" border style="width: 100%">
<el-table-column label="序号" type="index" align="center" width="50"></el-table-column> <el-table-column label="序号" type="index" align="center" width="50"></el-table-column>
<el-table-column prop="inspectTime" label="检查时间" align="center" width="200px"> <el-table-column prop="inspectTime" label="检查时间" align="center" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker <el-date-picker v-if="scope.row.isEdit" v-model="scope.row.inspectTime" type="date"
v-if="scope.row.isEdit" class="input-width" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
v-model="scope.row.inspectTime"
type="date"
class="input-width"
value-format="yyyy-MM-dd"
placeholder="选择日期"
></el-date-picker>
<div v-else class="div-content">{{ scope.row.inspectTime }}</div> <div v-else class="div-content">{{ scope.row.inspectTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px"> <el-table-column prop="inspectStaffId" label="检查人员" align="center" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select v-if="scope.row.isEdit" v-model="scope.row.inspectStaffId" placeholder="请选择"
v-if="scope.row.isEdit" class="input-width" @change="handleChangeStaff(scope.row)" clearable>
v-model="scope.row.inspectStaffId" <el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label"
placeholder="请选择" :value="subItem.value"></el-option>
class="input-width"
@change="handleChangeStaff(scope.row)"
clearable
>
<el-option v-for="subItem in optionStaff" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option>
</el-select> </el-select>
<div v-else class="div-content">{{ scope.row.inspectStaffName }}</div> <div v-else class="div-content">{{ scope.row.inspectStaffName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px"> <el-table-column prop="inspectStaffMobile" label="联系电话" align="center" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-if="scope.row.isEdit" type="number" v-model="scope.row.inspectStaffMobile"
v-if="scope.row.isEdit" placeholder="请输入" class="input-width" clearable disabled></el-input>
type="number"
v-model="scope.row.inspectStaffMobile"
placeholder="请输入"
class="input-width"
clearable
disabled
></el-input>
<div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div> <div v-else class="div-content">{{ scope.row.inspectStaffMobile }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inspectResult" label="检查结果" align="center"> <el-table-column prop="inspectResult" label="检查结果" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable> <el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择"
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option> class="input-width" size="small" clearable>
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label"
:value="subItem.value"></el-option>
</el-select> </el-select>
<div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div> <div v-else class="div-content">{{ scope.row.inspectResult == 1 ? '正常' : '异常' }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
prop="detailed" prop="detailed"
label="隐患明细" label="隐患明细"
@ -84,66 +63,50 @@
</div> </div>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column prop="imgList" label="图片列表" align="center" width="150px"> <el-table-column prop="imgList" label="图片列表" align="center" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.isEdit"> <div v-if="scope.row.isEdit">
<el-upload <el-upload :disabled="scope.row.imgList.length == 3" :headers="$getElUploadHeaders()"
:disabled="scope.row.imgList.length == 3" class="avatar-uploader" :action="uploadUrl" :data="{ customerId: customerId }"
:headers="$getElUploadHeaders()" :show-file-list="true" :limit="3" :file-list="scope.row.imgShowList"
class="avatar-uploader"
:action="uploadUrl"
:data="{ customerId: customerId }"
:show-file-list="true"
:limit="3"
:file-list="scope.row.imgShowList"
:on-success="res => handleImgSuccess(res, scope.row)" :on-success="res => handleImgSuccess(res, scope.row)"
:on-remove="res => handleImgRemove(res, scope.row)" :on-remove="res => handleImgRemove(res, scope.row)" list-type="picture"
list-type="picture" :before-upload="beforeImgUpload">
:before-upload="beforeImgUpload" <div v-if="scope.row.imgList.length != 3"><i
> class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片</div>
<div v-if="scope.row.imgList.length != 3"><i class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片</div>
</el-upload> </el-upload>
</div> </div>
<div v-else class="div-content"> <div v-else class="div-content">
<el-image <el-image v-if="scope.row.imgList.length > 0" style="width: 100px; height: 50px"
v-if="scope.row.imgList.length > 0" :src="scope.row.imgList[0]" fit="cover"
style="width: 100px; height: 50px" :preview-src-list="scope.row.imgList"></el-image>
:src="scope.row.imgList[0]"
fit="cover"
:preview-src-list="scope.row.imgList"
></el-image>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px"> <el-table-column prop="nextInspectTime" label="拟复查时间" align="center" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker <el-date-picker v-if="scope.row.isEdit" v-model="scope.row.nextInspectTime" type="date"
v-if="scope.row.isEdit" class="input-width" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
v-model="scope.row.nextInspectTime"
type="date"
class="input-width"
value-format="yyyy-MM-dd"
placeholder="选择日期"
></el-date-picker>
<div v-else class="div-content">{{ scope.row.nextInspectTime }}</div> <div v-else class="div-content">{{ scope.row.nextInspectTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!disabled" fixed="right" label="操作" align="center" width="120"> <el-table-column v-if="!disabled" fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.isEdit"> <template v-if="scope.row.isEdit">
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button> <el-button @click="handleEdit(scope.row)" type="text" size="small"
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> class="btn-color-edit">保存</el-button>
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small"
class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <!-- v-if="formType == 'edit'" -->
修改 <el-button @click="handleChange(scope.row, 'edit')"
type="text" size="small" :disabled="disabled" class="btn-color-edit"> 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?"
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del"
style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
</template> </template>
@ -153,9 +116,11 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { requestPost, requestGet } from '@/js/dai/request'; import {
requestPost,
requestGet
} from '@/js/dai/request';
export default { export default {
props: { props: {
id: { id: {
@ -184,23 +149,18 @@ export default {
return { return {
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'), customerId: localStorage.getItem('customerId'),
btnDisabled: false, btnDisabled: false,
btnType: 'cancle', btnType: 'cancle',
isEdit: false, isEdit: false,
tableData: [], tableData: [],
tempRow: {}, tempRow: {},
optionResult: [{
optionResult: [
{
label: '异常', label: '异常',
value: '0' value: '0'
}, }, {
{
label: '正常', label: '正常',
value: '1' value: '1'
} }],
],
optionStaff: [ optionStaff: [
// { // {
// label: "", // label: "",
@ -209,11 +169,12 @@ export default {
] ]
}; };
}, },
computed: { computed: {
allowOperate() { allowOperate() {
const { const {
info: { agencyId } info: {
agencyId
}
} = this; } = this;
return agencyId && agencyId == this.$store.state.user.agencyId; return agencyId && agencyId == this.$store.state.user.agencyId;
} }
@ -230,7 +191,6 @@ export default {
immediate: true immediate: true
} }
}, },
created() { created() {
console.log('id', this.id); console.log('id', this.id);
this.getOptionStaff(); this.getOptionStaff();
@ -240,14 +200,12 @@ export default {
this.handleAdd(); this.handleAdd();
} }
}, },
methods: { methods: {
beforeImgUpload(file) { beforeImgUpload(file) {
console.log(file); console.log(file);
const isLt1M = file.size / 1024 / 1024 < 10; const isLt1M = file.size / 1024 / 1024 < 10;
const srcType = file.type; const srcType = file.type;
const format = file.name.split('.').pop(); const format = file.name.split('.').pop();
if (!isLt1M) { if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!'); this.$message.error('上传文件大小不能超过 10MB!');
return false; return false;
@ -258,7 +216,6 @@ export default {
} }
return true; return true;
}, },
handleImgSuccess(res, row) { handleImgSuccess(res, row) {
console.log('handleImgSuccess', res); console.log('handleImgSuccess', res);
if (res.code === 0 && res.msg === 'success') { if (res.code === 0 && res.msg === 'success') {
@ -268,13 +225,14 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}, },
computeImgShowList(row) { computeImgShowList(row) {
row.imgShowList = row.imgList.map(url => { row.imgShowList = row.imgList.map(url => {
return { name: '', url }; return {
name: '',
url
};
}); });
}, },
handleImgRemove(file, row) { handleImgRemove(file, row) {
console.log('handleImgRemove', file); console.log('handleImgRemove', file);
let url = file.url || file.response.data.url; let url = file.url || file.response.data.url;
@ -283,50 +241,59 @@ export default {
this.computeImgShowList(row); this.computeImgShowList(row);
} }
}, },
getRowClass({
getRowClass({ rowIndex, columnIndex }) { rowIndex,
columnIndex
}) {
if (rowIndex === 0) { if (rowIndex === 0) {
return 'background: #2195fe; color: #fff;'; return 'background: #2195fe; color: #fff;';
} }
}, },
handleChange(row, type) { handleChange(row, type) {
console.log('type----', type); console.log('type----', type);
if (type == 'cancle') { if (type == 'cancle') {
row = { ...this.tempRow }; row = {
...this.tempRow
};
row.isEdit = false; row.isEdit = false;
if (this.btnType == 'add') this.tableData.pop(); if (this.btnType == 'add') this.tableData.pop();
this.getList(); this.getList();
console.log('row----', row); console.log('row----', row);
} else { } else {
this.tempRow = { ...row }; this.tempRow = {
...row
};
row.isEdit = true; row.isEdit = true;
} }
this.btnType = type; this.btnType = type;
this.isEdit = !this.isEdit; this.isEdit = !this.isEdit;
}, },
handleChangeStaff(row) { handleChangeStaff(row) {
const { inspectStaffId } = row; const {
const { optionStaff } = this; inspectStaffId
} = row;
const {
optionStaff
} = this;
let item = optionStaff.find(item => item.value == inspectStaffId); let item = optionStaff.find(item => item.value == inspectStaffId);
if (item) { if (item) {
row.inspectStaffName = item.name; row.inspectStaffName = item.name;
row.inspectStaffMobile = item.mobile; row.inspectStaffMobile = item.mobile;
} }
}, },
async getOptionStaff() { async getOptionStaff() {
let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`; let url = `/data/aggregator/org/staff-select-list/${this.$store.state.user.agencyId}`;
const { data, code, msg } = await requestPost(url, {}); const {
data,
code,
msg
} = await requestPost(url, {});
if (code === 0) { if (code === 0) {
this.optionStaff = data || []; this.optionStaff = data || [];
} else { } else {
this.$message.error('请求工作人员数据失败!'); this.$message.error('请求工作人员数据失败!');
} }
}, },
async handleEdit(row) { async handleEdit(row) {
// if (row.result == '0' && row.reviewTime == '') { // if (row.result == '0' && row.reviewTime == '') {
// this.$message.error(''); // this.$message.error('');
@ -347,11 +314,9 @@ export default {
this.$message.error('请先保存上方信息'); this.$message.error('请先保存上方信息');
} }
}, },
handleAdd() { handleAdd() {
this.btnType = 'add'; this.btnType = 'add';
this.isEdit = true; this.isEdit = true;
const item = { const item = {
isEdit: true, isEdit: true,
// id: this.id, // id: this.id,
@ -364,17 +329,22 @@ export default {
nextInspectTime: '' nextInspectTime: ''
}; };
this.computeImgShowList(item); this.computeImgShowList(item);
if (!this.disabled) { this.tableData.push(item); } if (!this.disabled) {
this.tableData.push(item);
}
}, },
async save(row) { async save(row) {
console.log(row, this.id); console.log(row, this.id);
const params = { const params = {
equipmentId: this.id, ...row,
...row equipmentId: this.id
}; };
const url = `/actual/base/safetyEquipmentInspectRecord/save`; const url = `/actual/base/safetyEquipmentInspectRecord/save`;
const { data, code, msg } = await requestPost(url, params); const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.$message.success('保存成功'); this.$message.success('保存成功');
row.isEdit = false; row.isEdit = false;
@ -385,14 +355,17 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async edit(row) { async edit(row) {
console.log(row, this.id); console.log(row, this.id);
const params = { const params = {
...row ...row
}; };
const url = `/actual/base/safetyEquipmentInspectRecord/update`; const url = `/actual/base/safetyEquipmentInspectRecord/update`;
const { data, code, msg } = await requestPost(url, params); const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.$message.success('保存成功'); this.$message.success('保存成功');
row.isEdit = false; row.isEdit = false;
@ -402,12 +375,14 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async del(row) { async del(row) {
let arr = [row.id]; let arr = [row.id];
const url = `/actual/base/safetyEquipmentInspectRecord/delete`; const url = `/actual/base/safetyEquipmentInspectRecord/delete`;
const { data, code, msg } = await requestPost(url, arr); const {
data,
code,
msg
} = await requestPost(url, arr);
if (code === 0) { if (code === 0) {
this.$message.success('删除成功'); this.$message.success('删除成功');
this.getList(); this.getList();
@ -415,7 +390,6 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
async getList() { async getList() {
const params = { const params = {
equipmentId: this.id, equipmentId: this.id,
@ -423,8 +397,11 @@ export default {
pageSize: 10000 pageSize: 10000
}; };
const url = `/actual/base/safetyEquipmentInspectRecord/page`; const url = `/actual/base/safetyEquipmentInspectRecord/page`;
const { data, code, msg } = await requestPost(url, params); const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.tableData = data.list.map(item => { this.tableData = data.list.map(item => {
this.computeImgShowList(item); this.computeImgShowList(item);
@ -441,7 +418,6 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/assets/scss/buttonstyle.scss'; @import '@/assets/scss/buttonstyle.scss';
@import '@/assets/scss/modules/management/list-main.scss'; @import '@/assets/scss/modules/management/list-main.scss';
@ -449,6 +425,7 @@ export default {
.mt10 { .mt10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
.input-width { .input-width {
width: 170px; width: 170px;
} }

8
src/views/modules/shequzhili/tuceng/anquan/yinhuan/record.vue

@ -54,11 +54,12 @@
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button> <el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">保存</el-button>
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<!-- v-if="formType == 'edit'" -->
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -273,7 +274,8 @@ export default {
async save(row) { async save(row) {
const params = { const params = {
...row ...row,
hiddenDangerRecordId: this.id,
}; };
const url = `/actual/base/hiddenDangerRecord/saveProcess`; const url = `/actual/base/hiddenDangerRecord/saveProcess`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);

9
src/views/modules/shequzhili/tuceng/yingji/wuzi/record.vue

@ -138,10 +138,11 @@
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <!-- v-if="formType == 'edit'" -->
<el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -369,8 +370,8 @@ export default {
async save(row) { async save(row) {
const params = { const params = {
equipmentId: this.id, ...row,
...row equipmentId: this.id
}; };
const url = `/actual/base/emergencyEquipment/inspect-save`; const url = `/actual/base/emergencyEquipment/inspect-save`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);

10
src/views/modules/shequzhili/tuceng/zhonghe/shebei/record.vue

@ -139,10 +139,11 @@
<el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button> <el-button @click="handleChange(scope.row, 'cancle')" type="text" size="small" class="btn-color-edit">取消</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button v-if="formType == 'edit'" @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit"> <!-- v-if="formType == 'edit'" -->
<el-button @click="handleChange(scope.row, 'edit')" type="text" size="small" :disabled="disabled" class="btn-color-edit">
修改 修改
</el-button> </el-button>
<el-popconfirm v-if="formType == 'edit'" title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)"> <el-popconfirm title="删除之后无法恢复,确认删除?" @onConfirm="del(scope.row)" @confirm="del(scope.row)">
<el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button> <el-button slot="reference" type="text" size="small" class="btn-color-del" style="margin-left: 10px">删除</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -363,8 +364,9 @@ export default {
async save(row) { async save(row) {
console.log(row, this.id); console.log(row, this.id);
const params = { const params = {
equipmentId: this.id,
...row ...row,
equipmentId: this.id
}; };
const url = `/actual/base/monitoringEquipmentInspectRecord/save`; const url = `/actual/base/monitoringEquipmentInspectRecord/save`;
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);

Loading…
Cancel
Save