main
weitingdong 11 months ago
parent 084c8e1b8c
commit fa4fbed262
  1. 77
      src/api/smart/workpermit.js
  2. 59
      src/api/smart/workpermitattachment.js
  3. 14
      src/router/views/index.js
  4. 568
      src/views/smart/workpermit.vue
  5. 820
      src/views/smart/workpermitDetail.vue

@ -0,0 +1,77 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/smart/workpermit/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/api/smart/workpermit/detail',
method: 'get',
params: {
id
}
})
}
export const remove = (ids) => {
return request({
url: '/api/smart/workpermit/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return request({
url: '/api/smart/workpermit/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return request({
url: '/api/smart/workpermit/submit',
method: 'post',
data: row
})
}
export const auditing = (ids) => {
return request({
url: '/api/smart/workpermit/auditing',
method: 'post',
params: {
ids,
}
})
}
export const reject = (ids) => {
return request({
url: '/api/smart/workpermit/reject',
method: 'post',
params: {
ids,
}
})
}
export const closeTicket = (ids) => {
return request({
url: '/api/smart/workpermit/closeTicket',
method: 'post',
params: {
ids,
}
})
}

@ -0,0 +1,59 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/smart/workpermitattachment/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getDetail = (id) => {
return request({
url: '/api/smart/workpermitattachment/detail',
method: 'get',
params: {
id
}
})
}
export const attachment_remove = (ids) => {
return request({
url: '/api/smart/workpermitattachment/remove',
method: 'post',
params: {
ids,
}
})
}
export const attachment_add = (row) => {
return request({
url: '/api/smart/workpermitattachment/submit',
method: 'post',
data: row
})
}
export const attachment_update = (row) => {
return request({
url: '/api/smart/workpermitattachment/update',
method: 'post',
data: row
})
}
export const attachment_getListBylegerId = (workTicketNo) => {
return request({
url: '/api/smart/workpermitattachment/getList',
method: 'get',
params: {
workTicketNo: workTicketNo
}
})
}

@ -152,5 +152,19 @@ export default [{
component: () => component: () =>
import( /* webpackChunkName: "views" */ '@/views/spares/materialDetail') import( /* webpackChunkName: "views" */ '@/views/spares/materialDetail')
}] }]
}, {
path: '/smart',
component: Layout,
redirect: '/smart/index',
children: [{
path: 'workpermitDetail',
name: '工作票详情',
meta: {
menu: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/smart/workpermitDetail')
}]
} }
] ]

