Commit 74f05069 authored by 李驰骋's avatar 李驰骋

工单状态调整

parent ac70517b
......@@ -18,13 +18,13 @@
</el-form-item> -->
<el-form-item label="状态" prop="status">
<el-select value="['','']"
v-model="queryParams.statusArr"
clearable
placeholder="请选择状态"
multiple="true"
v-model="queryParams.statusArr"
clearable
placeholder="请选择状态"
multiple="true"
>
<el-option
v-for="dict in dict.type.mes_order_status"
v-for="dict in dict.type.mes_workorder_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
......@@ -106,10 +106,10 @@
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>重置</el-button
>
</el-form-item>
</el-form>
......@@ -123,7 +123,7 @@
size="mini"
@click="handleAdd"
v-hasPermi="['mes:pro:workorder:add']"
>新增</el-button
>新增</el-button
>
</el-col>
<el-col :span="1.5">
......@@ -135,7 +135,7 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:pro:workorder:edit']"
>修改</el-button
>修改</el-button
>
</el-col>
<el-col :span="1.5">
......@@ -147,7 +147,7 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:pro:workorder:remove']"
>删除</el-button
>删除</el-button
>
</el-col>
<el-col :span="1.5">
......@@ -158,7 +158,7 @@
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:workorder:export']"
>导出</el-button
>导出</el-button
>
</el-col>
<el-col :span="1.5">
......@@ -191,7 +191,7 @@
size="mini"
@click="handleImport"
v-hasPermi="['mes:pro:workorder:edit']"
>导入工单</el-button
>导入工单</el-button
>
</el-col>
<right-toolbar
......@@ -223,7 +223,7 @@
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>下载模板</el-link
>
</div>
</el-upload>
......@@ -250,7 +250,7 @@
type="text"
@click="handleView(scope.row)"
v-hasPermi="['mes:pro:workorder:query']"
>{{ scope.row.workorderCode }}</el-button
>{{ scope.row.workorderCode }}</el-button
>
</template>
</el-table-column>
......@@ -370,7 +370,7 @@
v-if="scope.row.status == 'PREPARE'"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:workorder:edit']"
>修改</el-button
>修改</el-button
>
<el-button
size="mini"
......@@ -379,7 +379,7 @@
v-if="scope.row.status == 'PREPARE'"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:workorder:remove']"
>删除</el-button
>删除</el-button
>
<!-- <el-button
size="mini"
......@@ -467,7 +467,7 @@
v-for="dict in dict.type.mes_workorder_sourcetype"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>{{ dict.label }}</el-radio
>
</el-radio-group>
<el-radio-group v-model="form.orderSource" v-else>
......@@ -475,7 +475,7 @@
v-for="dict in dict.type.mes_workorder_sourcetype"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
......@@ -671,13 +671,13 @@
type="primary"
@click="cancel"
v-if="optType == 'view' || form.status != 'PREPARE'"
>返回</el-button
>返回</el-button
>
<el-button
type="primary"
@click="submitForm"
v-if="form.status == 'PREPARE' && optType != 'view'"
> </el-button
> </el-button
>
<el-button
type="success"
......@@ -687,7 +687,7 @@
optType != 'view' &&
form.workorderId != null
"
> </el-button
> </el-button
>
<el-button @click="cancel"> </el-button>
</div>
......@@ -696,506 +696,506 @@
</template>
<script>
import {
listWorkorder,
getWorkorder,
delWorkorder,
addWorkorder,
updateWorkorder,
dofinish,
doCheckToolNum
} from "@/api/mes/pro/workorder";
import { addProtaskList } from "@/api/mes/pro/protask";
import Workorderbom from "./bom/bom.vue";
import WorkorderItemList from "./items/item.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
import ClientSelect from "@/components/clientSelect/single.vue";
import VendorSelect from "@/components/vendorSelect/single.vue";
import { genCode } from "@/api/system/autocode/rule";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getToken } from "@/utils/auth";
import {
listWorkorder,
getWorkorder,
delWorkorder,
addWorkorder,
updateWorkorder,
dofinish,
doCheckToolNum
} from "@/api/mes/pro/workorder";
import { addProtaskList } from "@/api/mes/pro/protask";
import Workorderbom from "./bom/bom.vue";
import WorkorderItemList from "./items/item.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
import ClientSelect from "@/components/clientSelect/single.vue";
import VendorSelect from "@/components/vendorSelect/single.vue";
import { genCode } from "@/api/system/autocode/rule";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getToken } from "@/utils/auth";
export default {
name: "Workorder",
dicts: [
"mes_workorder_status",
"mes_workorder_sourcetype",
"mes_workorder_type",
],
components: {
Treeselect,
ItemSelect,
ClientSelect,
VendorSelect,
Workorderbom,
WorkorderItemList,
},
data() {
return {
//自动生成编码
autoGenFlag: false,
optType: undefined,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 非单个禁用
single: true,
// 总条数
total: 0,
// 非多个禁用
multiple: true,
// 生产工单表格数据
workorderList: [],
// 生产工单树选项
workorderOptions: [],
selectedRows: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
export default {
name: "Workorder",
dicts: [
"mes_workorder_status",
"mes_workorder_sourcetype",
"mes_workorder_type",
],
components: {
Treeselect,
ItemSelect,
ClientSelect,
VendorSelect,
Workorderbom,
WorkorderItemList,
},
data() {
return {
//自动生成编码
autoGenFlag: false,
optType: undefined,
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 非单个禁用
single: true,
// 总条数
total: 0,
// 非多个禁用
multiple: true,
// 生产工单表格数据
workorderList: [],
// 生产工单树选项
workorderOptions: [],
selectedRows: [],
// 弹出层标题
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/mes/pro/workorder/importData",
// 是否显示弹出层
open: false,
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/mes/pro/workorder/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workorderCode: null,
workorderName: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
routeName: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
statusArr: ["PREPARE","ORCHESTRATED"],
},
// 表单参数
form: {},
// 表单校验
rules: {
workorderCode: [
{ required: true, message: "工单编码不能为空", trigger: "blur" },
],
workorderName: [
{ required: true, message: "工单名称不能为空", trigger: "blur" },
],
workorderType: [
{ required: true, message: "请选择生产工单类型", trigger: "blur" },
],
orderSource: [
{ required: true, message: "来源类型不能为空", trigger: "blur" },
],
productId: [
{ required: true, message: "产品不能为空", trigger: "blur" },
],
productCode: [
{ required: true, message: "产品编号不能为空", trigger: "blur" },
],
productName: [
{ required: true, message: "产品名称不能为空", trigger: "blur" },
],
quantity: [
{ required: true, message: "生产数量不能为空", trigger: "blur" },
],
requestDate: [
{ required: true, message: "需求日期不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询生产工单列表 */
getList() {
this.loading = true;
listWorkorder(this.queryParams).then((response) => {
this.workorderList = this.handleTree(
response.rows,
"workorderId",
"parentId"
);
this.total = response.total;
this.loading = false;
});
},
importTemplate() {
this.download(
"mes/pro/workorder/importTemplate",
{},
`work_order_template_${new Date().getTime()}.xlsx`
);
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workorderCode: null,
workorderName: null,
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
routeName: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
requestDate: null,
parentId: null,
ancestors: null,
statusArr: ["PREPARE","CONFIRMED"],
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
},
// 表单参数
form: {},
// 表单校验
rules: {
workorderCode: [
{ required: true, message: "工单编码不能为空", trigger: "blur" },
],
workorderName: [
{ required: true, message: "工单名称不能为空", trigger: "blur" },
],
workorderType: [
{ required: true, message: "请选择生产工单类型", trigger: "blur" },
],
orderSource: [
{ required: true, message: "来源类型不能为空", trigger: "blur" },
],
productId: [
{ required: true, message: "产品不能为空", trigger: "blur" },
],
productCode: [
{ required: true, message: "产品编号不能为空", trigger: "blur" },
],
productName: [
{ required: true, message: "产品名称不能为空", trigger: "blur" },
],
quantity: [
{ required: true, message: "生产数量不能为空", trigger: "blur" },
],
requestDate: [
{ required: true, message: "需求日期不能为空", trigger: "blur" },
],
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
};
},
created() {
this.getList();
},
methods: {
/** 查询生产工单列表 */
getList() {
this.loading = true;
listWorkorder(this.queryParams).then((response) => {
this.workorderList = this.handleTree(
response.rows,
"workorderId",
"parentId"
);
this.total = response.total;
this.loading = false;
});
},
importTemplate() {
this.download(
"mes/pro/workorder/importTemplate",
{},
`work_order_template_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
/** 转换生产工单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.workorderId,
label: node.workorderName,
children: node.children,
};
},
/** 查询生产工单下拉树结构 */
getTreeselect() {
listWorkorder().then((response) => {
this.workorderOptions = [];
const data = {
workorderId: 0,
workorderName: "顶级节点",
children: [],
};
data.children = this.handleTree(
response.data,
"workorderId",
"parentId"
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.workorderOptions.push(data);
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
workorderId: null,
workorderCode: null,
workorderName: null,
workorderType: "SELF",
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
routeName: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
vendorId: null,
vendorCode: null,
vendorName: null,
requestDate: null,
parentId: null,
status: "PREPARE",
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.autoGenFlag = false;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//从BOM行中直接新增
handleSubAdd(row) {
this.open = false;
this.reset();
this.getTreeselect();
if (row != null && row.workorderId) {
this.form = row;
this.form.parentId = row.workorderId;
this.form.workorderId = null;
this.form.workorderCode = null;
} else {
this.form.parentId = 0;
}
this.open = true;
this.title = "添加生产工单";
this.optType = "add";
},
/** 新增按钮操作 */
handleAdd(row) {
this.getTreeselect();
// 跳转到申请单界
this.$router.push("/mes/pro/workorder/apply");
return;
// this.reset();
// this.getTreeselect();
// if (row != null && row.workorderId) {
// this.form.parentId = row.workorderId;
// this.form.orderSource = row.orderSource;
// this.form.sourceCode = row.sourceCode;
// this.form.clientId = row.clientId;
// this.form.clientCode = row.clientCode;
// this.form.clientName = row.clientName;
// } else {
// this.form.parentId = 0;
// }
// this.open = true;
// this.title = "添加生产工单";
// this.optType="add";
},
// 查询明细按钮操作
handleView(row) {
this.reset();
this.getTreeselect();
const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/info?workorderId=" + workorderId);
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
/** 转换生产工单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.workorderId,
label: node.workorderName,
children: node.children,
};
},
/** 查询生产工单下拉树结构 */
getTreeselect() {
listWorkorder().then((response) => {
this.workorderOptions = [];
const data = {
workorderId: 0,
workorderName: "顶级节点",
children: [],
};
data.children = this.handleTree(
response.data,
"workorderId",
"parentId"
);
this.workorderOptions.push(data);
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
workorderId: null,
workorderCode: null,
workorderName: null,
workorderType: "SELF",
orderSource: null,
sourceCode: null,
productId: null,
productCode: null,
productName: null,
productSpc: null,
routeName: null,
unitOfMeasure: null,
quantity: null,
quantityProduced: null,
quantityChanged: null,
quantityScheduled: null,
clientId: null,
clientCode: null,
clientName: null,
vendorId: null,
vendorCode: null,
vendorName: null,
requestDate: null,
parentId: null,
status: "PREPARE",
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.autoGenFlag = false;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//从BOM行中直接新增
handleSubAdd(row) {
this.open = false;
this.reset();
this.getTreeselect();
if (row != null && row.workorderId) {
this.form = row;
this.form.parentId = row.workorderId;
this.form.workorderId = null;
this.form.workorderCode = null;
} else {
this.form.parentId = 0;
}
this.open = true;
this.title = "添加生产工单";
this.optType = "add";
},
/** 新增按钮操作 */
handleAdd(row) {
this.getTreeselect();
// 跳转到申请单界
this.$router.push("/mes/pro/workorder/apply");
return;
// this.reset();
// this.getTreeselect();
// if (row != null && row.workorderId) {
// this.form.parentId = row.workorderId;
// this.form.orderSource = row.orderSource;
// this.form.sourceCode = row.sourceCode;
// this.form.clientId = row.clientId;
// this.form.clientCode = row.clientCode;
// this.form.clientName = row.clientName;
// } else {
// this.form.parentId = 0;
// }
// this.open = true;
// this.title = "添加生产工单";
// this.optType="add";
},
// 查询明细按钮操作
handleView(row) {
this.reset();
this.getTreeselect();
const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/info?workorderId=" + workorderId);
// this.reset();
// this.getTreeselect();
// const workorderId = row.workorderId || this.ids;
// getWorkorder(workorderId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "查看工单信息";
// this.optType = "view";
// });
},
handleSelectionChange(val) {
this.selectedRows = val;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// this.reset();
// this.getTreeselect();
// const workorderId = row.workorderId || this.ids;
// getWorkorder(workorderId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "查看工单信息";
// this.optType = "view";
// });
},
handleSelectionChange(val) {
this.selectedRows = val;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/edit?workorderId=" + workorderId);
const workorderId = row.workorderId || this.ids;
this.$router.push("/mes/pro/workorder/edit?workorderId=" + workorderId);
// this.reset();
// this.getTreeselect();
// if (row != null) {
// this.form.parentId = row.workorderId;
// }
// getWorkorder(row.workorderId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "修改生产工单";
// this.optType="edit";
// });
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.workorderId != null) {
updateWorkorder(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
//this.open = false;
this.$refs["bomlist"].getList();
this.getList();
});
} else {
addWorkorder(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
//this.open = false;
this.form.workorderId = response.data;
this.getList();
});
// this.reset();
// this.getTreeselect();
// if (row != null) {
// this.form.parentId = row.workorderId;
// }
// getWorkorder(row.workorderId).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "修改生产工单";
// this.optType="edit";
// });
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.workorderId != null) {
updateWorkorder(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
//this.open = false;
this.$refs["bomlist"].getList();
this.getList();
});
} else {
addWorkorder(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
//this.open = false;
this.form.workorderId = response.data;
this.getList();
});
}
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(
'是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?'
)
.then(function () {
return delWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 生产任务单操作 */
handleDofinish() {
this.$modal
.confirm("是否生成选中的任务单?")
.then(() => {
const ids = this.selectedRows.map((v) => v.workorderId);
console.log("00000", ids);
return addProtaskList(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("生成成功");
})
.catch(() => {});
},
handleToolNumCheck(){
this.$modal
.confirm("是否检查刀具模版齐套?")
.then(() => {
const ids = this.selectedRows.map((v) => v.workorderId);
return doCheckToolNum(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("已齐套");
})
.catch(() => {});
},
handleSelectProduct() {
this.$refs.itemSelect.showFlag = true;
},
handleSelectClient() {
this.$refs.clientSelect.showFlag = true;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/pro/workorder/export",
{
...this.queryParams,
},
`workorder_${new Date().getTime()}.xlsx`
);
},
handleConfirm() {
let that = this;
this.$modal
.confirm("是确认完成工单编制?【确认后将不能更改】")
.then(function () {
that.form.status = "CONFIRMED";
that.submitForm();
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm(
'是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?'
)
.then(function () {
return delWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 生产任务单操作 */
handleDofinish() {
this.$modal
.confirm("是否生成选中的任务单?")
.then(() => {
const ids = this.selectedRows.map((v) => v.workorderId);
console.log("00000", ids);
return addProtaskList(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("生成成功");
})
.catch(() => {});
},
handleToolNumCheck(){
this.$modal
.confirm("是否检查刀具模版齐套?")
.then(() => {
const ids = this.selectedRows.map((v) => v.workorderId);
return doCheckToolNum(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("已齐套");
})
.catch(() => {});
},
handleSelectProduct() {
this.$refs.itemSelect.showFlag = true;
},
handleSelectClient() {
this.$refs.clientSelect.showFlag = true;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/pro/workorder/export",
{
...this.queryParams,
},
`workorder_${new Date().getTime()}.xlsx`
);
},
handleConfirm() {
let that = this;
this.$modal
.confirm("是确认完成工单编制?【确认后将不能更改】")
.then(function () {
that.form.status = "CONFIRMED";
that.submitForm();
});
},
handleFinish(row) {
const workorderIds = row.workorderId || this.ids;
this.$modal
.confirm("确认完成工单?一旦完成,此工单将无法继续报工")
.then(function () {
return dofinish(workorderIds); //完成工单
})
.then(() => {
this.getList();
this.$modal.msgSuccess("更改成功");
})
.catch(() => {});
},
// //物料选择弹出框
// onItemSelected(obj){
// if(obj != undefined && obj != null){
// this.form.productId = obj.itemId;
// this.form.productCode = obj.itemCode;
// this.form.productName = obj.itemName;
// this.form.productSpc = obj.specification;
// this.form.unitOfMeasure = obj.unitOfMeasure;
// }
// },
//客户选择弹出框
onClientSelected(obj) {
if (obj != undefined && obj != null) {
this.form.clientId = obj.clientId;
this.form.clientCode = obj.clientCode;
this.form.clientName = obj.clientName;
}
},
//供应商选择
handleSelectVendor() {
this.$refs.vendorSelect.showFlag = true;
},
//供应商选择弹出框
onVendorSelected(obj) {
debugger;
if (obj != undefined && obj != null) {
this.form.vendorId = obj.vendorId;
this.form.vendorCode = obj.vendorCode;
this.form.vendorName = obj.vendorName;
}
},
/** 完成任务单操作 */
confirmWorkorder(row) {
this.$modal
.confirm(
'是否将工单编号"' + row.workorderCode + '"的草稿数据项改为已确认?'
)
.then(function () {
return confirmedWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("已确认成功");
})
.catch(() => {});
},
//自动生成编码
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
genCode("WORKORDER_CODE").then((response) => {
this.form.workorderCode = response;
});
} else {
this.form.workorderCode = null;
}
},
},
handleFinish(row) {
const workorderIds = row.workorderId || this.ids;
this.$modal
.confirm("确认完成工单?一旦完成,此工单将无法继续报工")
.then(function () {
return dofinish(workorderIds); //完成工单
})
.then(() => {
this.getList();
this.$modal.msgSuccess("更改成功");
})
.catch(() => {});
},
// //物料选择弹出框
// onItemSelected(obj){
// if(obj != undefined && obj != null){
// this.form.productId = obj.itemId;
// this.form.productCode = obj.itemCode;
// this.form.productName = obj.itemName;
// this.form.productSpc = obj.specification;
// this.form.unitOfMeasure = obj.unitOfMeasure;
// }
// },
//客户选择弹出框
onClientSelected(obj) {
if (obj != undefined && obj != null) {
this.form.clientId = obj.clientId;
this.form.clientCode = obj.clientCode;
this.form.clientName = obj.clientName;
}
},
//供应商选择
handleSelectVendor() {
this.$refs.vendorSelect.showFlag = true;
},
//供应商选择弹出框
onVendorSelected(obj) {
debugger;
if (obj != undefined && obj != null) {
this.form.vendorId = obj.vendorId;
this.form.vendorCode = obj.vendorCode;
this.form.vendorName = obj.vendorName;
}
},
/** 完成任务单操作 */
confirmWorkorder(row) {
this.$modal
.confirm(
'是否将工单编号"' + row.workorderCode + '"的草稿数据项改为已确认?'
)
.then(function () {
return confirmedWorkorder(row.workorderId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("已确认成功");
})
.catch(() => {});
},
//自动生成编码
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
genCode("WORKORDER_CODE").then((response) => {
this.form.workorderCode = response;
});
} else {
this.form.workorderCode = null;
}
},
},
};
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment