Commit cd3db3e4 authored by 李苏's avatar 李苏 💬

设备选择保养项目

parent 5f28c622
import request from 'common/src/utils/request'
/* 查询 */
export function doQuery(query) {
return request({
url: '/aqgl/sbgl/sbbymx/query',
method: 'post',
data: query||{}
})
}
/* 更新 */
export function doUpdate(query) {
return request({
url: '/aqgl/sbgl/sbbymx/update',
method: 'post',
data: query||{}
})
}
export function doAdd(query) {
return request({
url: '/aqgl/sbgl/sbbymx/add',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/aqgl/sbgl/sbbymx/delete',
method: 'post',
data: query||{}
})
}
export function doSave(query) {
return request({
url: '/aqgl/sbgl/sbbymx/save',
method: 'post',
data: query||{}
})
}
......@@ -1072,20 +1072,7 @@ export const powerRoutes=[
redirect: 'equipmentClass',
meta: {title: "设备管理", icon: "fa-cog", noCache: false, link: null,mkid:908000000},
children: [
/* 设备保养项目*/
{
component:'equipment/sbbyxm/index',
hidden:false,
meta:{
"title": "设备保养项目",
"icon": "",
"noCache": false,
"link": null,
"mkid":'908000100',
},
name:'sbbyxm',
path:"sbbyxm"
},
{
component:'equipment/equipmentClass/index',
hidden:false,
......@@ -1163,6 +1150,34 @@ export const powerRoutes=[
},
name:'inspection',
path:"inspection"
},
/* 设备保养项目*/
{
component:'equipment/sbbyxm/index',
hidden:false,
meta:{
"title": "保养项目维护",
"icon": "",
"noCache": false,
"link": null,
"mkid":'908000100',
},
name:'sbbyxm',
path:"sbbyxm"
},
/* 设备保养项目*/
{
component:'equipment/sbbymx/index',
hidden:false,
meta:{
"title": "设备保养项目",
"icon": "",
"noCache": false,
"link": null,
"mkid":'908000100',
},
name:'sbbymx',
path:"sbbymx"
}
]
},
......
<template>
<DefaultDialog :app='app'>
<div class="min_full" slot='form' style="height: 550px;border: 0px;">
<Selector :app='this' v-if='showDialog&&DialogName=="ksry"' ></Selector>
<!-- 按钮操作-->
<el-row class="tool-bar">
<!-- <ViewButton ref="view" :app='this'></ViewButton>
<AddButton ref="add" :app='this'></AddButton>
<CopyButton ref="copy" :app='this'></CopyButton>
<EditButton ref="edit" :app='this'></EditButton> -->
<el-button @click="xzry" size='mini' type="primary">导入项目</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers" style="height: 380px;">
<TablePager :showPagination='false' @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem' :delParams="'mxid'"
@getRow='getRow'>
</TablePager>
</div>
</div>
</DefaultDialog>
</template>
<script>
/* 引入需要的接口*/
import Selector from './selector'
import {
doQuery,
doAdd,
doUpdate,
doDelete
} from '@/api/equipment/sbbymx.js';
//
/* edit页面*/
import DtlEdit from './dtlEdit.vue'
import {
tableMixin_noapp
} from 'common'
export default {
props:['app'],
mixins: [tableMixin_noapp],
name: 'aqgl.pxglPxsjmx',
/* 初始额外赋值*/
async mounted() {
/* 存储试卷数据*/
this.sjdata=this.app.singleItem
//试卷的
this.queryParams.mid=this.app.singleItem.id
this.$nextTick(()=>{
this.$refs['TablePager'].pageQuery()
})
},
data() {
return {
typeObj:{
'M':'多选题',
'S':'单选题',
'J':'判断题',
'F':'填空题'
},
sjdata:{},
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogWidth:'85%',
DialogTitle:'导入试题',
/* 基础url*/
baseUrl: '/aqgl/pxgl/pxsjmx',
/* 查询参数*/
queryParams: {
info: '',
mid:''
},
/* 表格标题对应参数*/
tableTitle: [
{label: "编码", prop: "code", fieldType: "ftString",width:120},
{label: "名称", prop: "name", fieldType: "ftString",width:300},
{label: "保养周期-天", prop: "byzq", fieldType: "int",width:252},
{label: "公司", prop: "gsName", fieldType: "ftString",width:192},
{label: "停用标志", prop: "tybz", fieldType: "ftString",width:100},
{label: "停用日期", prop: "tyrq", ...this.$common('ftDateTime'),width:192},
{label: "标准工时", prop: "bzgs", fieldType: "float",width:192},
{label: "附件数", prop: "attachcount", fieldType: "int",width:192},
{label: "备注", prop: "bz", fieldType: "ftString",width:300},
{label: "维护人", prop: "whr", fieldType: "ftString",width:192},
{label: "维护时间", prop: "whsj", ...this.$common('ftDateTime'),width:192},
{label: "创建人", prop: "cjr", fieldType: "ftString",width:192},
{label: "创建时间", prop: "cjsj", ...this.$common('ftDateTime'),width:192},
]
}
},
methods: {
xzry(){
if (this.app.selectOne || this.app.clickOne) {
this.DialogTitle='选择保养项目'
this.showDialog=true
this.DialogName='ksry'
} else {
this.$warning('请选中一行操作');
}
},
drst(){
this.showDialog=true
},
/* 基础查询*/
query: doQuery,
/* 基础增*/
// apiAdd: doDtlAdd,
// /* 基础更新*/
// apiUpdate: doDtlUpdate,
// /* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
DtlEdit,
Selector
}
}
</script>
<style scoped>
</style>
<template>
<DefaultDialog :app='app'>
<div slot='form'class="min_full" style="height: 70vh;border: 0px;">
<div class="search" v-condition>
<SearchButton @click.native='search' ></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">类型:</span>
<RelSelect filterable style="width: 100%;" clearable src='aqgl/pxgl/pxst/init/type'
:match="{value:'id',label:'name'}" v-model='type'></RelSelect>
</div>
</el-col>
<el-col :span="18" class="search-col" >
<div style="height: 50px;line-height: 50px;font-size: 12px;width: 450px;">
填空题({{fcount}}/{{sjdata.fcount}}) 单选题({{scount}}/{{sjdata.scount}})多选题({{mcount}}/{{sjdata.mcount}})判断题({{jcount}}/{{sjdata.jcount}}
</div>
</el-col>
</el-row>
</div>
<div class="tablePagers">
<el-table
height='50vh'
v-loading="loading"
ref="multipleTable"
:data="tableData"
@select="selectChange"
@select-all="selectAllChange"
>
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column prop="cont" label="题目" align="center" > </el-table-column>
<el-table-column prop="type" label="类型" align="center" :formatter="transType" > </el-table-column>
</el-table>
<el-row type="flex" class="pageBanner" style="padding-top: 20px;" justify="center">
<el-pagination
background
:total="total"
:page-size="pageSize"
@size-change="pageSizeChange"
@current-change="currentPageChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30]"
layout="total, sizes, prev, pager, next"
>
</el-pagination>
</el-row>
</div>
</div>
<div slot="reFooter" class="refooter" >
<span slot="footer" class="dialog-footer" >
<el-button type="primary" @click="save()">导 入</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
doQuery,
doAdd,
doUpdate,
doDelete,
pxxmQuery,
excelimport
} from '@/api/train/questionManage';
import {
donDtlSave
} from '@/api/train/examination';
export default {
props:['app'],
data() {
return {
typeObj:{
'M':'多选题',
'S':'单选题',
'J':'判断题',
'F':'填空题'
},
type:'',
pageSize: 10,
// 唯一标识符
id: "id",
loading: false,
total: 0,
currentPage: 1,
selectedList: [
],
tableData: [],
};
},
created() {
this.sjdata=this.app.sjdata
this.selectedList=_.cloneDeep(this.app.tabData)
console.log(this.selectedList,'传入已选')
/* 试题定量*/
/* 单选题*/
/* 多选题*/
/* 判断题*/
/* 填空题*/
},
mounted() {
this.$nextTick(()=>{
this.getData(this.currentPage, this.pageSize);
})
// 页面初始化时,首次加载数据
},
computed:{
scount(){
/* 单选数量*/
let num=0
this.selectedList.forEach(item=>{
item.type=='S'&&num++
})
return num
},
mcount(){
let num=0
this.selectedList.forEach(item=>{
item.type=='M'&&num++
})
/* 多选数量*/
return num
},
jcount(){
let num=0
this.selectedList.forEach(item=>{
item.type=='J'&&num++
})
/* 判断题数量*/
return num
},
fcount(){
let num=0
this.selectedList.forEach(item=>{
item.type=='F'&&num++})
/* 填空题*/
return num
}
},
methods: {
transType(a,b,c){
let val=this.typeObj[c]
return val
},
save(){
/* 判断*/
if(this.scount>this.sjdata.scount){
this.$warning('单选题超出试卷允许设置范围')
return
}
if(this.mcount>this.sjdata.mcount){
this.$warning('多选题超出试卷允许设置范围')
return
}
if(this.jcount>this.sjdata.jcount){
this.$warning('判断题超出试卷允许设置范围')
return
}
if(this.fcount>this.sjdata.fcount){
this.$warning('填空题超出试卷允许设置范围')
return
}
let params={
id:this.sjdata.id,
datas:this.selectedList
}
donDtlSave(params).then(res=>{
if(res.success){
this.$success('导入成功')
this.app.showDialog=false
this.app.$refs['TablePager'].pageQuery()
}
})
},
search(event){
event.preventDefault();
this.getData(this.currentPage, this.pageSize);
},
// 单行前的勾选状态切换
selectChange(selectedRows, row) {
// true为选中, 0或false为取消选中
let selected = selectedRows.length && selectedRows.indexOf(row) !== -1;
if (selected) {
this.addItem(row);
} else {
this.removeItem(row);
}
},
// 全选/取消全选
selectAllChange(selectedRows) {
let selectedMarkList = this.selectedList.map((item) => item[this.id]);
// 当前页选中行的标记列表
let pageSelectedMarkList = Array.isArray(selectedRows)
? selectedRows.map((item) => item[this.id])
: [];
this.tableData.forEach((row) => {
if (pageSelectedMarkList.includes(row[this.id])) {
if (!selectedMarkList.includes(row[this.id])) {
this.addItem(row);
}
} else if (selectedMarkList.includes(row[this.id])) {
this.removeItem(row);
}
});
},
// 切换每页显示条数
pageSizeChange(newPageSize) {
this.pageSize = newPageSize;
this.getData(this.currentPage, this.pageSize);
},
// 切换页码--翻页
currentPageChange(newPage) {
this.currentPage = newPage;
this.getData(this.currentPage, this.pageSize);
},
// 更新勾选标记
updateMark() {
let selectedMarkList = this.selectedList.map((item) => item[this.id]);
this.tableData.forEach((row) => {
if (selectedMarkList.includes(row[this.id])) {
// toggleRowSelection 需在$nextTick中使用!
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(row);
});
}
});
},
// 模拟访问接口获取数据
getData(page, pageSize) {
this.loading = true;
let params={
xmid:this.sjdata.xmid,
type:this.type,
pageSize:pageSize,
pageNo:page
}
doQuery(params).then(res=>{
this.loading = false;
this.tableData=res.data.records||[]
this.total = res.data.total
this.updateMark();
})
},
// 新增选中项
addItem(item) {
this.selectedList.push(item);
},
// 移除选中项
removeItem(item) {
for (let [index, itemTemp] of this.selectedList.entries()) {
if (itemTemp[this.id] === item[this.id]) {
this.removeItemByIndex(index);
break;
}
}
},
// 根据下标移除选中项
removeItemByIndex(index, item) {
this.selectedList.splice(index, 1);
// 若有item,则是点击标签上的关闭按钮,移除选中项
if (item) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(
// 此处必须在 tableData 中查找对应的数据,否则 toggleRowSelection 会失效
this.tableData.find((row) => {
return row[this.id] === item[this.id];
}),
false
);
});
}
},
},
};
</script>
<style scoped>
.mainBox {
margin: 10px;
}
.el-tag {
margin: 10px;
}
.pageBanner {
margin: 10px;
margin-bottom: 0px;
}
</style>
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备编码" ref="code" prop="code">
<el-input :readonly="readonly" v-model="form.code" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" ref="name" prop="name">
<el-input :readonly="readonly" v-model="form.name" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="制造商" ref="productor" prop="productor">
<el-input :readonly="readonly" v-model="form.productor" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="型号" ref="model" prop="model">
<el-input :readonly="readonly" v-model="form.model" ></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="出厂编号" ref="serialno" prop="serialno">
<el-input :readonly="readonly" v-model="form.serialno" ></el-input>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="计量单位" ref="jldw" prop="jldw">
<el-input :readonly="readonly" v-model="form.jldw" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="启用日期" ref="qyrq" prop="qyrq">
<el-date-picker value-format="timestamp" style="width: 100%;" :readonly="readonly" type="date"
v-model="form.qyrq" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用地点" ref="sydd" prop="sydd">
<el-input :readonly="readonly" v-model="form.sydd" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用途" ref="yt" prop="yt">
<el-input :readonly="readonly" v-model="form.yt" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" ref="sl" prop="sl">
<el-input :readonly="readonly" v-model="form.sl" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否入档" ref="doc" prop="doc">
<el-switch
v-model="form.doc"
active-color="#13ce66"
active-value="Y" inactive-value="N"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" ref="bz" prop="bz">
<el-input type="textarea" :readonly="readonly" v-model="form.bz" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
},
/* 组件名称*/
name: "aqglSbxxEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
//ID
id:'',
//设备编码
code:'',
//档案编号
dabh:'',
//系统分类
xtfl:'0',
//设备分类
flid:'',
//名称
name:'',
//制造商
productor:'',
//型号
model:'',
//出厂编号
serialno:'',
//计量单位
jldw:'',
//启用日期
qyrq:new Date().getTime(),
//停用日期
tyrq:new Date().getTime(),
//停用标志
tybz:'',
//使用地点
sydd:'',
//用途
yt:'',
//数量
sl:'',
//出厂日期
ccrq:new Date().getTime(),
//工作级别
gzjb:'',
//跨度
kd:'',
//提升速度
tssd:'',
//运行速度
yxsd:'',
//吨位
dw:'',
//起升高度
qsgd:'',
//电机功率
djgl:'',
//安装日期
azrq:new Date().getTime(),
//安装地点
azdd:'',
//安装单位
azdw:'',
//注册编号
zcbh:'',
//检验报告编号
jybgbh:'',
//检验周期
jyzq:'',
//上次检验日期
scjyrq:new Date().getTime(),
//下次检验日期
xcjyrq:new Date().getTime(),
//检验前自检结论
jyqzjjl:'',
//实际检验日期
sjjyrq:new Date().getTime(),
//特检机构检验结论
tjjgjyjl:'',
//检验整改情况
jyzgqk:'',
//设备升级
sbsj:'',
//设备资料
sbzl:'',
//设备资料存放地点
sbzldd:'',
//未检原因
wjyy:'',
//系统名称
xtmc:'',
//参数及量程
cslc:'',
//监测因子
jcyz:'',
//类型
lx:'',
//主体材质
ztcz:'',
//容器容积
rqrj:'',
//容器净重
rqjz:'',
//设计压力
sjyl:'',
//设计温度
sjwd:'',
//最高压力
zgyl:'',
//耐压试验压力
nysyyl:'',
//管径与壁厚
gjbh:'',
//管道级别
gdjb:'',
//管道起点
gdqd:'',
//管道终点
gdzd:'',
//压力
yl:'',
//铺设方式
psfs:'',
//工作温度
gzwd:'',
//工作压力
gzyl:'',
//输送介质
ssjz:'',
//焊口数量
hksl:'',
//保温
bw:'',
//防腐方式
fffs:'',
//标识
bs:'',
//公称通径
gctj:'',
//产品编号
cpbh:'',
//整定压力
zdyl:'',
//层站
dtcz:'',
//载重
dtzz:'',
//提升高度
dttsgd:'',
//运行速度
dtyxsd:'',
//车牌号
cph:'',
//发动机型号
fdjxh:'',
//发动机编号
fdjbh:'',
//底盘车架号
dpcjh:'',
//拍照选项
pzxx:'',
//附件数
attachcount:'',
//备注
bz:'',
//维护人编码
whrid:'',
//维护人
whr:'',
//维护时间
whsj:new Date().getTime(),
//创建人编码
cjrid:'',
//创建人
cjr:'',
//创建时间
cjsj:new Date().getTime(),
//系统版本
doc:""
},
/* form提交时的规则,具体规则参考官网*/
rules: {
}
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="min_full">
<Byxm :app='this' v-if='showDialog&&DialogName=="byxm"' ></Byxm>
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">档案编号:</span>
<el-input v-model="queryParams.dabh"></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">设备名称:</span>
<el-input v-model="queryParams.sbxx"></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">是否已入档:</span>
<el-select v-model="queryParams.doc" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app' ></AttachFileButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮-->
<el-button @click="byxm" size='mini' type="primary">保养项目</el-button>
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
</template>
<script>
import {
doQuery,
doAdd,
doUpdate,
doDelete
} from '@/api/equipment/sbxx.js';
import Byxm from './byxm.vue'
/* edit页面*/
import Edit from './edit'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'appVersion',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
options:[
{label:"是",value:"Y"},
{label:"否",value:"N"},
],
/*需要的额外参数 */
DialogWidth:'75%',
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: '/aqgl/sbxx',
/* 查询参数*/
queryParams: {
dabh: '',
sbxx: '',
doc:'',
xtfl:"0",
},
/* 表格标题对应参数*/
tableTitle: [
{label: "档案编号", prop: "dabh", fieldType: "ftString",width:100},
{label: "设备编号", prop: "code", fieldType: "ftString",width:140},
{label: "设备名称", prop: "name", fieldType: "ftString",width:160},
// {label: "系统分类", prop: "xtflName", fieldType: "ftString",width:48},
// {label: "设备分类", prop: "sbflName", fieldType: "ftString",width:96},
{label: "制造商", prop: "productor", fieldType: "ftString",width:300},
{label: "型号", prop: "model", fieldType: "ftString",width:300},
{label: "出厂编号", prop: "serialno", fieldType: "ftString",width:300},
{label: "计量单位", prop: "jldw", fieldType: "ftString",width:120},
{label: "启用日期", prop: "qyrq", fieldType: "ftDateTime"},
/* {label: "停用日期", prop: "tyrq", fieldType: "ftDateTime"}, */
{label: "使用状态", prop: "tybzName", fieldType: "ftString",width:80},
{label: "使用地点", prop: "sydd", fieldType: "ftString",width:300},
{label: "用途", prop: "yt", fieldType: "ftString",width:300},
{label: "数量", prop: "sl", fieldType: "int"},
{label: "出厂日期", prop: "ccrq", fieldType: "ftDateTime"},
{label: "备注", prop: "bz", fieldType: "ftString",width:300},
{label: "是否已入档", prop: "doc", fieldType: "ftString",width:160,show:false},
{label: "是否已入档", prop: "docName", fieldType: "ftString",width:160}
]
}
},
methods: {
/* 查看人员*/
byxm(){
if (this.app.selectOne || this.app.clickOne) {
this.DialogTitle='保养项目'
this.showDialog=true
this.DialogName='byxm'
} else {
this.$warning('请选中一行操作');
}
},
/* 基础查询*/
query: doQuery,
/* 基础增*/
apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
/* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
Edit,Byxm
}
}
</script>
<style scoped>
</style>
<template>
<DefaultDialog :app='app'>
<div slot='form' style="height:550px;display: flex;">
<div class="min_full" style="width:100%;height: 550px;">
<!-- 查询条件-->
<div class="search" v-condition >
<SearchButton @click.native='search'></SearchButton>
<!-- <el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">用户:</span>
<el-input v-model="queryParams.usercx" size="small" class="search-input"></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">电话:</span>
<el-input v-model="queryParams.phone" size="small" class="search-input"></el-input>
</div>
</el-col>
</el-row> -->
</div>
<!-- 按钮操作-->
<!-- 表格-->
<div class="tablePagers" style='height:450px'>
<el-table
height='415'
v-loading="loading"
ref="multipleTable"
:data="tableData"
@select="selectChange"
@select-all="selectAllChange"
>
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column v-for="(item,index) in tableTitle" :prop="item.prop" :label="item.label" align="center" > </el-table-column>
</el-table>
<el-row type="flex" class="pageBanner" style="padding-top: 20px;" justify="center">
<el-pagination
background
:total="total"
:page-size="pageSize"
@size-change="pageSizeChange"
@current-change="currentPageChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30]"
layout="total, sizes, prev, pager, next"
>
</el-pagination>
</el-row>
</div>
</div>
</div>
<div slot="reFooter" class="refooter" >
<span slot="footer" class="dialog-footer" >
<el-button type="primary" @click="save()">确 认</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
/* 引入需要的接口*/
import {
doQuery,
doAdd,
doUpdate,
doDelete
} from '@/api/equipment/sbbyxm.js';
import {
doSave
} from "@/api/equipment/sbbymx.js"
/* edit页面*/
import {
tableMixin_noapp
} from 'common'
export default {
mixins: [tableMixin_noapp],
props:['app'],
/* 初始额外赋值*/
async mounted() {
this.selectedList=_.cloneDeep(this.app.tabData)
this.getData(this.currentPage, this.pageSize);
},
data() {
return {
id:'id',
/* 已选人员列表*/
selectedList: [
],
pageSize: 10,
// 唯一标识符
id: "id",
loading: false,
total: 0,
currentPage: 1,
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
/* 查询参数*/
queryParams: {
},
tableData:[],
/* 树的标题 */
/* 表格标题对应参数*/
tableTitle: [
{label: "编码", prop: "code", fieldType: "ftString",width:120},
{label: "名称", prop: "name", fieldType: "ftString",width:300},
{label: "保养周期-天", prop: "byzq", fieldType: "int",width:252},
{label: "公司", prop: "gsName", fieldType: "ftString",width:192},
{label: "标准工时", prop: "bzgs", fieldType: "float",width:192},
]
}
},
methods: {
search(event){
console.log(this.tableTitle)
event.stopPropagation()
this.getData(this.currentPage, this.pageSize);
},
getData(page, pageSize) {
this.loading = true;
let params={
pageSize:pageSize,
pageNo:page
}
params={...params,...this.queryParams}
doQuery(params).then(res=>{
this.loading = false;
this.tableData=res.data.records||[]
this.total = res.data.total
this.updateMark();
})
},
addItem(item) {
this.selectedList.push(item);
},
// 移除选中项
removeItem(item) {
for (let [index, itemTemp] of this.selectedList.entries()) {
if (itemTemp[this.id] === item[this.id]) {
this.removeItemByIndex(index);
break;
}
}
},
// 根据下标移除选中项
removeItemByIndex(index, item) {
this.selectedList.splice(index, 1);
// 若有item,则是点击标签上的关闭按钮,移除选中项
if (item) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(
// 此处必须在 tableData 中查找对应的数据,否则 toggleRowSelection 会失效
this.tableData.find((row) => {
return row[this.id] === item[this.id];
}),
false
);
});
}
},
selectChange(selectedRows, row) {
// true为选中, 0或false为取消选中
let selected = selectedRows.length && selectedRows.indexOf(row) !== -1;
if (selected) {
this.addItem(row);
} else {
this.removeItem(row);
}
},
// 全选/取消全选
selectAllChange(selectedRows) {
let selectedMarkList = this.selectedList.map((item) => item[this.id]);
// 当前页选中行的标记列表
let pageSelectedMarkList = Array.isArray(selectedRows)
? selectedRows.map((item) => item[this.id])
: [];
this.tableData.forEach((row) => {
if (pageSelectedMarkList.includes(row[this.id])) {
if (!selectedMarkList.includes(row[this.id])) {
this.addItem(row);
}
} else if (selectedMarkList.includes(row[this.id])) {
this.removeItem(row);
}
});
},
// 切换每页显示条数
pageSizeChange(newPageSize) {
this.pageSize = newPageSize;
this.getData(this.currentPage, this.pageSize);
},
// 切换页码--翻页
currentPageChange(newPage) {
this.currentPage = newPage;
this.getData(this.currentPage, this.pageSize);
},
// 更新勾选标记
updateMark() {
let selectedMarkList = this.selectedList.map((item) => item[this.id]);
this.tableData.forEach((row) => {
if (selectedMarkList.includes(row[this.id])) {
// toggleRowSelection 需在$nextTick中使用!
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(row);
});
}
});
},
/* 跨页*/
selectedTree(e){
this.queryParams.bmid=e.id||'root'
this.getData(this.currentPage, this.pageSize);
},
/* 基础查询*/
query: doQuery,
/* treeQuery */
/* 初始化赋值操作*/
init() {
},
save(){
let params={
id:this.app.queryParams.mid,
data:this.selectedList
}
doSave(params).then(res=>{
if(res.success){
this.$success('保存成功')
this.app.$refs['TablePager'].pageQuery()
this.app.showDialog=false
}
})
}
},
components:{
}
}
</script>
<style scoped>
</style>
......@@ -14,10 +14,9 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="停用标志" ref="tybz" prop="tybz">
<!-- <el-input :readonly="readonly" v-model="form.tybz" ></el-input> -->
<el-select style="width: 100%;" v-model="form.tybz" placeholder="请选择">
<el-option
v-for="item in options"
......@@ -35,7 +34,7 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="保养周期(天)" ref="byzq" prop="byzq">
......@@ -93,9 +92,9 @@
//名称
name:'',
//停用标志
tybz:'',
//停用日期
tyrq:'',
// tybz:'',
// //停用日期
// tyrq:'',
//标准工时
bzgs:'',
//附件数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment