feat: 优化handover_form
This commit is contained in:
parent
d445981929
commit
53ce3694be
|
@ -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: {
|
||||||
|
|
|
@ -251,8 +251,14 @@
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
<save-dialog
|
<el-drawer
|
||||||
v-if="dialog.save"
|
v-model="dialog.save"
|
||||||
|
:title="titleMap[mode]"
|
||||||
|
:size="'90%'"
|
||||||
|
destroy-on-close
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<save-dialog
|
||||||
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();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,217 +1,218 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-container>
|
||||||
:title="titleMap[mode]"
|
<el-main class="nopadding">
|
||||||
v-model="visible"
|
<el-form
|
||||||
width="1000px"
|
ref="dialogForm"
|
||||||
:size="1000"
|
:model="form"
|
||||||
destroy-on-close
|
:rules="rules"
|
||||||
@closed="$emit('closed')"
|
label-width="80px"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-row>
|
||||||
ref="dialogForm"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
label-width="80px"
|
|
||||||
>
|
|
||||||
<el-row>
|
|
||||||
<el-form-item label="交接物料">
|
|
||||||
<el-button type="primary" @click="addMaterial" v-if="mode!=='show'">手动添加</el-button>
|
|
||||||
<scScanner @scanResult="codeTextChange"></scScanner>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label-width="0">
|
|
||||||
<el-input
|
|
||||||
ref="codeInput"
|
|
||||||
v-model="codeText"
|
|
||||||
clearable
|
|
||||||
placeholder="物料批次"
|
|
||||||
style="width: 200px;margin-left: 4px;"
|
|
||||||
@keyup.enter="codeTextChange(codeText)"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="总计:">
|
|
||||||
{{ totalCount }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="原始物料" v-if="mode!='add'&&form.mtype==20" style="margin-left: 20px;">
|
|
||||||
<el-col >{{ form.batch }}</el-col>
|
|
||||||
</el-form-item>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-show="addShow">
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="交接物料">
|
<el-form-item label="交接物料">
|
||||||
<xtSelect
|
<el-button type="primary" @click="addMaterial" v-if="mode!=='show'">手动添加</el-button>
|
||||||
:apiObj="apiObjM"
|
<scScanner @scanResult="codeTextChange"></scScanner>
|
||||||
v-model="selectObjIds"
|
|
||||||
v-model:obj="selectObjs"
|
|
||||||
:labelField="'batch'"
|
|
||||||
style="width: 100%;"
|
|
||||||
:params = "paramsM"
|
|
||||||
:multiple="true"
|
|
||||||
@change="materialChange0"
|
|
||||||
>
|
|
||||||
<el-table-column label="物料" prop="full_name">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
|
|
||||||
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
|
|
||||||
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
|
|
||||||
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="可交接数量" prop="count_canhandover" width="110px"></el-table-column>
|
|
||||||
</xtSelect>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label-width="0">
|
||||||
</el-row>
|
<el-input
|
||||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
ref="codeInput"
|
||||||
<el-col :span="12">
|
v-model="codeText"
|
||||||
<el-form-item label="交接物料">
|
|
||||||
<el-input v-model="listItem.label" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-form-item label="总数量">
|
|
||||||
<span>{{ listItem.count_cando }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="交接数量">
|
|
||||||
<el-input-number
|
|
||||||
v-model="listItem.count"
|
|
||||||
controls-position="right"
|
|
||||||
:min="0"
|
|
||||||
step="1"
|
|
||||||
:max="listItem.count_cando"
|
|
||||||
:disabled="mode==='show'"
|
|
||||||
:step-strictly="true"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="交接数量"
|
|
||||||
@change="countChange"
|
|
||||||
>
|
|
||||||
</el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2" v-if="mode!=='show'">
|
|
||||||
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :md="12" :sm="24">
|
|
||||||
<el-form-item label="交送日期" prop="send_date">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.send_date"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择时间"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :md="12" :sm="24" v-if="mtype!==30">
|
|
||||||
<el-form-item label="交送人">
|
|
||||||
<el-select
|
|
||||||
v-model="form.send_user"
|
|
||||||
placeholder="交送人"
|
|
||||||
clearable
|
clearable
|
||||||
filterable
|
placeholder="物料批次"
|
||||||
style="width: 100%"
|
style="width: 200px;margin-left: 4px;"
|
||||||
>
|
@keyup.enter="codeTextChange(codeText)"
|
||||||
<el-option
|
></el-input>
|
||||||
v-for="item in userList"
|
</el-form-item>
|
||||||
:key="item.id"
|
<el-form-item label="总计:">
|
||||||
:label="item.name"
|
{{ totalCount }}
|
||||||
:value="item.id"
|
</el-form-item>
|
||||||
|
<el-form-item label="原始物料" v-if="mode!='add'&&form.mtype==20" style="margin-left: 20px;">
|
||||||
|
<el-col >{{ form.batch }}</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-show="addShow">
|
||||||
|
<el-col>
|
||||||
|
<el-form-item label="交接物料">
|
||||||
|
<xtSelect
|
||||||
|
:apiObj="apiObjM"
|
||||||
|
v-model="selectObjIds"
|
||||||
|
v-model:obj="selectObjs"
|
||||||
|
:labelField="'batch'"
|
||||||
|
style="width: 100%;"
|
||||||
|
:params = "paramsM"
|
||||||
|
:multiple="true"
|
||||||
|
@change="materialChange0"
|
||||||
|
>
|
||||||
|
<el-table-column label="物料" prop="full_name">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
|
||||||
|
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
|
||||||
|
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
|
||||||
|
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="可交接数量" prop="count_canhandover" width="110px"></el-table-column>
|
||||||
|
</xtSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="交接物料">
|
||||||
|
<el-input v-model="listItem.label" disabled></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-form-item label="总数量">
|
||||||
|
<span>{{ listItem.count_cando }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="交接数量">
|
||||||
|
<el-input-number
|
||||||
|
v-model="listItem.count"
|
||||||
|
controls-position="right"
|
||||||
|
:min="0"
|
||||||
|
step="1"
|
||||||
|
:max="listItem.count_cando"
|
||||||
|
:disabled="mode==='show'"
|
||||||
|
:step-strictly="true"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="交接数量"
|
||||||
|
@change="countChange"
|
||||||
|
>
|
||||||
|
</el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2" v-if="mode!=='show'">
|
||||||
|
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="交送日期" prop="send_date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.send_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择时间"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :md="12" :sm="24" v-if="mtype!==30">
|
||||||
<el-col :md="12" :sm="24" v-if="mtype!==30">
|
<el-form-item label="交送人">
|
||||||
<el-form-item label="接收工段" prop="recive_mgroup">
|
<el-select
|
||||||
<el-select
|
v-model="form.send_user"
|
||||||
v-model="form.recive_mgroup"
|
placeholder="交送人"
|
||||||
placeholder="接收工段"
|
clearable
|
||||||
clearable
|
filterable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="type==40||mode!=='add'"
|
>
|
||||||
@change="getUserList2"
|
<el-option
|
||||||
>
|
v-for="item in userList"
|
||||||
<el-option
|
:key="item.id"
|
||||||
v-for="item in mgroupOptions"
|
:label="item.name"
|
||||||
:key="item.id"
|
:value="item.id"
|
||||||
:label="item.name"
|
/>
|
||||||
:value="item.id"
|
</el-select>
|
||||||
></el-option>
|
</el-form-item>
|
||||||
</el-select>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :md="12" :sm="24" v-if="mtype!==30">
|
||||||
</el-col>
|
<el-form-item label="接收工段" prop="recive_mgroup">
|
||||||
<el-col :md="12" :sm="24" v-if="mtype!==30">
|
<el-select
|
||||||
<el-form-item label="接收人">
|
v-model="form.recive_mgroup"
|
||||||
<el-select
|
placeholder="接收工段"
|
||||||
v-model="form.recive_user"
|
clearable
|
||||||
placeholder="接收人"
|
style="width: 100%"
|
||||||
clearable
|
:disabled="type==40||mode!=='add'"
|
||||||
filterable
|
@change="getUserList2"
|
||||||
style="width: 100%"
|
>
|
||||||
>
|
<el-option
|
||||||
<el-option
|
v-for="item in mgroupOptions"
|
||||||
v-for="item in userList2"
|
:key="item.id"
|
||||||
:key="item.id"
|
:label="item.name"
|
||||||
:label="item.name"
|
:value="item.id"
|
||||||
:value="item.id"
|
></el-option>
|
||||||
/>
|
</el-select>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :md="12" :sm="24" v-if="mtype!==30">
|
||||||
<el-col :md="12" :sm="24" v-if="type==10&&mtype==30">
|
<el-form-item label="接收人">
|
||||||
<el-form-item label="更改批次">
|
<el-select
|
||||||
<el-switch v-model="change_batch"></el-switch>
|
v-model="form.recive_user"
|
||||||
</el-form-item>
|
placeholder="接收人"
|
||||||
</el-col>
|
clearable
|
||||||
<el-col :md="12" :sm="24">
|
filterable
|
||||||
<el-form-item label="处理备注">
|
style="width: 100%"
|
||||||
<el-input v-model="form.note" placeholder="处理备注"></el-input>
|
>
|
||||||
</el-form-item>
|
<el-option
|
||||||
</el-col>
|
v-for="item in userList2"
|
||||||
<el-col :md="12" :sm="24" v-if="change_batch">
|
:key="item.id"
|
||||||
<el-form-item label="新批次号" prop="new_batch">
|
:label="item.name"
|
||||||
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
|
:value="item.id"
|
||||||
</el-form-item>
|
/>
|
||||||
</el-col>
|
</el-select>
|
||||||
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo'">
|
</el-form-item>
|
||||||
<el-form-item label="检验附件">
|
</el-col>
|
||||||
<sc-upload-file
|
<el-col :md="12" :sm="24" v-if="type==10&&mtype==30">
|
||||||
v-model="fileList"
|
<el-form-item label="更改批次">
|
||||||
:multiple="false"
|
<el-switch v-model="change_batch"></el-switch>
|
||||||
:limit="1"
|
</el-form-item>
|
||||||
:accept="['.xlsx', '.xls']"
|
</el-col>
|
||||||
@success = "fileUPSuccess"
|
<el-col :md="12" :sm="24">
|
||||||
>
|
<el-form-item label="处理备注">
|
||||||
<el-button type="primary" icon="el-icon-upload"> </el-button>
|
<el-input v-model="form.note" placeholder="处理备注"></el-input>
|
||||||
</sc-upload-file>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :md="12" :sm="24" v-if="change_batch">
|
||||||
</el-row>
|
<el-form-item label="新批次号" prop="new_batch">
|
||||||
</el-form>
|
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
|
||||||
<el-footer v-show="mode!=='show'">
|
</el-form-item>
|
||||||
<template v-if="(route_code=='tuihuo'&&type==10&&mtype==10)||form.ticket!=null">
|
</el-col>
|
||||||
<el-button
|
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo'">
|
||||||
v-for="item in transitions"
|
<el-form-item label="检验附件">
|
||||||
:key="item.id"
|
<sc-upload-file
|
||||||
type="primary"
|
v-model="fileList"
|
||||||
:loading="isSaveing"
|
:multiple="false"
|
||||||
:disabled="isSaveing"
|
:limit="1"
|
||||||
@click="submitTicketCreate(item.id)"
|
:accept="['.xlsx', '.xls']"
|
||||||
style="margin-right: 4px"
|
@success = "fileUPSuccess"
|
||||||
>{{ item.name }}</el-button>
|
>
|
||||||
</template>
|
<el-button type="primary" icon="el-icon-upload"> </el-button>
|
||||||
<el-button v-else type="primary" v-loading="isSaveing" @click="submit">确定</el-button>
|
</sc-upload-file>
|
||||||
<el-button @click="visible = false">取消</el-button>
|
</el-form-item>
|
||||||
</el-footer>
|
</el-col>
|
||||||
</el-dialog>
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-footer v-show="mode!=='show'">
|
||||||
|
<template v-if="(route_code=='tuihuo'&&type==10&&mtype==10)||form.ticket!=null">
|
||||||
|
<ticketd_b_start :workflow_key="'backfire'" :title="'退火交接审批单'" :t_id="form.id" :ticketId="form.ticket"
|
||||||
|
@success="()=>{$emit('success')} " :submit_b_func="submit_b_func" ref="ticketd_b_start"></ticketd_b_start>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="primary" v-loading="isSaveing" @click="submit">确定</el-button>
|
||||||
|
<el-button @click="$emit('closed')">取消</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</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,62 +554,14 @@ 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 = '退火交接审批单';
|
} else if (that.mode == "edit") {
|
||||||
ticket.workflow = that.initForm.workflow;
|
await that.$API.wpm.handover.update.req(that.form.id, that.form);
|
||||||
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") {
|
|
||||||
that.$API.wpm.handover.update.req(that.form.id, that.form).then((res) => {
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
//提交
|
//提交
|
||||||
submit() {
|
submit() {
|
||||||
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue