自定义防抖指令

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", DASHBOARD_URL: "/dashboard",
//版本号 //版本号
APP_VER: "1.0", APP_VER: "2.0.1",
//内核版本号 //内核版本号
CORE_VER: "1.6.3", CORE_VER: "1.6.3",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -139,7 +139,7 @@
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <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-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-container> </el-container>
@ -257,9 +257,9 @@ export default {
form form
); );
} }
this.visible = false;
this.isSaveing = false; this.isSaveing = false;
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
this.visible = false;
console.log(res) console.log(res)
this.$message.success("操作成功"); this.$message.success("操作成功");
return res; return res;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -111,8 +111,13 @@
</el-row> </el-row>
</el-form> </el-form>
<div style="margin-top:20px;text-align:center"> <div style="margin-top:20px;text-align:center">
<el-button style="margin-top: 20px" @click="handleNextStep" <el-button style="margin-top: 20px"
type="primary">下一步</el-button> @click="handleNextStep"
:loading="isSaving"
:disabled="isSaving"
type="primary">
下一步
</el-button>
</div> </div>
</el-main> </el-main>
@ -133,27 +138,11 @@
<el-table-column label="#" type="expand"> <el-table-column label="#" type="expand">
<template #default="scope"> <template #default="scope">
<el-descriptions :column="3" style="margin-left:70px"> <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.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-descriptions-item label="是否重要访客:">
<el-space v-if="scope.row.is_main == true"></el-space> <el-space v-if="scope.row.is_main == true"></el-space>
<el-space v-else></el-space> <el-space v-else></el-space>
</el-descriptions-item> </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> </el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
@ -314,10 +303,12 @@
style="margin-right:4px">上一步</el-button style="margin-right:4px">上一步</el-button
> >
<span v-for=" item in initform.transitions" :key="item.id"> <span v-for=" item in initform.transitions" :key="item.id">
<el-button @click="submitticket(item.id)" <el-button
style="margin-right:4px" type="primary">{{item.name}}</el-button :loading="isSaving"
> :disabled="isSaving"
@click="submitticket(item.id)"
style="margin-right:4px" type="primary"
>{{item.name}}</el-button>
</span> </span>
<el-button @click="submitOut" type="warning">退出</el-button> <el-button @click="submitOut" type="warning">退出</el-button>
</div> </div>
@ -438,6 +429,7 @@ export default {
}, },
mounted() { mounted() {
this.visitid = this.$route.query.visitid; //ID this.visitid = this.$route.query.visitid; //ID
this.isSaving = false;
if(this.visitid){ if(this.visitid){
this.getRpj(); this.getRpj();
this.getpeoplelistlist(); this.getpeoplelistlist();
@ -486,6 +478,7 @@ export default {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
this.isSaving = true;
if(this.visitid){ if(this.visitid){
this.$API.vm.visit.update this.$API.vm.visit.update
.req(this.visitid, this.form) .req(this.visitid, this.form)
@ -493,6 +486,9 @@ export default {
this.$message.success("基本信息更新成功"); this.$message.success("基本信息更新成功");
this.getInit(); this.getInit();
this.active = 1; this.active = 1;
this.isSaving = false;
}).catch(()=>{
this.isSaving = false;
}) })
}else{ }else{
this.$API.vm.visit.create.req(this.form).then(res=>{ this.$API.vm.visit.create.req(this.form).then(res=>{
@ -500,9 +496,11 @@ export default {
this.$message.success("项目创建成功"); this.$message.success("项目创建成功");
this.getInit(); this.getInit();
this.active = 1; this.active = 1;
this.isSaving = false;
}).catch(()=>{
this.isSaving = false;
}) })
} }
} }
}); });
} else { } else {
@ -586,6 +584,7 @@ export default {
// //
submitticket(id){ submitticket(id){
this.ticket={}; this.ticket={};
this.isSaving = true;
this.ticket.title = this.form.name; this.ticket.title = this.form.name;
this.ticket.workflow=this.initform.workflow; this.ticket.workflow=this.initform.workflow;
this.ticket.ticket_data={visit:this.visitid,name:this.form.name}; this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
@ -596,8 +595,9 @@ export default {
name: "visit", name: "visit",
query: {}, query: {},
}); });
}).catch(()=>{
this.isSaving = false;
}); });
} }
}, },
}; };