自定义防抖指令

This commit is contained in:
shijing 2023-03-17 17:13:18 +08:00
parent 0d2250d417
commit 1bf3a44513
17 changed files with 317 additions and 321 deletions

View File

@ -6,7 +6,7 @@ const DEFAULT_CONFIG = {
DASHBOARD_URL: "/dashboard",
//版本号
APP_VER: "1.0",
APP_VER: "2.0.1",
//内核版本号
CORE_VER: "1.6.3",

View File

@ -9,6 +9,7 @@ import store from './store'
import { createApp } from 'vue'
import App from './App.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import preventReClick from './utils/preventReClick'
const app = createApp(App);
@ -18,7 +19,7 @@ app.use(ElementPlus);
app.use(i18n);
app.use(scui);
app.use(ehsui);
app.use(preventReClick)
//挂载app
app.mount('#app');
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {

View File

@ -0,0 +1,14 @@
export default (app) => {
app.directive('preventReClick', {
mounted(el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 2000)
}
})
}
})
}

View File

@ -167,9 +167,11 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button type="primary"
:disabled="isSaving"
:loading="isSaving"
plain @click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -472,6 +474,7 @@
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
:disabled="tLoading"
@click="submitTicketCreate(item.id)"
style="margin-right:4px"
>{{item.name}}
@ -528,7 +531,7 @@
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {},
selection: [],
issave: false, //
isSaving: false, //
search: {
keyword: null,
},
@ -698,41 +701,39 @@
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.isSaving = true; //
if (this.oplId == "") {
//
debugger;
// debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
this.$API.opm.opl.create.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.isSaving = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.isSaving = false;
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.isSaving = false;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
this.isSaving = false;
}
}
})
@ -866,9 +867,8 @@
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -876,6 +876,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -166,9 +166,12 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
:disabled="issaving"
:loading="issaving"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -527,7 +530,7 @@
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {},
selection: [],
issave: false, //
issaving: false, //
search: {
keyword: null,
},
@ -692,48 +695,44 @@
},
//
handleNextStep() {
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
if (this.oplId == "") {
//
debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
if (valid) {
this.issaving = true; //
if (this.oplId == "") {
//
debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.active = 1;
this.issaving = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.issaving = false;
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.active = 1;
this.issaving = false;
this.getgasList();
this.getworkerList();
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
}
}
})
});
}
}
})
} else {
if (this.active==1){
if(this.apiworkerObj.length==0){
@ -742,9 +741,7 @@
}
}
this.active = 2;
}
// this.stepSuc.push(++this.active)
},
//
@ -864,9 +861,8 @@
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -874,6 +870,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -179,9 +179,11 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button type="primary" plain
@click="handleNextStep"
:disabled="issaving"
:loading="issaving"
>下一步</el-button>
</div>
</el-main>
@ -481,6 +483,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -540,7 +543,7 @@
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {},
selection: [],
issave: false, //
issaving: false, //
search: {
keyword: null,
},
@ -708,45 +711,41 @@
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
if (this.oplId == "") {
//
debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
if (valid) {
this.issaving = true; //
if (this.oplId == "") {
//
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.active = 1;
this.issaving = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.issaving = false;
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.active = 1;
this.issaving = false;
this.getgasList();
this.getworkerList();
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
}
}
})
});
}
}
})
} else {
if (this.active==1){
if(this.apiworkerObj.length==0){
@ -755,9 +754,7 @@
}
}
this.active = 2;
}
// this.stepSuc.push(++this.active)
},
//
@ -877,9 +874,8 @@
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -887,11 +883,11 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {
id: this.operationId,//ID
},
});
}

View File

