This commit is contained in:
shijing 2025-09-25 08:54:43 +08:00
commit a842a1a358
6 changed files with 272 additions and 302 deletions

View File

@ -75,7 +75,7 @@ export default {
emits: ["success", "closed"], emits: ["success", "closed"],
components: { ticketd }, components: { ticketd },
props: { props: {
modelId: { type: String, default: null }, t_id: { type: String, default: null },
}, },
data() { data() {
return { return {
@ -107,8 +107,8 @@ export default {
mounted() { mounted() {
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code; this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.tableData = []; this.tableData = [];
if (this.modelId) { if (this.t_id) {
this.getRoutePackDetail(this.modelId); this.getRoutePackDetail(this.t_id);
} }
}, },
methods: { methods: {

View File

@ -133,7 +133,8 @@
<h4 :id="titleId" :class="titleClass">工单详情</h4> <h4 :id="titleId" :class="titleClass">工单详情</h4>
<el-button type="danger" @click="close">关闭</el-button> <el-button type="danger" @click="close">关闭</el-button>
</template> </template>
<component :is="currentComponent" :ticketId="ticketId" :modelId="modelId"></component> <component :is="currentComponent" :ticketId="ticketId" :t_id="t_id" @closed="drawer = false"
@success="()=>{drawer = false; $refs.table.refresh()}"></component>
</el-drawer> </el-drawer>
</el-container> </el-container>
</template> </template>
@ -179,7 +180,7 @@ export default {
wfOptions: [], wfOptions: [],
currentComponent: null, currentComponent: null,
ticketId: null, ticketId: null,
modelId: null, t_id: null,
}; };
}, },
mounted() { mounted() {
@ -220,7 +221,7 @@ export default {
handleShow(row) { handleShow(row) {
this.drawer = true; this.drawer = true;
this.ticketId = row.id; this.ticketId = row.id;
this.modelId = row.ticket_data.t_id; this.t_id = row.ticket_data.t_id;
const viewPath = row.workflow_.view_path; const viewPath = row.workflow_.view_path;
// import // import
this.currentComponent = markRaw( this.currentComponent = markRaw(

View File

@ -1,5 +1,5 @@
<template> <template>
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames" style="padding-left: 2px; padding-right: 2px;">
<el-collapse-item title="基本信息" name="1"> <el-collapse-item title="基本信息" name="1">
<el-descriptions :column="1"> <el-descriptions :column="1">
<el-descriptions-item> <el-descriptions-item>
@ -12,6 +12,10 @@
{{ actStateEnum[ticketDetail.act_state]?.text }} {{ actStateEnum[ticketDetail.act_state]?.text }}
</el-tag> </el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="可处理人:"
v-if="ticketDetail.participant_type == 2 || ticketDetail.participant_type == 1">
<span v-for="item in ticketDetail.participant_" :key="item.id">{{ item.name }}/</span>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-collapse-item> </el-collapse-item>
<el-collapse-item title="操作" name="2" v-if="actionShow"> <el-collapse-item title="操作" name="2" v-if="actionShow">
@ -85,12 +89,13 @@ const handleForm = ref({
suggestion: "" suggestion: ""
}) })
onMounted(() => { onMounted(() => {
console.log('props.ticketId', props.ticketId) console.log(props)
if (props.ticketId) { if (props.ticketId) {
getTicketDetail(); getTicketDetail();
getTicketLog(); getTicketLog();
} }
}); });
const emit = defineEmits(['success']);
const refreshTicket = async () => { const refreshTicket = async () => {
actionShow.value = false actionShow.value = false
isOwn.value = false isOwn.value = false
@ -100,6 +105,7 @@ const refreshTicket = async () => {
activeNames.value = ['1', '3'] // activeNames.value = ['1', '3'] //
getTicketDetail() getTicketDetail()
getTicketLog() getTicketLog()
emit('success')
} }
const getTicketDetail = () => { const getTicketDetail = () => {
@ -162,7 +168,7 @@ const handleTransition = (transitionId) => {
params.transition = transitionId; params.transition = transitionId;
if (props.ticket_data) { if (props.ticket_data) {
params.ticket_data = props.ticket_data; params.ticket_data = props.ticket_data;
}else{ } else {
params.ticket_data = {}; params.ticket_data = {};
} }
params.suggestion = handleForm.value.suggestion; params.suggestion = handleForm.value.suggestion;

View File

@ -27,9 +27,13 @@ const props = defineProps({
const workflow = ref(null); const workflow = ref(null);
const transitions = ref([]); const transitions = ref([]);
onMounted(async () => { onMounted(async () => {
init()
})
const init = async () => {
if (props.ticketId != null && props.ticketId != undefined) { if (props.ticketId != null && props.ticketId != undefined) {
API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => { API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => {
transitions.value = res; transitions.value = res;
console.log("res", res)
}); });
}else if (props.workflow_key !=null && props.workflow_key != undefined) { }else if (props.workflow_key !=null && props.workflow_key != undefined) {
let res = await API.wf.workflow.initkey.req(props.workflow_key); let res = await API.wf.workflow.initkey.req(props.workflow_key);
@ -38,8 +42,7 @@ onMounted(async () => {
}else{ }else{
ElMessage.error("缺少workflow_key或ticketId"); ElMessage.error("缺少workflow_key或ticketId");
} }
}
})
const isSaveing = ref(false); const isSaveing = ref(false);

View File

@ -251,8 +251,14 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<el-drawer
v-model="dialog.save"
:title="titleMap[mode]"
:size="'90%'"
destroy-on-close
:close-on-click-modal="false"
>
<save-dialog <save-dialog
v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
:type="type" :type="type"
:process = "processId" :process = "processId"
@ -261,8 +267,8 @@
:mgroupId="mgroupId" :mgroupId="mgroupId"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
> ></save-dialog>
</save-dialog> </el-drawer>
<el-dialog title="退料操作" v-model="backDialogVisible" style="width: 70%;"> <el-dialog title="退料操作" v-model="backDialogVisible" style="width: 70%;">
<el-row v-for="item in handoverbList" :key="item.id" style="padding: 10px 10px 0 20px;"> <el-row v-for="item in handoverbList" :key="item.id" style="padding: 10px 10px 0 20px;">
<el-col style="display: flex;border-bottom: 1px dashed #eee;"> <el-col style="display: flex;border-bottom: 1px dashed #eee;">
@ -379,6 +385,12 @@ export default {
}, },
route_code: "", route_code: "",
// setNameVisible: false, // setNameVisible: false,
titleMap: {
add: "新增交接记录",
edit: "编辑交接记录",
show: "查看交接记录",
},
mode: "add"
}; };
}, },
mounted() { mounted() {
@ -410,6 +422,7 @@ export default {
// //
table_add(type) { table_add(type) {
this.dialog.save = true; this.dialog.save = true;
this.mode = "add";
this.type = type; this.type = type;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add",'',10); this.$refs.saveDialog.open("add",'',10);
@ -419,6 +432,7 @@ export default {
let that = this; let that = this;
that.type = 10; that.type = 10;
that.codeText = codeText; that.codeText = codeText;
that.mode = "add";
that.dialog.save = true; that.dialog.save = true;
that.$nextTick(() => { that.$nextTick(() => {
that.$refs.saveDialog.open("add",codeText,10); that.$refs.saveDialog.open("add",codeText,10);
@ -429,6 +443,7 @@ export default {
this.type = 20; this.type = 20;
that.codeText2 = codeText2; that.codeText2 = codeText2;
this.dialog.save = true; this.dialog.save = true;
that.mode = "add";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add",codeText2,10); this.$refs.saveDialog.open("add",codeText2,10);
}); });
@ -437,6 +452,7 @@ export default {
table_edit(row) { table_edit(row) {
this.type=row.type; this.type=row.type;
this.dialog.save = true; this.dialog.save = true;
this.mode = "edit";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row); this.$refs.saveDialog.open("edit").setData(row);
}); });
@ -444,6 +460,7 @@ export default {
table_show(row){ table_show(row){
this.type=row.type; this.type=row.type;
this.dialog.save = true; this.dialog.save = true;
this.mode = "show";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row); this.$refs.saveDialog.open("show").setData(row);
}); });
@ -561,7 +578,7 @@ export default {
// //
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
this.dialog.save = true; this.dialog.save = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
}, },

View File

@ -1,12 +1,6 @@
<template> <template>
<el-dialog <el-container>
:title="titleMap[mode]" <el-main class="nopadding">
v-model="visible"
width="1000px"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-form <el-form
ref="dialogForm" ref="dialogForm"
:model="form" :model="form"
@ -193,25 +187,32 @@
</el-form> </el-form>
<el-footer v-show="mode!=='show'"> <el-footer v-show="mode!=='show'">
<template v-if="(route_code=='tuihuo'&&type==10&&mtype==10)||form.ticket!=null"> <template v-if="(route_code=='tuihuo'&&type==10&&mtype==10)||form.ticket!=null">
<el-button <ticketd_b_start :workflow_key="'backfire'" :title="'退火交接审批单'" :t_id="form.id" :ticketId="form.ticket"
v-for="item in transitions" @success="()=>{$emit('success')} " :submit_b_func="submit_b_func" ref="ticketd_b_start"></ticketd_b_start>
:key="item.id"
type="primary"
:loading="isSaveing"
:disabled="isSaveing"
@click="submitTicketCreate(item.id)"
style="margin-right: 4px"
>{{ item.name }}</el-button>
</template> </template>
<el-button v-else type="primary" v-loading="isSaveing" @click="submit">确定</el-button> <el-button v-else type="primary" v-loading="isSaveing" @click="submit">确定</el-button>
<el-button @click="visible = false">取消</el-button> <el-button @click="$emit('closed')">取消</el-button>
</el-footer> </el-footer>
</el-dialog> </el-main>
<el-aside width="20%" v-if="form.ticket">
<ticketd :ticketId="form.ticket" @success="$emit('success')"></ticketd>
</el-aside>
</el-container>
</template> </template>
<script> <script>
import ticketd_b_start from "@/views/wf/ticketd_b_start.vue";
import ticketd from '@/views/wf/ticketd.vue'
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
components: {
ticketd_b_start, ticketd
},
props: { props: {
t_id: {
type: String,
default: null
},
type: { type: {
type: Number, type: Number,
default: 10, default: 10,
@ -245,12 +246,7 @@ export default {
selectItems:[], selectItems:[],
yseorno: ["是", "否"], yseorno: ["是", "否"],
loading: false, loading: false,
mode: "add", mode: "show",
titleMap: {
add: "新增交接记录",
edit: "编辑交接记录",
show: "查看交接记录",
},
lists:[],// lists:[],//
handle_user: [], handle_user: [],
form: { form: {
@ -331,7 +327,6 @@ export default {
mgroupOptions: [], mgroupOptions: [],
materialOptions: [], materialOptions: [],
addShow: false, addShow: false,
visible: false,
scanVisible:false, scanVisible:false,
isSaveing: false, isSaveing: false,
setFiltersVisible: false, setFiltersVisible: false,
@ -380,25 +375,25 @@ export default {
}else{ }else{
that.getMgroupOptions(); that.getMgroupOptions();
} }
if(that.route_code=='tuihuo'){ that.getTid();
that.getInit();
}
}, },
methods: { methods: {
// getTid (){
getInit() { var that = this;
let that = this; if (that.t_id) {
if(this.form.ticket!==null){ that.$API.wpm.handover.item.req(that.t_id).then(res=>{
this.$API.wf.ticket.ticketTransitions.req(this.form.ticket).then((res) => { that.setData(res);
that.transitions = res; if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
}) that.mode = "edit";
}else{ }else{
that.$API.wf.workflow.initkey.req(" backfire").then((res) => { that.mode = "show";
that.initForm = res;
that.transitions = res.transitions;
});
} }
that.$nextTick(()=>{
that.$refs.ticketd_b_start.init();
})
})
}
}, },
// //
getMgroupOptions() { getMgroupOptions() {
@ -517,7 +512,6 @@ export default {
if(mtype==30){// if(mtype==30){//
this.change_batch = true; this.change_batch = true;
} }
this.visible = true;
return this; return this;
}, },
//handoverb //handoverb
@ -560,61 +554,13 @@ export default {
fileUPSuccess(res) { fileUPSuccess(res) {
this.test_file = res.path; this.test_file = res.path;
}, },
//退, async submit_b_func() {
submitTicketCreate(id) {
let that = this; let that = this;
that.isSaveing = true;
that.form.oinfo_json = {};
that.form.oinfo_json.test_file = that.test_file;
if(that.mode == "add") { if(that.mode == "add") {
that.$API.wpm.handover.create.req(that.form).then((res) => { let res = await that.$API.wpm.handover.create.req(that.form);
let ticket = {}; that.form.id = res.id;
ticket.title = '退火交接审批单';
ticket.workflow = that.initForm.workflow;
ticket.ticket_data = {t_id: res.id};
ticket.transition = id;
that.$API.wf.ticket.create.req(ticket).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
}).catch((e) => {
that.isSaveing = false;
});
} else if (that.mode == "edit") { } else if (that.mode == "edit") {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => { await that.$API.wpm.handover.update.req(that.form.id, that.form);
if (that.form.ticket == null) {
let ticket = {};
ticket.title = '退火交接审批单';
ticket.workflow = that.initForm.workflow;
ticket.ticket_data = {t_id: res.id};
ticket.transition = id;
that.$API.wf.ticket.create.req(ticket).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
});
} else {
let data = {transition: id, ticket_data: {}}
that.$API.wf.ticket.ticketHandle.req(that.form.ticket, data).then(res=>{
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("提交成功");
}).catch((e) => {
that.isSaveing = false;
})
}
}).catch((err) => {
that.isSaveing = false;
return err;
});
} }
}, },
// //
@ -634,7 +580,6 @@ export default {
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => { that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.$emit("success"); that.$emit("success");
that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch((err) => { }).catch((err) => {
that.isSaveing = false; that.isSaveing = false;
@ -645,7 +590,6 @@ export default {
that.$API.wpm.handover.create.req(that.form).then((res) => { that.$API.wpm.handover.create.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.$emit("success"); that.$emit("success");
that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch((err) => { }).catch((err) => {
that.isSaveing = false; that.isSaveing = false;
@ -655,7 +599,6 @@ export default {
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => { that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;
that.$emit("success", that.form, that.mode); that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch((err) => { }).catch((err) => {
that.isSaveing = false; that.isSaveing = false;