@ -0,0 +1,568 @@
<template>
<basic-container>
<avue-crud :option="option"
:table-loading="loading"
:data="data"
:page="page"
:permission="permissionList"
:before-open="beforeOpen"
v-model="form"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@on-load="onLoad">
<template slot="menuLeft">
<el-button type="danger"
size="small"
icon="el-icon-delete"
plain
v-if="permission.equipmentledger_delete"
@click="handleDelete">批量删除
</el-button>
</template>
<template slot="menuRight">
<el-button type="primary"
size="small"
plain
@click="handleDetailAdd">新增
</el-button>
<el-button type="primary"
size="small"
plain
@click="handleAuditing">批量审核
</el-button>
<el-button type="primary"
size="small"
plain
@click="handleReject">批量驳回
</el-button>
<el-button type="primary"
size="small"
plain
@click="handleExport()">导出
</el-button>
</template>
<template #menu="{row,index,size}">
<el-button @click="handleDetailSearch(row,index)" type="text">查看详情</el-button>
<el-button @click="handleCloseTicket(row)" type="text">关票</el-button>
<el-button @click="rowDel(row)" type="text">删除</el-button>
</template>
</avue-crud>
<el-dialog title="关票提醒"
append-to-body
:visible.sync="closeTicketBox"
width="555px">
<avue-form :option="closeTicketOption" v-model="closeTicketForm" ref="closeTicketForm">
</avue-form>
<div class="container">
<span>
<el-button type="primary"
size="small"
plain
@click="handleDetailCancel">取消
</el-button>
<el-button type="submit"
size="small"
plain
@click="handleDetailClose">关票
</el-button>
</span>
</div>
</el-dialog>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove,closeTicket} from "@/api/smart/workpermit";
import {mapGetters} from "vuex";
import {auditing, reject} from "@/api/smart/workpermit";
import expUtil from "@/util/exportUtil";
import {getToken} from "@/util/auth";
import {Alert} from "element-ui";
import {closeticket} from "@/api/smart/operationticket";
export default {
data() {
return {
form: {},
query: {},
search:{},
loading: true,
closeTicketBox: false,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: {
height: 'auto',
calcHeight: 210,
search:{},
searchShow: true,
searchMenuSpan: 22,
searchBtnText: '查询',
emptyBtnText: '重置',
tip: false,
border: true,
indexLabel: "序号",
index: true,
viewBtn: true,
selection: true,
column: [
{
label: "KKS编码",
prop: "kksEncoding",
rules: [{
required: true,
message: "请输入KKS编码",
trigger: "blur"
}],
span:8,
hide: true,
},
{
label: "KKS描述",
prop: "kksDescription",
rules: [{
required: true,
message: "请输入KKS描述",
trigger: "blur"
}],
span:8,
hide: true,
},
{
label: "工作票编号",
prop: "workTicketNo",
search: true,
rules: [{
required: true,
message: "请输入工作票编号",
trigger: "blur"
}],
span:8,
},
{
label: "工作票类型",
prop: "workTicketType",
search: true,
rules: [{
required: true,
message: "请输入工作票类型",
trigger: "blur"
}],
span:8,
},
{
label: "工单号",
prop: "tickets",
span:8,
},
{
label: "场站",
prop: "stations",
type: "select",
search: true,
dicUrl: "/api/daf-system/dict/dictionary?code=station",
props: {
label: "dictValue",
value: "dictKey"
},
span:8,
},
{
label: "班组",
prop: "team",
rules: [{
required: true,
message: "请输入班组",
trigger: "blur"
}],
span:8,
},
{
label: "工作负责人",
prop: "workChargePerson",
search: true,
rules: [{
required: true,
message: "请输入工作负责人",
trigger: "blur"
}],
span:8,
},
{
label: "工作班成员",
prop: "workClassMembers",
rules: [{
required: true,
message: "请输入工作班成员",
trigger: "blur"
}],
span:8,
},
{
label: "许可人",
prop: "licensors",
search: true,
rules: [{
required: true,
message: "请输入许可人",
trigger: "blur"
}],
span:8,
},
{
label: "签发人",
prop: "issuer",
search: true,
rules: [{
required: true,
message: "请输入签发人",
trigger: "blur"
}],
span:8,
},
{
label: "功能位置",
prop: "functionalLocation",
span:8,
},
{
label: "工作地点",
prop: "placeWork",
rules: [{
required: true,
message: "请输入工作地点",
trigger: "blur"
}],
span:8,
},
{
label: "工作内容",
prop: "jobDescription",
rules: [{
required: true,
message: "请输入工作内容",
trigger: "blur"
}],
span:8,
},
{
label: "计划开始时间",
prop: "planStartDate",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
search: true,
rules: [{
required: true,
message: "请输入计划开始时间",
trigger: "blur"
}],
span:8,
},
{
label: "工作条件",
prop: "workingConditions",
hide:true,
rules: [{
required: true,
message: "请输入工作条件",
trigger: "blur"
}],
span:8,
},
{
label: "计划结束时间",
prop: "planEndDate",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
rules: [{
required: true,
message: "请输入计划结束时间",
trigger: "blur"
}],
span:8,
},
{
label: "实际结束时间",
hide:true,
prop: "actualEndDate",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span:8,
},
{
label: "是否延期",
hide:true,
prop: "isExtended",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=yes_no",
props: {
label: "dictValue",
value: "dictKey"
},
span:8,
},
{
label: "状态",
search: true,
type: "select",
prop: "workState",
dicUrl: "/api/daf-system/dict/dictionary?code=work_status",
props: {
label: "dictValue",
value: "dictKey"
},
span:8,
},
{
label: "审核状态",
prop: "checkStatus",
hide:true,
dicUrl: "/api/daf-system/dict/dictionary?code=check_status",
props: {
label: "dictValue",
value: "dictKey"
},
},
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
// this.option.column = this.option.column.filter(v => {
// // return this.permission['workpermit_col_' + v.prop]
// })
return {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
done();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
done();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDetailAdd() {
this.$router.push({
path: "/smart/workpermitDetail",
query: {
frameMode:"add"
},
});
},
handleDetailSearch(row) {
debugger
this.$router.push({
path: "/smart/workpermitDetail",
query: {
frameMode:"search",
id: row.id,
checkstatus: row.checkStatus,
ticketCode:row.ticketCode
},
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleAuditing() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("是否将选择数据审核?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return auditing(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleReject() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("是否将选择数据审核?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return reject(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleCloseTicket(row) {
this.$confirm("是否结束该工作票?", "提示",{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return closeTicket(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleExport() {
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
expUtil.excelExportEasy(`/api/smart/workpermit/export?daf-auth=${getToken()}`, this.search);
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage){
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
this.page.pageSize = pageSize;
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>

@ -0,0 +1,820 @@
<template>
<basic-container>
<template >
<el-row :span="24">
<div class="check_status_class">
<span >
<el-col >
审核状态:
<el-select v-model="checkStatusValue">
<el-option
v-for="item in optionCheckStatus"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
</span>
</div>
</el-row>
</template>
<avue-tabs :option="option"
@change="handleChange"></avue-tabs>
<span v-if="type.prop==='information'">
<avue-form :option="tab1_option"
v-model="tab1_form"
ref="tab1_form"
:class="frame_class">
</avue-form>
</span>
<span v-else-if="type.prop==='attachment'">
<div>
<avue-crud :data="attachment_data"
:table-loading="loading"
:option="optionParam"
:permission="permissionList"
:before-open="beforeOpen"
:header-cell-class-name="headerClass"
v-model="attachment_form"
ref="crud"
@row-del="attachment_rowDel"
@row-update="attachment_rowUpdate"
@row-save="attachment_rowSave">
</avue-crud>
</div>
</span>
<div class="container">
<span >
<el-button type="primary"
size="large"
@click="handleFormSubmit"
v-if="addUpdateShowButton">
确定</el-button>
<el-button type="text"
size="large"
@click="back"
v-if="addUpdateShowButton">
取消</el-button>
<el-button type="primary"
size="small"
@click="closeTicket"
v-if="shouldShowButton">
关票</el-button>
<el-button type="primary"
size="small"
@click="auditing"
v-if="shouldShowButton">
审核</el-button>
<el-button type="primary"
size="small"
@click="reject"
v-if="shouldShowButton">
驳回</el-button>
<el-button type="primary"
size="small"
@click="seachToUpdate"
v-if="UpdateShowButton">
修改</el-button>
<el-button type="primary"
size="small"
@click="del"
v-if="shouldShowButton">
删除</el-button>
</span>
</div>
</basic-container>
<!-- https://avuejs.com/form/form-rules.html#%E5%A4%96%E7%BD%AE%E9%AA%8C%E8%AF%81-->
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/smart/workpermit";
import {
attachment_add,
attachment_update,
attachment_remove,
attachment_getListBylegerId,
} from "@/api/smart/workpermitattachment";
import {mapGetters} from "vuex";
import website from "@/config/website";
import {readonly} from "vue";
import {getToken} from "@/util/auth";
import {parameters_remove} from "@/api/leger/techparameters";
import request from "@/router/axios";
export default {
name: "equipmentledgerDetail",
data () {
return {
checkStatusValue: this.$route.query.checkstatus,
optionCheckStatus: [{
value: 1,
label: '审核中'
}, {
value: 2,
label: '已审核'
}, {
value: 3,
label: '未通过'
}, {
value: 4,
label: ' '
}],
frame_class: '',
type: {},
shouldShowButton:{},
addUpdateShowButton:{},
UpdateShowButton:{},
readonlyForm:{},
attachment_form:{},
option: {
column: [{
label: '基本信息',
prop: 'information',
}
]
},
tab1_form: {},
tab1_option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "KKS编码",
prop: "kksEncoding",
type: "select",
dicUrl: "/api/equipmentledger/getKksList",
props: {
label: "kksEncoding",
value: "kksEncoding",
},
event: {
change: (val) => {
if (!val) return
if (val) {
request({
url: "/api/equipmentledger/getDetailList",
method: 'get',
params: {
KksNo: val
}
}).then((res) => {
this.tab1_form.kksDescription = res.data.data.kksDescription;
this.tab1_form.stations = res.data.data.station;
})
}
},
},
rules: [{
required: true,
message: "请输入KKS编码",
trigger: "blur",
}],
span: 8,
maxlength: 20,
},
{
label: "KKS描述",
prop: "kksDescription",
disabled: true,
rules: [{
required: true,
message: "请输入KKS描述",
trigger: "blur"
}],
span: 8,
maxlength: 20,
},
{
label: "场站",
prop: "stations",
disabled: true,
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=station",
props: {
label: "dictValue",
value: "dictKey"
},
span: 8,
maxlength: 20,
},
{
label: "工作票编号",
prop: "workTicketNo",
rules: [{
required: true,
message: "请输入工作票编号",
trigger: "blur"
}],
span:8
},
{
label: "工作票类型",
prop: "workTicketType",
rules: [{
required: true,
message: "请输入工作票类型",
trigger: "blur"
}],
span:8
},
{
label: "工单",
prop: "tickets",
span:8
},
{
label: "班组",
prop: "team",
rules: [{
required: true,
message: "请输入班组",
trigger: "blur"
}],
span:8
},
{
label: "工作负责人",
prop: "workChargePerson",
rules: [{
required: true,
message: "请输入工作负责人",
trigger: "blur"
}],
span:8
},
{
label: "工作班成员",
prop: "workClassMembers",
rules: [{
required: true,
message: "请输入工作班成员",
trigger: "blur"
}],
span:8
},
{
label: "许可人",
prop: "licensors",
rules: [{
required: true,
message: "请输入许可人",
trigger: "blur"
}],
span:8
},
{
label: "签发人",
prop: "issuer",
rules: [{
required: true,
message: "请输入签发人",
trigger: "blur"
}],
span:8
},
{
label: "功能位置",
prop: "functionalLocation",
span:8
},
{
label: "工作地点",
prop: "placeWork",
rules: [{
required: true,
message: "请输入工作地点",
trigger: "blur"
}],
span:8
},
{
label: "工作内容",
prop: "jobDescription",
rules: [{
required: true,
message: "请输入工作内容",
trigger: "blur"
}],
span:8
},
{
label: "计划开始时间",
prop: "planStartDate",
rules: [{
required: true,
message: "请输入计划开始时间",
trigger: "blur"
}],
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span:8
},
{
label: "计划结束时间",
prop: "planEndDate",
rules: [{
required: true,
message: "请输入计划结束时间",
trigger: "blur"
}],
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span:8
},
{
label: "工作条件",
prop: "workingConditions",
rules: [{
required: true,
message: "请输入工作条件",
trigger: "blur"
}],
span:8
},
{
label: "实际结束时间",
prop: "actualEndDate",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span:8
},
{
label: "是否延期",
prop: "isExtended",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=yes_no",
props: {
label: "dictValue",
value: "dictKey"
},
span:8
},
{
label: "计划延期时间",
prop: "plannedExtensionDate",
type: "date",
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span:8
},
{
label: "延期申请理由",
prop: "extRegReason",
span:8
},
{
label: "是否变更",
prop: "ischanged",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=yes_no",
props: {
label: "dictValue",
value: "dictKey"
},
span:8
},
{
label: "变更申请理由",
prop: "changeReason",
span:8,
row:true,
},
{
label: "总结",
prop: "summary",
span:8
},
{
label: "工作状态",
type: "select",
prop: "workState",
dicUrl: "/api/daf-system/dict/dictionary?code=work_status",
props: {
label: "dictValue",
value: "dictKey"
},
span:8
},
]
},
tab2_page: {
pageSize: 20,
pagerCount: 5
},
attachment_data: [],
optionParam: {
align: 'center',
menuAlign: 'center',
height: 'auto',
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,
border: true,
indexLabel: "序号",
index: true,
column: [
{
label: "附票编码",
prop: "ticketCode",
},
{
label: "附票类型",
prop: "ticketType",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=ticket_type",
props: {
label: "dictValue",
value: "dictKey"
},
rules: [{
required: true,
message: "请输入附票类型",
trigger: "blur"
}],
span:24,
},
{
label: "专项作业名称",
prop: "specialJobName",
rules: [{
required: true,
message: "请输入专项作业名称",
trigger: "blur"
}],
span:24,
},
{
label: "工作内容",
prop: "jobDescription",
rules: [{
required: true,
message: "请输入工作内容",
trigger: "blur"
}],
span:24,
},
{
label: "状态",
type: "select",
prop: "workStatus",
dicUrl: "/api/daf-system/dict/dictionary?code=work_status",
props: {
label: "dictValue",
value: "dictKey"
},
rules: [{
required: true,
message: "请输入工作状态",
trigger: "blur"
}],
span:24,
},
{
label: "工作地点",
prop: "placeWork",
rules: [{
required: true,
message: "请输入工作地点",
trigger: "blur"
}],
span:24,
},
{
label: "创建人",
prop: "createUser",
type: 'select',
dicUrl: "/api/daf-user/listBySearch?search={{key}}",
props: {
label: 'name',
value: 'id',
desc: 'code'
},
span:24,
},
{
label: "创建时间",
prop: "createTime",
}
]
},
tab3_page: {
pageSize: 20,
pagerCount: 5
},
}
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: true,
viewBtn: false,
delBtn: true,
editBtn: true
};
},
},
created () {
this.type = this.option.column[0];
if(this.$route.query.frameMode == "search"){
this.option.column.push({ label: '工作票附票', prop: 'attachment' });
this.readonlyForm=true;
this.shouldShowButton=true;
this.addUpdateShowButton=false;
this.UpdateShowButton=true;
this.frame_class = 'frame_class1';
this.checkStatusValue = this.$route.query.checkstatus;
this.SearchDetail();
const kksDescription = this.findObject(this.tab1_option.column, "kksDescription");
kksDescription.disabled = false;
const stations = this.findObject(this.tab1_option.column, "stations");
stations.disabled = false;
}else{
this.readonlyForm=false;
this.shouldShowButton=false;
this.UpdateShowButton=false;
this.addUpdateShowButton=true;
this.frame_class = null;
this.checkStatusValue = 4;
}
const create_user = this.findObject(this.optionParam.column, "createUser");
create_user.display = false;
const create_date = this.findObject(this.optionParam.column, "createTime");
create_date.display = false;
const ticketCode = this.findObject(this.optionParam.column, "ticketCode");
ticketCode.display = false;
},
methods: {
handleFormSubmit() {
this.$refs.tab1_form.validate((valid, done, msg) => {
if (valid) {
done()
this.Submit();
} else {
console.log('error submit!!');
return false;
}
})
},
//
Submit() {
if(this.$route.query.frameMode=="add"){
this.$confirm("是否新增所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus="1"
add(this.tab1_form).then(()=>{
this.$router.push({
path: "/smart/workpermit",
query: {
},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
});
}else {
this.$confirm("是否修改所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
update(this.tab1_form).then(() => {
this.$router.push({
path: "/smart/workpermit",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
});
}
},
back() {
if(this.$route.query.frameMode=="add") {
this.$router.push({path: "/smart/workpermit"});
}else{
this.updateToSearch();
this.SearchDetail();
}
},
seachToUpdate () {
this.shouldShowButton=false;
this.addUpdateShowButton=true;
this.UpdateShowButton=false;
this.readonlyForm=false;
this.frame_class = null;
},
updateToSearch () {
this.readonlyForm=true;
this.shouldShowButton=true;
this.addUpdateShowButton=false;
this.UpdateShowButton=false;
this.frame_class = 'frame_class1';
},
handleChange (column) {
this.type = column
if (column.prop == 'attachment') {
this.UpdateShowButton=false;
this.attachment_onLoad();
}
this.attachment_form.ticketCode = this.tab1_form.workTicketNo;
},
//
attachment_rowSave (form, done, loading) {
loading();
form.workTicketNo = this.$route.query.id;
form.ticketCode = this.attachment_form.ticketCode;
attachment_add(form).then(() => {
done(form);
this.attachment_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.attachment_form.ticketCode = this.tab1_form.workTicketNo;
}, error => {
window.console.log(error);
loading();
});
},
//
attachment_rowUpdate (form, index, done, loading) {
attachment_update(form).then(() => {
done(form);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
//
attachment_rowDel (form, index,done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return attachment_remove(form.id);
})
.then(() => {
this.attachment_onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
SearchDetail() {
getDetail(this.$route.query.id).then(res => {
console.log(res);
this.tab1_form = res.data.data;
});
},
closeTicket() {
this.$confirm("是否结束该工作票?", "提示",{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.workState="4"
this.submitRejectOrauditing();
});
},
auditing() {
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus="2"
this.submitRejectOrauditing();
});
},
reject() {
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus="3"
this.submitRejectOrauditing();
});
},
submitRejectOrauditing() {
update(this.tab1_form).then(() => {
this.$router.push({
path: "/smart/workpermit",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
},
del() {
this.$confirm("是否将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
remove(this.tab1_form.id).then(() => {
this.$router.push({
path: "/smart/workpermit",
query: {},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
})
},
headerClass(){
return 'head-style'
},
attachment_onLoad(row, params = {}) {
this.loading = true;
attachment_getListBylegerId(this.$route.query.id).then(res => {
this.attachment_data = res.data.data;
this.loading = false;
});
}
}
}
</script>
<style>
.head-style{
background-color: #1e9fff !important;
color: #FFFFFF !important;
}
.frame_class1 input.el-input__inner {
border: none;
box-shadow: none;
outline: none;
pointer-events: none;
}
.frame_class1 .el-input__icon {
display: none;
}
.frame_class1 .el-input--prefix .el-input__inner {
padding-left: 15px;
}
.frame_class1 input::placeholder {
color: transparent;
display: none; /* 默认隐藏 */
}
.container {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
.check_status_class {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
.check_status_class input.el-input__inner {
border: none;
box-shadow: none;
outline: none;
pointer-events: none;
}
</style>
Loading…
Cancel
Save