@ -85,12 +85,12 @@
v-model="form.dept_do"
:options="deptoptions"
:props="{
expandTrigger: 'hover', //
label: 'label', //
value: 'value', //
emitPath: false, // false
checkStrictly: true
}"
expandTrigger: 'hover', //
label: 'label', //
value: 'value', //
emitPath: false, // false
checkStrictly: true
}"
clearable
/>
</el-form-item>
@ -175,9 +175,12 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
:loading="issave"
:disabled="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -306,6 +309,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -503,10 +507,8 @@
this.deptoptions = genTree(res);
});
},
//
//
//ID===>
getOplcates() {
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
@ -531,11 +533,10 @@
},
//
handleNextStep() {
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.issave = true; //
if (this.oplId == "") {
//
debugger;
@ -547,29 +548,26 @@
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.issave = false;
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
}
}
})
@ -690,17 +688,16 @@
//,
submitTicketCreate(id) {
if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员");
return
}
this.$message.warning("请添加作业人员");
return
}
let ticket = {};
ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -708,6 +705,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -175,9 +175,12 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
:loading="issave"
:disabled="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -306,6 +309,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -534,7 +538,7 @@
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.issave = true; //
if (this.oplId == "") {
//
debugger;
@ -546,9 +550,8 @@
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
@ -561,11 +564,10 @@
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
@ -573,7 +575,6 @@
}
})
}
// this.stepSuc.push(++this.active)
},
//
@ -689,17 +690,16 @@
//,
submitTicketCreate(id) {
if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员");
return
}
this.$message.warning("请添加作业人员");
return
}
let ticket = {};
ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -707,6 +707,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -148,9 +148,12 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
:disabled="issave"
:loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -279,6 +282,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -503,7 +507,7 @@
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.issave = false; //
if (this.oplId == "") {
//
debugger;
@ -515,9 +519,8 @@
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
@ -527,17 +530,17 @@
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
this.issave = false;
}
}
})
@ -658,17 +661,16 @@
//,
submitTicketCreate(id) {
if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员");
return
}
this.$message.warning("请添加作业人员");
return
}
let ticket = {};
ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -676,6 +678,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -139,7 +139,7 @@
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit" v-if="mode!=='show'">保存</el-button>
<el-button type="primary" :disabled="isSaveing" :loading="isSaveing" @click="submit" v-if="mode!=='show'">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
@ -257,9 +257,9 @@ export default {
form
);
}
this.visible = false;
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
console.log(res)
this.$message.success("操作成功");
return res;

View File

@ -76,7 +76,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" >
<el-form-item label="作业部门" prop="dept_do">
<el-cascader
@ -85,12 +84,12 @@
v-model="form.dept_do"
:options="deptoptions"
:props="{
expandTrigger: 'hover', //
label: 'label', //
value: 'value', //
emitPath: false, // false
checkStrictly: true
}"
expandTrigger: 'hover', //
label: 'label', //
value: 'value', //
emitPath: false, // false
checkStrictly: true
}"
clearable
/>
</el-form-item>
@ -177,12 +176,14 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
v-preventReClick
:loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
<!--作业人员!-->
<el-main class="nopadding" v-show="active === 1">
<div class="left-panel" style="margin: 10px">
@ -308,6 +309,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
v-preventReClick
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -537,10 +539,9 @@
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.issave = true; //
if (this.oplId == "") {
//
debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
@ -549,29 +550,29 @@
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.issave = false;
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
this.issave = false;
}
}
})
@ -692,9 +693,9 @@
//,
submitTicketCreate(id) {
if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员");
return
}
this.$message.warning("请添加作业人员");
return
}
let ticket = {};
ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId};
@ -702,7 +703,6 @@
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -710,6 +710,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -177,9 +177,12 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
:disabled="issave"
:loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -308,6 +311,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -535,7 +539,7 @@
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.issave = true; //
if (this.oplId == "") {
//
debugger;
@ -547,28 +551,28 @@
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.issave = false
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.issave = false;
this.active = 1;
}
}
@ -690,17 +694,16 @@
//,
submitTicketCreate(id) {
if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员");
return
}
this.$message.warning("请添加作业人员");
return
}
let ticket = {};
ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -708,6 +711,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -182,9 +182,12 @@
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
:disabled="issave"
:loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
@ -484,6 +487,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -708,11 +712,10 @@
},
//
handleNextStep() {
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
//
this.issave = true; //
if (this.oplId == "") {
//
debugger;
@ -724,28 +727,27 @@
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
this.issave = false;
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.issave = false;
this.active = 1;
}
}
@ -758,7 +760,6 @@
}
}
this.active = 2;
}
// this.stepSuc.push(++this.active)
},
@ -880,9 +881,8 @@
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});
@ -890,6 +890,7 @@
//退
submitOut() {
this.tLoading = false;
this.$router.push({
name: "opl",
query: {

View File

@ -64,8 +64,6 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业部门" prop="dept_do">
<el-cascader
@ -84,21 +82,27 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业监护人" prop="monitor">
<el-select v-model="form.monitor" placeholder="选择作业监护人">
<el-option
v-for="item in useroptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业负责人" prop="charger">
<el-input
v-model="form.charger_name"
style="width:200px"
disabled
></el-input>
<ehsUserSelect :multiple="false" @submit="getCharger"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业监护人" prop="monitor">
<el-input
v-model="form.monitor_name"
style="width:200px"
disabled
></el-input>
<ehsUserSelect :multiple="false" @submit="getMonitor"/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="供电制式" >
<el-select v-model="form.level" placeholder="选择供电制式">
<el-option
@ -115,12 +119,7 @@
<el-input-number v-model="form.power_days" type="text" clearable></el-input-number>
</el-form-item>
</el-col>
<!--
临时用电 !-->
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="工作类型">
<el-select v-model="form.work_type" placeholder="选择工作类型">
<el-option
@ -130,7 +129,6 @@
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
@ -140,13 +138,10 @@
type="datetime"
placeholder="选择开始时间"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="验收时间">
<el-date-picker
v-model="form.accept_time"
type="datetime"
@ -164,7 +159,6 @@
<el-input v-model="form.power_to" type="text" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="用电开始">
<el-date-picker
@ -172,7 +166,6 @@
type="datetime"
placeholder="选择开始时间"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
@ -182,7 +175,6 @@
type="datetime"
placeholder="选择开始时间"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
@ -190,7 +182,6 @@
<el-input v-model="form.power_from" type="text" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="风险选择">
<el-checkbox-group v-model="form.risks_checked">
@ -212,14 +203,6 @@
></el-input>
</el-form-item>
</el-col>
<!--
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="逃生路径">
<el-input v-model="escape_route" type="text" clearable></el-input>
</el-form-item>
</el-col> !-->
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="措施选择">
<el-checkbox-group v-model="form.measures_checked">
@ -232,16 +215,13 @@
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-card class="box-card">
<div class="clearfix">
<span>应急处置</span>
</div>
<div class="content">
<p>发生人员触电事故应迅速切断电源或采用绝缘工器具使触电者脱离电源判断触电者无意识或心跳呼吸已停止时应立即报告并由经过专业训练或具备相应能力的人员对触电者进行心肺复苏术直至专业医务人员赶到现场为止
其他应急处置
</p>
<p>发生人员触电事故应迅速切断电源或采用绝缘工器具使触电者脱离电源判断触电者无意识或心跳呼吸已停止时应立即报告并由经过专业训练或具备相应能力的人员对触电者进行心肺复苏术直至专业医务人员赶到现场为止其他应急处置</p>
</div>
</el-card>
<el-form-item label="其他应急处置">
@ -252,23 +232,16 @@
></el-input>
</el-form-item>
</el-col>
<!--
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业审批照片">
<el-input v-model="create_imgs" type="text" clearable></el-input>
</el-form-item>
</el-col>
!-->
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep"
>下一步
</el-button>
<el-button
v-preventReClick
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
<!--作业人员!-->
<el-main class="nopadding" v-show="active === 1">
<div class="left-panel" style="margin: 10px">
@ -396,7 +369,7 @@
<div style="margin-top:20px;text-align:center">
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button
:loading="tLoading"
v-preventReClick
v-for=" item in initForm.transitions"
:key="item.id"
type="primary"
@ -405,12 +378,8 @@
>{{item.name}}
</el-button>
<el-button @click="submitOut" type="warning">退出</el-button>
</div>
</el-main>
</el-container>
</template>
<style scoped>
@ -539,8 +508,14 @@ export default {
this.getDept();
},
methods: {
getCharger(data) {
this.form.charger=data.id;
this.form.charger_name=data.name
},
getMonitor(data) {
this.form.monitor=data.id;
this.form.monitor_name=data.name;
},
getoplData() {
if (this.oplId == "") {
this.getOperation();
@ -609,11 +584,9 @@ export default {
//
handleNextStep() {
if (this.active == 0) {
// console.log(this.oplId);
//
if (this.oplId == "") {
//
debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
@ -622,24 +595,18 @@ export default {
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
this.active = 1;
this.oplId = res.id;
this.getworkerList(res.id);
return res;
})
.catch((err) => {
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1;
this.getworkerList(this.oplId);
});
@ -719,9 +686,7 @@ export default {
ticket.ticket_data = {opl: this.oplId};
ticket.transition = id;
ticket.title = this.form.name + '-申请';
this.tLoading = true
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功");
this.submitOut()
}).catch(e=>{this.tLoading=false});

View File

@ -100,7 +100,7 @@
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
<el-button type="primary" :loading="isSaveing" :disabled="isSaveing" @click="submit"
>保存
</el-button
>
@ -191,9 +191,9 @@
} else if (this.mode == "edit") {
res = await this.$API.rpm.rpj.update.req(this.form.id, this.form);
}
this.visible = false;
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
return res;
} catch (err) {

View File

@ -112,6 +112,7 @@
<el-button
style="margin-top: 20px"
type="primary"
:loading="isSaveing" :disabled="isSaveing"
@click="handleNextStep"
>下一步
</el-button>
@ -345,6 +346,8 @@
v-for="item in initForm.transitions"
:key="item.id"
type="primary"
:loading="isSaveing"
:disabled="isSaveing"
@click="submitTicketCreate(item.id)"
style="margin-right: 4px"
>{{ item.name }}</el-button
@ -393,7 +396,7 @@ export default {
stepTitle: ["基本信息", "安全审核项目", "选择人员"],
query: {},
selection: [],
issave: false, //
isSaveing: false, //
search: {
keyword: null,
},
@ -434,6 +437,7 @@ export default {
},
mounted() {
this.rpjId = this.$route.query.rpjid; //ID
this.isSaveing = false;
this.rpartyShow();
if (this.rpjId) {
this.getRpj();
@ -495,6 +499,7 @@ export default {
if (this.active == 0) {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
if (this.rpjId) {
this.$API.rpm.rpj.update
.req(this.rpjId, this.rpjform)
@ -504,16 +509,22 @@ export default {
this.getmemberList();
this.getremployee();
this.active = 1;
this.isSaveing = false;
}).catch(res=>{
this.isSaveing = false;
});
} else {
this.$API.rpm.rpj.create.req(this.rpjform).then((res) => {
this.$message.success("项目创建成功!");
this.rpjId = res.id;
this.rpjform.rparty = res.rparty;
this.rpjform.rparty = res.rparty;
this.getRpjfileList();
this.getmemberList();
this.getremployee();
this.active = 1;
this.isSaveing = false;
}).catch(res=>{
this.isSaveing = false;
});
}
}
@ -640,6 +651,7 @@ export default {
//,
submitTicketCreate(id) {
let ticket = {};
this.isSaveing = true;
ticket.title = this.rpjform.name;
ticket.workflow = this.initForm.workflow;
ticket.ticket_data = { rpj: this.rpjId ,name:this.rpjform.name};
@ -650,6 +662,8 @@ export default {
name: "rpj",
query: {},
});
}).catch(()=>{
this.isSaveing = false;
});
},
},

View File

@ -111,8 +111,13 @@
</el-row>
</el-form>
<div style="margin-top:20px;text-align:center">
<el-button style="margin-top: 20px" @click="handleNextStep"
type="primary">下一步</el-button>
<el-button style="margin-top: 20px"
@click="handleNextStep"
:loading="isSaving"
:disabled="isSaving"
type="primary">
下一步
</el-button>
</div>
</el-main>
@ -133,27 +138,11 @@
<el-table-column label="#" type="expand">
<template #default="scope">
<el-descriptions :column="3" style="margin-left:70px">
<!-- <el-descriptions-item label="返乡时间:">{{ scope.row.return_date }}</el-descriptions-item> -->
<el-descriptions-item label="来源地:">{{ scope.row.come_place }}</el-descriptions-item>
<!-- <el-descriptions-item label="行程轨迹:">{{ scope.row.trip_desc }}</el-descriptions-item>
<el-descriptions-item label="管控措施:">{{ scope.row.measure }}</el-descriptions-item>
<el-descriptions-item label="核酸检测日期:">{{ scope.row.test_date }}</el-descriptions-item> -->
<el-descriptions-item label="是否重要访客:">
<el-space v-if="scope.row.is_main == true"></el-space>
<el-space v-else></el-space>
</el-descriptions-item>
<!-- <el-descriptions-item label="健康码:">
<el-image style="width: 100px; height: 100px" :src="scope.row.health_code"
:preview-src-list="[scope.row.health_code]" fit="cover" />
</el-descriptions-item>
<el-descriptions-item label="行程码:">
<el-image style="width: 100px; height: 100px" :src="scope.row.travel_code"
:preview-src-list="[scope.row.travel_code]" fit="cover" />
</el-descriptions-item>
<el-descriptions-item label="核酸报告:">
<el-image style="width: 100px; height: 100px" :src="scope.row.test_report"
:preview-src-list="[scope.row.test_report]" fit="cover" />
</el-descriptions-item> -->
</el-descriptions>
</template>
</el-table-column>
@ -314,12 +303,14 @@
style="margin-right:4px">上一步</el-button
>
<span v-for=" item in initform.transitions" :key="item.id">
<el-button @click="submitticket(item.id)"
style="margin-right:4px" type="primary">{{item.name}}</el-button
>
</span>
<el-button @click="submitOut" type="warning">退出</el-button>
<el-button
:loading="isSaving"
:disabled="isSaving"
@click="submitticket(item.id)"
style="margin-right:4px" type="primary"
>{{item.name}}</el-button>
</span>
<el-button @click="submitOut" type="warning">退出</el-button>
</div>
</el-main>
</el-container>
@ -438,6 +429,7 @@ export default {
},
mounted() {
this.visitid = this.$route.query.visitid; //ID
this.isSaving = false;
if(this.visitid){
this.getRpj();
this.getpeoplelistlist();
@ -486,6 +478,7 @@ export default {
if (this.active == 0) {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaving = true;
if(this.visitid){
this.$API.vm.visit.update
.req(this.visitid, this.form)
@ -493,16 +486,21 @@ export default {
this.$message.success("基本信息更新成功");
this.getInit();
this.active = 1;
this.isSaving = false;
}).catch(()=>{
this.isSaving = false;
})
}else{
this.$API.vm.visit.create.req(this.form).then(res=>{
this.visitid = res.id;
this.$message.success("项目创建成功");
this.getInit();
this.active = 1;
this.active = 1;
this.isSaving = false;
}).catch(()=>{
this.isSaving = false;
})
}
}
});
} else {
@ -585,19 +583,21 @@ export default {
},
//
submitticket(id){
this.ticket={};
this.ticket.title = this.form.name;
this.ticket={};
this.isSaving = true;
this.ticket.title = this.form.name;
this.ticket.workflow=this.initform.workflow;
this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
this.ticket.transition=id;
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
this.ticket.transition=id;
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
this.$message.success("提交成功");
this.$router.push({
name: "visit",
query: {},
name: "visit",
query: {},
});
}).catch(()=>{
this.isSaving = false;
});
});
}
},
};